/* =====================================================
   OWASP Sofia — Shared Styles
   Used by: index.html, policies.html
   ===================================================== */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --owasp-header: rgb(152, 175, 199);
    --owasp-header-dark: rgb(120, 145, 172);
    --owasp-dark: #233040;
    --owasp-text: #2d3748;
    --owasp-text-light: #4a5568;
    --owasp-bg: #ffffff;
    --owasp-bg-alt: #f7f8fa;
    --owasp-border: #e2e8f0;
    --owasp-accent: #4a90d9;
    --owasp-accent-hover: #3a7bc8;
}

html { scroll-behavior: smooth; }

body {
    font-family: 'Roboto', sans-serif;
    font-weight: 400;
    color: var(--owasp-text);
    line-height: 1.6;
    background: var(--owasp-bg);
}

a { color: var(--owasp-accent); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--owasp-accent-hover); text-decoration: underline; }

.container { max-width: 1100px; margin: 0 auto; padding: 0 24px; }

/* ===== SVG Icons ===== */
.icon-svg { width: 20px; height: 20px; fill: currentColor; vertical-align: middle; }
.icon-svg-sm { width: 16px; height: 16px; fill: currentColor; vertical-align: middle; }

/* ===== Header / Nav ===== */
header {
    background: var(--owasp-header);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}
.header-inner {
    display: flex; align-items: center; justify-content: space-between;
    padding: 0 24px; max-width: 1100px; margin: 0 auto; height: 64px;
}
.logo-area { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.logo-area img { height: 40px; width: auto; }
.logo-area span {
    font-weight: 700; font-size: 1.1rem; color: #fff; letter-spacing: 0.5px;
}
nav { display: flex; gap: 4px; }
nav a {
    color: rgb(35, 48, 64); font-weight: 500; font-size: 0.9rem;
    padding: 8px 14px; border-radius: 6px;
    transition: background 0.2s, color 0.2s; text-decoration: none;
    display: inline-flex; align-items: center; gap: 6px;
}
nav a svg { width: 14px; height: 14px; opacity: 0.85; }
nav a:hover { background: rgba(35,48,64,0.15); color: rgb(20, 30, 42); text-decoration: none; }
.nav-toggle { display: none; background: none; border: none; cursor: pointer; padding: 8px; }
.nav-toggle span { display: block; width: 24px; height: 2px; background: #fff; margin: 5px 0; }

/* ===== Buttons ===== */
.btn {
    display: inline-block; padding: 12px 28px; border-radius: 6px;
    font-weight: 500; font-size: 0.95rem; transition: all 0.2s;
    text-decoration: none; cursor: pointer; border: none;
}
.btn-primary { background: var(--owasp-accent); color: #fff; }
.btn-primary:hover { background: var(--owasp-accent-hover); color: #fff; text-decoration: none; }
.btn-outline { border: 2px solid var(--owasp-header); color: var(--owasp-header); background: rgba(35, 48, 64, 0.7); }
.btn-outline:hover { background: var(--owasp-header); color: var(--owasp-dark); text-decoration: none; }
.btn-glow {
    box-shadow: 0 0 0 0 rgba(74, 144, 217, 0.6);
    animation: pulse-glow 2s infinite;
}
.btn-glow:hover { animation: none; }
@keyframes pulse-glow {
    0%   { box-shadow: 0 0 0 0 rgba(74, 144, 217, 0.5); }
    70%  { box-shadow: 0 0 0 10px rgba(74, 144, 217, 0); }
    100% { box-shadow: 0 0 0 0 rgba(74, 144, 217, 0); }
}

/* ===== Section headings ===== */
.section-title { font-size: 1.8rem; font-weight: 700; margin-bottom: 12px; color: var(--owasp-dark); }
.section-desc { color: var(--owasp-text-light); margin-bottom: 40px; max-width: 650px; }

/* ===== Leaders / Екип ===== */
.leaders-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 220px));
    gap: 24px; justify-content: center;
}
.leader-card {
    background: #fff; border: 1px solid var(--owasp-border); border-radius: 10px;
    padding: 28px; text-align: center;
}
.leader-icon {
    width: 64px; height: 64px; border-radius: 50%;
    background: var(--owasp-header); margin: 0 auto 16px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.3rem; color: #fff; font-weight: 700;
}
.leader-card h3 { font-size: 1rem; font-weight: 700; color: var(--owasp-dark); margin-bottom: 4px; }
.leader-card p { font-size: 0.85rem; color: var(--owasp-text-light); margin-bottom: 12px; }
.leader-links { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.leader-links a {
    display: inline-flex; align-items: center; justify-content: center;
    width: 36px; height: 36px; border-radius: 50%;
    background: var(--owasp-bg-alt); color: var(--owasp-text-light);
    transition: all 0.2s; text-decoration: none;
}
.leader-links a:hover { background: var(--owasp-accent); color: #fff; text-decoration: none; }

/* ===== Partners / Приятелски организации ===== */
.partners-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.partner-card {
    background: #fff; border: 1px solid var(--owasp-border); border-radius: 10px;
    padding: 24px; transition: box-shadow 0.2s;
    text-decoration: none; color: inherit;
}
.partner-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,0.08); text-decoration: none; }
.partner-card h3 { font-size: 0.95rem; font-weight: 700; color: var(--owasp-dark); margin-bottom: 6px; }
.partner-card p { font-size: 0.82rem; color: var(--owasp-text-light); line-height: 1.5; }

/* ===== Contacts ===== */
.contact-links { display: grid; grid-template-columns: repeat(6, 1fr); gap: 16px; }
.contact-card {
    background: #fff; border: 1px solid var(--owasp-border);
    border-radius: 10px; padding: 24px; text-align: center;
    transition: box-shadow 0.2s; text-decoration: none; color: inherit;
}
.contact-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,0.08); text-decoration: none; }
.contact-card .icon { font-size: 2rem; margin-bottom: 12px; }
.contact-card h3 { font-size: 1rem; font-weight: 700; margin-bottom: 4px; color: var(--owasp-dark); }
.contact-card p { font-size: 0.85rem; color: var(--owasp-text-light); }

