/* ==========================================================================
   Dr Petra Matsicas, GP in Constantia: site styles
   Plain CSS, no build step, no external requests.
   Fonts are self-hosted under the SIL Open Font License (see assets/fonts/).
   ========================================================================== */

/* ---------- Fonts ---------- */

@font-face {
  font-family: "Fraunces";
  src: url("/assets/fonts/fraunces-500.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Source Sans 3";
  src: url("/assets/fonts/source-sans-3-400.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Source Sans 3";
  src: url("/assets/fonts/source-sans-3-600.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

/* ---------- Design tokens ---------- */

:root {
  --bg: #faf8f4;
  --surface: #f2ede4;
  --text: #1c1c1a;
  --text-muted: #4b4943;
  --accent: #1f4a3a;
  --accent-hover: #163a2d;
  --accent-tint: #dde7df;
  --on-accent: #ffffff;
  --line: #ddd5c8;
  --control-border: #8a8274;
  --footer-bg: #1a3a2e;
  --footer-text: #ece7dc;
  --footer-muted: #c5d5cb;

  --font-serif: "Fraunces", "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --font-sans: "Source Sans 3", "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;

  --maxw: 1100px;
  --gutter: clamp(1rem, 4vw, 2rem);
  --radius: 16px;
  --radius-lg: 24px;
  --section-space: clamp(3rem, 7vw, 5.5rem);

  /* Just under the sticky header's height: a section's top edge tucks under the
     header after a nav jump, and the section's own padding keeps its heading clear. */
  --header-h: 4rem;

  color-scheme: light;
}

/* ---------- Base ---------- */

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 1.0625rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

@media (min-width: 48em) {
  body {
    font-size: 1.125rem;
  }
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

h1,
h2,
h3 {
  margin: 0 0 0.5em;
  font-family: var(--font-serif);
  font-weight: 500;
  line-height: 1.15;
  letter-spacing: -0.01em;
  text-wrap: balance;
}

h1 {
  font-size: clamp(2.125rem, 1.45rem + 3vw, 3.5rem);
}

h2 {
  font-size: clamp(1.625rem, 1.3rem + 1.4vw, 2.25rem);
}

h3 {
  font-size: 1.25rem;
  line-height: 1.3;
}

p,
ul,
ol,
dl,
address {
  margin: 0 0 1em;
}

address {
  font-style: normal;
}

strong {
  font-weight: 600;
}

a {
  color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

a:hover {
  color: var(--accent-hover);
  text-decoration-thickness: 2px;
}

/* Keep phone numbers on one line. */
a[href^="tel:"]:not(.btn),
a[href^="https://wa.me/"]:not(.btn) {
  white-space: nowrap;
}

:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

.wrap {
  width: 100%;
  max-width: calc(var(--maxw) + 2 * var(--gutter));
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* Skip link: sits just above the viewport and slides into view on keyboard focus. */
.skip-link {
  position: absolute;
  top: 0.5rem;
  left: 0.5rem;
  z-index: 100;
  padding: 0.6rem 1rem;
  border-radius: 8px;
  background: var(--accent);
  color: var(--on-accent);
  font-weight: 600;
  transform: translateY(-150%);
  transition: transform 0.15s ease;
}

.skip-link:focus {
  transform: none;
  color: var(--on-accent);
}

/* ---------- In-page navigation ---------- */

/* The nav links jump to sections on the same page. Smooth scrolling is only
   switched on for people who haven't asked their device to reduce motion. */
@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}

/* Stop the sticky header covering a section's heading after a nav jump, or
   a link that receives keyboard focus. */
section[id] {
  scroll-margin-top: var(--header-h);
}

a,
button {
  scroll-margin-top: calc(var(--header-h) + 1rem);
}

/* Without JavaScript the mobile nav is always open, so the header is taller. */
@media (max-width: 47.99em) {
  html:not(.js) {
    --header-h: 6.75rem;
  }
}

@media (min-width: 48em) {
  :root {
    --header-h: 4.5rem;
  }
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 3rem;
  padding: 0.7rem 1.35rem;
  border: 2px solid transparent;
  border-radius: 999px;
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.btn-primary {
  background: var(--accent);
  color: var(--on-accent);
}

.btn-primary:hover {
  background: var(--accent-hover);
  color: var(--on-accent);
}

.btn-secondary {
  border-color: var(--accent);
  background: transparent;
  color: var(--accent);
}

.btn-secondary:hover {
  background: var(--accent-tint);
  color: var(--accent-hover);
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.cta-row .btn {
  flex: 1 1 auto;
}

@media (min-width: 36em) {
  .cta-row .btn {
    flex: 0 0 auto;
  }
}

/* ---------- Header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid var(--line);
  background: var(--bg);
}

.header-inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas:
    "brand toggle"
    "nav   nav";
  align-items: center;
  column-gap: 0.5rem;
  padding-block: 0.625rem;
}

.brand {
  grid-area: brand;
  display: flex;
  flex-direction: column;
  justify-self: start;
  padding-block: 0.25rem;
  color: var(--text);
  line-height: 1.2;
  text-decoration: none;
}

.brand:hover {
  color: var(--text);
}

.brand-name {
  font-family: var(--font-serif);
  font-size: 1.0625rem;
  font-weight: 500;
}

.brand-role {
  color: var(--text-muted);
  font-size: 0.8125rem;
}

/* Mobile menu button. It only appears when JavaScript is running (html.js);
   without JavaScript the nav links are always shown instead. */
.nav-toggle {
  grid-area: toggle;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
  min-width: 3rem;
  min-height: 2.875rem;
  padding: 0.3rem 0.5rem;
  border: 1.5px solid var(--control-border);
  border-radius: 12px;
  background: transparent;
  color: var(--text);
  font: 600 0.75rem/1 var(--font-sans);
  cursor: pointer;
}

.nav-toggle:hover {
  border-color: var(--text);
}

.nav-toggle-icon,
.nav-toggle-icon::before,
.nav-toggle-icon::after {
  display: block;
  width: 1.125rem;
  height: 2px;
  border-radius: 2px;
  background: currentColor;
  transition: transform 0.2s ease, background-color 0.2s ease;
}

.nav-toggle-icon {
  position: relative;
  margin-block: 5px;
}

.nav-toggle-icon::before,
.nav-toggle-icon::after {
  content: "";
  position: absolute;
  left: 0;
}

.nav-toggle-icon::before {
  top: -5px;
}

.nav-toggle-icon::after {
  top: 5px;
}

.nav-toggle[aria-expanded="true"] .nav-toggle-icon {
  background: transparent;
}

.nav-toggle[aria-expanded="true"] .nav-toggle-icon::before {
  transform: translateY(5px) rotate(45deg);
}

.nav-toggle[aria-expanded="true"] .nav-toggle-icon::after {
  transform: translateY(-5px) rotate(-45deg);
}

.site-nav {
  grid-area: nav;
}

.site-nav ul {
  display: flex;
  flex-wrap: wrap;
  column-gap: 1.125rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.site-nav a {
  display: block;
  padding: 0.5rem 0;
  border-bottom: 2px solid transparent;
  color: var(--text);
  font-size: 1rem;
  font-weight: 600;
  text-decoration: none;
}

.site-nav a:hover {
  border-bottom-color: currentColor;
  color: var(--accent);
}

@media (max-width: 47.99em) {
  .js .nav-toggle {
    display: inline-flex;
  }

  /* Collapsed mobile menu (the only hidden content on the site: it is the nav itself, opened with the Menu button). */
  .js .site-nav {
    display: none;
  }

  .js.nav-open .site-nav {
    display: block;
  }

  .js .site-nav ul {
    flex-direction: column;
    padding-block: 0.5rem 0.25rem;
  }

  .js .site-nav li + li {
    border-top: 1px solid var(--line);
  }

  .js .site-nav a {
    padding: 0.8rem 0.25rem;
    border-bottom: 0;
    font-size: 1.0625rem;
  }
}

@media (min-width: 48em) {
  .header-inner {
    grid-template-columns: auto minmax(0, 1fr);
    grid-template-areas: "brand nav";
    column-gap: 2rem;
    padding-block: 0.75rem;
  }

  .brand-name {
    font-size: 1.3125rem;
  }

  .brand-role {
    font-size: 0.875rem;
  }

  .site-nav {
    justify-self: end;
  }

  .site-nav ul {
    column-gap: 1.75rem;
  }
}

/* ---------- Sections ---------- */

.section {
  padding-block: var(--section-space);
}

.band {
  background: var(--surface);
}

.section-head {
  max-width: 42rem;
  margin-bottom: 2rem;
}

.section-head p {
  color: var(--text-muted);
}

.section-head > :last-child {
  margin-bottom: 0;
}

.section-foot {
  max-width: 42rem;
  margin: 2rem 0 0;
  color: var(--text-muted);
}

.section-foot ul {
  padding-left: 1.25em;
}

.section-foot > :last-child {
  margin-bottom: 0;
}

.eyebrow {
  margin: 0 0 1rem;
  color: var(--accent);
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.lead {
  max-width: 36em;
  color: var(--text-muted);
  font-size: clamp(1.125rem, 1.05rem + 0.4vw, 1.3125rem);
  line-height: 1.55;
}

.card {
  padding: clamp(1.5rem, 4vw, 2.25rem);
  border-radius: var(--radius-lg);
  background: var(--surface);
}

.band .card {
  background: var(--bg);
}

.card > :last-child {
  margin-bottom: 0;
}

.card h3 {
  font-size: clamp(1.375rem, 1.25rem + 0.5vw, 1.625rem);
}

/* ---------- Hero ---------- */

.hero {
  padding-block: clamp(2.25rem, 6vw, 5rem) clamp(2.75rem, 6vw, 4.5rem);
}

.hero-grid {
  display: grid;
  gap: 2.75rem;
  align-items: center;
}

.hero h1 {
  margin-bottom: 1.25rem;
}

.hero .lead {
  margin-bottom: 0;
}

.portrait {
  position: relative;
  width: 100%;
  max-width: 19rem;
  margin: 0 auto 0.75rem;
}

.portrait::before {
  content: "";
  position: absolute;
  inset: 1rem -0.75rem -0.75rem 1rem;
  border-radius: var(--radius-lg);
  background: var(--accent-tint);
}

.portrait picture,
.portrait img {
  position: relative;
  border-radius: var(--radius-lg);
}

@media (min-width: 52em) {
  .hero-grid {
    grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
    gap: clamp(2.5rem, 6vw, 5rem);
  }

  .hero .portrait {
    max-width: 26rem;
    margin-right: 0.75rem;
  }

  .portrait::before {
    inset: 1.5rem -1.25rem -1.25rem 1.5rem;
  }
}

/* ---------- About ---------- */

.split {
  display: grid;
  gap: 0.5rem 4rem;
}

@media (min-width: 52em) {
  .split {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr);
  }
}

.prose {
  max-width: 40rem;
}

.prose > :last-child {
  margin-bottom: 0;
}

/* ---------- Services ---------- */

.service-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 24rem), 1fr));
  gap: 1rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.service-item {
  padding: 1.5rem 1.5rem 1.4rem;
  border-radius: var(--radius);
  background: var(--surface);
}

.service-item h3 {
  margin-bottom: 0.4rem;
  font-size: 1.3125rem;
}

.service-item p {
  margin: 0;
  color: var(--text-muted);
}

/* ---------- Contact & directions ---------- */

.contact-grid {
  display: grid;
  gap: 2.5rem;
}

@media (min-width: 52em) {
  .contact-grid {
    grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr);
    gap: 4rem;
    align-items: start;
  }
}

.details {
  display: grid;
  grid-template-columns: 1fr;
  margin: 0;
}

.details dt {
  font-weight: 600;
}

.details dd {
  margin: 0 0 1.1rem;
}

.details dd:last-child {
  margin-bottom: 0;
}

.details address {
  margin: 0;
}

@media (min-width: 36em) {
  .details {
    grid-template-columns: max-content 1fr;
    gap: 1.1rem 2rem;
  }

  .details dd {
    margin: 0;
  }
}

/* Google Maps and Alphen House: bold link rows with an external-link arrow. */
.ext-links {
  display: grid;
  gap: 0.625rem;
  max-width: 26rem;
  margin: 1rem 0 0.25rem;
  padding: 0;
  list-style: none;
}

.ext-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 3rem;
  padding: 0.7rem 1.1rem;
  border: 2px solid var(--accent);
  border-radius: 12px;
  background: var(--bg);
  color: var(--accent);
  font-weight: 600;
  line-height: 1.3;
  text-decoration: none;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.ext-link:hover {
  background: #ffffff;
  color: var(--accent-hover);
}

.ext-icon {
  flex: none;
  width: 1.125em;
  height: 1.125em;
}

/* "How to book" box: the only call-to-action buttons on the site. */
.book-buttons {
  display: grid;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

/* ---------- Footer ---------- */

.site-footer {
  padding-block: 3.5rem 2rem;
  background: var(--footer-bg);
  color: var(--footer-text);
  font-size: 1rem;
}

.site-footer a {
  color: #ffffff;
}

.site-footer a:hover {
  color: #ffffff;
}

.site-footer :focus-visible {
  outline-color: #ffffff;
}

.site-footer .ext-icon {
  width: 0.875em;
  height: 0.875em;
  margin-left: 0.1em;
  vertical-align: -0.05em;
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 16rem), 1fr));
  gap: 2rem 3rem;
}

.footer-grid p,
.footer-grid address,
.footer-grid ul {
  margin-bottom: 0.6rem;
}

.footer-name {
  margin-bottom: 0.25rem;
  color: #ffffff;
  font-family: var(--font-serif);
  font-size: 1.375rem;
}

.footer-heading {
  margin-bottom: 0.75rem;
  color: var(--footer-muted);
  font-family: var(--font-sans);
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.footer-list {
  padding: 0;
  list-style: none;
}

.footer-list li + li {
  margin-top: 0.4rem;
}

.footer-bottom {
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgb(255 255 255 / 0.18);
  color: var(--footer-muted);
  font-size: 0.9375rem;
}

.footer-bottom p {
  margin: 0;
}

/* ---------- Motion ---------- */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition: none !important;
  }
}
