/* Tile Wise - site styles
   Brand: green sampled from the mascot (#00AF50). For text on white we use
   --green-text, a darker shade that meets WCAG AA contrast. */

@font-face { font-family: "Chilanka"; src: url("/fonts/chilanka-400.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Figtree"; src: url("/fonts/figtree-400.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Figtree"; src: url("/fonts/figtree-600.woff2") format("woff2"); font-weight: 600; font-display: swap; }

:root {
  --green: #00AF50;        /* brand fill */
  --green-fill: #00873F;   /* fills carrying white text (4.6:1, AA) */
  --green-text: #00773A;   /* links & headings on white (5.6:1) */
  --green-dark: #005C2D;   /* hover */
  --ink: #1E2B24;          /* body text */
  --grout: #CDD6D0;        /* joining lines, borders */
  --tint: #EEF7F1;         /* quiet panels */
  --white: #FFFFFF;

  --hand: "Chilanka", "Comic Neue", "Segoe Print", cursive;
  --sans: "Figtree", "Segoe UI", system-ui, sans-serif;

  --step-0: 1.0625rem;
  --step-1: 1.25rem;
  --step-2: 1.6rem;
  --step-3: clamp(2.2rem, 5vw, 3.4rem);
  --step-4: clamp(2.6rem, 8vw, 5.2rem);

  --wrap: 70rem;
  --gutter: clamp(1rem, 4vw, 2rem);
  --line: 2px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } *, *::before, *::after { transition: none !important; animation: none !important; } }

body {
  margin: 0;
  font-family: var(--sans);
  font-size: var(--step-0);
  line-height: 1.6;
  color: var(--ink);
  background: var(--white);
  min-height: 100vh;
  display: flex; flex-direction: column;
}
main { flex: 1 0 auto; width: 100%; }
img { max-width: 100%; height: auto; display: block; }
picture { display: contents; }
a { color: var(--green-text); text-underline-offset: 0.18em; }
a:hover { color: var(--green-dark); }
:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; }
h1, h2, h3 { line-height: 1.15; }

.skip-link { position: absolute; left: -999px; top: 0.5rem; background: var(--ink); color: var(--white); padding: 0.5rem 1rem; z-index: 10; }
.skip-link:focus { left: 0.5rem; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

main { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter) 4rem; }

/* ---------- Masthead: logo box, nav tiles joined by grout, mascot ---------- */
.masthead-inner {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 1.5rem var(--gutter) 2rem;
  display: grid;
  grid-template-columns: auto 1fr auto;
  grid-template-areas:
    "logo nav mascot"
    "logo contact mascot";
  align-items: center;
  column-gap: 0;
}
.wordmark {
  grid-area: logo;
  position: relative;
  z-index: 1;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  width: 7.5rem; height: 7rem;
  border: var(--line) solid var(--green);
  background: var(--white);
  font-family: var(--hand);
  color: var(--green-text);
  text-decoration: none;
  line-height: 0.9;
}
.wordmark-tile { font-size: 3.1rem; }
.wordmark-wise { font-size: 2.2rem; }
.wordmark:hover { color: var(--green-dark); }

.tilenav { grid-area: nav; align-self: end; }
.tilenav ul {
  position: relative;
  list-style: none; margin: 0; padding: 0;
  display: flex; gap: 0.75rem; justify-content: space-between;
  padding: 0 0.75rem; /* grout stubs to the logo and mascot */
}
/* the grout line that joins logo, tiles and mascot */
.tilenav ul::before {
  content: ""; position: absolute; left: 0; right: 0; top: 50%;
  border-top: var(--line) solid var(--green);
}
.tilenav li { position: relative; flex: 1 1 0; }
.tilenav a {
  display: block;
  padding: 0.3rem 0.5rem;
  text-align: center;
  background: var(--white);
  border: var(--line) solid var(--green);
  color: var(--green-text);
  text-decoration: none;
  font-size: 1.05rem;
  transition: background-color 0.15s, color 0.15s;
}
.tilenav a:hover { background: var(--tint); }
.tilenav a[aria-current="page"] { background: var(--green-fill); color: var(--white); border-color: var(--green-fill); }

.masthead-contact {
  grid-area: contact;
  justify-self: end;
  margin: 0.4rem 0.75rem 0 0;
  font-size: 0.9rem;
  line-height: 1.4;
  display: flex; flex-direction: column; align-items: flex-start;
}
.masthead-contact a:last-child { text-decoration: none; }
.mascot { grid-area: mascot; width: 7.5rem; margin-left: 0; position: relative; }
.mascot img { width: 100%; aspect-ratio: 590 / 543; object-fit: cover; }

