:root {
    color-scheme: light;
    --bg: #f4f7f9;
    --surface: #ffffff;
    --surface-muted: #e8eef2;
    --text: #17202a;
    --muted: #5d6b78;
    --brand: #1f5f8f;
    --brand-strong: #123a5a;
    --accent: #b31f3b;
    --border: rgba(23, 32, 42, 0.13);
    --shadow: 0 16px 42px rgba(19, 47, 71, 0.14);
    --radius: 8px;
    --max-width: 1120px;
}

[data-theme="dark"] {
    color-scheme: dark;
    --bg: #101418;
    --surface: #171d23;
    --surface-muted: #202832;
    --text: #f4f7fb;
    --muted: #b6c2cf;
    --brand: #74b8e6;
    --brand-strong: #9dd1f3;
    --accent: #f06c7f;
    --border: rgba(255, 255, 255, 0.14);
    --shadow: 0 18px 46px rgba(0, 0, 0, 0.32);
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: Arial, Helvetica, sans-serif;
    line-height: 1.55;
}

body.lightbox-open {
    overflow: hidden;
}

a {
    color: var(--brand);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

img {
    display: block;
    max-width: 100%;
}

button,
input,
select,
textarea {
    font: inherit;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 20;
    background: color-mix(in srgb, var(--surface) 92%, transparent);
    border-bottom: 1px solid var(--border);
    backdrop-filter: blur(16px);
}

.nav {
    width: min(100% - 32px, var(--max-width));
    margin: 0 auto;
    min-height: 72px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
}

.brand-link {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    color: var(--text);
    font-weight: 800;
    letter-spacing: 0;
}

.brand-link:hover {
    text-decoration: none;
}

.brand-logo {
    width: 48px;
    height: 48px;
    object-fit: contain;
}

[data-theme="dark"] .brand-logo {
    content: url("../assets/logos/photo-club-logo-dark.png");
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.nav-links a,
.theme-toggle,
.button {
    min-height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius);
    border: 1px solid transparent;
    padding: 9px 13px;
    color: var(--text);
    background: transparent;
    cursor: pointer;
    text-decoration: none;
}

.nav-links a:hover,
.nav-links a[aria-current="page"],
.theme-toggle:hover {
    background: var(--surface-muted);
    text-decoration: none;
}

.theme-toggle {
    border-color: var(--border);
}

.button {
    background: var(--brand);
    color: #ffffff;
    border-color: var(--brand);
    font-weight: 700;
}

.button:hover {
    background: var(--brand-strong);
    text-decoration: none;
}

.button.secondary {
    background: transparent;
    color: var(--text);
    border-color: var(--border);
}

.button.secondary:hover {
    background: var(--surface-muted);
}

.page-hero,
.section,
.footer-inner {
    width: min(100% - 32px, var(--max-width));
    margin: 0 auto;
}

.page-hero {
    padding: 64px 0 34px;
}

.eyebrow {
    margin: 0 0 12px;
    color: var(--accent);
    font-weight: 800;
    text-transform: uppercase;
    font-size: 0.78rem;
    letter-spacing: 0.06em;
}

h1,
h2,
h3,
p {
    overflow-wrap: anywhere;
}

h1 {
    max-width: 820px;
    margin: 0;
    font-size: clamp(2.2rem, 6vw, 5.1rem);
    line-height: 0.98;
    letter-spacing: 0;
}

h2 {
    margin: 0 0 16px;
    font-size: clamp(1.7rem, 3vw, 2.6rem);
    line-height: 1.05;
}

h3 {
    margin: 0 0 8px;
    font-size: 1.12rem;
}

.lead {
    max-width: 720px;
    margin: 18px 0 0;
    color: var(--muted);
    font-size: 1.12rem;
}

.gallery-hero {
    display: grid;
    grid-template-columns: auto minmax(220px, 0.8fr) minmax(280px, 1.2fr);
    align-items: end;
    gap: 16px;
    padding: 22px 0 10px;
}

.gallery-hero .eyebrow,
.gallery-hero .lead {
    margin: 0;
}

.gallery-hero h1 {
    max-width: none;
    font-size: clamp(1.6rem, 3vw, 2.4rem);
    line-height: 1;
}

.gallery-hero .lead {
    max-width: none;
    font-size: 0.98rem;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 26px;
}

.section {
    padding: 38px 0;
}

.gallery-section {
    padding-top: 12px;
}

.section-header {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 18px;
}

.section-header p {
    margin: 0;
    color: var(--muted);
}

.home-photo-grid {
    display: grid;
    grid-template-columns: 1.25fr 0.8fr 0.95fr;
    grid-template-rows: 220px 220px;
    gap: 14px;
}

.feature-photo {
    position: relative;
    overflow: hidden;
    border-radius: var(--radius);
    background: var(--surface-muted);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
}

.feature-photo:first-child {
    grid-row: span 2;
}

.feature-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.photo-caption {
    position: absolute;
    left: 12px;
    right: 12px;
    bottom: 12px;
    padding: 10px 12px;
    border-radius: var(--radius);
    background: rgba(0, 0, 0, 0.64);
    color: #ffffff;
    font-size: 0.9rem;
}

.feature-photo .photo-caption {
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 180ms ease, transform 180ms ease;
}

.feature-photo:hover .photo-caption,
.feature-photo:focus-visible .photo-caption {
    opacity: 1;
    transform: translateY(0);
}

.photo-caption strong {
    display: block;
}

.split {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 24px;
    align-items: stretch;
}

.panel,
.event-card,
.person-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.panel {
    padding: 24px;
}

.join-panel {
    display: grid;
    grid-template-columns: 1fr 150px;
    gap: 20px;
    align-items: center;
}

.qr-code {
    width: 150px;
    aspect-ratio: 1;
    object-fit: contain;
    border-radius: var(--radius);
    background: #ffffff;
    padding: 8px;
    border: 1px solid var(--border);
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
    gap: 16px;
}

.gallery-card {
    position: relative;
    min-height: 245px;
    aspect-ratio: 4 / 5;
    overflow: hidden;
    border: 0;
    border-radius: var(--radius);
    padding: 0;
    background: var(--surface-muted);
    cursor: zoom-in;
    box-shadow: var(--shadow);
}

.gallery-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 180ms ease, filter 180ms ease;
}