/* ===== Subscribe ===== */
.subscribe-card {
    background: linear-gradient(135deg, var(--owasp-dark) 0%, #1a2530 100%);
    color: #fff; border-radius: 12px;
    padding: 40px 32px; text-align: center;
}
.subscribe-card h2 { color: #fff; font-size: 1.6rem; font-weight: 700; margin-bottom: 8px; }
.subscribe-card p {
    color: #cbd5e0; max-width: 560px; margin: 0 auto 24px;
    font-size: 0.95rem; line-height: 1.7;
}
form.htc-subscribe {
    display: flex; gap: 8px; max-width: 480px; margin: 0 auto;
    flex-wrap: wrap; justify-content: center;
}
form.htc-subscribe input[type="email"] {
    flex: 1; min-width: 220px;
    padding: 12px 16px; border-radius: 6px; border: 1px solid rgba(255,255,255,0.2);
    background: rgba(255,255,255,0.08); color: #fff;
    font-family: 'Roboto', sans-serif; font-size: 0.95rem;
}
form.htc-subscribe input[type="email"]::placeholder { color: rgba(255,255,255,0.5); }
form.htc-subscribe input[type="email"]:focus {
    outline: none; border-color: var(--owasp-accent);
    background: rgba(255,255,255,0.12);
}
form.htc-subscribe button {
    padding: 12px 24px; border-radius: 6px; border: none;
    background: var(--owasp-accent); color: #fff;
    font-family: 'Roboto', sans-serif; font-size: 0.95rem; font-weight: 500;
    cursor: pointer; transition: background 0.2s;
}
form.htc-subscribe button:hover { background: var(--owasp-accent-hover); }
form.htc-subscribe button:disabled { opacity: 0.6; cursor: not-allowed; }
form.htc-subscribe .htc-msg {
    display: block; width: 100%; margin-top: 12px;
    font-size: 0.85rem; min-height: 1.2em;
}

/* ===== Footer ===== */
footer { background: var(--owasp-dark); color: #a0aec0; padding: 40px 0; font-size: 0.85rem; }
.footer-inner { display: flex; justify-content: space-between; align-items: start; flex-wrap: wrap; gap: 16px; }
footer a { color: var(--owasp-header); }
footer a:hover { color: #fff; }
.footer-social { display: flex; gap: 16px; align-items: center; }
.footer-social a {
    display: inline-flex; align-items: center; justify-content: center;
    width: 32px; height: 32px; border-radius: 50%;
    background: rgba(255,255,255,0.1); color: var(--owasp-header);
    transition: all 0.2s; text-decoration: none;
}
.footer-social a:hover { background: var(--owasp-accent); color: #fff; text-decoration: none; }

/* ===== Responsive (shared) ===== */
@media (max-width: 768px) {
    .nav-toggle { display: block; }
    nav {
        display: none; position: absolute; top: 64px; left: 0; right: 0;
        background: var(--owasp-header); flex-direction: column; padding: 16px;
        box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    }
    nav.open { display: flex; }
    nav a { padding: 12px 16px; }
    .footer-inner { flex-direction: column; text-align: center; }
    .footer-social { justify-content: center; }
    .contact-links { grid-template-columns: repeat(3, 1fr); }
    .partners-grid { grid-template-columns: repeat(2, 1fr); }
    .leaders-grid { grid-template-columns: 1fr; max-width: 320px; margin: 0 auto; }
    .leader-links { flex-wrap: wrap; }
}

/* =====================================================
   Page-specific: index.html
   ===================================================== */

/* ===== Page-specific (index.html) ===== */

/* Hero */
.hero {
    background: var(--owasp-dark) url('bg.jpg') center center / cover no-repeat;
    color: #fff;
    padding: 80px 24px;
    position: relative;
}
.hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at center, rgba(35,48,64,0.85) 0%, rgba(35,48,64,0.7) 100%);
}
.hero > .container { position: relative; z-index: 1; }

.hero-grid {
    display: grid;
    grid-template-columns: 1.4fr 1fr;
    gap: 40px;
    align-items: center;
}
.hero-text h1 {
    font-size: 2.6rem;
    font-weight: 700;
    margin-bottom: 16px;
    line-height: 1.2;
    color: #fff;
}
.hero-text h1 span { color: var(--owasp-header); }
.hero-text p {
    font-size: 1.02rem;
    line-height: 1.8;
    color: #cbd5e0;
    margin-bottom: 32px;
    background: rgba(35, 48, 64, 0.7);
    padding: 20px 24px;
    border-radius: 10px;
    border: 1px solid rgba(255,255,255,0.1);
}
.hero-buttons { display: flex; gap: 10px; flex-wrap: wrap; }
.hero-buttons .btn {
    padding: 10px 16px; font-size: 0.85rem; white-space: nowrap;
    display: inline-flex; align-items: center; gap: 8px;
}
.hero-buttons .btn svg { width: 16px; height: 16px; flex-shrink: 0; }

.hero-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}
.hero-stat {
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 10px;
    padding: 24px;
}
.hero-stat .number {
    font-size: 2rem;
    font-weight: 700;
    color: var(--owasp-header);
    line-height: 1;
    margin-bottom: 6px;
}
.hero-stat .label {
    font-size: 0.85rem;
    color: #90a4ae;
    font-weight: 400;
}

/* Sections with alternating bg */
section { padding: 64px 0; }
section:nth-child(even) { background: var(--owasp-bg-alt); }

/* About Grid */
.about-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; }
.about-card { background: #fff; border: 1px solid var(--owasp-border); border-radius: 10px; padding: 32px; }
.about-card h3 { font-size: 1.15rem; font-weight: 700; margin-bottom: 12px; color: var(--owasp-dark); }
.about-card p, .about-card li { color: var(--owasp-text-light); font-size: 0.95rem; line-height: 1.7; }
.about-card ul { list-style: none; padding: 0; }
.about-card ul li { padding: 6px 0 6px 20px; position: relative; }
.about-card ul li::before { content: "\2022"; color: var(--owasp-accent); font-weight: 700; position: absolute; left: 0; }

/* Video embed */
.video-embed {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    overflow: hidden;
    border-radius: 10px;
    border: 1px solid var(--owasp-border);
    background: #000;
    margin-bottom: 16px;
}
.video-embed iframe {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    border: 0;
}
.video-wrap { margin: 0 0 40px; }
.video-meta {
    text-align: right;
    margin-bottom: 0;
    font-size: 0.9rem;
}
.video-meta a { font-weight: 500; }

/* Events Table */
.events-table {
    width: 100%; border-collapse: collapse; background: #fff;
    border-radius: 10px; overflow: hidden; border: 1px solid var(--owasp-border);
}
.events-table thead { background: var(--owasp-header); color: #fff; }
.events-table th { padding: 14px 16px; text-align: left; font-weight: 500; font-size: 0.9rem; }
.events-table td { padding: 12px 16px; font-size: 0.9rem; border-bottom: 1px solid var(--owasp-border); vertical-align: top; }
.events-table tbody tr:hover { background: #f0f4f8; }
.events-table .year-row td {
    background: var(--owasp-dark); color: #fff; font-weight: 700; font-size: 1rem;
    padding: 10px 16px; cursor: pointer; user-select: none;
    transition: background 0.2s;
}
.events-table .year-row td:hover { background: #1a2530; }
.events-table .year-row td::after {
    content: '\25BC';
    float: right;
    font-size: 0.75rem;
    transition: transform 0.2s;
}
.events-table .year-row.collapsed td::after { transform: rotate(-90deg); }
.events-table tr.event-hidden { display: none; }

.badge {
    display: inline-block; padding: 3px 10px; border-radius: 12px;
    font-size: 0.75rem; font-weight: 500; text-decoration: none;
}
.badge-video { background: #e6f4ea; color: #1a7f37; }
.badge-video:hover { background: #d0e8d4; text-decoration: none; }
.badge-slides { background: #e8f0fe; color: #1a56db; }
.badge-slides:hover { background: #d0e0f8; text-decoration: none; }

.author-link { color: var(--owasp-text); text-decoration: none; }
.author-link:hover { color: var(--owasp-accent); text-decoration: underline; }
.author-link .icon-svg-sm { opacity: 0.5; margin-left: 3px; }
.author-link:hover .icon-svg-sm { opacity: 1; }

/* Resources Grid */
.resources-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 24px; }
.resource-card {
    background: #fff; border: 1px solid var(--owasp-border); border-radius: 10px;
    padding: 28px; transition: box-shadow 0.2s, transform 0.2s;
}
.resource-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,0.08); transform: translateY(-2px); }
.resource-card h3 { font-size: 1.05rem; font-weight: 700; margin-bottom: 8px; color: var(--owasp-dark); }
.resource-card p { font-size: 0.9rem; color: var(--owasp-text-light); margin-bottom: 12px; line-height: 1.6; }
.resource-card .link { font-size: 0.85rem; font-weight: 500; }

.lang-badge { display: inline-block; padding: 3px 10px; border-radius: 4px; font-size: 0.75rem; font-weight: 500; margin-right: 8px; }
.lang-bg { background: #e8f5e9; color: #2e7d32; }
.lang-en { background: #e3f2fd; color: #1565c0; }

/* Accordion (Top 10) */
.accordion { }
.accordion-item {
    border: 1px solid var(--owasp-border);
    border-radius: 10px;
    margin-bottom: 8px;
    background: #fff;
    overflow: hidden;
}
.accordion-header {
    width: 100%;
    background: none;
    border: none;
    padding: 16px 20px;
    font-family: 'Roboto', sans-serif;
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--owasp-dark);
    text-align: left;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: background 0.2s;
}
.accordion-header:hover { background: var(--owasp-bg-alt); }
.accordion-header .acc-code {
    background: var(--owasp-header);
    color: #fff;
    padding: 3px 10px;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 700;
    flex-shrink: 0;
}
.accordion-header .acc-arrow {
    margin-left: auto;
    transition: transform 0.2s;
    font-size: 0.8rem;
    color: var(--owasp-text-light);
}
.accordion-item.open .acc-arrow { transform: rotate(180deg); }
.accordion-body {
    display: none;
    padding: 0 20px 16px 20px;
    font-size: 0.9rem;
    color: var(--owasp-text-light);
    line-height: 1.7;
}
.accordion-item.open .accordion-body { display: block; }
.accordion-body a { font-size: 0.85rem; }

/* Responsive */
@media (max-width: 768px) {
    .hero h1 { font-size: 2rem; }
    .hero { padding: 48px 24px; }
    .hero-grid { grid-template-columns: 1fr; gap: 32px; }
    .hero-stats { grid-template-columns: 1fr 1fr; }
    .about-grid { grid-template-columns: 1fr; }
    .events-table { font-size: 0.8rem; }
    .events-table th, .events-table td { padding: 8px 10px; }
}

/* =====================================================
   Page-specific: policies.html
   ===================================================== */

/* ===== Page-specific (policies.html) ===== */

/* Page Hero */
.page-hero {
    background: var(--owasp-dark);
    color: #fff;
    padding: 60px 24px;
}
.page-hero h1 { font-size: 2.2rem; font-weight: 700; margin-bottom: 8px; }
.page-hero .breadcrumb {
    font-size: 0.85rem; color: var(--owasp-header); margin-bottom: 16px;
}
.page-hero .breadcrumb a { color: var(--owasp-header); }
.page-hero p { color: #cbd5e0; max-width: 720px; font-size: 1rem; }

/* Content Layout */
.content-layout {
    display: grid;
    grid-template-columns: 240px 1fr;
    gap: 48px;
    padding: 56px 0;
}

/* TOC Sidebar */
.toc {
    position: sticky;
    top: 88px;
    align-self: start;
    font-size: 0.9rem;
}
.toc-title {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--owasp-text-light);
    font-weight: 700;
    margin-bottom: 12px;
}
.toc ul { list-style: none; padding: 0; }
.toc li { margin: 2px 0; }
.toc a {
    display: block;
    padding: 8px 12px;
    border-left: 3px solid transparent;
    color: var(--owasp-text-light);
    font-weight: 500;
    border-radius: 0 6px 6px 0;
    transition: all 0.2s;
}
.toc a:hover, .toc a.active {
    background: var(--owasp-bg-alt);
    border-left-color: var(--owasp-accent);
    color: var(--owasp-dark);
    text-decoration: none;
}

/* Article */
article { max-width: 760px; }
article > p:first-of-type { font-size: 1.05rem; color: var(--owasp-text-light); }
article h2 {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--owasp-dark);
    margin: 56px 0 16px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--owasp-border);
    scroll-margin-top: 88px;
}
article h2:first-of-type { margin-top: 0; }
article h3 {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--owasp-dark);
    margin: 32px 0 12px;
}
article p { margin: 12px 0; color: var(--owasp-text); }
article ul, article ol { margin: 12px 0; padding-left: 24px; }
article li { margin: 6px 0; color: var(--owasp-text); }
article li strong { color: var(--owasp-dark); }
article hr {
    border: none;
    border-top: 1px solid var(--owasp-border);
    margin: 48px 0;
}
article blockquote {
    border-left: 4px solid var(--owasp-accent);
    padding: 12px 20px;
    margin: 20px 0;
    background: var(--owasp-bg-alt);
    color: var(--owasp-text-light);
    font-style: italic;
    border-radius: 0 8px 8px 0;
}
article table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
    font-size: 0.9rem;
    background: #fff;
    border: 1px solid var(--owasp-border);
    border-radius: 10px;
    overflow: hidden;
}
article table thead { background: var(--owasp-header); color: #fff; }
article table th { padding: 12px 14px; text-align: left; font-weight: 500; }
article table td { padding: 10px 14px; border-bottom: 1px solid var(--owasp-border); vertical-align: top; }
article table tbody tr:last-child td { border-bottom: none; }
article table tbody tr:hover { background: var(--owasp-bg-alt); }
article .meta-note {
    font-size: 0.85rem;
    color: var(--owasp-text-light);
    font-style: italic;
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid var(--owasp-border);
}

/* Community sections (Екип, Партньори, Абонамент, Контакти) */
section.community-section { padding: 64px 0; border-top: 1px solid var(--owasp-border); }
section.community-section:nth-of-type(even) { background: var(--owasp-bg-alt); }

/* Responsive */
@media (max-width: 900px) {
    .content-layout { grid-template-columns: 1fr; gap: 24px; padding: 32px 0; }
    .toc { position: static; }
    .toc ul { display: flex; flex-wrap: wrap; gap: 4px; }
    .toc li { margin: 0; }
    .toc a { padding: 6px 12px; border-left: none; border: 1px solid var(--owasp-border); border-radius: 20px; font-size: 0.8rem; }
    .toc a:hover, .toc a.active { border-color: var(--owasp-accent); background: var(--owasp-accent); color: #fff; }
}
@media (max-width: 768px) {
    .page-hero h1 { font-size: 1.6rem; }
}
