/* =========================================================================
   Schachverein Asten - Design System (Light Theme - Asten Gold & Blue)
   ========================================================================= */

/* --- Variables --- */
:root {
    /* Colors - Light Theme inspired by Asten Wappen */
    --clr-bg: #ffffff;
    --clr-bg-alt: #f0f4f8;
    --clr-bg-glass: rgba(255, 255, 255, 0.8);
    --clr-border: #d4dbe4;

    --clr-text: #1a2332;
    --clr-text-muted: #5a6a7e;

    /* Brand Accents — from the Asten Wappen */
    --clr-primary: #2E7AB8;
    /* Wappen shield blue */
    --clr-primary-hover: #1F5F94;
    --clr-secondary: #B8960C;
    /* Wappen gold anchor */
    --clr-secondary-hover: #9A7D09;

    /* Hero / dark-accent section */
    --clr-hero-bg: #1a2c42;
    --clr-hero-text: #f0f4f8;

    /* Typography */
    --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
    --font-heading: 'Outfit', var(--font-sans);

    /* Spacing */
    --space-xs: 0.5rem;
    --space-sm: 1rem;
    --space-md: 2rem;
    --space-lg: 4rem;
    --space-xl: 6rem;

    /* Transitions & Shadows */
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-fast: all 0.15s ease;
    --bg-shade: #f0f4f8;
    --shadow-sm: 0 2px 8px -1px rgba(0, 0, 0, 0.08), 0 1px 3px -1px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 8px 24px -4px rgba(0, 0, 0, 0.12), 0 4px 8px -2px rgba(0, 0, 0, 0.06);
    --shadow-glow: 0 0 20px rgba(46, 122, 184, 0.25);

    /* Layout */
    --container-max: 1200px;
    --container-padding: 2rem;
}

/* --- Resets & Base --- */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
    background-color: var(--clr-bg);
}

body {
    font-family: var(--font-sans);
    color: var(--clr-text);
    background-color: var(--clr-bg);
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

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

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

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font-heading);
    line-height: 1.2;
    font-weight: 600;
}

/* --- Typography --- */
.text-gradient {
    background: linear-gradient(135deg, var(--clr-secondary), var(--clr-primary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    display: inline-block;
}

.text-muted {
    color: var(--clr-text-muted);
}

.text-center {
    text-align: center;
}

/* --- Layout --- */
.container {
    width: 100%;
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 var(--container-padding);
}

.section {
    padding: var(--space-xl) 0;
    position: relative;
    scroll-margin-top: 5rem;
}

.section-dark {
    background-color: var(--clr-bg-alt);
}

.section-split {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-lg);
    align-items: center;
}

.section-split.reverse {
    direction: rtl;
}

.section-split.reverse>* {
    direction: ltr;
}

@media (max-width: 900px) {
    .section-split {
        grid-template-columns: 1fr;
        gap: var(--space-md);
    }

    .section-split.reverse {
        direction: ltr;
    }
}

.section-title {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: var(--space-sm);
    letter-spacing: -0.02em;
    color: var(--clr-text);
}

.section-subtitle {
    font-size: 1.125rem;
    color: var(--clr-text-muted);
    max-width: 600px;
    margin: 0 auto var(--space-lg);
}

.section-desc {
    font-size: 1.125rem;
    color: var(--clr-text-muted);
    margin-bottom: var(--space-sm);
}

/* --- Components --- */

/* Glassmorphism Classes */
.glass {
    background: var(--clr-bg-glass);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(0, 0, 0, 0.06);
}

.glass-card {
    background: linear-gradient(180deg, #ffffff 0%, #f8fafb 100%);
    backdrop-filter: blur(8px);
    border: 1px solid var(--clr-border);
    border-radius: 1rem;
    padding: var(--space-md);
    box-shadow: var(--shadow-sm);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    font-weight: 500;
    cursor: pointer;
    border: none;
    transition: var(--transition);
    font-family: var(--font-sans);
    font-size: 1rem;
}

.btn-primary {
    background-color: var(--clr-primary);
    color: white;
    box-shadow: 0 4px 14px 0 rgba(46, 122, 184, 0.3);
}

.btn-primary:hover {
    background-color: var(--clr-primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(46, 122, 184, 0.4);
    color: white;
}

.btn-secondary {
    background-color: transparent;
    color: var(--clr-text);
    border: 1px solid var(--clr-border);
}

.btn-secondary:hover {
    background-color: var(--clr-bg-alt);
    transform: translateY(-2px);
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

.w-100 {
    width: 100%;
}

.link-arrow {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--clr-primary);
    font-weight: 600;
    margin-top: var(--space-sm);
}

.link-arrow:hover {
    color: var(--clr-primary-hover);
    gap: 0.75rem;
}

/* --- Navigation --- */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    padding: 1rem 0;
    transition: var(--transition);
    background: transparent;
}

.navbar.scrolled {
    padding: 0.75rem 0;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--clr-border);
    box-shadow: var(--shadow-sm);
}

.nav-container {
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 var(--container-padding);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.nav-logo {
    height: 40px;
}

.nav-title {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 1.25rem;
    letter-spacing: -0.02em;
    color: var(--clr-text);
}

.nav-links {
    display: flex;
    list-style: none;
    align-items: center;
    gap: 2rem;
}

.nav-links a:not(.btn) {
    font-weight: 500;
    font-size: 0.95rem;
    color: var(--clr-text-muted);
}

.nav-links a:not(.btn):hover,
.nav-links a:not(.btn).active {
    color: var(--clr-primary);
}

.nav-links a:not(.btn).active {
    position: relative;
}

.nav-links a:not(.btn).active::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--clr-primary);
    border-radius: 1px;
}

