/* Global Variables & Design System */
:root {
    --background-white: #ffffff;
    --accent-grey: #f5f5f5;
    --primary-red: #e20a18;
    --primary-red-hover: #b50813;
    --text-dark: #1f2937;
    --text-light: #6b7280;

    --radius-container: 12px;
    --radius-pill: 9999px;
    --transition-speed: 0.2s;
}

/* Reset & Basics */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 80px;
    /* Offset for fixed header */
}

body {
    font-family: 'Outfit', sans-serif;
    color: var(--text-dark);
    background-color: var(--background-white);
    line-height: 1.6;
    font-weight: 400;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: 'Outfit', sans-serif;
    color: var(--text-dark);
    line-height: 1.2;
}

h1 {
    font-weight: 900;
    letter-spacing: -0.02em;
}

h2 {
    font-weight: 900;
    letter-spacing: -0.01em;
}

h3 {
    font-weight: 900;
}

h4 {
    font-weight: 700;
}

h5 {
    font-weight: 700;
}

h6 {
    font-weight: 700;
}

a {
    text-decoration: none;
    color: inherit;
    transition: color var(--transition-speed) ease;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Layout Utilities */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* I will read main.js first instead of changing section-padding blindly. Wait, I shouldn't replace anything yet. I'll just change section-padding from 5rem to something else if needed? I'll cancel this replacement chunk. Actually wait I can't cancel a parallel tool. So I'll just replace 5rem with 5rem (no-op). */
.section-padding {
    padding: 5rem 0;
}

.text-center {
    text-align: center;
}

.mb-2 {
    margin-bottom: 0.5rem;
}

.mb-4 {
    margin-bottom: 1rem;
}

.mb-8 {
    margin-bottom: 2rem;
}

.mt-8 {
    margin-top: 2rem;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-pill);
    font-family: 'Outfit', sans-serif;
    font-weight: 600;
    cursor: pointer;
    transition: background-color var(--transition-speed) ease, color var(--transition-speed) ease;
    border: none;
    text-decoration: none;
}

.btn-primary {
    background-color: var(--primary-red);
    color: #ffffff;
}

.btn-primary:hover {
    background-color: var(--primary-red-hover);
    color: #ffffff;
}

.btn-light {
    background-color: var(--accent-grey);
    color: var(--text-dark);
}

.btn-light:hover {
    background-color: #d1d5db;
}

/* Header & Navigation */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background-color: var(--background-white);
    border-bottom: 1px solid var(--accent-grey);
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 80px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-family: 'Outfit', sans-serif;
    font-weight: 900;
    font-size: 1.6rem;
    color: var(--text-dark);
}

.logo img {
    height: 48px;
    width: auto;
}

.main-nav {
    display: flex;
    gap: 2rem;
    align-items: center;
}

.nav-item {
    position: relative;
}

.main-nav a {
    font-weight: 600;
    transition: color var(--transition-speed) ease;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.main-nav a:hover,
.main-nav a.active {
    color: var(--primary-red);
}

/* Dropdown */
.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 50%;
    background-color: var(--background-white);
    min-width: 200px;
    border: 1px solid var(--accent-grey);
    border-radius: var(--radius-container);
    padding: 0.5rem 0;
    opacity: 0;
    visibility: hidden;
    transform: translateX(-50%) translateY(10px);
    transition: opacity var(--transition-speed) ease, transform var(--transition-speed) ease, visibility var(--transition-speed) ease;
    z-index: 200;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

.nav-item:hover .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

.dropdown-menu a {
    display: block;
    padding: 0.75rem 1.5rem;
    font-weight: 600;
}

.dropdown-menu a:hover {
    background-color: var(--accent-grey);
}

.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-dark);
    cursor: pointer;
}

/* Hero Section */
.hero {
    position: relative;
    min-height: 80vh;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    text-align: center;
    background-image: linear-gradient(rgba(31, 41, 55, 0.6), rgba(31, 41, 55, 0.6)), url('../assets/img/mannschaft-jubel-querformat.jpg');
    background-size: cover;
    background-position: center;
}

.hero-content {
    position: relative;
    z-index: 10;
    max-width: 800px;
    padding: 0 1.5rem;
}

.hero h1 {
    font-size: clamp(2.5rem, 5vw, 4rem);
    color: #ffffff;
    margin-bottom: 1rem;
}

.hero p {
    font-size: 1.25rem;
    margin-bottom: 2rem;
    opacity: 0.9;
}

/* Sections */
.section-title {
    font-size: 2.5rem;
    margin-bottom: 3rem;
    text-align: center;
}

/* Instagram Placeholder Grid */
.insta-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
}

