/* =========================================================
   Dr James Paltridge — site styles
   OPTION B — "Cover"
   Built around the portrait, like the cover of a magazine:
   the photo fills the opening screen and fades into deep navy,
   with the name set large over it. Below the cover the page is
   white and calm. Each fee is a "ticket" with a tear-off stub
   showing what the patient pays.

   Colours and fonts are set once here in :root.
   The styles are written mobile-first: the base rules are for
   phones, and the @media blocks further down add the wider layouts.
   ========================================================= */

:root {
  --color-bg: #ffffff;
  --color-navy: #0f1b3d;          /* the cover, buttons, ticket stubs, footer */
  --color-navy-light: #2a3a66;
  --color-ice: #e8edf5;           /* pale blue band behind the fees */
  --color-text: #0f1b3d;
  --color-muted: #48526e;
  --color-rule: #d3dae6;
  --color-link: #1d3fa8;
  --color-emergency: #b3261e;
  --color-warn-bg: #fdecd2;
  --color-warn-text: #8a4b14;

  --font-heading: "DM Serif Display", Georgia, "Times New Roman", serif;
  --font-body: "Hanken Grotesk", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  --bar-height: 68px;             /* height of the bottom bar on phones */
  /* side padding that keeps content within 1240px on wide screens */
  --gutter: max(20px, calc((100vw - 1240px) / 2));
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 16px; }

body {
  margin: 0;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  padding-bottom: calc(var(--bar-height) + env(safe-area-inset-bottom, 0px));   /* room for the bottom bar */
}

img, svg { max-width: 100%; display: block; }

h1, h2 { font-family: var(--font-heading); font-weight: 400; line-height: 1.02; margin: 0; }
h1 { font-size: clamp(3rem, 14vw, 4.4rem); }
h2 { font-size: clamp(2.2rem, 8vw, 3.2rem); line-height: 1.05; margin-bottom: .5em; }
h3 { font-size: 1.0625rem; font-weight: 700; line-height: 1.3; margin: 0; }

p { margin: 0 0 1em; }

a { color: var(--color-link); text-underline-offset: 3px; }

/* Phones zoom in when a spot is tapped twice quickly. On things people tap
   repeatedly (buttons, links, fold-outs) that is unwanted, so switch it off
   there. Pinch-to-zoom still works everywhere. */
a, button, summary, .action-bar { touch-action: manipulation; }
a:hover { color: var(--color-navy); }

