/**
 * FaKoS Schaffhausen - zentrales Stylesheet.
 * Baut auf Bootstrap 5 auf, ergänzt um ein eigenes, modernes Erscheinungsbild
 * angelehnt an die bestehende FaKoS-Identität (Schwarz/Gold).
 */

:root {
    --fakos-gold: #f5c518;
    --fakos-gold-dark: #d9ab00;
    --fakos-black: #161616;
    --fakos-dark: #232323;
    --fakos-grey: #6b7280;
    --fakos-grey-light: #f4f4f5;
    --fakos-radius: 0.75rem;
    /* Offizielles "Schaffhauser Gelb" der Stadt-/Fasnachtsfarben (schwarz/gelb),
       wie auf der bisherigen Website verwendet - bewusst als eigener Wert
       getrennt vom generischen Akzent-Gold gepflegt. */
    --schaffhausen-yellow: #ffd900;
    --bs-body-font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
}

html {
    scroll-behavior: smooth;
}

/* Buttons dürfen nie eine Text-Unterstreichung zeigen, auch nicht bei
   Hover/Focus/Active - unabhängig davon, welche btn-Klasse verwendet wird. */
[class*="btn"] {
    text-decoration: none !important;
}
[class*="btn"]:hover,
[class*="btn"]:focus,
[class*="btn"]:active,
[class*="btn"]:visited {
    text-decoration: none !important;
}

body {
    color: var(--fakos-black);
    background-color: #fff;
}

a {
    color: var(--fakos-dark);
}
a:hover {
    color: var(--fakos-gold-dark);
}

/* ─── Navigation ─────────────────────────────────────────────────────── */
.navbar-fakos {
    background-color: #fff;
    padding-top: 0.85rem;
    padding-bottom: 0.85rem;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    border-bottom: 3px solid var(--fakos-gold);
}
.navbar-fakos .navbar-brand {
    display: flex;
    align-items: center;
    padding: 0;
}
.navbar-fakos .navbar-brand img {
    display: block;
}
.navbar-fakos .nav-link {
    color: var(--fakos-black);
    font-weight: 500;
    padding: 0.5rem 0.9rem;
}
.navbar-fakos .nav-link:hover,
.navbar-fakos .nav-link.active {
    color: var(--fakos-gold-dark);
}
a.btn-cta {
    text-decoration: none;
}
.navbar-fakos .btn-cta {
    background-color: var(--fakos-gold);
    color: var(--fakos-black);
    font-weight: 700;
    border-radius: 999px;
    padding: 0.45rem 1.2rem;
    text-decoration: none;
}
.navbar-fakos .btn-cta:hover {
    background-color: var(--fakos-gold-dark);
    color: var(--fakos-black);
    text-decoration: none;
}

/* ─── Hero ───────────────────────────────────────────────────────────── */
.hero {
    background: radial-gradient(circle at top right, #2b2b2b 0%, var(--fakos-black) 60%);
    color: #fff;
    padding: 5.5rem 0 6rem;
}
.hero-slideshow {
    position: relative;
    overflow: hidden;
    isolation: isolate;
}
.hero-slideshow-slides {
    position: absolute;
    inset: 0;
    z-index: 0;
}
.hero-slide {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    opacity: 0;
    animation-name: heroSlideFade;
    animation-timing-function: ease-in-out;
    animation-iteration-count: infinite;
}
.hero-slideshow-overlay {
    position: absolute;
    inset: 0;
    z-index: 1;
    background: linear-gradient(120deg, rgba(0, 0, 0, 0.82) 0%, rgba(0, 0, 0, 0.55) 55%, rgba(0, 0, 0, 0.35) 100%);
}
.hero-content {
    position: relative;
    z-index: 2;
}
@keyframes heroSlideFade {
    0%, 100% { opacity: 0; }
    3%, 11% { opacity: 1; }
    14% { opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
    .hero-slide {
        animation: none;
        opacity: 0;
    }
    .hero-slide:first-child {
        opacity: 1;
    }
}
.hero h1 {
    font-weight: 800;
    font-size: clamp(2.1rem, 4vw, 3.4rem);
    line-height: 1.15;
}
.hero .lead {
    color: rgba(255, 255, 255, 0.85);
    font-size: 1.15rem;
}
.hero .badge-gold {
    background-color: var(--fakos-gold);
    color: var(--fakos-black);
    font-weight: 700;
    border-radius: 999px;
    padding: 0.4rem 0.9rem;
    display: inline-block;
    margin-bottom: 1rem;
}
.hero-card {
    border-radius: var(--fakos-radius);
    overflow: hidden;
    box-shadow: 0 20px 45px rgba(0, 0, 0, 0.35);
}

/* ─── Sections & Cards ───────────────────────────────────────────────── */
.section {
    padding-top: 4.5rem;
    padding-bottom: 4.5rem;
}
.section-title {
    font-weight: 800;
    margin-bottom: 0.5rem;
}
.section-subtitle {
    color: var(--fakos-grey);
    margin-bottom: 2.5rem;
    max-width: 640px;
}
.card-fakos {
    border: none;
    border-radius: var(--fakos-radius);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.06);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    height: 100%;
}
.card-fakos:hover {
    transform: translateY(-4px);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.12);
}
.card-fakos-image {
    display: block;
    position: relative;
    min-height: 280px;
    background-size: cover;
    background-position: center;
    color: #fff;
    text-decoration: none;
    overflow: hidden;
}
.card-fakos-image-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.1) 0%, rgba(0, 0, 0, 0.85) 100%);
    transition: background 0.2s ease;
}
.card-fakos-image:hover .card-fakos-image-overlay {
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.2) 0%, rgba(0, 0, 0, 0.92) 100%);
}
.card-fakos-image-body {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 1.5rem;
}
.card-fakos-image-body h3 {
    color: #fff;
    font-weight: 800;
    margin-bottom: 0.4rem;
}
.card-fakos-image-body p {
    color: rgba(255, 255, 255, 0.85);
    margin-bottom: 0.75rem;
}
.card-fakos-image-body .card-fakos-link {
    color: var(--fakos-gold);
    font-weight: 700;
}

