/* === Fonts === */
@import url("https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,400;9..144,500;9..144,600;9..144,700&family=Lato:wght@300;400;700&display=swap");

/* === Reset === */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* === Tokens === */
:root {
    --garance: #8b2a1a;
    --garance-dark: #6b1f12;
    --garance-light: #a8392a;
    --or: #b8892e;
    --or-light: #d4a84b;
    --pierre-light: #e8e0d4;
    --pierre: #d4c8b0;
    --pierre-mid: #9a8a72;
    --pierre-dark: #5c4d3c;
    --ink: #2c1f0e;
    --ink-soft: #4a3825;
    --parchment: #faf5ee;
    --shadow: 0 8px 32px rgba(44, 31, 14, 0.35);
    --shadow-card: 0 12px 48px rgba(44, 31, 14, 0.45);
    --radius: 18px;
    --radius-sm: 10px;
}

html,
body {
    font-family: "Lato", system-ui, sans-serif;
    color: var(--ink);
    background: var(--ink);
    min-height: 100vh;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

h1,
h2,
h3,
h4 {
    font-family: "Fraunces", Georgia, serif;
    font-weight: 500;
    letter-spacing: 0.01em;
    line-height: 1.2;
    font-variation-settings: "opsz" 60;
}

a {
    color: inherit;
    text-decoration: none;
}

/* === Background carousel (used on homepage) === */
#bg-carousel {
    position: fixed;
    inset: 0;
    z-index: 0;
    background: var(--ink);
}

.page {
    position: relative;
    z-index: 1;
}

#bg-carousel .slide {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    opacity: 0;
    animation: bgFade var(--bg-cycle, 150s) infinite linear;
}

#bg-carousel::after {
    /* Subtle dark overlay for legibility */
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(
        ellipse at center,
        rgba(20, 14, 5, 0.25) 0%,
        rgba(20, 14, 5, 0.55) 100%
    );
}

@keyframes bgFade {
    /* Each photo: 5s slot within 150s total (30 photos).
       Fade in 0-0.8s, hold 0.8-5s, fade out 5-5.8s (cross-fades with next slide). */
    0% {
        opacity: 0;
    }
    0.533% {
        opacity: 1;
    }
    3.333% {
        opacity: 1;
    }
    3.867% {
        opacity: 0;
    }
    100% {
        opacity: 0;
    }
}

/* === Page layout === */
.page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: clamp(20px, 4vw, 40px) clamp(14px, 4vw, 20px) 80px;
    position: relative;
}

/* Sub-pages (non-homepage) use a parchment background */
.page--parchment {
    background:
        radial-gradient(
            ellipse at top,
            var(--pierre-light) 0%,
            var(--pierre) 100%
        ),
        var(--pierre);
    color: var(--ink);
}

.page--parchment::before {
    content: "";
    position: fixed;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160' viewBox='0 0 160 160'%3E%3Cfilter id='n'%3E%3CfeTurbulence baseFrequency='0.85' numOctaves='2' seed='5'/%3E%3CfeColorMatrix values='0 0 0 0 0.36 0 0 0 0 0.3 0 0 0 0 0.24 0 0 0 0.08 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
    opacity: 0.5;
    mix-blend-mode: multiply;
    pointer-events: none;
    z-index: 0;
}

.page > * {
    position: relative;
    z-index: 1;
}

/* === Hero card (homepage) === */
.hero-card {
    width: 100%;
    max-width: 880px;
    backdrop-filter: blur(22px) saturate(125%);
    -webkit-backdrop-filter: blur(22px) saturate(125%);
    background: rgba(20, 14, 5, 0.45);
    border: 1px solid rgba(232, 224, 212, 0.18);
    border-radius: 24px;
    padding: clamp(28px, 5vw, 48px) clamp(22px, 5vw, 56px) clamp(26px, 4vw, 40px);
    color: var(--parchment);
    box-shadow: var(--shadow-card);
    margin-top: 6vh;
}

.hero-card h1 {
    font-family: "Fraunces", Georgia, serif;
    font-weight: 400;
    font-size: clamp(28px, 4.5vw, 44px);
    text-align: center;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--parchment);
}

