@font-face {
    font-family: 'Sabrina';
    src: url('/fonts/SabrinaSerif.ttf') format('truetype');
}

/* ========================================
   CSS VARIABLES - Single Source of Truth
   ======================================== */
:root {
    /* Colors */
    --color-black: #000000;
    --color-white: #ffffff;
    --color-grey: grey;
    --color-grey-dark: #222;
    --color-grey-mid: #555;
    --color-grey-light: #f0f0f0;
    --color-grey-lighter: #fafafa;
    --color-black-transparent-light: rgba(0, 0, 0, 0.3);
    --color-black-transparent-mid: rgba(0, 0, 0, 0.4);
    --color-black-transparent-shadow: rgba(0, 0, 0, 0.1);
    --color-white-solid: rgba(255, 255, 255, 1);
    
    /* Spacing (fixed values) - CONSOLIDATED */
    --spacing-sm: 10px;   /* tight spacing: gaps between tags, small padding */
    --spacing-md: 20px;   /* standard spacing: element spacing, form inputs */
    --spacing-lg: 40px;   /* major spacing: section gaps, layout spacing */
    
    /* Spacing (percentage) - CONSOLIDATED */
    --spacing-percent: 5%;  /* mobile margins and percentage-based spacing */
    
    /* Font Sizes - CONSOLIDATED */
    --font-size-sm: 11pt;  /* body text, descriptions, captions */
    --font-size-md: 16pt;  /* headings, buttons, emphasis */
    --font-size-lg: 20pt;  /* page titles, hero text */
    
    /* Font Families */
    --font-primary: 'Inconsolata', monospace;
    --font-secondary: 'Sabrina', sans-serif;
    
    /* Border Radius */
    --border-radius-sm: 5px;
    --border-radius-md: 10px;
    
    /* Opacity */
    --opacity-inactive: 0.4;
    --opacity-active: 1;
    
    /* Transitions */
    --transition-fast: 0.3s ease;
    --transition-medium: 0.4s ease;
    
    /* Other common values */
    --text-decoration-thickness: 1px;
    --box-shadow-default: 0 4px 10px var(--color-black-transparent-shadow);
    --text-underline-offset: 5px;
    
    /* Common widths */
    --width-standard: 90%;
    --width-mobile: 65%;
    --width-form-mobile: 85%;
}

/* ========================================
   Reset and Base Styles
   ======================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Base font is Inconsolata - inherited by everything unless overridden */
body {
    font-family: var(--font-primary);
    background-color: var(--color-white);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* h1 uses Sabrina */
h1 {
    font-family: var(--font-secondary);
}

p {
    font-size: var(--font-size-sm);
    text-align: justify;
}

hr {
    border-top: var(--text-decoration-thickness) dashed var(--color-black);
    width: 100%;
}

.btn {
    color: var(--color-white) !important;
    text-decoration: none;
    background-color: var(--color-black);
    font-size: var(--font-size-md);
    opacity: var(--opacity-inactive);
    padding: var(--spacing-sm) var(--spacing-percent);
    border-radius: var(--border-radius-md);
}

.btn:hover {
    opacity: var(--opacity-active);
}

/* Smaller button variant for archive */
.btn-small {
    font-size: var(--font-size-md);
    text-align: center;
}

/* Empty state message */
.empty-state {
    text-align: center;
}

.underline {
    text-decoration: underline;
    text-decoration-style: wavy;
    text-decoration-thickness: var(--text-decoration-thickness);
    text-underline-offset: var(--text-underline-offset);
}

/* ========================================
   Navigation Bar
   ======================================== */
/* Desktop navigation uses Sabrina */
.navbar {
    font-family: var(--font-secondary);
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding: var(--spacing-lg);
    width: 100%;
    margin: var(--spacing-md) 0;
}

.nav-link {
    font-size: var(--font-size-md);
    color: var(--color-black);
    cursor: pointer;
    text-decoration-line: none;
}

.nav-link:hover {
    text-underline-offset: var(--text-underline-offset); 
    text-decoration-line: underline;
    text-decoration-style: wavy;
    text-decoration-color: var(--color-black);
    text-decoration-thickness: var(--text-decoration-thickness);
}

.nav-icon {
    width: var(--spacing-lg);
    height: var(--spacing-lg);
}

.mobile-nav {
    display: none;
}

#navIconH {
    display: flex;
    height: var(--spacing-lg);
    width: var(--spacing-lg);
}

