/*
 * SigiDoc Feind — Project-specific CSS overrides.
 *
 * Loaded after base.css and epidoc.css (wins by source order).
 * Organized in sections:
 *   1. Theme variables (override scaffold defaults)
 *   2. Base overrides (structural differences from scaffold base.css)
 *   3. EpiDoc/SigiDoc overrides (extras beyond scaffold epidoc.css)
 *   4. Homepage
 */


/* ═══════════════════════════════════════════════════════════════════════════
   1. THEME VARIABLES — Override scaffold defaults, add SigiDoc palette
   ═══════════════════════════════════════════════════════════════════════ */

:root {
    /* Remap scaffold palette to SigiDoc gold/parchment theme */
    --ink:             #1a1a2e;
    --primary:         #1a1a2e;
    --primary-dark:    #1a1a2e;
    --accent:          #b8860b;
    --accent-hover:    #d4a843;
    --accent-faint:    #f5ecd7;
    --slate:           #4a4a5a;
    --border-color:    #d5cfc4;
    --bg-base:         #f5f0e8;
    --bg-light:        #faf7f2;
    --header-bg:       #1a1a2e;
    --header-bg-dark:  #1a1a2e;
    --header-text:     #e8e0d0;

    /* Shadows with themed tint */
    --shadow-sm: 0 1px 3px rgba(26,26,46,0.08);
    --shadow-md: 0 4px 12px rgba(26,26,46,0.1);

    /* SigiDoc fonts */
    --font-display: 'Cormorant Garamond', Georgia, 'Times New Roman', serif;
    --font-body:    'Source Sans 3', 'Segoe UI', system-ui, sans-serif;
    --font-greek:   'Athena Ruby', 'Times New Roman', serif;
    --font-mono:    'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
}


/* ═══════════════════════════════════════════════════════════════════════════
   2. BASE OVERRIDES — Structural differences from scaffold base.css
   ═══════════════════════════════════════════════════════════════════════ */

/* ── Typography & layout ── */

body {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
}

.layout-grid {
    max-width: 1100px;
    padding: 0 2rem;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-display);
}

h1 {
    font-size: 2.5rem;
    letter-spacing: -0.01em;
}

/* ── Header ── */

body > header {
    color: var(--header-text);
}

.header-inner {
    max-width: 1100px;
    padding: 0 2rem;
}

.site-title-link {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    color: inherit;
    flex-shrink: 0;
}

.site-title-link:hover {
    text-decoration: none;
}

.site-title-abbr {
    font-family: var(--font-display);
    font-size: 2rem;
    font-weight: 700;
    color: #fff;
    letter-spacing: 0.02em;
}

.title-separator {
    width: 1px;
    height: 1.75rem;
    background: rgba(184,134,11,0.5);
    display: inline-block;
}

.site-title-full {
    font-family: var(--font-display);
    letter-spacing: 0.02em;
}

/* ── Navigation ── */

.nav-dropdown-menu { border-color: rgba(184,134,11,0.3); }
.nav-dropdown-menu li a:hover { background: rgba(184,134,11,0.15); }

/* ── Language switcher ── */

.lang-current {
    color: var(--accent-hover);
    background: rgba(184,134,11,0.15);
}

/* ── Footer ── */

.footer-inner {
    max-width: 1100px;
    padding: 0 2rem;
}

footer p {
    color: rgba(232,224,208,0.6);
}

footer a {
    border-bottom: 1px solid rgba(184,134,11,0.3);
    transition: border-color 0.15s;
}

footer a:hover {
    color: #fff;
    border-bottom-color: var(--accent);
}

/* ── Data tables ── */

@media (max-width: 768px) {
    .data-table { font-size: 0.85rem; }
    .data-table th, .data-table td { padding: 0.5rem; }
}

/* ── Index cards ── */

.index-card h3 {
    font-family: var(--font-display);
    font-size: 1.25rem;
}

.index-card .entry-count { font-size: 0.75rem; letter-spacing: 0.02em; }

/* ── Document page container ── */

.document { display: grid; grid-template-columns: 1fr auto; }
.document > * { grid-column: 1 / -1; }
.doc-title { grid-column: 1; grid-row: 1; align-self: baseline; font-family: var(--font-display); letter-spacing: -0.01em; }
.doc-nav { flex-wrap: wrap; }

/* ── Monospace ID badge (seal-id) ── */

