/* ===================================
   CSS VARIABLES & RESET
   =================================== */
:root {
    --primary-color: #4665f1;
    --primary-dark: #3651d4;
    --secondary-color: #64748b;
    --success-color: #10b981;
    --error-color: #ef4444;
    --warning-color: #f59e0b;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --border-color: #e2e8f0;
    --bg-light: #f8fafc;
    --bg-white: #ffffff;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --transition: all 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Quill 2.x compatibility — pre-fix saves stored bullet lists as
   <ol><li data-list="bullet">. New saves are normalised to <ul>, but
   anything already in the DB still renders here as a numbered list
   without this fallback. */
ol li[data-list="bullet"] { list-style-type: disc; }
ol li[data-list="ordered"] { list-style-type: decimal; }
/* Inside the entry form's Quill editor, defer to Quill's own ::before
   counter so we don't draw a duplicate marker. */
.ql-editor ol li[data-list="bullet"],
.ql-editor ol li[data-list="ordered"],
.ql-editor ul li { list-style-type: none; }

html {
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--bg-light);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

@media (min-width: 1400px) {
    .container {
        max-width: 1300px;
    }
}

@media (min-width: 1600px) {
    .container {
        max-width: 1600px;
    }
}

/* ===================================
   HEADER & NAVIGATION
   =================================== */
.main-header {
    background: var(--bg-white);
    box-shadow: var(--shadow-sm);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
}


.main-header-spacer {
    height: 70px;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
}

.logo-section {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 0;
}

.program-logo {
    height: 40px;
    width: auto;
    object-fit: contain;
    flex-shrink: 0;
}

.program-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary-color);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.main-nav {
    display: flex;
    gap: 1.25rem;
    flex-shrink: 0;
}

.main-nav a {
    text-decoration: none;
    color: var(--text-secondary);
    font-weight: 500;
    transition: var(--transition);
    padding: 0.5rem 0;
    border-bottom: 2px solid transparent;
}

.main-nav a:hover {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

.main-nav .vote-nav-link,
.mobile-menu .vote-nav-link,
.main-nav .entry-nav-link,
.mobile-menu .entry-nav-link {
    background: var(--primary-color);
    color: white !important;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-md);
    border-bottom: none !important;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-weight: 600;
    transition: var(--transition);
}

.main-nav .vote-nav-link:hover,
.mobile-menu .vote-nav-link:hover,
.main-nav .entry-nav-link:hover,
.mobile-menu .entry-nav-link:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.main-nav .vote-nav-link i,
.mobile-menu .vote-nav-link i,
.main-nav .entry-nav-link i,
.mobile-menu .entry-nav-link i {
    font-size: 0.875rem;
}

.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-primary);
    cursor: pointer;
}

.mobile-menu {
    display: none;
    flex-direction: column;
    background: var(--bg-white);
    box-shadow: var(--shadow-md);
    padding: 1rem;
    gap: 0.5rem;
}

.mobile-menu.active {
    display: flex;
    position: fixed;
    top: 70px;
    left: 0;
    right: 0;
    z-index: 999;
}

.mobile-menu a {
    text-decoration: none;
    color: var(--text-secondary);
    padding: 0.75rem 1rem;
    border-radius: var(--radius-md);
    transition: var(--transition);
}

.mobile-menu a:hover {
    background: var(--bg-light);
    color: var(--primary-color);
}

/* ===================================
   HERO SECTION
   =================================== */
.hero-section {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    padding: 5rem 0;
    text-align: center;
}

/* Cinematic hero — full viewport, dramatic */
.hero-cinematic {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 6rem 0;
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    position: relative;
}

.hero-cinematic .hero-content h1 {
    font-size: 4rem;
    letter-spacing: -0.02em;
    text-shadow: 0 2px 30px rgba(0,0,0,0.5);
}

.hero-cinematic .hero-description {
    font-size: 1.375rem;
    max-width: 750px;
    text-shadow: 0 1px 15px rgba(0,0,0,0.4);
}

.hero-cinematic .countdown-number {
    text-shadow: 0 2px 20px rgba(0,0,0,0.4);
}

.hero-cinematic .cta-button {
    padding: 1.125rem 3rem;
    font-size: 1.25rem;
    box-shadow: 0 4px 30px rgba(0,0,0,0.3);
}

@media (max-width: 768px) {
    .hero-cinematic {
        min-height: 80vh;
        background-attachment: scroll;
    }
    .hero-cinematic .hero-content h1 {
        font-size: 2.5rem;
    }
}

.hero-content h1 {
    font-size: 3rem;
    font-weight: 800;
    margin-bottom: 1.5rem;
    line-height: 1.2;
}

.hero-description {
    font-size: 1.25rem;
    max-width: 700px;
    margin: 0 auto 3rem;
    opacity: 0.95;
}

.hero-description p {
    margin-bottom: 0.75rem;
}

.hero-description p:last-child {
    margin-bottom: 0;
}

.hero-stats {
    display: flex;
    justify-content: center;
    gap: 3rem;
    margin-bottom: 3rem;
    flex-wrap: wrap;
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.stat-item i {
    font-size: 2rem;
    opacity: 0.9;
}

.stat-number {
    font-size: 2.5rem;
    font-weight: 700;
}

.stat-label {
    font-size: 0.875rem;
    opacity: 0.9;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Countdown Timer — circular digits with labels below */
.countdown-wrapper {
    margin: 2rem auto 2.5rem;
    max-width: 600px;
}

.countdown-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    opacity: 0.8;
    margin-bottom: 1.25rem;
    font-weight: 600;
}

.countdown-timer {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    gap: 0.5rem;
}

.countdown-unit {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: none;
    border: none;
    padding: 0;
    min-width: 0;
}

.countdown-number {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 5.5rem;
    height: 5.5rem;
    min-width: 5.5rem;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.4);
    border: 2px solid var(--primary-color);
    color: #ffffff;
    font-size: 1.75rem;
    font-weight: 800;
    line-height: 1;
    font-variant-numeric: tabular-nums;
    letter-spacing: 0;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    box-sizing: border-box;
}

.countdown-text {
    font-size: 0.6875rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    opacity: 0.85;
    margin-top: 0.75rem;
    font-weight: 700;
    color: var(--success-color);
}

.countdown-separator {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 5.5rem;
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary-color);
    opacity: 0.9;
    line-height: 1;
}

@media (max-width: 600px) {
    .countdown-separator {
        height: 3.75rem;
        font-size: 1.5rem;
    }
}

.countdown-finished {
    font-size: 1.25rem;
    font-weight: 700;
    padding: 1rem;
}

@media (max-width: 600px) {
    .countdown-timer {
        gap: 0.25rem;
    }
    .countdown-number {
        width: 3.75rem;
        height: 3.75rem;
        min-width: 3.75rem;
        font-size: 1.125rem;
    }
    .countdown-text {
        font-size: 0.5625rem;
        margin-top: 0.5rem;
    }
}

.cta-button {
    display: inline-block;
    background: white;
    color: var(--primary-color);
    padding: 1rem 2.5rem;
    border-radius: var(--radius-lg);
    text-decoration: none;
    font-weight: 600;
    font-size: 1.125rem;
    transition: var(--transition);
    box-shadow: var(--shadow-lg);
}

.cta-button:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-xl);
}

/* ===================================
   SECTIONS
   =================================== */
section {
    padding: 2rem 0;
    scroll-margin-top: 80px; /* Account for sticky header */
}

/* Alternating section backgrounds */
section.bg-white {
    background: var(--bg-white);
}

section.bg-light {
    background: var(--bg-light);
}

