/* ═══════════════════════════════════════════════════════════
   VALLEY OF SHADOWS
   Tales from Venturia & Vallombrosa
   ═══════════════════════════════════════════════════════════ */

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
img { max-width: 100%; display: block; }

/* ── Variables ── */
:root {
    --gold:          #c9a84c;
    --gold-bright:   #e8c84a;
    --gold-dim:      rgba(201, 168, 76, 0.35);
    --gold-border:   rgba(201, 168, 76, 0.18);
    --gold-glow:     rgba(201, 168, 76, 0.15);
    --crimson:       #8b1a2a;
    --cream:         #e8dcc8;
    --cream-mid:     #c4b49a;
    --cream-dim:     #8a7a64;
    --black:         #090709;
    --dark:          #0d0b11;
    --dark-mid:      #141020;
    --dark-warm:     #1a1424;
    --card-bg:       rgba(13, 10, 18, 0.97);
    --card-border:   rgba(201, 168, 76, 0.16);
    --nav-h:         64px;
    --max-w:         1380px;
    --pad:           1.5rem;
    --font-d:        'IM Fell English', Georgia, serif;
    --font-h:        'Cinzel', Georgia, serif;
    --font-b:        'Crimson Text', Georgia, serif;
}

/* ── Base ── */
body {
    font-family: var(--font-b);
    font-size: 18px;
    line-height: 1.7;
    background: var(--dark);
    color: var(--cream);
    overflow-x: hidden;
    min-height: 100vh;
}

a { color: var(--gold); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--gold-bright); }

/* ══════════════════════════════════════════════
   NAVIGATION
══════════════════════════════════════════════ */
.site-nav {
    position: fixed;
    inset: 0 0 auto;
    z-index: 200;
    height: var(--nav-h);
    background: rgba(9, 7, 9, 0.9);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--gold-border);
}

.nav-inner {
    max-width: var(--max-w);
    margin: 0 auto;
    height: 100%;
    display: flex;
    align-items: center;
    padding: 0 var(--pad);
    gap: 2rem;
}

/* Brand */
.nav-brand {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    flex-shrink: 0;
    color: var(--cream);
}
.nav-brand:hover { color: var(--gold); }

.nav-logo {
    width: 38px;
    height: 38px;
    object-fit: contain;
    border-radius: 50%;
    filter: brightness(0.85);
    transition: filter 0.2s;
}
.nav-brand:hover .nav-logo { filter: brightness(1.1); }

.nav-title {
    font-family: var(--font-h);
    font-size: 0.82rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--gold);
    white-space: nowrap;
}

/* Links */
.nav-links {
    display: flex;
    list-style: none;
    flex: 1;
    justify-content: center;
    gap: 0.1rem;
}

.nav-links a {
    font-family: var(--font-h);
    font-size: 0.72rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--cream-dim);
    padding: 0.45rem 1.1rem;
    position: relative;
    transition: color 0.2s;
}
.nav-links a::after {
    content: '';
    position: absolute;
    bottom: 2px;
    left: 1.1rem;
    right: 1.1rem;
    height: 1px;
    background: var(--gold);
    transform: scaleX(0);
    transition: transform 0.25s ease;
}
.nav-links a:hover,
.nav-links a.active { color: var(--gold); }
.nav-links a:hover::after,
.nav-links a.active::after { transform: scaleX(1); }

/* Session countdown in nav */
.nav-session {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    flex-shrink: 0;
}
.nav-session-label {
    font-family: var(--font-h);
    font-size: 0.6rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--cream-dim);
}
#nav-countdown {
    font-family: var(--font-h);
    font-size: 0.8rem;
    letter-spacing: 0.06em;
    color: var(--gold);
}

/* ══════════════════════════════════════════════
   HERO
══════════════════════════════════════════════ */
.hero {
    position: relative;
    height: 100vh;
    min-height: 640px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    padding-top: var(--nav-h);
}

.hero-bg {
    position: absolute;
    inset: -5%;
    background-image: url('../images/masqueradebackground.png');
    background-size: cover;
    background-position: center 25%;
    animation: hero-drift 35s ease-in-out infinite alternate;
}

@keyframes hero-drift {
    from { transform: scale(1.05) translateY(0px);   }
    to   { transform: scale(1.09) translateY(-14px); }
}

