/* ==========================================================================
   Technothek Hub – Design-System
   Technische, sachliche Bildsprache: Platinen-Grün als Primärfarbe, Kupfer als
   Akzent, dunkles Tannengrün als Grundton, klare Struktur, datenblattartige Darstellung. Baut auf
   Bootstrap 5.3 CSS-Variablen auf (kein Rebuild/Sass nötig).
   ========================================================================== */

:root {
    /* Platinen-Grün als Bootstrap-Primary (Elektronik/Bausätze, bewusst kein VDI-/VDE-Blau) */
    --bs-primary: #1a6b45;
    --bs-primary-rgb: 26, 107, 69;
    --bs-primary-text-emphasis: #0f3d27;
    --bs-primary-bg-subtle: #dcefe4;
    --bs-primary-border-subtle: #a6d2b8;

    --bs-link-color: #1a6b45;
    --bs-link-color-rgb: 26, 107, 69;
    --bs-link-hover-color: #0f3d27;
    --bs-link-hover-color-rgb: 15, 61, 39;

    /* Leicht grünliche Neutraltöne statt Bootstrap-Standardgrau */
    --th-navy: #10231b;
    --th-navy-2: #183427;
    --th-ink: #1b2a23;
    --th-muted: #55695e;
    --th-surface: #f3f8f5;
    --th-border: #d7e3dc;
    --th-accent: #c7811f;

    /* Hinweisboxen (alert-info) in Kupfer-Tönen statt Bootstrap-Cyan */
    --bs-info-text-emphasis: #5a3a08;
    --bs-info-bg-subtle: #f8ecd6;
    --bs-info-border-subtle: #e6c98f;

    --bs-body-bg: #ffffff;
    --bs-body-color: var(--th-ink);
    --bs-secondary-color: var(--th-muted);
    --bs-border-color: var(--th-border);

    --th-font-mono: ui-monospace, 'SFMono-Regular', Menlo, Consolas, 'Liberation Mono', monospace;
}

body {
    -webkit-font-smoothing: antialiased;
}

/* -- Technische Textbausteine -------------------------------------------- */

.th-eyebrow {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.09em;
    text-transform: uppercase;
    color: var(--bs-primary);
}

.th-mono {
    font-family: var(--th-font-mono);
    font-variant-numeric: tabular-nums;
}

/* -- Utility-Leiste + Hauptnavigation ------------------------------------- */

.th-utility-bar {
    background: var(--th-navy);
    color: #cfe6da;
    font-size: 0.8125rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.th-utility-bar a {
    color: #cfe6da;
    text-decoration: none;
}

.th-utility-bar a:hover {
    color: #ffffff;
    text-decoration: underline;
}

.th-navbar {
    background: var(--th-navy-2);
    border-bottom: 3px solid var(--bs-primary);
}

.th-navbar .navbar-brand {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-weight: 700;
    letter-spacing: 0.01em;
}

.th-brand-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.1rem;
    height: 2.1rem;
    background: var(--bs-primary);
    color: #fff;
    font-family: var(--th-font-mono);
    font-weight: 700;
    font-size: 0.95rem;
    border-radius: 0.25rem;
    flex-shrink: 0;
}

.th-brand-text {
    display: flex;
    flex-direction: column;
    line-height: 1.15;
}

.th-brand-text small {
    font-size: 0.6875rem;
    font-weight: 500;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #9dbfad;
}

.th-navbar .nav-link {
    color: #cfe6da;
    font-size: 0.925rem;
    font-weight: 500;
}

.th-navbar .nav-link:hover,
.th-navbar .nav-link.active {
    color: #ffffff;
}

/* -- Hero ------------------------------------------------------------------ */

.th-hero {
    background: linear-gradient(135deg, var(--th-navy) 0%, var(--th-navy-2) 55%, var(--bs-primary) 130%);
    color: #eef6f1;
    border-radius: 0.5rem;
    position: relative;
    overflow: hidden;
}

.th-hero::after {
    content: '';
    position: absolute;
    inset: 0;
    background-image: linear-gradient(rgba(255, 255, 255, 0.06) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, 0.06) 1px, transparent 1px);
    background-size: 28px 28px;
    pointer-events: none;
}

.th-hero .th-eyebrow {
    color: #9ad6b4;
}