.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    color: var(--clr-text);
    font-size: 1.5rem;
    cursor: pointer;
}

/* Overrides for Transparent Navbar at the Top */
.navbar:not(.scrolled) .nav-title,
.navbar:not(.scrolled) .nav-username {
    color: #ffffff;
}

.navbar:not(.scrolled) .nav-links a:not(.btn) {
    color: rgba(255, 255, 255, 0.85);
}

.navbar:not(.scrolled) .nav-links a:not(.btn):hover,
.navbar:not(.scrolled) .nav-links a:not(.btn).active {
    color: #ffffff;
}

.navbar:not(.scrolled) .btn-secondary {
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.5);
}

.navbar:not(.scrolled) .btn-secondary:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: #ffffff;
}

/* --- Hero Section (keeps a dark accent for drama) --- */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    position: relative;
    padding-top: 5rem;
    overflow: hidden;
    background: linear-gradient(135deg, var(--clr-hero-bg) 0%, #162236 50%, #1a3550 100%);
    color: var(--clr-hero-text);
}

.hero-bg-blur {
    position: absolute;
    top: -10%;
    left: 30%;
    width: 50vw;
    height: 50vw;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(46, 122, 184, 0.2) 0%, rgba(184, 150, 12, 0.08) 40%, transparent 70%);
    z-index: 0;
    filter: blur(60px);
}

.hero-content {
    width: 100%;
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 var(--container-padding);
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-lg);
    align-items: center;
    z-index: 1;
}

.hero-title {
    font-size: clamp(3rem, 5vw, 4.5rem);
    line-height: 1.1;
    font-weight: 800;
    margin-bottom: var(--space-sm);
    color: #ffffff;
}

.hero-subtitle {
    font-size: clamp(1.125rem, 2vw, 1.35rem);
    color: rgba(240, 244, 248, 0.75);
    margin-bottom: var(--space-md);
    max-width: 500px;
}

.hero-actions {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.hero .btn-primary {
    background: var(--clr-secondary);
    box-shadow: 0 4px 14px 0 rgba(184, 150, 12, 0.35);
}

.hero .btn-primary:hover {
    background: var(--clr-secondary-hover);
    box-shadow: 0 6px 20px rgba(184, 150, 12, 0.5);
}

.hero .btn-secondary {
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.3);
}

.hero .btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.5);
}

.hero-visual {
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    gap: 2rem;
}

.hero-logo {
    height: 260px;
    width: auto;
    filter: drop-shadow(0 20px 40px rgba(0, 0, 0, 0.4)) brightness(0) invert(1);
    animation-delay: -3s;
}

.hero-wappen {
    height: 260px;
    width: auto;
    filter: drop-shadow(0 20px 40px rgba(0, 0, 0, 0.4));
}

