/* RESET & BASIS */
body {
    box-sizing: border-box;
}

* {
    box-sizing: border-box;
}

:root {
    --primary-color: #8B0000;
    --secondary-color: #FFD700;
    --font-primary: 'Times New Roman', Times, serif;
    --font-secondary: ui-sans-serif, system-ui, sans-serif;
    --text-color: #1a1a1a;
    --background-color: #ffffff;
    --surface-color: #f8f9fa;
}

body.light-mode {
    --text-color: #1a1a1a;
    --background-color: #ffffff;
    --surface-color: #f3f4f6;
}

body.dark-mode {
    --text-color: #e8e8e8;
    --background-color: #1a1a1a;
    --surface-color: #2d2d2d;
}

html,
body {
    margin: 0;
    padding: 0;
    min-height: 100vh;
    scroll-behavior: smooth;
    font-family: var(--font-secondary);
    line-height: 1.6;
    color: var(--text-color) !important;
    background-color: var(--background-color) !important;
    transition: background-color 0.3s ease, color 0.3s ease;
}

a,
button,
[data-page],
.nav-logo,
.footer-links a,
.clickable-card {
    cursor: pointer !important;
}

.page-wrapper {
    width: 100%;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

h1,
h2,
h3 {
    font-family: var(--font-primary);
    font-weight: 700;
}

/* Navigation */
.nav-container {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: var(--surface-color);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: background-color 0.3s ease;
}

.nav-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem 2rem;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    position: relative;
}

.nav-logo {
    font-family: sans-serif;
    font-size: 1.5rem;
    font-weight: 900;
    color: var(--primary-color);
    text-decoration: none;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
}

.nav-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-left: auto;
}

/* Buttons */
.theme-toggle-btn,
.mobile-menu-btn {
    background: none;
    border: none;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    color: #fff;
    cursor: pointer;
}

.theme-toggle-btn svg {
    width: 28px;
    height: 28px;
    fill: #ffffff;
}

.mobile-menu-btn {
    font-size: 28px;
    line-height: 1;
}

body.light-mode .nav-container {
    background: var(--surface-color);
    border-bottom: 1px solid #e5e7eb;
}

body.light-mode .theme-toggle-btn svg {
    fill: #1a1a1a;
}

body.light-mode .mobile-menu-btn {
    color: #1a1a1a;
}

body.dark-mode .nav-container {
    background: var(--surface-color);
    border-bottom: 1px solid #444;
}

body.dark-mode .nav-logo {
    color: #ffffff;
}

body.dark-mode .card,
body.dark-mode .partner-card,
body.dark-mode .cat-header,
body.dark-mode .chronicle-header {
    background: var(--surface-color);
    color: var(--text-color);
    border-color: #444;
}

body.dark-mode .contact-item {
    background: var(--background-color);
    border: 1px solid #444;
}

.nav-links {
    list-style: none;
    /* Remove bullets */
    position: absolute;
    top: 100%;
    right: 0;
    width: 250px;
    background: #1a1a1a;
    padding: 0.5rem 0;
    display: none;
    flex-direction: column;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    border-bottom-left-radius: 8px;
    border-bottom-right-radius: 8px;
    z-index: 2000;
}

.nav-links.active {
    display: flex;
}

.nav-links a {
    color: #ffffff;
    text-decoration: none;
    font-weight: 600;
    display: block;
    padding: 0.75rem 1.5rem;
    transition: background-color 0.2s, color 0.2s;
}

.nav-links a:hover {
    background-color: var(--primary-color);
    color: white;
}

