/* rejestraptek: home, pharmacy lists with the map, cities A–Z, search and filters. */

.js-only[hidden],
.nearest [hidden],
.listing [hidden],
.page-results [hidden],
.az-group[hidden],
.az__none[hidden] {
    display: none !important;
}

html:not(.js) .js-only {
    display: none !important;
}

.btn--sm {
    padding: 0 14px;
    font-size: 0.875rem;
}

.apt-display {
    font-family: var(--font-display);
    font-weight: 800;
    letter-spacing: -0.035em;
    font-size: clamp(2.25rem, 1.6rem + 2.6vw, 3.75rem);
    line-height: 1;
}

.apt-display--md {
    font-size: clamp(1.75rem, 1.4rem + 1.5vw, 2.75rem);
    letter-spacing: -0.03em;
    line-height: 1.04;
}

.apt-subhead {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--text-2);
    margin-bottom: 16px;
}

/* Status pill colors by state (.status.is-*) live in registry.css, shared with pharmacy-card.css. */
.status { white-space: normal; }

/* -------------------------------------------------------------------- hero */

.apt-hero {
    --hero-fg-2: #D6E8DF;
    --hero-accent: #7FD1A6;
    --hero-line: var(--header-control, #3F7A66);

    position: relative;
    overflow: hidden;
    background: var(--deep);
    color: #FFFFFF;
    padding-block: 28px 40px;
}

.apt-hero a:not(.btn) {
    color: inherit;
}

.apt-hero__mark {
    position: absolute;
    pointer-events: none;
    fill: var(--accent);
    opacity: 0.6;
}

.apt-hero__mark--big {
    display: none;
    width: 760px;
    height: 760px;
    right: -210px;
    top: 60px;
}

.apt-hero__mark svg,
.owner-cta__mark svg {
    width: 100%;
    height: 100%;
}

.apt-hero__grid {
    position: relative;
    display: grid;
    gap: 28px;
    grid-template-columns: minmax(0, 1fr);
}

.apt-hero__main {
    display: flex;
    flex-direction: column;
    gap: 18px;
    min-width: 0;
}

.apt-hero__eyebrow {
    align-self: flex-start;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    border: 1px solid var(--hero-line);
    border-radius: 999px;
    color: var(--hero-fg-2);
    font-size: 0.8125rem;
}

.apt-hero__dot,
.apt-chip__dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--hero-accent);
    flex-shrink: 0;
}

.apt-hero__title {
    font-family: var(--font-display);
    font-weight: 800;
    font-size: clamp(3.25rem, 1.6rem + 6.4vw, 7rem);
    line-height: 0.9;
    letter-spacing: -0.045em;
    overflow-wrap: anywhere;
}

.apt-hero__title-line--accent {
    color: var(--hero-accent);
}

.apt-hero__title--page {
    font-size: clamp(3rem, 1.8rem + 5vw, 6.5rem);
}

/* The mockup's hero column is 730 px wide at 1440 (a 1280 px inner content
   width, not this theme's default 1200): only wide enough for "Znajdź
   aptekę" to stay on one line at the mockup's own size. nowrap is a
   safety net — without the matching width, "Znajdź aptekę" still wraps
   mid-line before it ever grows tall enough to visibly overflow. */
@media (min-width: 1024px) {
    .apt-hero {
        --content: 1280px;
    }

    .apt-hero__title-line {
        display: inline-block;
        white-space: nowrap;
    }
}

.apt-hero__sub {
    font-size: clamp(1rem, 0.9rem + 0.5vw, 1.3125rem);
    color: var(--hero-fg-2);
}

.apt-hero__stats {
    display: flex;
    flex-wrap: wrap;
    gap: 12px 28px;
    margin: 0;
}

.apt-hero__stats dt {
    font-size: 0.8125rem;
    color: var(--hero-fg-2);
}

.apt-hero__stats dd {
    margin: 0;
    font-size: 1.25rem;
    color: #FFFFFF;
}

@media (min-width: 768px) {
    .apt-hero {
        padding-block: 56px 72px;
    }

    .apt-hero__main {
        gap: 26px;
    }
}

@media (min-width: 1024px) {
    .apt-hero {
        padding-block: 72px 96px;
    }

    .apt-hero__mark--big {
        display: block;
    }

    .apt-hero__grid {
        grid-template-columns: repeat(12, minmax(0, 1fr));
        gap: 40px;
        align-items: center;
    }

    .apt-hero__main {
        grid-column: span 7;
    }

    .nearest {
        grid-column: span 5;
    }
}

