/**
 * STYLES.CSS
 * ==================================================
 * Main stylesheet for Lightricks Brand Hub
 * 
 * This file contains:
 * - Layout structure
 * - Component styles (buttons, cards, accordions)
 * - Typography
 * - Spacing and grid
 * - Animations
 */

/* ===== CSS VARIABLES ===== */
/* These make it easy to maintain consistent design */
:root {
    /* Typography - Font Sizes (converted from design specs to rem) */
    --font-size-h1: 3.125rem;        /* 50pt - Logo */
    --font-size-h2: 2.5rem;          /* 40pt - Section headers (Index, Easy Access) */
    --font-size-h3: 2.25rem;         /* 36pt - Section titles (Presentations, Asset Libraries) */
    --font-size-button-lg: 1.5rem;   /* 24pt - Top right buttons */
    --font-size-item: 1.375rem;      /* 22pt - Items/Links */
    --font-size-button-sm: 0.875rem; /* 14pt - Filter pills */
    
    /* Typography - Other */
    --line-height: 1.5;              /* 150% */
    --letter-spacing: 0;
    
    /* Spacing */
    --spacing-xs: 0.5rem;    /* 8px */
    --spacing-sm: 1rem;      /* 16px */
    --spacing-md: 1.5rem;    /* 24px */
    --spacing-lg: 2rem;      /* 32px */
    --spacing-xl: 3rem;      /* 48px */
    --spacing-accordion: 1.875rem; /* 30px - accordion item spacing */
    
    /* Button Spacing */
    --button-padding-y: 0.875rem;    /* 14px - top/bottom */
    --button-padding-x: 1.125rem;    /* 18px - left/right */
    --button-gap: 0.625rem;          /* 10px - gap between buttons */
    
    /* Border Radius */
    --radius-button: 50px;           /* 50px - pill shaped buttons */
    --radius-full: 999px;
    
    /* Transitions */
    --transition-fast: 0.15s ease;
    --transition-normal: 0.3s ease;
    
    /* Layout */
    --max-width: 1920px;             /* Design canvas width */
    --content-padding: 4rem;         /* Padding from edges */
}

/* ===== RESET & BASE STYLES ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-primary);
    line-height: var(--line-height);
    letter-spacing: var(--letter-spacing);
    /* Colors set by themes.css */
}

/* ===== TYPOGRAPHY ===== */

/* H1 - Logo "Lightricks Brand Hub" - Functions as home button */
h1, .h1 {
    font-family: var(--font-primary); /* Aeonik/Inter */
    font-size: var(--font-size-h1);
    font-weight: 400; /* Always same weight */
    line-height: var(--line-height);
    cursor: pointer; /* Show it's clickable */
    transition: opacity var(--transition-fast); /* Smooth hover effect */
}

h1:hover, .h1:hover {
    opacity: 0.7; /* Subtle hover feedback */
}

/* H2 - Section Headers (Index, Easy Access) */
h2, .h2 {
    font-family: var(--font-primary); /* Aeonik/Inter */
    font-size: 1.3rem; /* 20.8pt - same as items */
    font-weight: 600; /* Semi-bold weight */
    line-height: var(--line-height);
    letter-spacing: 0.03em; /* 3% more spacing between letters */
    padding-bottom: 10px; /* Added spacing below "Index" and "Easy Access" headers */
}

/* H3 - Section Titles (Presentations, Asset Libraries, etc.) */
h3, .h3 {
    font-family: var(--font-primary); /* Aeonik/Inter */
    font-size: 1.3rem; /* 20.8pt - same as items */
    font-weight: 400;
    line-height: var(--line-height);
}

/* Brand Hub title - "Brand Hub" in black with Aeonik Light weight */
.logo-light {
    font-weight: 300 !important; /* Aeonik Light */
    color: var(--text-primary) !important; /* Black in light mode, white in dark mode */
    opacity: 1; /* No opacity, use actual color */
}

/* ===== LAYOUT STRUCTURE ===== */

.container {
    max-width: var(--max-width);
    margin: 0 auto;
    /* Different padding for top vs sides - top is much tighter */
    padding: 25px var(--content-padding) var(--content-padding) var(--content-padding);
    /* Explanation: padding: top right bottom left */
    /* Top: 25px (moved up from 50px), Sides & Bottom: 4rem (64px) */
}

