@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500;700&family=Playfair+Display:ital,wght@0,400;0,600;0,700;1,400&display=swap');

:root {
    --font-serif: 'Playfair Display', serif;
    --font-mono: 'JetBrains Mono', monospace;
    --color-bg: #fdfdfd;
    --color-text: #1a1a1a;
    --color-black: #000000;
    --color-white: #ffffff;
    --color-gray: #f5f5f5;
    --color-border: #e0e0e0;
}

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

body {
    font-family: var(--font-serif);
    background-color: var(--color-bg);
    color: var(--color-text);
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Typography elements */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-serif);
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--color-black);
}

a {
    color: inherit;
    text-decoration: none;
    transition: all 0.2s ease;
}

/* Header */
.site-header {
    position: sticky;
    top: 0;
    background: rgba(255, 255, 255, 0.95);
    border-bottom: 1px solid var(--color-border);
    z-index: 1000;
    backdrop-filter: blur(10px);
}

.header-inner {
    max-width: 1200px;
    margin: 0 auto;
    height: 89px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 2rem;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-icon-img {
    height: 48px;
    width: auto;
    object-fit: contain;
}

.logo-text {
    font-family: var(--font-serif);
    font-size: 24px;
    font-weight: 600;
    color: var(--color-black);
}

.nav-links {
    display: flex;
    gap: 30px;
    align-items: center;
}

.nav-link {
    font-family: var(--font-mono);
    font-size: 11.5px;
    text-transform: uppercase;
    letter-spacing: 0.92px;
    color: var(--color-black);
    position: relative;
}

.nav-link:hover {
    color: #666;
}

.nav-link.has-badge::after {
    content: "OSINT";
    position: absolute;
    top: -12px;
    right: -10px;
    font-size: 8px;
    font-family: var(--font-mono);
    color: var(--color-black);
    font-weight: bold;
}

/* Main Container */
.main-content {
    flex: 1;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
    padding: 4rem 2rem;
}

/* Cards (Home Page) */
.acts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.act-card {
    background: var(--color-white);
    border: 1px solid var(--color-border);
    padding: 2rem;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    display: flex;
    flex-direction: column;
}

.act-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.05);
}

.act-card h2 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.act-card p {
    font-family: var(--font-mono);
    font-size: 13px;
    color: #666;
    margin-bottom: 1.5rem;
    flex: 1;
}

.act-card .btn {
    align-self: flex-start;
    font-family: var(--font-mono);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
    border: 1px solid var(--color-black);
    padding: 8px 16px;
    color: var(--color-black);
}

.act-card .btn:hover {
    background: var(--color-black);
    color: var(--color-white);
}

/* Sections List (Act Page) */
.act-header {
    margin-bottom: 3rem;
    border-bottom: 1px solid var(--color-border);
    padding-bottom: 2rem;
}

.act-header p {
    font-family: var(--font-mono);
    color: #444;
    margin-top: 1rem;
}

.sections-list {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
}

.section-item {
    border: 1px solid var(--color-border);
    padding: 1rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--color-white);
}

.section-item:hover {
    background: var(--color-gray);
}

.section-item h4 {
    margin-bottom: 0;
    font-size: 1.1rem;
}

.section-item .sec-number {
    font-family: var(--font-mono);
    font-size: 12px;
    color: #888;
}

/* Section Detail View */
.section-detail {
    max-width: 800px;
    margin: 0 auto;
    background: var(--color-white);
    padding: 3rem;
    border: 1px solid var(--color-border);
}

.section-meta {
    font-family: var(--font-mono);
    font-size: 12px;
    text-transform: uppercase;
    color: #888;
    margin-bottom: 1rem;
    display: block;
}

.section-content {
    font-size: 1.2rem;
    line-height: 1.8;
    color: #333;
    margin-top: 2rem;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: var(--font-mono);
    font-size: 12px;
    text-transform: uppercase;
    margin-bottom: 2rem;
    color: var(--color-black);
}

.back-link:hover {
    text-decoration: underline;
}

/* Chapter / Part Dividers */
.chapter-divider {
    background: var(--color-black);
    color: var(--color-white);
    padding: 14px 20px;
    margin: 8px 0;
    border-radius: 4px;
    font-family: var(--font-mono);
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 1.5px;
    text-transform: uppercase;
}

.chapter-divider span {
    display: block;
}

