/* fdoi.css — Base styles for fdoi.us */
/* Color palette aligned with OrganizeFor brand standards */

:root {
    /* Presidential Layer */
    --navy:          #1A2744;
    --midnight:      #0F1A2E;
    --slate:         #2D3A4E;
    --cranberry:     #9B2335;
    --brilliant:     #FAFAF7;

    /* Mellencamp Layer */
    --baby-blue:     #4A7A96;
    --faded-red:     #A8635B;
    --vanilla:       #F0E4CF;
    --warm-stone:    #6B6560;
    --dusty-sage:    #5C7254;

    /* Semantic mappings — light mode */
    --bg:            #F7F3EB;
    --bg-card:       #FAFAF7;
    --bg-card-alt:   #F0E4CF;
    --bg-elevated:   #E8E0D2;
    --text:          #1A2744;
    --text-secondary: #4A4540;
    --text-muted:    #6B6560;
    --link:          #4A7A96;
    --link-hover:    #3A6178;
    --link-contrast: #FAFAF7;
    --border:        #D4CFC7;
    --border-light:  #E0DBD3;
    --tag-bg:        #E8DFD0;
    --tag-text:      #4A7A96;
    --tag-hover:     #DDD3C2;
    --btn-primary-bg:    #9B2335;
    --btn-primary-hover: #832030;
    --success-bg:    #E2EDDF;
    --success-text:  #3D5236;
    --error-bg:      #F5E0DE;
    --error-text:    #7A1D2A;
    --warning-bg:    #F5EDD8;
    --warning-border: #D4A04A;
    --warning-text:  #6B4D1A;

    --heading:       #1A2744;   /* navy headings on cream */
    --focus:         #9B2335;   /* cranberry ring on cream */

    /* Surface depth */
    --shadow-card: 0 1px 2px rgba(15, 26, 46, 0.06), 0 6px 18px rgba(15, 26, 46, 0.05);
    --shadow-card-hover: 0 3px 8px rgba(15, 26, 46, 0.08), 0 14px 32px rgba(15, 26, 46, 0.12);

    color-scheme: light;
}

@font-face {
    font-family: 'Inter';
    src: url("../fonts/Inter/Inter-Regular.f698d4cdc06a.woff2") format('woff2');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Inter';
    src: url("../fonts/Inter/Inter-Medium.b5f4191ff15e.woff2") format('woff2');
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Inter';
    src: url("../fonts/Inter/Inter-SemiBold.f2d19a293bd3.woff2") format('woff2');
    font-weight: 600;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Inter';
    src: url("../fonts/Inter/Inter-Bold.116357beffcc.woff2") format('woff2');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'JetBrains Mono';
    src: url("../fonts/JetBrainsMono/JetBrainsMono-Regular.0b7f9be556a6.woff2") format('woff2');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

/* Dark mode. The base.html script sets data-theme from localStorage (else
   system preference) before first paint, so the [data-theme="dark"] block is
   the one that normally applies; the media query covers no-JS visitors and
   respects an explicit light choice via :not(). Keep both blocks in sync. */
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --bg:            #0F1A2E;
        --bg-card:       #1A2744;
        --bg-card-alt:   #2D3A4E;
        --bg-elevated:   #2D3A4E;
        --text:          #FAFAF7;
        --text-secondary: #C4BFB8;
        --text-muted:    #8A94A8;
        --link:          #7BA4BE;
        --link-hover:    #9FBDD2;
        --link-contrast: #0F1A2E;
        --border:        #3A4A5E;
        --border-light:  #2D3A4E;
        --tag-bg:        #2D3A4E;
        --tag-text:      #7BA4BE;
        --tag-hover:     #3A4A5E;
        --btn-primary-bg:    #9B2335;
        --btn-primary-hover: #B52A3F;
        --success-bg:    #1A2E1F;
        --success-text:  #849A7C;
        --error-bg:      #2E1A1D;
        --error-text:    #C17B72;
        --warning-bg:    #2E261A;
        --warning-border: #D4A04A;
        --warning-text:  #D4A04A;
        --heading:       #FAFAF7;   /* brilliant headings on midnight */
        --focus:         #D4A04A;   /* gold ring on midnight */
        --shadow-card: 0 1px 2px rgba(0, 0, 0, 0.22), 0 8px 22px rgba(0, 0, 0, 0.16);
        --shadow-card-hover: 0 4px 10px rgba(0, 0, 0, 0.28), 0 16px 36px rgba(0, 0, 0, 0.24);
        color-scheme: dark;
    }
}

