/*
 * Design tokens reverse-engineered from the original WordPress/Elementor
 * site's global Kit. Meant as a clean starting point — tune freely.
 */
:root {
    color-scheme: dark;

    --color-bg:          #1B1B1B;
    --color-bg-alt:      #1D1D1D;
    --color-bg-raised:   #242424;
    --color-border:      #333333;

    --color-text:        #7A7A7A;
    --color-text-strong: #FFFFFF;
    --color-text-muted:  #5A5A5A;

    --color-accent:      #6EC1E4;
    --color-secondary:   #54595F;
    --color-link:        #FFFFFF;

    --color-button-bg:   #0158A1;
    --color-button-text: #FFFFFF;

    --color-error-bg:    #3a1f1f;
    --color-error-text:  #f2a6a6;
    --color-success-bg:  #1f3a24;
    --color-success-text: #9ad9a8;

    --font-body:    'Signika', system-ui, sans-serif;
    --font-heading: 'Signika', system-ui, sans-serif;
    --font-serif:   'Signika', system-ui, sans-serif;

    --container-width: 900px;
    --radius-card:      6px;
    --radius-avatar:    50%;
    --radius-cover:     6px;
}

* { box-sizing: border-box; }

html, body {
    background: var(--color-bg);
    color: var(--color-text);
}

body {
    margin: 0;
    font-family: var(--font-body);
    line-height: 1.55;
}

h1, h2, h3, h4 {
    font-family: var(--font-heading);
    font-weight: 600;
    color: var(--color-text-strong);
    line-height: 1.25;
}

.site-main--home h1,
.site-main--home h2,
.site-main--home h3,
.site-main--home h4 {
    padding-left: 1rem;
}

h2 { font-family: var(--font-serif); font-weight: 500; }

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

/* ---------- Header ---------- */
.site-header {
    position: sticky;
    top: 0;
    z-index: 10;
    background: var(--color-bg-alt);
    border-bottom: 1px solid var(--color-border);
}

.site-header-inner {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.site-header .brand {
    display: inline-flex;
    align-items: center;
}
.site-header .brand:hover { text-decoration: none; opacity: 0.85; }
.site-header .brand img {
    display: block;
    height: 32px;
    width: auto;
}

.site-header nav a {
    margin-left: 1.25rem;
    font-size: 0.95rem;
    color: var(--color-text);
}
.site-header nav a:hover { color: var(--color-text-strong); }

.nav-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 32px;
    height: 32px;
    padding: 0;
    background: none;
    border: none;
    cursor: pointer;
}
.nav-toggle span {
    display: block;
    height: 2px;
    background: var(--color-text-strong);
    border-radius: 1px;
}

/*
 * Below this width, the member roster's auto-fill grid (150px min tracks,
 * 1.5rem gap, inside the 900px/1.5rem-padded main column) drops to 3
 * columns — collapse the nav into a hamburger before links start wrapping.
 */
@media (max-width: 719px) {
    .nav-toggle { display: flex; }

    .site-header nav {
        display: none;
        flex-basis: 100%;
        flex-direction: column;
        gap: 0;
    }
    .site-header nav.is-open { display: flex; }
    .site-header nav a {
        margin-left: 0;
        padding: 0.65rem 0;
        border-top: 1px solid var(--color-border);
    }
}

/* ---------- Layout ---------- */
.site-main {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 1rem 1rem;
    min-height: 60vh;
    background: #1a1a18;
}
.site-main--home { padding-left: 0; padding-right: 0; }

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

/* ---------- Flash messages ---------- */
.flash {
    padding: 0.85rem 1.1rem;
    border-radius: var(--radius-card);
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
}
.flash-error   { background: var(--color-error-bg);   color: var(--color-error-text); }
.flash-success { background: var(--color-success-bg); color: var(--color-success-text); }
.flash ul { margin: 0; padding-left: 1.2rem; }

/* ---------- Cards ---------- */
.card {
    background: var(--color-bg-raised);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-card);
    padding: 1.25rem;
    margin-bottom: 1.25rem;
}

.card h2, .card h3 { margin-top: 0; }

.card img.cover,
img.cover {
    border-radius: var(--radius-cover);
    max-width: 100%;
    display: block;
}

