/* MLM Gallery - Hauptstyles */

/* Bootstrap wird über app.js geladen, hier eigene Anpassungen */

/* CSS Custom Properties für Bootstrap Override */
/* WICHTIG: Diese Variablen sind die SINGLE SOURCE OF TRUTH für alle Farben!
   Bei Änderungen müssen die Variablen auch in templates/pdf/base.html.twig
   manuell aktualisiert werden (wkhtmltopdf kann keine externen CSS-Dateien importieren).
   Siehe templates/pdf/README.md für Details. */
:root {
    /* === Neue Branding-Farben === */
    --blue-700: #1E3A5F;      /* Akzent-Blau (Primary) */
    --neutral-050: #FFFFFF;   /* Weiß */
    --neutral-100: #EAE6DF;   /* Off-White / Beige hell */
    --neutral-300: #CFCBCC;   /* Warmes Mittelgrau */
    --neutral-900: #2C2B29;   /* Sehr dunkles, warmes Grau */

    /* RGB-Werte für Transparenzen */
    --blue-700-rgb: 30, 58, 95;
    --neutral-050-rgb: 255, 255, 255;
    --neutral-100-rgb: 234, 230, 223;
    --neutral-300-rgb: 207, 203, 204;
    --neutral-900-rgb: 44, 43, 41;

    /* Bootstrap Variablen überschreiben */
    --bs-primary: #1E3A5F;
    --bs-primary-rgb: 30, 58, 95;
    --bs-secondary: #CFCBCC;
    --bs-secondary-rgb: 207, 203, 204;
    --bs-success: #28a745;
    --bs-danger: #dc3545;
    --bs-warning: #ffc107;
    --bs-info: #17a2b8;
    --bs-light: #EAE6DF;
    --bs-dark: #2C2B29;

    /* Semantische Farben */
    --mlm-primary: var(--blue-700);
    --mlm-secondary: var(--neutral-300);
    --mlm-accent: #23466f;
    --mlm-bg: var(--neutral-050);
    --mlm-surface: var(--neutral-100);
    --mlm-text: var(--neutral-900);
    --mlm-text-muted: #4A4947;
    --mlm-border: var(--neutral-300);

    /* Schatten und Abstände */
    --mlm-shadow-sm: 0 2px 4px rgba(var(--neutral-900-rgb), 0.1);
    --mlm-shadow: 0 4px 15px rgba(var(--blue-700-rgb), 0.15);
    --mlm-shadow-lg: 0 8px 25px rgba(var(--neutral-900-rgb), 0.15);
    --mlm-border-radius: 0.5rem;
    --mlm-border-radius-lg: 0.75rem;

    /* Typography */
    --mlm-font-family: InterVariable, Inter, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

    /* Barrierefreiheit - WCAG 2.1 AA konform */
    --focus-ring: 0 0 0 0.25rem rgba(var(--blue-700-rgb), 0.5);
    --focus-ring-dark: 0 0 0 3px rgba(255, 255, 255, 0.5);
}

/* ===== BARRIEREFREIHEIT (WCAG 2.1 AA) ===== */

/* Fokus-Styles für alle interaktiven Elemente */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible,
.btn:focus-visible {
    outline: 3px solid var(--mlm-primary);
    outline-offset: 2px;
    box-shadow: var(--focus-ring);
}

/* Fokus-Styles für dunkle Hintergründe */
.navbar a:focus-visible,
.bg-dark a:focus-visible,
.bg-dark button:focus-visible {
    outline: 3px solid #ffffff;
    outline-offset: 2px;
    box-shadow: var(--focus-ring-dark);
}

/* Fokus für Bilder mit Interaktion */
img[tabindex]:focus-visible,
img[role="button"]:focus-visible {
    outline: 3px solid var(--mlm-primary);
    outline-offset: 4px;
    box-shadow: 0 0 0 4px rgba(var(--blue-700-rgb), 0.3);
}

