/* ==========================================================================
   Doxa Kindergarten — hand-written CSS, no framework.
   Palette sampled directly from the Squarespace reference screenshots
   (docs/reference/) so the rebuild matches the original.
   ========================================================================== */

@font-face {
  font-family: 'Young Serif';
  src: url('/assets/fonts/young-serif-latin-400.woff2') format('woff2');
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: 'Bitter';
  src: url('/assets/fonts/bitter-latin-var.woff2') format('woff2-variations');
  font-weight: 400 700;
  font-display: swap;
}

:root {
  --paper: #f7f1e7;      /* header background */
  --warm: #eae6dd;       /* main section background */
  --yellow: #edd286;     /* accent bands, footer, contact page */
  --ink: #2d2d2a;        /* body + heading text */
  --ink-soft: #5c5a54;
  --black: #000;
  --white: #fff;
  --rule: rgba(45, 45, 42, 0.25);

  --serif: 'Young Serif', Georgia, 'Times New Roman', serif;
  --body: 'Bitter', Georgia, serif;

  --wrap: 1280px;
  --gutter: clamp(20px, 5vw, 64px);
  --section-y: clamp(56px, 11vh, 132px);
  --radius: 10px;
}

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

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

body {
  margin: 0;
  background: var(--warm);
  color: var(--ink);
  font-family: var(--body);
  font-size: 1rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

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

h1, h2, h3, h4 {
  font-family: var(--serif);
  font-weight: 400;
  line-height: 1.12;
  margin: 0 0 0.5em;
  letter-spacing: -0.005em;
}

p { margin: 0 0 1.1em; }
p:last-child { margin-bottom: 0; }

a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { text-decoration-color: var(--ink); }

ul { margin: 0 0 1.1em; padding-left: 1.15em; }
li { margin-bottom: 0.45em; }

:focus-visible { outline: 3px solid var(--black); outline-offset: 3px; }

.wrap {
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.skip-link {
  position: absolute;
  left: -9999px;
  background: var(--black);
  color: var(--white);
  padding: 0.7em 1.1em;
  z-index: 100;
}
.skip-link:focus { left: 0; top: 0; }

/* ---------- header ---------- */

.site-header { background: var(--paper); }

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 76px;
}

.logo { display: inline-flex; align-items: center; text-decoration: none; }
.logo-img { width: 56px; height: auto; }

.site-nav { display: flex; gap: clamp(0.9rem, 2.2vw, 2rem); }
.site-nav a {
  font-size: 0.82rem;
  letter-spacing: 0.02em;
  text-decoration: none;
  padding: 0.35em 0;
}
.site-nav a:hover { text-decoration: underline; }
.site-nav a.is-active { text-decoration: underline; }

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
}
.nav-toggle span {
  display: block;
  height: 2px;
  background: var(--ink);
  transition: transform 0.2s, opacity 0.2s;
}

/* ---------- hero ---------- */

.hero { position: relative; display: grid; isolation: isolate; }
/* A hard height, not min-height: the source is 2500x1668, so at 1440px wide the
   natural height would be 961px and the band would grow well past the original. */
.hero > img {
  grid-area: 1 / 1;
  width: 100%;
  height: clamp(420px, 62vw, 780px);
  object-fit: cover;
}
.hero::after {
  content: '';
  grid-area: 1 / 1;
  background: rgba(0, 0, 0, 0.42);
  z-index: 1;
}
.hero-body {
  grid-area: 1 / 1;
  z-index: 2;
  align-self: center;
  justify-self: center;
  max-width: 46ch;
  padding: var(--gutter);
  text-align: center;
  color: var(--white);
}
.hero-body p {
  font-size: clamp(0.95rem, 1.15vw, 1.08rem);
  font-weight: 600;
  margin-bottom: 1.8em;
  text-wrap: pretty;
}

.btn-row { display: flex; flex-wrap: wrap; gap: 1rem; justify-content: center; }