/* Header */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-md); /* Space below the divider line */
    padding-bottom: 5px; /* Reduced space between H1 and divider line */
    border-bottom: 1px solid var(--border-color);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

/* Filter Pills Section */
.filter-section {
    display: flex;
    flex-wrap: wrap;
    gap: var(--button-gap);
    margin-bottom: calc(var(--spacing-xl) + 105px); /* Increased gap below filters */
    /* This equals: 3rem (48px) + 105px = 153px total space before sections */
}

/* Main Content Layout - 2/3 + 1/3 split */
.main-content {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: var(--spacing-xl);
    margin-top: 25vh; /* Push content down to mid-page - 25% of viewport height */
    align-items: start; /* Align both columns to the top */
    /* Hide content until JavaScript finishes loading */
    opacity: 0;
    transition: opacity 0.3s ease-in;
}

/* Show content when loaded */
.main-content.loaded {
    opacity: 1;
}

/* Left side - 2/3 width (index-section) */
/* Right side - 1/3 width (highlight-section) */

/* "What's New" title for Highlights section */
.highlight-section::before {
    content: "Easy Access";
    display: block;
    font-family: var(--font-primary); /* Aeonik/Inter */
    font-size: 1.3rem; /* Same as section titles */
    font-weight: 400;
    color: var(--text-primary);
    text-align: left;
    padding-bottom: 10px; /* 10px gap before border */
    margin-top: calc(-1.3rem - 20px); /* Pull up 10px more to perfectly align borders */
}

/* Add border to first item to align with Index sections */
.highlight-section .item-link:first-child {
    border-top: 1px solid var(--border-color); /* Same 1px border as Index */
}

/* Reduce padding and font size for items in Highlights section */
.highlight-section .item-link {
    padding: 0.75rem 0;
    font-size: 1rem; /* Smaller than Index items (1.3rem) */
    font-family: var(--font-primary); /* Aeonik/Inter instead of JetBrains Mono */
    transition: color var(--transition-fast); /* Match hover transition */
}

/* Highlights section hover - match title hover grey */
.highlight-section .item-link:hover {
    color: rgba(0, 0, 0, 0.7); /* Match the grey from "Brand Hub" title hover */
}

/* Dark mode hover for highlights section */
body.dark-mode .highlight-section .item-link:hover {
    color: rgba(255, 255, 255, 0.7);
}

/* Badges maintain their own colors and don't react to hover in highlights section */
.highlight-section .item-link:hover .badge-new,
.highlight-section .item-link:hover .badge-restricted,
.highlight-section .item-link:hover .badge-wip,
.highlight-section .item-link:hover .badge-example {
    opacity: 1; /* Ensure badges stay fully visible */
}

/* Easy Access items have arrows same as accordion arrows */
.highlight-section .item-link .item-arrow {
    display: inline; /* Make sure arrows are visible */
    font-size: 1rem; /* Same as accordion arrows - 1rem */
}

/* Add bottom border to last item in Easy Access for visual consistency */
.highlight-section .item-link:last-child {
    border-bottom: 1px solid var(--border-color);
}

/* ===== COMPONENT STYLES ===== */

/* ===== BUTTONS ===== */

/* Base button styles (overrides themes.css with specific values) */
button,
.button {
    font-family: var(--font-primary);
    padding: var(--button-padding-y) var(--button-padding-x);
    border-radius: var(--radius-button);
    border: 1px solid var(--border-color);
    background-color: var(--button-bg);
    color: var(--button-text);
    cursor: pointer;
    transition: all var(--transition-fast);
    font-weight: 400;
}

button:hover,
.button:hover {
    background-color: var(--button-hover-bg);
    color: var(--button-hover-text);
}

/* Large buttons (Request Form, etc.) */
.button-large {
    font-size: var(--font-size-button-lg);
}

/* Request Form button - styled as underlined text */
#requestFormBtn {
    background: none;
    border: none;
    padding: 0;
    font-family: var(--font-mono); /* JetBrains Mono */
    font-size: 1em; /* 1em = 16px typically */
    line-height: 5px;
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 5px; /* 5px gap between text and underline */
    color: var(--text-primary);
}