/*
 * The hero search. Below 600 px the field is its own white pill and the two
 * buttons sit directly on the green hero, not inside a shared white bar;
 * from 600 px the three merge into one white bar (the desktop mockup).
 */
.apt-search {
    max-width: 700px;
}

.apt-search__bar {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.apt-search__bar :focus-visible {
    outline-color: var(--focus);
}

.apt-search__field {
    flex: 1 1 100%;
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 56px;
    padding: 0 14px;
    background: #FFFFFF;
    color: var(--text-2);
    border-radius: 16px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.18);
}

.apt-search__field:focus-within {
    outline: 3px solid var(--focus);
}

.apt-search__field input {
    width: 100%;
    min-width: 0;
    border: 0;
    outline: none;
    background: transparent;
    color: var(--text);
    font-size: 1.0625rem;
}

.apt-search__near {
    flex: 1 1 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 56px;
    padding: 0 14px;
    border: 1px solid var(--hero-line);
    border-radius: 14px;
    background: transparent;
    color: #FFFFFF;
    font-weight: 600;
    cursor: pointer;
}

.apt-search__near:hover {
    border-color: var(--hero-fg-2);
}

.apt-search__submit {
    flex: 1 1 0;
    min-height: 56px;
    border-radius: 14px;
    background: #FFFFFF;
    color: var(--deep);
}

@media (min-width: 600px) {
    .apt-search__bar {
        gap: 8px;
        padding: 8px;
        background: #FFFFFF;
        color: var(--text);
        border-radius: 20px;
        box-shadow: 0 24px 60px rgba(0, 0, 0, 0.25);
    }

    .apt-search__field {
        flex: 1 1 auto;
        width: auto;
        box-shadow: none;
    }

    .apt-search__near {
        flex: 0 0 56px;
        padding: 0;
        border-color: var(--line);
        background: #FFFFFF;
        color: var(--deep);
    }

    .apt-search__near:hover {
        border-color: var(--deep);
    }

    .apt-search__near-text {
        display: none;
    }

    .apt-search__submit {
        flex: 0 0 auto;
        padding: 0 30px;
        background: var(--accent);
        color: #FFFFFF;
    }
}

.apt-chips {
    display: flex;
    flex-wrap: nowrap;
    gap: 8px;
    list-style: none;
    padding: 0;
    overflow-x: auto;
    scrollbar-width: none;
}

.apt-chips::-webkit-scrollbar {
    display: none;
}

@media (min-width: 600px) {
    .apt-chips {
        flex-wrap: wrap;
        overflow-x: visible;
    }
}

.apt-chip {
    display: inline-flex;
    flex-shrink: 0;
    align-items: center;
    gap: 8px;
    min-height: 44px;
    padding: 0 16px;
    border: 1px solid var(--hero-line);
    border-radius: 999px;
    color: #FFFFFF;
    font-size: 0.9375rem;
    text-decoration: none;
    white-space: nowrap;
}

.apt-hero .apt-chip {
    color: #FFFFFF;
}

.apt-chip:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--hero-fg-2);
}

/* ------------------------------------------------------ nearest open card */

.nearest {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 20px;
    background: #FFFFFF;
    color: var(--text);
    border-radius: 24px;
    box-shadow: 0 20px 50px rgba(10, 74, 55, 0.18);
}

@media (min-width: 1024px) {
    .nearest {
        gap: 18px;
        padding: 26px;
        border-radius: 28px;
        box-shadow: 0 30px 80px rgba(0, 0, 0, 0.3);
    }
}

.nearest :focus-visible,
.nearest:focus-visible {
    outline-color: var(--focus);
}

.nearest:focus {
    outline: none;
}

.nearest a:not(.btn) {
    color: var(--deep);
}

/*
 * Below 768 px the card's own bottom margin eats into the hero's trailing
 * padding, so the hero's box ends before the card's real bottom edge and the
 * card's last ~24px paint over the top of the next section. The hero must
 * stop clipping its children for that to show (the only element that relies
 * on the clip is the large decorative mark, hidden below 1024 px anyway),
 * and the card needs a stacking context to paint above that next section
 * rather than under it.
 */