/* ========================================
   Main Content
   ======================================== */
.main-content {
    display: flex;
    gap: var(--spacing-sm);
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: var(--spacing-lg);
    flex: 1;
    margin: 0 20%;
}

/* Utility classes for text alignment */
.text-center {
    text-align: center;
}

.text-right {
    text-align: right;
}

.issue-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    padding: var(--spacing-lg) var(--spacing-percent);
    gap: var(--spacing-sm);
    color: var(--color-white);
    background-color: var(--color-black);
    border-radius: var(--border-radius-md);
}

/* Issue descriptions use Inconsolata */
.issue-container p {
    font-family: var(--font-primary);
}

.post-title-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--spacing-md);
    min-height: 130px;
    justify-content: flex-start;
}

.archive-post-title-wrapper {
    display: flex;
    flex-direction: column;
    align-items: left;
    justify-content: space-between;
    gap: var(--spacing-sm);
    width: var(--width-standard);
}

/* Archive post descriptions use Inconsolata */
.archive-post-title-wrapper p {
    font-family: var(--font-primary);
}

.carousel-align {
    text-align: left;
    width: 100%;
}

.post-container a {
    color: var(--color-black);
    font-size: var(--font-size-sm);
    text-decoration-style: dashed;
    text-decoration-thickness: var(--text-decoration-thickness);
}

.post-container a:hover {
    text-decoration-style: solid;
    text-decoration-thickness: var(--text-decoration-thickness);
}

.review {
    width: var(--width-standard);
}

.quote {
    font-size: var(--font-size-sm);
}

/* Reviewer name styling */
.reviewer-name {
    text-align: right;
}

/* Iframe wrapper for embedded content */
.iframe-wrapper {
    border-radius: var(--border-radius-md);
    overflow: hidden;
}

.iframe-wrapper .fallback-image {
    width: 100%;
    height: 400px;
    object-fit: cover;
    display: block;
    border-radius: var(--border-radius-md);
}

#coolSearchH {
    width: 100%;
    display: flex;
}

#coolSearchV {
    width: 100%;
    display: none;
}

/* Footer uses Sabrina */
footer {
    font-family: var(--font-secondary);
}

footer a {
    text-decoration-style: wavy;
    color: var(--color-black);
}

footer p {
    text-align: center;
    margin: var(--spacing-percent) 0;
}

/* ========================================
   Form Styles
   ======================================== */
/* Form intro paragraph */
.form-intro {
    font-size: var(--font-size-md);
    font-family: var(--font-secondary);
    text-align: center;
}

form {
    width: var(--width-standard);
    min-height: 60vh;
    text-align: center;
    justify-content: flex-start;
    align-items: center;
    display: flex;
    flex-direction: column;
    gap: var(--spacing-lg);
}

form h3 {
    width: 100%;
    font-weight: bold;
    font-size: var(--font-size-md);
    color: var(--color-white);
    background-color: var(--color-black);
    border-radius: var(--border-radius-md);
    padding: var(--spacing-sm);
    margin: var(--spacing-sm) 0;
}

form button {
    font-family: var(--font-primary);
    font-weight: bold;
    font-size: var(--font-size-md);
    color: var(--color-white);
    background-color: var(--color-black-transparent-light);
    border-radius: var(--border-radius-md);
    padding: var(--spacing-sm) var(--spacing-percent);
    cursor: pointer;
    border: none;
}