[data-theme="dark"] {
    --bg:            #0F1A2E;
    --bg-card:       #1A2744;
    --bg-card-alt:   #2D3A4E;
    --bg-elevated:   #2D3A4E;
    --text:          #FAFAF7;
    --text-secondary: #C4BFB8;
    --text-muted:    #8A94A8;
    --link:          #7BA4BE;
    --link-hover:    #9FBDD2;
    --link-contrast: #0F1A2E;
    --border:        #3A4A5E;
    --border-light:  #2D3A4E;
    --tag-bg:        #2D3A4E;
    --tag-text:      #7BA4BE;
    --tag-hover:     #3A4A5E;
    --btn-primary-bg:    #9B2335;
    --btn-primary-hover: #B52A3F;
    --success-bg:    #1A2E1F;
    --success-text:  #849A7C;
    --error-bg:      #2E1A1D;
    --error-text:    #C17B72;
    --warning-bg:    #2E261A;
    --warning-border: #D4A04A;
    --warning-text:  #D4A04A;
    --heading:       #FAFAF7;   /* brilliant headings on midnight */
    --focus:         #D4A04A;   /* gold ring on midnight */
    --shadow-card: 0 1px 2px rgba(0, 0, 0, 0.22), 0 8px 22px rgba(0, 0, 0, 0.16);
    --shadow-card-hover: 0 4px 10px rgba(0, 0, 0, 0.28), 0 16px 36px rgba(0, 0, 0, 0.24);
    color-scheme: dark;
}

/* Reset & base */
*, *::before, *::after {
    box-sizing: border-box;
}

/* Accessibility helpers */
.skip-link {
    position: absolute;
    left: -9999px;
    top: 0;
    z-index: 100;
    background: var(--bg-card);
    color: var(--text);
    padding: 0.5rem 1rem;
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}
.skip-link:focus {
    left: 0.75rem;
    top: 0.75rem;
}
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
summary:focus-visible {
    outline: 3px solid var(--focus);
    outline-offset: 2px;
}
/* the navy header keeps the gold ring in both themes — cranberry vanishes on navy */
header :focus-visible {
    outline-color: #D4A04A;
}

::selection {
    background: var(--navy);
    color: var(--brilliant);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    line-height: 1.6;
    color: var(--text);
    background: var(--bg);
    margin: 0;
    padding: 0;
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

h1,
h2,
h3 {
    color: var(--heading);
    line-height: 1.2;
    letter-spacing: -0.02em;
}

a {
    color: var(--link);
    text-decoration: none;
}

a:hover {
    color: var(--link-hover);
    text-decoration: underline;
}

img {
    max-width: 100%;
    height: auto;
}

/* Layout */
header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: color-mix(in srgb, var(--navy), transparent 8%);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    color: var(--brilliant);
    padding: 0.75rem 1.5rem;
    box-shadow: 0 1px 4px rgba(15, 26, 46, 0.25);
}

.site-nav {
    display: flex;
    align-items: center;
    gap: 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.nav-brand {
    color: var(--brilliant);
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: 0.05em;
}

.nav-brand:hover {
    text-decoration: none;
    color: var(--baby-blue);
}

.nav-links {
    list-style: none;
    display: flex;
    gap: 1.5rem;
    margin: 0;
    padding: 0;
}

.nav-links a {
    color: #A89F91;
}

.nav-links a:hover {
    color: var(--brilliant);
    text-decoration: none;
}

.nav-links a[aria-current="page"] {
    color: var(--brilliant);
    font-weight: 600;
}

.nav-form {
    margin: 0;
}

.nav-button {
    border: 0;
    background: transparent;
    color: #A89F91;
    cursor: pointer;
    font: inherit;
    padding: 0;
}

.nav-button:hover {
    color: var(--brilliant);
}

/* Theme toggle — sun shows in dark mode, moon in light */
.theme-toggle {
    background: none;
    border: 1px solid #A89F91;
    border-radius: 9999px;
    cursor: pointer;
    width: 2.25rem;
    height: 2.25rem;
    padding: 0.5rem;
    margin-left: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #A89F91;
    transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease, transform 0.15s ease;
}
.theme-toggle:hover {
    background: rgba(250, 250, 247, 0.08);
    border-color: var(--brilliant);
    color: var(--brilliant);
    transform: translateY(-1px);
}
.theme-toggle:active {
    transform: none;
}
.theme-toggle svg {
    width: 16px;
    height: 16px;
    display: block;
}
.theme-toggle .icon-sun { display: none; }
.theme-toggle .icon-moon { display: block; }
[data-theme="dark"] .theme-toggle .icon-sun { display: block; }
[data-theme="dark"] .theme-toggle .icon-moon { display: none; }

/* Staff dropdown */
.nav-dropdown {
    position: relative;
}

.nav-dropdown-toggle {
    cursor: pointer;
}

.nav-dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    background: var(--navy);
    border: 1px solid var(--slate);
    border-radius: 4px;
    list-style: none;
    margin: 0.25rem 0 0;
    padding: 0.25rem 0;
    min-width: 180px;
    z-index: 100;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.nav-dropdown:hover .nav-dropdown-menu {
    display: block;
}

.nav-dropdown-menu li {
    border: none;
}

.nav-dropdown-menu a {
    display: block;
    padding: 0.375rem 1rem;
    white-space: nowrap;
}

.nav-dropdown-menu a:hover {
    background: var(--slate);
}

main {
    flex: 1 0 auto;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 1.5rem;
}

footer {
    text-align: center;
    padding: 2rem 1rem;
    color: var(--text-muted);
    font-size: 0.875rem;
    border-top: 1px solid var(--border);
    margin-top: 3rem;
}

/* Messages */
.messages {
    margin-bottom: 1rem;
}

.message {
    padding: 0.75rem 1rem;
    border-radius: 0.375rem;
    margin-bottom: 0.5rem;
}

.message-success {
    background: var(--success-bg);
    color: var(--success-text);
}

.message-error {
    background: var(--error-bg);
    color: var(--error-text);
}

/* Gallery grid */
.gallery-header h1 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.clear-filter {
    font-size: 0.875rem;
    font-weight: normal;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1.25rem;
}

.gallery-item {
    display: flex;
    flex-direction: column;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 0.625rem;
    overflow: hidden;
    box-shadow: var(--shadow-card);
    transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.gallery-item:hover,
.gallery-item:focus-within {
    border-color: color-mix(in srgb, var(--link), var(--border) 55%);
    box-shadow: var(--shadow-card-hover);
    transform: translateY(-3px);
}

.gallery-item > a:first-child,
.gallery-item > a:first-child picture {
    display: block;
    overflow: hidden;
}

.gallery-item a img {
    width: 100%;
    aspect-ratio: 9/5;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
}

.gallery-item:hover > a:first-child img,
.gallery-item:focus-within > a:first-child img {
    transform: scale(1.025);
}

.gallery-item-title {
    flex: 1;
    padding: 0.7rem 0.8rem 0.75rem;
    font-size: 0.84375rem;
    font-weight: 500;
    line-height: 1.45;
}

.gallery-item-title a {
    color: var(--text);
}

.no-results {
    grid-column: 1 / -1;
    text-align: center;
    color: var(--text-muted);
    padding: 3rem;
}

/* Pagination */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    padding: 2rem 0;
}

.pagination a {
    padding: 0.5rem 1rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 0.375rem;
}

.pagination a:hover {
    background: var(--bg-elevated);
    text-decoration: none;
}

.page-info {
    color: var(--text-muted);
    font-size: 0.875rem;
}

/* Cover navigation (prev/next) */
.cover-nav {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}

/* Stat cards */
.stat-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 1rem;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 0.625rem;
    padding: 1rem;
    text-align: center;
    box-shadow: var(--shadow-card);
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--heading);
}