.hero-card .subtitle {
    text-align: center;
    color: var(--or-light);
    font-family: "Fraunces", Georgia, serif;
    font-style: italic;
    font-size: clamp(16px, 1.8vw, 19px);
    margin-top: 6px;
    letter-spacing: 0.04em;
}

.hero-card .welcome {
    text-align: center;
    margin-top: 22px;
    font-size: 15px;
    color: rgba(250, 245, 238, 0.88);
    max-width: 560px;
    margin-inline: auto;
    line-height: 1.6;
}

.hero-card .lead {
    text-align: center;
    margin-top: 18px;
    font-size: 13.5px;
    color: rgba(250, 245, 238, 0.72);
    letter-spacing: 0.02em;
}

.hero-card .tagline {
    text-align: center;
    margin-top: 30px;
    font-size: 13.5px;
    color: rgba(250, 245, 238, 0.7);
    font-style: italic;
}

/* === Sub-cards grid === */
.cards-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    margin-top: 24px;
}

.sub-card {
    display: block;
    background: rgba(232, 224, 212, 0.07);
    border: 1px solid rgba(232, 224, 212, 0.12);
    border-radius: 14px;
    padding: 20px 22px 22px;
    color: var(--parchment);
    transition:
        background 0.25s,
        border-color 0.25s,
        transform 0.25s;
}

.sub-card:hover {
    background: rgba(232, 224, 212, 0.12);
    border-color: rgba(212, 168, 75, 0.45);
    transform: translateY(-2px);
}

.sub-card h3 {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 17px;
    font-weight: 600;
    color: var(--parchment);
}

.sub-card h3 svg {
    width: 22px;
    height: 22px;
    color: var(--or-light);
    flex-shrink: 0;
}

.sub-card p {
    margin-top: 8px;
    font-size: 13px;
    color: rgba(250, 245, 238, 0.72);
    line-height: 1.5;
}

.sub-card .accent {
    color: var(--or-light);
    font-weight: 600;
    font-size: 13px;
    margin-top: 6px;
    display: block;
}

/* CTA buttons within Organisation card */
.sub-card-ctas {
    display: flex;
    gap: 10px;
    margin-top: 14px;
}

.sub-card-ctas a {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 60px;
    padding: 12px 8px;
    background: rgba(232, 224, 212, 0.08);
    border: 1px solid rgba(232, 224, 212, 0.14);
    border-radius: 10px;
    color: var(--parchment);
    font-size: 12px;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    transition:
        background 0.2s,
        border-color 0.2s;
    -webkit-tap-highlight-color: transparent;
}

.sub-card-ctas a:active {
    background: rgba(212, 168, 75, 0.25);
}

.sub-card-ctas a:hover {
    background: rgba(212, 168, 75, 0.18);
    border-color: rgba(212, 168, 75, 0.5);
    color: var(--or-light);
}

.sub-card-ctas svg {
    width: 22px;
    height: 22px;
    color: var(--or-light);
}

/* === Asso links footer (homepage bottom strip) === */
.asso-strip {
    margin-top: 22px;
    width: 100%;
    background: rgba(250, 245, 238, 0.92);
    border-radius: 999px;
    padding: 14px 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 28px;
    flex-wrap: wrap;
    box-shadow: var(--shadow);
}

.asso-strip a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--ink-soft);
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    padding: 8px 10px;
    border-radius: 8px;
    min-height: 36px;
    transition:
        color 0.2s,
        background 0.2s;
    -webkit-tap-highlight-color: transparent;
}

.asso-strip a:active {
    background: rgba(139, 42, 26, 0.08);
    color: var(--garance);
}

.asso-strip a:hover {
    color: var(--garance);
}

.asso-strip svg {
    width: 16px;
    height: 16px;
    opacity: 0.8;
}

/* Album link - distinctive accent (gold/garance) */
.asso-strip__album {
    color: var(--garance) !important;
}

.asso-strip__album svg {
    width: 18px !important;
    height: 18px !important;
    opacity: 1 !important;
}

.asso-strip__album:hover {
    color: var(--garance-dark) !important;
}

.asso-strip__sep {
    width: 1px;
    height: 16px;
    background: var(--pierre);
    flex-shrink: 0;
}

