/* ============================================
   GMRAV Systems — Design System
   Brief: DM Serif Display + Inter, terracotta #B85C38,
   warm off-white #FAF8F5, editorial/magazine layout
   ============================================ */

/* --- Reset & Base --- */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Palette */
    --bg: #FAF8F5;
    --bg-alt: #F2EFEA;
    --surface: #FFFFFF;
    --text: #2D2D2D;
    --text-muted: #6B6B6B;
    --accent: #B85C38;
    --accent-hover: #9A4A2D;
    --border: #E0DCD6;
    --border-light: #EDEBE7;

    /* Type scale (fluid) */
    --fs-xs: 0.75rem;
    --fs-sm: 0.875rem;
    --fs-base: 1rem;
    --fs-md: 1.125rem;
    --fs-lg: 1.5rem;
    --fs-xl: 2rem;
    --fs-2xl: 2.75rem;
    --fs-3xl: 3.5rem;

    /* Spacing */
    --sp-xs: 0.5rem;
    --sp-sm: 0.75rem;
    --sp-md: 1rem;
    --sp-lg: 1.5rem;
    --sp-xl: 2rem;
    --sp-2xl: 3rem;
    --sp-3xl: 5rem;
    --sp-4xl: 8rem;

    /* Layout */
    --max-w: 1200px;
    --nav-h: 64px;
}

@import url('https://fonts.googleapis.com/css2?family=DM+Serif+Display:ital@0;1&family=Inter:wght@400;500;600&display=swap');

html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
}

body {
    font-family: 'Inter', system-ui, sans-serif;
    font-size: var(--fs-base);
    line-height: 1.6;
    color: var(--text);
    background: var(--bg);
}

h1,
h2,
h3 {
    font-family: 'DM Serif Display', Georgia, serif;
    font-weight: 400;
    line-height: 1.15;
}

a {
    color: inherit;
    text-decoration: none;
}

img {
    display: block;
    max-width: 100%;
    height: auto;
}

button {
    font-family: inherit;
    cursor: pointer;
    border: none;
    background: none;
}

input,
textarea,
select {
    font-family: inherit;
    font-size: inherit;
}

/* --- Layout --- */
.container {
    max-width: var(--max-w);
    margin: 0 auto;
    padding: 0 var(--sp-lg);
}

/* --- Navigation --- */
.nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--nav-h);
    background: rgba(250, 248, 245, 0.92);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-light);
    z-index: 100;
    transition: box-shadow 0.3s ease;
}

.nav.scrolled {
    box-shadow: 0 1px 8px rgba(0, 0, 0, 0.04);
}

.nav .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
}

.nav-brand {
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    font-size: var(--fs-sm);
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text);
}

.nav-links {
    display: flex;
    align-items: center;
    gap: var(--sp-xl);
}

.nav-links a {
    font-size: var(--fs-sm);
    font-weight: 500;
    color: var(--text-muted);
    transition: color 0.2s ease;
    position: relative;
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--text);
}

.nav-links a.active::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    right: 0;
    height: 1.5px;
    background: var(--accent);
}

/* Mobile nav toggle */
.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    padding: 4px;
}

.nav-toggle span {
    display: block;
    width: 22px;
    height: 1.5px;
    background: var(--text);
    transition: transform 0.3s ease, opacity 0.3s ease;
}

/* --- Buttons --- */
.btn {
    display: inline-flex;
    align-items: center;
    gap: var(--sp-xs);
    padding: 12px 28px;
    font-size: var(--fs-sm);
    font-weight: 600;
    letter-spacing: 0.02em;
    transition: all 0.2s ease;
}

.btn-primary {
    background: var(--text);
    color: var(--bg);
}

.btn-primary:hover {
    background: #1a1a1a;
}

.btn-accent {
    background: var(--accent);
    color: #fff;
}

.btn-accent:hover {
    background: var(--accent-hover);
}

.btn-outline {
    border: 1px solid var(--border);
    color: var(--text);
    background: transparent;
}

.btn-outline:hover {
    border-color: var(--text);
}

/* --- Hero Section --- */
.hero {
    padding: calc(var(--nav-h) + var(--sp-4xl)) 0 var(--sp-3xl);
}

.hero-content {
    max-width: 720px;
}

.hero h1 {
    font-size: var(--fs-3xl);
    color: var(--text);
    margin-bottom: var(--sp-lg);
}