.stat-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

/* Cover detail */
.cover-detail h1 {
    max-width: 52rem;
    font-size: clamp(1.5rem, 2.5vw, 2rem);
    margin: 0 0 1.25rem;
}

.cover-main {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 2rem;
    align-items: start;
}

.cover-meta {
    min-width: 0;
    padding-left: 1.5rem;
    border-left: 1px solid var(--border);
}

@media (max-width: 768px) {
    .cover-main {
        grid-template-columns: 1fr;
    }

    .cover-meta {
        padding-top: 1.5rem;
        padding-left: 0;
        border-top: 1px solid var(--border);
        border-left: 0;
    }
}

.cover-image > picture {
    display: block;
    border-radius: 0.75rem;
    background: var(--bg-card);
    box-shadow: var(--shadow-card);
    overflow: hidden;
}

.cover-image > picture img {
    display: block;
    width: 100%;
    border: 1px solid var(--border);
    border-radius: 0.75rem;
}

.image-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.cover-description {
    margin-bottom: 1.25rem;
    color: var(--text-secondary);
    font-size: 0.9375rem;
    line-height: 1.7;
}

.cover-description p:first-child {
    margin-top: 0;
}

.cover-ai-description {
    position: relative;
    margin-bottom: 1rem;
    padding: 0.75rem 1rem;
    background: var(--bg-card-alt);
    border-left: 3px solid var(--warm-stone);
    border-radius: 0 0.25rem 0.25rem 0;
    color: var(--text-secondary);
    font-size: 0.875rem;
    line-height: 1.6;
}

.cover-ai-description__label {
    display: block;
    margin-bottom: 0.25rem;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted, var(--text-secondary));
}

.cover-ai-description p {
    margin: 0;
}

.cover-ai-disclaimer {
    margin: 0.5rem 0 0;
    padding: 0 0.25rem;
    font-size: 0.7rem;
    line-height: 1.3;
    text-align: center;
    color: var(--text-muted, var(--text-secondary));
    opacity: 0.65;
}

.cover-ai-summaries {
    margin-top: 1.25rem;
}

.meta-item {
    margin: 0.75rem 0;
}