/* Preamble Section */
.preamble-section {
    background: linear-gradient(135deg, #1a1a2e, #16213e);
    color: var(--color-white);
    padding: 3rem 2rem;
    margin-bottom: 2rem;
    border-radius: 6px;
    font-family: var(--font-serif);
    font-size: 1.15rem;
    line-height: 2;
    text-align: justify;
    border-left: 4px solid #e2b659;
}

.preamble-section h3 {
    font-family: var(--font-serif);
    font-size: 1.4rem;
    margin-bottom: 1.5rem;
    color: #e2b659;
    letter-spacing: 2px;
    text-transform: uppercase;
}

/* Schedule Items */
.schedule-item {
    border-left: 3px solid var(--color-black) !important;
}

/* Footer */
.site-footer {
    background: var(--color-black);
    color: var(--color-white);
    margin-top: auto;
}

.footer-top {
    padding: 5rem 2rem;
    text-align: center;
    background: var(--color-black);
}

.footer-top h2 {
    color: var(--color-white);
    font-size: 2.5rem;
    margin-bottom: 2rem;
}

.btn-outline-light {
    display: inline-block;
    border: 1px solid var(--color-white);
    color: var(--color-white);
    padding: 12px 24px;
    font-family: var(--font-mono);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.btn-outline-light:hover {
    background: var(--color-white);
    color: var(--color-black);
}

.footer-middle {
    background: var(--color-gray);
    color: var(--color-black);
    padding: 4rem 2rem;
    text-align: center;
}

.footer-middle h3 {
    font-family: var(--font-serif);
    font-size: 1.8rem;
    margin-bottom: 1rem;
}

.newsletter-form {
    max-width: 400px;
    margin: 0 auto;
    display: flex;
    gap: 10px;
}

.newsletter-form input {
    flex: 1;
    padding: 12px;
    border: 1px solid var(--color-border);
    font-family: var(--font-mono);
}

.newsletter-form button {
    padding: 12px 24px;
    background: var(--color-black);
    color: var(--color-white);
    border: none;
    font-family: var(--font-mono);
    text-transform: uppercase;
    cursor: pointer;
}

.footer-bottom {
    background: var(--color-white);
    color: var(--color-black);
    padding: 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid var(--color-border);
}

.footer-copy {
    font-family: var(--font-mono);
    font-size: 11px;
    color: #666;
}

.footer-links {
    display: flex;
    gap: 20px;
}

.footer-links a {
    font-family: var(--font-mono);
    font-size: 11px;
    text-transform: uppercase;
}

.hamburger-menu {
    display: none;
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--color-black);
}

@media (max-width: 768px) {
    .header-inner {
        flex-direction: row;
        flex-wrap: wrap;
        height: auto;
        padding: 1rem;
        justify-content: space-between;
    }
    .hamburger-menu {
        display: block;
    }
    .nav-links {
        display: none;
        width: 100%;
        flex-direction: column;
        gap: 15px;
        padding-top: 15px;
        margin-top: 10px;
        border-top: 1px solid var(--color-border);
    }
    .nav-links.active {
        display: flex;
    }
    
    .acts-grid {
        grid-template-columns: 1fr;
    }
    .act-card h2 {
        font-size: 1.25rem;
    }
    .act-card p {
        font-size: 12px;
    }
    .act-card .btn {
        font-size: 10px;
    }

    .footer-top {
        padding: 3rem 1.5rem;
    }
    .footer-top h2 {
        font-size: 1.8rem;
    }
    .footer-middle {
        padding: 3rem 1.5rem;
    }
    .newsletter-form {
        flex-direction: column;
    }
    .footer-bottom {
        flex-direction: column;
        gap: 1.5rem;
        text-align: center;
    }
    .footer-links {
        flex-wrap: wrap;
        justify-content: center;
        gap: 15px;
    }

    .section-detail {
        padding: 1.5rem;
    }
    .section-content {
        font-size: 1.05rem;
    }
}

/* A-Z Act List Items */
.act-list-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
    border-bottom: 1px solid #f0f0f0;
    transition: all 0.15s ease;
    color: var(--color-text);
}

.act-list-item:hover {
    background: #f8f8f8;
    padding-left: 28px;
}

.act-list-title {
    font-family: var(--font-serif);
    font-size: 1rem;
}

.act-list-arrow {
    font-family: var(--font-mono);
    font-size: 14px;
    color: #999;
    transition: transform 0.15s ease, color 0.15s ease;
}

.act-list-item:hover .act-list-arrow {
    transform: translateX(4px);
    color: #333;
}

/* Nav Dropdown Logic */
.dropdown {
    position: relative;
    display: inline-block;
}
.dropdown-content {
    display: none;
    position: absolute;
    background-color: #fff;
    min-width: 220px;
    box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.1);
    z-index: 1;
    border: 1px solid #eaeaea;
    border-radius: 4px;
    top: 100%;
    left: 0;
}
.dropdown-content a {
    color: #333;
    padding: 12px 16px;
    text-decoration: none;
    display: block;
    font-size: 0.85rem;
    font-family: var(--font-mono);
    border-bottom: 1px solid #f5f5f5;
}
.dropdown-content a:hover {
    background-color: #f9f9f9;
}
.dropdown:hover .dropdown-content {
    display: block;
}

/* Global Navigation Search */
.nav-search-container {
    position: relative;
    display: inline-block;
    margin-left: 1rem;
}
.nav-search-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-color);
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 0;
}
.nav-search-btn:hover {
    color: #000;
}
.header-search-bar {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    min-width: 250px;
    margin-top: 10px;
    background: #fff;
    border: 1px solid #ccc;
    padding: 8px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    border-radius: 4px;
    z-index: 1000;
}
.header-search-bar.active {
    display: block;
}
.header-search-bar input {
    width: 100%;
    border: 1px solid #eaeaea;
    padding: 8px;
    outline: none;
    border-radius: 3px;
    font-family: var(--font-mono);
}