.float-anim {
    animation: float 6s ease-in-out infinite;
}

@keyframes float {
    0% {
        transform: translateY(0px);
    }

    50% {
        transform: translateY(-20px);
    }

    100% {
        transform: translateY(0px);
    }
}

.scroll-indicator {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    animation: bounce 2s infinite;
}

.scroll-indicator a {
    color: rgba(255, 255, 255, 0.5);
    font-size: 1.5rem;
}

@keyframes bounce {

    0%,
    20%,
    50%,
    80%,
    100% {
        transform: translateY(0);
    }

    40% {
        transform: translateY(-10px);
    }

    60% {
        transform: translateY(-5px);
    }
}

@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Hero - navbar integration (white text on dark hero until scrolled) */
.navbar:not(.scrolled) .nav-title {
    color: #ffffff;
}

.navbar:not(.scrolled) .nav-links a:not(.btn) {
    color: rgba(255, 255, 255, 0.7);
}

.navbar:not(.scrolled) .nav-links a:not(.btn):hover,
.navbar:not(.scrolled) .nav-links a:not(.btn).active {
    color: #ffffff;
}

.navbar:not(.scrolled) .mobile-menu-btn {
    color: #ffffff;
}

@media (max-width: 900px) {
    .hero-content {
        grid-template-columns: 1fr;
        text-align: center;
        padding-top: 2rem;
    }

    .hero-subtitle {
        margin: 0 auto var(--space-md);
    }

    .hero-actions {
        justify-content: center;
    }

    .hero-visual {
        flex-wrap: wrap;
        gap: 1.5rem;
        margin-top: 2rem;
    }

    .hero-logo {
        height: 160px;
    }

    .hero-wappen {
        height: 160px;
    }
}

/* --- Section Images --- */
.section-image {
    position: relative;
    border-radius: 1rem;
    overflow: hidden;
    box-shadow: var(--shadow-md);
}

.section-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s ease;
}

.zoom-hover:hover img {
    transform: scale(1.05);
}

.section-image::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 1rem;
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.06);
    pointer-events: none;
}

/* --- Info Cards & Features --- */
.info-card {
    border-radius: 1rem;
    padding: var(--space-sm);
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.info-item {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1rem;
    border-radius: 0.5rem;
    background: rgba(46, 122, 184, 0.04);
    transition: var(--transition);
}

.info-item:hover {
    background: rgba(46, 122, 184, 0.08);
}

.info-icon {
    font-size: 1.5rem;
    color: var(--clr-primary);
    background: rgba(46, 122, 184, 0.1);
    width: 3rem;
    height: 3rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    flex-shrink: 0;
}

.info-content h3 {
    font-size: 1.125rem;
    margin-bottom: 0.25rem;
}

.info-content p {
    color: var(--clr-text-muted);
    font-size: 0.95rem;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--space-md);
}

.feature-card {
    text-align: center;
}

.feature-icon {
    font-size: 2rem;
    color: var(--clr-secondary);
    margin-bottom: 1rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 4rem;
    height: 4rem;
    background: rgba(184, 150, 12, 0.1);
    border-radius: 50%;
}

.feature-card h3 {
    margin-bottom: 0.5rem;
    font-size: 1.25rem;
}

.feature-card p {
    color: var(--clr-text-muted);
    font-size: 0.95rem;
}

.hover-lift {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.hover-lift:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-md), var(--shadow-glow);
}

/* --- News Component --- */
.news-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: var(--space-sm);
}

.news-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.5rem;
}

.news-item {
    padding: 1.25rem;
    background: #ffffff;
    border: 1px solid var(--clr-border);
    border-radius: 0.75rem;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.news-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: var(--clr-secondary);
    opacity: 0;
    transition: opacity 0.3s;
}

.news-item:hover {
    border-color: var(--clr-secondary);
    transform: translateX(4px);
    box-shadow: var(--shadow-sm);
}

.news-item:hover::before {
    opacity: 1;
}

.news-date {
    font-size: 0.875rem;
    color: var(--clr-secondary);
    font-weight: 600;
    margin-bottom: 0.25rem;
    display: block;
}