.hero p {
    font-size: var(--fs-md);
    color: var(--text-muted);
    max-width: 520px;
    margin-bottom: var(--sp-xl);
    line-height: 1.7;
}

/* --- Photo Collage (homepage) --- */
.photo-collage {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    grid-template-rows: 280px 220px;
    gap: 6px;
    margin-top: var(--sp-3xl);
}

.photo-collage .photo-item {
    overflow: hidden;
    position: relative;
}

.photo-collage .photo-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s ease;
}

.photo-collage .photo-item:hover img {
    transform: scale(1.03);
}

.photo-collage .photo-item:first-child {
    grid-row: 1 / 3;
}

.photo-collage .photo-item .photo-label {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: var(--sp-md) var(--sp-lg);
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.5));
    color: #fff;
    font-size: var(--fs-sm);
    font-weight: 500;
}

/* --- Section Styles --- */
.section {
    padding: var(--sp-4xl) 0;
}

.section-divider {
    border: none;
    border-top: 1px solid var(--border-light);
    margin: 0;
}

.section-header {
    margin-bottom: var(--sp-3xl);
}

.section-header h2 {
    font-size: var(--fs-2xl);
    margin-bottom: var(--sp-sm);
}

.section-header p {
    font-size: var(--fs-md);
    color: var(--text-muted);
}

/* --- Event List (full-width horizontal cards) --- */
.event-list {
    display: flex;
    flex-direction: column;
    gap: 1px;
    background: var(--border-light);
}

.event-card {
    display: grid;
    grid-template-columns: 1fr 1fr;
    min-height: 280px;
    background: var(--bg);
    transition: background 0.2s ease;
}

.event-card:hover {
    background: var(--bg-alt);
}

.event-card-image {
    overflow: hidden;
}

.event-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.event-card:hover .event-card-image img {
    transform: scale(1.02);
}

.event-card-info {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: var(--sp-2xl) var(--sp-2xl) var(--sp-2xl) var(--sp-xl);
}

.event-card-info h3 {
    font-size: var(--fs-xl);
    margin-bottom: var(--sp-sm);
}

.event-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: var(--sp-md);
    font-size: var(--fs-sm);
    color: var(--text-muted);
    margin-bottom: var(--sp-md);
}

.event-card-meta span {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.event-card-desc {
    font-size: var(--fs-sm);
    color: var(--text-muted);
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.event-card-link {
    margin-top: auto;
    padding-top: var(--sp-lg);
    font-size: var(--fs-sm);
    font-weight: 500;
    color: var(--accent);
    transition: color 0.2s ease;
}

.event-card-link:hover {
    color: var(--accent-hover);
}

/* --- Year Filter --- */
.year-filter {
    display: flex;
    gap: var(--sp-xl);
    margin-bottom: var(--sp-2xl);
}

.year-filter button {
    font-size: var(--fs-base);
    color: var(--text-muted);
    padding-bottom: 4px;
    border-bottom: 1.5px solid transparent;
    transition: all 0.2s ease;
}

.year-filter button:hover {
    color: var(--text);
}

.year-filter button.active {
    color: var(--text);
    border-bottom-color: var(--accent);
}

/* --- Masonry Gallery (event detail) --- */
.gallery-header {
    padding: calc(var(--nav-h) + var(--sp-2xl)) 0 var(--sp-xl);
}

.gallery-header .back-link {
    font-size: var(--fs-sm);
    color: var(--accent);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-bottom: var(--sp-lg);
    transition: color 0.2s ease;
}

.gallery-header .back-link:hover {
    color: var(--accent-hover);
}

.gallery-header h1 {
    font-size: var(--fs-2xl);
    margin-bottom: var(--sp-sm);
}

.gallery-header .event-meta {
    font-size: var(--fs-sm);
    color: var(--text-muted);
    margin-bottom: var(--sp-md);
}

.gallery-header .event-description {
    font-size: var(--fs-base);
    color: var(--text-muted);
    max-width: 640px;
    line-height: 1.7;
}

.masonry {
    columns: 3;
    column-gap: 6px;
    padding-bottom: var(--sp-4xl);
}

.masonry .gallery-item {
    break-inside: avoid;
    margin-bottom: 6px;
    overflow: hidden;
    cursor: pointer;
    position: relative;
}

.masonry .gallery-item img {
    width: 100%;
    display: block;
    transition: transform 0.5s ease, filter 0.3s ease;
}

.masonry .gallery-item:hover img {
    transform: scale(1.02);
    filter: brightness(0.92);
}

/* --- Lightbox --- */
.lightbox {
    position: fixed;
    inset: 0;
    z-index: 200;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.lightbox.active {
    opacity: 1;
    pointer-events: auto;
}

.lightbox img {
    max-width: 90vw;
    max-height: 90vh;
    object-fit: contain;
}

.lightbox-close {
    position: absolute;
    top: var(--sp-lg);
    right: var(--sp-lg);
    color: #fff;
    font-size: var(--fs-xl);
    opacity: 0.7;
    transition: opacity 0.2s ease;
    background: none;
    border: none;
    cursor: pointer;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-close:hover {
    opacity: 1;
}

.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    color: #fff;
    font-size: var(--fs-xl);
    opacity: 0.5;
    transition: opacity 0.2s ease;
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-nav:hover {
    opacity: 1;
}

.lightbox-prev {
    left: var(--sp-lg);
}

.lightbox-next {
    right: var(--sp-lg);
}

/* --- Contact --- */
.contact-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--sp-3xl);
}

.contact-info h3 {
    font-size: var(--fs-lg);
    margin-bottom: var(--sp-lg);
}

.contact-info-item {
    display: flex;
    gap: var(--sp-md);
    margin-bottom: var(--sp-lg);
    font-size: var(--fs-sm);
    color: var(--text-muted);
}

.contact-info-item strong {
    color: var(--text);
    display: block;
    margin-bottom: 2px;
}

.contact-form label {
    display: block;
    font-size: var(--fs-sm);
    font-weight: 500;
    margin-bottom: 6px;
    color: var(--text);
}

.contact-form input,
.contact-form textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text);
    margin-bottom: var(--sp-lg);
    transition: border-color 0.2s ease;
    outline: none;
}