@media (max-width: 992px) {
    .insta-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 640px) {
    .insta-grid {
        grid-template-columns: 1fr;
    }
}

.insta-placeholder {
    background-color: var(--accent-grey);
    border-radius: var(--radius-container);
    aspect-ratio: 1 / 1;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-light);
    font-size: 0.875rem;
    border: 1px dashed #d1d5db;
}

.insta-post {
    display: block;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    background-color: #000;
    border-radius: var(--radius-container);
}

.insta-post img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: opacity 0.2s ease;
}

.insta-post:hover img {
    opacity: 0.7;
}

/* Mannschaften Kacheln */
.teams-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 2rem;
}

@media (max-width: 1024px) {
    .teams-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 640px) {
    .teams-grid {
        grid-template-columns: 1fr;
    }
}

.team-card {
    background-color: var(--accent-grey);
    border-radius: var(--radius-container);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.team-card-img {
    width: 100%;
    aspect-ratio: 16 / 9;
    background-color: #e5e7eb;
    object-fit: cover;
}

.team-card-content {
    padding: 1.5rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.team-card h3 {
    margin-bottom: 0.5rem;
    font-size: 1.5rem;
}

.team-card p {
    color: var(--text-light);
    margin-bottom: 1.5rem;
    flex-grow: 1;
}

/* Timeline */
.timeline {
    max-width: 800px;
    margin: 0 auto;
    position: relative;
}

.timeline-item {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
    background-color: var(--background-white);
    border: 1px solid #e5e7eb;
    border-radius: var(--radius-container);
    padding: 1.5rem;
}

.timeline-date {
    font-weight: 900;
    color: var(--primary-red);
    min-width: 120px;
}

.timeline-content h4 {
    font-size: 1.25rem;
    margin-bottom: 0.25rem;
}

.timeline-content p {
    color: var(--text-light);
}

/* Contact & Maps */
.contact-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

.map-container {
    border-radius: var(--radius-container);
    overflow: hidden;
    height: 400px;
    background-color: var(--accent-grey);
}

.map-container iframe {
    width: 100%;
    height: 100%;
    border: none;
}

.contact-info-cards {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
}

.contact-card {
    background-color: var(--accent-grey);
    border-radius: var(--radius-container);
    padding: 1.5rem;
}

.contact-card h4 {
    margin-bottom: 0.5rem;
    font-size: 1.125rem;
}

.contact-card p {
    color: var(--text-light);
    margin-bottom: 0.25rem;
}

.board-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.board-member {
    background-color: var(--background-white);
    padding: 1rem;
    border-radius: var(--radius-container);
    border: 1px solid #e5e7eb;
}

.board-member .role {
    font-size: 0.75rem;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 900;
}

.board-member .name {
    font-weight: 700;
}

/* Footer */
.site-footer {
    background-color: #f9fafb;
    border-top: 1px solid var(--accent-grey);
    padding: 4rem 0 2rem;
    margin-top: 4rem;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 3rem;
    margin-bottom: 3rem;
}

.footer-col h4 {
    font-size: 1.125rem;
    margin-bottom: 1.5rem;
}

.footer-col ul {
    list-style: none;
}

.footer-col ul li {
    margin-bottom: 0.75rem;
}

.footer-col ul li a {
    color: var(--text-light);
}

.footer-col ul li a:hover {
    color: var(--primary-red);
}

.sponsors {
    border-top: 1px solid var(--accent-grey);
    padding-top: 2rem;
    margin-bottom: 2rem;
    text-align: center;
}

.sponsors-logos {
    display: flex;
    justify-content: center;
    gap: 2rem;
    flex-wrap: wrap;
    margin-top: 1rem;
    opacity: 0.5;
}

.footer-bottom {
    text-align: center;
    color: var(--text-light);
    font-size: 0.875rem;
    padding-top: 2rem;
    border-top: 1px solid var(--accent-grey);
}



/* Instagram Viewer Modal */
.insta-viewer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--transition-speed) ease, visibility var(--transition-speed) ease;
}

.insta-viewer.active {
    opacity: 1;
    visibility: visible;
}

.insta-viewer-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(5px);
}

.insta-viewer-content {
    position: relative;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    background-color: var(--background-white);
    border-radius: var(--radius-container);
    overflow: hidden;
    max-width: 90vw;
    max-height: 90vh;
    width: 480px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.insta-viewer-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(255, 255, 255, 0.8);
    border: none;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10001;
    color: var(--text-dark);
    transition: background-color 0.2s ease;
}

.insta-viewer-close:hover {
    background: #ffffff;
}