.logo-container {
    position: fixed;
    top: 1rem;
    left: 1rem;
    z-index: 1001;
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.logo-container.home-position {
    top: 1rem;
    left: 1rem;
    width: 224px;
    height: 262px;
}

.logo-container.nav-position {
    top: 1rem;
    left: 1rem;
    width: 120px;
    height: 140px;
}

/* Tablet & Mobile Optimization (Logo/Header) - Covers iPad Pro Landscape (1366px) */
@media (max-width: 1400px) {
    .nav-content {
        padding: 0.5rem 1rem;
        min-height: 60px;
        display: flex;
        justify-content: space-between;
        align-items: center;
    }

    .logo-container,
    .logo-container.home-position,
    .logo-container.nav-position {
        position: relative !important;
        top: auto !important;
        left: auto !important;
        width: 60px !important;
        height: auto !important;
        margin-right: 1rem;
        flex-shrink: 0;
    }

    .nav-logo {
        position: relative;
        left: auto;
        transform: none;
        width: auto;
        margin: 0;
        z-index: 1005;
        font-size: 1.0rem;
        line-height: 1.2;
        text-align: left;
        white-space: normal;
        display: flex;
        align-items: center;
        flex-grow: 1;
    }

    .nav-controls {
        position: relative;
        z-index: 2005;
        margin-left: 10px;
        flex-shrink: 0;
    }
}

/* Mobile Layout Optimization (Columns etc.) */
@media (max-width: 768px) {

    /* --- Visual Polish --- */

    /* Compact Hero */
    .hero {
        padding: 2.5rem 1rem !important;
    }

    .hero h1 {
        font-size: 1.8rem !important;
        margin-bottom: 0.5rem;
    }

    .hero p {
        font-size: 1rem !important;
    }

    /* 2-Column Grid for Members & Cards (FLEX Update) */
    .card-grid {
        display: flex !important;
        flex-wrap: wrap !important;
        justify-content: center !important;
        gap: 0.75rem !important;
    }

    /* Note: Widths are now handled by the main CSS block using [data-count] */

    .card-grid>.card h3 {
        font-size: 1rem !important;
        margin-bottom: 0.25rem !important;
    }

    .card-grid>.card p {
        font-size: 0.85rem !important;
        line-height: 1.3 !important;
    }

    /* Compact Card Styling */
    .card {
        padding: 1rem !important;
    }

    .card h3 {
        font-size: 1.1rem !important;
        margin-bottom: 0.5rem !important;
    }

    .card p {
        font-size: 0.9rem !important;
        line-height: 1.4 !important;
    }

    /* Smaller Member Images */
    .member-img-container {
        width: 100px !important;
        height: 133px !important;
        margin-bottom: 0.5rem !important;
    }

    /* General Section Constraints */
    .content-section {
        padding: 2rem 1rem !important;
    }

    .section-title {
        font-size: 1.8rem !important;
        margin-bottom: 1.5rem !important;
    }

    .section-intro {
        font-size: 0.95rem !important;
        margin: 2rem auto !important;
        /* Equal spacing before and after */
    }

    /* Compact Partners */
    .partner-grid-gold,
    .partner-grid-silver {
        grid-template-columns: 1fr 1fr !important;
        gap: 1rem !important;
    }
}

/* Mobile Landscape Optimization */
@media (max-height: 500px) and (orientation: landscape) {
    .nav-content {
        padding: 0.25rem 1rem !important;
        min-height: 50px !important;
    }

    .logo-container,
    .logo-container.home-position,
    .logo-container.nav-position {
        position: relative !important;
        top: auto !important;
        left: auto !important;
        width: 50px !important;
        /* Smaller logo for landscape */
        height: auto !important;
        margin-right: 1rem;
        flex-shrink: 0;
    }

    .nav-logo {
        position: relative;
        left: auto;
        transform: none;
        width: auto;
        margin: 0;
        font-size: 0.9rem;
        /* Smaller text */
    }
}

.hero {
    background: linear-gradient(135deg, var(--primary-color) 0%, #6b0000 100%);
    color: white;
    padding: 6rem 2rem;
    text-align: center;
}

.hero h1 {
    font-size: 3rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.content-section {
    max-width: 1200px;
    margin: 0 auto;
    padding: 4rem 2rem;
}

.section-intro {
    font-size: 1.1rem;
    text-align: center;
    max-width: 800px;
    margin: 0 auto 6rem auto;
    color: #555;
    white-space: pre-line;
}

.section-title {
    font-size: 2.5rem;
    color: var(--primary-color);
    margin: 0 0 2rem 0;
    text-align: center;
}

/* HOME BOXES (Dynamic Centered) */
.home-card-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 2rem;
    margin-top: 2rem;
    --desktop-cols: 4;
}

.home-card-grid>.card {
    flex: 1 1 calc((100% / var(--desktop-cols)) - 2rem);
    max-width: 100%;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
}

@media (max-width: 768px) {
    .home-card-grid>.card {
        flex-basis: calc(50% - 1.5rem);
    }

    .home-card-grid[data-count="1"]>.card {
        flex-basis: 100%;
    }
}

/* MEMBER GRID (Static Left-Aligned) */
.card-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-start;
    gap: 2rem;
    margin-top: 2rem;
}

.card-grid>.card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

@media (min-width: 769px) {
    .card-grid>.card {
        width: calc(33.333% - 1.34rem);
    }
}

@media (max-width: 768px) {
    .card-grid {
        justify-content: flex-start !important;
        /* Force left alignment */
        gap: 1rem;
    }

    .card-grid>.card {
        width: calc(50% - 0.5rem);
        margin-left: 0 !important;
        /* Prevent auto margins */
        margin-right: 0 !important;
        flex-grow: 0 !important;
        /* Prevent growing to fill row */
    }

    /* CONTACT GRID OVERRIDE: Always center */
    #contactPage .card-grid {
        justify-content: center !important;
    }

    /* #contactPage .card-grid>.card { } - Removed empty rule */
}