.seal-id a {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--accent);
    background: var(--bg-light);
    padding: 0.125rem 0.375rem;
    border: 1px solid var(--border-color);
    text-decoration: none;
}

/* ── Seals list page (project-specific class aliases) ── */

.seal-id { white-space: nowrap; font-weight: 600; }
.seal-table td a { color: var(--ink); text-decoration: none; }
.seal-table td a:hover { color: var(--accent); }

/* ── Index table extras ── */

.index-table h3 { font-family: var(--font-display); }

/* ── SigiDoc-specific responsive ── */

@media (max-width: 768px) {
    .header-inner { padding: 0 1.25rem; }
    .site-title-abbr { font-size: 1.625rem; }
    .site-title-full { font-size: 1rem; }
    .title-separator { display: none; }
    .language-switcher { order: 2; }
    .document { grid-template-columns: 1fr; }
    .doc-title { grid-row: auto; font-size: 1.5rem; }
}


/* ═══════════════════════════════════════════════════════════════════════════
   3. EPIDOC/SIGIDOC OVERRIDES — Extras beyond scaffold epidoc.css
   ═══════════════════════════════════════════════════════════════════════ */

/* ── Section headings (.iospe) ── */

h3.iospe {
    font-family: var(--font-display);
    color: var(--ink);
    font-weight: 600;
    font-size: 1.5rem;
    margin-top: 0;
    margin-bottom: 0.75rem;
    padding-bottom: 0.375rem;
    border-bottom: 1px solid var(--border-color);
}

h4.iospe {
    font-family: var(--font-display);
    color: var(--ink);
    font-weight: 600;
    font-size: 1.25rem;
    margin-top: 0;
    margin-bottom: 0.75rem;
    padding-bottom: 0.375rem;
    border-bottom: 1px solid var(--border-color);
}

/* ── Metadata sections (IDs from XSLT) ── */

.document [id="stone"],
.document [id="text-field"] {
    background: none;
    padding: 0 0 0 1.25rem;
    border-radius: 0;
    margin-bottom: 2rem;
    border-left: 3px solid var(--accent);
}

/* ── Images background ── */

#images {
    background: var(--bg-light);
}

/* ── SigiDoc ID badge (h6 from XSLT) ── */

.document > h6 {
    grid-column: 2;
    grid-row: 1;
    align-self: baseline;
    width: auto;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--slate);
    background: var(--bg-base);
    border: 1px solid var(--border-color);
    padding: 0.15rem 0.5rem;
    margin: 0;
    margin-left: 1rem;
    white-space: nowrap;
}

/* ── Edition tabs (Foundation .section-container) ── */

.RTIedition {
    background: none;
    padding: 0;
    margin: 2.5rem 0;
    border: none;
}

.section-container.tabs {
    margin: 0.75rem 0 1.5rem;
    border: none;
    border-radius: 0;
    overflow: visible;
}

.section-container section {
    border-bottom: none;
}

.section-container .title {
    background: var(--accent-faint);
    padding: 0.3rem 0.75rem !important;
    height: auto !important;
    margin: 0;
    font-weight: 600;
    font-size: 0.75rem;
    line-height: 1.4;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    border: 1px solid var(--border-color);
}

.section-container .title a {
    color: var(--ink);
    text-decoration: none;
    padding: 0 !important;
}

.section-container .content {
    padding: 0.75rem 0;
    background: none;
}

/* ── Text parts (transcription blocks) ── */

.textpartnumber {
    display: block;
    font-weight: 700;
    color: var(--accent);
    margin-top: 0.75rem;
    margin-bottom: 0.25rem;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-family: var(--font-body);
}

.textpartnumber:first-child {
    margin-top: 0;
}

.textpart[lang="grc"] {
    line-height: 1.6;
}

.gap {
    color: var(--border-color);
}

/* ── Apparatus ── */

#apparatus {
    margin-top: 1rem;
    font-size: 0.9rem;
    color: var(--slate);
}

/* ── Translation extras ── */

#translation p {
    margin: 0.5rem 0;
    color: var(--ink);
    font-size: 0.9rem;
    line-height: 1.7;
}

#translation p:first-of-type {
    font-family: var(--font-greek);
}

/* ── Bibliography ── */

#bibliography {
    background: var(--accent-faint);
    padding: 1.25rem 1.5rem;
    margin: 2.5rem 0;
    border-left: 3px solid var(--accent);
    border-radius: 0;
}