img.avatar {
    border-radius: var(--radius-avatar);
    object-fit: cover;
}

/* ---------- Forms ---------- */
form .field { margin-bottom: 1.25rem; }

form label {
    display: block;
    font-weight: 500;
    color: var(--color-text-strong);
    margin-bottom: 0.4rem;
    font-size: 0.9rem;
}

form input,
form select,
form textarea {
    width: 100%;
    padding: 0.65rem 0.75rem;
    box-sizing: border-box;
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: 4px;
    color: var(--color-text-strong);
    font-family: inherit;
    font-size: 0.95rem;
}

form input:focus,
form select:focus,
form textarea:focus {
    outline: none;
    border-color: var(--color-accent);
}

form input[type="checkbox"] { width: auto; }

.song-row { display: flex; gap: 0.6rem; margin-bottom: 0.6rem; }
.song-row input { flex: 1; }

button,
input[type="submit"] {
    padding: 0.7rem 1.4rem;
    background: var(--color-button-bg);
    color: var(--color-button-text);
    border: none;
    border-radius: 4px;
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
}
button:hover, input[type="submit"]:hover { background: #0169bd; }

.form-actions { display: flex; align-items: center; gap: 0.8rem; margin-top: 0.4rem; }
.btn-cancel {
    padding: 0.7rem 1.4rem;
    background: transparent;
    color: inherit;
    border: 1px solid var(--color-button-bg);
    border-radius: 4px;
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 500;
    text-decoration: none;
    display: inline-block;
}
.btn-cancel:hover { background: rgba(255, 255, 255, 0.08); }

/* ---------- Misc ---------- */
.video-embed {
    position: relative;
    width: 100%;
    padding-top: 56.25%; /* matches the source videos' actual 16:9 encode, confirmed via Vimeo oEmbed — keeps the iframe exactly the video's shape so there's no letterbox space for Vimeo's own page background to show through */
    margin: 1.5rem 0;
    overflow: hidden;
    border-radius: var(--radius-cover);
    background: #000;
}
.video-embed iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
    display: block;
}

.audio-embed { margin: 1.5rem 0; }
.audio-embed iframe { width: 100%; border-radius: var(--radius-cover); border: none; }

details summary { cursor: pointer; color: var(--color-text-strong); font-weight: 500; }

/* ---------- Login / Register ---------- */
.auth-forms {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
    align-items: flex-start;
}
.auth-forms .card { flex: 1 1 320px; margin-bottom: 0; }
.auth-forms .card h2 { margin-top: 0; }
.auth-forms form .field label { display: flex; align-items: center; gap: 0.5rem; font-weight: 400; }
.auth-forms form .field input[type="checkbox"] { width: auto; }
.auth-forms p { font-size: 0.85rem; margin-top: 1rem; }

/* ---------- Horizontal-scroll sections (homepage) ---------- */
.hscroll-section { margin-bottom: 2.5rem; }
.hscroll-section h2 { margin-bottom: 0.75rem; }

.hscroll {
    display: flex;
    gap: 1rem;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-padding-left: 1rem;
    scroll-padding-right: 1rem;
    padding-bottom: 0.6rem;
    -webkit-overflow-scrolling: touch;
}
/*
 * scroll-padding alone clamps to 0 (nothing precedes/follows the end cards
 * to make room for), and a spacer alone gets snapped past by the mandatory
 * start-alignment on the cards. Together: the spacers give the end cards a
 * real 1rem offset, and scroll-padding tells the snap algorithm that offset
 * already satisfies "start"/"end" — so resting/end scroll position keeps
 * the 1rem gap instead of auto-correcting to hide the spacer.
 */
.hscroll::before,
.hscroll::after {
    content: '';
    flex: 0 0 1rem;
}
.hscroll::-webkit-scrollbar { height: 6px; }
.hscroll::-webkit-scrollbar-track { background: transparent; }
.hscroll::-webkit-scrollbar-thumb { background: var(--color-border); border-radius: 3px; }

.hscroll-card {
    flex: 0 0 auto;
    scroll-snap-align: start;
    width: 160px;
    text-align: center;
}
.hscroll-card:hover { text-decoration: none; }