.th-hero-title {
    max-width: 42rem;
}

.th-hero-lead {
    max-width: 38rem;
    color: #cfe6da;
}

.th-surface-section,
.th-content-header {
    background: var(--th-surface);
}

.th-content-header {
    border-bottom: 1px solid var(--th-border);
}

/* -- Karten / Panels -------------------------------------------------------- */

.th-card {
    border: 1px solid var(--th-border);
    border-radius: 0.375rem;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

a.th-card {
    display: block;
    text-decoration: none;
    color: inherit;
}

a.th-card:hover {
    border-color: var(--bs-primary);
    box-shadow: 0 0.25rem 0.75rem rgba(16, 35, 27, 0.08);
}

.th-card-accent {
    border-top: 3px solid var(--bs-primary);
}

.th-card-image-placeholder {
    height: 100px;
    color: var(--bs-primary);
    background: var(--th-surface);
    border-radius: 0.375rem 0.375rem 0 0;
}

.th-inventory-card-image {
    height: 140px;
    object-fit: cover;
    border-radius: 0.375rem 0.375rem 0 0;
}

.th-post-card-image {
    height: 160px;
    object-fit: cover;
    border-radius: 0.375rem 0.375rem 0 0;
}

/* Anreißer in Termin- und Beitragskarten: höchstens drei Zeilen, Karten bleiben gleich hoch (W-09). */
.th-teaser {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* -- Mediathek -------------------------------------------------------------- */
.th-media-thumb {
    aspect-ratio: 4 / 3;
    width: 100%;
    object-fit: cover;
    border-radius: 0.375rem 0.375rem 0 0;
}

.th-media-thumb-placeholder {
    aspect-ratio: 4 / 3;
    color: var(--bs-primary);
    background: var(--th-surface);
    border-radius: 0.375rem 0.375rem 0 0;
}

.th-media-preview {
    max-height: 320px;
}

/* Virtuelle Ordner: Baum neben der Dateiliste, Auswahl-Checkbox auf der Karte */
.th-folder-tree .th-folder-tree {
    padding-left: 1rem;
}

.th-folder-tree a {
    display: flex;
    gap: 0.4rem;
    align-items: center;
    padding: 0.15rem 0;
    text-decoration: none;
}

.th-folder-tree a[aria-current] {
    font-weight: 600;
}

.th-folder-tree svg {
    flex-shrink: 0;
    color: var(--bs-primary);
}

.th-media-select {
    position: absolute;
    top: 0.5rem;
    left: 0.5rem;
    padding: 0.15rem 0.35rem;
    background: var(--bs-body-bg);
    border-radius: 0.25rem;
}

/* Download-Auswahl im Blog-/Terminformular */
.th-scroll-list {
    max-height: 16rem;
    overflow-y: auto;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--bs-border-color);
    border-radius: 0.375rem;
}

/* Auswahldialog „Aus der Mediathek einfügen“ (richtext_controller.js) */
.th-media-dialog {
    width: min(52rem, calc(100% - 2rem));
    max-height: calc(100% - 2rem);
    padding: 1.25rem;
    border: 1px solid var(--bs-border-color);
    border-radius: 0.5rem;
}

.th-media-dialog::backdrop {
    background: rgb(16 35 27 / 0.5);
}

/* Im Text eingebettete Bilder (Blog, Termine) */
.th-media-figure img {
    max-width: 100%;
    height: auto;
}

/* Vergrößerbare Bilder (lightbox_controller.js) */
.th-lightbox-trigger {
    display: inline-block;
    cursor: zoom-in;
    border-radius: var(--bs-border-radius);
}

.th-lightbox-trigger:focus-visible {
    outline: 3px solid var(--th-accent);
    outline-offset: 3px;
}

.th-lightbox {
    max-width: min(96vw, 1400px);
    max-height: 96vh;
    padding: 0.75rem;
    border: 0;
    border-radius: var(--bs-border-radius-lg);
    background: var(--th-navy);
    color: #fff;
}

.th-lightbox::backdrop {
    background: rgb(16 35 27 / 85%);
}

.th-lightbox-bar {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 0.5rem;
}

.th-lightbox-figure {
    margin: 0;
}

.th-lightbox-figure img {
    display: block;
    max-width: 100%;
    max-height: calc(96vh - 8rem);
    width: auto;
    height: auto;
    margin: 0 auto;
}

.th-lightbox-caption {
    margin-top: 0.5rem;
    max-width: 60rem;
}

/* -- Datenblatt (Standort-Detail) -------------------------------------------- */

.th-datasheet dt {
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--th-muted);
    margin-top: 0.85rem;
}

