/* Databáze organizací (/databaze) – port z referenčního designového mockupu
   webu (finalni_web/databaze/ + styles.css), přemapováno na sdílené
   --rdcjk-* tokeny a primitiva (.container/.section-pad-small-top/.sr-only)
   z theme-rdcjk.css/web.css místo duplikování. Layout stránky je jednoduchý
   svislý sled sekcí (hero -> filtry -> výsledky -> karty -> mapa), žádný
   speciální grid na úrovni .directory-layout. */

.directory-page {
    font-family: 'Poppins', sans-serif;
    background: var(--rdcjk-background);
    color: var(--rdcjk-foreground);
}

.directory-page h1,
.directory-page h2,
.directory-page h3 {
    font-weight: 700;
    letter-spacing: -0.03em;
    line-height: 1.15;
}

.directory-kicker {
    margin: 0;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--rdcjk-secondary);
}

.directory-hero h1 {
    margin: 8px 0 0;
    font-size: clamp(2rem, 5vw, 3.4rem);
}

.directory-intro {
    max-width: 680px;
    margin: 12px 0 0;
    font-size: 1.05rem;
    line-height: 1.75;
    color: rgba(90, 61, 179, 0.92);
}

.directory-section {
    padding-bottom: 64px;
}

.directory-filters {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.search-field,
.select-wrap {
    position: relative;
}

.search-field input,
.select-wrap select {
    min-height: 44px;
    border-radius: 999px;
    background: var(--rdcjk-card);
    box-shadow: 0 4px 12px rgba(43, 27, 96, 0.04);
    border: 1px solid var(--rdcjk-border);
    color: var(--rdcjk-foreground);
    font-family: inherit;
    font-size: 0.95rem;
}

.search-field input {
    width: 100%;
    padding: 0 16px 0 44px;
    outline: 0;
}

.search-field input::placeholder {
    color: rgba(90, 61, 179, 0.6);
}

.search-field i,
.search-field svg {
    position: absolute;
    left: 16px;
    top: 50%;
    width: 18px;
    height: 18px;
    transform: translateY(-50%);
    color: rgba(90, 61, 179, 0.7);
}

.select-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.select-wrap select {
    appearance: none;
    width: 100%;
    padding: 0 42px 0 16px;
    outline: 0;
}

.select-wrap i,
.select-wrap svg {
    position: absolute;
    right: 14px;
    top: 50%;
    width: 18px;
    height: 18px;
    transform: translateY(-50%);
    pointer-events: none;
    color: rgba(90, 61, 179, 0.7);
}

.directory-results-text {
    margin: 16px 0 0;
    font-size: 0.95rem;
    line-height: 1.75;
    color: rgba(90, 61, 179, 0.92);
}

.directory-results-text span {
    font-weight: 700;
    color: var(--rdcjk-primary);
}

.empty-state {
    margin-top: 24px;
    padding: 40px;
    text-align: center;
    border: 1px solid var(--rdcjk-border);
    border-radius: var(--rdcjk-radius-lg);
    background: var(--rdcjk-card);
    color: rgba(90, 61, 179, 0.85);
}

.directory-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 24px;
    margin-top: 24px;
}

.org-card {
    cursor: pointer;
    padding: 24px;
    border: 1px solid var(--rdcjk-border);
    border-radius: var(--rdcjk-radius-lg);
    background: var(--rdcjk-card);
    box-shadow: 0 1px 0 rgba(43, 27, 96, 0.02);
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.org-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--rdcjk-shadow-soft);
}

.org-card.is-active {
    background: rgba(90, 61, 179, 0.1);
    border-color: rgba(90, 61, 179, 0.4);
    box-shadow: inset 0 0 0 1px rgba(90, 61, 179, 0.25);
}

.org-district {
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 0;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--rdcjk-secondary);
}

.org-district i,
.org-district svg {
    width: 14px;
    height: 14px;
}