.btn-fakos-primary {
    background-color: var(--fakos-gold);
    border-color: var(--fakos-gold);
    color: var(--fakos-black);
    font-weight: 700;
    border-radius: 999px;
    padding: 0.65rem 1.6rem;
}
.btn-fakos-primary:hover {
    background-color: var(--fakos-gold-dark);
    border-color: var(--fakos-gold-dark);
    color: var(--fakos-black);
}
.btn-fakos-outline {
    border: 2px solid var(--fakos-black);
    color: var(--fakos-black);
    font-weight: 700;
    border-radius: 999px;
    padding: 0.6rem 1.5rem;
}
.btn-fakos-outline:hover {
    background-color: var(--fakos-black);
    color: #fff;
}
.hero-slideshow .btn-fakos-outline {
    border-color: #fff;
    color: #fff;
}
.hero-slideshow .btn-fakos-outline:hover {
    background-color: #fff;
    border-color: #fff;
    color: var(--fakos-black);
}

/* ─── Content pages ──────────────────────────────────────────────────── */
.page-header {
    background-color: var(--fakos-grey-light);
    padding: 3rem 0;
    margin-bottom: 2.5rem;
}
.page-header h1 {
    font-weight: 800;
}
.page-header-hero {
    position: relative;
    background-size: cover;
    background-position: center;
    color: #fff;
    padding: 4.5rem 0;
    margin-bottom: 2.5rem;
    overflow: hidden;
}
.page-header-hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(22,22,22,.35) 0%, rgba(22,22,22,.75) 100%);
}
.page-header-hero .container {
    position: relative;
    z-index: 1;
}
.page-header-hero h1 {
    font-weight: 800;
    color: #fff;
    text-shadow: 0 2px 8px rgba(0,0,0,.45);
}
.page-header-hero .breadcrumb-fakos a {
    color: rgba(255,255,255,.85);
}
.page-header-hero .breadcrumb-fakos {
    color: rgba(255,255,255,.7);
}
.breadcrumb-fakos a {
    color: var(--fakos-grey);
    text-decoration: none;
}
.content-body h2 {
    font-weight: 700;
    margin-top: 2rem;
}
.content-body h3 {
    font-weight: 700;
    margin-top: 1.5rem;
}

/* ─── Fehlerseite (404 etc.) ─────────────────────────────────────────── */
.error-page-emblem {
    width: 180px;
    height: auto;
    opacity: 0.92;
}
.error-page-code {
    font-size: 5rem;
    font-weight: 800;
    line-height: 1;
    color: var(--fakos-gold);
    letter-spacing: 0.05em;
}
@media (max-width: 575.98px) {
    .error-page-emblem { width: 130px; }
    .error-page-code { font-size: 3.5rem; }
}

/* ─── Forms ──────────────────────────────────────────────────────────── */
.form-fakos label {
    font-weight: 600;
}
.form-fakos .form-control,
.form-fakos .form-select {
    border-radius: 0.5rem;
    padding: 0.65rem 0.9rem;
}
.form-fakos .form-control:focus,
.form-fakos .form-select:focus {
    border-color: var(--fakos-gold);
    box-shadow: 0 0 0 0.2rem rgba(245, 197, 24, 0.25);
}
.alert-fakos-success {
    background-color: #e9f9ee;
    border: 1px solid #b6ecc7;
    color: #14532d;
    border-radius: var(--fakos-radius);
}
.alert-fakos-error {
    background-color: #fdecec;
    border: 1px solid #f5b8b8;
    color: #7f1d1d;
    border-radius: var(--fakos-radius);
}