#requestFormBtn:hover {
    background: none;
    opacity: 0.6; /* Subtle hover effect */
}

/* Filter pill buttons */
.filter-button {
    font-family: var(--font-mono); /* JetBrains Mono */
    font-size: calc(var(--font-size-button-sm) * 0.803); /* ~10% smaller than original: 0.7026rem */
    padding: calc(var(--button-padding-y) * 0.803) calc(var(--button-padding-x) * 0.803); /* ~10% smaller padding */
    /* This equals approximately: 11.2px top/bottom, 14.5px left/right */
}

.filter-button.active {
    background-color: var(--button-hover-bg);
    color: var(--button-hover-text);
}

/* Dark mode toggle button */
.dark-mode-toggle {
    width: 60px;
    height: 32px;
    border-radius: var(--radius-full);
    border: 1px solid var(--border-color);
    background-color: transparent;
    padding: 0; /* Remove padding to manually center the circle */
    position: relative;
    cursor: pointer;
    transition: none; /* Prevent entire button from animating */
    display: flex;
    align-items: center; /* Center circle vertically */
}

/* Remove hover effect on the toggle button itself */
.dark-mode-toggle:hover {
    background-color: transparent;
    border-color: var(--border-color);
    color: inherit;
}

/* The circle/ball that moves */
.dark-mode-toggle-inner {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background-color: var(--text-primary); /* Black in light mode, white in dark mode */
    transition: transform var(--transition-normal);
    position: absolute;
    left: 4px; /* Start position with 4px margin */
}

/* Move the circle when in dark mode */
body.dark-mode .dark-mode-toggle-inner {
    transform: translateX(28px);
}

/* ===== ACCORDION SECTIONS ===== */

.accordion-category {
    margin-bottom: calc(var(--spacing-accordion) * 2); /* Doubled: 60px instead of 30px - more white space between categories */
    border-top: 1px solid var(--border-color);
    transition: all 0.5s cubic-bezier(0.4, 0, 0.6, 1); /* Smoother, more fluid transition */
    cursor: pointer; /* Entire section clickable when closed */
}

/* When open, reduce bottom margin for tighter spacing */
.accordion-category.open {
    margin-bottom: var(--spacing-md); /* Reduced from 60px to 24px when open */
    cursor: pointer;
}

/* When accordion is CLOSED - header is clickable row */
.accordion-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    padding: 10px 0; /* Back to original tight spacing */
    transition: padding 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.2s ease;
}

/* Hover state for accordion header */
.accordion-header:hover {
    opacity: 0.7;
}

.accordion-category.open .accordion-header:hover {
    opacity: 0.7; /* Also apply hover when open */
}

/* When accordion is OPEN - use grid layout for side-by-side */
.accordion-category.open {
    display: grid;
    grid-template-columns: 1fr 2fr; /* Title takes 1/3, items take 2/3 of width */
    gap: var(--spacing-xl); /* Space between title and items */
    align-items: start;
    cursor: pointer; /* Indicate entire section is clickable to close */
}

.accordion-category.open .accordion-header {
    border-top: none; /* Remove border when open, it's on the parent */
    padding-top: 10px; /* Keep tight spacing */
}

.accordion-title {
    /* Font styles inherited from h3 (now Aeonik, 1.5rem) */
    margin: 0;
    padding: 0;
}

.accordion-arrow {
    font-size: 1rem;
    transition: opacity 0.4s cubic-bezier(0.4, 0, 0.6, 1), 
                transform 0.5s cubic-bezier(0.4, 0, 0.6, 1);
    position: relative;
    display: inline-block;
    width: 1.5rem; /* Fixed width to prevent layout shift */
    text-align: center;
}

/* Hide arrow when open */
.accordion-category.open .accordion-arrow {
    opacity: 0;
    visibility: hidden;
    transform: rotate(90deg); /* Subtle rotation as it fades */
}

/* Close button at bottom of open accordion */
.accordion-close-button {
    display: none; /* Hidden by default when closed */
    opacity: 0;
    padding: 10px 0;
    border-top: 1px solid var(--border-color);
    text-align: right; /* Arrow aligned to right, matching header arrow position */
    cursor: pointer;
    transition: opacity 0.3s ease 0.2s; /* Fade in after section opens */
}

