/* Apteki całodobowe – style działu (prefiks .apt, nie kolidują z resztą serwisu). */
.apt, .apt-site-header, .apt-site-footer {
  --apt-bg: #ffffff;
  --apt-surface: #f6f8f7;
  --apt-border: #dde3e0;
  --apt-text: #1d2521;
  --apt-muted: #5b6761;
  --apt-accent: #0b7a4b;
  --apt-accent-hover: #075c38;
  --apt-accent-soft: #e3f3eb;
  --apt-radius: 10px;
}
@media (prefers-color-scheme: dark) {
  .apt-standalone, .apt-standalone .apt, .apt-standalone .apt-site-header, .apt-standalone .apt-site-footer {
    --apt-bg: #141917;
    --apt-surface: #1c2320;
    --apt-border: #2f3a35;
    --apt-text: #e6ebe8;
    --apt-muted: #9aa7a0;
    --apt-accent: #3ccf8e;
    --apt-accent-hover: #6fe0ad;
    --apt-accent-soft: #173327;
  }
}

.apt-standalone {
  margin: 0;
  background: var(--apt-bg, #fff);
  color: var(--apt-text, #1d2521);
  font: 16px/1.6 system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}
.apt-standalone a { color: var(--apt-accent); }
/* Szerokość jak kontener nagłówka serwisu (.sticky-header-container: calc(100% - 40px), max 1360px). */
.apt-wrap { width: calc(100% - 40px); max-width: 1360px; margin: 0 auto; padding: 0; box-sizing: border-box; }
@media (max-width: 600px) { .apt-wrap { width: calc(100% - 32px); } }
.apt-site-header { border-bottom: 1px solid var(--apt-border); background: var(--apt-bg); }
.apt-site-header .apt-wrap { display: flex; justify-content: space-between; align-items: center; gap: 16px; min-height: 56px; flex-wrap: wrap; }
.apt-site-logo { font-weight: 700; text-decoration: none; color: var(--apt-text) !important; }
.apt-site-footer { border-top: 1px solid var(--apt-border); margin-top: 48px; padding: 16px 0; color: var(--apt-muted); font-size: 14px; }
/* Zastępczy nagłówek/stopka – gdy brak plików serwisu (header.php, footer.php) */
.apt-fallback-header { max-width: 1360px; margin: 0 auto; padding: 16px; border-bottom: 1px solid var(--apt-border); font-weight: 700; }
.apt-fallback-footer { max-width: 1360px; margin: 48px auto 0; padding: 16px; border-top: 1px solid var(--apt-border); color: var(--apt-muted); font-size: 14px; }

/* Bazowa typografia działu. Serwis ustawia html { font-size: 10px } oraz globalne style p/li/h3/h4/strong
   (header-28.css), dlatego wszystkie rozmiary podajemy w px i nadpisujemy te reguły w obrębie .apt. */
.apt { color: var(--apt-text); padding-top: 48px; padding-bottom: 32px; font-size: 16px; line-height: 1.6; }
.apt a { color: var(--apt-accent); }
.apt a:hover { color: var(--apt-accent-hover); }
.apt h1 { font-size: clamp(26px, 4vw, 36px); line-height: 1.2; font-weight: 800; margin: 8px 0 12px; }
.apt h2 { font-size: clamp(21px, 3vw, 26px); line-height: 1.3; font-weight: 700; margin: 40px 0 16px; }
.apt h3 { font-size: 18px; line-height: 1.35; font-weight: 700; margin: 0 0 8px; }
.apt h4 { font-size: 17px; line-height: 1.35; font-weight: 700; margin: 0 0 4px; }
.apt p { color: inherit; font-size: 16px; line-height: 1.6; margin: 0 0 14px; }
.apt strong { color: inherit; font-size: inherit; }
.apt ul, .apt ol { font-size: 16px; }
.apt li { color: inherit; line-height: 1.5; margin: 0 0 6px; }

.apt .apt-breadcrumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: 4px; padding: 0; margin: 0; font-size: 14px; color: var(--apt-muted); }
.apt-breadcrumbs li { margin: 0; }
.apt-breadcrumbs li + li::before { content: "›"; margin-right: 4px; }
.apt .apt-breadcrumbs a { color: var(--apt-muted); }

.apt-hero { padding: 8px 0 4px; }
.apt p.apt-lead { font-size: 18px; max-width: 70ch; }
.apt .apt-updated, .apt .apt-muted, .apt .apt-small { color: var(--apt-muted); font-size: 14px; }

.apt-cards { display: grid; gap: 20px; grid-template-columns: repeat(auto-fill, minmax(400px, 1fr)); }
.apt-card { background: #fff; border: 1px solid #c9d3ce; border-left: 5px solid var(--apt-accent); border-radius: var(--apt-radius); padding: 20px 22px; box-shadow: 0 2px 8px rgba(16, 40, 28, .08); scroll-margin-top: 80px; display: flex; flex-direction: column; }
.apt .apt-card__title { font-size: 20px; color: #111; }
.apt-card .apt-card__address { color: #111; }
.apt-card .apt-card__meta { color: #222; }
.apt-card .apt-card__meta a { font-weight: 600; }
.apt-card:target { outline: 2px solid var(--apt-accent); }
.apt p.apt-card__badges { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.apt-badge { display: inline-block; font-size: 13px; padding: 2px 10px; border-radius: 999px; border: 1px solid var(--apt-border); color: var(--apt-muted); }
.apt-badge--ok { background: var(--apt-accent-soft); color: var(--apt-accent); border-color: transparent; font-weight: 600; }
.apt-card__address { font-style: normal; font-size: 16px; margin-bottom: 8px; }
.apt .apt-card__meta { list-style: none; padding: 0; margin: 0 0 14px; font-size: 15px; }
.apt-card__meta li { margin: 0 0 4px; overflow-wrap: anywhere; }
.apt .apt-note { color: var(--apt-muted); font-size: 14px; }
.apt-card__actions { display: flex; gap: 8px; flex-wrap: wrap; margin: auto 0 0; }

.apt-btn { display: inline-flex; font-size: 16px; align-items: center; justify-content: center; min-height: 44px; padding: 0 18px; border-radius: 8px; border: 1px solid var(--apt-accent); color: var(--apt-accent) !important; background: transparent; font-family: inherit; font-weight: 600; text-decoration: none; cursor: pointer; }
.apt-btn:hover { border-color: var(--apt-accent-hover); color: var(--apt-accent-hover) !important; }
.apt-btn--primary { background: var(--apt-accent); color: #fff !important; }
.apt-btn--primary:hover { background: var(--apt-accent-hover); color: #fff !important; }

.apt-map { height: 420px; width: 100%; border-radius: var(--apt-radius); border: 1px solid var(--apt-border); background: var(--apt-surface); display: flex; align-items: center; justify-content: center; overflow: hidden; margin-bottom: 6px; }

.apt-map-tiles { filter: grayscale(1) brightness(1.06) contrast(.88); }
.apt-pin { background: none; border: 0; filter: drop-shadow(0 1px 2px rgba(0,0,0,.35)); }
.apt-pin svg { display: block; transition: transform .15s ease; }
.apt-pin:hover svg { transform: scale(1.15); }
.apt .apt-map-legend { list-style: none; display: flex; flex-wrap: wrap; gap: 6px 20px; padding: 0; margin: 4px 0 6px; font-size: 14px; }
.apt-map-legend li { display: flex; align-items: center; gap: 8px; margin: 0; }
.apt-map-legend__dot { width: 14px; height: 14px; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 0 0 1px rgba(0,0,0,.2); }
.apt-map-legend__dot--24h { background: #0b7a4b; }
.apt-map-legend__dot--sun { background: #1f6fd1; }

.apt-faq details { font-size: 16px; border: 1px solid var(--apt-border); border-radius: var(--apt-radius); padding: 0 16px; margin-bottom: 10px; background: var(--apt-bg); }
.apt-faq summary { cursor: pointer; padding: 16px 36px 16px 0; list-style: none; position: relative; }
.apt-faq summary::-webkit-details-marker { display: none; }
.apt-faq summary::marker { content: ""; }
/* Strzałka (chevron) po prawej, obraca się po rozwinięciu */
.apt-faq summary::after { content: ""; position: absolute; right: 4px; top: 50%; width: 9px; height: 9px; margin-top: -7px; border-right: 2px solid var(--apt-accent); border-bottom: 2px solid var(--apt-accent); transform: rotate(45deg); transition: transform .2s ease, margin-top .2s ease; }
.apt-faq details[open] > summary::after { transform: rotate(-135deg); margin-top: -2px; }
.apt-faq summary:hover h3 { color: var(--apt-accent); }
.apt-faq summary:focus-visible { outline: 2px solid var(--apt-accent); outline-offset: 2px; border-radius: 4px; }
.apt-faq summary h3 { display: inline; font-size: 17px; margin: 0; }
.apt-faq details p { margin: 0 0 14px; }

.apt-links { list-style: none; padding: 0; margin: 0 0 16px; display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.apt-links li { margin: 0; padding: 10px 14px; border: 1px solid var(--apt-border); border-radius: 8px; display: flex; flex-direction: column; background-color:#FFFFFF;}

/* Lista miast w kolumnach (3 na komputerze, 2 na tablecie i telefonie). Kolejność w dół kolumn, alfabetycznie. */
.apt .apt-chips { columns: 3; column-gap: 24px; margin: 8px 0 16px; padding: 0; }
.apt-chips a { display: flex; align-items: center; gap: 10px; break-inside: avoid; min-height: 34px; padding: 3px 6px; border-radius: 6px; text-decoration: none; color: var(--apt-text) !important; line-height: 1.3; }
.apt-chips a::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--apt-accent); flex: none; }
.apt-chips a > span { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; box-sizing: border-box; border-radius: 50%; font-size: 12px; line-height: 1; background: var(--apt-accent-soft); color: var(--apt-accent); font-weight: 700; }
.apt-chips a:hover { color: var(--apt-accent) !important; background: var(--apt-surface); }
@media (max-width: 900px) { .apt .apt-chips { columns: 2; } }

.apt h3.apt-group { margin: 28px 0 10px; color: var(--apt-muted); font-size: 14px; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; }
.apt-city-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.apt-city { border: 1px solid var(--apt-border); border-radius: var(--apt-radius); padding: 14px 16px; background: var(--apt-surface); }
.apt-city h4 { margin: 0 0 4px; font-size: 17px; }
.apt-city h4 a { color: var(--apt-text); }
.apt-city h4 a:hover { color: var(--apt-accent); }
.apt-city ul { padding-left: 18px; margin: 8px 0 0; font-size: 15px; }
.apt-city li { margin: 0 0 4px; }

/* Tabela aptek czynnych w niedziele */
.apt-table-wrap { border: 1px solid var(--apt-border); border-radius: var(--apt-radius); overflow: hidden; margin-bottom: 8px; }
.apt-table { width: 100%; border-collapse: collapse; font-size: 15px; background: var(--apt-bg); }
.apt-table th { text-align: left; font-size: 14px; font-weight: 700; color: var(--apt-muted); background: var(--apt-surface); padding: 10px 12px; border-bottom: 1px solid var(--apt-border); }
.apt-table td { padding: 12px; border-bottom: 1px solid var(--apt-border); vertical-align: top; line-height: 1.5; }
.apt-table tbody tr:last-child td { border-bottom: 0; }
.apt-table td strong { color: var(--apt-text); font-size: 15px; }
.apt-table .apt-badge { margin-top: 4px; }
.apt-table__lp { width: 44px; color: var(--apt-muted); }
.apt-table__24h td { background: var(--apt-accent-soft); }
.apt-table td .apt-muted { font-size: 14px; }

.apt-empty { padding: 16px; border-radius: var(--apt-radius); background: var(--apt-surface); border: 1px solid var(--apt-border); }
.apt-disclaimer { margin-top: 40px; padding: 16px; border-left: 4px solid var(--apt-accent); background: var(--apt-surface); border-radius: 0 var(--apt-radius) var(--apt-radius) 0; }
.apt-disclaimer p:last-child { margin-bottom: 0; }
.apt-editorial { margin-top: 8px; }

@media (max-width: 600px) {
  .apt { padding-top: 28px; }
  .apt-cards, .apt-city-grid, .apt-links { grid-template-columns: 1fr; }
  .apt-card__actions .apt-btn { flex: 1 1 auto; }
  .apt-map { height: 320px; }
  .apt-table thead { display: none; }
  .apt-table, .apt-table tbody, .apt-table tr, .apt-table td { display: block; width: auto; }
  .apt-table tr { padding: 12px 14px; border-bottom: 1px solid var(--apt-border); }
  .apt-table tbody tr:last-child { border-bottom: 0; }
  .apt-table td { padding: 2px 0; border: 0; }
  .apt-table tr.apt-table__24h { background: var(--apt-accent-soft); }
  .apt-table td[data-label]:not(:nth-child(-n+2))::before { content: attr(data-label) ": "; color: var(--apt-muted); font-size: 14px; }
  .apt-table__lp { display: none !important; }
}