.section-title {
    font-size: 2.5rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.section-subtitle {
    text-align: center;
    font-size: 1.125rem;
    color: var(--text-secondary);
    margin-bottom: 3rem;
}

/* ===================================
   TIMELINE SECTION
   =================================== */
.timeline-section {
    /* background set dynamically via alternating classes */
}

.timeline-container {
    max-width: 900px;
    margin: 0 auto;
    position: relative;
}

.timeline {
    position: relative;
    padding: 1rem 0;
}

/* Vertical line */
.timeline::before {
    content: '';
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    width: 4px;
    height: 100%;
    background: linear-gradient(to bottom, var(--primary-color), var(--primary-dark));
    border-radius: 2px;
}

.timeline-item {
    position: relative;
    width: 50%;
    padding: 1rem 2rem;
    box-sizing: border-box;
}

.timeline-item:nth-child(odd) {
    left: 0;
    padding-right: 3rem;
    text-align: right;
}

.timeline-item:nth-child(even) {
    left: 50%;
    padding-left: 3rem;
    text-align: left;
}

/* Timeline dot */
.timeline-item::before {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    background: var(--bg-white);
    border: 4px solid var(--primary-color);
    border-radius: 50%;
    top: 1.5rem;
    z-index: 1;
}

.timeline-item:nth-child(odd)::before {
    right: -10px;
}

.timeline-item:nth-child(even)::before {
    left: -10px;
}

/* Timeline status indicators */
.timeline-item.completed::before {
    background: var(--success-color);
    border-color: var(--success-color);
}

.timeline-item.active::before {
    background: var(--primary-color);
    border-color: var(--primary-color);
    box-shadow: 0 0 0 6px rgba(70, 101, 241, 0.2);
    animation: timelinePulse 2s infinite;
}

.timeline-item.upcoming::before {
    background: var(--bg-white);
    border-color: var(--secondary-color);
}

@keyframes timelinePulse {
    0%, 100% {
        box-shadow: 0 0 0 6px rgba(70, 101, 241, 0.2);
    }
    50% {
        box-shadow: 0 0 0 10px rgba(70, 101, 241, 0.1);
    }
}

.timeline-content {
    background: var(--bg-white);
    padding: 1.5rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    transition: var(--transition);
}

.timeline-content:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.timeline-item.completed .timeline-content {
    border-left: 4px solid var(--success-color);
}

.timeline-item.active .timeline-content {
    border-left: 4px solid var(--primary-color);
}

.timeline-item.upcoming .timeline-content {
    border-left: 4px solid var(--secondary-color);
    opacity: 0.85;
}

.timeline-date {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.timeline-item:nth-child(odd) .timeline-date {
    justify-content: flex-end;
}

.timeline-date i {
    font-size: 1rem;
}

.timeline-title {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.timeline-description {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* Empty timeline state */
.timeline-empty {
    text-align: center;
    padding: 3rem;
    color: var(--text-secondary);
}

.timeline-empty i {
    font-size: 3rem;
    margin-bottom: 1rem;
    color: var(--secondary-color);
    opacity: 0.5;
}

/* Mobile responsive timeline */
@media (max-width: 768px) {
    .timeline::before {
        left: 20px;
    }

    .timeline-item {
        width: 100%;
        left: 0 !important;
        padding-left: 48px !important;
        padding-right: 0 !important;
        text-align: left !important;
        margin-bottom: 1.25rem;
    }

    .timeline-item::before {
        left: 10px !important;
        right: auto !important;
    }

    .timeline-item:nth-child(odd) .timeline-date {
        justify-content: flex-start;
    }

    /* Tighter card padding on phones so cards don't feel oversized.
       Title/description sizes also nudged down for a more compact rhythm. */
    .timeline-content {
        padding: 1rem 1.1rem 1.05rem;
    }
    .timeline-title {
        font-size: 1rem;
    }
    .timeline-description {
        font-size: 0.86rem;
        line-height: 1.45;
    }
}

/* ===================================
   CATEGORIES SECTION
   =================================== */
.categories-section {
    /* background set dynamically via alternating classes */
}

/* Flex (not grid) so an incomplete last row centers within the container.
   With grid + auto-fill the trailing cells stayed empty, leaving 1-2 cards
   left-jammed. flex-grow=1 keeps full rows looking the same as before
   (cards expand to fill the row); the per-card max-width prevents a single
   card on the last row from stretching to full container width. */
.categories-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 2rem;
    margin-left: auto;
    margin-right: auto;
}

/* Orphan-aware row balancing. With cards capped at 380px and flex-wrap,
   the default viewport allows up to ~4 across on desktop — which leaves
   an awkward solo card on row 2 when the total is 5 or 9. Cap the grid
   max-width per count so 5 → 3+2, 6 → 3+3, 9 → 3+3+3, etc., and the
   flex container's `justify-content: center` keeps the partial last
   row centred. Totals where 4-up balances cleanly (4, 7, 8, 11, 12)
   keep the wide cap. */
.categories-grid[data-count="1"],
.categories-grid[data-count="2"] {
    max-width: calc(2 * 380px + 2rem);
}
.categories-grid[data-count="3"],
.categories-grid[data-count="5"],
.categories-grid[data-count="6"],
.categories-grid[data-count="9"] {
    max-width: calc(3 * 380px + 4rem);
}

.categories-grid:not(.categories-expanded) .category-card.category-card-overflow {
    display: none;
}

.categories-toggle-wrap {
    display: none;
    justify-content: center;
    margin-top: 2rem;
}

.category-group-nav {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.75rem;
    margin: 0 0 2rem;
}

.category-group-filter.active {
    box-shadow: 0 0 0 3px color-mix(in srgb, currentColor 30%, transparent);
}

.category-group-panel[hidden] { display: none; }
.category-group-title { text-align: center; margin-bottom: 0.5rem; }
.category-group-description { text-align: center; margin: 0 auto 1.5rem; max-width: 760px; }

.categories-toggle-wrap.has-desktop-overflow {
    display: flex;
}

.categories-toggle {
    align-items: center;
    background: transparent;
    border: 2px solid var(--primary-color);
    border-radius: var(--radius-md);
    color: var(--primary-color);
    cursor: pointer;
    font: inherit;
    font-weight: 700;
    gap: 0.65rem;
    justify-content: center;
    min-height: 48px;
    padding: 0.75rem 1.5rem;
    transition: var(--transition);
}

.categories-toggle:hover,
.categories-toggle:focus-visible {
    background: var(--primary-color);
    color: #fff;
}


.category-card {
    background: var(--bg-white);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 2rem;
    transition: var(--transition);
    cursor: pointer;
    display: flex;
    flex-direction: column;
    /* Mirror the previous grid behaviour: minimum 300px (so cards don't get
       too small), grow to fill the row, capped so a lone card on the last
       row doesn't span the whole container. */
    flex: 1 1 300px;
    min-width: 280px;
    max-width: 380px;
}

.category-card .category-description {
    /* Clamp long descriptions so grid cards stay even-height. JS adds a
       Read more toggle when the content actually overflows (see
       setupCategoryDescriptionToggles in script.js). */
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.category-card .category-description.expanded {
    display: block;
    -webkit-line-clamp: unset;
    -webkit-box-orient: unset;
    overflow: visible;
}

.category-card .read-more-toggle {
    background: none;
    border: none;
    padding: 0;
    margin: 0 0 1rem 0;
    font: inherit;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--primary-color);
    cursor: pointer;
    align-self: flex-start;
    text-align: left;
}

.category-card .read-more-toggle:hover {
    text-decoration: underline;
}

.category-card .vote-button {
    text-decoration: none;
    margin-top: auto;
}

.category-card:hover {
    border-color: var(--primary-color);
    box-shadow: var(--shadow-xl);
}

.category-emoji {
    font-size: 3rem;
    margin-bottom: 1rem;
    display: block;
    text-align: center;
}

.category-icon {
    display: block;
    width: 80px;
    height: 80px;
    max-width: 100%;
    object-fit: contain;
    margin: 0 auto 1rem;
}

.category-card h3 {
    font-size: 1.5rem;
    margin-bottom: 0.75rem;
    color: var(--text-primary);
}

.category-card p,
.category-description {
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 1rem;
}

.category-description p {
    margin-bottom: 0.5rem;
}

.category-description p:last-child {
    margin-bottom: 0;
}

.category-card.has-voting {
    position: relative;
    padding-top: 3rem;
}

.voting-badge {
    position: absolute;
    top: 1rem;
    right: 1rem;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-md);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.voting-badge i {
    font-size: 0.875rem;
}

.voting-badge.active {
    background: #10b981;
    color: white;
}

.voting-badge.upcoming {
    background: #f59e0b;
    color: white;
}

.voting-badge.closed {
    background: #6b7280;
    color: white;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.8;
    }
}

.voting-stats {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.voting-stats i {
    color: var(--primary-color);
}

.voting-info {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.voting-info i {
    color: var(--secondary-color);
}

.vote-button {
    width: 100%;
    margin-top: 1rem;
    padding: 0.75rem 1.5rem;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.vote-button:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.vote-button.vote-button-disabled {
    background: rgba(148, 163, 184, 0.15);
    color: #64748b;
    cursor: default;
    text-decoration: none;
}

.vote-button.vote-button-disabled:hover {
    background: rgba(148, 163, 184, 0.15);
    transform: none;
    box-shadow: none;
}

.dark-landing .vote-button.vote-button-disabled {
    background: rgba(148, 163, 184, 0.1);
    color: #94a3b8;
}

.vote-button i {
    font-size: 1.125rem;
}

/* ===================================
   CATEGORIES ACCORDION
   =================================== */
.categories-accordion {
    max-width: 900px;
    margin: 0 auto;
}

.accordion-controls {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 1rem;
}

.expand-all-btn {
    background: transparent;
    border: 1px solid var(--primary-color);
    color: var(--primary-color);
    padding: 0.5rem 1rem;
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: var(--transition);
}

.expand-all-btn:hover {
    background: var(--primary-color);
    color: white;
}

.accordion-item {
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    margin-bottom: 1rem;
    overflow: hidden;
    transition: var(--transition);
}

.accordion-item:hover {
    border-color: var(--primary-color);
    box-shadow: var(--shadow-md);
}

.accordion-item.has-voting {
    position: relative;
}

.accordion-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1.25rem;
    padding: 1rem 1.25rem;
    cursor: pointer;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark, var(--primary-color)) 100%);
    color: white;
    transition: var(--transition);
}

.accordion-header:hover {
    filter: brightness(1.1);
}

.accordion-header-content {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex: 1 1 auto;
    min-width: 0;
}

.accordion-header .category-icon {
    /* Important: the base .category-icon rule uses margin: 0 auto 1rem
       to centre the icon ABOVE the title in the grid layout. Inside a
       flex container that auto margin pushes the icon hard against the
       inline-start edge and grows the gap to the title, leaving the
       category name floating mid-card. Force margin: 0 here so the
       icon stays in the natural flex flow next to the title. */
    width: 56px !important;
    height: 56px !important;
    margin: 0 !important;
    padding: 6px;
    flex-shrink: 0;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.14);
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.18) inset;
    object-fit: contain;
}

.accordion-header .category-emoji {
    font-size: 2rem;
    margin-bottom: 0;
    line-height: 1;
    flex-shrink: 0;
    width: 56px;
    height: 56px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.14);
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.18) inset;
}

.accordion-header h3 {
    font-size: 1.15rem;
    font-weight: 700;
    color: white;
    margin: 0;
    line-height: 1.3;
    word-break: break-word;
    overflow-wrap: anywhere;
    min-width: 0;
}

.accordion-header .voting-badge {
    position: static;
    margin-left: 0.75rem;
}

.accordion-toggle {
    background: white;
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    flex-shrink: 0;
}

.accordion-toggle:hover {
    background: var(--primary-color);
    color: white;
}