.insta-viewer-img-container {
    width: 100%;
    aspect-ratio: 1 / 1;
    background-color: #000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.insta-viewer-img-container img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.insta-viewer-info {
    padding: 1rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-top: 1px solid var(--accent-grey);
}

.insta-viewer-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.insta-viewer-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
}

.insta-viewer-username {
    font-weight: 700;
    font-size: 1.125rem;
}

.btn-sm {
    padding: 0.4rem 1.25rem;
    font-size: 0.875rem;
}

/* Team Info Cards */
.info-cards-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.full-width-card {
    grid-column: 1 / -1;
}

.info-cards-grid .contact-card {
    display: flex;
    flex-direction: column;
    height: 100%;
    margin-bottom: 0;
}

.card-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--accent-grey);
}

.card-header h3 {
    margin-bottom: 0;
    font-size: 1.25rem;
    color: var(--text-dark);
}

.card-content {
    flex-grow: 1;
}

.card-content p {
    margin-bottom: 0.5rem;
}

.card-content p:last-child {
    margin-bottom: 0;
}

/* Training Table */
.training-table {
    width: 100%;
    border-collapse: collapse;
}

.training-table td {
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--accent-grey);
}

.training-table tr:first-child td {
    padding-top: 0;
}

.training-table tr:last-child td {
    border-bottom: none;
    padding-bottom: 0;
}

.training-table td:first-child {
    font-weight: 600;
    color: var(--text-dark);
    width: 40%;
}

.training-table td:last-child {
    text-align: right;
    color: var(--text-light);
}

/* Responsive */
@media (max-width: 992px) {
    .nav-container {
        position: relative;
    }

    .mobile-menu-toggle {
        display: block;
    }

    .main-nav {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background-color: var(--background-white);
        flex-direction: column;
        align-items: flex-end;
        padding: 1.5rem;
        gap: 1rem;
        border-bottom: 1px solid var(--accent-grey);
    }

    .info-cards-grid {
        grid-template-columns: 1fr;
    }

    .main-nav.active {
        display: flex;
    }

    .nav-item {
        width: 100%;
        display: flex;
        flex-direction: column;
        align-items: flex-end;
    }

    .main-nav a {
        padding: 0.75rem 1rem;
        min-height: 54px;
        width: 100%;
        justify-content: flex-end;
        text-align: right;
        border-radius: var(--radius-container);
        gap: 0.5rem;
    }

    .main-nav a .material-symbols-outlined {
        order: 2;
        /* Stellen Sie sicher, dass das Icon immer ganz rechts nach dem Text steht */
    }

    .dropdown-menu {
        position: static;
        display: none;
        /* Standmäßig aus in mobile */
        opacity: 1;
        visibility: visible;
        transform: none !important;
        width: 100%;
        min-width: 100%;
        box-shadow: none;
        border: none;
        padding-left: 0;
        padding-right: 1.5rem;
        padding-top: 0.5rem;
        padding-bottom: 0.5rem;
        margin-top: 0.5rem;
        background-color: transparent;
        border-right: 2px solid var(--accent-grey);
        align-items: flex-end;
        gap: 0.5rem;
    }

    .dropdown-menu a {
        padding: 1rem 1.25rem;
        min-height: 54px;
        font-weight: 500;
        justify-content: flex-end;
        text-align: right;
        border-radius: var(--radius-container);
    }

    /* Hover-Effekte auf dem Handy deaktivieren (Bug-Fix) */
    .nav-item:hover .dropdown-menu {
        display: none;
    }

    /* Klick-Effekt durch JS aktivierte Klasse */
    .nav-item.active .dropdown-menu {
        display: flex;
        flex-direction: column;
    }

    /* Icon drehen wenn geöffnet */
    .nav-item.active>a .material-symbols-outlined {
        transform: rotate(180deg);
    }

    .main-nav a .material-symbols-outlined {
        transition: transform 0.3s ease;
    }

}

.insta-viewer-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
}

.insta-viewer-username {
    font-weight: 700;
    font-size: 1.125rem;
}

.btn-sm {
    padding: 0.4rem 1.25rem;
    font-size: 0.875rem;
}

/* Team Info Cards */
.info-cards-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.full-width-card {
    grid-column: 1 / -1;
}

.info-cards-grid .contact-card {
    display: flex;
    flex-direction: column;
    height: 100%;
    margin-bottom: 0;
}

.card-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--accent-grey);
}

.card-header h3 {
    margin-bottom: 0;
    font-size: 1.25rem;
    color: var(--text-dark);
}

.card-content {
    flex-grow: 1;
}

.card-content p {
    margin-bottom: 0.5rem;
}

.card-content p:last-child {
    margin-bottom: 0;
}

