/* PharmacyFinder.uk
   One idea: the illuminated green cross of a pharmacy sign. Everything else stays quiet,
   legible and fast for someone who may be unwell and on a phone. */

:root {
  --ink: #0f241c;
  --muted: #4a5d55;
  --paper: #fafcfa;
  --white: #fff;
  --line: #d3ded8;
  --mint: #e3f1e9;
  --green: #0a7b4f;
  --green-deep: #06583a;
  --night: #0b3b2a;
  --glow: #36d987;
  --open-bg: #d9f2e3; --open-fg: #075c3b;
  --soon-bg: #fff0d1; --soon-fg: #7a4a00;
  --closed-bg: #fbe7e5; --closed-fg: #9b231a;
  --focus: #ffbf47;
  --radius-s: 6px;
  --radius-m: 12px;
  --wrap: 1120px;
  --font: 'Atkinson Hyperlegible Next', 'Atkinson Hyperlegible', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  /* Type scale: 1.25 ratio on a 17px base */
  --t-sm: .875rem; --t-base: 1.0625rem; --t-md: 1.25rem; --t-lg: 1.5625rem; --t-xl: 1.953rem; --t-2xl: 2.441rem; --t-3xl: 3.4rem;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font: 400 var(--t-base)/1.55 var(--font);
  font-feature-settings: 'kern';
}
img, iframe, svg { max-width: 100%; }
a { color: var(--green-deep); text-underline-offset: .18em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; box-shadow: 0 0 0 5px var(--ink); border-radius: 2px; }
h1, h2, h3 { line-height: 1.15; font-weight: 800; letter-spacing: -.01em; margin: 0 0 .5em; text-wrap: balance; }
h1 { font-size: clamp(var(--t-xl), 5vw, var(--t-2xl)); }
h2 { font-size: var(--t-lg); }
h3 { font-size: var(--t-md); font-weight: 600; }
p { margin: 0 0 1em; }
.sr-only { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 0; background: var(--focus); color: var(--ink); padding: .6em 1em; z-index: 9; font-weight: 600; }
.skip:focus { left: 1rem; }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 1.25rem; }
.ico { width: 1.15em; height: 1.15em; fill: currentColor; vertical-align: -.2em; flex: none; }

/* ── Header ───────────────────────────────── */
.site-head { background: var(--white); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; }
.head-row { display: flex; align-items: center; gap: 1rem; min-height: 64px; }
.logo { display: inline-flex; align-items: center; gap: .5rem; color: var(--ink); text-decoration: none; font-weight: 800; font-size: 1.2rem; letter-spacing: -.02em; }
.logo b { color: var(--green); font-weight: 800; }
.logo-cross { width: 28px; height: 28px; fill: var(--green); }
.site-nav { margin-left: auto; }
.site-nav ul { list-style: none; display: flex; gap: .25rem; margin: 0; padding: 0; }
.site-nav a { display: block; padding: .5rem .75rem; color: var(--ink); text-decoration: none; border-radius: var(--radius-s); font-weight: 600; font-size: var(--t-sm); }
.site-nav a:hover { background: var(--mint); }
.site-nav a[aria-current='page'] { color: var(--green-deep); box-shadow: inset 0 -3px 0 var(--green); border-radius: 0; }
.menu-btn { display: none; margin-left: auto; background: none; border: 0; padding: .75rem; cursor: pointer; }
.burger, .burger::before, .burger::after { display: block; width: 22px; height: 2px; background: var(--ink); position: relative; transition: transform .2s; }
.burger::before, .burger::after { content: ''; position: absolute; left: 0; }
.burger::before { top: -7px; } .burger::after { top: 7px; }
.menu-btn[aria-expanded='true'] .burger { background: transparent; }
.menu-btn[aria-expanded='true'] .burger::before { transform: translateY(7px) rotate(45deg); }
.menu-btn[aria-expanded='true'] .burger::after { transform: translateY(-7px) rotate(-45deg); }