.meta-item dt {
    font-weight: 600;
    font-size: 0.8125rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.meta-item dd {
    margin: 0;
}

.cover-meta h3 {
    margin: 1.5rem 0 0.625rem;
    font-size: 1rem;
}

/* Tags */
.cover-tags h3 {
    font-size: 1rem;
    margin-bottom: 0.5rem;
}

.tag-list {
    list-style: none;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 0.375rem;
}

.tag-list li a {
    display: inline-block;
    padding: 0.25rem 0.625rem;
    background: var(--tag-bg);
    color: var(--tag-text);
    border-radius: 0.25rem;
    font-size: 0.8125rem;
}

.tag-list li a:hover {
    background: var(--tag-hover);
    text-decoration: none;
}

/* Tag cloud */
.tag-cloud-page h1 {
    margin-bottom: 1.5rem;
}

.tag-cloud {
    line-height: 2.5;
    text-align: center;
}

.tag-cloud-item {
    padding: 0.25rem 0.5rem;
    color: var(--link);
}

.tag-cloud-item:hover {
    background: var(--tag-bg);
    border-radius: 0.25rem;
    text-decoration: none;
}

/* Cover actions */
.cover-actions {
    margin-top: 1.5rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 2.5rem;
    padding: 0.5rem 1rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    color: var(--text);
    font-family: inherit;
    font-size: 0.875rem;
    font-weight: 600;
    line-height: 1.25;
    cursor: pointer;
    text-align: center;
    box-shadow: 0 1px 2px rgba(15, 26, 46, 0.06);
    transition: background-color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease,
        color 0.15s ease, transform 0.15s ease;
}

.btn:hover {
    background: var(--bg-elevated);
    border-color: color-mix(in srgb, var(--link), var(--border) 60%);
    color: var(--text);
    box-shadow: 0 3px 8px rgba(15, 26, 46, 0.12);
    text-decoration: none;
    transform: translateY(-1px);
}

.btn:active {
    box-shadow: 0 1px 2px rgba(15, 26, 46, 0.08);
    transform: none;
}

.btn:disabled,
.btn[aria-disabled="true"] {
    cursor: not-allowed;
    opacity: 0.55;
    box-shadow: none;
    transform: none;
}

.btn-primary {
    background: var(--btn-primary-bg);
    color: var(--brilliant);
    border-color: var(--btn-primary-bg);
}

.btn-primary:hover {
    background: var(--btn-primary-hover);
    border-color: var(--btn-primary-hover);
    color: var(--brilliant);
}

/* Inline forms (favorite toggle) */
.inline-form {
    display: inline;
    margin: 0;
}

.btn-favorite {
    border-color: var(--border);
}

.btn-favorite.is-favorited {
    background: var(--warning-bg);
    border-color: var(--warning-border);
    color: var(--warning-text);
}

/* Forms */
.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.25rem;
    font-size: 0.875rem;
    color: var(--heading);
}

.form-input,
input[type="text"],
input[type="password"],
input[type="email"],
input[type="url"],
input[type="number"],
input[type="date"] {
    width: 100%;
    min-height: 2.75rem;
    padding: 0.625rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    font-family: inherit;
    font-size: 0.875rem;
    line-height: 1.25;
    background: var(--bg-card);
    color: var(--text);
    transition: background-color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.form-textarea,
textarea {
    width: 100%;
    padding: 0.625rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    font-family: inherit;
    font-size: 0.875rem;
    line-height: 1.5;
    resize: vertical;
    background: var(--bg-card);
    color: var(--text);
    transition: background-color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.form-input:hover,
input[type="text"]:hover,
input[type="password"]:hover,
input[type="email"]:hover,
input[type="url"]:hover,
input[type="number"]:hover,
input[type="date"]:hover,
.form-textarea:hover,
textarea:hover,
.form-select:hover,
.search-input:hover {
    border-color: color-mix(in srgb, var(--link), var(--border) 55%);
}

input::placeholder,
textarea::placeholder {
    color: var(--text-muted);
    opacity: 0.8;
}

input[type="checkbox"],
input[type="radio"] {
    accent-color: var(--cranberry);
}

input[type="file"] {
    width: 100%;
    padding: 0.375rem;
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    background: var(--bg-card);
    color: var(--text-secondary);
    font: inherit;
}

input[type="file"]::file-selector-button {
    min-height: 2.25rem;
    margin-right: 0.75rem;
    padding: 0.375rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: 0.375rem;
    background: var(--bg-elevated);
    color: var(--text);
    font: inherit;
    font-weight: 600;
    cursor: pointer;
}

.form-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1rem;
}

.video-gen-row,
.translate-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.8125rem;
    color: var(--text-muted);
}

.form-select-sm {
    padding: 0.25rem 0.5rem;
    font-size: 0.8125rem;
}

.field-errors {
    color: var(--error-text);
    font-size: 0.8125rem;
    list-style: none;
    padding: 0;
    margin: 0.25rem 0 0;
}

.form-help,
.upload-hint,
.upload-quota {
    color: var(--text-muted);
    font-size: 0.8125rem;
    line-height: 1.5;
}

.form-help {
    margin: 0.375rem 0 0;
}

.form-errors {
    margin-bottom: 1rem;
    padding: 0.75rem 1rem;
    border-left: 3px solid var(--error-text);
    border-radius: 0.375rem;
    background: var(--error-bg);
    color: var(--error-text);
    font-size: 0.875rem;
}

.form-errors .errorlist {
    margin: 0;
    padding-left: 1.25rem;
}

