/* Darstellung der Quick-Reference-Kapitel (Funk, Alphabet, Betonnung, KVR,
   Lichter, Knoten).

   Die Kapitel selbst stehen als Partials unter includes/reference/ und werden
   von zwei Ansichten gerendert: der geschuetzten Quick-Reference
   (pages/reference.php) und den oeffentlichen Wissensseiten
   (pages/wissen.php, /wissen/<slug>). Diese Datei traegt deshalb genau das
   CSS, das beide brauchen — das Seitenlayout der Quick-Reference (Raster,
   Sprungnavigation, Suchfeld) bleibt in pages/reference.php.

   Farben kommen ausschliesslich aus den CSS-Variablen von style.css, damit
   der Nachtmodus in beiden Ansichten greift. */

/* Sprungziel innerhalb des Funk-Kapitels: MAYDAY, SÉCURITÉ und PAN-PAN sind
   ueber ihre eigene ID anspringbar. */
.radio-priority[id] {
    scroll-margin-top: 1.25rem;
}

.radio-priority[id]:target {
    box-shadow: 0 0 0 3px rgba(42, 111, 151, 0.16), var(--shadow-soft);
}

.alphabet-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.5rem;
}

.alphabet-item {
    display: grid;
    grid-template-columns: 2.1rem minmax(0, 1fr);
    align-items: center;
    gap: 0.6rem;
    background-color: var(--bg-main);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-small);
    padding: 0.65rem 0.75rem;
    min-height: 48px;
}

.alphabet-letter {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.1rem;
    height: 2.1rem;
    border-radius: 8px;
    background-color: rgba(42, 111, 151, 0.1);
    color: var(--primary-brand);
    font-weight: 800;
    font-size: 1rem;
    line-height: 1;
}

.alphabet-word {
    color: var(--text-primary);
    font-family: monospace;
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.2;
    overflow-wrap: anywhere;
}

.reference-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1rem;
}

.reference-panel {
    background-color: var(--bg-main);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 15px;
}

.reference-panel h3 {
    color: var(--primary-brand);
    font-size: 1.05rem;
    margin: 0 0 0.6rem;
}

.radio-priority {
    background-color: var(--bg-main);
    border: 1px solid var(--border-color);
    border-left-width: 5px;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 1rem;
}

.radio-priority h3 {
    font-size: 1.12rem;
    margin: 0 0 0.6rem;
}

.radio-priority-danger {
    border-left-color: var(--status-error-text);
}

.radio-priority-danger h3 {
    color: var(--status-error-text);
}

.radio-priority-warning {
    border-left-color: var(--status-warning-solid);
}

.radio-priority-warning h3 {
    color: var(--status-warning-text);
}

.radio-priority-info {
    border-left-color: var(--status-info-text);
}

.radio-priority-info h3 {
    color: var(--status-info-text);
}

.radio-script {
    font-family: monospace;
    font-size: 0.98rem;
    line-height: 1.55;
}

.channel-list {
    display: grid;
    gap: 0.55rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.channel-list li {
    display: grid;
    grid-template-columns: 4.8rem minmax(0, 1fr);
    gap: 0.65rem;
    align-items: start;
    color: var(--text-muted);
    font-size: 0.94rem;
    line-height: 1.4;
}

.channel-list strong {
    color: var(--text-primary);
}

.channel-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 2rem;
    border-radius: 8px;
    background-color: rgba(42, 111, 151, 0.1);
    color: var(--primary-brand);
    font-weight: 800;
    font-size: 0.92rem;
    padding: 0 0.35rem;
    text-align: center;
    white-space: nowrap;
}

.seamark-copy {
    color: var(--text-muted);
    font-size: 0.9rem;
    line-height: 1.5;
    margin: 0 0 15px;
}

.seamark-heading {
    color: var(--text-primary);
    font-size: 1.1rem;
    margin: 24px 0 10px;
}

.seamark-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 12px;
    margin-bottom: 22px;
}

.seamark-card {
    background: var(--bg-main);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    display: grid;
    gap: 0.7rem;
    padding: 14px 12px;
    text-align: center;
}

.seamark-card strong {
    color: var(--text-primary);
    display: block;
    font-size: 0.98rem;
    line-height: 1.2;
}

.seamark-visual {
    align-items: center;
    aspect-ratio: 1.25 / 1;
    background: linear-gradient(180deg, rgba(224, 242, 254, 0.72) 0%, rgba(255, 255, 255, 0.5) 55%, rgba(14, 165, 233, 0.12) 100%);
    border: 1px solid rgba(42, 111, 151, 0.14);
    border-radius: 8px;
    display: flex;
    justify-content: center;
    min-height: 126px;
    overflow: hidden;
}

.seamark-svg {
    display: block;
    height: 132px;
    max-width: 100%;
    width: 140px;
}

.seamark-meta {
    color: var(--text-muted);
    font-size: 0.84rem;
    line-height: 1.45;
}

.seamark-light-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px;
    margin-bottom: 0;
}

.light-card {
    align-items: center;
    background: var(--bg-main);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    display: grid;
    gap: 0.75rem;
    grid-template-columns: 80px minmax(0, 1fr);
    padding: 12px;
}

/* Lichterfuehrung und Tonnen behalten ihre vorgeschriebenen Farben:
   Sie bilden die reale Kennung ab und duerfen sich mit dem Theme nicht
   veraendern. Der dunkle Grund stellt die Nacht dar. */
.light-pattern {
    align-items: center;
    background: #0f172a;
    border-radius: 8px;
    display: flex;
    gap: 5px;
    height: 56px;
    justify-content: center;
    overflow: hidden;
    padding: 0 8px;
}

.light-dot {
    background: var(--light-color, #fff);
    border-radius: 999px;
    box-shadow: 0 0 12px var(--light-color, #fff), 0 0 24px var(--light-color, #fff);
    height: 12px;
    width: 12px;
}

.light-dot.long {
    border-radius: 999px;
    width: 28px;
}

.light-gap {
    background: rgba(148, 163, 184, 0.45);
    border-radius: 999px;
    height: 4px;
    width: 12px;
}

.light-card strong {
    color: var(--text-primary);
    display: block;
    font-size: 0.94rem;
    line-height: 1.25;
    margin-bottom: 0.2rem;
}

.light-card span {
    color: var(--text-muted);
    display: block;
    font-size: 0.84rem;
    line-height: 1.45;
}

.knot-block {
    margin-bottom: 20px;
}

.knot-block:last-child {
    margin-bottom: 0;
}

@media (max-width: 520px) {
    .alphabet-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .alphabet-item {
        grid-template-columns: 1.8rem minmax(0, 1fr);
        gap: 0.5rem;
        padding: 0.55rem 0.6rem;
    }

    .alphabet-letter {
        width: 1.8rem;
        height: 1.8rem;
    }

    .alphabet-word {
        font-size: 0.92rem;
    }

    .seamark-grid,
    .seamark-light-grid {
        grid-template-columns: 1fr;
    }

    .light-card {
        grid-template-columns: 70px minmax(0, 1fr);
    }
}