@media (max-width: 767px) {
    .apt-hero {
        overflow: visible;
        padding-bottom: 56px;
    }

    .nearest {
        position: relative;
        z-index: 2;
        margin-bottom: -80px;
    }
}

/* Below 768 px the mockup drops the eyebrow and big clock: the title row
   carries a short heading and a compact "sob 14:32" instead. */
.nearest__head {
    display: none;
    flex-direction: column;
    gap: 2px;
}

.nearest__now {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--caption);
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.nearest__time {
    font-size: clamp(1.5rem, 1.2rem + 1vw, 2.5rem);
    font-weight: 500;
    letter-spacing: -0.03em;
    line-height: 1.1;
}

.nearest__title-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 12px;
}

.nearest__title {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.375rem;
    letter-spacing: -0.01em;
    line-height: 1.2;
}

.nearest__title-full {
    display: none;
}

.nearest__time-sm {
    flex-shrink: 0;
    font-size: 0.9375rem;
    color: var(--text-2);
}

@media (min-width: 768px) {
    .nearest__head {
        display: flex;
    }

    .nearest__title-row {
        display: block;
    }

    .nearest__title-full {
        display: inline;
    }

    .nearest__title-short,
    .nearest__time-sm {
        display: none;
    }
}

.nearest__body {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.nearest__state {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    color: var(--text-2);
    font-size: 0.9375rem;
}

.nearest__state--muted {
    color: var(--caption);
}

.nearest__list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    list-style: none;
    padding: 0;
}

.nearest__item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 14px;
    border-radius: 16px;
    background: var(--page);
    color: var(--text);
    text-decoration: none;
}

.nearest .nearest__item {
    color: var(--text);
}

.nearest__item:hover {
    background: var(--muted-bg);
}

.nearest__tile {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    flex-shrink: 0;
    border-radius: 12px;
    background: var(--accent);
    fill: #FFFFFF;
}

.nearest__item[data-hours-state="h24"] .nearest__tile {
    background: var(--h24-bg);
}

.nearest__tile svg {
    width: 18px;
    height: 18px;
}

.nearest__text {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.nearest__name {
    font-weight: 700;
    overflow-wrap: anywhere;
}

.nearest__status {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--open-fg);
}

.nearest__item[data-hours-state="closing"] .nearest__status {
    color: var(--closing-fg);
}

.nearest__item[data-hours-state="h24"] .nearest__status {
    color: var(--text);
}

.nearest__dist {
    font-family: var(--font-mono);
    font-size: 0.875rem;
    color: var(--text-2);
    white-space: nowrap;
}

.nearest__more {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 52px;
    padding: 0 18px;
    border-radius: 14px;
    background: var(--ink);
    font-weight: 600;
    text-decoration: none;
}

/* Same specificity as ".apt-hero a:not(.btn) { color: inherit }" above, so the
   element selector on the anchor keeps this last-declared rule winning: the
   button is black with white text, not text inherited from the white card. */
.apt-hero a.nearest__more,
.apt-hero a.nearest__more:hover {
    color: #FFFFFF;
}

.nearest .nearest__more:focus-visible {
    outline-offset: 3px;
}

/* ------------------------------------------------------------ home blocks */

.city-tiles {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    list-style: none;
    padding: 0;
}

.city-tile {
    --tile-bg: var(--card);
    --tile-fg: var(--ink);
    --tile-line: var(--line);
    --tile-chip: var(--muted-bg);

    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 16px;
    min-height: 120px;
    padding: 16px;
    background: var(--tile-bg);
    color: var(--tile-fg);
    border: 1px solid var(--tile-line);
    border-radius: 18px;
}

.city-tile:nth-child(1) {
    --tile-bg: var(--accent);
    --tile-fg: #FFFFFF;
    --tile-line: var(--accent);
    --tile-chip: rgba(255, 255, 255, 0.14);
}

.city-tile:nth-child(4),
.city-tile:nth-child(6) {
    --tile-bg: var(--tint);
    --tile-fg: var(--deep);
    --tile-line: #CFE5DA;
    --tile-chip: #FFFFFF;
}

.city-tile:nth-child(1) :focus-visible {
    outline-color: #FFFFFF;
}

.city-tile__name {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: clamp(1.375rem, 1rem + 1.4vw, 2.125rem);
    line-height: 1;
    letter-spacing: -0.025em;
    text-decoration: none;
    overflow-wrap: anywhere;
}