/* Additional images */
.additional-images {
    margin-top: 1rem;
}

.additional-images h3 {
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
}

.additional-images img {
    width: 80px;
    height: 60px;
    object-fit: cover;
    border-radius: 0.25rem;
    border: 1px solid var(--border);
    margin-right: 0.5rem;
}

/* Locations table */
.locations-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.locations-table th,
.locations-table td {
    padding: 0.5rem 0.75rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.locations-table th {
    background: var(--bg-elevated);
    font-weight: 600;
}

/* Login page */
.login-page {
    max-width: 430px;
    margin: clamp(2rem, 8vh, 5rem) auto;
    padding: clamp(1.25rem, 4vw, 2rem);
    border: 1px solid var(--border);
    border-radius: 0.75rem;
    background: var(--bg-card);
    box-shadow: var(--shadow-card);
}

.login-page h1 {
    text-align: center;
    margin-top: 0;
    margin-bottom: 1.5rem;
}

/* Cover images page */
.cover-images .image-group {
    margin-bottom: 2rem;
}

.cover-images .image-size {
    margin-bottom: 1rem;
}

.cover-images .image-size h3 {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-bottom: 0.25rem;
}

/* AI suggested tags */
.cover-suggested-tags {
    margin: 1rem 0;
    padding: 0.75rem 1rem;
    background: var(--warning-bg);
    border: 1px solid var(--warning-border);
    border-radius: 0.5rem;
}

.cover-suggested-tags h3 {
    font-size: 0.875rem;
    margin: 0 0 0.5rem;
    color: var(--warning-text);
}

.tag-list.suggested {
    margin-bottom: 0.75rem;
}

.tag-list.suggested li label {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.625rem;
    background: var(--tag-bg);
    border-radius: 0.25rem;
    font-size: 0.8125rem;
    color: var(--warning-text);
    cursor: pointer;
}

.tag-list.suggested li label:hover {
    background: var(--tag-hover);
}

/* Date/location items */
.date-location-item {
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
}

.date-location-item .date {
    font-weight: 600;
    margin-right: 0.5rem;
}

.no-image {
    padding: 3rem;
    text-align: center;
    background: var(--bg-elevated);
    border: 1px dashed var(--border);
    border-radius: 0.5rem;
    color: var(--text-muted);
}

/* Artist grid */
.artist-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1rem;
}

.artist-card {
    display: flex;
    flex-direction: column;
    padding: 1rem 1.25rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 0.625rem;
    box-shadow: var(--shadow-card);
    transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.artist-card:hover,
.artist-card:focus-visible {
    border-color: color-mix(in srgb, var(--link), var(--border) 55%);
    box-shadow: var(--shadow-card-hover);
    transform: translateY(-2px);
    text-decoration: none;
}

.artist-name {
    font-weight: 600;
    color: var(--heading);
}

.artist-count {
    font-size: 0.8125rem;
    color: var(--text-muted);
}

/* Collection cards reuse .artist-card but lead with a cover thumbnail, so the
   card padding moves onto the text rows and the image bleeds to the edges. */
.collection-card {
    padding: 0;
    overflow: hidden;
}

.collection-thumb {
    display: block;
}

.collection-thumb picture,
.collection-thumb img {
    display: block;
    width: 100%;
    aspect-ratio: 3 / 2;
    object-fit: cover;
    background: var(--bg-card-alt);
}

.collection-thumb-empty {
    aspect-ratio: 3 / 2;
    background: var(--bg-card-alt);
}

.collection-card .artist-name {
    padding: 0.75rem 1.25rem 0;
}

.collection-card .artist-count {
    padding: 0.25rem 1.25rem 1rem;
}

.artist-bio {
    margin-bottom: 1rem;
    color: var(--text-secondary);
}

.artist-dates {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
}

/* Browse grid (years, states) */
.browse-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.browse-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0.75rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 0.625rem;
    box-shadow: var(--shadow-card);
    transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
    text-align: center;
}

.browse-card:hover,
.browse-card:focus-visible {
    border-color: color-mix(in srgb, var(--link), var(--border) 55%);
    box-shadow: var(--shadow-card-hover);
    transform: translateY(-2px);
    text-decoration: none;
}

.browse-label {
    font-weight: 600;
    color: var(--heading);
}

.browse-count {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Related covers */
.related-covers {
    margin-top: 1.5rem;
}

.related-covers h3 {
    font-size: 1rem;
    margin-bottom: 0.75rem;
}

.related-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
}