/* === Sub-page header (used on credits, contact, map, menu) === */
.page-header {
    text-align: center;
    max-width: 880px;
    width: 100%;
    margin-bottom: 36px;
}

.page-header .kicker {
    display: inline-block;
    color: var(--garance);
    font-size: 12px;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    font-weight: 700;
    margin-bottom: 12px;
}

.page-header h1 {
    font-family: "Fraunces", Georgia, serif;
    font-weight: 400;
    font-size: clamp(28px, 4vw, 42px);
    color: var(--ink);
    letter-spacing: 0.02em;
}

.page-header .rule {
    width: 80px;
    height: 2px;
    background: var(--or);
    margin: 18px auto 0;
}

.page-header .intro {
    margin-top: 18px;
    font-size: 15px;
    color: var(--ink-soft);
    max-width: 620px;
    margin-inline: auto;
    line-height: 1.65;
}

.page-content {
    width: 100%;
    max-width: 1000px;
}

/* === Back-home button (sub-pages) === */
.btn-back {
    position: fixed;
    top: 24px;
    left: 24px;
    z-index: 50;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 44px;
    padding: 9px 16px;
    background: rgba(250, 245, 238, 0.85);
    border: 1px solid var(--pierre);
    border-radius: 999px;
    color: var(--ink-soft);
    font-size: 12px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    font-weight: 600;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    transition:
        background 0.2s,
        color 0.2s;
    box-shadow: 0 4px 12px rgba(44, 31, 14, 0.12);
    -webkit-tap-highlight-color: transparent;
}

.btn-back:active {
    background: var(--parchment);
    color: var(--garance);
}

.btn-back:hover {
    background: var(--parchment);
    color: var(--garance);
}

.btn-back svg {
    width: 16px;
    height: 16px;
}

/* === Card panels (re-usable on sub-pages) === */
.panel {
    background: var(--parchment);
    border: 1px solid var(--pierre);
    border-radius: var(--radius);
    padding: 28px 32px;
    box-shadow: 0 6px 20px rgba(44, 31, 14, 0.08);
}

.panel + .panel {
    margin-top: 22px;
}

.panel h2 {
    color: var(--ink);
    font-size: 22px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 12px;
}

.panel h2 svg {
    width: 24px;
    height: 24px;
    color: var(--garance);
    flex-shrink: 0;
}

.panel h2::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--pierre);
    margin-left: 6px;
}

/* === Responsive === */
@media (max-width: 720px) {
    .hero-card {
        border-radius: 18px;
    }
    .hero-card .welcome,
    .hero-card .lead,
    .hero-card .tagline {
        max-width: 100%;
    }
    .cards-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    .sub-card {
        padding: 18px 18px 20px;
    }
    .asso-strip {
        gap: 6px;
        padding: 10px 12px;
        border-radius: 18px;
    }
    .panel {
        padding: 22px 18px;
    }
    .panel h2 {
        font-size: 19px;
    }
    .page-header {
        margin-bottom: 26px;
    }
    .page-header .intro {
        font-size: 14.5px;
    }
    .btn-back {
        top: 12px;
        left: 12px;
        padding: 9px 14px;
        font-size: 11.5px;
    }
}

@media (max-width: 480px) {
    .hero-card {
        margin-top: 4vh;
        padding: 26px 20px 24px;
    }
    .hero-card .welcome {
        font-size: 14.5px;
    }
    .sub-card-ctas {
        gap: 8px;
    }
    .sub-card-ctas a {
        font-size: 11.5px;
        padding: 10px 6px;
    }
    .asso-strip {
        font-size: 11.5px;
    }
}

@media (max-width: 380px) {
    .hero-card {
        padding: 22px 16px 22px;
    }
    .hero-card h1 {
        letter-spacing: 0.06em;
    }
    .sub-card-ctas a {
        font-size: 11px;
        letter-spacing: 0.04em;
    }
    .asso-strip {
        gap: 4px;
    }
    .asso-strip a {
        font-size: 11px;
        padding: 6px 8px;
    }
}

/* Restore hover only on devices that actually hover */
@media (hover: none) {
    .sub-card:hover,
    .asso-strip a:hover,
    .btn-back:hover,
    .sub-card-ctas a:hover {
        background: inherit;
        color: inherit;
        transform: none;
    }
}
