/* Avon Osteopathy – the logo's deep petrol blue (the old site's background) and its sky tint, now
   with warm paper grounds so long text is easier to read. The logo's pill gives the rounded photo
   frames and buttons, its spine of dots the small motif, the old site's line drawing the hands.
   DM Sans stays from the old site; Newsreader adds a softer voice for headings. Mobile first.
   Spacing is on a 4 px grid; type uses the six sizes below and two weights per family. */

@font-face { font-family: 'DM Sans'; font-weight: 400; font-style: normal; font-display: swap; src: url(../fonts/dm-sans-latin-400-normal.woff2) format('woff2'); }
@font-face { font-family: 'DM Sans'; font-weight: 500; font-style: normal; font-display: swap; src: url(../fonts/dm-sans-latin-500-normal.woff2) format('woff2'); }
@font-face { font-family: Newsreader; font-weight: 300; font-style: normal; font-display: swap; src: url(../fonts/newsreader-latin-300-normal.woff2) format('woff2'); }
@font-face { font-family: Newsreader; font-weight: 400; font-style: normal; font-display: swap; src: url(../fonts/newsreader-latin-400-normal.woff2) format('woff2'); }

:root {
  color-scheme: light;
  --petrol: #004C6F;
  --petrol-deep: #003A56;
  --sky: #8FDCF7;            /* the logo's light dots; the main action, and text on petrol */
  --teal: #0F6C8F;           /* links on light grounds (5.2:1 on ice, 5.4:1 on paper) */
  --ice: #E8F3F6;
  --paper: #F8F5EF;
  --white: #fff;
  --ink: #17333F;
  --ink-soft: #3D5560;
  --on-petrol: #D9EAF0;
  --line: #D5DEDF;
  --heading: var(--petrol);  /* headings and large text on the page grounds */
  --surface: var(--white);   /* cards */
  --focus: var(--teal);      /* white on the dark bands, below */
  --head: Newsreader, Georgia, 'Times New Roman', serif;
  --body: 'DM Sans', system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
  --fs-small: .9375rem;      /* 15 px */
  --fs-body: 1.0625rem;      /* 17 px */
  --fs-lead: clamp(1.1875rem, 2.2vw, 1.375rem);
  --fs-h3: 1.375rem;         /* 22 px */
  --fs-h2: clamp(2rem, 4vw, 2.75rem);
  --fs-h1: clamp(2.75rem, 7vw, 4.5rem);
  --wrap: 72rem;
  --text-width: 42rem;
  --gutter: clamp(1rem, 5vw, 3rem);
  --pill: 2.75rem;           /* the logo's pill corner, on large photos */
  --card: 1.5rem;            /* corner and padding of every card */
}
/* Dark: the page grounds turn a petrol-tinted near-black; the petrol bands, logo and sky stay.
   Guarded, because a light-dark() token in an older browser is invalid, not light */