.city-tile a {
    color: var(--tile-fg);
}

.city-tile__count {
    font-size: 0.875rem;
    opacity: 0.85;
}

.city-tile__links {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.city-tile__chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 44px;
    padding: 0 12px;
    border-radius: 10px;
    background: var(--tile-chip);
    font-size: 0.875rem;
    font-weight: 600;
    text-decoration: none;
}

.city-all-button {
    margin-top: 4px;
}

@media (min-width: 768px) {
    .city-all-button {
        display: none;
    }
}

@media (max-width: 767px) {
    .city-all-link {
        display: none;
    }
}

@media (min-width: 1024px) {
    .city-tiles {
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 16px;
    }

    .city-tile {
        min-height: 150px;
        padding: 24px;
        border-radius: 24px;
        gap: 30px;
    }
}

.province-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    list-style: none;
    padding: 0;
}

.province-chips .chip,
.listing__chips .chip,
.listing-status .chip {
    min-height: 44px;
}

.apt-banner:empty {
    display: none;
}

.newest {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 16px;
    list-style: none;
    padding: 0;
}

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

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

.newest__card {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 22px;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 22px;
}

.newest__date {
    font-size: 0.75rem;
    color: var(--caption);
}

.newest__name {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.3125rem;
    line-height: 1.15;
    letter-spacing: -0.01em;
    overflow-wrap: anywhere;
}

.newest__name a {
    color: var(--ink);
    text-decoration: none;
}

.newest__name a:hover {
    text-decoration: underline;
}

.newest__addr {
    font-size: 0.875rem;
    color: var(--text-2);
}

.result__province {
    font-size: 0.8125rem;
    color: var(--caption);
}

.result__actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-top: auto;
}

.newest__more {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: auto;
    min-height: 44px;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--deep);
}

.apt-panel {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 24px 20px;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 24px;
}

.rules-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
    list-style: none;
    padding: 0;
}

.rules-grid__item {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 18px;
    background: var(--page);
    border-radius: 18px;
}

.rules-grid__n {
    font-size: 0.9375rem;
    color: var(--accent);
}

.rules-grid__title {
    font-size: 1.0625rem;
    font-weight: 700;
    line-height: 1.3;
}

.rules-grid__body {
    font-size: 0.9375rem;
    line-height: 1.55;
    color: var(--text-2);
}

@media (min-width: 768px) {
    .rules-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 16px;
    }

    .rules-grid__item {
        padding: 24px;
        border-radius: 22px;
    }
}