/* Contact Grid Desktop: Center */
#contactPage .card-grid {
    justify-content: center;
}

.card {
    background: var(--background-color);
    border-radius: 8px;
    padding: 2rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.card:hover {
    transform: translateY(-5px);
    border-color: var(--primary-color);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

.card.clickable-card:hover {
    cursor: pointer;
    border-color: var(--primary-color);
    background: var(--surface-color);
}

#homePage .card,
#contactPage .card {
    text-align: center;
    padding: 3rem 2rem;
}

#homePage .card h3,
#contactPage .card h3 {
    font-size: 2rem;
    margin-bottom: 1rem;
    color: var(--primary-color);
}

#homePage .card p,
#contactPage .card p,
#contactPage .card a {
    font-size: 1.2rem;
    line-height: 1.7;
}

.contact-icon {
    width: 48px;
    height: 48px;
    margin: 0 auto 1.5rem auto;
    fill: var(--primary-color);
}

.page-content {
    display: none;
}

.page-content.active {
    display: block;
}

/* FOOTER & SOCIAL */
.footer {
    background: var(--primary-color);
    color: white;
    padding: 3rem 2rem;
    text-align: center;
    margin-top: auto;
}

.social-icons {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

/* Social Icon Style: Bild zentriert, Größe fixiert */
.social-icon {
    width: 32px;
    height: 32px;
    object-fit: contain;
    transition: transform 0.2s;
    display: block;
}

.social-icon:hover {
    transform: scale(1.1);
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 3rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.footer-links a {
    color: white;
    text-decoration: none;
    padding: 0.5rem 1.5rem;
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 4px;
    transition: all 0.2s ease;
    background: rgba(0, 0, 0, 0.1);
}

.footer-links a:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: white;
    transform: translateY(-2px);
}

/* PARTNER GRID STYLES */
/* PARTNER GRID STYLES */
.partner-grid-gold,
.partner-grid-silver,
.partner-grid-bronze {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1.5rem;
    /* Default gap */
    margin-bottom: 4rem;
    width: 100%;
}

/* Gold: Mobile 100%, Desktop 80% */
.partner-grid-gold>.partner-card {
    width: 100%;
    max-width: 600px;
}

@media (min-width: 769px) {
    .partner-grid-gold>.partner-card {
        width: 80%;
    }
}

/* Silver: Mobile 50%, Desktop 50% */
.partner-grid-silver>.partner-card {
    /* Mobile: 50% width. To fit 2 with gap, use calc(50% - gap) */
    width: calc(50% - 0.75rem);
}

/* Bronze: Mobile 33%, Desktop 33% */
.partner-grid-bronze>.partner-card {
    /* Mobile: 33% width. To fit 3 with gap, use calc(33.333% - gap) */
    width: calc(33.333% - 1rem);
}

@media (max-width: 768px) {

    /* reduce gap on mobile to fit items better */
    .partner-grid-gold,
    .partner-grid-silver,
    .partner-grid-bronze {
        gap: 0.5rem;
    }

    .partner-grid-gold>.partner-card {
        width: 100%;
    }

    .partner-grid-silver>.partner-card {
        width: calc(50% - 0.25rem);
        /* 50% - half gap */
    }

    .partner-grid-bronze>.partner-card {
        width: calc(33.333% - 0.34rem);
        /* 33% - 2/3 gap */
    }
}

@media (min-width: 768px) {
    .partner-grid-silver {
        grid-template-columns: repeat(2, 1fr);
    }

    .partner-grid-bronze {
        grid-template-columns: repeat(4, 1fr);
    }
}

.partner-card {
    background: var(--surface-color);
    border: 1px solid rgba(0, 0, 0, 0.05);
    border-radius: 8px;
    padding: 1.5rem;
    text-align: center;
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.partner-card:hover {
    transform: translateY(-3px);
}

.partner-logo-container {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
}

.partner-logo {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.partner-name {
    font-weight: 600;
    color: var(--text-color);
    margin-top: auto;
}

.gold-size {
    height: 200px;
}

.silver-size {
    height: 120px;
}

.bronze-size {
    height: 80px;
}

/* CHRONIK & SOUNDCLOUD */
.chronicle-container {
    margin-bottom: 2rem;
}

.chronicle-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.5rem 2rem;
    background: var(--surface-color);
    border-left: 5px solid var(--primary-color);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 0.5rem;
}

.chronicle-header:hover {
    filter: brightness(0.95);
}

.chronicle-title-text {
    font-family: var(--font-primary);
    font-weight: 700;
    font-size: 1.5rem;
    color: var(--primary-color);
}

.chronicle-icon {
    width: 24px;
    height: 24px;
    transition: transform 0.3s ease;
    fill: var(--text-color);
}

.chronicle-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s cubic-bezier(0, 1, 0, 1);
    padding: 0 2rem;
    background: var(--background-color);
    border-radius: 0 0 8px 8px;
}

.chronicle-content.open {
    max-height: 2000px;
    padding: 2rem;
    margin-bottom: 2rem;
    border: 1px solid rgba(0, 0, 0, 0.05);
    border-top: none;
}

.chronicle-header.active .chronicle-icon {
    transform: rotate(180deg);
}

.chronicle-toggle-all {
    /* display: inline-block; */
    /* Removed redundant display */
    float: right;
    margin-bottom: 1rem;
    padding: 0.5rem 1rem;
    border: 1px solid var(--primary-color);
    color: var(--primary-color);
    border-radius: 4px;
    font-weight: 600;
    transition: all 0.2s ease;
    font-size: 0.9rem;
}

.chronicle-toggle-all:hover {
    background: var(--primary-color);
    color: white;
}

.soundcloud-wrapper {
    margin-top: 3rem;
    border-radius: 8px;
    overflow: hidden;
}

.soundcloud-wrapper div,
.soundcloud-wrapper a {
    color: var(--text-color) !important;
    font-family: var(--font-secondary) !important;
    font-weight: normal !important;
}

.soundcloud-wrapper a:hover {
    color: var(--primary-color) !important;
    text-decoration: underline !important;
}

.member-img-container {
    width: 150px;
    height: 200px;
    margin: 0 auto 1rem auto;
    border-radius: 8px;
    overflow: hidden;
    border: 3px solid var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f0f0f0;
}

.member-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top center;
}