/* Mobile Drawer Logic */
.mobile-drawer {
    position: fixed;
    top: 0;
    right: -300px;
    width: 300px;
    height: 100%;
    background-color: #fff;
    box-shadow: -5px 0 15px rgba(0,0,0,0.1);
    z-index: 10001;
    transition: right 0.3s ease;
    overflow-y: auto;
}
.mobile-drawer.active {
    right: 0;
}
.drawer-content {
    padding: 2rem 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
}
.drawer-link {
    text-decoration: none;
    color: #333;
    font-weight: 600;
    font-size: 1.1rem;
    font-family: var(--font-mono);
    border-bottom: 1px solid #eaeaea;
    padding-bottom: 0.5rem;
}
.drawer-link.sub-link {
    font-weight: 400;
    font-size: 0.95rem;
    padding-left: 1rem;
    border-bottom: none;
}
.drawer-heading {
    font-family: var(--font-mono);
    color: #999;
    font-size: 0.8rem;
    letter-spacing: 1px;
    margin-bottom: -10px;
    margin-top: 10px;
}
.close-drawer {
    position: absolute;
    top: 10px;
    right: 15px;
    background: none;
    border: none;
    font-size: 2rem;
    cursor: pointer;
    color: #333;
}
.drawer-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.4);
    z-index: 10000;
    display: none;
}
.drawer-overlay.active {
    display: block;
}

/* Hide desktop nav on mobile, show hamburger */
@media (max-width: 768px) {
    .desktop-nav {
        display: none !important;
    }
    .hamburger-menu {
        display: block;
    }
}

/* Autocomplete Search Dropdown Elements */
.autocomplete-dropdown {
    position: absolute;
    background: #fff;
    border: 1px solid #eaeaea;
    max-height: 250px;
    overflow-y: auto;
    width: 100%;
    z-index: 1000;
    box-shadow: 0px 4px 6px rgba(0,0,0,0.1);
    list-style: none;
    margin: 0;
    padding: 0;
    border-radius: 0 0 6px 6px;
    top: 100%;
    left: 0;
    display: none;
}
.autocomplete-dropdown li {
    font-size: 0.9rem;
    font-family: var(--font-mono);
    border-bottom: 1px solid #f9f9f9;
}
.autocomplete-dropdown li:last-child {
    border-bottom: none;
}
.autocomplete-dropdown li a {
    display: block;
    padding: 10px 15px;
    text-decoration: none;
    color: #333;
    transition: background 0.1s ease;
}
.autocomplete-dropdown li a:hover {
    background-color: #f5f5f5;
    color: #000;
}

/* ── Previous / Next Section Navigation ─────────────────────────────────── */
.section-nav {
    margin-top: 3rem;
    border-top: 1px solid var(--color-border);
    padding-top: 1.5rem;
}

.section-nav-inner {
    display: flex;
    align-items: stretch;
    gap: 1rem;
}

.section-nav-btn {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.1rem 1.4rem;
    border: 1px solid var(--color-border);
    background: var(--color-white);
    color: var(--color-black);
    text-decoration: none;
    transition: background 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
    min-width: 0;
}

.section-nav-btn:hover {
    background: var(--color-black);
    color: var(--color-white);
    border-color: var(--color-black);
    transform: translateY(-2px);
}

.section-nav-btn.section-nav-disabled {
    pointer-events: none;
    opacity: 0;
}

.section-nav-prev {
    justify-content: flex-start;
}

.section-nav-next {
    justify-content: flex-end;
}

.section-nav-arrow {
    font-size: 1.3rem;
    flex-shrink: 0;
    line-height: 1;
    font-family: var(--font-mono);
}

.section-nav-details {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.section-nav-prev .section-nav-details {
    text-align: left;
}

.section-nav-next .section-nav-details {
    text-align: right;
}

.section-nav-label {
    font-family: var(--font-mono);
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: #888;
    margin-bottom: 3px;
    display: block;
}

.section-nav-btn:hover .section-nav-label {
    color: rgba(255,255,255,0.65);
}

.section-nav-title {
    font-family: var(--font-serif);
    font-size: 0.92rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
    max-width: 300px;
}

.section-nav-index {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 48px;
    height: auto;
    border: 1px solid var(--color-border);
    background: var(--color-white);
    color: var(--color-black);
    font-size: 1.1rem;
    text-decoration: none;
    transition: background 0.18s ease, color 0.18s ease;
}

.section-nav-index:hover {
    background: var(--color-black);
    color: var(--color-white);
    border-color: var(--color-black);
}

@media (max-width: 768px) {
    .section-nav-inner {
        flex-direction: column;
    }
    .section-nav-index {
        width: 100%;
        padding: 0.8rem;
    }
    .section-nav-title {
        max-width: 100%;
        white-space: normal;
    }
    .section-nav-next .section-nav-details {
        text-align: left;
    }
    .section-nav-next {
        flex-direction: row-reverse;
        justify-content: flex-end;
    }
}