.news-title {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.news-content {
    color: var(--clr-text-muted);
    font-size: 0.95rem;
}

/* --- Meisterschaft / Championship --- */
.championship-grid {
    display: grid;
    grid-template-columns: minmax(260px, 340px) 1fr;
    gap: 1.5rem;
    align-items: start;
}

.championship-card {
    border: 1px solid var(--clr-border);
    border-radius: 1rem;
    overflow: hidden;
    background: var(--clr-bg-alt);
    box-shadow: var(--shadow-sm);
}

.championship-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.875rem 1.25rem;
    background: linear-gradient(135deg, rgba(46, 122, 184, 0.12), rgba(184, 150, 12, 0.08));
    border-bottom: 1px solid var(--clr-border);
}

.champ-round-label {
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--clr-text);
}

.champ-date {
    font-size: 0.775rem;
    color: var(--clr-text-muted);
}

.championship-matches {
    padding: 0.25rem 0;
}

.match-row {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1.25rem;
    border-bottom: 1px solid var(--clr-border);
    transition: background var(--transition);
}

.match-row:last-child {
    border-bottom: none;
}

.match-row:hover {
    background: rgba(46, 122, 184, 0.05);
}

.match-team {
    font-size: 0.84rem;
    color: var(--clr-text);
}

.match-team:first-child {
    text-align: right;
}

.match-score {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--clr-primary);
    background: rgba(46, 122, 184, 0.1);
    border: 1px solid rgba(46, 122, 184, 0.2);
    border-radius: 0.375rem;
    padding: 0.175rem 0.5rem;
    white-space: nowrap;
    text-align: center;
    min-width: 64px;
}

.team-asten {
    color: var(--clr-secondary) !important;
    font-weight: 700;
}

/* Standings table */
.championship-table-card .table-scroll {
    overflow-x: auto;
}

.standings-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8rem;
    white-space: nowrap;
}

.standings-table thead th {
    background: rgba(46, 122, 184, 0.08);
    color: var(--clr-text-muted);
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 0.5rem 0.4rem;
    text-align: center;
    border-bottom: 2px solid var(--clr-border);
}

.standings-table th.col-team,
.standings-table td.col-team {
    text-align: left;
    padding-left: 1rem;
    white-space: normal;
    min-width: 130px;
}

.standings-table tbody td {
    padding: 0.4rem 0.4rem;
    border-bottom: 1px solid var(--clr-border);
    text-align: center;
    color: var(--clr-text);
}

.standings-table tbody tr:last-child td {
    border-bottom: none;
}

.standings-table tbody tr:hover td {
    background: rgba(46, 122, 184, 0.05);
}

.standings-table .row-asten td {
    background: rgba(184, 150, 12, 0.07);
}

.standings-table .row-asten:hover td {
    background: rgba(184, 150, 12, 0.12);
}

.standings-table .col-rank {
    color: var(--clr-text-muted);
    font-weight: 600;
    width: 2rem;
}

.standings-table .col-pts {
    font-weight: 700;
    color: var(--clr-primary);
}

.standings-table .col-round {
    min-width: 2rem;
    font-size: 0.75rem;
}

.standings-table .round-self {
    background: rgba(0, 0, 0, 0.06);
}

@media (max-width: 900px) {
    .championship-grid {
        grid-template-columns: 1fr;
    }
}

/* --- Gallery Grid --- */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
}

.gallery-item {
    position: relative;
    border-radius: 0.75rem;
    overflow: hidden;
    aspect-ratio: 3/4;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.gallery-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(0deg, rgba(26, 44, 66, 0.9) 0%, rgba(26, 44, 66, 0.2) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 1.5rem;
}

.gallery-item:hover {
    box-shadow: var(--shadow-glow);
}

.gallery-item:hover img {
    transform: scale(1.08);
}

.gallery-item:hover .gallery-overlay {
    opacity: 1;
}

.gallery-title {
    font-weight: 600;
    font-size: 1.125rem;
    margin-bottom: 0.25rem;
    color: #ffffff;
}

.gallery-desc {
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.8);
}

