/*
 * Pracoviště školy (templates/page-pracoviste.php): map + branch cards.
 * Palette and font follow style.css: red #c8352a/#eb5334, yellow #ffce2e, cream #feefba, text #3a3c46, Anivers headings.
 */

.branchesPage {
    --zus-red: #c8352a;
    --zus-red-light: #eb5334;
    --zus-yellow: #ffce2e;
    --zus-cream: #feefba;
    --zus-cream-light: #fffaea;
    --zus-ink: #3a3c46;
    --zus-muted: #6b6d76;
    --zus-line: #f1dd9a;
    width: 803px;
    font-size: 14px;
    line-height: 1.5;
}

.branchesPage .icon {
    width: 18px;
    height: 18px;
    flex: none;
    fill: currentColor;
}

/* Intro */

.branchesIntro {
    font-size: 15px;
    margin-bottom: 18px;
}

/* Map + chips */

.branchMapCard {
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(58, 60, 70, 0.15);
    overflow: hidden;
    margin-bottom: 28px;
}

.branchMap {
    height: 340px;
    background: var(--zus-cream-light);
}

.branchMapFallback {
    padding: 150px 20px 0;
    text-align: center;
    color: var(--zus-muted);
}

.branchChips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 14px 16px;
    border-top: 4px solid var(--zus-yellow);
    background: var(--zus-cream-light);
}

#content a.branchChip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 5px 14px 5px 5px;
    border-radius: 999px;
    background: #fff;
    border: 1px solid var(--zus-line);
    font-family: 'Anivers-Regular';
    font-size: 16px;
    text-decoration: none;
    color: var(--zus-ink);
    transition: background-color 0.15s, border-color 0.15s;
}

#content a.branchChip:hover,
#content a.branchChip:focus-visible,
#content a.branchChip.isActive {
    background: var(--zus-yellow);
    border-color: var(--zus-yellow);
    outline: none;
}

.branchNo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: var(--zus-red);
    color: #fff;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 13px;
    font-weight: bold;
    flex: none;
}

/* Leaflet markers and popups */

.branchMarker {
    background: none;
    border: 0;
}

.branchMarker .branchNo {
    width: 30px;
    height: 30px;
    border: 3px solid #fff;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
    font-size: 14px;
    transition: transform 0.15s;
}

.branchMarker.isMain .branchNo {
    background: var(--zus-ink);
}

.branchMarker.isActive .branchNo {
    transform: scale(1.25);
    background: var(--zus-red-light);
}

.branchPopup {
    font-family: Arial, Helvetica, sans-serif;
    font-size: 13px;
    color: var(--zus-ink);
}

.branchPopup strong {
    display: block;
    font-family: 'Anivers-Regular';
    font-size: 17px;
    font-weight: normal;
    margin-bottom: 2px;
}

.branchesPage .leaflet-container a.branchPopupLink {
    color: var(--zus-red);
    text-decoration: underline;
}

/* Branch cards */

.branchCard {
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(58, 60, 70, 0.12);
    margin-bottom: 22px;
    overflow: hidden;
    scroll-margin-top: 16px;
    transition: box-shadow 0.3s;
}

.branchCard:target,
.branchCard.isActive {
    box-shadow: 0 0 0 3px var(--zus-yellow), 0 4px 14px rgba(58, 60, 70, 0.2);
}

.branchCardHead {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 20px;
    background: var(--zus-cream);
    border-bottom: 4px solid var(--zus-yellow);
}

.branchCard.isMain .branchCardHead .branchNo {
    background: var(--zus-ink);
}

.branchCardHead h2 {
    flex: 1;
    margin: 0;
    padding: 0;
    font-size: 24px;
    line-height: 1.1;
    color: var(--zus-ink);
}

.branchTag {
    padding: 3px 10px;
    border-radius: 999px;
    background: #fff;
    color: var(--zus-red);
    font-size: 11px;
    font-weight: bold;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.branchCard.isMain .branchTag {
    background: var(--zus-red);
    color: #fff;
}

.branchCardBody {
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: 28px;
    padding: 18px 20px 20px;
}

.branchCardBody h3 {
    margin: 0 0 10px;
    padding: 0;
    font-size: 13px;
    font-family: Arial, Helvetica, sans-serif;
    font-weight: bold;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--zus-red);
}