.th-datasheet dt:first-child {
    margin-top: 0;
}

.th-datasheet dd {
    margin-bottom: 0;
    color: var(--th-ink);
}

.th-icon-row {
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
}

.th-icon-row svg {
    flex-shrink: 0;
    margin-top: 0.2rem;
    color: var(--bs-primary);
}

.th-hours-table th,
.th-hours-table td {
    padding: 0.3rem 0.6rem;
    font-size: 0.9rem;
}

.th-hours-table td.th-mono {
    color: var(--th-ink);
}

.th-hours-table tr.th-closed td {
    color: var(--th-muted);
}

/* -- Status-Badges ------------------------------------------------------- */

.th-status-dot {
    display: inline-block;
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 50%;
    margin-right: 0.4rem;
}

.th-status-dot-success {
    background: var(--bs-success);
}

/* -- Footer --------------------------------------------------------------- */

.th-footer {
    background: var(--th-navy);
    color: #b9d3c4;
}

.th-footer a {
    color: #dcefe4;
}

.th-footer a:hover {
    color: #ffffff;
}

.th-footer h2,
.th-footer h3 {
    color: #ffffff;
}

.th-footer .th-footer-heading {
    color: #9ad6b4;
}

.th-footer-separator {
    border-color: rgba(255, 255, 255, 0.12) !important;
}

/* -- Sonstiges -------------------------------------------------------------- */

trix-editor.trix-content {
    min-height: 16rem;
}

.th-brand-mark-lg {
    width: 3.5rem;
    height: 3.5rem;
    font-size: 1.1rem;
}

.th-location-logo {
    width: 64px;
    height: 64px;
    object-fit: cover;
}

.th-location-map {
    height: 420px;
}

.th-meta-eyebrow {
    font-size: 0.7rem;
}

.th-copy-medium {
    max-width: 40rem;
}

.th-article {
    max-width: 46rem;
}

.th-admin-preview-image {
    max-height: 160px;
}

/* Inventarformular: buchspezifische Felder bei Medienart „Buch“ hervorheben
   (media_type_controller.js schaltet die Klasse). */
.th-field-highlight {
    border-left: 3px solid var(--bs-primary);
    padding-left: 0.75rem;
}

/* Symfony markiert Pflichtfelder mit class="required", zeigt das aber ohne
   eigenes CSS nicht sichtbar an - Sternchen ergänzt für sehende Nutzende,
   die native required-Validierung erreicht Screenreader-Nutzende ohnehin. */
.form-label.required::after {
    content: ' *';
    color: var(--bs-danger);
}

/* Kompakte Öffnungszeiten-Eingabe: ein Tag pro Zeile statt pro Feld. */
.opening-hours-day-label {
    min-width: 8rem;
    flex-shrink: 0;
}

.opening-hours-time {
    width: 6.5rem;
}

/* -- Kontaktformular: Honeypot-Feld für Menschen unsichtbar ---------------- */

.th-hp {
    position: absolute;
    left: -10000px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

/* -- Druckansicht (z. B. Wunschliste) --------------------------------------
   Seitenkopf, Fußzeile, Verwaltungsnavigation und Bedienelemente entfallen,
   der Inhalt nutzt die volle Breite. Einzelne Elemente blenden sich mit
   .th-print-hide aus; Bootstraps .d-print-* bleiben zusätzlich nutzbar. */

@media print {
    .th-utility-bar,
    .th-navbar,
    .th-footer,
    .th-admin-nav,
    .th-print-hide {
        display: none !important;
    }

    .th-admin-content {
        flex: 0 0 100%;
        max-width: 100%;
    }

    body {
        background: #fff;
        color: #000;
    }

    .table-responsive {
        overflow: visible;
    }

    thead {
        display: table-header-group;
    }

    tr,
    section h2 {
        break-inside: avoid;
    }

    a {
        color: inherit;
        text-decoration: none;
    }

    .badge {
        border: 1px solid #000;
        color: #000 !important;
        background: transparent !important;
    }
}
