/* Φαρμακείο Πιστοφίδου: the box, the leaflet, the blister. Local fonts only (OFL, see assets/fonts). */
@font-face { font-family: "Sofia Sans"; src: url("fonts/SofiaSans-wght.woff2") format("woff2"); font-weight: 1 1000; font-display: swap; }
@font-face { font-family: "Sofia Sans Extra Condensed"; src: url("fonts/SofiaSansExtraCondensed-wght.woff2") format("woff2"); font-weight: 1 1000; font-display: swap; }
@font-face { font-family: "Mynerve"; src: url("fonts/Mynerve-Regular.woff2") format("woff2"); font-weight: 400; font-display: swap; }

:root {
  --paper: #f3eee4;
  --paper-deep: #e7dfd0;
  --ink: #16211c;
  --ink-soft: #3f4b45;
  --green: #01815f;
  --green-text: #016a4e;
  --green-name: #017959; /* the sign green, one step darker: 4.68:1 on the paper (the sign green itself is 4.22:1) */
  --closed: #8a2a17;
  --mark: #ffe680;
  --pen: #1f3fa8;
  --gut: clamp(20px, 5vw, 96px);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='260' height='260'%3E%3Cfilter id='n' x='0' y='0' width='100%25' height='100%25'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9 .35' numOctaves='3' seed='7' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .32 0 0 0 0 .27 0 0 0 0 .2 0 0 0 .09 0'/%3E%3C/filter%3E%3Crect width='260' height='260' filter='url(%23n)'/%3E%3C/svg%3E");
  color: var(--ink);
  font: 400 1.1875rem/1.55 "Sofia Sans", "Helvetica Neue", Arial, sans-serif;
  overflow-x: hidden;
}
p { margin: 0 0 1em; }
a { color: var(--green-text); text-decoration-thickness: 2px; text-underline-offset: 0.18em; }
a:hover { color: var(--ink); }
:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; border-radius: 3px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip { position: absolute; left: 12px; top: -80px; z-index: 20; background: var(--ink); color: #fff; padding: 12px 18px; min-height: 44px; }
.skip:focus { top: 12px; color: #fff; }

#gl { position: fixed; left: 0; top: 0; width: 100%; height: 100%; z-index: 1; pointer-events: none; display: none; }
.gl #gl { display: block; }
.veil { display: none; }

mark.ph { background: var(--mark); color: var(--ink); padding: 0.1em 0.3em; border-radius: 3px; box-decoration-break: clone; -webkit-box-decoration-break: clone; }

.sec { position: relative; padding: 0 var(--gut); }
.copy { position: relative; z-index: 2; max-width: 34rem; }
.eyebrow { font-weight: 600; font-size: 1.125rem; letter-spacing: 0.01em; color: var(--ink-soft); margin: 0 0 0.4em; }
.title { font: 800 clamp(2.6rem, 5.2vw, 5rem)/0.95 "Sofia Sans Extra Condensed", "Sofia Sans", sans-serif; letter-spacing: 0.005em; margin: 0 0 0.35em; color: var(--ink); text-wrap: balance; }
.bigword { --bw: min(24vw, 44vh); position: sticky; z-index: 0; top: 5vh; height: calc(var(--bw) * 0.8); margin: 0 0 calc(var(--bw) * -0.8); font: 800 var(--bw)/0.8 "Sofia Sans Extra Condensed", sans-serif; color: var(--paper-deep); white-space: nowrap; pointer-events: none; user-select: none; }

/* ---------- hero */
.hero { padding-top: 3.2vh; padding-bottom: 8vh; }
.gl .hero { min-height: 135vh; }
.hero .eyebrow { position: relative; z-index: 2; }
.name { position: relative; z-index: 0; margin: 0; font: 800 min(14.3vw, 29vh)/0.82 "Sofia Sans Extra Condensed", "Sofia Sans", sans-serif; color: var(--green-name); letter-spacing: -0.005em; }
.name span { display: block; }
.facts { margin-top: 3.2vh; max-width: 36rem; }
.slogan { font: 700 clamp(1.7rem, 2.4vw, 2.3rem)/1.05 "Sofia Sans Extra Condensed", sans-serif; letter-spacing: 0.01em; margin: 0 0 0.5em; }
.status { margin: 0 0 0.2em; }
.status-now { display: inline-block; font-weight: 800; font-size: 1.75rem; line-height: 1.15; margin-right: 0.35em; }
.status-now::before { content: ""; display: inline-block; width: 0.5em; height: 0.5em; border-radius: 50%; background: currentColor; margin-right: 0.35em; vertical-align: 0.08em; }
.status:not([data-state]) .status-now::before { display: none; }
[data-state="open"] .status-now { color: var(--green-text); }
[data-state="closed"] .status-now { color: var(--closed); }
.status-next { font-size: 1.1875rem; }
.today { font-weight: 600; margin: 0 0 0.9em; }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem 1.4rem; margin: 0.6em 0 0.9em; }
.call { display: inline-flex; align-items: center; gap: 0.5em; min-height: 60px; padding: 0.55em 1.2em; background: var(--green); color: #fff; font-weight: 700; font-size: 1.375rem; line-height: 1.1; text-decoration: none; border-radius: 6px; box-shadow: 0 1px 0 #015a43, 0 10px 22px -14px rgba(1, 60, 44, 0.8); transition: transform 0.2s ease, background 0.2s ease; }
.call .num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.call:hover { background: #016f52; color: #fff; transform: translateY(-1px); }
.call:active { transform: translateY(1px); }
.note { font: 400 1.375rem/1.1 "Mynerve", cursive; color: var(--pen); margin: 0; transform: rotate(-3deg); }
.addr { margin: 0; }
.addr a { display: inline-block; padding: 0.55em 0; }

/* ---------- stills: shown when the canvas is not running (no JavaScript, no WebGL2, too slow) */
.still { display: block; width: 100%; max-width: 30rem; height: auto; margin: 1.5rem 0; border-radius: 4px; position: relative; z-index: 2; }
.gl .still { display: none; }

/* ---------- leaflet */
.leaflet { padding-top: 12vh; }
.leaflet .copy { margin-left: 56%; }
.leaflet .lead { margin-left: 0; max-width: 30rem; padding-bottom: 2rem; }
/* the lead is read while the carton is still on screen; it has left before the leaflet lands on this side */
.gl .leaflet .lead { margin-top: -30vh; min-height: 76vh; }
.fold { display: flex; flex-direction: column; justify-content: center; padding: 1.5rem 0; }
.gl .fold { min-height: 82vh; }
.fold h3 { font: 800 clamp(2.2rem, 3.6vw, 3.4rem)/1 "Sofia Sans Extra Condensed", sans-serif; margin: 0 0 0.3em; }
.fold p { font-size: 1.3125rem; }
.num-mark { font: 800 1.25rem/1 "Sofia Sans", sans-serif; color: #fff; background: var(--green); width: 2.2rem; height: 2.2rem; border-radius: 50%; display: grid; place-items: center; margin: 0 0 0.9rem; }

/* ---------- blister / hours */
.blister { padding-top: 14vh; padding-bottom: 12vh; }
.gl .blister { min-height: 175vh; }
.blister .copy { margin-left: 50%; }
.gl .blister .copy { position: sticky; top: 16vh; }
.hours { border-collapse: collapse; width: 100%; font-size: 1.25rem; font-variant-numeric: tabular-nums; margin: 0.4rem 0 1.2rem; }
.hours th, .hours td { text-align: left; padding: 0.62rem 0.7rem; vertical-align: baseline; border-bottom: 1px solid #cfc7b6; }
.hours th { font-weight: 600; width: 9.5em; }
.hours .and { color: var(--ink-soft); }
.hours tr.is-today th, .hours tr.is-today td { background: #fffdf6; font-weight: 800; border-bottom-color: var(--green); }
.hours tr.is-today th { box-shadow: inset 6px 0 0 var(--green); padding-left: 1rem; }
.hours .tag { display: inline-block; font-size: 1.125rem; font-weight: 700; color: #fff; background: var(--green); padding: 0.05em 0.5em 0.12em; border-radius: 999px; margin-left: 0.3em; }
.duty a { font-weight: 700; display: inline-block; padding: 0.5em 0; }

/* ---------- jar / services */
.jar { padding-top: 14vh; padding-bottom: 12vh; }
.gl .jar { min-height: 215vh; }
.jar .copy { margin-left: 50%; max-width: 36rem; }
.gl .jar .copy { position: sticky; top: 14vh; }
.services { list-style: none; margin: 1.2rem 0 0; padding: 0; }
.services li { position: relative; padding: 0.7rem 0 0.7rem 3.4rem; min-height: 3.4rem; border-bottom: 1px solid #cfc7b6; }
.services li[data-tab]::before { content: ""; position: absolute; left: 0.55rem; top: 1.05rem; width: 1.5rem; height: 1.5rem; border-radius: 50%; background: #fff; box-shadow: inset 0 -2px 3px rgba(60, 50, 30, 0.25), 0 1px 2px rgba(60, 50, 30, 0.35); }
.tabs3d .services li[data-tab]::before { display: none; }
.services li.more { border-bottom: 0; }

/* ---------- mortar */
.mortar { padding-top: 14vh; padding-bottom: 12vh; }
.gl .mortar { min-height: 190vh; }
.gl .mortar .copy { position: sticky; top: 20vh; }
.ask { font-weight: 700; font-size: 1.5rem; }
.ask a { display: inline-block; padding: 0.35em 0; white-space: nowrap; }

/* ---------- footer */
.foot { padding-top: 14vh; padding-bottom: 14vh; }
.gl .foot { min-height: 100vh; padding-top: 20vh; }
.foot address { font-style: normal; font-size: 1.375rem; font-weight: 600; margin: 0 0 1.1rem; }
.links { list-style: none; padding: 0; margin: 1.2rem 0; display: flex; flex-wrap: wrap; gap: 0.2rem 1.8rem; }
.links a { display: inline-block; padding: 0.6em 0; font-weight: 700; font-size: 1.25rem; }
.small { color: var(--ink-soft); }

.bar { display: none; }

/* desktop stills sit on the object side */
@media (min-width: 821px) {
  html:not(.gl) .sec { min-height: calc(30vw + 22vh); }
  html:not(.gl) .bigword { display: none; }
  .sec > .still { position: absolute; width: 38%; max-width: none; top: 10vh; margin: 0; }
  .hero > .still, .mortar > .still, .foot > .still { right: var(--gut); }
  .hero > .still { top: 24vh; z-index: 1; }
  .leaflet > .still, .blister > .still, .jar > .still { left: var(--gut); }
}

/* ---------- phone */
@media (max-width: 820px) {
  body { font-size: 1.1875rem; }
  .gl #gl { z-index: 4; }
  .gl .veil { display: block; position: fixed; z-index: 3; left: 0; top: 0; width: 100%; height: 46svh; pointer-events: none; opacity: 0; background: linear-gradient(to bottom, var(--paper) 0%, var(--paper) 93%, rgba(243, 238, 228, 0) 100%); }
  .bigword { display: none; }
  .copy { max-width: none; }
  .hero, .gl .hero { min-height: 0; padding-top: 12px; padding-bottom: 12svh; }
  html:not(.gl) .bigword { display: none; }
  html:not(.gl) .sec:not(.hero) { padding-top: 6svh; padding-bottom: 6svh; }
  .hero .eyebrow { font-size: 1.125rem; line-height: 1.25; margin-bottom: 6px; }
  .name { font-size: min(24vw, 14.5svh); line-height: 0.84; }
  .addr .sep { display: none; }
  .addr a { display: block; width: max-content; }
  .hero .still { width: auto; max-width: 100%; height: 30svh; margin: 0 auto; object-fit: contain; }
  .gl .hero .still { display: block; visibility: hidden; }
  .facts { margin-top: 0; }
  .slogan { display: none; }
  .status-now { font-size: 1.625rem; }
  .status-next { display: block; }
  .today { margin-bottom: 0.5em; }
  .actions { margin: 0.4em 0 0.5em; }
  .call { width: 100%; justify-content: center; min-height: 62px; font-size: 1.4375rem; }
  .note { display: none; }
  .gl .sec:not(.hero) { padding-top: 24svh; }
  .gl #orario { scroll-margin-top: 23svh; }
  /* keyboard focus on a phone: a focused link is never scrolled under the object or under the call bar */
  .gl main a { scroll-margin-top: 50svh; scroll-margin-bottom: 96px; }
  .leaflet .copy, .blister .copy, .jar .copy { margin-left: 0; }
  .leaflet { padding-top: 6svh; }
  .leaflet .lead, .gl .leaflet .lead { margin-top: 0; min-height: 0; padding-bottom: 8svh; }
  .gl .fold { min-height: 62svh; justify-content: flex-start; }
  .gl .blister, .gl .jar, .gl .mortar { min-height: 0; padding-bottom: 16svh; }
  .gl .blister .copy, .gl .jar .copy, .gl .mortar .copy { position: relative; top: auto; }
  .hours { font-size: 1.1875rem; }
  .hours th { width: 6.6em; padding-left: 0.4rem; }
  .hours td { padding-right: 0.2rem; }
  .hours tr.is-today th { padding-left: 0.8rem; }
  .hours .tag { display: block; width: max-content; margin: 0.15em 0 0; }
  .foot, .gl .foot { min-height: 0; padding-bottom: 110px; }
  .bar:not([hidden]) { display: flex; position: fixed; z-index: 6; left: 0; right: 0; bottom: 0; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 12px calc(8px + env(safe-area-inset-bottom)); background: #fffdf6; border-top: 1px solid #cfc7b6; transform: translateY(110%); transition: transform 0.35s cubic-bezier(0.2, 0.7, 0.2, 1); }
  .bar.on { transform: none; }
  .bar-status { font-weight: 800; font-size: 1.1875rem; }
  .bar-status[data-state="open"] { color: var(--green-text); }
  .bar-status[data-state="closed"] { color: var(--closed); }
  .bar-call { display: inline-flex; align-items: center; min-height: 48px; padding: 0 1.4em; background: var(--green); color: #fff; font-weight: 700; font-size: 1.25rem; text-decoration: none; border-radius: 6px; }
}

/* still-capture mode (?still=1): only the canvas on paper */
.capture main, .capture .bar, .capture .veil, .capture .skip { display: none !important; }

@media (prefers-reduced-motion: reduce) {
  .call, .bar { transition: none; }
}