@media (max-width: 860px) {
  .menu-btn { display: block; }
  .site-nav { display: none; position: absolute; left: 0; right: 0; top: 64px; background: var(--white); border-bottom: 1px solid var(--line); }
  .site-nav.open { display: block; }
  .site-nav ul { flex-direction: column; padding: .5rem 1.25rem 1rem; }
  .site-nav a { font-size: var(--t-base); padding: .8rem 0; border-bottom: 1px solid var(--line); border-radius: 0; }
  .site-nav a[aria-current='page'] { box-shadow: inset 4px 0 0 var(--green); padding-left: .75rem; }
}

/* ── Hero: the lit sign ───────────────────── */
.hero { background: var(--night); color: #f2fbf6; overflow: hidden; }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); align-items: center; gap: 2rem; padding-top: clamp(2.5rem, 7vw, 5rem); padding-bottom: clamp(2.5rem, 7vw, 5rem); }
.hero h1 { font-size: clamp(2.2rem, 6.2vw, var(--t-3xl)); line-height: 1.02; letter-spacing: -.03em; max-width: 13ch; margin-bottom: .35em; }
.hero-sub { font-size: var(--t-md); color: #c3e3d3; max-width: 34ch; margin-bottom: 1.75rem; }
.hero-sign { display: grid; place-items: center; }
.sign-cross {
  width: min(320px, 100%); aspect-ratio: 1; fill: var(--glow);
  filter: drop-shadow(0 0 18px rgba(54, 217, 135, .55)) drop-shadow(0 0 60px rgba(54, 217, 135, .35));
  animation: sign-on 1.6s steps(1, end) .2s both, hum 5s ease-in-out 2s infinite;
}
@keyframes sign-on {
  0% { opacity: .15; } 12% { opacity: 1; } 18% { opacity: .2; } 26% { opacity: 1; } 31% { opacity: .35; } 40%, 100% { opacity: 1; }
}
@keyframes hum { 50% { filter: drop-shadow(0 0 22px rgba(54, 217, 135, .65)) drop-shadow(0 0 80px rgba(54, 217, 135, .45)); } }
@media (prefers-reduced-motion: reduce) { .sign-cross { animation: none; } }
@media (max-width: 760px) {
  .hero-grid { grid-template-columns: minmax(0, 1fr); }
  .hero-sign { position: absolute; right: -40px; top: 70px; opacity: .22; pointer-events: none; }
  .hero-sign .sign-cross { width: 220px; }
  .hero { position: relative; }
  .hero-copy { position: relative; z-index: 1; }
}

/* ── Search ───────────────────────────────── */
.search { max-width: 640px; }
.search-label { display: block; font-weight: 600; margin-bottom: .5rem; }
.search-row { display: flex; gap: .5rem; }
.search input {
  flex: 1; min-width: 0; font: inherit; font-size: var(--t-md); padding: .8rem 1rem; border: 2px solid var(--ink);
  border-radius: var(--radius-s); background: var(--white); color: var(--ink);
}
.search input:focus-visible { box-shadow: 0 0 0 4px var(--focus); outline: 0; }
.search--big input { font-size: 1.35rem; padding: 1rem 1.1rem; border-color: transparent; }
.link-btn {
  margin-top: .75rem; background: none; border: 0; padding: .4rem 0; font: inherit; font-weight: 600; color: var(--green-deep);
  cursor: pointer; display: inline-flex; gap: .4rem; align-items: center; text-decoration: underline; text-underline-offset: .2em;
}
.hero .link-btn { color: #9be8c2; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem; font: inherit; font-weight: 600; cursor: pointer;
  padding: .75rem 1.15rem; border-radius: var(--radius-s); border: 2px solid var(--ink); background: var(--white); color: var(--ink);
  text-decoration: none; min-height: 48px; white-space: nowrap;
}
.btn:hover { background: var(--mint); }
.btn--primary { background: var(--green); border-color: var(--green); color: #fff; }
.btn--primary:hover { background: var(--green-deep); border-color: var(--green-deep); }
.search--big .btn--primary { padding: 0 1.6rem; font-size: var(--t-md); background: var(--glow); border-color: var(--glow); color: var(--night); }
.search--big .btn--primary:hover { background: #5ee6a1; }

/* ── Quick links & nations ────────────────── */
.quick { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius-m); overflow: hidden; margin: -1.75rem 0 2.5rem; position: relative; box-shadow: 0 8px 24px -12px rgba(11, 59, 42, .35); }
.quick a { background: var(--white); padding: 1.1rem 1.25rem; text-decoration: none; color: var(--ink); display: flex; flex-direction: column; gap: .15rem; }
.quick a:hover { background: var(--mint); }
.quick strong { font-size: var(--t-md); }
.quick span { color: var(--muted); font-size: var(--t-sm); }
@media (max-width: 760px) { .quick { grid-template-columns: 1fr 1fr; margin-top: 1.25rem; } }

.block { margin: 2.5rem 0; }
.nations { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: .75rem; }
.nations a { padding-right: 2.75rem !important; display: flex; flex-direction: column; padding: 1.25rem; border: 2px solid var(--ink); border-radius: var(--radius-m); text-decoration: none; color: var(--ink); background: var(--white); position: relative; }
.nations a::after { content: ''; position: absolute; right: 1rem; top: 1rem; width: 18px; height: 18px; background: var(--green); clip-path: polygon(35% 0, 65% 0, 65% 35%, 100% 35%, 100% 65%, 65% 65%, 65% 100%, 35% 100%, 35% 65%, 0 65%, 0 35%, 35% 35%); }
.nations a:hover { background: var(--mint); }
.n-name { font-weight: 800; font-size: var(--t-md); }
.n-count { color: var(--muted); }
@media (max-width: 760px) { .nations { grid-template-columns: 1fr 1fr; } }

.link-cols { list-style: none; padding: 0; margin: 0 0 1rem; columns: 4 200px; column-gap: 2rem; }
.link-cols li { break-inside: avoid; padding: .3rem 0; display: flex; justify-content: space-between; gap: .75rem; border-bottom: 1px dotted var(--line); }
.link-cols span { color: var(--muted); font-variant-numeric: tabular-nums; font-size: var(--t-sm); }

.split { display: grid; grid-template-columns: 1.2fr 1fr; gap: 3rem; padding: 2rem; background: var(--mint); border-radius: var(--radius-m); }
.split h2 { font-size: var(--t-md); }
@media (max-width: 760px) { .split { grid-template-columns: 1fr; gap: 1.5rem; padding: 1.25rem; } }
.ticks { list-style: none; padding: 0; columns: 2 180px; }
.ticks li { padding: .2rem 0 .2rem 1.6rem; position: relative; }
.ticks li::before { content: ''; position: absolute; left: 0; top: .5em; width: 12px; height: 12px; background: var(--green); clip-path: polygon(35% 0, 65% 0, 65% 35%, 100% 35%, 100% 65%, 65% 65%, 65% 100%, 35% 100%, 35% 65%, 0 65%, 0 35%, 35% 35%); }
.guide-list { padding-left: 1.1rem; }
.guide-list li { margin-bottom: .5rem; }

/* ── Breadcrumbs & list pages ─────────────── */
.crumbs ol { list-style: none; padding: 0; margin: 1.25rem 0 1rem; display: flex; flex-wrap: wrap; font-size: var(--t-sm); color: var(--muted); }
.crumbs li + li::before { content: '›'; margin: 0 .5rem; color: var(--muted); }
.crumbs a { color: var(--muted); }
.list-head { margin-bottom: 1.5rem; }
.lede { font-size: var(--t-md); color: var(--muted); max-width: 60ch; }

.filters { display: flex; flex-wrap: wrap; gap: .5rem; margin: 0 0 1rem; align-items: center; }
.chip { font: inherit; font-size: var(--t-sm); font-weight: 600; padding: .55rem .95rem; border-radius: 999px; border: 2px solid var(--ink); background: var(--white); color: var(--ink); cursor: pointer; min-height: 44px; }
.chip span { color: var(--muted); font-weight: 400; margin-left: .25rem; }
.chip[aria-pressed='true'] { background: var(--ink); color: #fff; }
.chip[aria-pressed='true'] span { color: #c9d6cf; }
.filter-empty { width: 100%; color: var(--muted); margin: .5rem 0 0; }
.search-msg { color: var(--muted); }
.search-head { padding-top: 1.75rem; }
.pill { white-space: nowrap; }

/* Pharmacy rows */
.rows { list-style: none; padding: 0; margin: 0 0 1.5rem; border-top: 1px solid var(--line); }
.row {
  display: grid; grid-template-columns: 13.5rem minmax(0, 1fr) auto; grid-template-areas: 'status name dist' 'status addr tel';
  gap: .15rem 1rem; padding: .95rem .5rem; border-bottom: 1px solid var(--line); align-items: baseline;
}
.row:hover { background: var(--white); }
.row[hidden] { display: none; }
.row .status { grid-area: status; align-self: center; }
.row-name { grid-area: name; font-weight: 600; font-size: var(--t-md); line-height: 1.3; }
.row-addr { grid-area: addr; color: var(--muted); font-size: var(--t-sm); }
.row-tel { grid-area: tel; font-size: var(--t-sm); white-space: nowrap; justify-self: end; }
.row-dist { grid-area: dist; font-weight: 600; font-variant-numeric: tabular-nums; justify-self: end; white-space: nowrap; }
.rows--compact .row { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: 'name dist' 'addr dist' 'status status'; padding: .75rem 0; }
.rows--compact .row-name { font-size: var(--t-base); }
.rows--compact .row-tel { display: none; }
.rows--compact .status { margin-top: .25rem; }
@media (max-width: 640px) {
  .row { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: 'name dist' 'addr addr' 'status tel'; padding: .9rem 0; }
  .row .status { margin-top: .35rem; }
}

.pill { display: inline-block; font-size: var(--t-sm); font-weight: 600; padding: .2rem .6rem; border-radius: var(--radius-s); line-height: 1.4; }
.pill--open { background: var(--open-bg); color: var(--open-fg); }
.pill--soon { background: var(--soon-bg); color: var(--soon-fg); }
.pill--closed { background: var(--closed-bg); color: var(--closed-fg); }
.pill--unknown { background: #eef1ef; color: var(--muted); font-weight: 400; }
.pill small { font-weight: 400; font-size: 1em; }

/* ── Pharmacy page ────────────────────────── */
.ph-head { padding: .5rem 0 1.5rem; border-bottom: 1px solid var(--line); margin-bottom: 2rem; }
.ph-head h1 { margin-bottom: .2rem; }
.ph-sub { color: var(--muted); font-size: var(--t-md); margin-bottom: 1rem; }
.status--big .pill { font-size: var(--t-md); padding: .45rem .9rem; }
.actions { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 1rem; }
.ph-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 3rem; }
.ph-main .block:first-child { margin-top: 0; }
.ph-side .map { margin-bottom: 2rem; }
@media (max-width: 860px) { .ph-grid { grid-template-columns: 1fr; gap: 0; } }

.hours { width: 100%; max-width: 30rem; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.hours th, .hours td { text-align: left; padding: .6rem .75rem; border-bottom: 1px solid var(--line); }
.hours th { font-weight: 600; width: 40%; }
.hours tr.today { background: var(--mint); box-shadow: inset 4px 0 0 var(--green); }
.hours tr.today th::after { content: ' (today)'; font-weight: 400; color: var(--muted); }
.note { color: var(--muted); font-size: var(--t-sm); margin-top: .75rem; }
.note.bank { color: var(--soon-fg); background: var(--soon-bg); padding: .6rem .8rem; border-radius: var(--radius-s); }
address { font-style: normal; font-size: var(--t-md); margin-bottom: 1.25rem; }
.facts { margin: 0; display: grid; gap: .4rem; }
.facts div { display: grid; grid-template-columns: 11rem 1fr; gap: 1rem; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; }
@media (max-width: 480px) { .facts div { grid-template-columns: 1fr; gap: 0; } .facts dd { margin-bottom: .4rem; } }
.map iframe { width: 100%; aspect-ratio: 4 / 3; border: 1px solid var(--line); border-radius: var(--radius-m); display: block; background: var(--mint); }
.map-link { display: inline-block; margin-top: .4rem; font-size: var(--t-sm); }
.faq h3 { font-size: var(--t-base); margin: 1.25rem 0 .25rem; }
.report { margin-top: 2rem; padding: 1rem 1.25rem; background: var(--white); border: 1px solid var(--line); border-radius: var(--radius-m); color: var(--muted); }

/* ── Articles ─────────────────────────────── */
.prose { max-width: 68ch; }
.article { padding-bottom: 1rem; }
.article h1 { margin-top: .5rem; }
.article h2 { margin-top: 2rem; font-size: var(--t-md); }
.article li { margin-bottom: .35rem; }
.meta { color: var(--muted); font-size: var(--t-sm); }
.source { color: var(--muted); font-size: var(--t-sm); border-top: 1px solid var(--line); padding-top: 1rem; margin-top: 2rem; }
.warn { background: var(--soon-bg); color: var(--soon-fg); padding: 1rem 1.25rem; border-radius: var(--radius-m); }
table.data { border-collapse: collapse; width: 100%; margin: 0 0 1.5rem; font-size: var(--t-sm); }
table.data th, table.data td { text-align: left; padding: .6rem .75rem; border-bottom: 1px solid var(--line); vertical-align: top; }
table.data thead th { border-bottom: 2px solid var(--ink); }
.cta-box { margin: 2.5rem 0; padding: 1.5rem; background: var(--mint); border-radius: var(--radius-m); }
.cta-box h2 { margin-top: 0 !important; }
.guide-index { list-style: none; padding: 0; margin: 0; border-top: 1px solid var(--line); max-width: 60rem; }
.guide-index a { display: block; padding: 1.1rem 0; border-bottom: 1px solid var(--line); text-decoration: none; color: var(--ink); }
.guide-index strong { display: block; font-size: var(--t-md); color: var(--green-deep); text-decoration: underline; text-underline-offset: .18em; text-decoration-thickness: 1px; }
.guide-index span { color: var(--muted); }

/* ── Ads ──────────────────────────────────── */
.ad { margin: 2rem 0; min-height: 280px; text-align: center; }
.ad-label { display: block; font-size: .75rem; color: var(--muted); margin-bottom: .25rem; }

/* ── Footer ───────────────────────────────── */
.site-foot { background: var(--night); color: #c3e3d3; margin-top: 4rem; padding: 3rem 0 2rem; font-size: var(--t-sm); }
.site-foot a { color: #f2fbf6; }
.foot-grid { display: grid; grid-template-columns: 1.5fr 1fr 1fr 1fr; gap: 2rem; margin-bottom: 2rem; }
.foot-grid h2 { font-size: var(--t-base); color: #fff; }
.foot-grid ul { list-style: none; padding: 0; margin: 0; }
.foot-grid li { margin-bottom: .45rem; }
.logo--foot { color: #fff; margin-bottom: .75rem; }
.logo--foot .logo-cross { fill: var(--glow); }
.logo--foot b { color: var(--glow); }
.legal { border-top: 1px solid rgba(255, 255, 255, .15); padding-top: 1rem; color: #9fc4b2; margin: 0 0 .5rem; }
@media (max-width: 760px) { .foot-grid { grid-template-columns: 1fr 1fr; } .foot-brand { grid-column: 1 / -1; } }