.contact-form input:focus,
.contact-form textarea:focus {
    border-color: var(--accent);
}

.contact-form textarea {
    min-height: 120px;
    resize: vertical;
}

/* --- Footer --- */
.footer {
    border-top: 1px solid var(--border-light);
    padding: var(--sp-2xl) 0;
}

.footer .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.footer-text {
    font-size: var(--fs-sm);
    color: var(--text-muted);
}

.footer-links {
    display: flex;
    gap: var(--sp-lg);
}

.footer-links a {
    font-size: var(--fs-sm);
    color: var(--text-muted);
    transition: color 0.2s ease;
}

.footer-links a:hover {
    color: var(--text);
}

/* --- Loading States --- */
.skeleton {
    background: linear-gradient(90deg, var(--bg-alt) 25%, var(--border-light) 50%, var(--bg-alt) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

.loading-message {
    text-align: center;
    padding: var(--sp-4xl) 0;
    color: var(--text-muted);
    font-size: var(--fs-sm);
}

.empty-state {
    text-align: center;
    padding: var(--sp-4xl) 0;
    color: var(--text-muted);
}

.empty-state h3 {
    font-size: var(--fs-lg);
    color: var(--text);
    margin-bottom: var(--sp-sm);
}

/* --- Responsive --- */
@media (max-width: 768px) {
    :root {
        --fs-3xl: 2.25rem;
        --fs-2xl: 1.75rem;
        --fs-xl: 1.5rem;
    }

    .nav-links {
        display: none;
    }

    .nav-links.open {
        display: flex;
        flex-direction: column;
        position: absolute;
        top: var(--nav-h);
        left: 0;
        right: 0;
        background: var(--bg);
        padding: var(--sp-lg);
        border-bottom: 1px solid var(--border-light);
        gap: var(--sp-md);
    }

    .nav-toggle {
        display: flex;
    }

    .photo-collage {
        grid-template-columns: 1fr;
        grid-template-rows: 220px 160px 160px;
    }

    .photo-collage .photo-item:first-child {
        grid-row: auto;
    }

    .event-card {
        grid-template-columns: 1fr;
        min-height: auto;
    }

    .event-card-image {
        height: 200px;
    }

    .event-card-info {
        padding: var(--sp-lg);
    }

    .masonry {
        columns: 2;
    }

    .contact-grid {
        grid-template-columns: 1fr;
    }

    .footer .container {
        flex-direction: column;
        gap: var(--sp-md);
        text-align: center;
    }
}

@media (max-width: 480px) {
    .masonry {
        columns: 1;
    }

    .hero h1 {
        font-size: 1.75rem;
    }

    .year-filter {
        gap: var(--sp-md);
    }
}