/* Training Table */
.training-table {
    width: 100%;
    border-collapse: collapse;
}

.training-table td {
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--accent-grey);
}

.training-table tr:first-child td {
    padding-top: 0;
}

.training-table tr:last-child td {
    border-bottom: none;
    padding-bottom: 0;
}

.training-table td:first-child {
    font-weight: 600;
    color: var(--text-dark);
    width: 40%;
}

.training-table td:last-child {
    text-align: right;
    color: var(--text-light);
}

/* Responsive */
@media (max-width: 992px) {
    .nav-container {
        position: relative;
    }

    .mobile-menu-toggle {
        display: block;
    }

    .main-nav {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background-color: var(--background-white);
        flex-direction: column;
        align-items: flex-end;
        padding: 1.5rem;
        gap: 1rem;
        border-bottom: 1px solid var(--accent-grey);
    }

    .info-cards-grid {
        grid-template-columns: 1fr;
    }

    .main-nav.active {
        display: flex;
    }

    .nav-item {
        width: 100%;
        display: flex;
        flex-direction: column;
        align-items: flex-end;
    }

    .main-nav a {
        padding: 0.75rem 1rem;
        min-height: 54px;
        width: 100%;
        justify-content: flex-end;
        text-align: right;
        border-radius: var(--radius-container);
        gap: 0.5rem;
    }

    .main-nav a .material-symbols-outlined {
        order: 2;
        /* Stellen Sie sicher, dass das Icon immer ganz rechts nach dem Text steht */
    }

    .dropdown-menu {
        position: static;
        display: none;
        /* Standmäßig aus in mobile */
        opacity: 1;
        visibility: visible;
        transform: none !important;
        width: 100%;
        min-width: 100%;
        box-shadow: none;
        border: none;
        padding-left: 0;
        padding-right: 1.5rem;
        padding-top: 0.5rem;
        padding-bottom: 0.5rem;
        margin-top: 0.5rem;
        background-color: transparent;
        border-right: 2px solid var(--accent-grey);
        align-items: flex-end;
        gap: 0.5rem;
    }

    .dropdown-menu a {
        padding: 1rem 1.25rem;
        min-height: 54px;
        font-weight: 500;
        justify-content: flex-end;
        text-align: right;
        border-radius: var(--radius-container);
    }

    /* Hover-Effekte auf dem Handy deaktivieren (Bug-Fix) */
    .nav-item:hover .dropdown-menu {
        display: none;
    }

    /* Klick-Effekt durch JS aktivierte Klasse */
    .nav-item.active .dropdown-menu {
        display: flex;
        flex-direction: column;
    }

    /* Icon drehen wenn geöffnet */
    .nav-item.active>a .material-symbols-outlined {
        transform: rotate(180deg);
    }

    .main-nav a .material-symbols-outlined {
        transition: transform 0.3s ease;
    }

    .contact-grid {
        grid-template-columns: 1fr;
    }

    .timeline-item {
        flex-direction: column;
        gap: 0.5rem;
    }
}

/* Bento Grid Galerie */
.bento-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-auto-rows: 250px;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.bento-item {
    border-radius: var(--radius-container);
    overflow: hidden;
    background-color: var(--accent-grey);
    display: block;
    position: relative;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    transition: box-shadow 0.3s ease;
}

.bento-item::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.4) 0%, transparent 50%);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.bento-item:hover {
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

.bento-item:hover::after {
    opacity: 1;
}

.bento-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: filter 0.3s ease;
}

.bento-item:nth-child(6n+1) {
    grid-column: span 2;
    grid-row: span 2;
}

.bento-item:nth-child(6n+2) {
    grid-column: span 2;
    grid-row: span 1;
}

.bento-item:nth-child(6n+3) {
    grid-column: span 1;
    grid-row: span 1;
}

.bento-item:nth-child(6n+4) {
    grid-column: span 1;
    grid-row: span 1;
}

.bento-item:nth-child(6n+5) {
    grid-column: span 2;
    grid-row: span 1;
}

.bento-item:nth-child(6n+6) {
    grid-column: span 2;
    grid-row: span 1;
}

@media (max-width: 992px) {
    .bento-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }

    .bento-item {
        grid-column: span 1 !important;
        grid-row: span 1 !important;
    }

    .bento-item:nth-child(4n+1) {
        grid-column: span 2 !important;
        grid-row: span 2 !important;
    }
}

@media (max-width: 640px) {
    .bento-grid {
        grid-template-columns: 1fr;
        grid-auto-rows: 300px;
    }

    .bento-item {
        grid-column: span 1 !important;
        grid-row: span 1 !important;
    }
}