form button:hover {
    color: var(--color-white);
    background-color: var(--color-black);
}

#form-questions {
    display: flex;
    flex-direction: column;
    width: var(--width-standard);
    align-items: center;
}

.form-input {
    font-size: var(--font-size-sm);
    font-family: var(--font-primary);
    height: 28pt;
    padding: var(--spacing-sm);
    margin: var(--spacing-sm) 0 0 0;
    border: var(--text-decoration-thickness) dashed var(--color-black);
    border-radius: var(--border-radius-md);
    width: 100%;
}

.form-input:focus {
    border: var(--text-decoration-thickness) solid var(--color-black);
    outline: none;
}

.description {
    font-family: var(--font-primary);
    color: var(--color-grey);
    font-size: var(--font-size-sm);
}

#bigback {
    height: 100pt;
}

/* ========================================
   FAQ & Archive Styles (Consolidated Accordion)
   ======================================== */
.faq-container {
    margin: 0 auto;
    width: var(--width-standard);
}

.archive-container {
    margin: 0 auto;
}

.faq-title {
    text-align: center;
    font-family: var(--font-secondary);
    font-size: var(--font-size-md);
    font-weight: 600;
    margin-bottom: var(--spacing-lg);
}

.faq-item {
    background: var(--color-white);
    border-radius: var(--border-radius-md);
    margin-bottom: var(--spacing-sm);
    box-shadow: var(--box-shadow-default);
    overflow: hidden;
    transition: all var(--transition-fast);
}

/* Consolidated Accordion Question (replaces .faq-question and .archive-question) */
.accordion-question {
    background: var(--color-white);
    font-family: var(--font-primary);
    border: none;
    width: 100%;
    text-align: left;
    padding: var(--spacing-md);
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: var(--color-grey-dark);
    transition: background var(--transition-fast);
}

/* Context-based sizing for accordion questions */
.faq-container .accordion-question {
    font-size: var(--font-size-sm);
}

.archive-container .accordion-question {
    font-size: var(--font-size-md);
    gap: var(--spacing-sm);
}

.accordion-question:hover {
    background: var(--color-grey-light);
}

/* Consolidated Accordion Answer (replaces .faq-answer and .archive-answer) */
.accordion-answer {
    max-height: 0;
    overflow: hidden;
    background: var(--color-grey-lighter);
    transition: all var(--transition-medium);
    font-family: var(--font-primary);
    font-size: var(--font-size-sm);
    padding: 0 var(--spacing-md);
    line-height: 1.6;
    color: var(--color-grey-mid);
}

/* Active state for accordion answers */
.faq-item.active .accordion-answer {
    max-height: 300px;
    padding: var(--spacing-md);
}

/* Archive items need more space when expanded */
.archive-container .faq-item.active .accordion-answer {
    max-height: none;
}

.faq-icon {
    font-size: var(--spacing-md);
    transition: transform var(--transition-fast);
}

.faq-item.active .faq-icon {
    transform: rotate(45deg);
}

/* ========================================
   Carousel Styles
   ======================================== */
.carousel-wrapper {
    position: relative;
    width: 100vw;
}

.post-carousel {
    display: flex;
    overflow-x: auto;
    overflow-y: hidden;
    gap: var(--spacing-lg);
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    width: 100%;
    padding-left: calc(50% - 350px);
    padding-right: calc(50% - 350px);
}

.post-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 0 0 700px;
    gap: var(--spacing-md);
    scroll-snap-align: center;
}

.post-container iframe {
    width: 700px; 
    height: 400px;
}

.archive-wrapper {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
}

.archive-wrapper .fallback-image {
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    display: block;
    border-radius: var(--border-radius-md);
}

/* Issue headers in archive */
.issue-header {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}
.issue-header h2{
    font-family: var(--font-secondary);
    text-align: center;
}
.issue-header p {
    text-align: justify;
}

/* Archive accordion content wrapper */
.archive-content-wrapper {
    margin: var(--spacing-sm) 0;
}