/* Lightbox Modal */
.lightbox {
    position: fixed;
    inset: 0;
    background: rgba(26, 44, 66, 0.95);
    backdrop-filter: blur(8px);
    z-index: 2000;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.lightbox.active {
    opacity: 1;
    pointer-events: all;
}

.lightbox-content {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    transform: scale(0.95);
    transition: transform 0.3s ease;
}

.lightbox.active .lightbox-content {
    transform: scale(1);
}

.lightbox-content img {
    max-height: 85vh;
    border-radius: 0.5rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.lightbox-caption {
    text-align: center;
    padding-top: 1rem;
    font-size: 1.125rem;
    font-weight: 500;
    color: #ffffff;
}

.lightbox-close {
    position: absolute;
    top: 2rem;
    right: 2rem;
    background: rgba(255, 255, 255, 0.15);
    border: none;
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 1.25rem;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: var(--transition);
}

.lightbox-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

/* Lightbox Navigation Arrows */
.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.15);
    border: none;
    color: white;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    font-size: 1.25rem;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: var(--transition);
    z-index: 10;
}

.lightbox-nav:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-50%) scale(1.1);
}

.lightbox-prev {
    left: 1.5rem;
}

.lightbox-next {
    right: 1.5rem;
}

/* --- Contact Section --- */
.contact-wrapper {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: 0;
    border-radius: 1rem;
    overflow: hidden;
    border: 1px solid var(--clr-border);
    background: #ffffff;
    box-shadow: var(--shadow-md);
}

.contact-info {
    background: var(--clr-bg-alt);
    padding: var(--space-md);
    border-right: 1px solid var(--clr-border);
}

.contact-details {
    list-style: none;
    margin-top: var(--space-sm);
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.contact-details li {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
}

.contact-details i {
    color: var(--clr-primary);
    font-size: 1.25rem;
    margin-top: 0.25rem;
}

.contact-link {
    color: var(--clr-primary);
}

.contact-link:hover {
    text-decoration: underline;
}

.contact-form {
    padding: var(--space-md);
}

.contact-form h3 {
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
}

.form-group {
    margin-bottom: 1rem;
}

.form-group.row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--clr-text-muted);
}

.form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    background: var(--clr-bg-alt);
    border: 1px solid var(--clr-border);
    border-radius: 0.5rem;
    color: var(--clr-text);
    font-family: var(--font-sans);
    font-size: 1rem;
    transition: var(--transition);
}

.form-control:focus {
    outline: none;
    border-color: var(--clr-primary);
    box-shadow: 0 0 0 3px rgba(46, 122, 184, 0.15);
}

textarea.form-control {
    resize: vertical;
    min-height: 120px;
}

@media (max-width: 768px) {
    .contact-wrapper {
        grid-template-columns: 1fr;
    }

    .contact-info {
        border-right: none;
        border-bottom: 1px solid var(--clr-border);
    }

    .form-group.row {
        grid-template-columns: 1fr;
    }
}

/* --- Footer (dark accent for contrast) --- */
.footer {
    background: var(--clr-hero-bg);
    color: var(--clr-hero-text);
    padding: var(--space-lg) 0 2rem;
    border-top: 3px solid var(--clr-secondary);
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-md);
    flex-wrap: wrap;
    gap: var(--space-sm);
}

.footer-brand p {
    color: rgba(240, 244, 248, 0.6);
    margin-top: 0.5rem;
}

.footer-logo {
    height: 48px;
    opacity: 0.9;
}

.footer-social {
    display: flex;
    gap: 1rem;
}

.social-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.125rem;
    color: #ffffff;
}

.social-icon:hover {
    background: var(--clr-secondary);
    color: white;
    transform: translateY(-3px);
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(240, 244, 248, 0.5);
    font-size: 0.875rem;
}

.footer-link {
    color: var(--clr-secondary);
}

.footer-link:hover {
    text-decoration: underline;
}

/* --- Member Portal UI (Login, NavBar, Games, Events) --- */
.internal-badge {
    font-size: 0.7em;
    margin-left: 0.5rem;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    background-color: #ffc107;
    color: #000;
    vertical-align: middle;
}

/* News Image */
.news-item {
    padding: 0;
    display: flex;
    flex-direction: column;
}

.news-content-wrapper {
    padding: 1.25rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.news-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-bottom: 3px solid var(--clr-primary);
}

.news-content-text {
    color: var(--clr-text-muted);
    line-height: 1.6;
    flex: 1;
    margin-bottom: 0.5rem;
}