@media (max-width: 56em) {
  .masthead-inner {
    grid-template-columns: auto 1fr auto;
    grid-template-areas:
      "logo contact mascot"
      "nav nav nav";
    row-gap: 1.25rem;
    padding-bottom: 1.5rem;
  }
  .wordmark { width: 5.5rem; height: 5.2rem; }
  .wordmark-tile { font-size: 2.3rem; }
  .wordmark-wise { font-size: 1.65rem; }
  .mascot { width: 5.5rem; }
  .masthead-contact { justify-self: center; margin: 0; align-items: center; }
  /* on small screens the nav becomes a tiled panel: tiles with grout gaps */
  .tilenav ul {
    display: grid; grid-template-columns: repeat(3, 1fr);
    gap: 4px; padding: 4px; background: var(--grout);
  }
  .tilenav ul::before { display: none; }
  .tilenav a { border: 0; padding: 0.7rem 0.25rem; }
}

/* ---------- Headings ---------- */
.page-title, .section-title, .gallery-title {
  font-family: var(--hand);
  font-weight: 400;
  color: var(--green-text);
  margin: 0 0 1rem;
  letter-spacing: -0.01em;
}
.page-title { font-size: var(--step-3); }
.section-title { font-size: var(--step-2); }

/* ---------- Home ---------- */
.hero { position: relative; margin: 0; }
.hero-img { width: 100%; aspect-ratio: 16 / 7; object-fit: cover; }
.hero-title {
  position: absolute; right: 6%; bottom: 6%;
  margin: 0;
  font-family: var(--hand); font-weight: 400;
  color: var(--white);
  text-align: left;
  line-height: 0.95;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.55);
}
.hero-title span { display: block; }
.hero-title span:first-child { font-size: calc(var(--step-4) * 0.72); }
.hero-title span:last-child { font-size: var(--step-4); }
@media (max-width: 40em) {
  .hero-img { aspect-ratio: 4 / 3; }
  .hero-title { right: 5%; left: 5%; }
}
.intro { max-width: 46rem; margin: 2rem auto 2.5rem; text-align: center; font-size: var(--step-1); }
.intro p { margin: 0 0 0.75rem; }
@media (max-width: 40em) { .intro { text-align: left; font-size: var(--step-0); } }

/* ---------- Branch cards ---------- */
.branches {
  list-style: none; margin: 0; padding: 0;
  display: grid; gap: 1.25rem;
  grid-template-columns: repeat(auto-fit, minmax(14.5rem, 1fr));
}
.branch { border: var(--line) solid var(--green); background: var(--white); text-align: center; display: flex; flex-direction: column; }
.branch-name {
  margin: 0; padding: 0.35rem 0.5rem 0.2rem;
  background: var(--green-fill); color: var(--white);
  font-family: var(--hand); font-weight: 400; font-size: 2rem;
}
.branch-body { padding: 0.9rem 0.75rem 1rem; font-size: 0.97rem; line-height: 1.5; }
.branch-body p { margin: 0 0 0.7rem; }
.branch-body a { text-decoration: none; }
.branch-body a:hover { text-decoration: underline; }
.branch-email { overflow-wrap: anywhere; }
.hours { margin: 0; }
.hours-title { color: var(--green-text); font-weight: 600; }
.hours dd { margin: 0; }