.btn {
  display: inline-block;
  padding: 0.85em 2.4em;
  border-radius: 999px;
  background: var(--paper);
  color: var(--ink);
  font-size: 0.9rem;
  text-decoration: none;
  border: 1px solid transparent;
  transition: background 0.18s, color 0.18s;
}
.btn:hover { background: var(--white); }
.btn-dark { background: var(--black); color: var(--white); }
.btn-dark:hover { background: #1d1d1d; }

/* ---------- sections ---------- */

.section { padding-block: var(--section-y); }
.section-warm { background: var(--warm); }
.section-paper { background: var(--paper); }
.section-yellow { background: var(--yellow); }

.section > .wrap > h2 { margin-bottom: 1.6em; }

.section-title { font-size: clamp(1.9rem, 3.6vw, 2.7rem); }
.section-title-lg { font-size: clamp(2.1rem, 5vw, 3.3rem); }

/* Underlined sub-headings, as on the original "Our Services" block. */
.rule-heading {
  display: inline-block;
  font-size: clamp(1.05rem, 1.7vw, 1.3rem);
  border-bottom: 1.5px solid var(--ink);
  padding-bottom: 0.12em;
  margin-bottom: 0.9em;
}

/* Fixed column counts, not auto-fit. auto-fit silently reflowed "Our Services"
   into 3 columns at desktop, which changed the reading order of the four
   blocks. The original is a strict 2x2 / 3-up. */
.cols-2, .cols-3 { display: grid; gap: clamp(2.2rem, 5vw, 4.5rem) clamp(2rem, 5vw, 5rem); grid-template-columns: 1fr; }

@media (min-width: 700px) {
  .cols-2 { grid-template-columns: repeat(2, 1fr); }
  .cols-3 { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 1000px) {
  .cols-3 { grid-template-columns: repeat(3, 1fr); }
}

.prose { max-width: 68ch; }
.prose h3 { margin-top: 1.8em; font-size: 1.2rem; }
.prose h3:first-child { margin-top: 0; }

.note { color: var(--ink-soft); }

/* ---------- zigzag divider ---------- */

/* Sawtooth edge with a dark outline — the motif the original uses between
   the cream and yellow bands. preserveAspectRatio=none lets it stretch. */
.zigzag {
  height: 22px;
  background-repeat: repeat-x;
  background-size: 44px 22px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 44 22' preserveAspectRatio='none'%3E%3Cpath d='M0 22 L11 3 L22 22 L33 3 L44 22 Z' fill='%23edd286'/%3E%3Cpath d='M0 22 L11 3 L22 22 L33 3 L44 22' fill='none' stroke='%232d2d2a' stroke-width='2'/%3E%3C/svg%3E");
}
.zigzag-up { transform: scaleY(-1); }

/* ---------- team ---------- */

.team-grid { display: grid; gap: clamp(2.5rem, 6vw, 5rem); grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); }
.team-member { text-align: center; }
.portrait {
  width: clamp(140px, 18vw, 190px);
  aspect-ratio: 1;
  border-radius: 50%;
  object-fit: cover;
  margin: 0 auto 1.4rem;
  background: var(--warm);
}
.team-member h3 { font-size: 1.05rem; margin-bottom: 0.7em; }
.team-member .bio { text-align: left; font-size: 0.92rem; }
blockquote { margin: 0; font-style: italic; }

/* ---------- gallery index ---------- */

.album-teaser { padding-block: clamp(2rem, 6vh, 5rem); }
.album-teaser h2 { font-size: clamp(1.8rem, 3.8vw, 2.8rem); }
.album-teaser h2 a { text-decoration: none; }
.album-teaser h2 a:hover { text-decoration: underline; }

.collage { display: grid; gap: 0.6rem; margin-top: 1.4rem; text-decoration: none; }
.collage img { width: 100%; border-radius: 4px; }

@media (min-width: 760px) {
  .album-teaser { display: grid; grid-template-columns: 1fr 1.6fr; gap: clamp(1.5rem, 4vw, 4rem); align-items: center; }
  .album-teaser.is-flipped h2 { order: 2; text-align: right; }
  .collage {
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(2, auto);
    margin-top: 0;
  }
  /* Staggered overlap, echoing the original's collage. */
  .collage-item.c1 { grid-column: 1 / 3; grid-row: 1; }
  .collage-item.c2 { grid-column: 2 / 4; grid-row: 2; margin-top: -22%; z-index: 2; }
  .collage-item.c3 { grid-column: 1 / 2; grid-row: 2; margin-top: -8%; }
}

/* ---------- album grid ---------- */

/* Two columns at desktop, matching the original album layout — auto-fill gave
   three at 1440px and made every photo noticeably smaller than the original. */
.album-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: clamp(0.7rem, 2vw, 1.5rem);
  grid-template-columns: 1fr;
}
@media (min-width: 700px) {
  .album-grid { grid-template-columns: repeat(2, 1fr); }
}
.album-item {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: none;
  cursor: zoom-in;
  border-radius: 4px;
  overflow: hidden;
}
.album-item img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; transition: transform 0.35s ease; }
.album-item:hover img { transform: scale(1.03); }

/* ---------- lightbox ---------- */

/* A closed <dialog> is display:none in the UA stylesheet, but AUTHOR styles win
   over UA styles regardless of specificity — so an unconditional `display: grid`
   here leaves the closed lightbox painted on the page. Scope it to [open]. */
.lightbox:not([open]) { display: none; }