.cat-header {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 2rem;
    padding: 1rem;
    padding-left: 2rem;
    border-bottom: 3px solid var(--primary-color);
    background: var(--surface-color);
    border-radius: 8px;
    transition: background-color 0.3s ease;
}

.cat-icon {
    width: 80px;
    height: 80px;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: transparent;
    flex-shrink: 0;
}

/* Google Form Iframe */
.google-form-container {
    width: 100%;
    display: flex;
    justify-content: center;
    margin-top: 2rem;
}

.google-form-container iframe {
    width: 100% !important;
    max-width: 640px;
    display: block;
    background: transparent;
}

.hero-image-container {
    margin-bottom: 3rem;
    border-radius: 12px;
    overflow: hidden;
}

@media (max-width: 768px) {
    .section-intro {
        margin-bottom: 0 !important;
        margin-top: 0 !important;
        padding-top: 0 !important;
    }

    /* Equalize: Top Gap = 0.5rem (approx 8px reduction), Bottom Gap = 2rem */
    .hero-image-container {
        margin-bottom: 0.5rem !important;
    }
}/* New Utility Classes for Strict CSP */
.text-pre-line {
    white-space: pre-line;
}

.margin-vertical-large {
    margin-top: 4rem;
    margin-bottom: 0;
}

.text-center-muted {
    text-align: center;
    color: #888;
}

.overflow-hidden {
    overflow: hidden;
}

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

.link-clean {
    color: var(--text-color);
    text-decoration: none;
}

.text-small {
    font-size: 0.9rem;
}

.footer-version-text {
    font-size: 0.8rem;
    opacity: 0.7;
    margin-top: 1rem;
}

.img-contain-full {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.cat-header-title {
    font-size: 2rem;
    color: var(--primary-color);
    margin: 0;
}

.member-position {
    color: var(--primary-color);
    font-weight: 700;
    margin: 0;
}

.member-name {
    margin: 0 0 0.5rem 0;
    font-size: 1.3rem;
}

.member-since {
    margin: 0;
    font-size: 0.9rem;
    color: #666;
}

.member-placeholder-icon {
    width: 60px;
    height: 60px;
}

.contact-intro-margin {
    margin-bottom: 2rem;
}.logo-img { width: 100%; height: 100%; object-fit: contain; border-radius: 12px; }
.text-center { text-align: center; }