/* Mindestgröße für Touch-Targets (44x44px WCAG 2.1 Level AAA, 24x24px Level AA) */
.btn,
button,
.navbar-toggler {
    min-height: 44px;
    min-width: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* Navigation Links - Touch-Target aber kein Flex-Layout */
a.nav-link {
    min-height: 44px;
    padding: 0.5rem 1rem;
    display: inline-block;
}

/* Icons in Navigation behalten ihren Abstand */
.nav-link i {
    margin-right: 0.5rem;
}

/* Ausnahmen für Text-Links im Fließtext */
p a,
li a,
.text-content a {
    min-height: unset;
    min-width: unset;
    display: inline;
}

/* Verbesserte Kontraste für Links - ABER nicht in Navigation/Footer/Gallery */
main a:not(.btn):not(.nav-link):not(.gallery-item-link),
.text-content a {
    text-decoration: underline;
    text-underline-offset: 2px;
}

main a:not(.btn):not(.nav-link):not(.gallery-item-link):hover,
.text-content a:hover {
    text-decoration-thickness: 2px;
}

/* Footer Links ohne Unterstreichung */
footer a {
    text-decoration: none;
}

footer a:hover {
    text-decoration: underline;
}

/* Bootstrap Override Styles */
.btn-primary {
    --bs-btn-bg: var(--mlm-primary);
    --bs-btn-border-color: var(--mlm-primary);
    --bs-btn-hover-bg: var(--mlm-secondary);
    --bs-btn-hover-border-color: var(--mlm-secondary);
    --bs-btn-active-bg: var(--mlm-secondary);
    --bs-btn-active-border-color: var(--mlm-secondary);
    --bs-btn-focus-shadow-rgb: var(--bs-primary-rgb);
}

.btn-secondary {
    --bs-btn-bg: var(--mlm-secondary);
    --bs-btn-border-color: var(--mlm-secondary);
}

/* Checkbox & Radio Buttons - Primary Color */
.form-check-input:checked {
    background-color: var(--mlm-primary) !important;
    border-color: var(--mlm-primary) !important;
}

.form-check-input:focus {
    border-color: var(--mlm-primary);
    box-shadow: 0 0 0 0.25rem rgba(var(--blue-700-rgb), 0.25);
}

/* Basis-Layout */
body {
    font-family: var(--mlm-font-family);
    line-height: 1.6;
    color: var(--mlm-text);
    background-color: var(--neutral-100);
    font-optical-sizing: auto;
}

/* Skip-Link für Screenreader */
.skip-link {
    position: absolute;
    top: -40px;
    left: 6px;
    background: var(--mlm-primary);
    color: white;
    padding: 8px;
    text-decoration: none;
    z-index: 1000;
}

.skip-link:focus {
    top: 6px;
}

/* Navigation Enhancements */
.navbar {
    box-shadow: 0 8px 24px rgba(var(--blue-700-rgb), 0.4), 0 4px 12px rgba(var(--neutral-900-rgb), 0.2);
    padding: 0.75rem 0;
    position: relative;
    z-index: 10;
}

.navbar .nav-link {
    position: relative;
    transition: all 0.3s ease;
    border-radius: 0.375rem;
    margin: 0 0.25rem;
}

.navbar .nav-link:hover {
    background-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

.navbar .nav-link::after {
    content: '';
    position: absolute;
    bottom: 8px;
    left: 50%;
    transform: translateX(-50%) scaleX(0);
    width: 80%;
    height: 2px;
    background: white;
    transition: transform 0.3s ease;
}

.navbar .nav-link:hover::after {
    transform: translateX(-50%) scaleX(1);
}

.navbar .nav-link i {
    display: inline-block;
    transition: transform 0.3s ease;
}

.navbar .nav-link:hover i {
    transform: scale(1.4);
}

.navbar-brand {
    transition: transform 0.3s ease;
}

.navbar-brand:hover {
    transform: scale(1.05);
}

.navbar-toggler {
    border: 2px solid var(--neutral-100);
    transition: all 0.3s ease;
}

.navbar-toggler:hover {
    border-color: white;
    background-color: rgba(234, 230, 223, 0.2);
}

/* Navbar-Toggler Icon - Off-White für bessere Sichtbarkeit */
.navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='%23EAE6DF' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e") !important;
}

/* Gallery-spezifische Styles */
.gallery-item {
    transition: transform 0.2s ease-in-out;
}

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

.gallery-item img {
    width: 100%;
    height: auto;
    border-radius: 0.375rem;
}

/* Admin-Bereich */
.admin-sidebar {
    min-height: 100vh;
    background-color: var(--bs-dark);
}

.admin-content {
    padding: 2rem;
}

.e-mail:before {
    content: attr(data-website) "\0040" attr(data-user);
    unicode-bidi: bidi-override;
    direction: rtl;
}

/* Flash Message Close Button - Hidden (auto-dismiss after 5s) */
.alert-dismissible .btn-close {
    display: none;
}

/* ===== HERO HEADER - 4-SEGMENT-BANNER ===== */

/* Höhe für Header-Varianten - kompakter */
.strip-hero {
    --h: 180px;
}

@media (min-width: 1200px) {
    .strip-hero {
        --h: 200px;
    }
}

@media (min-width: 2560px) {
    .strip-hero {
        --h: 220px;
    }
}

/* Layout: 4 Segmente nebeneinander */
.strip-hero {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr 1fr;
    height: var(--h);
    position: relative;
    background: var(--neutral-900);
    overflow: hidden;
}

/* Jedes Segment zeigt sein Bild vollständig */
.seg {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    margin: 0;
}

.seg img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
    filter: grayscale(100%);
}