@media (min-width: 1024px) {
    .apt-panel {
        padding: 56px;
        border-radius: 32px;
        gap: 16px;
    }

    .rules-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

.owner-cta {
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-top: 16px;
    padding: 24px 20px;
    background: var(--ink);
    color: #FFFFFF;
    border-radius: 24px;
}

.owner-cta__mark {
    position: absolute;
    width: 360px;
    height: 360px;
    right: -120px;
    top: -110px;
    fill: #23272B;
    pointer-events: none;
}

.owner-cta__text {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 14px;
    max-width: 640px;
}

.owner-cta__text p {
    font-size: 1.0625rem;
    line-height: 1.6;
    color: #C9CCC6;
}

.owner-cta__button {
    position: relative;
    align-self: stretch;
    background: #FFFFFF;
    color: var(--ink);
    font-weight: 700;
}

.owner-cta .owner-cta__button:hover {
    background: var(--tint);
    color: var(--ink);
}

@media (min-width: 1024px) {
    .owner-cta {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        gap: 40px;
        padding: 56px;
        border-radius: 32px;
    }

    .owner-cta__mark {
        right: 260px;
    }

    .owner-cta__button {
        align-self: center;
        flex-shrink: 0;
    }
}

.seo-block {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 16px;
}

.seo-block__title {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.75rem;
    line-height: 1.15;
    letter-spacing: -0.015em;
}

@media (min-width: 1024px) {
    .seo-block {
        grid-template-columns: repeat(12, minmax(0, 1fr));
        gap: 40px;
    }

    .seo-block__title {
        grid-column: span 4;
    }

    .seo-block__text {
        grid-column: span 8;
    }
}

/* Inside the listing's left panel there is no room for the two-column
   layout above: the SEO text stays a single narrow column at every width. */
.seo-block--panel {
    grid-template-columns: minmax(0, 1fr);
    padding: 24px var(--gutter) 8px;
    border-top: 1px solid var(--line-soft);
    margin-top: 12px;
}

.seo-block--panel .seo-block__title {
    grid-column: auto;
    font-size: 1.125rem;
}

.seo-block--panel .seo-block__text {
    grid-column: auto;
    font-size: 0.875rem;
}

@media (min-width: 1024px) {
    .seo-block--panel {
        grid-template-columns: minmax(0, 1fr);
        padding: 24px 16px 8px;
    }

    .seo-block--panel .seo-block__title,
    .seo-block--panel .seo-block__text {
        grid-column: auto;
    }
}

/* ------------------------------------------------------ list and its map */

.listing {
    position: relative;
    background: var(--card);
    border-bottom: 1px solid var(--line);
}

.listing__panel {
    min-width: 0;
    background: var(--card);
}

.listing__head {
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 20px var(--gutter) 16px;
    border-bottom: 1px solid var(--line-soft);
}

.listing__title-row {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: 4px 12px;
}

.listing__title {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.625rem;
    line-height: 1.15;
    letter-spacing: -0.01em;
    overflow-wrap: anywhere;
}

.listing__count,
.listing__query,
.listing__found {
    font-size: 0.875rem;
    color: var(--text-2);
}

.listing__note {
    font-size: 0.8125rem;
    line-height: 1.45;
    color: var(--text-2);
}

.listing-search {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.listing-search__field {
    flex: 1 1 200px;
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 48px;
    padding: 0 12px;
    border: 1px solid #B9B5AA;
    border-radius: var(--radius-sm);
    color: var(--text-2);
}

.listing-search__field:focus-within {
    outline: 3px solid var(--focus);
    border-color: var(--ink);
}

.listing-search__field input {
    width: 100%;
    min-width: 0;
    border: 0;
    outline: none;
    background: transparent;
    color: var(--text);
    font-size: 1rem;
}

.listing-search__clear {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    padding: 0 6px;
    font-size: 0.875rem;
    font-weight: 600;
}

.listing__chips,
.listing-status__buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    list-style: none;
    padding: 0;
}

.listing__chips .apt-chip__dot {
    background: var(--open-dot);
}

.listing__chips .chip[aria-current] .apt-chip__dot {
    background: var(--hero-accent, #7FD1A6);
}

.listing-status {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 12px;
}

.listing-status__label {
    font-size: 0.875rem;
    color: var(--text-2);
}

.listing__results {
    padding: 12px var(--gutter) 24px;
}

.results {
    display: flex;
    flex-direction: column;
    gap: 10px;
    list-style: none;
    padding: 0;
}

.results + .results,
.listing__results > :not(.results) + .results {
    margin-top: 10px;
}

.result {
    display: flex;
    gap: 14px;
    padding: 16px;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 16px;
}

.result.is-selected {
    border: 2px solid var(--accent);
    background: #F4FAF7;
    padding: 15px;
}

.result__n {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    flex-shrink: 0;
    border-radius: 50%;
    background: var(--accent);
    color: #FFFFFF;
    font-family: var(--font-mono);
    font-size: 0.8125rem;
    font-variant-numeric: tabular-nums;
}

.result[data-hours-state="h24"] .result__n {
    background: var(--h24-bg);
}

.result--closed .result__n,
.result[data-hours-state="closed"] .result__n,
.result[data-hours-state="unknown"] .result__n,
.result[data-hours-state="holiday"] .result__n {
    background: #5B6168;
}

.result__body {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
    color: inherit;
    text-decoration: none;
}

.result__body:hover .result__name {
    text-decoration: underline;
}

.result__top {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 12px;
}

.result__name {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.0625rem;
    line-height: 1.25;
    overflow-wrap: anywhere;
}

.result__dist {
    font-size: 0.8125rem;
    color: var(--text-2);
    white-space: nowrap;
}

.result__addr,
.result__phone {
    font-size: 0.875rem;
    color: var(--text-2);
}

.result__meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.result__actions {
    margin-top: 4px;
}

.result__actions a[href^="tel:"],
.result__actions a[href^="mailto:"] {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    font-weight: 600;
}

.listing__results .pagination {
    margin-top: 24px;
}

.listing__results .empty {
    margin-top: 8px;
}

/* The map: beside the list from 1024 px, a full-screen view with the list as a sheet below. */
.listing__map {
    display: none;
    position: relative;
    background: #ECEEE8;
    isolation: isolate;
}

.map-canvas {
    position: absolute;
    inset: 0;
    font-family: var(--font-body);
}

.map-controls {
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.map-button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 0;
    border-radius: 12px;
    background: #FFFFFF;
    color: var(--ink);
    font-size: 1.375rem;
    line-height: 1;
    box-shadow: 0 4px 14px rgba(22, 24, 26, 0.12);
    cursor: pointer;
}

.map-button:hover {
    background: var(--muted-bg);
}

.map-button[aria-busy="true"] {
    opacity: 0.6;
}

.map-legend {
    position: absolute;
    left: 20px;
    bottom: 20px;
    z-index: 1000;
    display: flex;
    flex-wrap: wrap;
    gap: 6px 16px;
    max-width: calc(100% - 40px);
    margin: 0;
    padding: 10px 14px;
    list-style: none;
    background: #FFFFFF;
    border-radius: 12px;
    font-size: 0.8125rem;
    box-shadow: 0 4px 14px rgba(22, 24, 26, 0.1);
}

.map-legend li {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.map-legend__dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.map-legend__dot--open { background: var(--accent); }
.map-legend__dot--24h { background: var(--h24-bg); }
.map-legend__dot--closed { background: #9AA0A6; }

.map-attribution {
    position: absolute;
    right: 12px;
    bottom: 8px;
    z-index: 1000;
    padding: 2px 6px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.85);
    font-size: 0.75rem;
    color: var(--text-2);
}

.map-attribution a {
    color: inherit;
}

.map-error {
    position: absolute;
    top: 20px;
    left: 20px;
    right: 84px;
    z-index: 1001;
}

.map-pin {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border: 3px solid #FFFFFF;
    border-radius: 50%;
    background: var(--accent);
    color: #FFFFFF;
    font-family: var(--font-mono);
    font-size: 12px;
    box-shadow: 0 2px 6px rgba(22, 24, 26, 0.3);
    box-sizing: border-box;
}

.map-pin--h24 { background: var(--h24-bg); }
.map-pin--closed { background: #6B7178; }
.map-pin.is-selected {
    width: 40px;
    height: 40px;
    font-size: 15px;
}

.map-me {
    width: 18px;
    height: 18px;
    border: 3px solid #FFFFFF;
    border-radius: 50%;
    background: #1F6FEB;
    box-shadow: 0 0 0 6px rgba(31, 111, 235, 0.2);
    box-sizing: border-box;
}

.map-popup {
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-width: 220px;
    font-family: var(--font-body);
    font-size: 0.875rem;
    color: var(--text-2);
}

.map-popup__head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 10px;
}

.map-popup__title {
    font-family: var(--font-display);
    font-size: 1.0625rem;
    font-weight: 700;
    color: var(--ink);
}

.map-popup__dist {
    flex-shrink: 0;
    font-family: var(--font-mono);
    font-size: 0.8125rem;
    color: var(--text-2);
}

.map-popup__actions {
    display: flex;
    gap: 8px;
}

.map-popup__actions a {
    flex: 1 1 0;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 0 12px;
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.875rem;
    text-decoration: none;
}

.map-popup__actions a:first-child {
    background: var(--accent);
    color: #FFFFFF;
}

.map-popup__actions a:last-child {
    border: 1px solid var(--line);
    color: var(--ink);
}

.listing .leaflet-popup-content-wrapper {
    border-radius: 16px;
    box-shadow: 0 16px 40px rgba(22, 24, 26, 0.18);
}

.listing .leaflet-popup-content {
    margin: 16px;
}

.listing .leaflet-container {
    font: inherit;
    background: #ECEEE8;
}

.listing .leaflet-container a.leaflet-popup-close-button {
    width: 32px;
    height: 32px;
    font-size: 22px;
}

.map-toggle {
    position: fixed;
    left: 50%;
    bottom: 16px;
    z-index: 1100;
    transform: translateX(-50%);
    box-shadow: 0 8px 24px rgba(22, 24, 26, 0.2);
}

/*
 * Below 1024 px, a city page opens on the map (data-map-first): the sheet
 * collapses to its header (handle, compact title/open-count + the inline
 * "Lista" button, the ordering note) with the full head — search, chips,
 * status filter — reachable once "Lista" expands the sheet back to the
 * full list. Hidden by default; only [data-listing].is-map shows it, so a
 * visitor without JS (is-map never gets added) only ever sees the full list.
 */
.sheet-handle,
.sheet-head,
.sheet-head__note {
    display: none;
}

.sheet-handle {
    justify-content: center;
    padding: 10px 0 4px;
}

.sheet-handle::before {
    content: '';
    width: 40px;
    height: 5px;
    border-radius: 3px;
    background: #D3D0C7;
}

.sheet-head {
    justify-content: space-between;
    align-items: baseline;
    gap: 12px;
    padding: 8px var(--gutter) 12px;
}

.sheet-head__title {
    margin: 0;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.375rem;
    letter-spacing: -0.01em;
}

.map-toggle--sheet {
    flex-shrink: 0;
    box-shadow: none;
}

.sheet-head__note {
    margin: -4px var(--gutter) 10px;
    font-size: 0.75rem;
    line-height: 1.45;
    color: var(--text-2);
}

@media (max-width: 1023px) {
    .listing.is-map .sheet-handle,
    .listing.is-map .sheet-head {
        display: flex;
    }

    .listing.is-map .sheet-head__note {
        display: block;
    }

    .listing.is-map .listing__head {
        display: none;
    }

    .listing.is-map .map-toggle--floating {
        display: none;
    }

    /* One class more than ".listing.is-map .map-toggle" below, so this wins
       regardless of source order and the sheet button stays inline. */
    .listing.is-map .sheet-head .map-toggle--sheet {
        position: static;
        top: auto;
    }
}

.listing.is-map {
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
}

.listing.is-map .listing__map {
    display: block;
    position: absolute;
    inset: 0;
}

.listing.is-map .listing__panel {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1050;
    height: 45%;
    overflow-y: auto;
    overscroll-behavior: contain;
    border-radius: 26px 26px 0 0;
    box-shadow: 0 -12px 40px rgba(22, 24, 26, 0.16);
}

.listing.is-map .map-toggle {
    position: absolute;
    top: 12px;
    bottom: auto;
}

.listing.is-map .map-controls {
    top: 68px;
    right: 12px;
}

.listing.is-map .map-legend {
    top: 68px;
    left: 12px;
    bottom: auto;
    max-width: calc(100% - 80px);
}

.listing.is-map .map-attribution {
    bottom: calc(45% + 6px);
}

.listing.is-map .map-error {
    top: 68px;
    left: 12px;
    right: 68px;
}

@media (min-width: 1024px) {
    .listing {
        display: grid;
        grid-template-columns: minmax(420px, 560px) minmax(0, 1fr);
        align-items: start;
    }

    .listing__panel {
        border-right: 1px solid var(--line);
    }

    .listing__head {
        padding: 20px 24px 16px;
    }

    .listing__results {
        padding: 12px 16px 24px;
    }

    .listing__map,
    .listing.is-map .listing__map {
        display: block;
        position: sticky;
        top: 0;
        height: 100vh;
        min-height: 480px;
    }

    .map-toggle {
        display: none !important;
    }
}

@media (max-width: 1023px) {
    .listing.is-map .listing__map {
        min-height: 0;
    }
}

/* ------------------------------------------------------------ cities A–Z */

.apt-hero--page {
    padding-block: 32px 48px;
}

.cities-hero {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.cities-hero__text {
    display: flex;
    flex-direction: column;
    gap: 16px;
    min-width: 0;
}

.cities-hero .breadcrumbs ol {
    color: var(--brand-tld, #A9CDBD);
}

.cities-hero__lead {
    max-width: 60ch;
    color: var(--hero-fg-2);
    font-size: 0.9375rem;
    line-height: 1.6;
}

.cities-filter__field {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    min-height: 60px;
    padding: 0 18px;
    border-radius: 18px;
    background: #FFFFFF;
    color: var(--text-2);
}

.cities-filter__field:focus-within {
    outline: 3px solid #FFFFFF;
    outline-offset: 2px;
}

.cities-filter__field input {
    width: 100%;
    min-width: 0;
    border: 0;
    outline: none;
    background: transparent;
    color: var(--text);
    font-size: 1.0625rem;
}

@media (min-width: 1024px) {
    .apt-hero--page {
        padding-block: 48px 64px;
    }

    .cities-hero {
        flex-direction: row;
        align-items: flex-end;
        justify-content: space-between;
        gap: 40px;
    }

    .cities-filter {
        flex: 0 0 440px;
    }
}

.letters {
    background: var(--card);
    border-bottom: 1px solid var(--line);
    padding-block: 12px;
}

.letters__list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    list-style: none;
}

.letters__link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: var(--page);
    color: var(--ink);
    font-family: var(--font-mono);
    font-size: 1rem;
    text-decoration: none;
}

a.letters__link:hover,
a.letters__link:focus-visible {
    background: var(--accent);
    color: #FFFFFF;
}

.letters__link[aria-disabled="true"] {
    background: transparent;
    color: var(--caption);
    opacity: 0.6;
}

.largest {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 16px;
}

.largest__list {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    column-gap: 40px;
    list-style: none;
    padding: 0;
}

.largest__item {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px 12px;
    padding: 14px 0;
    border-bottom: 1px solid var(--line);
}

.largest__city {
    display: flex;
    align-items: baseline;
    gap: 14px;
    min-height: 44px;
    color: var(--ink);
    text-decoration: none;
    min-width: 0;
}

.largest__city:hover .largest__name {
    text-decoration: underline;
}

.largest__n,
.largest__count {
    font-size: 0.8125rem;
    color: var(--caption);
}

.largest__name {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: clamp(1.375rem, 1.1rem + 1vw, 1.875rem);
    letter-spacing: -0.02em;
    overflow-wrap: anywhere;
}

.largest__24h {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 44px;
    padding: 0 12px;
    border-radius: 10px;
    background: var(--tint);
    color: var(--deep);
    font-size: 0.875rem;
    font-weight: 600;
    text-decoration: none;
}

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

@media (min-width: 1024px) {
    .largest {
        grid-template-columns: repeat(12, minmax(0, 1fr));
        gap: 40px;
    }

    .largest__title {
        grid-column: span 3;
    }

    .largest__list {
        grid-column: span 9;
    }
}

.az__title {
    margin-bottom: 16px;
}

.az__none {
    margin-bottom: 16px;
}

.az-group {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
    padding-block: 24px;
    border-top: 1px solid var(--line);
    scroll-margin-top: 16px;
}

.az-group__letter {
    font-family: var(--font-display);
    font-weight: 800;
    font-size: clamp(3rem, 2.4rem + 2.4vw, 4.5rem);
    line-height: 0.8;
    color: var(--accent);
}

.az-group__list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 4px 24px;
    list-style: none;
    padding: 0;
}

.az-group__list li {
    min-width: 0;
    overflow-wrap: anywhere;
}

.az-group__list a {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    font-size: 1.0625rem;
    color: var(--ink);
    text-decoration: none;
}

.az-group__list a:hover {
    text-decoration: underline;
}

.az-group__count {
    font-size: 0.8125rem;
    color: var(--caption);
}

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

@media (min-width: 1024px) {
    .az-group {
        grid-template-columns: repeat(12, minmax(0, 1fr));
        gap: 40px;
        padding-block: 28px;
    }

    .az-group__letter {
        grid-column: span 3;
    }

    .az-group__list {
        grid-column: span 9;
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

/* ------------------------------------------------ search, filter, options */

.page-results {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.page-results__head {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.page-results__search {
    max-width: 760px;
}

.page-results__filter {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 16px;
}

.page-results__filter .link {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
}

.page-results__found {
    color: var(--text-2);
}

.results--cards {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
}

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

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

.result__phone a {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
}

.options {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
    list-style: none;
    padding: 0;
}

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

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

.options__link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 56px;
    padding: 12px 18px;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    color: var(--ink);
    font-weight: 600;
    text-decoration: none;
}

.options__link:hover {
    border-color: var(--ink);
    color: var(--ink);
}

.options__link svg {
    flex-shrink: 0;
    color: var(--caption);
}

@media print {
    .listing__map,
    .map-toggle,
    .nearest,
    .apt-search,
    .apt-chips,
    .listing-search,
    .listing__chips,
    .listing-status,
    .result__actions,
    .cities-filter,
    .letters {
        display: none !important;
    }

    .apt-hero {
        background: none;
        color: #000000;
    }
}