.gallery-card:hover img,
.gallery-card:focus-visible img {
    transform: scale(1.035);
    filter: brightness(0.78);
}

.gallery-card .photo-caption {
    transform: translateY(8px);
    opacity: 0;
    transition: opacity 180ms ease, transform 180ms ease;
}

.gallery-card:hover .photo-caption,
.gallery-card:focus-visible .photo-caption {
    transform: translateY(0);
    opacity: 1;
}

.gallery-tools {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 18px;
}

.gallery-tools input,
.gallery-tools select {
    min-height: 44px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 10px 12px;
    background: var(--surface);
    color: var(--text);
}

.gallery-tools input {
    flex: 1 1 260px;
}

.gallery-tools select {
    flex: 0 1 180px;
}

.lightbox {
    position: fixed;
    inset: 0;
    z-index: 50;
    display: none;
    grid-template-rows: auto 1fr auto;
    gap: 10px;
    padding: 18px;
    background: rgba(0, 0, 0, 0.9);
    color: #ffffff;
}

.lightbox.is-open {
    display: grid;
}

.lightbox-top,
.lightbox-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.lightbox-title {
    margin: 0;
    font-weight: 800;
}

.lightbox-meta {
    margin: 0;
    color: rgba(255, 255, 255, 0.72);
}

.lightbox-stage {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 0;
}

.lightbox-image {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: var(--radius);
}

.icon-button {
    width: 44px;
    height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255, 255, 255, 0.26);
    border-radius: var(--radius);
    background: rgba(255, 255, 255, 0.12);
    color: #ffffff;
    cursor: pointer;
    font-size: 1.35rem;
}

.lightbox-prev,
.lightbox-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
}

.lightbox-prev {
    left: 0;
}

.lightbox-next {
    right: 0;
}

.events-list,
.people-grid {
    display: grid;
    gap: 16px;
}

.events-list {
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.event-card,
.person-card {
    padding: 20px;
}

.person-card {
    display: grid;
    grid-template-columns: 140px 1fr;
    gap: 18px;
}

.person-card img {
    width: 140px;
    aspect-ratio: 1;
    object-fit: cover;
    border-radius: var(--radius);
}

.role {
    margin: 0 0 4px;
    color: var(--accent);
    font-weight: 800;
}

.contact-shell {
    min-height: calc(100vh - 72px);
    position: relative;
    overflow: hidden;
}

.contact-backdrop {
    position: absolute;
    inset: 0;
    z-index: -2;
    background: var(--surface-muted);
}

.contact-backdrop img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    transition: opacity 900ms ease;
}

.contact-backdrop img.is-active {
    opacity: 1;
}

.contact-shell::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background: color-mix(in srgb, var(--bg) 72%, transparent);
    backdrop-filter: blur(8px);
}

.contact-form {
    display: grid;
    gap: 12px;
}

.contact-form label {
    font-weight: 700;
}

.contact-form input,
.contact-form select,
.contact-form textarea {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 10px 12px;
    background: var(--surface);
    color: var(--text);
}

.site-footer {
    margin-top: 46px;
    border-top: 1px solid var(--border);
    background: var(--surface);
}

.footer-inner {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    padding: 24px 0;
    color: var(--muted);
}

.empty-state {
    padding: 24px;
    border: 1px dashed var(--border);
    border-radius: var(--radius);
    color: var(--muted);
}

@media (max-width: 780px) {
    .nav {
        align-items: flex-start;
        flex-direction: column;
        padding: 12px 0;
    }

    .nav-links {
        width: 100%;
        justify-content: flex-start;
    }

    .home-photo-grid,
    .split,
    .join-panel,
    .person-card {
        grid-template-columns: 1fr;
    }

    .home-photo-grid {
        grid-template-rows: none;
    }

    .feature-photo,
    .feature-photo:first-child {
        grid-row: auto;
        aspect-ratio: 4 / 3;
    }

    .page-hero {
        padding-top: 42px;
    }

    .gallery-hero {
        grid-template-columns: 1fr;
        gap: 8px;
        padding: 18px 0 8px;
    }

    .gallery-hero h1 {
        font-size: 1.8rem;
    }

    .section-header,
    .footer-inner {
        align-items: flex-start;
        flex-direction: column;
    }

    .lightbox {
        padding: 12px;
    }

    .lightbox-prev,
    .lightbox-next {
        top: auto;
        bottom: 6px;
        transform: none;
    }
}