/* Sanfte Übergänge zwischen Segmenten (V-Blend) - breiter und weicher */
.seg::after {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    right: -1px;
    width: 80px;
    pointer-events: none;
    background: linear-gradient(to right, rgba(44, 43, 41, 0), rgba(44, 43, 41, 0.4));
    mix-blend-mode: multiply;
}

.seg:last-child::after {
    display: none;
}

/* Fokuspunkte pro Motiv (anpassbar wenn Bilder vorhanden) */
.seg--sew img {
    object-position: 30% 40%;
}

.seg--print img {
    object-position: 40% 60%;
}

.seg--author img {
    object-position: 60% 60%;
}

.seg--code img {
    object-position: 70% 50%;
}

/* Dunkler Top-Gradient für Navbar-Lesbarkeit */
.top-grad {
    position: absolute;
    inset: 0 0 auto 0;
    height: 120px;
    background: linear-gradient(to bottom,
                rgba(44, 43, 41, 0.95) 0%,
                rgba(44, 43, 41, 0.8) 40%,
                rgba(44, 43, 41, 0.4) 70%,
                rgba(44, 43, 41, 0) 100%);
    pointer-events: none;
    z-index: 1;
}

/* Navbar über dem Banner */
.navbar-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: 10;
    background: transparent !important;
    box-shadow: none !important;
}

/* Logo und Slogan zentrieren */
.navbar-overlay .navbar-brand {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    top: 55%;
    margin: 0;
    gap: 0.5rem;
}

/* Navbar-Links bleiben oben */
.navbar-overlay .navbar-nav {
    position: relative;
    z-index: 20;
}

/* Text-Schatten für bessere Lesbarkeit */
.navbar-overlay .navbar-brand,
.navbar-overlay .nav-link {
    text-shadow: 0 6px 12px rgba(0, 0, 0, 1),
                 0 4px 8px rgba(0, 0, 0, 0.9),
                 0 2px 4px rgba(0, 0, 0, 0.8),
                 0 1px 2px rgba(0, 0, 0, 0.7);
}

/* Slogan unter dem Logo */
.brand-slogan {
    font-size: 1.4rem;
    font-weight: 400;
    font-style: italic;
    color: white;
    text-shadow: 0 6px 12px rgba(0, 0, 0, 1),
                 0 4px 8px rgba(0, 0, 0, 0.9),
                 0 2px 4px rgba(0, 0, 0, 0.8),
                 0 1px 2px rgba(0, 0, 0, 0.7);
    line-height: 1.3;
}

.brand-logo {
    height: 90px;
    filter: drop-shadow(0 6px 12px rgba(0, 0, 0, 1))
            drop-shadow(0 4px 8px rgba(0, 0, 0, 0.9))
            drop-shadow(0 2px 4px rgba(0, 0, 0, 0.8));
}

/* Mobile: Segmente untereinander */
@media (max-width: 767px) {
    .strip-hero {
        grid-template-columns: 1fr;
        grid-template-rows: repeat(4, 1fr);
        --h: 400px;
    }

    .seg::after {
        display: none;
    }
}

/* ===== GLOBALE BUTTON-FIXES ===== */
.btn,
button:not(.navbar-toggler):not(.admin-nav-group-toggle):not(.admin-nav-subgroup-toggle),
a.btn {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 0.5rem;
}

