/* ═══════════════════════════════════════════════════════════
   GAWAIN — Castle Theme Global Styles
   kingofthegeeks.com
   ═══════════════════════════════════════════════════════════ */

/* ═══════════ REALM VARIABLES ═══════════ */
:root {
    --gold: #c9a84c;
    --gold-light: #e8d48b;
    --gold-dark: #8a6d2b;
    --crimson: #8b1a1a;
    --crimson-deep: #5c1010;
    --stone: #2a2520;
    --stone-light: #3d3630;
    --stone-dark: #1a1614;
    --parchment: #d4c5a9;
    --parchment-dark: #b8a88a;
    --iron: #4a4a4a;
    --shadow: rgba(0, 0, 0, 0.7);

    --nav-width: 260px;
}

/* ═══════════ RESET & BASE ═══════════ */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    scrollbar-width: thin;
    scrollbar-color: var(--gold-dark) var(--stone-dark);
}

body {
    background: var(--stone-dark);
    color: var(--parchment);
    font-family: 'Cormorant Garamond', Georgia, serif;
    overflow-x: hidden;
    min-height: 100vh;
    line-height: 1.6;
}

/* Stone texture overlay */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    background:
        repeating-linear-gradient(0deg, transparent, transparent 2px, rgba(0, 0, 0, 0.03) 2px, rgba(0, 0, 0, 0.03) 4px),
        repeating-linear-gradient(90deg, transparent, transparent 2px, rgba(0, 0, 0, 0.02) 2px, rgba(0, 0, 0, 0.02) 4px);
    pointer-events: none;
    z-index: 1000;
}

a {
    color: inherit;
    text-decoration: none;
}

h1:focus {
    outline: none;
}

::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: var(--stone-dark);
}

::-webkit-scrollbar-thumb {
    background: var(--gold-dark);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--gold);
}

/* ═══════════ SHARED TYPOGRAPHY ═══════════ */
.emphasis {
    color: var(--gold-light);
    font-weight: 500;
}

/* ═══════════ ORNAMENTAL DIVIDERS ═══════════ */
.divider {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    padding: 2rem 0;
    opacity: 0.6;
    max-width: 900px;
    margin: 0 auto;
}

.divider::before,
.divider::after {
    content: '';
    flex: 1;
    max-width: 200px;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--gold-dark), transparent);
}

.divider-icon {
    color: var(--gold-dark);
    font-size: 1.2rem;
}

/* ═══════════ PAGE HEADERS ═══════════ */
.page-header {
    text-align: center;
    padding: 6rem 2rem 3rem;
    position: relative;
    background:
        radial-gradient(ellipse at 50% 30%, rgba(201, 168, 76, 0.06) 0%, transparent 60%),
        linear-gradient(180deg, rgba(13, 11, 9, 1) 0%, var(--stone-dark) 100%);
}

.page-header h1 {
    font-family: 'Cinzel Decorative', serif;
    font-size: clamp(2rem, 5vw, 3.5rem);
    font-weight: 900;
    color: var(--gold);
    letter-spacing: 0.06em;
    line-height: 1.2;
    text-shadow:
        0 0 40px rgba(201, 168, 76, 0.3),
        0 2px 4px rgba(0, 0, 0, 0.8);
}

.page-subtitle {
    font-family: 'Cormorant Garamond', serif;
    font-size: clamp(1rem, 1.8vw, 1.2rem);
    font-weight: 300;
    font-style: italic;
    color: var(--parchment-dark);
    margin-top: 0.8rem;
    letter-spacing: 0.05em;
}

/* ═══════════ SECTION HEADERS ═══════════ */
.section-title {
    font-family: 'Cinzel', serif;
    font-size: clamp(1.4rem, 3vw, 2rem);
    font-weight: 600;
    color: var(--gold);
    letter-spacing: 0.08em;
    text-align: center;
    margin-bottom: 0.8rem;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

.section-subtitle {
    text-align: center;
    font-size: 1.05rem;
    font-style: italic;
    color: var(--parchment-dark);
    margin-bottom: 2.5rem;
    font-weight: 300;
}

/* ═══════════ FADE ANIMATIONS ═══════════ */
.fade-in {
    opacity: 0;
    transform: translateY(25px);
    animation: fadeReveal 0.8s ease-out forwards;
}

.fade-in:nth-child(2) { animation-delay: 0.15s; }
.fade-in:nth-child(3) { animation-delay: 0.3s; }
.fade-in:nth-child(4) { animation-delay: 0.45s; }
.fade-in:nth-child(5) { animation-delay: 0.6s; }

@keyframes fadeReveal {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes revealDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes revealUp {
    from {
        opacity: 0;
        transform: translateY(40px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes flicker {
    0% { opacity: 0.6; transform: scale(1); }
    25% { opacity: 0.8; }
    50% { opacity: 0.65; transform: scale(1.05); }
    75% { opacity: 0.9; }
    100% { opacity: 0.7; transform: scale(0.98); }
}

/* ═══════════ BLAZOR ERROR UI ═══════════ */
#blazor-error-ui {
    background: var(--crimson-deep);
    color: var(--parchment);
    bottom: 0;
    box-shadow: 0 -1px 8px rgba(0, 0, 0, 0.5);
    box-sizing: border-box;
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
    font-family: 'Cinzel', serif;
    font-size: 0.9rem;
    letter-spacing: 0.04em;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 0.75rem;
    top: 0.5rem;
}

#blazor-error-ui .reload {
    color: var(--gold);
}

.blazor-error-boundary {
    background: var(--crimson-deep);
    padding: 1rem 1rem 1rem 1.5rem;
    color: var(--parchment);
    font-family: 'Cormorant Garamond', serif;
}

.blazor-error-boundary::after {
    content: "Something has gone awry in the castle."
}

/* ═══════════ RESPONSIVE HELPERS ═══════════ */
@media (max-width: 900px) {
    .page-header {
        padding: 5rem 1.5rem 2.5rem;
    }
}

@media (max-width: 480px) {
    .page-header h1 {
        font-size: 1.8rem;
    }
}