/* ─── Footer ─────────────────────────────────────────────────────────── */
.footer-fakos {
    background-color: var(--schaffhausen-yellow);
    color: rgba(0, 0, 0, 0.75);
    padding: 3.5rem 0 2rem;
}
.footer-fakos .footer-logo {
    height: 64px;
    width: auto;
}
.footer-fakos h5 {
    color: var(--fakos-black);
    font-weight: 700;
}
.footer-fakos a {
    color: rgba(0, 0, 0, 0.75);
    text-decoration: none;
}
.footer-fakos a:hover {
    color: var(--fakos-black);
    text-decoration: underline;
}
.footer-fakos .footer-bottom {
    border-top: 1px solid rgba(0, 0, 0, 0.15);
    margin-top: 2.5rem;
    padding-top: 1.5rem;
    font-size: 0.875rem;
    color: rgba(0, 0, 0, 0.65);
}
.footer-fakos .footer-social-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: var(--fakos-black);
    color: var(--schaffhausen-yellow);
    transition: transform 0.15s ease, background-color 0.15s ease;
}
.footer-fakos .footer-social-link:hover {
    background-color: rgba(0, 0, 0, 0.8);
    color: var(--schaffhausen-yellow);
    text-decoration: none;
    transform: translateY(-2px);
}

/* ─── Sponsors ───────────────────────────────────────────────────────── */
.sponsor-logo {
    background-color: #fff;
    border-radius: var(--fakos-radius);
    padding: 1.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 110px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
}
.sponsor-logo img {
    max-height: 70px;
    max-width: 100%;
    filter: grayscale(0.1);
}

/* ─── Sponsor-Laufband (Startseite) ─────────────────────────────────────
   Reine CSS-Loesung: die Sponsorenliste wird im Template dupliziert und
   per @keyframes horizontal verschoben, dadurch entsteht ein nahtloser
   Endlos-Scroll ohne externe JS-Bibliothek. */