/* ===== BOOTSTRAP COLOR OVERRIDES ===== */
/* Breadcrumb Links */
.breadcrumb-item a {
    color: var(--mlm-primary);
    text-decoration: none;
}

.breadcrumb-item a:hover {
    color: var(--mlm-accent);
    text-decoration: underline;
}

.breadcrumb-item.active {
    color: var(--mlm-text-muted);
}

/* Primary Buttons - komplettes Override */
.btn-primary {
    --bs-btn-bg: var(--mlm-primary);
    --bs-btn-border-color: var(--mlm-primary);
    --bs-btn-hover-bg: var(--mlm-accent);
    --bs-btn-hover-border-color: var(--mlm-accent);
    --bs-btn-active-bg: var(--mlm-accent);
    --bs-btn-active-border-color: var(--mlm-accent);
    --bs-btn-disabled-bg: var(--mlm-primary);
    --bs-btn-disabled-border-color: var(--mlm-primary);
    background-color: var(--mlm-primary) !important;
    border-color: var(--mlm-primary) !important;
}

.btn-primary:hover,
.btn-primary:focus {
    background-color: var(--mlm-accent) !important;
    border-color: var(--mlm-accent) !important;
}

.btn-outline-primary {
    --bs-btn-color: var(--mlm-primary);
    --bs-btn-border-color: var(--mlm-primary);
    --bs-btn-hover-bg: var(--mlm-primary);
    --bs-btn-hover-border-color: var(--mlm-primary);
    --bs-btn-active-bg: var(--mlm-primary);
    --bs-btn-active-border-color: var(--mlm-primary);
    color: var(--mlm-primary) !important;
    border-color: var(--mlm-primary) !important;
}

.btn-outline-primary:hover,
.btn-outline-primary:focus {
    background-color: var(--mlm-primary) !important;
    border-color: var(--mlm-primary) !important;
    color: white !important;
}

/* Badge Primary */
.badge.bg-primary {
    background-color: var(--mlm-primary) !important;
}

/* Links allgemein */
a:not(.btn):not(.nav-link):not(.navbar-brand):not(.gallery-item-link):not(.admin-nav-link):not(.admin-nav-group-toggle) {
    color: var(--mlm-primary);
}

a:not(.btn):not(.nav-link):not(.navbar-brand):not(.gallery-item-link):not(.admin-nav-link):not(.admin-nav-group-toggle):hover {
    color: var(--mlm-accent);
}

/* Pagination */
.pagination .page-link {
    color: var(--mlm-primary);
}

.pagination .page-link:hover {
    color: var(--mlm-accent);
    background-color: var(--mlm-surface);
    border-color: var(--mlm-primary);
}

.pagination .page-item.active .page-link {
    background-color: var(--mlm-primary) !important;
    border-color: var(--mlm-primary) !important;
    color: white;
}

.pagination .page-item.disabled .page-link {
    color: var(--mlm-text-muted);
}

/* Recipient Autocomplete */
/* Recipient Autocomplete Styles */

.autocomplete-wrapper {
    position: relative;
}

.autocomplete-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 1000;
    display: none;
    max-height: 300px;
    overflow-y: auto;
    margin-top: 2px;
    background-color: #fff;
    border: 1px solid #ced4da;
    border-radius: 0.375rem;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

.autocomplete-dropdown.show {
    display: block;
}

.autocomplete-item {
    padding: 0.5rem 0.75rem;
    cursor: pointer;
    border-bottom: 1px solid #e9ecef;
    transition: background-color 0.15s ease-in-out;
}

.autocomplete-item:last-child {
    border-bottom: none;
}

.autocomplete-item:hover,
.autocomplete-item.active {
    background-color: #f8f9fa;
}

.autocomplete-item strong {
    display: block;
    margin-bottom: 0.25rem;
}

.autocomplete-item small {
    display: block;
    font-size: 0.875rem;
}

.autocomplete-item .badge {
    font-size: 0.75rem;
    padding: 0.25em 0.5em;
}

/* Selected recipient display */
.recipient-display {
    margin-top: 0.5rem;
    padding: 0.5rem;
    background-color: #e7f3ff;
    border: 1px solid #b3d9ff;
    border-radius: 0.375rem;
    font-size: 0.875rem;
}

.recipient-display.d-none {
    display: none;
}