.accordion-toggle i {
    transition: transform 0.3s ease;
}

.accordion-item.collapsed .accordion-toggle i {
    transform: rotate(-90deg);
}

.accordion-body {
    max-height: 1000px;
    overflow: hidden;
    transition: max-height 0.4s ease;
}

.accordion-item.collapsed .accordion-body {
    max-height: 0;
}

.accordion-body .category-description {
    background: var(--bg-alt);
    padding: 1rem;
    border-radius: var(--radius-md);
    margin-bottom: 1rem;
}

.accordion-body .vote-button {
    margin-top: 0;
}

.accordion-body .voting-info {
    margin-top: 0;
    padding-top: 0;
    border-top: none;
}

/* Judges accordion — reuses .accordion-item / -header / -toggle / -body but with
   a circular avatar in the header slot and judge meta (name + title/org) inline. */
.judges-accordion {
    max-width: 900px;
    margin: 0 auto;
}

.judges-accordion .accordion-header-content {
    align-items: center;
    gap: 1rem;
}

.judges-accordion .judge-accordion-avatar {
    width: 56px;
    height: 56px;
    flex-shrink: 0;
    border-radius: 50%;
    object-fit: cover;
    margin: 0;
    border: 2px solid rgba(255, 255, 255, 0.45);
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.08);
    background: rgba(255, 255, 255, 0.12);
}

.judges-accordion .judge-accordion-avatar-placeholder {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-weight: 700;
    font-size: 1rem;
    letter-spacing: 0.04em;
    background: rgba(255, 255, 255, 0.18);
}

.judges-accordion .judge-accordion-meta {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.judges-accordion .accordion-header h3 {
    margin: 0;
}

.judges-accordion .judge-accordion-subtitle {
    margin: 0.15rem 0 0;
    font-size: 0.85rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.85);
    overflow-wrap: anywhere;
}

.judges-accordion .accordion-body {
    padding: 1.25rem 1.5rem;
    transition: max-height 0.4s ease, padding 0.4s ease;
}

/* Collapsed: zero the body's own vertical padding so no white space shows
   under the header. (Category bodies have no direct padding — it lives on
   inner children that max-height:0 clips — so they never had this gap.) */
.judges-accordion .accordion-item.collapsed .accordion-body {
    padding-top: 0;
    padding-bottom: 0;
}

.judges-accordion .accordion-body .judge-bio {
    color: var(--text-secondary);
    line-height: 1.6;
    margin: 0 0 1rem;
    white-space: pre-line;
}

.judges-accordion .accordion-body .judge-links {
    display: flex;
    justify-content: flex-start;
    gap: 0.75rem;
    margin: 0;
    padding-top: 0;
    border-top: none;
}

/* ===================================
   JUDGES SECTION
   =================================== */
.judges-section {
    /* background set dynamically via alternating classes */
}

/* Flexbox (not grid) so the last row of judges centers when it isn't full.
   The CSS variable --judge-cards-per-row drives the per-card flex-basis at
   each breakpoint — same 4 → 3 → 2 → 1 progression as before. */
.judges-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1.5rem;
    max-width: 1200px;
    margin: 0 auto;
    --judge-cards-per-row: 4;
}

.judges-grid .judge-card {
    /* Solve `n * card + (n-1) * gap = 100%` for card width, where n is the
       configured cards-per-row. Gap is 1.5rem. */
    flex: 1 1 calc((100% - (var(--judge-cards-per-row) - 1) * 1.5rem) / var(--judge-cards-per-row));
    max-width: calc((100% - (var(--judge-cards-per-row) - 1) * 1.5rem) / var(--judge-cards-per-row));
}

@media (max-width: 1200px) {
    .judges-grid { --judge-cards-per-row: 3; }
}
@media (max-width: 900px) {
    .judges-grid { --judge-cards-per-row: 2; }
}
@media (max-width: 560px) {
    .judges-grid { --judge-cards-per-row: 1; }
}

.judge-card {
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    padding: 1.75rem 1.5rem 1.5rem;
    text-align: center;
    /* Stronger resting shadow so cards feel like real objects on the page
       (was --shadow-sm). The lift on hover is also more pronounced. */
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.06), 0 8px 24px rgba(15, 23, 42, 0.05);
    /* Subtle accent tint at rest — lifts cards off the section bg without
       shouting. Uses the theme primary at very low alpha so it always
       matches whatever palette the organiser has set. */
    border: 1px solid rgba(70, 101, 241, 0.08);
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
    cursor: pointer;
}

@media (min-width: 768px) {
    .judge-card:hover {
        transform: translateY(-4px);
        box-shadow: 0 8px 18px rgba(15, 23, 42, 0.08), 0 18px 42px rgba(15, 23, 42, 0.1);
        border-color: var(--primary-color);
    }
}
.judge-card:hover {
    box-shadow: 0 6px 16px rgba(15, 23, 42, 0.08), 0 14px 32px rgba(15, 23, 42, 0.08);
    border-color: var(--primary-color);
}

.judge-card.expanded {
    border-color: var(--primary-color);
    box-shadow: var(--shadow-lg);
}

/* Hidden judges (beyond initial 8) */
.judges-grid .judge-card.hidden-judge {
    display: none !important;
}

.judges-grid .judge-card.hidden-judge.visible {
    display: block !important;
}

.judge-avatar {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    margin: 0 auto 1rem;
    object-fit: cover;
    border: 3px solid var(--primary-color);
    transition: var(--transition);
}

.judge-card:hover .judge-avatar,
.judge-card.expanded .judge-avatar {
    border-color: var(--primary-dark);
    transform: scale(1.05);
}

.judge-avatar-placeholder {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    margin: 0 auto 1rem;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 2.5rem;
    font-weight: 700;
    border: 3px solid var(--primary-color);
    transition: var(--transition);
}

.judge-card:hover .judge-avatar-placeholder,
.judge-card.expanded .judge-avatar-placeholder {
    transform: scale(1.05);
}

.judge-name {
    font-size: 1.125rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
    color: var(--primary-color);
    transition: var(--transition);
}

.judge-card:hover .judge-name {
    color: var(--primary-dark);
}

/* Slightly darker secondary text so role/company are easier to read on
   the printed card, and bumped to 0.85rem / 0.9rem for better balance.
   A clear gap between the two lines avoids the previous cramped feel. */
.judge-title {
    color: #475569;
    font-size: 0.85rem;
    line-height: 1.45;
    margin-bottom: 0.45rem;
    font-weight: 500;
}

.judge-organization {
    color: #334155;
    font-weight: 600;
    font-size: 0.9rem;
    line-height: 1.45;
    margin-bottom: 0.9rem;
}

/* Shared by the hosted page and the export's canonical stylesheet. Explicit
   card colours still take precedence through the theme's resolved overrides. */
.dark-landing .judge-card h3 { color: #f1f5f9; }
.dark-landing .judge-card .judge-title,
.dark-landing .judge-card .judge-organization,
.dark-landing .judge-card .judge-org,
.dark-landing .judge-card .judge-expand-indicator,
.dark-landing .judge-card .judge-link { color: #94a3b8; }
.dark-landing .judge-card .judge-bio { color: #cbd5e1; }

/* Expandable bio section */
.judge-bio-container {
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: max-height 0.3s ease, opacity 0.3s ease, margin 0.3s ease;
    margin-top: 0;
}

.judge-card.expanded .judge-bio-container {
    max-height: 300px;
    opacity: 1;
    margin-top: 0.75rem;
}

.judge-bio {
    color: var(--text-secondary);
    font-size: 0.85rem;
    line-height: 1.6;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border-color);
    text-align: left;
}

/* Expand indicator */
.judge-expand-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    color: var(--text-secondary);
    font-size: 0.75rem;
    margin-top: 0.5rem;
    transition: var(--transition);
}

.judge-expand-indicator i {
    font-size: 0.7rem;
    transition: transform 0.3s ease;
}

.judge-card.expanded .judge-expand-indicator i {
    transform: rotate(180deg);
}

.judge-card:hover .judge-expand-indicator {
    color: var(--primary-color);
}

.judge-expertise {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    justify-content: center;
    margin-bottom: 0.5rem;
}

.expertise-tag {
    background: var(--bg-light);
    color: var(--text-secondary);
    padding: 0.2rem 0.5rem;
    border-radius: var(--radius-sm);
    font-size: 0.7rem;
    font-weight: 500;
}

.judge-links {
    display: flex;
    justify-content: center;
    gap: 0.75rem;
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border-color);
}

.judge-link {
    color: var(--text-secondary);
    font-size: 1.125rem;
    transition: var(--transition);
}

.judge-link:hover {
    color: var(--primary-color);
}

/* Show More Judges Button */
.show-more-container {
    text-align: center;
    margin-top: 2rem;
}

.show-more-btn {
    background: transparent;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
    padding: 0.75rem 2rem;
    border-radius: var(--radius-lg);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.show-more-btn:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.show-more-btn i {
    transition: transform 0.3s ease;
}

.show-more-btn.expanded i {
    transform: rotate(180deg);
}

/* ===================================
   ENTRY FORM SECTION
   =================================== */
.entry-form-section {
    /* background set dynamically via alternating classes */
}

.form-container {
    max-width: 800px;
    margin: 0 auto;
    background: var(--bg-white);
    padding: 0 3rem 3rem 3rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
}

#formFields {
    padding-top: 2rem;
}

.entry-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.form-group:last-child {
    margin-bottom: 0;
}

.form-group label {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0;
}

.form-group .quill-entry-editor,
.form-group .ql-container,
.form-group .ql-toolbar {
    margin-top: 0 !important;
}

.form-group .ql-toolbar {
    border-top-left-radius: 0.5rem;
    border-top-right-radius: 0.5rem;
}