.archive-inner-content {
    display: flex;
    flex-direction: column;
    margin: var(--spacing-percent);
    gap: var(--spacing-md);
}

/* Archive-specific faq icon spacing */
.archive-container .faq-icon {
    margin: var(--spacing-md);
}

.archive-post-header-wrapper {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
}

.archive-icon {
    width: var(--spacing-percent);
    margin: 0 var(--spacing-sm);
}

.archive-wrapper iframe {
    width: 100%;
    aspect-ratio: 16 / 9;
}

.post-tag {
    font-family: var(--font-primary);
    font-size: var(--font-size-sm);
    background-color: var(--color-black);
    opacity: var(--opacity-inactive);
    color: var(--color-white);
    padding: 1pt var(--spacing-sm);
    border-radius: var(--border-radius-sm);
    cursor: pointer;
}

.post-tag:hover {
    opacity: var(--opacity-active);
}

.person {
    background-color: rgb(190, 143, 1);
    opacity: var(--opacity-inactive);
}

.audio {
    background-color: rgb(37, 91, 167);
    opacity: var(--opacity-inactive);
}

.video {
    background-color: rgb(167, 37, 37);
    opacity: var(--opacity-inactive);
}

.visual {
    background-color: rgb(87, 151, 60);
    opacity: var(--opacity-inactive);
}

.interactive {
    background-color: rgb(91, 63, 127);
    opacity: var(--opacity-inactive);
}

.archive-description-wrapper {
    display: flex;
    gap: var(--spacing-percent);
}

.archive-description-wrapper a {
    min-width: var(--spacing-percent);
}

/* Scrollbar styling */
.post-carousel::-webkit-scrollbar {
    height: var(--spacing-sm);
}

.post-carousel::-webkit-scrollbar-track {
    background: var(--color-white);
}

.post-carousel::-webkit-scrollbar-thumb {
    background: rgb(229, 229, 229);
    border-radius: var(--border-radius-sm);
}

.post-carousel::-webkit-scrollbar-thumb:hover {
    background: rgb(229, 229, 229);
}

.post-description-container {
    width: var(--width-standard);
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    border-radius: var(--border-radius-md);
    border: var(--text-decoration-thickness) dashed var(--color-black);
    padding: var(--spacing-md);
}

.post-description {
    font-family: var(--font-primary);
    text-align: left;
    width: 100%;
}

/* ========================================
   Mobile Responsive
   ======================================== */
