/* ----- CUSTOM BRAND VARIABLES & PAPER TEXTURE (needed for brand identity & texture) ----- */
:root {
    --color-primary: #0D3B66;
    --color-secondary: #FAA916;
    --color-accent: #F4D35E;
    --color-bg-paper: #FDF9F2;
    --color-text-dark: #111827;
    --color-muted: #6B7280;
    --font-heading: 'Inter', 'Montserrat', system-ui, sans-serif;
    --font-body: 'Roboto', system-ui, sans-serif;
}
body {
    font-family: var(--font-body);
    color: var(--color-text-dark);
    background-color: #FBF7EF;
    /* PAPER TEXTURE: subtle grain/noise overlay + soft natural gradient */
    position: relative;
    background-image: 
        repeating-radial-gradient(circle at 20% 30%, rgba(0,0,0,0.008) 0px, rgba(0,0,0,0.008) 2px, transparent 2px, transparent 4px),
        linear-gradient(145deg, #FDF9F2 0%, #F9F3E6 100%);
}
/* Additional paper texture overlay (noise) for authenticity */
body::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)' opacity='0.025'/%3E%3C/svg%3E");
    background-repeat: repeat;
    opacity: 0.35;
}
/* ensure all content sits above texture */
.content-wrapper {
    position: relative;
    z-index: 2;
}
/* custom utility classes for brand colors (consistent with Tailwind layout) */
.bg-primary { background-color: var(--color-primary); }
.bg-secondary { background-color: var(--color-secondary); }
.bg-accent { background-color: var(--color-accent); }
.text-primary { color: var(--color-primary); }
.text-secondary { color: var(--color-secondary); }
.text-accent { color: var(--color-accent); }
.border-primary { border-color: var(--color-primary); }
.border-secondary { border-color: var(--color-secondary); }
.hover\:bg-primary-dark:hover { background-color: #083056; }
.btn-primary {
    background-color: var(--color-primary);
    color: white;
    transition: all 0.2s ease;
    font-weight: 600;
}
.btn-primary:hover {
    background-color: #0a2e52;
    transform: translateY(-1px);
    box-shadow: 0 8px 16px -6px rgba(13, 59, 102, 0.2);
}
.btn-outline-secondary {
    border: 1.5px solid var(--color-secondary);
    color: var(--color-secondary);
    background: transparent;
    transition: 0.2s;
    font-weight: 500;
}
.btn-outline-secondary:hover {
    background-color: var(--color-secondary);
    color: #1f2937;
    transform: translateY(-1px);
}
.btn-secondary-solid {
    background-color: var(--color-secondary);
    color: #1e1e2f;
    font-weight: 600;
    transition: all 0.2s ease;
}
.btn-secondary-solid:hover {
    background-color: #e09c14;
    transform: translateY(-2px);
    box-shadow: 0 8px 16px -6px rgba(250, 169, 22, 0.3);
}
.card-hover {
    transition: all 0.25s ease;
}
.card-hover:hover {
    transform: translateY(-6px);
    box-shadow: 0 20px 25px -12px rgba(0, 0, 0, 0.1);
}
h1, h2, h3, h4, .heading-font {
    font-family: var(--font-heading);
    font-weight: 700;
    letter-spacing: -0.02em;
}
.section-title {
    position: relative;
    display: inline-block;
}
.section-title:after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 0;
    width: 60px;
    height: 3px;
    background-color: var(--color-secondary);
    border-radius: 3px;
}
/* mobile menu smooth */
.mobile-menu-open {
    max-height: 500px;
    opacity: 1;
    visibility: visible;
}

p {
    word-break: break-all;
    overflow-wrap: break-word;
}

.prose iframe,
.prose video {
    width: 100% !important;
    aspect-ratio: 16 / 9;
    height: auto !important;
    border-radius: 1rem;
}

.post-content p { margin-bottom: 1rem; }
.post-content h2 { font-size: 1.5rem; font-weight: 700; margin-top: 1.5rem; margin-bottom: 0.75rem; }
.post-content h3 { font-size: 1.25rem; font-weight: 600; margin-top: 1.25rem; margin-bottom: 0.5rem; }
.post-content ul { list-style-type: disc; padding-left: 1.5rem; margin-bottom: 1rem; }
.post-content ol { list-style-type: decimal; padding-left: 1.5rem; margin-bottom: 1rem; }


/* Sidebar Styles */

/* Mobile sidebar toggle styles */
.archive-sidebar-toggle {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    z-index: 1000;
    width: 56px;
    height: 56px;
    border-radius: 9999px;
    background: var(--color-primary, #0D3B66);
    color: white;
    border: none;
    box-shadow: 0 8px 30px rgba(13, 59, 102, 0.3);
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    cursor: pointer;
    transition: transform 0.2s, background 0.2s;
}
.archive-sidebar-toggle:hover {
    transform: scale(1.05);
    background: #0a2e52;
}
.archive-sidebar-toggle:active {
    transform: scale(0.95);
}

/* Sidebar overlay (mobile) */
.archive-sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 900;
    background: rgba(0, 0, 0, 0.3);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}
.archive-sidebar-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

/* Sidebar panel */
.archive-sidebar {
    position: relative;
    /* default: static in flow on desktop */
}

/* On mobile, we make it fixed and slide from left */
@media (max-width: 1023px) {
    .archive-sidebar-toggle {
        display: flex;
    }

    .archive-sidebar-overlay {
        display: block;
    }

    .archive-sidebar {
        position: fixed;
        top: 0;
        left: 0;
        width: 320px;
        max-width: 85vw;
        height: 100%;
        z-index: 1000;
        background: #fff;
        overflow-y: auto;
        transform: translateX(-100%);
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        box-shadow: 4px 0 30px rgba(0, 0, 0, 0.08);
        padding: 1.5rem 1.25rem 2rem;
        display: block !important; /* override any flex */
    }

    .archive-sidebar.open {
        transform: translateX(0);
    }

    /* Hide the sticky behavior on mobile */
    .archive-sidebar .sticky {
        position: static !important;
    }

    /* Close button inside sidebar (mobile) */
    .archive-sidebar-close {
        display: flex !important;
    }
}

@media (min-width: 1024px) {
    .archive-sidebar-close {
        display: none !important;
    }
    .archive-sidebar-overlay {
        display: none !important;
    }
    .archive-sidebar-toggle {
        display: none !important;
    }
}

.archive-sidebar-close {
    display: none;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 9999px;
    background: #f3f4f6;
    border: none;
    cursor: pointer;
    color: #4b5563;
    transition: background 0.2s;
    margin-left: auto;
    margin-bottom: 0.5rem;
}
.archive-sidebar-close:hover {
    background: #e5e7eb;
}