/* Close arrow styling */
.accordion-close-arrow {
    font-size: 1rem;
    display: inline-block;
    transform: rotate(-90deg); /* Rotate to point UP */
    transition: opacity var(--transition-fast);
}

/* Show close button when accordion is open */
.accordion-category.open .accordion-close-button {
    display: block;
    opacity: 1;
}

/* Hover effect for close button */
.accordion-close-button:hover {
    opacity: 0.7;
}

/* Content column (when closed) */
.accordion-content {
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: max-height 0.15s cubic-bezier(0.4, 0, 1, 1), 
                opacity 0.1s ease;
}

/* Content column (when open) - appears in second grid column */
.accordion-category.open .accordion-content {
    max-height: 2000px; /* Large enough for content */
    overflow: visible;
    opacity: 1;
    transition: max-height 0.5s cubic-bezier(0.2, 0, 0.2, 1), 
                opacity 0.3s ease 0.1s;
}

/* Disable item transitions when closing to prevent any movement */
.accordion-category:not(.open) .item-link {
    transition: none !important;
}

/* ===== ITEM LINKS ===== */

.item-link {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0; /* Match section title padding for alignment */
    border-top: 1px solid var(--border-color);
    font-family: var(--font-primary); /* Aeonik/Inter instead of JetBrains Mono */
    font-size: 1.3rem; /* 20.8pt - same as Easy Access items */
    color: var(--text-primary);
    text-decoration: none;
    transition: color var(--transition-fast);
    cursor: pointer; /* Explicit pointer cursor for links */
}

.item-link:hover {
    color: rgba(0, 0, 0, 0.7); /* Match the grey from "Brand Hub" title hover */
}

/* Dark mode hover - use white at 70% opacity */
body.dark-mode .item-link:hover {
    color: rgba(255, 255, 255, 0.7);
}

/* Badges maintain their own colors and don't react to hover */
.item-link:hover .badge-new,
.item-link:hover .badge-restricted,
.item-link:hover .badge-wip,
.item-link:hover .badge-example {
    opacity: 1; /* Ensure badges stay fully visible */
}

/* Remove border from first item - section's top border already serves as divider */
.accordion-content .item-link:first-child {
    border-top: none;
}

/* Last item doesn't need bottom border - next section's top border serves as divider */
.accordion-content .item-link:last-child {
    /* No border-bottom - the next accordion section's border-top creates the divider */
    padding-bottom: 10px; /* Maintain consistent padding with other items */
}