.org-city {
    margin: 10px 0 0;
    font-size: 0.78rem;
    font-weight: 600;
    color: rgba(90, 61, 179, 0.78);
}

.org-card h3 {
    margin: 8px 0 0;
    font-size: 1.2rem;
    line-height: 1.3;
    letter-spacing: -0.03em;
}

.org-card h3 a {
    color: inherit;
    text-decoration: none;
}

.org-card h3 a:hover {
    color: var(--rdcjk-secondary);
}

.org-profile-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-top: 16px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--rdcjk-secondary);
    text-decoration: none;
}

.org-profile-link:hover {
    text-decoration: underline;
}

.org-profile-link i,
.org-profile-link svg {
    width: 14px;
    height: 14px;
}

.org-description {
    margin: 12px 0 0;
    font-size: 0.95rem;
    line-height: 1.75;
    color: rgba(43, 27, 96, 0.7);
}

.org-areas {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 0;
    margin: 16px 0 0;
    list-style: none;
}

.org-area {
    display: inline-flex;
    width: fit-content;
    align-items: center;
    border-radius: 999px;
    background: var(--rdcjk-muted);
    padding: 6px 12px;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--rdcjk-secondary);
}

.org-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    padding-top: 16px;
    margin-top: 20px;
    border-top: 1px solid var(--rdcjk-border);
}

.org-icon-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 999px;
    background: var(--rdcjk-muted);
    color: rgba(43, 27, 96, 0.72);
    text-decoration: none;
}

.org-icon-link i,
.org-icon-link svg {
    width: 18px;
    height: 18px;
}

.org-icon-link:hover {
    background: var(--rdcjk-secondary);
    color: var(--rdcjk-secondary-foreground);
}

.org-web {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 0;
    margin-left: auto;
    font-size: 0.925rem;
    font-weight: 600;
    color: var(--rdcjk-secondary);
    text-decoration: none;
}

.org-web i,
.org-web svg {
    width: 18px;
    height: 18px;
}

.directory-pagination {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    margin-top: 32px;
}

.directory-page-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 38px;
    height: 38px;
    padding: 0 8px;
    border-radius: 999px;
    border: 1px solid var(--rdcjk-border);
    background: var(--rdcjk-card);
    color: var(--rdcjk-foreground);
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: border-color 0.15s ease, background-color 0.15s ease, color 0.15s ease;
}

.directory-page-link:hover {
    border-color: var(--rdcjk-secondary);
    background: var(--rdcjk-muted);
}

.directory-page-link.is-active {
    border-color: var(--rdcjk-primary);
    background: var(--rdcjk-primary);
    color: var(--rdcjk-primary-foreground);
}

.directory-page-link--arrow {
    color: rgba(90, 61, 179, 0.75);
}

.directory-page-link--arrow i,
.directory-page-link--arrow svg {
    width: 16px;
    height: 16px;
}

/* ---------- mapa ---------- */

.map-section {
    margin-top: 48px;
    scroll-margin-top: 96px;
}

.map-heading h2 {
    margin: 0;
    font-size: 1.6rem;
}

.map-heading p {
    max-width: 680px;
    margin: 12px 0 0;
    font-size: 0.95rem;
    line-height: 1.75;
    color: rgba(90, 61, 179, 0.92);
}

.map-panel {
    position: relative;
    height: min(76vh, 860px);
    min-height: 520px;
    margin-top: 20px;
    overflow: hidden;
    overflow-anchor: none;
    border-radius: var(--rdcjk-radius-xl);
    background: rgba(247, 225, 251, 0.35);
    border: 1px solid var(--rdcjk-border);
}

#leaflet-map {
    position: absolute;
    inset: 0;
    font-family: inherit;
    z-index: 0;
}

.map-label {
    position: absolute;
    left: 20px;
    top: 20px;
    z-index: 20;
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(6px);
    padding: 6px 12px;
    font-size: 0.75rem;
    font-weight: 600;
    color: rgba(90, 61, 179, 0.8);
    pointer-events: none;
}