.hero-overlay {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse at 50% 30%, rgba(9,7,9,0.15) 0%, rgba(9,7,9,0.55) 55%),
        linear-gradient(to bottom,
            rgba(9,7,9,0.45)  0%,
            rgba(9,7,9,0.25) 35%,
            rgba(9,7,9,0.65) 75%,
            rgba(9,7,9,1.00) 100%);
}

.hero-content {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.25rem;
    text-align: center;
    padding: 2rem;
}

.hero-logo {
    width: min(440px, 78vw);
    filter:
        drop-shadow(0 0 50px rgba(201, 168, 76, 0.25))
        drop-shadow(0 8px 28px rgba(0,0,0,0.85));
    animation: hero-float 7s ease-in-out infinite;
}
@keyframes hero-float {
    0%, 100% { transform: translateY(0);    }
    50%       { transform: translateY(-9px); }
}

.hero-tagline {
    font-family: var(--font-d);
    font-style: italic;
    font-size: 1.2rem;
    color: var(--cream-mid);
    letter-spacing: 0.1em;
    text-shadow: 0 2px 16px rgba(0,0,0,1);
}

.hero-scroll-hint {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1;
    color: var(--gold-dim);
    font-size: 1.4rem;
    animation: scroll-bounce 2.5s ease-in-out infinite;
}
@keyframes scroll-bounce {
    0%, 100% { transform: translateX(-50%) translateY(0);   opacity: 0.4; }
    50%       { transform: translateX(-50%) translateY(8px); opacity: 0.9; }
}

/* ══════════════════════════════════════════════
   ORNAMENT BAND (full-width divider between hero & main)
══════════════════════════════════════════════ */
.ornament-band {
    width: 100%;
    background: var(--dark-warm);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.4rem 0;
    border-top: 1px solid var(--gold-border);
    border-bottom: 1px solid var(--gold-border);
}
.ornament-line {
    display: block;
    max-width: min(640px, 90%);
    height: auto;
}

/* CSS-only inline divider */
.css-divider {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin: 2.5rem 0 1.5rem;
    color: var(--gold-dim);
    font-size: 1rem;
}
.css-divider::before,
.css-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: linear-gradient(to right, transparent, var(--gold-dim));
}
.css-divider::after {
    background: linear-gradient(to left, transparent, var(--gold-dim));
}
.css-divider span {
    color: var(--gold-dim);
    flex-shrink: 0;
}

/* ══════════════════════════════════════════════
   LAYOUT
══════════════════════════════════════════════ */
.site-main {
    background: var(--dark);
    padding: 3rem 0 6rem;
}

.content-grid {
    max-width: var(--max-w);
    margin: 0 auto;
    padding: 0 var(--pad);
    display: grid;
    grid-template-columns: 258px 1fr 258px;
    grid-template-areas: "left center right";
    gap: 1.75rem;
    align-items: start;
}

.sidebar-left  { grid-area: left;   }
.center-content{ grid-area: center; }
.sidebar-right { grid-area: right;  }

/* Sticky sidebars */
.sidebar {
    position: sticky;
    top: calc(var(--nav-h) + 1.5rem);
}

/* ══════════════════════════════════════════════
   WIDGETS (shared)
══════════════════════════════════════════════ */
.widget {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-top: 2px solid var(--gold-dim);
    padding: 1.4rem 1.5rem;
    margin-bottom: 1.4rem;
    position: relative;
    overflow: hidden;
}
.widget::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at top right, var(--gold-glow) 0%, transparent 65%);
    pointer-events: none;
}

.widget-title {
    font-family: var(--font-h);
    font-size: 0.68rem;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--gold);
    margin-bottom: 1.1rem;
    padding-bottom: 0.55rem;
    border-bottom: 1px solid var(--gold-border);
}

/* ══════════════════════════════════════════════
   COUNTDOWN WIDGET
══════════════════════════════════════════════ */
.countdown-widget { text-align: center; }

.session-date {
    font-family: var(--font-d);
    font-style: italic;
    font-size: 0.92rem;
    color: var(--cream-mid);
    line-height: 1.4;
    margin-bottom: 0.6rem;
}

.countdown-display {
    font-family: var(--font-h);
    font-size: 1.55rem;
    letter-spacing: 0.06em;
    color: var(--gold);
    text-shadow: 0 0 24px rgba(201, 168, 76, 0.45);
    padding: 0.35rem 0;
}

/* ══════════════════════════════════════════════
   PARTY ROSTER
══════════════════════════════════════════════ */
.party-list { list-style: none; }
.party-list li {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 0.5rem;
    padding: 0.48rem 0;
    border-bottom: 1px solid rgba(201, 168, 76, 0.07);
}
.party-list li:last-child { border-bottom: none; }