.sponsor-marquee-section {
    background-color: #fff;
    border-top: 1px solid rgba(0, 0, 0, 0.06);
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    padding: 1.5rem 0;
    overflow: hidden;
}
.sponsor-marquee {
    overflow: hidden;
    width: 100%;
    -webkit-mask-image: linear-gradient(to right, transparent 0, #000 5%, #000 95%, transparent 100%);
    mask-image: linear-gradient(to right, transparent 0, #000 5%, #000 95%, transparent 100%);
}
.sponsor-marquee-track {
    display: flex;
    align-items: center;
    gap: 2.5rem;
    width: max-content;
    animation: sponsor-marquee-scroll 45s linear infinite;
}
.sponsor-marquee-section:hover .sponsor-marquee-track {
    animation-play-state: paused;
}
.sponsor-marquee-item {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 48px;
}
.sponsor-marquee-item img {
    max-height: 40px;
    max-width: 130px;
    width: auto;
    filter: grayscale(0.35);
    opacity: 0.85;
    transition: filter 0.2s ease, opacity 0.2s ease;
}
.sponsor-marquee-item a:hover img,
.sponsor-marquee-item img:hover {
    filter: grayscale(0);
    opacity: 1;
}
@keyframes sponsor-marquee-scroll {
    from { transform: translateX(0); }
    to   { transform: translateX(-50%); }
}
@media (prefers-reduced-motion: reduce) {
    .sponsor-marquee-track {
        animation: none;
    }
}

/* ─── Admin ──────────────────────────────────────────────────────────── */
.admin-shell {
    display: flex;
    position: relative;
}
.admin-sidebar {
    background-color: var(--fakos-black);
    min-height: 100vh;
    color: #fff;
    width: 260px;
    flex-shrink: 0;
    transition: width 0.2s ease, transform 0.25s ease;
    overflow-x: hidden;
}
.admin-sidebar a {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    display: block;
    padding: 0.65rem 1.25rem;
    border-radius: 0.5rem;
    white-space: nowrap;
}
.admin-sidebar a:hover,
.admin-sidebar a.active {
    background-color: rgba(245, 197, 24, 0.15);
    color: var(--fakos-gold);
}
.admin-sidebar-close {
    background: none;
    border: 0;
    color: #fff;
    font-size: 1.75rem;
    line-height: 1;
    padding: 0 0.25rem;
}
.admin-content {
    padding: 2.5rem;
    background-color: var(--fakos-grey-light);
    min-height: 100vh;
    min-width: 0;
}
.admin-card {
    background: #fff;
    border-radius: var(--fakos-radius);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    padding: 1.75rem;
}

/* Hamburger-/Toggle-Button für die Sidebar (mobil: öffnet Overlay-Menü,
   Desktop: klappt die Sidebar ein/aus) */
.admin-sidebar-toggle {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 42px;
    height: 42px;
    background: #fff;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 0.5rem;
    cursor: pointer;
    flex-shrink: 0;
}
.admin-sidebar-toggle span {
    display: block;
    width: 20px;
    height: 2px;
    margin: 0 auto;
    background-color: var(--fakos-black);
    border-radius: 2px;
}
.admin-sidebar-backdrop {
    display: none;
}

/* Desktop: eingeklappter Zustand wird via localStorage gemerkt und schon
   vor dem ersten Rendern über die Klasse auf <html> gesetzt (siehe
   templates/layout/admin.php Inline-Script) */
@media (min-width: 992px) {
    html.admin-sidebar-collapsed-pref .admin-sidebar {
        width: 0;
        padding-left: 0 !important;
        padding-right: 0 !important;
    }
    html.admin-sidebar-collapsed-pref .admin-sidebar-label,
    html.admin-sidebar-collapsed-pref .admin-sidebar-brand,
    html.admin-sidebar-collapsed-pref .admin-sidebar-close {
        display: none;
    }
}

/* Mobil/Tablet: Sidebar wird zum Off-Canvas-Menü mit Hamburger-Button */
@media (max-width: 991.98px) {
    .admin-sidebar {
        position: fixed;
        top: 0;
        left: 0;
        z-index: 1050;
        width: 280px;
        max-width: 85vw;
        height: 100vh;
        transform: translateX(-100%);
        box-shadow: 8px 0 30px rgba(0, 0, 0, 0.25);
    }
    .admin-shell.admin-sidebar-mobile-open .admin-sidebar {
        transform: translateX(0);
    }
    .admin-shell.admin-sidebar-mobile-open .admin-sidebar-backdrop {
        display: block;
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 1040;
    }
    .admin-content {
        padding: 1.25rem;
        width: 100%;
    }
}
body.admin-scroll-lock {
    overflow: hidden;
}

@media (max-width: 767.98px) {
    .hero { padding: 3.5rem 0 4rem; }
    .section { padding-top: 3rem; padding-bottom: 3rem; }
}

/* ─── Galerie-Lightbox: Bootstrap-Carousel-artige Pfeil-Navigation ────── */
.gallery-modal-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
    width: 3rem;
    height: 3rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.35);
    border: none;
    border-radius: 50%;
    color: #fff;
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    transition: background-color 0.15s ease-in-out;
}
.gallery-modal-nav:hover,
.gallery-modal-nav:focus {
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
}
.gallery-modal-prev {
    left: 0.75rem;
}
.gallery-modal-next {
    right: 0.75rem;
}
@media (max-width: 575.98px) {
    .gallery-modal-nav {
        width: 2.25rem;
        height: 2.25rem;
        font-size: 1.1rem;
    }
}
#galleryModal .modal-dialog {
    max-height: 90vh;
    display: flex;
    align-items: center;
}
#galleryModal .modal-content {
    max-height: 90vh;
}
#galleryModal .modal-body {
    display: flex;
    align-items: center;
    justify-content: center;
    max-height: 90vh;
    overflow: hidden;
}
#galleryModalImage {
    max-width: 100%;
    max-height: calc(90vh - 3rem);
    width: auto;
    height: auto;
    object-fit: contain;
}

/* ─── Sub-Navigation (z.B. Organisation-Unterseiten, Galerie-Jahre) ────── */
.subnav-fakos {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--fakos-grey-light);
}
.subnav-fakos-link {
    display: inline-block;
    padding: 0.4rem 1rem;
    border-radius: 999px;
    background: var(--fakos-grey-light);
    color: var(--fakos-dark, #212529);
    font-weight: 600;
    font-size: 0.9rem;
    text-decoration: none;
    transition: background 0.15s ease, color 0.15s ease;
}
.subnav-fakos-link:hover {
    background: var(--fakos-gold);
    color: #212529;
}
.subnav-fakos-link.active {
    background: var(--fakos-gold);
    color: #212529;
}

/* ─── Organisation Teaser-Karten ────────────────────────────────────────── */
.teaser-fakos {
    display: flex;
    flex-direction: column;
    padding: 1.75rem;
    text-decoration: none;
}
.teaser-fakos h3 {
    color: var(--fakos-dark, #212529);
    font-weight: 800;
    margin-bottom: 0.5rem;
}
.teaser-fakos p {
    color: var(--fakos-grey);
    margin-bottom: 1rem;
    flex-grow: 1;
}
.teaser-fakos .teaser-fakos-link {
    color: var(--fakos-gold-dark);
    font-weight: 700;
}

/* ─── Captcha (Formulare) ────────────────────────────────────────────────── */
.captcha-fakos-image {
    border: 1px solid var(--fakos-grey-light);
    border-radius: 0.375rem;
    background: #f4f4f5;
}