/* Leaflet špendlíky - vlastní ikona (L.divIcon), barvu/hover řeší tahle
   třída, pozici a anchor si už drží Leaflet sám (viz createPinIcon() v
   page.js). Tělo špendlíku je růžové, vnitřní kolečko fialové (viz
   .map-pin__body/.map-pin__dot na <path>/<circle> uvnitř page.js), s
   jemným stínem přes filter: drop-shadow (respektuje tvar SVG, ne jen
   obdélník jako box-shadow). */
.map-pin button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    background: none;
    border: 0;
    padding: 0;
    cursor: pointer;
}

.map-pin svg {
    filter: drop-shadow(0 2px 4px rgba(43, 27, 96, 0.35));
    transition: transform 0.2s ease;
}

.map-pin__body {
    fill: #ec4899;
    stroke: #ec4899;
}

.map-pin__dot {
    fill: var(--rdcjk-secondary);
    stroke: var(--rdcjk-secondary);
}

.map-pin button:hover svg,
.map-pin.is-active svg {
    transform: scale(1.12);
}

.map-pin.is-active svg {
    filter: drop-shadow(0 3px 6px rgba(43, 27, 96, 0.45));
}

/* Leaflet popup (klik na špendlík/kartu) - stylované přes Leaflet vlastní
   třídy, aby vypadal jako zbytek "karet" na webu (zaoblení, stín, fialový
   border), viz .map-popup předané do bindPopup() v page.js. */
.map-popup .leaflet-popup-content-wrapper {
    border-radius: 14px;
    background: var(--rdcjk-card);
    border: 1px solid var(--rdcjk-border);
    box-shadow: 0 18px 30px rgba(43, 27, 96, 0.12);
}

.map-popup .leaflet-popup-content {
    margin: 12px 14px;
    font-family: inherit;
    font-size: 0.8rem;
    line-height: 1.5;
    width: 176px !important;
}

.map-popup .leaflet-popup-tip {
    background: var(--rdcjk-card);
    border: 1px solid var(--rdcjk-border);
    box-shadow: none;
}

.map-popup strong {
    display: block;
    font-size: 0.84rem;
    color: var(--rdcjk-foreground);
}

.map-popup p,
.map-popup span {
    margin: 0;
    font-size: 0.68rem;
}

.map-popup p {
    margin-top: 2px;
    color: rgba(90, 61, 179, 0.72);
}

.map-popup span {
    display: inline-block;
    margin-top: 6px;
    font-weight: 500;
    color: var(--rdcjk-secondary);
}

.map-popup .tooltip-city {
    display: block;
    margin-top: 5px;
    color: rgba(43, 27, 96, 0.72);
    font-weight: 500;
}

.map-controls {
    position: absolute;
    z-index: 20;
    right: 20px;
    bottom: 36px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border-radius: 14px;
    background: var(--rdcjk-card);
    box-shadow: 0 8px 20px rgba(43, 27, 96, 0.08);
    border: 1px solid var(--rdcjk-border);
}

.map-controls button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    color: rgba(43, 27, 96, 0.72);
    background: none;
    border: 0;
    cursor: pointer;
    touch-action: manipulation;
}

.map-controls i,
.map-controls svg {
    width: 18px;
    height: 18px;
}

.map-controls button[disabled] {
    cursor: default;
    opacity: 0.45;
}

.map-controls button:not([disabled]):hover {
    background: rgba(247, 225, 251, 0.75);
}

.map-controls span {
    width: 100%;
    height: 1px;
    background: var(--rdcjk-border);
}

@media (min-width: 640px) {
    .directory-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (min-width: 1024px) {
    .directory-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .directory-filters {
        flex-direction: row;
        align-items: center;
    }

    .search-field {
        flex: 1;
    }

    .select-grid {
        display: flex;
        gap: 12px;
    }

    .select-wrap {
        width: 208px;
    }

    .select-wrap:last-child {
        width: 224px;
    }
}