@media (max-width: 768px) {

    /* Mobile header height variable for consistency */
    :root {
        --mobile-header-height: 70px;
    }
    
    /* FIXED: Add padding-top to body to prevent fixed header from blocking content */
    body {
        padding-top: var(--mobile-header-height);
        font-size: var(--font-size-sm);
    }
    
    /* NEW: Unified Mobile Header Bar */
    .mobile-header {
        position: fixed;
        top: 0;
        left: 0;
        width: 100vw;
        height: var(--mobile-header-height);
        background-color: var(--color-white-solid);
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 0 var(--spacing-md);
        z-index: 11;
        box-shadow: 0 2px 4px var(--color-black-transparent-shadow);
    }
  
    .mobile-nav {
        display: flex;
    }
    
    /* Mobile navbar inherits Inconsolata from body */
    .navbar {
        margin: 0 0 var(--spacing-md) 0;
        flex-direction: column;
        justify-content: flex-start;
        width: 100%;
        padding: var(--spacing-lg) var(--spacing-md);
        min-height: 100vh;
        transform: translateX(-100%);
        background-color: var(--color-white-solid);
        position: fixed;
        transition: transform var(--transition-fast);
        text-align: left;
        z-index: 10;
        font-family: var(--font-primary);
    }

    .navbar-open {
        transform: translateX(0) !important;
    }

    #mobile-nav-title {
        font-size: var(--font-size-md);
        text-decoration: underline;
        text-decoration-style: dashed;
        text-underline-offset: var(--spacing-sm);
        margin: var(--spacing-lg) 0 var(--spacing-md) 0;
    }

    .nav-link {
        font-size: var(--font-size-md);
        font-weight: bold;
        color: var(--color-white);
        background-color: var(--color-black-transparent-light);
        width: 100%;
        padding: var(--spacing-md);
        border-radius: var(--border-radius-md);
        margin: var(--spacing-sm) 0;
    }

    .nav-link:hover {
        color: var(--color-white);
        background-color: var(--color-black);
        text-decoration: none;
    }

    /* Title positioning within mobile header */
    #navTitleV {
        font-family: var(--font-secondary);
        font-size: var(--font-size-md);
        text-align: center;
        flex: 1;
        margin: 0;
    }

    #navTitleV a {
        all: unset;
        cursor: pointer;
    }
    
    /* Burger icon positioning within mobile header */
    #burgerIcon {
        display: flex;
        width: var(--spacing-md);
        height: var(--spacing-md);
        cursor: pointer;
        position: relative;
        left: 0;
        background-color: transparent;
    }

    .footnote {
        display: inline;
        position: fixed;
        bottom: var(--spacing-percent);
        margin: 0 var(--spacing-percent);
        padding: var(--spacing-percent);
        border-radius: var(--border-radius-md);
        text-align: center;
        font-size: var(--font-size-sm);
    }

    #navIconH {
        display: none;
    }

    /* MAIN CONTENT */
    .main-content {
        flex-direction: column;
        justify-content: center;
        margin: 0 var(--spacing-sm);
    }

    .post-title {
        text-align: center;
    }

    .post-title-wrapper{
        width: var(--width-standard);
        min-height: 0;
    }

    .issue-container {
        color: var(--color-white);
        background-color: var(--color-black);
        border-radius: var(--border-radius-md);
        margin-top: var(--spacing-percent);
    }

    h1 {
        font-size: var(--font-size-lg) !important;
    }
    h3 {
        font-size: var(--font-size-md) !important; 
    }
    p, blockquote{
        font-size: var(--font-size-sm) !important;
    }

    .post-carousel {
        display: flex;
        flex-direction: column;
        overflow-x: hidden;
        overflow-y: auto;
        scroll-snap-type: y mandatory;
        -webkit-overflow-scrolling: touch;
        width: 100%;
        padding-left: calc(50% - 350px);
        padding-right: calc(50% - 350px);
    }

    .post-container {
        flex: 0 0 90%;
    }

    .post-container iframe .fallback-image{
        width: 90vw; 
        aspect-ratio: 16 / 9;
    }

    .archive-icon {
        display: none;
    }

    #coolSearchH {
        width: 100%;
        display: none;
    }

    #coolSearchV {
        width: 100%;
        display: flex;
    }

    .archive-container {
        width: 100%;
    }

    .accordion-question {
        width: 100%;
    }

    .archive-container .accordion-question {
        padding-right: 0;
        font-size: var(--font-size-sm);
        gap: 0;
    }

    .archive-container .faq-item.active .accordion-answer {
        max-height: none;
        padding: var(--spacing-md);
    }

    .post-tag {
        padding: 0 var(--spacing-sm);
    }

    /* Form */
    form {
        width: 100%;
    }

    .description {
        font-size: var(--font-size-sm);
        text-align: left;
    }
    .archive-post-header-wrapper {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        gap: var(--spacing-sm);
        margin-bottom: var(--spacing-sm);
    }
    footer {
        margin: 0 var(--spacing-sm);
    }

    #submissionForm {
        margin-top: var(--spacing-lg);
        margin-bottom: 0;
    }
    
    .form-intro {
        text-align: center;
    }

    .form-input {
        margin: var(--spacing-md);
    }

    .form-questions{
        text-align: center;
    }

    .issue-header{
        padding: 0 var(--spacing-md);
    }

}