.hscroll-card img {
    width: 160px;
    height: 160px;
    object-fit: cover;
    border-radius: var(--radius-cover);
    display: block;
    background: var(--color-bg-raised);
}
.hscroll-card.member-card img { border-radius: var(--radius-avatar); }

.hscroll-card .hscroll-title {
    display: block;
    margin-top: 0.5rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--color-text-strong);
}

.hscroll-card .hscroll-tagline {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    margin-top: 0.15rem;
    font-size: 0.78rem;
    line-height: 1.3;
    color: var(--color-text);
    overflow: hidden;
}

.hscroll-card .hscroll-count {
    display: block;
    margin-top: 0.3rem;
    font-size: 0.7rem;
    letter-spacing: 0.03em;
    color: var(--color-accent);
}

/* ---------- Member profile page ---------- */
.member-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 0.75rem;
    margin-bottom: 1.75rem;
}
.member-header img.avatar {
    width: 120px;
    height: 120px;
    object-fit: cover;
    background: var(--color-bg-raised);
}
.member-header .member-tagline {
    color: var(--color-text);
    font-style: italic;
    margin: 0.35rem 0 0;
}
.member-header .member-count {
    color: var(--color-accent);
    font-size: 0.85rem;
    letter-spacing: 0.03em;
    margin: 0.35rem 0 0;
}

.card.submission h3 { margin-bottom: 0; }
.card.submission .mix-party {
    margin-left: 0.6rem;
    font-size: 0.75rem;
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--color-text-muted);
    vertical-align: middle;
}

/* ---------- Member roster (index) / Parties (index) ---------- */
.member-grid,
.party-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 1.5rem;
}
.member-grid .hscroll-card,
.party-grid .hscroll-card { width: auto; }
.member-grid .hscroll-card img,
.party-grid .hscroll-card img { width: 100%; height: auto; aspect-ratio: 1 / 1; }

/*
 * About cards (Story/Process): keep their rectangular shape and larger size
 * at every width. Cards fit side by side on desktop with room to spare, so
 * this row never needs to scroll there — it only kicks in once the viewport
 * gets too narrow to fit both, at which point they scroll horizontally
 * instead of wrapping to a new line (mirrors the old WP homepage's carousel,
 * which drops to 1 visible card + scroll on narrow screens rather than
 * stacking).
 */
.intro-cards {
    display: flex;
    gap: 1.25rem;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-padding-left: 1rem;
    scroll-padding-right: 1rem;
    padding-bottom: 0.6rem;
    -webkit-overflow-scrolling: touch;
}
/* Same spacer + scroll-padding pairing as .hscroll — see its comment above. */
.intro-cards::before,
.intro-cards::after {
    content: '';
    flex: 0 0 1rem;
}
.intro-cards .card {
    flex: 0 0 260px;
    scroll-snap-align: start;
    padding: 0;
    overflow: hidden;
    display: block;
    color: inherit;
}
.intro-cards .card:hover { text-decoration: none; border-color: var(--color-accent); }
.intro-cards .card img {
    display: block;
    width: 100%;
    aspect-ratio: 525 / 300;
    object-fit: cover;
}
.intro-cards .card h3,
.intro-cards .card p { margin: 0.9rem 1.25rem 0; }
.intro-cards .card p { margin-top: 0.35rem; padding-bottom: 1.25rem; }

@media (min-width: 601px) {
    /* Cards fit without overflowing here, so this isn't in scroll mode —
       drop the spacers and use real padding on the row instead. */
    .intro-cards { padding-left: 1rem; padding-right: 1rem; }
    .intro-cards::before,
    .intro-cards::after { content: none; }
    .intro-cards .card { flex: 1 1 260px; }
}


audio { width: 100%; margin: 0.75rem 0; }

/* ---------- Wimpy "Music Only" player ---------- */
.wimpy-player {
    width: 100%;
    max-width: 420px;
    margin: 0 auto;
}

/* ---------- Story page inline images ---------- */
.story-image { text-align: center; }
.story-image img {
    max-width: 300px;
    width: 100%;
    height: auto;
    border-radius: var(--radius-cover);
    display: inline-block;
}
.story-image-group {
    display: flex;
    justify-content: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}
.story-image-group img { max-width: 100px; }
.story-image img.story-logo { max-width: 257px; }