.char-name {
    font-family: var(--font-d);
    font-style: italic;
    font-size: 1rem;
    color: var(--cream);
}
.char-class {
    font-family: var(--font-h);
    font-size: 0.62rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--cream-dim);
    flex-shrink: 0;
}

/* ══════════════════════════════════════════════
   WIKI NAV WIDGET
══════════════════════════════════════════════ */
.wiki-nav-list { list-style: none; }
.wiki-nav-list li { border-bottom: 1px solid rgba(201, 168, 76, 0.07); }
.wiki-nav-list li:last-child { border-bottom: none; }

.wiki-nav-list a {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.5rem 0.2rem;
    font-family: var(--font-d);
    font-size: 1rem;
    color: var(--cream-mid);
    transition: all 0.18s;
}
.wiki-nav-list a:hover {
    color: var(--gold);
    padding-left: 0.5rem;
}
.wni {
    font-size: 0.8rem;
    width: 1rem;
    text-align: center;
    color: var(--gold-dim);
    flex-shrink: 0;
}

/* ══════════════════════════════════════════════
   WIKI EDITS
══════════════════════════════════════════════ */
.wiki-edits-list { display: flex; flex-direction: column; }

.wiki-edit-item {
    padding: 0.45rem 0;
    border-bottom: 1px solid rgba(201, 168, 76, 0.07);
}
.wiki-edit-item:last-child { border-bottom: none; }

.wiki-edit-title {
    display: block;
    font-family: var(--font-d);
    font-style: italic;
    font-size: 1rem;
    color: var(--cream);
}
.wiki-edit-title:hover { color: var(--gold); }

.wiki-edit-time {
    font-family: var(--font-h);
    font-size: 0.68rem;
    letter-spacing: 0.05em;
    color: var(--cream-dim);
    margin-top: 0.1rem;
}

/* ══════════════════════════════════════════════
   QUICK LINKS
══════════════════════════════════════════════ */
.quick-links-list { list-style: none; }
.quick-links-list li { border-bottom: 1px solid rgba(201, 168, 76, 0.07); }
.quick-links-list li:last-child { border-bottom: none; }
.quick-links-list a {
    display: block;
    padding: 0.48rem 0;
    font-family: var(--font-d);
    font-size: 1rem;
    color: var(--cream-mid);
    transition: all 0.18s;
}
.quick-links-list a:hover { color: var(--gold); padding-left: 0.45rem; }

/* ══════════════════════════════════════════════
   HERO UPDATE CARD (latest dispatch)
══════════════════════════════════════════════ */
.hero-update-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-top: 3px solid var(--gold);
    padding: 2.25rem 2.5rem;
    position: relative;
    overflow: hidden;
}
.hero-update-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse at top left, rgba(201,168,76,0.07) 0%, transparent 55%),
        radial-gradient(ellipse at bottom right, rgba(139,26,42,0.06) 0%, transparent 50%);
    pointer-events: none;
}

/* Update type badge */
.update-type-badge {
    display: inline-block;
    font-family: var(--font-h);
    font-size: 0.6rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    padding: 0.18rem 0.75rem;
    border: 1px solid var(--gold-dim);
    color: var(--gold);
    background: rgba(201, 168, 76, 0.07);
    margin-bottom: 0.85rem;
}

.update-header { margin-bottom: 1.25rem; }

.update-title {
    font-family: var(--font-h);
    font-size: 1.55rem;
    font-weight: 600;
    color: var(--cream);
    line-height: 1.3;
    margin-bottom: 0.65rem;
}

.update-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    font-family: var(--font-h);
    font-size: 0.72rem;
    letter-spacing: 0.06em;
    color: var(--cream-dim);
}

.update-content {
    font-size: 1.05rem;
    line-height: 1.78;
    color: var(--cream-mid);
}
.update-content p { margin-bottom: 0.75rem; }

.read-more {
    display: inline-block;
    margin-top: 1rem;
    font-family: var(--font-h);
    font-size: 0.68rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--gold);
    border-bottom: 1px solid var(--gold-dim);
    padding-bottom: 0.1rem;
    transition: all 0.2s;
}
.read-more:hover {
    color: var(--gold-bright);
    border-color: var(--gold);
    letter-spacing: 0.22em;
}