:focus-visible { outline: 3px solid #e0a100; outline-offset: 3px; border-radius: 3px; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link { position: absolute; left: -9999px; top: 0; background: #fff; color: var(--color-text); padding: 8px 16px; z-index: 100; }
.skip-link:focus { left: 12px; top: 12px; }

/* Placeholder marker — delete the <span class="tbc"> tags once details are confirmed */
.tbc {
  display: inline-block;
  font-family: var(--font-body);
  font-size: .68rem; font-weight: 700; letter-spacing: .04em;
  padding: 1px 6px; margin-left: 4px; border-radius: 4px;
  background: var(--color-warn-bg); color: var(--color-warn-text);
  vertical-align: middle;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 50px; padding: 10px 26px;
  border-radius: 4px;
  font-weight: 700; font-size: 1rem; line-height: 1.2; text-align: center;
  text-decoration: none;
  border: 2px solid var(--color-navy);
}
.btn-sm { min-height: 44px; padding: 8px 18px; font-size: .95rem; }
.btn-primary { background: var(--color-navy); color: #fff; }
.btn-primary:hover { background: var(--color-navy-light); border-color: var(--color-navy-light); color: #fff; }
.btn-ghost { color: var(--color-navy); }
.btn-ghost:hover { background: var(--color-navy); color: #fff; }

/* ---------- Menu and bottom bar (phones) ---------- */
.site-header { position: absolute; left: 0; right: 0; z-index: 5; }
.header-book { display: none; }   /* desktop only: see "Desktop" below */

/* The menu opens as a sheet just above the bottom bar (see js/main.js) */
.site-nav {
  display: none;
  position: fixed; left: 10px; right: 10px; z-index: 59;
  bottom: calc(var(--bar-height) + 10px + env(safe-area-inset-bottom, 0px));
  flex-direction: column;
  background: #fff; border-radius: 10px; padding: 6px 18px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, .35);
}
.site-nav.open { display: flex; }
.site-nav a { color: var(--color-text); text-decoration: none; font-family: var(--font-heading); font-size: 1.5rem; padding: 12px 0; }
.site-nav a + a { border-top: 1px solid var(--color-rule); }

.action-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
  display: flex; gap: 10px;
  padding: 9px 12px calc(9px + env(safe-area-inset-bottom, 0px));
  background: #fff; border-top: 1px solid var(--color-rule);
  box-shadow: 0 -4px 16px rgba(15, 27, 61, .1);
}
.action-bar .btn { flex: 1; }
.nav-toggle {
  display: inline-flex; align-items: center; gap: 10px;
  min-height: 50px; padding: 0 16px;
  background: none; color: var(--color-navy); cursor: pointer;
  border: 2px solid var(--color-navy); border-radius: 4px;
  font: 700 1rem/1 var(--font-body);
}
.nav-toggle-bar,
.nav-toggle-bar::before,
.nav-toggle-bar::after {
  display: block; width: 18px; height: 2px; background: currentColor;
  position: relative; transition: transform .2s, background .2s;
}
.nav-toggle-bar::before, .nav-toggle-bar::after { content: ""; position: absolute; left: 0; }
.nav-toggle-bar::before { top: -6px; }
.nav-toggle-bar::after { top: 6px; }
.nav-toggle[aria-expanded="true"] .nav-toggle-bar { background: transparent; }
.nav-toggle[aria-expanded="true"] .nav-toggle-bar::before { transform: translateY(6px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle-bar::after { transform: translateY(-6px) rotate(-45deg); }

/* =========================================================
   The cover
   Phones: the portrait on top, fading down into navy; the name
   overlaps the bottom of the photo.
   ========================================================= */
.cover { background: var(--color-navy); color: #fff; }
.cover-photo { position: relative; height: 62vh; height: 62svh; min-height: 360px; max-height: 600px; margin-bottom: -1px; }
.cover-photo img,
.photo-placeholder { width: 100%; height: 100%; object-fit: cover; object-position: center 20%; }
/* the fade from the photo into the navy */
.cover-photo::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(15, 27, 61, 0) 45%, var(--color-navy) 100%);
}
.photo-placeholder {
  position: relative; overflow: hidden;
  display: flex; align-items: flex-start; justify-content: flex-end;
  background: linear-gradient(160deg, #46598c, #263663);
  font-size: .8rem; color: var(--color-text);
}
.photo-placeholder svg { position: absolute; inset: 0; width: 100%; height: 100%; fill: #5f72a3; }
.photo-placeholder span { position: relative; z-index: 1; margin: 16px; background: #fff; padding: 3px 10px; border-radius: 3px; }

.cover-text { position: relative; margin-top: -150px; padding: 0 20px 40px; }
.role { margin: 0 0 10px; font-weight: 600; font-size: 1.05rem; }
.cover h1 { color: #fff; }
.lead { font-size: 1.2rem; line-height: 1.5; margin: 20px 0 0; max-width: 30em; color: #dfe5f2; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 24px; }
/* on the navy cover the buttons swap to white */
.cover .btn { border-color: #fff; }
.cover .btn-primary { background: #fff; color: var(--color-navy); }
.cover .btn-primary:hover { background: var(--color-ice); border-color: var(--color-ice); color: var(--color-navy); }
.cover .btn-ghost { color: #fff; }
.cover .btn-ghost:hover { background: #fff; color: var(--color-navy); }

/* =========================================================
   Sections
   Each section is a heading followed by its content. On a
   computer the heading sits in a left column (see Desktop).
   ========================================================= */
.section { padding: 52px var(--gutter) 44px; }
.section + .section { border-top: 1px solid var(--color-rule); }
.section > p { max-width: 36em; }
.section-intro { color: var(--color-muted); font-size: 1.12rem; }

/* About: "At a glance" */
.facts { margin-top: 28px; max-width: 38em; }
.facts h3 { font-family: var(--font-heading); font-weight: 400; font-size: 1.4rem; }
.facts dl { margin: 10px 0 0; border-top: 2px solid var(--color-navy); }
.facts dl > div { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--color-rule); }
.facts dt { color: var(--color-muted); }
.facts dd { margin: 0; font-weight: 600; }

/* Services */
.services-list { list-style: none; padding: 0; margin: 24px 0 0; display: grid; gap: 22px; }
.services-list h3 { font-family: var(--font-heading); font-weight: 400; font-size: 1.45rem; line-height: 1.15; }
.services-list p { margin: 4px 0 0; color: var(--color-muted); }

/* ---------- Fees: tickets ----------
   The white part of each ticket shows the consultation, the fee and the
   Medicare rebate. The navy stub shows what the patient pays. */
#fees { background: var(--color-ice); border-top: 0; }
#fees + .section { border-top: 0; }

.sample-notice {
  display: inline-block;
  background: var(--color-warn-bg); color: var(--color-warn-text);
  padding: 5px 12px; border-radius: 4px; font-size: .92rem; font-weight: 600;
  margin: 0 0 18px;
}
.fee-list { display: grid; gap: 14px; }
.fee { position: relative; background: #fff; border-radius: 12px; }
.fee header { padding: 18px 20px 8px; }
.fee h3 { font-family: var(--font-heading); font-weight: 400; font-size: 1.5rem; line-height: 1.1; }
.fee-meta { margin: 4px 0 0; color: var(--color-muted); font-size: .95rem; }
.fee-figures { margin: 0; font-variant-numeric: tabular-nums; }
.fee-figures > div { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 5px 20px; }
.fee-figures dt { color: var(--color-muted); }
.fee-figures dd { margin: 0; font-weight: 600; }
/* the stub */
.fee-figures > .fee-gap {
  position: relative;
  margin-top: 14px; padding: 14px 20px;
  align-items: center;
  background: var(--color-navy); color: #fff;
  border-top: 2px dashed var(--color-ice);            /* the perforation */
  border-radius: 0 0 12px 12px;
}
.fee-gap dt { color: #fff; font-weight: 600; }
.fee-gap dd { font-family: var(--font-heading); font-weight: 400; font-size: 2rem; line-height: 1; }
/* two small notches at the ends of the perforation */
.fee-gap::before, .fee-gap::after {
  content: ""; position: absolute; top: -10px; width: 18px; height: 18px;
  border-radius: 50%; background: var(--color-ice);
}
.fee-gap::before { left: -9px; }
.fee-gap::after { right: -9px; }

.fee-notes { display: grid; gap: 18px; margin-top: 30px; }
.fee-notes p { margin: 2px 0 0; color: var(--color-muted); }
.fee-footnote { margin: 24px 0 0; font-size: .9rem; color: var(--color-muted); max-width: 40em; }

/* ---------- More fees: day headings, the weekend link, and the Saturday / Sunday fold-outs ----------
   Each fold-out is a <details> element holding the same tickets as the weekday list.
   Closed: a white bar with a navy "Show +" button. Open: the bar turns navy, the button
   reads "Hide −", and a navy frame runs around the tickets that belong to it. */
.fee-day { margin: 0 0 12px; }
.fee-day-extra { margin-top: 36px; }
.fee-day-row { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin: 0 0 12px; }
.fee-day-row .fee-day { margin: 0; }
.fee-day-row a { font-size: .95rem; font-weight: 600; }
.fee-more { margin-top: 12px; border: 2px solid var(--color-navy); border-radius: 14px; overflow: hidden; }
.fee-more summary {
  cursor: pointer; list-style: none;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 14px 16px 14px 20px;
  background: #fff; color: var(--color-navy);
  font-family: var(--font-heading); font-size: 1.35rem; line-height: 1.15;
}
.fee-more summary::-webkit-details-marker { display: none; }
.fee-more summary:hover { background: #f5f7fb; }
.fee-more summary:focus-visible { outline: 3px solid var(--color-link); outline-offset: -5px; }
/* the Show / Hide button at the right-hand end of the bar */
.fee-more summary::after {
  content: "Show  +"; white-space: pre; flex: none;
  padding: 8px 16px; border-radius: 999px;
  background: var(--color-navy); color: #fff;
  font-family: var(--font-body); font-size: .92rem; font-weight: 700; line-height: 1.2;
}
.fee-more[open]:not(.is-closing) summary { background: var(--color-navy); color: #fff; }
.fee-more[open]:not(.is-closing) summary::after { content: "Hide  \2212"; background: #fff; color: var(--color-navy); }
.fee-more .fee-list { margin: 0; padding: 14px; }
/* a ticket with one price only (procedures): no fee or rebate rows */
.fee-simple header { padding-bottom: 4px; }
/* the "Your out-of-pocket" label is hidden on these (screen readers still read it) */
.fee-simple .fee-gap dt { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.fee-simple .fee-figures > .fee-gap { justify-content: flex-end; }

/* ---------- Practices ---------- */
.practice-list { display: grid; gap: 32px; margin-top: 24px; }
.practice { border-top: 4px solid var(--color-navy); padding-top: 16px; }
.practice h3 { font-family: var(--font-heading); font-weight: 400; font-size: 1.8rem; line-height: 1.1; margin-bottom: 8px; }
.practice p { margin: 0; }
.practice-days { color: var(--color-muted); margin-top: 6px !important; }
.practice-actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 18px 0 14px; }
.practice-actions .btn { flex: 1 1 auto; }
.practice-phone a { font-weight: 700; }

/* ---------- FAQ ---------- */
.faq { border-top: 2px solid var(--color-navy); max-width: 44em; }
.faq details { border-bottom: 1px solid var(--color-rule); }
.faq summary {
  cursor: pointer; list-style: none; position: relative;
  padding: 16px 40px 16px 0;
  font-family: var(--font-heading); font-weight: 400; font-size: 1.35rem; line-height: 1.2;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+"; position: absolute; right: 2px; top: 50%; transform: translateY(-50%);
  font: 400 1.6rem/1 var(--font-body);
}
/* ":not(.is-closing)" flips the sign back to + as soon as the answer starts to close (see js/main.js) */
.faq details[open]:not(.is-closing) summary::after { content: "\2212"; }
.faq details p { color: var(--color-muted); margin: 0; padding-bottom: 22px; }

/* ---------- Footer ---------- */
.site-footer { background: var(--color-navy); color: #cfd6e6; padding: 40px var(--gutter) 36px; }
.site-footer a { color: #fff; }
.emergency { background: #fff; color: var(--color-text); border-radius: 6px; padding: 14px 18px; margin-bottom: 32px; }
.emergency strong { color: var(--color-emergency); margin-right: 4px; }
.site-footer .emergency a { color: var(--color-link); font-weight: 700; }
.footer-grid { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 14px 24px; }
.footer-grid p { margin: 0; }
.footer-grid .footer-name { font-family: var(--font-heading); font-weight: 400; font-size: 1.9rem; line-height: 1.1; color: #fff; }
.footer-grid nav { display: flex; flex-wrap: wrap; gap: 2px 22px; }
.footer-grid nav a { padding: 8px 0; }
.footer-legal { margin: 22px 0 0; padding-top: 18px; border-top: 1px solid rgba(255, 255, 255, .2); font-size: .88rem; }

/* ---------- Privacy page (privacy.html uses a simple top bar) ---------- */
/* ".container.header-inner" (both classes) so this padding wins over the plain .container rule below */
.container.header-inner { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 20px; border-bottom: 1px solid var(--color-rule); background: #fff; }
.brand { text-decoration: none; display: flex; flex-direction: column; line-height: 1.25; }
.brand-name { font-family: var(--font-heading); font-weight: 400; font-size: 1.3rem; color: var(--color-text); }
.brand-role { font-size: .85rem; color: var(--color-muted); }
.container { max-width: 1240px; margin: 0 auto; padding: 0 20px; }
.narrow { max-width: 720px; }
.page { padding: 150px 0 56px; }
.page h1 { font-size: 2.8rem; margin-bottom: .5em; }
.page h2 { font-size: 1.6rem; margin: 1.5em 0 .4em; }


/* ---------- Cover entrance ----------
   When the page first opens, the photo fades in and the role, name, tagline and
   buttons rise into place one after another. Skipped for visitors who ask for less motion. */
@media (prefers-reduced-motion: no-preference) {
  @keyframes cover-rise { from { opacity: 0; transform: translateY(26px); } to { opacity: 1; transform: none; } }
  @keyframes cover-fade { from { opacity: 0; } to { opacity: 1; } }
  .cover-photo img { animation: cover-fade 1.1s ease both; }
  .cover-text > * { animation: cover-rise .8s cubic-bezier(.2, .7, .2, 1) both; }
  .cover-text > :nth-child(1) { animation-delay: .15s; }
  .cover-text > :nth-child(2) { animation-delay: .3s; }
  .cover-text > :nth-child(3) { animation-delay: .5s; }
  .cover-text > :nth-child(4) { animation-delay: .7s; }
}

/* ---------- Scroll-in (see js/main.js) ----------
   The script adds "reveal" to parts of the page, then "is-visible" when each one
   scrolls into view. Without the script nothing is hidden. */
.reveal { opacity: 0; transform: translateY(32px); }
/* the movement is set here, not above, so things are hidden instantly and only the arrival is animated */
.reveal.is-visible { opacity: 1; transform: none; transition: opacity .7s ease, transform .7s cubic-bezier(.2, .7, .2, 1); }

/* =========================================================
   Wider screens
   ========================================================= */

/* Large phones and tablets */
@media (min-width: 640px) {
  .practice-actions .btn { flex: 0 1 auto; }
  :root { --gutter: max(36px, calc((100vw - 1240px) / 2)); }
  .cover-text { padding: 0 36px 52px; }
  h1 { font-size: 5rem; }
  .lead { font-size: 1.3rem; }
  .services-list { grid-template-columns: 1fr 1fr; gap: 28px 40px; }
  .practice-list { grid-template-columns: 1fr 1fr; gap: 36px; }
  .fee-notes { grid-template-columns: repeat(3, 1fr); gap: 28px; }

  /* Tickets turn sideways: the stub moves to the right-hand end */
  .fee { padding: 0 176px 14px 0; }
  .fee-figures > .fee-gap {
    position: absolute; top: 0; right: 0; bottom: 0; width: 176px; margin: 0;
    flex-direction: column; justify-content: center; align-items: flex-start; gap: 8px;
    border-top: 0; border-left: 2px dashed var(--color-ice);
    border-radius: 0 12px 12px 0;
  }
  .fee-gap dd { font-size: 2.2rem; }
  .fee-gap::before, .fee-gap::after { left: -10px; right: auto; }
  .fee-gap::before { top: -9px; }
  .fee-gap::after { top: auto; bottom: -9px; }
  .fee-simple { display: flex; align-items: center; min-height: 88px; padding-bottom: 0; }
  .fee-simple .fee-figures > .fee-gap { justify-content: center; align-items: center; }
  .fee-simple header { padding: 18px 20px; }
}

/* Desktop */
@media (min-width: 1000px) {
  body { padding-bottom: 0; }
  .action-bar { display: none; }

  /* Menu: a row of links fixed to the top of the screen.
     Over the cover it is see-through; after scrolling, js/main.js adds "is-stuck",
     which gives it a navy background and shows the booking button. */
  html { scroll-padding-top: 84px; }
  .site-header-main {
    position: fixed; top: 0; z-index: 50;
    display: flex; align-items: center; justify-content: space-between; gap: 24px;
    padding: 22px var(--gutter);
    transition: background-color .25s ease, padding .25s ease, box-shadow .25s ease;
  }
  .site-header-main.is-stuck { background: var(--color-navy); padding-top: 10px; padding-bottom: 10px; box-shadow: 0 2px 14px rgba(15, 27, 61, .25); }
  .site-nav {
    display: flex; position: static; flex-direction: row; gap: 30px;
    background: none; border-radius: 0; padding: 0; box-shadow: none;
  }
  .site-nav a { color: #fff; font-family: var(--font-body); font-size: 1rem; font-weight: 600; padding: 6px 0; }
  .site-nav a + a { border-top: 0; }
  .site-nav a:hover { text-decoration: underline; text-underline-offset: 6px; }
  /* the section currently on screen (set by js/main.js) */
  .site-nav a.is-current { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 6px; }
  .header-book {
    display: inline-flex; background: #fff; color: var(--color-navy); border-color: #fff;
    opacity: 0; visibility: hidden; transition: opacity .25s ease, visibility .25s;
  }
  .header-book:hover { background: var(--color-ice); border-color: var(--color-ice); color: var(--color-navy); }
  .is-stuck .header-book { opacity: 1; visibility: visible; }

  /* Cover: text on the left, portrait filling the right-hand side */
  .cover {
    display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
    min-height: min(100vh, 880px);
  }
  .cover-text { order: 1; margin: 0; align-self: center; padding: 120px 56px 72px var(--gutter); }
  .cover-photo { order: 2; height: auto; min-height: 0; max-height: none; }
  .cover-photo::after { background: linear-gradient(90deg, var(--color-navy) 0%, rgba(15, 27, 61, 0) 35%); }
  h1 { font-size: clamp(4.6rem, 7.4vw, 7.5rem); line-height: .95; }
  .role { font-size: 1.2rem; margin-bottom: 16px; }
  .lead { font-size: 1.4rem; margin-top: 28px; }
  .hero-actions { margin-top: 32px; }

  /* Sections: heading in a left column that stays in view, content on the right.
     (The heading spans every row, so the content rows stack beside it.) */
  .section {
    display: grid; grid-template-columns: 280px minmax(0, 1fr); column-gap: 64px;
    padding-top: 88px; padding-bottom: 80px;
  }
  .section > h2 { grid-column: 1; grid-row: 1 / span 20; align-self: start; position: sticky; top: 100px; margin: 0; }
  .section > :not(h2) { grid-column: 2; }
  .section-intro { font-size: 1.2rem; }
  .site-footer { padding-top: 56px; }
}

/* Wide desktop: tickets two across */
@media (min-width: 1320px) {
  .fee-list { grid-template-columns: 1fr 1fr; }
  .fee { padding-right: 156px; }
  .fee-figures > .fee-gap { width: 156px; padding: 14px 18px; }
}

/* Visitors who have asked their device for less motion */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; }
}