#bibliography dl.iospe {
    font-size: 0.85rem;
}

/* ── Commentary extras ── */

#commentary p {
    margin: 0.75rem 0;
    color: var(--slate);
    line-height: 1.7;
    font-size: 0.9rem;
}

/* ── Footnotes ── */

#footnotes {
    background: none;
    padding: 1rem 0 0;
    margin: 2rem 0;
    border: none;
    border-top: 1px solid var(--border-color);
    border-left: none;
    border-radius: 0;
}

#footnotes h4.iospe {
    font-size: 1rem;
    color: var(--slate);
}

#footnotes p {
    margin: 0.5rem 0;
    color: var(--slate);
    font-size: 0.85rem;
    line-height: 1.6;
}

.fnseparator {
    display: none;
}

/* ── XSLT pagination ── */

.document > .row:last-child .pagination {
    list-style: none;
    padding: 0;
    margin: 2rem 0 0;
    display: flex;
    gap: 0.5rem;
}

.document .pagination .arrow a {
    color: var(--accent);
    text-decoration: none;
    padding: 0.25rem 0.5rem;
    border: 1px solid var(--border-color);
    font-size: 0.8rem;
}

.document .pagination .arrow a:hover {
    border-color: var(--accent);
    background: var(--accent-faint);
}

/* ── RTI viewer ── */

.rti {
    margin: 1rem 0;
}

.rti-switch {
    cursor: pointer;
    color: var(--accent);
    font-size: 0.85rem;
    margin-right: 1rem;
}

.rti-switch.hidden {
    display: none;
}

.openLime {
    width: 100%;
    height: 400px;
    background: #000;
    margin: 0.5rem 0;
}

/* ── Responsive overrides for XSLT output ── */

@media (max-width: 768px) {
    .document > h6 {
        grid-column: 1;
        grid-row: auto;
        margin-left: 0;
        margin-bottom: 0.5rem;
    }

    .document dl.iospe {
        grid-template-columns: 1fr;
        gap: 0.25rem;
    }

    .document dl.iospe dt {
        font-weight: 700;
        margin-top: 0.5rem;
    }

    dl.box img {
        max-width: 100%;
    }

    .openLime {
        height: 280px;
    }
}


/* ═══════════════════════════════════════════════════════════════════════════
   4. HOMEPAGE
   ═══════════════════════════════════════════════════════════════════════ */

.home-notice {
    background: var(--accent-faint);
    border-left: 3px solid var(--accent);
    padding: 0.85rem 1.25rem;
    margin-bottom: 2rem;
    font-size: 0.85rem;
}
.home-notice p { margin: 0; color: var(--slate); }

.home-hero { text-align: center; margin-bottom: 1.5rem; }

.home-title {
    font-family: var(--font-display);
    color: #8b3a3a;
    font-size: 2.5rem;
    font-weight: 600;
    margin: 0 0 0.25rem;
    padding: 0;
    border: none;
}

.home-location {
    font-family: var(--font-display);
    color: var(--slate);
    font-size: 1.375rem;
    margin: 0 0 1rem;
}

.home-editors {
    text-align: left;
    max-width: 600px;
    margin: 0 auto;
}
.home-editors p { margin: 0.25rem 0; font-size: 0.9rem; }
.home-editors a { color: #8b3a3a; }

.home-image-link { display: block; text-align: center; }
.home-image {
    display: inline-block;
    max-width: 600px;
    width: 100%;
    margin: 1.5rem 0;
}

.home-panel {
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 1.5rem 2rem;
    margin: 1.5rem 0;
}

.home-panel h2 {
    font-family: var(--font-display);
    color: var(--ink);
    font-size: 1.5rem;
    font-weight: 600;
    margin: 0 0 1rem;
    padding-bottom: 0.375rem;
    border-bottom: 1px solid var(--border-color);
}

.home-panel p {
    color: var(--ink);
    line-height: 1.7;
    margin: 0.75rem 0;
}

.home-panel--subtle {
    background: var(--bg-base);
}
.home-panel--subtle p { font-size: 0.9rem; }
.home-panel--subtle img { margin-right: 0.5rem; vertical-align: middle; }

@media (max-width: 768px) {
    .home-title { font-size: 1.75rem; }
    .home-panel { padding: 1rem 1.25rem; }
}