.form-group .ql-container {
    border-bottom-left-radius: 0.5rem;
    border-bottom-right-radius: 0.5rem;
}

@media (max-width: 640px) {
    .entry-form .ql-toolbar.ql-snow {
        padding: 4px 6px;
    }

    .entry-form .ql-toolbar.ql-snow .ql-formats {
        margin-right: 6px;
    }

    .entry-form .ql-toolbar.ql-snow button {
        width: 24px;
        height: 22px;
        padding: 3px;
    }

    .entry-form .ql-toolbar.ql-snow button svg {
        width: 15px;
        height: 15px;
    }
}

.required {
    color: var(--error-color);
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="url"],
.form-group input[type="number"],
.form-group input[type="date"],
.form-group textarea,
.form-group select {
    padding: 0.75rem 1rem;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-family: inherit;
    transition: var(--transition);
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(70, 101, 241, 0.1);
}

.form-group textarea {
    resize: vertical;
    min-height: 100px;
}

/* Help / supporting text — unified styling so every variant lands on
   the same baseline regardless of which CSS class the field uses. The
   entry-form override in the inline <style> block (Label Text Colour)
   sets the colour; this rule sets size/weight/spacing so they all
   match each other. */
.help-text,
.form-hint,
.field-hint,
.form-group small,
.entry-form small {
    display: block;
    width: 100%;
    font-size: 0.85rem;
    font-weight: 400;
    line-height: 1.45;
    color: var(--text-secondary);
    margin: 0.25rem 0 0.5rem;
    font-family: inherit;
}

.dark-landing .entry-form label,
.dark-landing .entry-form legend,
.dark-landing .entry-form .sub-field label,
.dark-landing .entry-form .checkbox-option label,
.dark-landing .entry-form .radio-option label {
    color: #e2e8f0;
}

.dark-landing .entry-form .help-text,
.dark-landing .entry-form .form-hint,
.dark-landing .entry-form .field-hint,
.dark-landing .entry-form .form-group small,
.dark-landing .entry-form small {
    color: #cbd5e1;
    opacity: 1;
}

.dark-landing .entry-form .required {
    color: #fca5a5;
}

/* Content Box — display-only informational field on the entry form.
   Mirrors the builder/preview/export treatment. Body text inherits the
   form colour so it adapts to light/dark; titles use saturated accents. */