.lightbox[open] {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  place-items: center;
  padding: clamp(1rem, 4vw, 3rem);
  background: rgba(0, 0, 0, 0.9);
  border: 0;
}
.lightbox::backdrop { background: rgba(0, 0, 0, 0.9); }
.lightbox img { max-width: 100%; max-height: 82vh; width: auto; border-radius: 4px; }
.lightbox-caption { color: #efefef; font-size: 0.85rem; text-align: center; margin-top: 0.9rem; max-width: 60ch; }
/* 48px minimum: below that, touch targets fail WCAG 2.5.8 / Lighthouse. */
.lightbox-close, .lightbox-nav button {
  position: absolute;
  background: rgba(255, 255, 255, 0.12);
  color: var(--white);
  border: 0;
  border-radius: 999px;
  width: 48px;
  height: 48px;
  font-size: 1.3rem;
  cursor: pointer;
  line-height: 1;
}
.lightbox-close { top: 1rem; right: 1rem; }
.lightbox-nav .prev { left: 1rem; top: 50%; transform: translateY(-50%); }
.lightbox-nav .next { right: 1rem; top: 50%; transform: translateY(-50%); }
.lightbox-close:hover, .lightbox-nav button:hover { background: rgba(255, 255, 255, 0.26); }

/* ---------- contact form ---------- */

.contact-layout { max-width: 620px; }

.form-field { margin-bottom: 1.1rem; }
.form-row { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); }

/* Reset the browser's default fieldset chrome — it is only used for grouping. */
fieldset.form-field { border: 0; padding: 0; margin-inline: 0; }
fieldset.form-field > legend { padding: 0; font-size: 0.82rem; margin-bottom: 0.4em; }

label { display: block; font-size: 0.82rem; margin-bottom: 0.4em; }
label .req { color: var(--ink-soft); }

input[type="text"], input[type="email"], input[type="tel"], textarea {
  width: 100%;
  font-family: inherit;
  font-size: 1rem;
  color: var(--ink);
  padding: 0.7em 1em;
  background: transparent;
  border: 1.5px solid var(--ink);
  border-radius: 22px;
}
textarea { border-radius: var(--radius); min-height: 130px; resize: vertical; }
input:focus, textarea:focus { outline: 3px solid var(--black); outline-offset: 2px; }

/* Honeypot: hidden from people, visible to naive bots. Not display:none —
   some bots skip those; off-screen positioning catches more. */
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.form-status { margin-top: 1rem; font-size: 0.9rem; }
.form-status[data-state="ok"] { color: #1c5b2a; font-weight: 600; }
.form-status[data-state="error"] { color: #8a1c1c; font-weight: 600; }

button[type="submit"] { cursor: pointer; }
button[disabled] { opacity: 0.6; cursor: progress; }

/* ---------- footer ---------- */

.site-footer { background: var(--yellow); }
.site-footer .zigzag { transform: scaleY(-1); }
.footer-inner {
  display: grid;
  gap: clamp(1.8rem, 4vw, 3.5rem);
  padding-block: clamp(2.4rem, 6vh, 4.5rem);
  align-items: start;
}
@media (min-width: 760px) { .footer-inner { grid-template-columns: 1fr 1fr; } }

.footer-contact h2 { font-size: clamp(1.6rem, 3vw, 2.2rem); margin-bottom: 0.5em; }
.footer-contact hr { border: 0; border-top: 1px solid var(--rule); margin: 0 0 1.4rem; }
.footer-address { font-style: normal; font-size: 0.9rem; }
.footer-address span { display: block; }
.footer-phones { margin-top: 1.2rem; font-size: 0.9rem; }
.footer-phones p { margin-bottom: 0.15em; }
.footer-email { margin-top: 1.2rem; font-size: 0.9rem; }

.map { width: 100%; aspect-ratio: 4 / 3; border: 0; border-radius: 4px; background: var(--warm); }

/* ---------- mobile nav ---------- */

@media (max-width: 719px) {
  .nav-toggle { display: flex; }
  .site-nav {
    position: absolute;
    left: 0;
    right: 0;
    top: 76px;
    flex-direction: column;
    gap: 0;
    background: var(--paper);
    padding: 0 var(--gutter);
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.25s ease;
    z-index: 50;
    border-bottom: 1px solid var(--rule);
  }
  .site-header { position: relative; }
  .site-nav a { padding: 0.9em 0; font-size: 1rem; border-top: 1px solid var(--rule); }
  .site-nav a:first-child { border-top: 0; }
  .site-header.nav-open .site-nav { max-height: 60vh; padding-block: 0.4em; }
  .site-header.nav-open .nav-toggle span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .site-header.nav-open .nav-toggle span:nth-child(2) { opacity: 0; }
  .site-header.nav-open .nav-toggle span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
}