.update-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    margin-top: 1.25rem;
}
.tag {
    font-family: var(--font-h);
    font-size: 0.58rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--cream-dim);
    background: rgba(201, 168, 76, 0.05);
    border: 1px solid rgba(201, 168, 76, 0.12);
    padding: 0.14rem 0.55rem;
}

/* Session info inside widget */
.session-info { font-size: 0.95rem; }
.session-info h3 {
    font-family: var(--font-h);
    font-size: 0.8rem;
    font-weight: 400;
    letter-spacing: 0.06em;
    color: var(--gold);
    margin-bottom: 0.65rem;
}
.session-info p {
    margin-bottom: 0.35rem;
    color: var(--cream-mid);
    line-height: 1.5;
    font-size: 0.95rem;
}
.session-info strong { color: var(--cream); }

/* ══════════════════════════════════════════════
   SECTION HEADING
══════════════════════════════════════════════ */
.section-heading {
    font-family: var(--font-h);
    font-size: 0.7rem;
    letter-spacing: 0.28em;
    text-transform: uppercase;
    color: var(--gold);
    margin-bottom: 1.4rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}
.section-heading::after {
    content: '';
    flex: 1;
    height: 1px;
    background: linear-gradient(to right, var(--gold-dim), transparent);
}

/* ══════════════════════════════════════════════
   RECENT UPDATES GRID
══════════════════════════════════════════════ */
.updates-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.2rem;
}

.update-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-top: 2px solid var(--gold-dim);
    padding: 1.4rem;
    transition: border-color 0.22s, transform 0.22s, box-shadow 0.22s;
    cursor: default;
}
.update-card:hover {
    border-color: rgba(201,168,76,0.32);
    border-top-color: var(--gold);
    transform: translateY(-3px);
    box-shadow: 0 12px 36px rgba(0,0,0,0.55), 0 0 0 1px rgba(201,168,76,0.08);
}
.update-card h3 {
    font-family: var(--font-h);
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--cream);
    line-height: 1.35;
    margin: 0.45rem 0 0.55rem;
}
.update-card .update-meta { margin-bottom: 0.65rem; font-size: 0.7rem; }
.update-card p { font-size: 0.92rem; line-height: 1.65; color: var(--cream-dim); }

/* Loading state */
.loading-text {
    font-family: var(--font-d);
    font-style: italic;
    font-size: 0.95rem;
    color: var(--cream-dim);
    text-align: center;
    padding: 0.75rem 0;
}
.error { color: var(--crimson); font-style: italic; font-size: 0.9rem; }
.loading { color: var(--cream-dim); font-style: italic; font-size: 0.9rem; }

/* ══════════════════════════════════════════════
   FOOTER
══════════════════════════════════════════════ */
.site-footer {
    background: var(--dark-mid);
    border-top: 1px solid var(--gold-border);
    padding: 3.5rem 2rem;
    text-align: center;
}
.footer-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
}
.footer-icon {
    width: 68px;
    height: 68px;
    object-fit: contain;
    opacity: 0.65;
    margin: 0 auto;
}
.footer-title {
    font-family: var(--font-h);
    font-size: 0.72rem;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--gold);
}
.footer-sub {
    font-family: var(--font-d);
    font-style: italic;
    font-size: 0.95rem;
    color: var(--cream-dim);
}

/* ══════════════════════════════════════════════
   RESPONSIVE
══════════════════════════════════════════════ */
@media (max-width: 1160px) {
    .content-grid {
        grid-template-columns: 240px 1fr;
        grid-template-areas:
            "left  center"
            "right right";
    }
    .sidebar-right {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 1.25rem;
    }
    .sidebar-right .widget { margin-bottom: 0; }
    .sidebar-right { position: static; }
}

@media (max-width: 820px) {
    .content-grid {
        grid-template-columns: 1fr;
        grid-template-areas: "center" "left" "right";
    }
    .sidebar-left, .sidebar-right { position: static; }
    .sidebar-right { display: grid; grid-template-columns: 1fr 1fr; }
    .updates-grid  { grid-template-columns: 1fr; }
    .nav-session   { display: none; }
    .nav-links a   { padding: 0.4rem 0.65rem; font-size: 0.68rem; }
}

@media (max-width: 560px) {
    .sidebar-right { grid-template-columns: 1fr; }
    .nav-title     { display: none; }
    .hero-tagline  { font-size: 1rem; }
    .hero-logo     { width: min(300px, 86vw); }
    .hero-update-card { padding: 1.5rem; }
}