/* ---------- Two-column content pages ---------- */
.split {
  display: grid;
  grid-template-columns: minmax(12rem, 17rem) minmax(0, 40rem);
  gap: 1rem 3.5rem;
  margin-top: 1.5rem;
  margin-bottom: 3rem;
}
@media (max-width: 56em) { .split { grid-template-columns: 1fr; } }
.side-photo { width: 100%; max-width: 16rem; aspect-ratio: 1; object-fit: cover; border: var(--line) solid var(--green); }
.prose > :first-child { margin-top: 0.6rem; }
.prose p { margin: 0 0 1rem; }
.prose .lead { font-size: var(--step-1); }
.prose h2, .prose h3 { font-family: var(--sans); font-weight: 600; color: var(--green-text); margin: 1.6rem 0 0.25rem; font-size: var(--step-1); }
.prose h3 { font-size: 1.05rem; margin-top: 1.1rem; }
.prose .small { font-size: 0.9rem; color: #4d5a53; }

/* staggered team photos, like tiles set slightly off grid */
.team { position: relative; display: grid; grid-template-columns: 1fr 1fr; width: 16rem; max-width: 100%; }
.team img { width: 100%; aspect-ratio: 1; object-fit: cover; border: 5px solid var(--white); }
.team-1 { grid-column: 1; grid-row: 1; }
.team-2 { grid-column: 2; grid-row: 1 / span 2; align-self: center; box-shadow: 0 0 0 var(--line) var(--grout); }
.team-3 { grid-column: 1; grid-row: 2; }
@media (max-width: 56em) { .team { grid-template-columns: repeat(3, 1fr); width: 100%; max-width: 24rem; } .team-2 { grid-row: 1; } .team-3 { grid-column: 3; grid-row: 1; } }

/* ---------- Buttons ---------- */
.tile-button {
  display: inline-block;
  font: inherit; font-size: 1.05rem;
  padding: 0.5rem 1.4rem;
  border: var(--line) solid var(--green);
  background: var(--white);
  color: var(--green-text);
  text-decoration: none;
  cursor: pointer;
}
.tile-button:hover { background: var(--green-fill); border-color: var(--green-fill); color: var(--white); }
.tile-button[disabled] { opacity: 0.6; cursor: wait; }

/* ---------- Gallery ---------- */
.gallery-head, .contact-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 2.5rem; margin-top: 1.5rem; }
.gallery-head p, .contact-head p { margin: 0 0 1rem; max-width: 34rem; }
.gallery-jump ul { list-style: none; margin: 0 0 2rem; padding: 0; display: flex; flex-wrap: wrap; gap: 0.5rem; }
.gallery-jump a { display: block; padding: 0.2rem 0.75rem; border: var(--line) solid var(--grout); text-decoration: none; }
.gallery-jump a:hover { border-color: var(--green); }
.gallery-section { display: grid; grid-template-columns: 12rem minmax(0, 1fr); gap: 1rem 2rem; margin-bottom: 3rem; scroll-margin-top: 1rem; }
@media (max-width: 56em) { .gallery-section { grid-template-columns: 1fr; } }
.gallery-title { font-size: var(--step-2); color: var(--ink); }
.gallery-grid {
  list-style: none; margin: 0; padding: 0;
  display: grid; gap: 0.9rem;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 15rem), 1fr));
}
.gallery-grid figure { margin: 0; }
.gallery-link { display: block; overflow: hidden; background: var(--tint); }
.gallery-link img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; transition: transform 0.25s ease; }
.gallery-link:hover img { transform: scale(1.03); }
.gallery-grid figcaption { font-size: 0.9rem; padding-top: 0.3rem; color: #4d5a53; }

.lightbox { border: 0; padding: 0; max-width: min(96vw, 80rem); background: var(--white); }
.lightbox::backdrop { background: rgba(20, 30, 24, 0.85); }
.lightbox img { max-height: 80vh; width: auto; margin: 0 auto; }
.lightbox-caption { margin: 0; padding: 0.5rem 1rem 0; text-align: center; }
.lightbox-nav { display: flex; justify-content: space-between; padding: 0.5rem 1rem 1rem; }
.lightbox-nav button, .lightbox-close { font: inherit; background: var(--white); border: var(--line) solid var(--green); color: var(--green-text); padding: 0.25rem 0.9rem; cursor: pointer; }
.lightbox form { position: absolute; top: 0.5rem; right: 0.5rem; margin: 0; }
.lightbox-close { font-size: 1.5rem; line-height: 1; padding: 0.1rem 0.6rem; }

/* ---------- Contact ---------- */
.contact-lower { display: grid; grid-template-columns: minmax(14.5rem, 20rem) minmax(0, 1fr); gap: 2.5rem; margin-top: 2.5rem; align-items: start; }
@media (max-width: 56em) { .contact-lower { grid-template-columns: 1fr; } }
.enquiry { background: var(--tint); padding: 1.5rem clamp(1rem, 3vw, 2rem) 2rem; border-top: 6px solid var(--green-fill); scroll-margin-top: 1rem; }
.enquiry-form { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem 1.25rem; }
@media (max-width: 40em) { .enquiry-form { grid-template-columns: 1fr; } }
.field-wide { grid-column: 1 / -1; }
.field label { display: block; font-weight: 600; margin-bottom: 0.25rem; }
.optional { font-weight: 400; color: #4d5a53; }
.field input, .field select, .field textarea {
  width: 100%; font: inherit; color: var(--ink);
  padding: 0.55rem 0.65rem;
  border: var(--line) solid var(--grout);
  background: var(--white);
  border-radius: 0;
}
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--green); outline: 2px solid var(--green); outline-offset: 0; }
.field [aria-invalid="true"] { border-color: #B3261E; }
.field-error { color: #B3261E; font-size: 0.9rem; margin: 0.25rem 0 0; }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.form-note { font-size: 0.92rem; margin: 0; }
.form-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem 1.25rem; }
.form-status { margin: 0; font-weight: 600; }
.form-status.is-ok { color: var(--green-text); }
.form-status.is-error { color: #B3261E; }

/* ---------- Footer ---------- */
.site-footer { background: var(--green-text); color: var(--white); margin-top: 2rem; border-top: 6px solid var(--green); }
.site-footer a { color: var(--white); }
.footer-inner {
  max-width: var(--wrap); margin: 0 auto; padding: 2rem var(--gutter);
  display: grid; gap: 1.5rem; grid-template-columns: 1fr 2fr 1fr; font-size: 0.95rem;
}
@media (max-width: 56em) { .footer-inner { grid-template-columns: 1fr; } }
.footer-inner p { margin: 0 0 0.35rem; }
.footer-name { font-family: var(--hand); font-size: 2rem; line-height: 1; }
.footer-heading { font-weight: 600; }
.footer-small { font-size: 0.88rem; }