.branchesPage p.branchLine {
    display: flex;
    gap: 10px;
    padding: 0;
    margin: 0 0 10px;
}

.branchLine .icon {
    margin-top: 1px;
    fill: var(--zus-red);
}

#content .branchLine a {
    text-decoration: none;
    font-weight: bold;
}

#content .branchLine a:hover {
    text-decoration: underline;
}

.branchesPage p.branchNote {
    margin: 4px 0 12px;
    padding: 8px 12px;
    border-left: 4px solid var(--zus-yellow);
    background: var(--zus-cream-light);
    font-size: 13px;
}

.branchesPage p.branchActions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 4px 0 0;
}

#content .branchButton {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    border-radius: 6px;
    border: 2px solid var(--zus-red);
    background: var(--zus-red);
    color: #fff;
    font: bold 13px Arial, Helvetica, sans-serif;
    text-decoration: none;
    cursor: pointer;
    transition: background-color 0.15s, color 0.15s;
}

#content .branchButton:hover,
#content .branchButton:focus-visible {
    background: var(--zus-red-light);
    border-color: var(--zus-red-light);
    outline: none;
}

#content .branchButton.isGhost {
    background: #fff;
    color: var(--zus-red);
}

#content .branchButton.isGhost:hover,
#content .branchButton.isGhost:focus-visible {
    background: var(--zus-cream);
}

.branchButton[hidden] {
    display: none !important;
}

ul.branchSubjects {
    list-style: none;
    margin: 0;
    padding: 0;
}

div#content ul.branchSubjects li {
    display: flex;
    flex-direction: column;
    margin: 0;
    padding: 7px 0;
    border-bottom: 1px solid var(--zus-line);
}

div#content ul.branchSubjects li:first-child {
    padding-top: 0;
}

div#content ul.branchSubjects li:last-child {
    border-bottom: 0;
}

ul.branchSubjects strong {
    font-weight: bold;
}

ul.branchSubjects span {
    color: var(--zus-muted);
    font-size: 13px;
}

/* Longer subject lists flow into two columns to keep the cards short. */
ul.branchSubjects.isLong {
    columns: 2;
    column-gap: 24px;
}

div#content ul.branchSubjects.isLong li {
    break-inside: avoid;
    border-bottom: 1px solid var(--zus-line);
}

div#content ul.branchSubjects.isLong li:first-child {
    padding-top: 7px;
}

/* "O pobočce" */

details.branchAbout {
    border-top: 1px solid var(--zus-line);
}

details.branchAbout summary {
    list-style: none;
    cursor: pointer;
    padding: 12px 20px;
    font-family: 'Anivers-Regular';
    font-size: 16px;
    color: var(--zus-red);
}

details.branchAbout summary::-webkit-details-marker {
    display: none;
}

details.branchAbout summary::after {
    content: '';
    display: inline-block;
    width: 7px;
    height: 7px;
    margin-left: 10px;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: translateY(-3px) rotate(45deg);
    transition: transform 0.2s;
}

details.branchAbout[open] summary::after {
    transform: translateY(1px) rotate(-135deg);
}

details.branchAbout summary:hover,
details.branchAbout summary:focus-visible {
    background: var(--zus-cream-light);
    outline: none;
}

.branchAboutText {
    padding: 0 20px 14px;
}

@media (prefers-reduced-motion: reduce) {
    .branchesPage *,
    .branchesPage *::after {
        transition: none !important;
    }
}

/* Phone/tablet layout (css/responsive.css takes over below 1120px). */
@media (max-width: 1119px) {
    .branchesPage {
        width: auto;
    }
}

@media (max-width: 639px) {
    .branchMap {
        height: 280px;
    }

    .branchCardHead {
        padding: 12px 16px;
    }

    .branchCardHead h2 {
        font-size: 21px;
    }

    .branchCardBody {
        grid-template-columns: 1fr;
        gap: 18px;
        padding: 16px;
    }

    .branchAboutText {
        padding: 0 16px 14px;
    }
}