@supports (color: light-dark(#000, #fff)) {
  :root {
    color-scheme: light dark;
    --teal: light-dark(#0F6C8F, #8FDCF7);
    --ice: light-dark(#E8F3F6, #122B38);
    --paper: light-dark(#F8F5EF, #0D1E28);
    --surface: light-dark(#fff, #173443);
    --ink: light-dark(#17333F, #EAF3F6);
    --ink-soft: light-dark(#3D5560, #C3D5DC);
    --line: light-dark(#D5DEDF, #2C4A59);
    --heading: light-dark(#004C6F, #CBE9F4);
  }
}
@media (prefers-contrast: more) { :root { --ink-soft: var(--ink); --line: var(--ink); --on-petrol: var(--white); } }
.site-top, .hero, .page-head, .split-dark, .book, .site-footer { --focus: var(--white); }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; font: 400 var(--fs-body)/1.65 var(--body); color: var(--ink-soft); background: var(--paper); }
img { max-width: 100%; height: auto; display: block; }
picture { display: block; }
a { color: var(--teal); text-underline-offset: .18em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 4px; }
h1, h2, h3 { font-family: var(--head); font-weight: 400; line-height: 1.12; color: var(--heading); text-wrap: balance; margin: 0 0 1rem; }
h1 { font-weight: 300; font-size: var(--fs-h1); letter-spacing: -.012em; }
h2 { font-size: var(--fs-h2); letter-spacing: -.008em; margin-bottom: 1.5rem; }
h3 { font-size: var(--fs-h3); line-height: 1.2; margin-bottom: .5rem; }
p { margin: 0 0 1rem; }
strong { font-weight: 500; }
.lead { font-size: var(--fs-lead); line-height: 1.5; }

.wrap { width: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: var(--gutter); }
.wrap-text { max-width: calc(var(--text-width) + 2 * var(--gutter)); }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip-link { position: absolute; left: 1rem; top: -4rem; z-index: 30; background: var(--white); color: var(--petrol); padding: .5rem 1rem; border-radius: 99px; }
.skip-link:focus { top: .75rem; }

/* Buttons take their shape from the logo's pill. Sky is the main action, the outline the second */
.btn { display: inline-block; padding: .75rem 1.5rem; border-radius: 99px; font-weight: 500; line-height: 1.2; text-decoration: none; overflow-wrap: anywhere; transition: background-color .2s, color .2s; }
.btn-sky { background: var(--sky); color: var(--petrol-deep); }
.btn-sky:hover { background: var(--white); }
.btn-line { box-shadow: inset 0 0 0 1.5px var(--sky); color: var(--white); }
.btn-line:hover { background: var(--sky); color: var(--petrol-deep); }

/* Rounded photo frame */
.frame { display: block; border-radius: var(--pill); overflow: hidden; background: var(--ice); }
.frame img { width: 100%; height: 100%; object-fit: cover; }

/* Header */
.site-top { position: sticky; top: 0; z-index: 20; background: var(--petrol); }
.top-inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding-block: .75rem; }
.brand img { width: 5rem; height: auto; }
.nav-toggle { width: 2.75rem; height: 2.75rem; border: 0; padding: 0; background: none; display: grid; place-items: center; cursor: pointer; }
.nav-toggle-bars, .nav-toggle-bars::before, .nav-toggle-bars::after { display: block; width: 1.5rem; height: 2px; background: var(--white); transition: transform .2s, background-color .2s; }
.nav-toggle-bars { position: relative; }
.nav-toggle-bars::before, .nav-toggle-bars::after { content: ''; position: absolute; left: 0; }
.nav-toggle-bars::before { top: -8px; }
.nav-toggle-bars::after { top: 8px; }
.nav-toggle[aria-expanded="true"] .nav-toggle-bars { background: transparent; }
.nav-toggle[aria-expanded="true"] .nav-toggle-bars::before { transform: translateY(8px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle-bars::after { transform: translateY(-8px) rotate(-45deg); }
.nav-list { list-style: none; margin: 0; padding: 0; }
.nav-link { display: block; padding: .75rem 0; color: var(--white); text-decoration: none; font-weight: 500; }
.nav-link[aria-current="page"] { color: var(--sky); }
.nav-link:hover { color: var(--sky); }
.nav-book { padding-block: .5rem 1rem; }

/* Phone menu: drops under the bar. Without JavaScript it is a plain list */
@media (max-width: 55.99rem) {
  .top-inner { flex-wrap: wrap; }
  .site-nav { flex-basis: 100%; }
  .js .site-nav { display: none; }
  .js .site-nav.is-open { display: block; }
  html:not(.js) .nav-toggle { display: none; }
}
@media (min-width: 56rem) {
  .nav-toggle { display: none; }
  .nav-list { display: flex; align-items: center; gap: 1.5rem; }
  .nav-link { padding: .5rem 0; font-size: var(--fs-small); }
  .nav-book { padding: 0 0 0 .5rem; }
  .nav-book .btn { font-size: var(--fs-small); }
  .brand img { width: 5.5rem; }
}

/* Hero */
.hero { position: relative; overflow: hidden; background: var(--petrol); color: var(--on-petrol); }
.hero h1 { color: var(--white); }
.hero-kicker { margin: 0 0 1rem; font-size: var(--fs-small); font-weight: 500; color: var(--sky); }
.hero-hands { position: absolute; left: -14%; bottom: 0; width: 86rem; max-width: none; opacity: .07; pointer-events: none; }
.hero-inner { position: relative; display: grid; gap: 2.5rem; padding-block: 2.5rem 5rem; }
.hero-links { display: flex; flex-wrap: wrap; gap: .75rem; margin: 1.75rem 0 0; }
.hero-photo { aspect-ratio: 1 / 1; }
.hero-spine, .head-spine { position: absolute; right: var(--gutter); bottom: 1.25rem; width: 8rem; height: auto; opacity: .5; }
@media (min-width: 56rem) {
  .hero-inner { grid-template-columns: 1.1fr .9fr; align-items: center; gap: 4rem; padding-block: 4.5rem 5.5rem; }
}

/* The opening questions */
.questions { padding-block: clamp(3.5rem, 8vw, 6rem); }
.question-list { list-style: none; margin: 0 0 2rem; padding: 0; display: grid; gap: .75rem; }
.question-list li { position: relative; padding: 1rem 1.5rem 1rem 3rem; background: var(--surface); border-radius: var(--card); color: var(--ink); }
.question-list li::before { content: ''; position: absolute; left: 1.5rem; top: 1.5rem; width: .75rem; height: .75rem; border-radius: 50%; background: var(--teal); }
.questions-closing { font-size: var(--fs-lead); line-height: 1.5; color: var(--heading); margin: 0; max-width: 40rem; }
@media (min-width: 44rem) { .question-list { grid-template-columns: 1fr 1fr; } .question-list li:last-child { grid-column: 1 / -1; } }

/* Photo and text, side by side */
.split { padding-block: clamp(3.5rem, 8vw, 6rem); }
.split-inner { display: grid; gap: 2.5rem; align-items: center; }
.split .frame { aspect-ratio: 4 / 3; }
.split-ice { background: var(--ice); }
.split-dark { background: var(--petrol); color: var(--on-petrol); }
.split-dark h2 { color: var(--white); }
.split-dark a { color: var(--sky); }
.more { font-weight: 500; }
.more::after { content: ' →'; }
@media (min-width: 56rem) {
  .split-inner { grid-template-columns: 5fr 6fr; gap: 4.5rem; }
  .split .frame { aspect-ratio: 5 / 6; }
  .split-flip .frame { order: 2; }
}

/* What Avon Osteopathy offer: a plain list, so items without a description sit as naturally as the rest */
.offer { padding-block: clamp(3.5rem, 8vw, 6rem); }
.offer-list { list-style: none; margin: 0; padding: 0; display: grid; column-gap: 3rem; }
.offer-item { padding-block: 1.5rem; border-top: 1px solid var(--line); }
.offer-item p { margin: 0; }
@media (min-width: 44rem) { .offer-list { grid-template-columns: 1fr 1fr; } }

/* Inner page heads */
.page-head { position: relative; overflow: hidden; background: var(--petrol); color: var(--on-petrol); }
.page-head h1 { color: var(--white); }
.page-head a { color: var(--sky); }
.page-head-inner { display: grid; gap: 2rem; padding-block: 2.5rem 4rem; }
.page-head .lead { margin: 0; max-width: 40rem; }
.page-head .frame { aspect-ratio: 4 / 3; border-radius: 2rem; }
@media (min-width: 56rem) {
  .page-head.has-image .page-head-inner { grid-template-columns: 1.25fr .75fr; align-items: center; gap: 4rem; padding-block: 3.5rem 4.5rem; }
  .page-head-inner { padding-block: 3.5rem 4.5rem; }
}

/* Long text */
.prose-photo { margin-top: 2.5rem; aspect-ratio: 4 / 3; }
.prose-section { padding-block: clamp(3rem, 7vw, 5rem); }
.prose h2 { margin-top: 3rem; }
.prose h2:first-child { margin-top: 0; }
.prose h3 { margin-top: 2rem; }
.prose ul, .prose ol { padding-left: 1.25rem; margin: 0 0 1rem; }
.prose li { margin-bottom: .5rem; }
.prose li::marker { color: var(--teal); }
.prose > :last-child { margin-bottom: 0; }
.prose p > img { border-radius: 2rem; margin-block: 1.5rem; }
.prose strong { color: var(--ink); }
.split-dark .prose strong { color: var(--white); }

/* FAQs */
.faq-section { padding-block: clamp(3rem, 7vw, 5rem); }
.faq-list { display: grid; gap: .75rem; }
.faq { background: var(--surface); border-radius: var(--card); }
.faq summary { display: flex; justify-content: space-between; gap: 1rem; padding: 1.25rem var(--card); cursor: pointer; list-style: none; font-family: var(--head); font-size: var(--fs-h3); line-height: 1.2; color: var(--heading); }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: '+'; flex: none; font: 400 var(--fs-h3)/1 var(--body); color: var(--teal); transition: transform .2s; }
.faq[open] summary::after { transform: rotate(45deg); }
.faq-a { padding: 0 var(--card) var(--card); }
.faq-a > :last-child { margin-bottom: 0; }

/* Contact */
.contact-section { padding-block: clamp(3rem, 7vw, 5rem); }
.contact-grid { display: grid; gap: 1rem; }
.contact-card { padding: var(--card); background: var(--surface); border-radius: var(--card); }
.contact-card h2 { font-size: var(--fs-h3); margin-bottom: 1rem; }
.contact-card address { font-style: normal; color: var(--ink); }
.contact-big { font-weight: 500; overflow-wrap: anywhere; margin-bottom: .5rem; }
.contact-note { font-size: var(--fs-small); margin: .75rem 0 0; overflow-wrap: anywhere; }
@media (min-width: 56rem) { .contact-grid { grid-template-columns: repeat(3, 1fr); } }

/* Booking band */
.book { background: var(--petrol-deep); color: var(--on-petrol); padding-block: clamp(3rem, 7vw, 4.5rem); }
.book h2 { color: var(--white); max-width: 40rem; }
.book-spine { margin: 0 0 1.25rem; width: 8rem; opacity: .75; }
.book-links { display: flex; flex-wrap: wrap; gap: .75rem; margin: 0; }

/* Footer */
.site-footer { position: relative; overflow: hidden; background: var(--petrol); color: var(--on-petrol); font-size: var(--fs-small); }
.site-footer a { color: var(--white); }
.footer-hands { position: absolute; right: -6%; bottom: 0; width: 56rem; max-width: none; opacity: .06; pointer-events: none; }
.footer-inner { position: relative; display: grid; gap: 1.5rem; padding-block: 3rem; }
.footer-brand img { width: 7rem; }
.footer-contact { font-style: normal; }
/* Opt-out button in the footer: reads as a link */
.footer-optout { padding: 0; border: 0; background: none; color: var(--white); font: inherit; text-decoration: underline; text-underline-offset: .15em; cursor: pointer; text-align: inherit; }
.footer-optout:disabled { cursor: default; text-decoration: none; opacity: .85; }
.footer-contact p, .footer-links { margin: 0 0 .75rem; }
@media (min-width: 44rem) { .footer-inner { grid-template-columns: auto 1fr auto; gap: 3rem; align-items: end; } .footer-contact { display: flex; gap: 3rem; } .footer-contact p, .footer-links { margin: 0; } .footer-links { text-align: right; } }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}

/* Page-to-page cross-fade (Chrome, Safari). Firefox just loads the page */
@media (prefers-reduced-motion: no-preference) {
  @view-transition { navigation: auto; }
}

/* Windows contrast themes: system colours take over, so edges and the menu icon need real ones.
   The logo is white artwork, so it keeps its petrol ground */
@media (forced-colors: active) {
  :focus-visible { outline-color: CanvasText; }
  .btn, .question-list li, .faq, .contact-card, .nav-toggle { border: 1px solid CanvasText; }
  .nav-toggle-bars, .nav-toggle-bars::before, .nav-toggle-bars::after { background: ButtonText; }
  .nav-toggle[aria-expanded="true"] .nav-toggle-bars { background: transparent; }
  .brand img, .footer-brand img { forced-color-adjust: none; background: #004C6F; }
}