.related-item {
    display: flex;
    flex-direction: column;
    text-align: center;
    min-width: 0;
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    background: var(--bg-card);
    box-shadow: var(--shadow-card);
    overflow: hidden;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.related-item picture {
    display: block;
    overflow: hidden;
}

.related-item img {
    width: 100%;
    aspect-ratio: 9/5;
    object-fit: cover;
    display: block;
    border: 0;
    border-radius: 0;
    transition: transform 0.25s ease;
}

.related-item span {
    flex: 1;
    padding: 0.5rem 0.625rem 0.625rem;
    font-size: 0.6875rem;
    color: var(--text-secondary);
    line-height: 1.4;
}

.related-item:hover,
.related-item:focus-visible {
    border-color: color-mix(in srgb, var(--link), var(--border) 55%);
    box-shadow: var(--shadow-card-hover);
    transform: translateY(-2px);
    text-decoration: none;
}

.related-item:hover img,
.related-item:focus-visible img {
    transform: scale(1.025);
}

/* Month pills */
.month-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.month-pill {
    display: inline-block;
    padding: 0.375rem 0.875rem;
    background: var(--tag-bg);
    color: var(--tag-text);
    border-radius: 1rem;
    font-size: 0.8125rem;
}

.month-pill:hover {
    background: var(--tag-hover);
    text-decoration: none;
}

.month-pill.active {
    background: var(--link-hover);
    color: var(--link-contrast);
}

/* Search form */
.search-form {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    max-width: 600px;
}

.search-input {
    flex: 1;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: 0.375rem;
    font-size: 0.875rem;
    background: var(--bg-card);
    color: var(--text);
}

.search-result-count {
    color: var(--text-muted);
    font-size: 0.875rem;
    margin-bottom: 1rem;
}

/* Breadcrumbs */
.breadcrumbs {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
}

.breadcrumbs a {
    color: var(--link);
}

/* Footer links */
.footer-links {
    font-size: 0.8125rem;
}

.footer-links a {
    color: var(--text-muted);
}

.footer-links a:hover {
    color: var(--link);
}

/* Discovery sections (home page) */
.discovery-section {
    margin-bottom: 2rem;
}

.discovery-section h2 {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: var(--heading);
}

.discovery-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

/* Needs Attention section (staff only) */
.needs-attention-section {
    background: var(--warning-bg);
    border: 1px solid var(--warning-border);
    border-radius: 0.5rem;
    padding: 1rem 1.25rem;
}

.needs-attention-list {
    margin: 0;
    padding-left: 1.25rem;
    font-size: 0.875rem;
    color: var(--warning-text);
}

.needs-attention-list li {
    margin-bottom: 0.25rem;
}

/* API docs */
.api-docs h1 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.api-intro {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

.api-docs h2 {
    font-size: 1.125rem;
    font-weight: 600;
    margin-top: 2rem;
    margin-bottom: 0.75rem;
    color: var(--heading);
}

.api-docs code {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.8125rem;
    background: var(--bg-elevated);
    padding: 0.125rem 0.375rem;
    border-radius: 0.25rem;
}

.api-docs pre {
    background: var(--navy);
    color: var(--brilliant);
    padding: 1rem 1.25rem;
    border-radius: 0.5rem;
    overflow-x: auto;
    font-size: 0.8125rem;
    line-height: 1.6;
    margin: 0.75rem 0 1rem;
}

.api-docs pre code {
    background: none;
    padding: 0;
    color: inherit;
}

.api-endpoint {
    margin-bottom: 1.5rem;
}

.api-endpoint h3 {
    font-size: 1rem;
    margin-bottom: 0.5rem;
}

.endpoint-url {
    margin-bottom: 0.25rem;
}

.endpoint-url .method {
    display: inline-block;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.6875rem;
    font-weight: 700;
    padding: 0.125rem 0.5rem;
    border-radius: 0.25rem;
    background: var(--success-bg);
    color: var(--success-text);
    margin-right: 0.375rem;
}

.endpoint-url .method.auth-required {
    background: var(--warning-bg);
    color: var(--warning-text);
}

.api-docs details {
    margin-top: 0.5rem;
}

.api-docs summary {
    cursor: pointer;
    font-size: 0.8125rem;
    color: var(--link);
}

.api-docs ol,
.api-docs ul {
    margin: 0.75rem 0;
    padding-left: 1.5rem;
    font-size: 0.9375rem;
    color: var(--text-secondary);
    line-height: 1.7;
}

.api-docs li {
    margin-bottom: 0.25rem;
}

.api-docs .usage-table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
    font-size: 0.8125rem;
}

.api-docs .usage-table th,
.api-docs .usage-table td {
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid var(--border);
    text-align: left;
}

.api-docs .usage-table th {
    font-weight: 600;
    color: var(--text-muted);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

/* Analysis conflict review */
.conflict-row {
    display: flex;
    gap: 1rem;
    padding: 1rem;
    margin-bottom: 0.75rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 0.5rem;
}

.conflict-thumb {
    flex-shrink: 0;
    width: 120px;
}

.conflict-thumb img {
    width: 100%;
    border-radius: 0.25rem;
}

.conflict-details h3 {
    font-size: 1rem;
    margin: 0 0 0.5rem;
}

.conflict-field {
    font-size: 0.8125rem;
    margin-bottom: 0.375rem;
}

.conflict-label {
    font-weight: 600;
    color: var(--error-text);
    margin-right: 0.5rem;
}

.conflict-existing {
    color: var(--text-muted);
    margin-right: 0.75rem;
}

.conflict-ai {
    color: var(--text-secondary);
}

.conflict-actions {
    margin-top: 0.5rem;
    display: flex;
    gap: 0.5rem;
}

@media (max-width: 640px) {
    .conflict-row {
        flex-direction: column;
    }

    .conflict-thumb {
        width: 100%;
    }
}

/* Suggest edit / edit history */
.suggest-edit-notice {
    background: var(--warning-bg);
    border: 1px solid var(--warning-border);
    border-radius: 0.375rem;
    padding: 0.625rem 0.875rem;
    font-size: 0.875rem;
    color: var(--warning-text);
    margin-bottom: 1rem;
}

.suggestion-value {
    font-size: 0.8125rem;
    max-width: 200px;
    word-break: break-word;
}

.suggestion-new {
    font-weight: 600;
}

.status-badge {
    display: inline-block;
    padding: 0.125rem 0.5rem;
    border-radius: 1rem;
    font-size: 0.75rem;
    font-weight: 600;
}

.status-badge.status-approved {
    background: var(--success-bg);
    color: var(--success-text);
}

.status-badge.status-pending {
    background: var(--warning-bg);
    color: var(--warning-text);
}

.status-badge.status-rejected {
    background: var(--error-bg);
    color: var(--error-text);
}

.status-badge.status-hidden {
    background: var(--warning-bg);
    color: var(--warning-text);
}

.status-badge.status-deleted {
    background: var(--error-bg);
    color: var(--error-text);
}

.status-badge.status-placeholder {
    background: var(--tag-bg);
    color: var(--text-muted);
}

.history-reviewer {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.form-select {
    width: 100%;
    min-height: 2.75rem;
    padding: 0.625rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    font-family: inherit;
    font-size: 0.875rem;
    background: var(--bg-card);
    color: var(--text);
    transition: background-color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

/* Video script page */
.video-script-page h1 {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
}

.script-layout {
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: 1.5rem;
    margin: 1.5rem 0;
}

@media (max-width: 640px) {
    .script-layout {
        grid-template-columns: 1fr;
    }
}

.script-preview img {
    width: 100%;
    border-radius: 0.375rem;
    border: 1px solid var(--border);
}

.script-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    font-size: 0.8125rem;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
    align-items: center;
}

.script-text {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 0.375rem;
    padding: 1rem;
    font-family: inherit;
    font-size: 0.875rem;
    line-height: 1.6;
    white-space: pre-wrap;
    word-wrap: break-word;
    color: var(--text);
    max-height: 500px;
    overflow-y: auto;
}

.script-notes-display {
    margin-top: 0.75rem;
    font-size: 0.8125rem;
    color: var(--text-muted);
}

.script-actions {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

.script-form-row {
    display: flex;
    gap: 1rem;
    margin-bottom: 0.75rem;
}

.script-form-row .form-group {
    flex: 1;
}

.script-history {
    margin-top: 1.5rem;
}

.script-history summary {
    cursor: pointer;
    font-size: 0.8125rem;
    color: var(--link);
    margin-bottom: 0.5rem;
}

.current-script {
    background: var(--bg-card-alt);
}

.script-caption {
    margin-top: 1.25rem;
    padding: 0.75rem;
    background: var(--bg-card);
    border-radius: 4px;
}

.script-caption h3 {
    font-size: 0.9375rem;
    margin-bottom: 0.5rem;
}

.caption-text {
    white-space: pre-wrap;
    font-size: 0.8125rem;
    line-height: 1.5;
}

.narration-audio {
    margin-top: 1.25rem;
}

.narration-audio h3 {
    font-size: 0.9375rem;
    margin-bottom: 0.5rem;
}

.narration-audio audio {
    width: 100%;
    margin-bottom: 0.25rem;
}

.audio-meta {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.script-video {
    margin-top: 1.25rem;
}

.script-video h3 {
    font-size: 0.9375rem;
    margin-bottom: 0.5rem;
}

.script-video video {
    width: 100%;
    max-height: 60vh;
    border-radius: 4px;
}

.video-meta {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.cover-video {
    margin-top: 1.25rem;
}

.cover-video h3 {
    font-size: 0.9375rem;
    margin-bottom: 0.5rem;
}

.video-controls {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-bottom: 0.5rem;
}

.video-lang-tabs,
.video-format-tabs {
    display: flex;
    gap: 0.25rem;
}

.video-lang-btn,
.video-fmt-btn {
    padding: 0.2rem 0.6rem;
    font-size: 0.8125rem;
    border: 1px solid var(--border);
    background: var(--bg-card);
    color: var(--text-secondary);
    cursor: pointer;
    border-radius: 3px;
}

.video-lang-btn.active,
.video-fmt-btn.active {
    background: var(--link-hover);
    color: var(--link-contrast);
    border-color: var(--link-hover);
}

.cover-video video {
    width: 100%;
    max-height: 50vh;
    border-radius: 4px;
}

.shot-list-section {
    margin-top: 1.25rem;
}

.shot-list-section h3 {
    font-size: 0.9375rem;
    margin-bottom: 0.5rem;
}

/* Legal pages (privacy, terms) */
.legal-page {
    max-width: 720px;
}

.legal-page h1 {
    font-size: 1.5rem;
    margin-bottom: 0.25rem;
}

.legal-page .legal-updated {
    color: var(--text-muted);
    font-size: 0.8125rem;
    margin-bottom: 1.5rem;
}

.legal-page h2 {
    font-size: 1.125rem;
    font-weight: 600;
    margin-top: 1.75rem;
    margin-bottom: 0.5rem;
    color: var(--heading);
}

.legal-page p,
.legal-page ul {
    color: var(--text-secondary);
    font-size: 0.9375rem;
    line-height: 1.7;
    margin-bottom: 0.75rem;
}

.legal-page ul {
    padding-left: 1.5rem;
}

.legal-page li {
    margin-bottom: 0.375rem;
}

/* Hamburger menu toggle (hidden checkbox) */
.nav-toggle {
    display: none;
}

.nav-hamburger {
    display: none;
    cursor: pointer;
    margin-left: auto;
    width: 2.75rem;
    height: 2.75rem;
    position: relative;
}

.nav-hamburger span,
.nav-hamburger span::before,
.nav-hamburger span::after {
    display: block;
    width: 100%;
    height: 2px;
    background: var(--brilliant);
    border-radius: 1px;
    position: absolute;
    transition: transform 0.25s, opacity 0.2s;
}

.nav-hamburger span {
    top: 50%;
    left: 50%;
    width: 1.5rem;
    transform: translate(-50%, -50%);
}

.nav-hamburger span::before {
    content: '';
    top: -7px;
}

.nav-hamburger span::after {
    content: '';
    top: 7px;
}

/* Animate to X when open */
.nav-toggle:checked + .nav-hamburger span {
    background: transparent;
}

.nav-toggle:checked + .nav-hamburger span::before {
    top: 0;
    transform: rotate(45deg);
}

.nav-toggle:checked + .nav-hamburger span::after {
    top: 0;
    transform: rotate(-45deg);
}

/* Compact navigation before authenticated and staff links can overflow. */
@media (max-width: 1180px) {
    .nav-hamburger {
        display: block;
    }

    .site-nav {
        flex-wrap: wrap;
        column-gap: 0.75rem;
        row-gap: 0;
    }

    .nav-links {
        display: none;
        flex-direction: column;
        width: 100%;
        gap: 0;
        padding: 0.5rem 0 0;
        /* keep the expanded menu after the toggle button in the wrap order */
        order: 10;
    }

    .nav-toggle:checked ~ .nav-links {
        display: flex;
        /* the sticky header owns the viewport when open — keep it scrollable */
        max-height: calc(100vh - 3.5rem);
        max-height: calc(100dvh - 3.5rem);
        overflow-y: auto;
    }

    .theme-toggle {
        margin-left: 0.75rem;
        width: 2.75rem;
        height: 2.75rem;
    }

    .nav-links li {
        border-top: 1px solid var(--slate);
    }

    .nav-links a,
    .nav-links .nav-button {
        display: block;
        padding: 0.625rem 0;
        font-size: 0.9375rem;
    }

    .nav-dropdown-menu {
        position: static;
        border: none;
        box-shadow: none;
        min-width: 0;
        padding: 0;
        margin: 0;
        display: block;
    }

    .nav-dropdown-menu a {
        padding: 0.625rem 0 0.625rem 1rem;
    }

    .nav-dropdown-menu li {
        border-top: 1px solid var(--slate);
    }
}

/* Responsive content */
@media (max-width: 640px) {
    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 0.75rem;
    }

    .related-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* Community Notes */
.cover-notes { margin-top: 1.5rem; }
.note-item {
    border-left: 3px solid var(--link);
    border-radius: 0 0.375rem 0.375rem 0;
    padding: 0.625rem 0.75rem;
    margin-bottom: 0.75rem;
    background: var(--bg-card);
}
.note-text { margin: 0; }
.note-meta {
    margin: 0.25rem 0 0;
    font-size: 0.85rem;
    color: var(--text-muted);
}
.note-empty {
    color: var(--text-muted);
    font-style: italic;
}
.note-form textarea {
    width: 100%;
    box-sizing: border-box;
    padding: 0.625rem 0.75rem;
    font-family: inherit;
    font-size: 0.875rem;
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    background: var(--bg-card);
    color: var(--text);
    margin-bottom: 0.5rem;
    resize: vertical;
}
.note-form .btn { margin-top: 0; }
.note-login { font-size: 0.9rem; }

/* DR backups dashboard status colors */
.dr-ok { color: var(--success-text); font-weight: 600; }
.dr-warn { color: var(--error-text); font-weight: 600; }

/* Reduced motion — clamp every animation/transition */
@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;
    }
}

/* Print */
@media print {
    header, footer, .messages, .theme-toggle, .skip-link {
        display: none !important;
    }
    body {
        background: #fff;
        color: #000;
    }
    a {
        color: #000;
        text-decoration: underline;
    }
}