.item-title {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

/* "Open" button in item links - styled like filter buttons */
.item-open-button {
    font-family: var(--font-mono); /* JetBrains Mono like filter buttons */
    font-size: calc(var(--font-size-button-sm) * 0.9); /* Same as filter buttons */
    padding: calc(var(--button-padding-y) * 0.45) calc(var(--button-padding-x) * 0.9); /* Half the top/bottom padding */
    /* Top/Bottom: ~6.3px, Left/Right: ~16.2px */
    border-radius: var(--radius-button);
    border: 1px solid var(--border-color);
    background-color: var(--button-bg);
    color: var(--button-text);
    cursor: pointer;
    transition: all var(--transition-fast);
    text-decoration: none;
    display: inline-block;
}

.item-open-button:hover {
    background-color: var(--button-hover-bg); /* Black background */
    color: var(--button-hover-text); /* Light text */
}

/* Prevent the button hover from being affected by parent link hover */
.item-link:hover .item-open-button {
    color: var(--button-text); /* Keep button text color normal until button itself is hovered */
}

.item-link:hover .item-open-button:hover {
    background-color: var(--button-hover-bg); /* Invert when button is hovered */
    color: var(--button-hover-text);
}

/* Hide old arrow styling (keep for Easy Access section) */
.item-arrow {
    font-size: 1em;
}

/* "New" badge - elliptical sticker */
.badge-new {
    font-family: var(--font-mono); /* JetBrains Mono */
    font-size: 0.7em;
    padding: 0.3em 0.8em; /* More horizontal padding for ellipse shape */
    background-color: #B9FF09; /* Bright lime green */
    color: #000000; /* Black text for contrast */
    border: none; /* No outline */
    border-radius: 50px; /* Pill/ellipse shape */
    text-transform: uppercase;
    font-weight: 500;
    margin-left: -10px; /* Large negative margin to overcome padding and make badges almost touch */
    white-space: nowrap; /* Prevent badge from wrapping to multiple lines */
}

/* "RESTRICTED" Badge - Light Peach */
.badge-restricted {
    font-family: var(--font-mono); /* JetBrains Mono */
    font-size: 0.7em;
    padding: 0.3em 0.8em; /* More horizontal padding for ellipse shape */
    background-color: #FFCFC8; /* Light peach */
    color: #000000; /* Black text for contrast */
    border: none; /* No outline */
    border-radius: 50px; /* Pill/ellipse shape */
    text-transform: uppercase;
    font-weight: 500;
    margin-left: -10px; /* Large negative margin to overcome padding and make badges almost touch */
    white-space: nowrap; /* Prevent badge from wrapping to multiple lines */
}

/* "WIP" Badge - Black background, white text (inverts in dark mode) */
.badge-wip {
    font-family: var(--font-mono); /* JetBrains Mono */
    font-size: 0.7em;
    padding: 0.3em 0.8em; /* More horizontal padding for ellipse shape */
    background-color: #000000; /* Black background */
    color: #FFFFFF; /* White text for contrast */
    border: none; /* No outline */
    border-radius: 50px; /* Pill/ellipse shape */
    text-transform: uppercase;
    font-weight: 500;
    margin-left: -10px; /* Large negative margin to overcome padding and make badges almost touch */
    white-space: nowrap; /* Prevent badge from wrapping to multiple lines */
}

/* Invert WIP badge in dark mode: white background, black text */
body.dark-mode .badge-wip {
    background-color: #FFFFFF; /* White background in dark mode */
    color: #000000; /* Black text in dark mode */
}

/* "EXAMPLE" Badge - Light blue background */
.badge-example {
    font-family: var(--font-mono); /* JetBrains Mono */
    font-size: 0.7em;
    padding: 0.3em 0.8em; /* More horizontal padding for ellipse shape */
    background-color: #92C6FF; /* Light blue */
    color: #000000; /* Black text for contrast */
    border: none; /* No outline */
    border-radius: 50px; /* Pill/ellipse shape */
    text-transform: uppercase;
    font-weight: 500;
    margin-left: -10px; /* Large negative margin to overcome padding and make badges almost touch */
    white-space: nowrap; /* Prevent badge from wrapping to multiple lines */
}

/* Badge text variants - show full text by default, short on small screens */
.badge-full {
    display: inline; /* Show "Restricted Access" by default */
}

.badge-short {
    display: none; /* Hide "Restricted" by default */
}

/* Make badges 10% smaller in index section to help with longer text items */
.index-section .badge-new,
.index-section .badge-restricted,
.index-section .badge-wip,
.index-section .badge-example {
    font-size: 0.63em; /* 10% smaller than 0.7em */
}

/* ===== FILTERED RESULTS SECTION ===== */
/* This section appears when a filter is active, replacing the Index section */
/* It's styled to look like an open accordion section */

.filtered-section {
    /* Takes full width of left column (2/3) */
    grid-column: 1;
}

.filtered-section-inner {
    /* Uses same grid layout as open accordion */
    display: grid;
    grid-template-columns: 1fr 2fr; /* Title takes 1/3, items take 2/3 of width - consistent position */
    gap: var(--spacing-xl);
    align-items: start;
    border-top: 1px solid var(--border-color);
    /* No padding-top here - title handles its own padding */
}

.filtered-section-title {
    /* Same styling and spacing as accordion titles and item-links */
    font-family: var(--font-primary);
    font-size: 1.3rem;
    font-weight: 400;
    line-height: var(--line-height);
    margin: 0;
    padding: 10px 0; /* Exact match with accordion-header and item-link padding for perfect alignment */
}

.filtered-section-items {
    /* Container for the filtered items */
    display: flex;
    flex-direction: column;
}

/* Remove top border from first item - title's border already serves as divider */
/* Keep same padding as all other items for consistent alignment */
.filtered-section-items .item-link:first-child {
    border-top: none;
    padding: 10px 0; /* Maintain same padding as other items and title */
}

/* ===== INDEX SECTION SCROLLING ===== */

/* Make Index section scrollable with hidden scrollbar */
.index-section,
.filtered-section {
    max-height: calc(100vh - 25vh - 200px); /* Full viewport minus top margin and header space */
    overflow-y: auto; /* Enable vertical scrolling */
    overflow-x: hidden; /* No horizontal scroll */
    padding-bottom: 4rem; /* Extra padding at bottom so last items are fully visible before scrolling off screen */
    
    /* Hide scrollbar for Chrome, Safari, and Opera */
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE and Edge */
}

/* Hide scrollbar for Chrome, Safari, and Opera */
.index-section::-webkit-scrollbar,
.filtered-section::-webkit-scrollbar {
    display: none;
}

/* Smooth scrolling behavior */
.index-section,
.filtered-section {
    scroll-behavior: smooth;
}

/* ===== RESPONSIVE DESIGN ===== */

/* Large-medium screens - Fix badge wrapping issue (1293-1200px) */
@media (max-width: 1293px) and (min-width: 1200px) {
    .badge-new,
    .badge-restricted,
    .badge-wip,
    .badge-example {
        font-size: 0.65em; /* Slightly smaller to prevent wrapping */
        padding: 0.28em 0.7em; /* Tighter padding */
    }
    
    /* Show short text on these screen widths */
    .badge-full {
        display: none; /* Hide "Restricted Access" */
    }
    .badge-short {
        display: inline; /* Show "Restricted" */
    }
}

/* Medium screens - Fix badge wrapping issue (810-769px) */
@media (max-width: 810px) and (min-width: 769px) {
    .badge-new,
    .badge-restricted,
    .badge-wip,
    .badge-example {
        font-size: 0.6em; /* Slightly smaller to prevent wrapping */
        padding: 0.25em 0.6em; /* Tighter padding */
    }
    
    /* Show short text on these screen widths */
    .badge-full {
        display: none; /* Hide "Restricted Access" */
    }
    .badge-short {
        display: inline; /* Show "Restricted" */
    }
}

/* Tablet */
@media (max-width: 1200px) {
    :root {
        --content-padding: 2rem;
    }
    
    .main-content {
        grid-template-columns: 1fr; /* Stack vertically */
        display: flex; /* Use flexbox for easy reordering */
        flex-direction: column;
        margin-top: 0; /* Remove large top margin on tablet - content starts right after filters */
    }
    
    /* Put "Easy Access" section first on smaller screens */
    .highlight-section {
        order: -1; /* Moves to the top */
        margin-bottom: var(--spacing-xl); /* Space below Easy Access */
        width: 100%; /* Full width to match Index section */
    }
    
    /* Index/Filtered section comes second */
    .index-section,
    .filtered-section {
        order: 0; /* Default order, comes after Easy Access */
        width: 100%; /* Full width */
    }
    
    /* Add section titles when layout stacks (tablet and below) */
    /* This helps users know which section they're looking at */
    
    /* Add "Easy Access" heading */
    .highlight-section::before {
        content: "Easy Access";
        display: block;
        font-size: 1.3rem; /* Same as h2 */
        font-weight: 600;
        letter-spacing: 0.03em;
        padding-bottom: 10px;
        margin-bottom: var(--spacing-sm);
    }
    
    /* Add "Index" heading */
    .index-section::before {
        content: 'Index';
        display: block;
        font-size: 1.3rem; /* Same as h2 */
        font-weight: 600;
        letter-spacing: 0.03em;
        padding-bottom: 10px;
        margin-top: 0;
        margin-bottom: var(--spacing-sm);
    }
    
    /* No extra space below Easy Access section */
    .highlight-section {
        margin-bottom: var(--spacing-xl);
    }
}

/* Mobile */
@media (max-width: 768px) {
    :root {
        --content-padding: 1.5rem;
    }
    
    .main-content {
        margin-top: 20px; /* 20px gap between filter buttons and sections on mobile */
    }
    
    /* Ensure both sections are full width and aligned */
    .highlight-section,
    .index-section,
    .filtered-section {
        width: 100%; /* Full width alignment */
    }
    
    /* Override negative margin on mobile - no longer needed when stacked */
    .highlight-section::before {
        margin-top: 0; /* Reset negative margin for mobile */
    }
    
    /* Header: row with toggle */
    .header {
        display: flex;
        flex-direction: row;
        align-items: center;
        flex-wrap: nowrap; /* Keep H1 and toggle on same line */
        gap: var(--spacing-xs);
        padding-bottom: var(--spacing-sm);
    }
    
    /* H1: 1.5rem on mobile */
    h1 {
        font-size: 1.5rem; /* 24px */
        flex: 1 1 0;
        min-width: 0;
        margin: 0;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    
    /* Header actions: only toggle visible in header */
    .header-actions {
        display: flex;
        align-items: center;
        gap: var(--spacing-sm);
        flex: 0 0 auto;
    }
    
    /* Dark mode toggle: 20% smaller on mobile */
    .dark-mode-toggle {
        width: 48px; /* 20% smaller: 60px * 0.8 */
        height: 26px; /* 20% smaller: 32px * 0.8 */
        flex-shrink: 0;
    }
    
    /* Toggle circle also smaller */
    .dark-mode-toggle-inner {
        width: 20px; /* Proportionally smaller */
        height: 20px;
        left: 3px; /* Adjusted position */
    }
    
    /* Move distance for dark mode */
    body.dark-mode .dark-mode-toggle-inner {
        transform: translateX(22px); /* Adjusted for smaller toggle */
    }
    
    /* Request form: move to bottom, after all content */
    #requestFormBtn {
        display: none; /* Hide in header, will show at bottom */
    }
    
    /* All text sizes to 0.8rem (including buttons) */
    h2, .h2,
    h3, .h3,
    .item-link,
    .accordion-title,
    .filtered-section-title,
    .highlight-section .item-link,
    .filter-button,
    .item-open-button {
        font-size: 0.8rem !important; /* 12.8px */
    }
    
    /* Filter buttons: 20% smaller */
    .filter-button {
        padding: 6px 11px; /* 20% smaller: was 8px 14px */
        font-size: 0.64rem !important; /* 20% smaller than 0.8rem */
    }
    
    .item-open-button {
        padding: 6px 14px; /* Keep same */
    }
    
    /* Reduce space between filter tags and content */
    .filter-section {
        gap: var(--spacing-xs);
        margin-bottom: var(--spacing-md);
    }
    
    /* Override section title sizes for mobile (they're already showing from tablet breakpoint) */
    .highlight-section::before,
    .index-section::before {
        font-size: 0.8rem !important; /* Smaller on mobile */
        padding: 10px 0;
        margin-bottom: var(--spacing-sm);
    }
    
    /* Tighter spacing on mobile for Easy Access section */
    .highlight-section {
        margin-bottom: 0;
    }
    
    /* Consistent padding for all sections */
    .accordion-category {
        margin-bottom: 0 !important; /* Override default spacing */
    }
    
    /* Consistent padding for items */
    .item-link {
        padding: 10px 0 !important; /* Same top and bottom */
    }
    
    /* Last item same height as others */
    .accordion-content .item-link:last-child,
    .highlight-section .item-link:last-child {
        padding-bottom: 10px !important; /* Ensure same padding */
    }
    
    /* Accordion items open directly under header (not side-by-side) */
    .accordion-category.open {
        display: block; /* Override grid layout */
    }
    
    .accordion-category.open .accordion-header {
        padding-bottom: 0; /* No extra space after header */
    }
    
    .accordion-content {
        margin-top: 0; /* Items directly under header */
    }
    
    /* Filtered section items also stack vertically */
    .filtered-section-inner {
        display: block; /* Override grid layout */
    }
    
    .filtered-section-title {
        padding-bottom: 0;
        margin-bottom: 0;
    }
    
    /* Create request form at bottom (aligned left) */
    .container::after {
        content: 'Request Form';
        display: block;
        text-align: left; /* Aligned left */
        text-decoration: underline;
        text-decoration-thickness: 1px;
        text-underline-offset: 5px;
        color: var(--text-primary);
        padding: var(--spacing-sm) 0;
        margin-top: var(--spacing-xl);
        border-top: 1px solid var(--border-color);
        cursor: pointer;
        font-family: var(--font-mono);
        font-size: 0.8rem;
    }
    
    /* Disable fixed height scrolling on mobile - let it flow naturally */
    .index-section,
    .filtered-section {
        max-height: none;
        overflow-y: visible;
    }
}