/* Events Section */
.events-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
    margin-top: var(--space-md);
}

/* ── Chess Calendar ─────────────────────────────── */
.chess-calendar {
    background: var(--bg-card, #fff);
    border-radius: var(--radius-lg, 16px);
    overflow: hidden;
    box-shadow: var(--shadow-md, 0 4px 20px rgba(0,0,0,.1));
    user-select: none;
    align-self: flex-start;
    min-height: 360px;
}

.cal-chess-header {
    background: repeating-linear-gradient(
        90deg,
        var(--primary, #1a2c5b) 0px, var(--primary, #1a2c5b) 14.28%,
        #2e4a8a 14.28%, #2e4a8a 28.56%
    );
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
}

.cal-month-label {
    color: #fff;
    font-weight: 700;
    font-size: 1rem;
    text-transform: capitalize;
}

.cal-nav {
    background: rgba(255,255,255,0.15);
    border: none;
    color: #fff;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.cal-nav:hover { background: rgba(255,255,255,0.3); }

.cal-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
}

.cal-day-name {
    text-align: center;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 0.5rem 0;
    color: var(--text-muted, #666);
    background: var(--bg-shade, #f0f4f8);
}

.cal-cell {
    aspect-ratio: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-size: 0.82rem;
    position: relative;
    cursor: default;
}

.cal-light { background: #f8f9fa; }
.cal-dark  { background: #e8ecf4; }
.cal-empty { background: transparent; }

.cal-today {
    font-weight: 700;
    outline: 2px solid var(--primary, #1a2c5b);
    outline-offset: -2px;
    border-radius: 4px;
    z-index: 1;
}

.cal-has-event {
    cursor: pointer;
    font-weight: 700;
    color: var(--primary, #1a2c5b);
}

.cal-has-event:hover { background: #d0d8f0; }

.cal-dot {
    display: block;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--accent, #e63946);
    position: absolute;
    bottom: 3px;
}

/* ── Event List ──────────────────────────────────── */
.event-item {
    background: #ffffff;
    border-radius: 1rem;
    box-shadow: var(--shadow-sm);
    display: flex;
    gap: var(--space-md);
    align-items: flex-start;
    padding: 1.25rem;
    border-left: 4px solid var(--clr-primary);
    opacity: 0;
    animation: fadeUp 0.6s ease-out forwards;
}

.event-calendar {
    flex-shrink: 0;
    width: 70px;
    background: var(--clr-bg-alt);
    border-radius: 8px;
    text-align: center;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.event-month {
    display: block;
    background: var(--clr-primary);
    color: white;
    font-size: 0.85rem;
    font-weight: 700;
    padding: 0.25rem 0;
    text-transform: uppercase;
}

.event-day {
    display: block;
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--clr-text);
    padding: 0.25rem 0;
}

.event-details {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.event-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.event-meta {
    font-size: 0.9rem;
    color: var(--clr-text-muted);
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 0.5rem;
}

.event-meta i {
    color: var(--clr-primary);
}

.event-description {
    font-size: 0.95rem;
    border-top: 1px solid var(--clr-border);
    padding-top: 0.5rem;
}

/* Games Section */
.games-selector {
    max-width: 600px;
    margin: 0 auto;
}

.pgn-viewer-wrapper {
    background: #ffffff;
    padding: var(--space-md);
    border-radius: 1rem;
    box-shadow: var(--shadow-md);
    margin: 0 auto;
    max-width: 800px;
    border-top: 4px solid var(--clr-secondary);
}

/* Navigation User Menu */
.user-menu-wrapper {
    position: relative;
}

.nav-username {
    cursor: pointer;
    font-weight: 600;
    color: var(--clr-primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: var(--transition);
}

.user-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 0.5rem;

    background: #fff;
    border: 1px solid var(--clr-border);
    border-radius: 0.5rem;
    padding: 0.5rem 0;
    min-width: 150px;
    opacity: 0;
    pointer-events: none;
    transition: var(--transition);
    box-shadow: var(--shadow-md);
}

/* Invisible bridge to catch the mouse on hover */
.user-dropdown::before {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 0;
    width: 100%;
    height: 1rem;
    background: transparent;
}

.user-menu-wrapper:hover .user-dropdown {
    opacity: 1;
    pointer-events: all;
}

.user-dropdown a {
    display: block;
    padding: 0.6rem 1rem;
    color: var(--clr-text) !important;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: var(--transition-fast);
}

.user-dropdown a:hover {
    background-color: var(--bg-shade) !important;
    color: var(--clr-primary) !important;
}

/* Login Modal */
.modal {
    position: fixed;
    inset: 0;
    background: rgba(26, 44, 66, 0.95);
    backdrop-filter: blur(8px);
    z-index: 2000;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    pointer-events: none;
    transition: var(--transition);
}

.modal.active {
    opacity: 1;
    pointer-events: all;
}

.modal-content {
    background: #fff;
    width: 100%;
    max-width: 400px;
    border-radius: 1rem;
    box-shadow: var(--shadow-md);
    overflow: hidden;
    transform: scale(0.95);
    transition: var(--transition);
}

.modal.active .modal-content {
    transform: scale(1);
}

.modal-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--clr-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--clr-bg-alt);
}

.modal-header h2 {
    font-size: 1.25rem;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--clr-text);
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--clr-text-muted);
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover {
    color: var(--clr-text);
}

.modal-body {
    padding: 1.5rem;
}

/* --- Alerts --- */
.alert {
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    font-size: 0.9rem;
    margin-bottom: 1rem;
    border: 1px solid transparent;
}

.alert-success {
    background: #d1e7dd;
    color: #0a3622;
    border-color: #a3cfbb;
}

.alert-danger {
    background: #f8d7da;
    color: #58151c;
    border-color: #f1aeb5;
}

/* --- Focus Visible (Accessibility) --- */
*:focus-visible {
    outline: 2px solid var(--clr-primary);
    outline-offset: 2px;
}

.btn:focus-visible {
    box-shadow: 0 0 0 3px rgba(46, 122, 184, 0.3);
}

/* --- Animations & Utilities --- */

/* Scroll Animations Base */
.fade-up {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.fade-in {
    opacity: 0;
    transition: opacity 1s ease-out;
}

.fade-up.visible,
.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Mobile Nav Toggle */
@media (max-width: 768px) {
    .mobile-menu-btn {
        display: block;
    }

    .nav-links {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--clr-bg);
        border-top: 1px solid var(--clr-border);
        flex-direction: column;
        padding: 1rem 0;
        box-shadow: var(--shadow-md);
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.4s ease-in-out;
    }

    .nav-links.active {
        max-height: 80vh;
        overflow-y: auto;
    }

    .nav-links li {
        width: 100%;
        text-align: center;
        padding: 0.5rem 0;
    }

    .nav-links a {
        display: block;
        padding: 0.5rem;
        color: var(--clr-text) !important;
    }

    /* Reset hero text overrides for mobile dropdown */
    .navbar:not(.scrolled) .nav-links a:not(.btn) {
        color: var(--clr-text-muted) !important;
    }

    .navbar:not(.scrolled) .nav-links a:not(.btn):hover,
    .navbar:not(.scrolled) .nav-links a:not(.btn).active {
        color: var(--clr-primary) !important;
    }

    /* Fix User Dropdown on Mobile */
    .user-dropdown {
        position: static;
        opacity: 0;
        max-height: 0;
        overflow: hidden;
        transition: all 0.3s ease-in-out;
        box-shadow: none;
        border: none;
        background: transparent;
        width: 100%;
        padding: 0;
        pointer-events: none;
    }

    .user-dropdown.active {
        opacity: 1 !important;
        max-height: 300px; /* Safe upper limit for 3 items */
        pointer-events: all !important;
        margin-top: 0.5rem;
    }

    .user-dropdown a {
        padding: 0.5rem;
        font-size: 0.95rem;
        color: var(--clr-text-muted) !important;
        text-align: center;
        display: block;
        width: 100%;
    }

    .user-dropdown a:hover {
        background-color: transparent !important;
        color: var(--clr-primary) !important;
    }

    .navbar:not(.scrolled) .nav-username,
    .navbar:not(.scrolled) .nav-username i,
    .navbar:not(.scrolled) .nav-username span {
        color: var(--clr-primary) !important;
    }

    .nav-username {
        justify-content: center;
        padding: 0.5rem 0;
    }
}