.content-box {
    border-radius: 8px;
    padding: 1rem 1.25rem;
    border-left: 4px solid #3b82f6;
    background: rgba(59, 130, 246, 0.08);
}
.content-box__title {
    font-weight: 700;
    margin-bottom: 0.4rem;
    color: #1d4ed8;
    font-size: 1.02rem;
}
.content-box__body {
    line-height: 1.55;
    color: inherit;
}
.content-box__body a {
    color: #2563eb;
    text-decoration: underline;
    word-break: break-word;
}
.content-box--warning { border-left-color: #f59e0b; background: rgba(245, 158, 11, 0.10); }
.content-box--warning .content-box__title { color: #b45309; }
.content-box--success { border-left-color: #10b981; background: rgba(16, 185, 129, 0.10); }
.content-box--success .content-box__title { color: #047857; }
.content-box--note    { border-left-color: #6b7280; background: rgba(107, 114, 128, 0.10); }
.content-box--note .content-box__title { color: #374151; }

.checkbox-option,
.radio-option {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0;
}

.checkbox-option input[type="checkbox"],
.radio-option input[type="radio"] {
    width: 1.25rem;
    height: 1.25rem;
    cursor: pointer;
}

.checkbox-option label,
.radio-option label {
    cursor: pointer;
    font-weight: 400;
}

/* Declaration / Agreement checkbox: the statement can be a long sentence, so
   the label must use the full available width and wrap naturally across lines,
   with the checkbox pinned to the first line rather than vertically centred. */
.checkbox-option.declaration-checkbox {
    align-items: flex-start;
}
.checkbox-option.declaration-checkbox input[type="checkbox"] {
    flex-shrink: 0;
    margin-top: 0.2rem;
}
.checkbox-option.declaration-checkbox label {
    flex: 1 1 auto;
    min-width: 0;
    line-height: 1.5;
}

/* Awards checkboxes with descriptions */
.awards-checkboxes {
    display: flex;
    flex-direction: column;
    gap: 0;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #e5e7eb;
}

.award-category-item {
    padding: 1rem;
    transition: all 0.2s ease;
}

.award-category-item.even {
    background-color: #f9fafb;
}

.award-category-item.odd {
    background-color: #ffffff;
}

.award-category-item:not(:last-child) {
    border-bottom: 1px solid #e5e7eb;
}

.award-category-item:hover {
    background-color: #f0f9ff;
}

.award-category-item:has(input:checked) {
    background-color: #eff6ff;
}

.awards-checkboxes .checkbox-option {
    padding: 0;
    align-items: center;
}

.awards-checkboxes .checkbox-option input[type="checkbox"] {
    flex-shrink: 0;
}

.awards-checkboxes .checkbox-option label {
    display: flex;
    align-items: center;
}

.awards-checkboxes .category-name {
    font-weight: 600;
    color: #1f2937;
    font-size: 1rem;
}

.awards-checkboxes .category-description {
    font-size: 0.875rem;
    color: #6b7280;
    line-height: 1.5;
    font-weight: 400;
    margin-top: 0.5rem;
    padding-left: 2rem;
}

.award-category-item:has(input:checked) .category-name {
    color: var(--primary-color);
}

.award-category-item:has(input:checked) .category-description {
    color: #4b5563;
}

.form-actions {
    margin-top: 1rem;
}

.submit-button {
    width: 100%;
    background: var(--primary-color);
    color: white;
    padding: 1rem 2rem;
    border: none;
    border-radius: var(--radius-md);
    font-size: 1.125rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.submit-button:hover:not(:disabled) {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.submit-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* ===================================
   MESSAGES & LOADING
   =================================== */
.loading-spinner {
    text-align: center;
    padding: 3rem;
    color: var(--text-secondary);
    font-size: 1.125rem;
}

.loading-spinner i {
    font-size: 2rem;
    margin-bottom: 1rem;
    display: block;
}

.success-message,
.info-message,
.error-message {
    padding: 2rem;
    border-radius: var(--radius-md);
    text-align: center;
}

.success-message {
    background: #d1fae5;
    color: #065f46;
}

.info-message {
}

.info-message-blue {
    background: #e0f2fe;
    color: #0c4a6e;
}
.warning-message {
}

.dark-landing .success-message {
    background: #064e3b;
    color: #d1fae5;
    border: 1px solid #10b981;
}

.dark-landing .info-message,
.dark-landing .info-message-blue {
    background: #0c4a6e;
    color: #e0f2fe;
    border: 1px solid #38bdf8;
}

.dark-landing .warning-message {
    background: #78350f;
    color: #fef3c7;
    border: 1px solid #f59e0b;
}

.dark-landing .success-message h3,
.dark-landing .success-message p,
.dark-landing .info-message h3,
.dark-landing .info-message p,
.dark-landing .info-message-blue h3,
.dark-landing .info-message-blue p,
.dark-landing .warning-message h3,
.dark-landing .warning-message p {
    color: inherit;
}

.dark-landing .form-verify-notice {
    background: #0c4a6e !important;
    color: #e0f2fe !important;
    border-left-color: #38bdf8 !important;
}

.dark-landing .form-verify-notice strong {
    color: #ffffff !important;
}

.error-message {
    background: #fee2e2;
    color: #991b1b;
}

.success-message i,
.info-message i,
.info-message-blue i,
.warning-message i,
.error-message i {
    font-size: 3rem;
    margin-bottom: 1rem;
    display: block;
}

.success-message h3 {
    margin-bottom: 0.5rem;
}

/* "Check your inbox to verify your email" card — sits inside the green
   success-message after a public submission. Visually distinct (amber)
   so the verify CTA reads as a separate next-step. */
.verify-inbox-card {
    margin: 1.5rem auto 0;
    max-width: 480px;
    padding: 1.75rem 1.5rem 1.5rem;
    background: #fffbeb;
    border: 1px solid #fcd34d;
    border-radius: var(--radius-md, 0.5rem);
    text-align: center;
    color: #78350f;
    box-shadow: 0 4px 14px rgba(251, 191, 36, 0.12);
}

.verify-inbox-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: #fef3c7;
    color: #b45309;
}

.verify-inbox-icon i {
    font-size: 1.875rem;
    /* Override the broad .success-message i { display:block } so the icon
       sits centred inside the circular badge instead of stretching full
       width. */
    display: inline;
    margin: 0;
}

.verify-inbox-heading {
    margin: 0 0 0.75rem;
    font-size: 1.125rem;
    font-weight: 700;
    color: #92400e;
    line-height: 1.35;
}

.verify-inbox-body {
    margin: 0 0 1rem;
    font-size: 0.95rem;
    line-height: 1.55;
    color: #78350f;
}

.verify-inbox-body strong {
    display: inline-block;
    margin-top: 0.25rem;
    padding: 0.25rem 0.625rem;
    background: rgba(245, 158, 11, 0.12);
    border-radius: 999px;
    font-weight: 600;
    word-break: break-all;
}

.verify-inbox-deadline {
    margin: 0;
    padding-top: 0.875rem;
    border-top: 1px dashed #fcd34d;
    font-size: 0.9rem;
    line-height: 1.55;
    color: #78350f;
}

.verify-inbox-deadline strong {
    color: #b45309;
}

.verify-inbox-capped {
    margin: 0.75rem 0 0;
    font-size: 0.85rem;
    line-height: 1.5;
    color: #92400e;
    font-style: italic;
}

.dark-landing .verify-inbox-card {
    background: #78350f;
    border-color: #f59e0b;
    color: #fef3c7;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.24);
}

.dark-landing .verify-inbox-icon {
    background: rgba(254, 243, 199, 0.14);
    color: #fde68a;
}

.dark-landing .verify-inbox-heading,
.dark-landing .verify-inbox-body,
.dark-landing .verify-inbox-deadline,
.dark-landing .verify-inbox-capped {
    color: #fef3c7;
}

.dark-landing .verify-inbox-body strong {
    background: rgba(254, 243, 199, 0.14);
    color: #ffffff;
}

.dark-landing .verify-inbox-deadline {
    border-top-color: rgba(254, 243, 199, 0.35);
}

.dark-landing .verify-inbox-deadline strong {
    color: #ffffff;
}

/* ===================================
   TERMS SECTION
   =================================== */
.terms-section {
    /* background set dynamically via alternating classes */
}

.terms-content {
    max-width: 800px;
    margin: 0 auto;
    line-height: 1.8;
}

.terms-content h3 {
    font-size: 1.5rem;
    margin-top: 2rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.terms-content h3:first-child {
    margin-top: 0;
}

.terms-content p {
    margin-bottom: 1rem;
    color: var(--text-secondary);
}

.terms-content ul,
.terms-content ol {
    margin-left: 2rem;
    margin-bottom: 1rem;
}

.terms-content ul li,
.terms-content ol li {
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
}

.terms-content a {
    color: var(--primary-color);
    text-decoration: none;
}

.terms-content a:hover {
    text-decoration: underline;
}

/* ===================================
   ERROR PAGE
   =================================== */
.error-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-light);
}

.error-page .error-message {
    text-align: center;
    padding: 3rem;
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    max-width: 500px;
}

.error-page .error-message i {
    font-size: 4rem;
    color: var(--error-color);
    margin-bottom: 1rem;
}

.error-page .error-message h1 {
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.error-page .error-message p {
    color: var(--text-secondary);
}

/* ===================================
   FAQ SECTION
   =================================== */
.faq-section {
    /* background set dynamically via alternating classes */
}

.faq-list {
    max-width: 800px;
    margin: 0 auto;
}

.faq-item {
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    margin-bottom: 1rem;
    overflow: hidden;
}

.faq-question {
    width: 100%;
    padding: 1.25rem 1.5rem;
    background: none;
    border: none;
    text-align: left;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    transition: var(--transition);
}

.faq-question:hover {
    background: var(--bg-light);
}

.faq-question i {
    transition: transform 0.3s ease;
    color: var(--primary-color);
}

.faq-item.active .faq-question i {
    transform: rotate(180deg);
}

.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, padding 0.3s ease;
}

.faq-item.active .faq-answer {
    max-height: 500px;
    padding: 0 1.5rem 1.25rem;
}

.faq-answer p {
    color: var(--text-secondary);
    line-height: 1.7;
}

/* ===================================
   SPONSORS SECTION
   =================================== */
.sponsors-section {
    /* background set dynamically via alternating classes */
}

/* Sponsors grid: flex-wrap with justify-content: center so any orphan row
   (e.g. 9 sponsors → 4+4+1) is centred. Container width is capped to fit
   exactly --sponsors-cols cards across, so the row count stays predictable. */
.sponsors-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: stretch;
    gap: 1.5rem 2rem;
    margin: 0 auto;
    max-width: calc(var(--sponsors-cols, 3) * 240px + (var(--sponsors-cols, 3) - 1) * 2rem);
}

.sponsors-grid .sponsor-card {
    flex: 0 0 240px;
    width: 240px;
}

@media (max-width: 900px) {
    .sponsors-grid {
        max-width: calc(2 * 240px + 2rem);
    }
}

@media (max-width: 480px) {
    .sponsors-grid {
        max-width: 280px;
    }
    .sponsors-grid .sponsor-card {
        flex: 0 0 100%;
        width: 100%;
    }
}

/* Sponsors carousel: same card visuals as the grid, but inside a Swiper. */
.sponsors-swiper {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 2.5rem 2.5rem;
}

.sponsors-swiper .swiper-slide {
    height: auto;
    display: flex;
}

.sponsors-swiper .swiper-slide .sponsor-card {
    width: 100%;
}

.sponsor-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    text-align: center;
    gap: 0.75rem;
    padding: 1.75rem 1.5rem;
    background: var(--bg-white);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    text-decoration: none;
    color: var(--text-primary);
    width: 100%;
    max-width: 100%;
}

.sponsor-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.sponsor-card .sponsor-logo,
.sponsor-card img {
    max-height: 70px;
    max-width: 180px;
    object-fit: contain;
    margin: 0 0 0.25rem;
}

.sponsor-card .sponsor-name {
    margin: 0;
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.3;
    color: var(--text-primary);
    overflow-wrap: anywhere;
}

.sponsor-card .sponsor-description {
    margin: 0.35rem 0 0;
    font-size: 0.85rem;
    line-height: 1.5;
    color: var(--text-secondary);
    overflow-wrap: anywhere;
}

/* ===================================
   NO DATA STATE
   =================================== */
.no-data {
    text-align: center;
    padding: 2rem;
    color: var(--text-secondary);
    font-style: italic;
}

/* ===================================
   FOOTER
   =================================== */
.main-footer {
    background: var(--text-primary);
    color: white;
    padding: 3rem 0 1.5rem;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-section h4 {
    margin-bottom: 1rem;
    font-size: 1.125rem;
}

.footer-section ul {
    list-style: none;
}

.footer-section ul li {
    margin-bottom: 0.5rem;
}

.footer-section a {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: var(--transition);
}

.footer-section a:hover {
    color: white;
}

.social-links {
    display: flex;
    gap: 1rem;
}

.social-links a {
    font-size: 1.5rem;
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 1.5rem;
    text-align: center;
    color: rgba(255, 255, 255, 0.7);
}

/* ===================================
   MODAL
   =================================== */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    animation: fadeIn 0.3s ease;
}

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: var(--bg-white);
    padding: 2rem;
    border-radius: var(--radius-lg);
    max-width: 500px;
    width: 90%;
    box-shadow: var(--shadow-xl);
    animation: slideUp 0.3s ease;
}

.modal-close {
    float: right;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-secondary);
}

.modal-close:hover {
    color: var(--text-primary);
}

.modal-content h3 {
    margin-bottom: 1rem;
    color: var(--error-color);
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from {
        transform: translateY(50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* ===================================
   RESPONSIVE DESIGN
   =================================== */
@media (max-width: 900px) {
    .main-nav {
        display: none;
    }

    .mobile-menu-toggle {
        display: block;
    }

    .hero-content h1 {
        font-size: 2rem;
    }

    .hero-description {
        font-size: 1rem;
    }

    .hero-stats {
        gap: 1.5rem;
    }

    .stat-number {
        font-size: 2rem;
    }

    .section-title {
        font-size: 2rem;
    }

    /* Mobile: drop the per-card max-width cap so a lone card fills the
       narrow viewport instead of leaving empty side margins. */
    .category-card {
        max-width: none;
    }

    .categories-grid:not(.categories-expanded) .category-card.mobile-category-card-overflow {
        display: none;
    }

    .categories-toggle-wrap {
        display: flex;
    }


    .form-container {
        padding: 1.5rem;
    }

    .footer-content {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 1rem;
    }

    .hero-section {
        padding: 3rem 0;
    }

    .hero-content h1 {
        font-size: 1.75rem;
    }

    section {
        padding: 3rem 0;
    }

    .program-title {
        font-size: 1rem;
    }
}

/* ===================================
   RESPONSIVE LAYOUT (Desktop/Mobile switching)
   =================================== */
.judges-desktop-only {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
}

.judges-mobile-only {
    display: none;
}

.desktop-only {
    display: block;
}

@media (max-width: 1200px) {
    .judges-desktop-only {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 900px) {
    .judges-desktop-only {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 767px) {
    .judges-desktop-only {
        display: none !important;
    }

    .judges-mobile-only {
        display: block !important;
    }

    .desktop-only {
        display: none !important;
    }
}

/* ===================================
   SWIPER CAROUSEL STYLES
   =================================== */
.categories-swiper,
.judges-swiper,
.sponsors-swiper {
    position: relative;
    /* Tighter than the original 50px — arrows sit just outside the cards
       (not floating in a 50px ditch). The arrow itself is 44px wide so
       it sits half-on / half-off the card edge for a connected feel. */
    padding: 0 28px;
}

.categories-swiper .swiper,
.judges-swiper .swiper,
.sponsors-swiper .swiper {
    /* Reserve space for pagination dots BELOW the slides without pushing
       the geometric centre of the swiper down (which would offset the
       nav arrows). The arrow rule below compensates explicitly. */
    padding-bottom: 44px;
}

.categories-swiper .swiper-slide,
.judges-swiper .swiper-slide,
.sponsors-swiper .swiper-slide {
    height: auto;
}

.categories-swiper .swiper-slide .category-card,
.judges-swiper .swiper-slide .judge-card,
.sponsors-swiper .swiper-slide .sponsor-card {
    height: 100%;
    margin: 0;
}

/* Swiper navigation buttons — theme-driven, anchored close to the
   carousel content (not floating in empty padding), with visible
   contrast against both light and dark card backgrounds. */
.categories-swiper .swiper-button-prev,
.categories-swiper .swiper-button-next,
.judges-swiper .swiper-button-prev,
.judges-swiper .swiper-button-next,
.sponsors-swiper .swiper-button-prev,
.sponsors-swiper .swiper-button-next {
    color: var(--primary-color);
    background: var(--bg-white);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.18), 0 0 0 1px rgba(15, 23, 42, 0.06);
    z-index: 20;
    pointer-events: auto;
    /* Compensate for the pagination padding inside .swiper — without
       this the geometric centre Swiper picks sits 22px low. */
    top: 50%;
    transform: translateY(calc(-50% - 22px));
    margin-top: 0;
    transition: background-color 0.18s ease, color 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
}

.categories-swiper .swiper-button-prev:after,
.categories-swiper .swiper-button-next:after,
.judges-swiper .swiper-button-prev:after,
.judges-swiper .swiper-button-next:after,
.sponsors-swiper .swiper-button-prev:after,
.sponsors-swiper .swiper-button-next:after {
    font-size: 16px;
    font-weight: 900;
}

.categories-swiper .swiper-button-prev,
.judges-swiper .swiper-button-prev,
.sponsors-swiper .swiper-button-prev {
    left: 0;
}

.categories-swiper .swiper-button-next,
.judges-swiper .swiper-button-next,
.sponsors-swiper .swiper-button-next {
    right: 0;
}

.categories-swiper .swiper-button-prev:hover,
.categories-swiper .swiper-button-next:hover,
.judges-swiper .swiper-button-prev:hover,
.judges-swiper .swiper-button-next:hover,
.sponsors-swiper .swiper-button-prev:hover,
.sponsors-swiper .swiper-button-next:hover {
    color: var(--bg-white);
    background: var(--primary-color);
    transform: translateY(calc(-50% - 22px)) scale(1.06);
    box-shadow: 0 6px 18px rgba(15, 23, 42, 0.22), 0 0 0 1px var(--primary-color);
}

/* Hide arrows when Swiper marks them as locked (only one slide / can't
   loop) or disabled (at end with loop off). Native Swiper sets these
   classes — we just give them a deterministic visual treatment. */
.categories-swiper .swiper-button-lock,
.judges-swiper .swiper-button-lock,
.sponsors-swiper .swiper-button-lock {
    display: none;
}
.categories-swiper .swiper-button-disabled,
.judges-swiper .swiper-button-disabled,
.sponsors-swiper .swiper-button-disabled {
    opacity: 0;
    pointer-events: none;
}

/* Mobile — slightly smaller arrows tucked tighter so they don't crowd
   cards or overflow the viewport edge. */
@media (max-width: 640px) {
    .categories-swiper,
    .judges-swiper,
    .sponsors-swiper {
        padding: 0 8px;
    }
    .categories-swiper .swiper-button-prev,
    .categories-swiper .swiper-button-next,
    .judges-swiper .swiper-button-prev,
    .judges-swiper .swiper-button-next,
    .sponsors-swiper .swiper-button-prev,
    .sponsors-swiper .swiper-button-next {
        width: 36px;
        height: 36px;
    }
    .categories-swiper .swiper-button-prev:after,
    .categories-swiper .swiper-button-next:after,
    .judges-swiper .swiper-button-prev:after,
    .judges-swiper .swiper-button-next:after,
    .sponsors-swiper .swiper-button-prev:after,
    .sponsors-swiper .swiper-button-next:after {
        font-size: 13px;
    }
}

/* Swiper pagination */
.categories-swiper .swiper-pagination,
.judges-swiper .swiper-pagination,
.sponsors-swiper .swiper-pagination {
    bottom: 10px;
}

.categories-swiper .swiper-pagination-bullet,
.judges-swiper .swiper-pagination-bullet,
.sponsors-swiper .swiper-pagination-bullet {
    background: var(--secondary-color);
    opacity: 0.5;
}

.categories-swiper .swiper-pagination-bullet-active,
.judges-swiper .swiper-pagination-bullet-active,
.sponsors-swiper .swiper-pagination-bullet-active {
    background: var(--primary-color);
    opacity: 1;
}

/* Mobile-only carousel styles - show as grid on desktop, swiper on mobile */
@media (min-width: 768px) {
    .carousel-mobile-only {
        padding: 0;
    }

    .carousel-mobile-only .swiper {
        padding-bottom: 0;
    }

    .carousel-mobile-only .swiper-button-prev,
    .carousel-mobile-only .swiper-button-next,
    .carousel-mobile-only .swiper-pagination {
        display: none;
    }

    /* Categories on desktop: flex (not grid) so a partial last row centers.
       The fixed-width `.swiper-slide` keeps full rows looking the same as
       before (cards align flush) and lets `justify-content: center` kick in
       only when there aren't enough cards to fill the row. */
    .categories-swiper.carousel-mobile-only .swiper-wrapper {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: 1.5rem;
    }
    .categories-swiper.carousel-mobile-only .swiper-slide {
        flex: 1 1 280px;
        min-width: 260px;
        max-width: 380px;
    }
    .categories-swiper.carousel-mobile-only:not(.categories-expanded) .swiper-slide.category-card-overflow {
        display: none;
    }
    .categories-toggle-wrap.carousel-mobile-desktop-toggle {
        display: flex;
    }

    /* Judges on desktop: same flex+center pattern. CSS variable drives the
       per-row count so we can shrink it at narrower viewports. */
    .judges-swiper.carousel-mobile-only .swiper-wrapper {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: 1.5rem;
        max-width: 1200px;
        margin: 0 auto;
        --judge-cards-per-row: 4;
    }
    .judges-swiper.carousel-mobile-only .swiper-slide {
        flex: 1 1 calc((100% - (var(--judge-cards-per-row) - 1) * 1.5rem) / var(--judge-cards-per-row));
        max-width: calc((100% - (var(--judge-cards-per-row) - 1) * 1.5rem) / var(--judge-cards-per-row));
    }

    @media (max-width: 1200px) {
        .judges-swiper.carousel-mobile-only .swiper-wrapper { --judge-cards-per-row: 3; }
    }
    @media (max-width: 900px) {
        .judges-swiper.carousel-mobile-only .swiper-wrapper { --judge-cards-per-row: 2; }
    }

    .carousel-mobile-only .swiper-slide {
        margin-right: 0 !important;
    }

    /* Hidden judges in carousel-mobile layout (beyond initial 8) */
    .judges-swiper.carousel-mobile-only .swiper-slide.hidden-judge {
        display: none !important;
    }

    .judges-swiper.carousel-mobile-only .swiper-slide.hidden-judge.visible {
        display: block !important;
    }
}

@media (max-width: 767px) {
    .categories-toggle-wrap.carousel-mobile-desktop-toggle {
        display: none;
    }
    .categories-swiper,
    .judges-swiper {
        padding: 0 35px;
    }

    .categories-swiper .swiper-button-prev,
    .categories-swiper .swiper-button-next,
    .judges-swiper .swiper-button-prev,
    .judges-swiper .swiper-button-next {
        width: 30px;
        height: 30px;
    }

    .categories-swiper .swiper-button-prev:after,
    .categories-swiper .swiper-button-next:after,
    .judges-swiper .swiper-button-prev:after,
    .judges-swiper .swiper-button-next:after {
        font-size: 14px;
    }

    /* Hide nav buttons on mobile for carousel-mobile-only (swipe naturally instead) */
    .carousel-mobile-only .swiper-button-prev,
    .carousel-mobile-only .swiper-button-next {
        display: none;
    }

    .carousel-mobile-only {
        padding: 0;
    }
}

/* Field Group Styles */
.field-group-inputs {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 1rem;
}

.field-group-inputs .sub-field {
    margin-bottom: 0.75rem;
}

.field-group-inputs .sub-field:last-child {
    margin-bottom: 0;
}

.field-group-inputs .sub-field label {
    display: block;
    font-size: 0.85rem;
    font-weight: 500;
    color: #475569;
    margin-bottom: 0.25rem;
}

.field-group-inputs .sub-field input,
.field-group-inputs .sub-field textarea {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid #cbd5e1;
    border-radius: 4px;
    font-size: 0.9rem;
    box-sizing: border-box;
}

.field-group-inputs .sub-field input:focus,
.field-group-inputs .sub-field textarea:focus {
    outline: none;
    border-color: var(--primary-color, #3b82f6);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Image Gallery Field Styles */
.image-gallery-field {
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    overflow: hidden;
}

/* Plain file-upload field (type: "file") — upload status / feedback */
.file-upload-status {
    margin-top: 0.5rem;
    font-size: 0.9rem;
    min-height: 1.2em;
}
.file-upload-status .file-upload-progress {
    color: #64748b;
}
.file-upload-status .file-upload-done {
    color: #15803d;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    flex-wrap: wrap;
    margin-top: 0.35rem;
}
.file-upload-status .file-upload-done a {
    color: inherit;
    overflow-wrap: anywhere;
}
.file-upload-status .file-upload-error {
    color: #b91c1c;
}
.file-upload-status .file-upload-remove {
    background: none;
    border: none;
    color: #b91c1c;
    cursor: pointer;
    font-size: 0.8rem;
    text-decoration: underline;
    padding: 0;
}

.gallery-dropzone {
    background: #f8fafc;
    border: 2px dashed #cbd5e1;
    border-radius: 8px;
    padding: 2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    margin: 0.5rem;
}

.gallery-dropzone:hover {
    border-color: var(--primary-color, #3b82f6);
    background: #eff6ff;
}

.gallery-dropzone.drag-over {
    border-color: var(--primary-color, #3b82f6);
    background: #dbeafe;
}

.gallery-dropzone i {
    font-size: 2.5rem;
    color: #94a3b8;
    display: block;
    margin-bottom: 0.5rem;
}

.gallery-dropzone span {
    display: block;
    font-weight: 500;
    color: #475569;
    margin-bottom: 0.25rem;
}

.gallery-dropzone small {
    color: #94a3b8;
    font-size: 0.8rem;
}

.gallery-images {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
    padding: 1rem;
}

.gallery-images:empty {
    display: none;
}

.gallery-image-item {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    overflow: hidden;
    position: relative;
}

.gallery-image-item .image-preview {
    width: 100%;
    height: 150px;
    object-fit: cover;
    display: block;
}

.gallery-image-item .image-actions {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    display: flex;
    gap: 0.25rem;
}

.gallery-image-item .image-actions button {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: none;
    background: rgba(0, 0, 0, 0.5);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    transition: background 0.2s;
}

.gallery-image-item .image-actions button:hover {
    background: rgba(0, 0, 0, 0.7);
}

.gallery-image-item .image-actions button.delete-btn:hover {
    background: #dc2626;
}

.gallery-image-item .image-annotations {
    padding: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.gallery-image-item .annotation-field {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.gallery-image-item .annotation-field label {
    font-size: 0.7rem;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
}

.gallery-image-item .annotation-field input,
.gallery-image-item .annotation-field textarea {
    padding: 0.375rem 0.5rem;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    font-size: 0.8rem;
    resize: none;
    width: 100%;
    box-sizing: border-box;
}

.gallery-image-item .annotation-field input:focus,
.gallery-image-item .annotation-field textarea:focus {
    outline: none;
    border-color: var(--primary-color, #3b82f6);
}

.gallery-image-item .image-number {
    position: absolute;
    top: 0.5rem;
    left: 0.5rem;
    background: rgba(0, 0, 0, 0.6);
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 600;
}

.gallery-url-import {
    padding: 0.5rem;
    text-align: center;
    border-top: 1px solid #e2e8f0;
}

.gallery-url-import .url-import-btn {
    background: transparent;
    border: 1px dashed #cbd5e1;
    color: #64748b;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.2s ease;
}

.gallery-url-import .url-import-btn:hover {
    border-color: var(--primary-color, #3b82f6);
    color: var(--primary-color, #3b82f6);
    background: #f8fafc;
}

.gallery-url-import .url-import-btn i {
    margin-right: 0.5rem;
}

/* Gallery preview mode (disabled state) */
.image-gallery-field.preview-mode .gallery-dropzone {
    cursor: not-allowed;
    opacity: 0.7;
}

.gallery-dropzone.gallery-preview-disabled {
    background: #f1f5f9;
    border-color: #cbd5e1;
    cursor: not-allowed;
}

.gallery-dropzone .preview-notice {
    margin-top: 0.75rem;
    padding: 0.375rem 0.75rem;
    background: #fef3c7;
    color: #92400e;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 500;
    display: inline-block;
}

/* ===================================
   MOBILE PERFORMANCE OPTIMIZATIONS
   =================================== */

/* Reduce animations for users who prefer reduced motion */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }

    .swiper-wrapper {
        transition: none !important;
    }
}

/* Remove 300ms tap delay on mobile devices */
a,
button,
input,
select,
textarea,
.btn,
.nav-link,
.category-card,
.judge-card,
.accordion-header,
[role="button"] {
    touch-action: manipulation;
}

/* Improve touch target sizes on mobile */
@media (max-width: 768px) {
    a,
    button,
    .btn,
    .nav-link {
        min-height: 44px;
        min-width: 44px;
    }

    .accordion-header {
        min-height: 48px;
    }
}

/* ===================================
   WINNERS SECTION
   Default colours derive from Theme & Branding (--primary-color, --bg-white,
   --text-primary). Each --winners-* override is only set on the section when
   the organiser saved a custom value, so blank fields fall back to theme.
   =================================== */
.winners-section {
    background-color: var(--winners-bg, inherit);
    color: var(--winners-font, inherit);
}

.winners-section .section-title,
.winners-section .section-subtitle {
    color: var(--winners-font, inherit);
}

.winners-section .section-title i.fa-trophy {
    color: var(--primary-color);
    margin-right: 0.5rem;
}

.winners-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

/* Grid layout (default): switch to flex so trailing siblings on an incomplete
   final row centre naturally. --winners-cols is set inline by the renderer
   based on category count, matching the Sponsors grid pattern. */
.winners-grid.winners-layout-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: stretch;
    gap: 1.5rem;
    margin-left: auto;
    margin-right: auto;
    max-width: calc(var(--winners-cols, 3) * 320px + (var(--winners-cols, 3) - 1) * 1.5rem);
}

.winners-grid.winners-layout-grid .winner-category-card {
    flex: 0 0 320px;
    width: 320px;
}

@media (max-width: 900px) {
    .winners-grid.winners-layout-grid {
        max-width: calc(2 * 280px + 1.5rem);
    }
    .winners-grid.winners-layout-grid .winner-category-card {
        flex: 0 0 280px;
        width: 280px;
    }
}

@media (max-width: 640px) {
    .winners-grid.winners-layout-grid {
        max-width: 360px;
    }
    .winners-grid.winners-layout-grid .winner-category-card {
        flex: 0 0 100%;
        width: 100%;
    }
}

.winner-category-card {
    background: var(--winners-card-bg, var(--bg-white));
    border-radius: var(--winners-card-radius, 12px);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    /* Flex column so the entries area can expand to fill whatever the
       stretched row height ends up being. Without this, cards with 1
       entry would leave a "white strip" at the bottom — entries sit at
       the top, then a big gap of the card bg shows below. With this +
       winner-entries flex:1, the entries area fills the card body and
       the visual gap disappears. */
    display: flex;
    flex-direction: column;
}

.winner-entries {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 0;
}

.winner-category-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
}

.winner-category-header {
    display: flex;
    align-items: center;
    background: var(--winners-header-bg, var(--primary-color));
    color: var(--winners-header-font, #fff);
    padding: 1rem 1.25rem;
}

.winner-category-header h3 {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 600;
}


.winner-entry {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1.25rem;
    border-bottom: 1px solid color-mix(in srgb, currentColor 10%, transparent);
    /* Each entry shares the available card-body height equally — a card
       with one entry has one tall entry (its content vertically centered
       via align-items: center above), a card with three has three normal
       entries. This is what prevents the "white strip above/below" on a
       short card when the row stretches the card to align with its
       siblings. */
    flex: 1;
}

.winner-entry:last-child {
    border-bottom: none;
}

/* 1st place: subtle primary-tinted gradient + 3px primary left border */
.winner-entry.winner-first {
    background: linear-gradient(90deg,
        color-mix(in srgb, var(--primary-color) 16%, transparent) 0%,
        color-mix(in srgb, var(--primary-color) 4%, transparent) 100%);
    border-left: 3px solid var(--primary-color);
    padding-left: calc(1.25rem - 3px);
}

.winner-rank {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: color-mix(in srgb, currentColor 10%, transparent);
    color: color-mix(in srgb, currentColor 60%, transparent);
    font-weight: 700;
    font-size: 0.85rem;
    flex-shrink: 0;
}

.winner-first .winner-rank {
    background: var(--primary-color);
    color: #fff;
    font-size: 0.95rem;
}

.winner-first .winner-rank i.fa-trophy {
    color: #fff;
}

.winner-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.winner-title {
    font-weight: 600;
    color: var(--winners-font, inherit);
    font-size: 0.95rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.winner-company {
    color: color-mix(in srgb, currentColor 60%, transparent);
    font-size: 0.85rem;
    margin-top: 0.15rem;
}

.winners-loading,
.winners-pending {
    text-align: center;
    padding: 3rem 1rem;
    color: color-mix(in srgb, currentColor 60%, transparent);
    grid-column: 1 / -1;
}

.winners-pending i {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    color: color-mix(in srgb, currentColor 30%, transparent);
    display: block;
}

.winners-pending p {
    margin: 0;
    font-size: 1.1rem;
}

.winners-loading i {
    font-size: 1.5rem;
    margin-right: 0.5rem;
}

@media (max-width: 640px) {
    .winners-grid {
        grid-template-columns: 1fr;
    }
}

/* --- Score Badge --- */
.winner-score-badge {
    display: inline-block;
    background: color-mix(in srgb, var(--winners-bg, var(--bg-white)) 80%, var(--primary-color) 20%);
    color: var(--primary-color);
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.15rem 0.5rem;
    border-radius: 999px;
    margin-left: 0.5rem;
    vertical-align: middle;
}

/* ===================================
   WINNERS LIST LAYOUT
   =================================== */
.winners-layout-list {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.winners-list-category {
    border-bottom: 1px solid #e2e8f0;
    padding-bottom: 1rem;
    margin-bottom: 1rem;
}

.winners-list-category:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.winners-list-heading {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--winners-header-bg, var(--primary-color));
    margin: 0 0 0.75rem 0;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--winners-header-bg, var(--primary-color));
    display: inline-block;
}

.winners-list-entries {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.winners-list-entry {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 0.75rem;
    border-radius: 8px;
    transition: background 0.15s ease;
}

.winners-list-entry:hover {
    background: color-mix(in srgb, currentColor 6%, transparent);
}

.winners-list-entry.winner-first {
    background: linear-gradient(90deg,
        color-mix(in srgb, var(--primary-color) 16%, transparent) 0%,
        color-mix(in srgb, var(--primary-color) 4%, transparent) 100%);
    border-left: 3px solid var(--primary-color);
    padding-left: calc(0.75rem - 3px);
}

.winners-list-entry .winner-rank {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: color-mix(in srgb, currentColor 10%, transparent);
    color: color-mix(in srgb, currentColor 60%, transparent);
    font-weight: 700;
    font-size: 0.8rem;
    flex-shrink: 0;
}

.winners-list-entry.winner-first .winner-rank {
    background: var(--primary-color);
    color: #fff;
}

.winners-list-entry .winner-title {
    font-weight: 600;
    color: var(--winners-font, inherit);
    font-size: 0.95rem;
}

.winners-list-entry .winner-company {
    color: color-mix(in srgb, currentColor 60%, transparent);
    font-size: 0.85rem;
    margin-left: auto;
}

.winners-list-entry .winner-score-badge {
    flex-shrink: 0;
}

/* ===================================
   WINNERS PODIUM LAYOUT
   =================================== */
.winners-layout-podium {
    display: flex;
    flex-direction: column;
    gap: 2.5rem;
}

.winners-podium-category {
    text-align: center;
}

.winners-podium-heading {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--winners-header-bg, var(--primary-color));
    margin: 0 0 1.5rem 0;
}

.podium-stage {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.podium-position {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    flex: 0 1 200px;
    max-width: 200px;
}

.podium-medal {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

/* Podium hierarchy is theme-driven: 1st = full primary, 2nd & 3rd progressively
   muted. No hardcoded gold/silver/bronze. */
.podium-first .podium-medal {
    font-size: 2rem;
    color: var(--primary-color);
}

.podium-second .podium-medal {
    font-size: 1.5rem;
    color: color-mix(in srgb, var(--primary-color) 65%, transparent);
}

.podium-third .podium-medal {
    font-size: 1.3rem;
    color: color-mix(in srgb, var(--primary-color) 40%, transparent);
}

.podium-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    margin-bottom: 0.75rem;
    min-height: 3rem;
}

.podium-title {
    font-weight: 700;
    color: var(--winners-font, inherit);
    font-size: 0.95rem;
    line-height: 1.3;
}

.podium-first .podium-title {
    font-size: 1.05rem;
}

.podium-company {
    color: color-mix(in srgb, currentColor 60%, transparent);
    font-size: 0.8rem;
}

.podium-block {
    width: 100%;
    border-radius: 8px 8px 0 0;
    min-width: 80px;
}

.podium-first .podium-block {
    height: 100px;
    background: linear-gradient(180deg, var(--primary-color), color-mix(in srgb, var(--primary-color) 70%, #000));
}

.podium-second .podium-block {
    height: 70px;
    background: linear-gradient(180deg,
        color-mix(in srgb, var(--primary-color) 60%, transparent),
        color-mix(in srgb, var(--primary-color) 35%, transparent));
}

.podium-third .podium-block {
    height: 50px;
    background: linear-gradient(180deg,
        color-mix(in srgb, var(--primary-color) 35%, transparent),
        color-mix(in srgb, var(--primary-color) 18%, transparent));
}

.podium-remaining {
    max-width: 500px;
    margin: 0 auto;
    text-align: left;
}

.podium-remaining .winners-list-entry {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0.75rem;
    border-radius: 8px;
}

.podium-remaining .winner-rank {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: color-mix(in srgb, currentColor 10%, transparent);
    color: color-mix(in srgb, currentColor 60%, transparent);
    font-weight: 700;
    font-size: 0.8rem;
    flex-shrink: 0;
}

.podium-remaining .winner-title {
    font-weight: 600;
    color: var(--winners-font, inherit);
    font-size: 0.9rem;
}

.podium-remaining .winner-company {
    color: color-mix(in srgb, currentColor 60%, transparent);
    font-size: 0.8rem;
    margin-left: auto;
}

/* ===================================
   SHORTLISTED ENTRIES SECTION
   Theme-driven by default (--primary-color, --accent-color, --text-primary).
   Two layouts: grid (category cards) and accordion.
   =================================== */
.shortlisted-section .section-title i.fa-list-check {
    color: var(--primary-color);
    margin-right: 0.5rem;
}

.shortlisted-loading,
.shortlisted-empty {
    text-align: center;
    padding: 3rem 1rem;
    color: color-mix(in srgb, currentColor 60%, transparent);
}

.shortlisted-empty i {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    color: color-mix(in srgb, var(--primary-color) 50%, transparent);
    display: block;
}

.shortlisted-empty p {
    margin: 0;
    font-size: 1.05rem;
}

/* Grid layout — same balance pattern as Sponsors / Winners */
.shortlisted-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    /* Top-align so a card expanded via "View all" grows downward without
       stretching its (still-capped) siblings into tall, gappy columns. */
    align-items: flex-start;
    gap: 1.5rem;
    margin: 2rem auto 0;
    max-width: calc(var(--shortlisted-cols, 3) * 320px + (var(--shortlisted-cols, 3) - 1) * 1.5rem);
}

.shortlisted-category-card {
    flex: 0 0 320px;
    width: 320px;
    background: var(--bg-white);
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.shortlisted-category-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
}

.shortlisted-category-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    background: var(--primary-color);
    color: #ffffff;
}

.shortlisted-category-header h3 {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 700;
    flex: 1;
    word-break: break-word;
}

.shortlisted-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 26px;
    padding: 0 0.6rem;
    background: var(--accent-color);
    color: #1a1a1a;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 700;
    flex-shrink: 0;
}

.shortlisted-entries {
    list-style: none;
    margin: 0;
    padding: 0;
    /* Fill the available card-body height (card is flex-column) so
       shorter shortlists don't leave a blank strip at the bottom when
       the row stretches this card to align with its siblings. The list
       items themselves stretch (flex: 1 below) to fill that height. */
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* Match the winner-entry visual treatment so shortlisted and winners
   cards read as the same component — same padding, same border weight,
   same primary-tinted gradient + left-border highlight that .winner-first
   uses, no explicit color (inherits from cardBodyColor cascade like
   .winner-entry), and flex:1 so each <li> shares the stretched card
   height equally. */
.shortlisted-entries li {
    padding: 0.75rem 1.25rem;
    padding-left: calc(1.25rem - 3px);
    line-height: 1.4;
    background: linear-gradient(90deg,
        color-mix(in srgb, var(--primary-color) 16%, transparent) 0%,
        color-mix(in srgb, var(--primary-color) 4%, transparent) 100%);
    border-left: 3px solid var(--primary-color);
    border-bottom: 1px solid color-mix(in srgb, currentColor 10%, transparent);
    flex: 1;
    display: flex;
    align-items: center;
}

.dark-landing .shortlisted-category-card {
    background: #1e293b;
    border: 1px solid #334155;
    color: #e2e8f0;
}

.dark-landing .shortlisted-category-header {
    color: #ffffff;
}

.dark-landing .shortlisted-entries li {
    color: #e2e8f0;
    border-bottom-color: rgba(226, 232, 240, 0.14);
}

.dark-landing .shortlisted-toggle-btn {
    color: #bfdbfe;
    border-top-color: rgba(226, 232, 240, 0.16);
}

.shortlisted-entries li:last-child {
    border-bottom: none;
}

/* Capped shortlists: show only the first 10 entries until the card's
   "View all" button is clicked (toggles .expanded). Base li is display:flex. */
.shortlisted-entries.shortlisted-capped li:nth-child(n+11) { display: none; }
.shortlisted-entries.shortlisted-capped.expanded li:nth-child(n+11) { display: flex; }

.shortlisted-toggle-btn {
    width: 100%;
    margin: 0;
    padding: 0.7rem 1.25rem;
    background: transparent;
    border: none;
    border-top: 1px solid color-mix(in srgb, currentColor 12%, transparent);
    color: var(--primary-color);
    font: inherit;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s ease;
}
.shortlisted-toggle-btn:hover {
    background: color-mix(in srgb, var(--primary-color) 8%, transparent);
}

@media (max-width: 900px) {
    .shortlisted-grid {
        max-width: calc(2 * 280px + 1.5rem);
    }
    .shortlisted-category-card {
        flex: 0 0 280px;
        width: 280px;
    }
}

@media (max-width: 640px) {
    .shortlisted-grid {
        max-width: 360px;
    }
    .shortlisted-category-card {
        flex: 0 0 100%;
        width: 100%;
    }
}

/* Accordion layout — reuses .accordion-item / -header / -toggle / -body chrome */
.shortlisted-accordion {
    max-width: 900px;
    margin: 2rem auto 0;
}

.shortlisted-accordion-item .accordion-header {
    gap: 0.75rem;
}

.shortlisted-accordion-item .shortlisted-count {
    background: var(--accent-color);
    color: #1a1a1a;
    margin-right: 0.25rem;
}

.shortlisted-accordion-item .accordion-body {
    padding: 0.5rem 0;
}

.shortlisted-accordion-item .shortlisted-entries li {
    padding: 0.65rem 1.5rem;
}

@media (max-width: 640px) {
    .podium-stage {
        flex-direction: column;
        align-items: center;
    }

    .podium-position {
        flex-direction: row;
        max-width: 100%;
        width: 100%;
        gap: 0.75rem;
        text-align: left;
        align-items: center;
    }

    .podium-info {
        align-items: flex-start;
        min-height: auto;
        margin-bottom: 0;
    }

    .podium-block {
        display: none;
    }

    .podium-medal {
        margin-bottom: 0;
    }

    .podium-first .podium-medal {
        font-size: 1.5rem;
    }

    /* Restore natural order on mobile: 1st, 2nd, 3rd */
    .podium-second { order: 2; }
    .podium-first { order: 1; }
    .podium-third { order: 3; }
}

/* Hardware acceleration for smooth animations */
.swiper,
.swiper-slide {
    will-change: transform;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
}
.entry-error-summary { border: 2px solid #b91c1c; background: #fff1f2; color: #991b1b; padding: 1rem; margin-bottom: 1.5rem; border-radius: 6px; }
.entry-error-summary button { background: transparent; border: 0; color: inherit; text-decoration: underline; cursor: pointer; font: inherit; text-align: left; }
.entry-field-error { color: #b91c1c; font-weight: 600; margin: .4rem 0; }
.entry-form [aria-invalid="true"] { outline: 2px solid #b91c1c; outline-offset: 2px; }
.dark-landing .entry-field-error { color: #fca5a5; }
