/* Kitchen Remodel Valencia
   One stylesheet for the whole site. No framework, no build step.
   Order: tokens, reset, shell, type, header, components, sections, footer, motion. */

/* ---------- tokens ---------- */
:root {
  --ink:        #211D19;
  --ink-2:      #3A342D;
  --body:       #4A423A;
  --muted:      #8C7F70;
  --cream:      #FAF7F2;
  --oat:        #EFE8DD;
  --line:       #E7DED1;
  --white:      #FFFFFF;
  --oak:        #C8AC8C;
  --clay:       #8C5B3F;
  --on-dark:    #F4EEE4;
  --on-dark-2:  #BDB2A4;

  /* Focus ring colour. Clay clears 3:1 on cream, oat and white but only
     reaches 2.94:1 on the ink sections, so those override it below. */
  --focus: var(--clay);

  --serif: Newsreader, Georgia, "Times New Roman", serif;
  --sans:  Karla, "Segoe UI", system-ui, -apple-system, sans-serif;

  /* One shell. Every full-width section pads to it, so all content shares an edge.
     Deriving from this instead of restating the formula is deliberate: the pavers
     build broke exactly there. */
  --gutter: 20px;
  --shell:  min(1240px, 100% - (var(--gutter) * 2));

  --s-1: 8px;  --s-2: 12px; --s-3: 16px; --s-4: 24px;
  --s-5: 32px; --s-6: 48px; --s-7: 64px; --s-8: 96px;
  --section-y: 64px;
}

@media (min-width: 700px)  { :root { --gutter: 40px; --section-y: 84px; } }
@media (min-width: 1040px) { :root { --gutter: 64px; --section-y: 104px; } }

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

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

body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.7;
  text-rendering: optimizeLegibility;
}

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

h1, h2, h3, h4 { margin: 0; font-weight: 400; text-wrap: balance; }
p  { margin: 0; }
ul, ol { margin: 0; }

a { color: var(--clay); text-decoration: none; }

:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
}
/* Any surface the ring lands on, not just any section. A primary button
   carries its own ink background wherever it sits, so it needs the light
   ring even in the middle of a cream section. */
.section--ink, .site-footer, .btn--primary { --focus: var(--oak); }

/* Clipped rather than parked at -9999px. An offscreen offset flips to the
   right edge under RTL and drags a horizontal scrollbar onto every page. */
.skip {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.skip:focus {
  position: fixed;
  inset-block-start: 0; inset-inline-start: 0;
  width: auto; height: auto;
  clip-path: none;
  background: var(--ink); color: var(--on-dark);
  padding: var(--s-2) var(--s-4);
  z-index: 100;
}

/* ---------- shell ---------- */
.shell { width: var(--shell); margin-inline: auto; }

.section { padding-block: var(--section-y); }
.section--tight { padding-block: 0 var(--section-y); }
.section--oat  { background: var(--oat); }
.section--ink  { background: var(--ink); color: var(--on-dark); }
.section--ink h1, .section--ink h2, .section--ink h3 { color: var(--on-dark); }

/* ---------- type ---------- */
.eyebrow {
  font: 500 11px var(--sans);
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0;
}
.section--ink .eyebrow { color: var(--oak); }

.display {
  font-family: var(--serif);
  font-weight: 300;
  font-size: clamp(36px, 5.2vw, 62px);
  line-height: 1.08;
  letter-spacing: -0.02em;
}
.h2 {
  font-family: var(--serif);
  font-weight: 300;
  font-size: clamp(30px, 3.4vw, 46px);
  line-height: 1.14;
  letter-spacing: -0.015em;
}
.h3 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(21px, 1.9vw, 27px);
  line-height: 1.25;
}
.lede { font-size: clamp(17px, 1.4vw, 19px); line-height: 1.65; color: var(--body); }
.prose p { color: var(--body); }
.prose p + p { margin-top: var(--s-3); }
.prose { max-width: 68ch; }
.muted { color: var(--muted); font-size: 15px; }
.section--ink .muted { color: var(--on-dark-2); }
.stack { display: flex; flex-direction: column; }

/* Placeholder plates. Every one names the photo it is waiting for. */
.ph {
  background: var(--oat);
  border: 1px dashed var(--oak);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 10px; text-align: center; padding: var(--s-4);
  min-height: 180px;
}
.ph span {
  font: 500 11px/1.5 var(--sans);
  letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--muted); max-width: 34ch;
}

/* Placed photos. Same footprint as the plate they replace, so a slot filling
   in does not move anything around it. Emitted by photo() in _build.py. */
/* width:100% matters. Both of these carry an inline aspect-ratio, and in a
   stretched grid cell (the hero) an auto width would be derived FROM the row
   height and overflow the column. A definite width makes aspect-ratio do the
   one job it is here for, which is holding the box shape before an image
   loads. */
.photo, .ph { width: 100%; }
.photo { overflow: hidden; background: var(--oat); }
.photo picture { display: contents; }
.photo img {
  display: block; width: 100%; height: 100%; object-fit: cover;
  /* Pure black at low opacity, never a tinted neutral. A tinted outline picks
     up the surface behind it and reads as dirt on the image edge. */
  outline: 1px solid oklch(0 0 0 / 0.1); outline-offset: -1px;
}

/* A computer generated image ships labelled. See _photo-claims.py. */
.photo-figure { margin: 0; display: flex; flex-direction: column; }
.photo-label {
  font: 500 11px/1.5 var(--sans);
  letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--muted); padding-top: 8px;
}
/* No nowrap here. Short tokens like [PHONE] have no spaces so they hold together
   on their own, while a long [OWNER: ...] note under nowrap pushed a 375px page
   out to 583px. */
.tbd {
  background: #F3E4D6; color: var(--clay);
  padding: 1px 7px; border-radius: 2px;
  font-weight: 600; overflow-wrap: anywhere;
}
.section--ink .tbd { background: var(--ink-2); color: #E4D9C8; }

/* ---------- header ---------- */
.site-header {
  background: var(--cream);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 40;
}
.site-header__bar {
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--s-4); padding-block: 14px;
}
.brand { display: flex; align-items: center; gap: 12px; color: var(--ink); }
.brand__mark { width: 34px; height: 34px; flex: none; }
.brand__name  { display: flex; flex-direction: column; line-height: 1.15; }
.brand__name b {
  font: 600 13px var(--sans); letter-spacing: 0.16em; text-transform: uppercase;
}
.brand__name span {
  font: 400 11px var(--sans); letter-spacing: 0.22em;
  text-transform: uppercase; color: var(--muted);
}

.nav { display: none; }
/* :not(.btn) matters. A bare `.nav a` colour rule outranks `.btn--primary`
   and paints the call-to-action ink on ink, which is invisible. */
.nav a:not(.btn) { color: var(--ink); font-size: 15px; }
.nav a:not(.btn)[aria-current="page"] { border-bottom: 1px solid var(--oak); }

.btn {
  display: inline-block;
  font: 600 15px var(--sans);
  letter-spacing: 0.04em;
  padding: 16px 30px;
  border: 1px solid transparent;
  text-align: center;
  cursor: pointer;
}
.btn--primary { background: var(--ink); color: var(--cream); }
.btn--ghost { border-color: var(--ink); color: var(--ink); }
.section--ink .btn--ghost { border-color: var(--on-dark-2); color: var(--on-dark); }
.btn--sm { padding: 13px 22px; font-size: 14px; }
.btn:active { scale: 0.96; }

.nav-toggle {
  width: 46px; height: 46px; flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  background: none; border: 1px solid #DDD2C2; cursor: pointer; color: var(--ink);
}
/* Both icons stay in the DOM and cross fade. Toggling display gives the swap
   no enter and no exit, so the control reads as a jump cut at every tap. */
.nav-toggle { position: relative; }
.nav-toggle svg { position: absolute; top: 50%; inset-inline-start: 50%; translate: -50% -50%; }
.nav-toggle__close,
.nav-toggle[aria-expanded="true"] .nav-toggle__open {
  opacity: 0; scale: 0.25; filter: blur(4px);
}
.nav-toggle[aria-expanded="true"] .nav-toggle__close {
  opacity: 1; scale: 1; filter: blur(0px);
}

.nav-panel {
  border-top: 1px solid var(--line);
  padding-block: var(--s-3) var(--s-5);
}
.nav-panel[hidden] { display: none; }
.nav-panel a:not(.btn) {
  display: block; color: var(--ink);
  padding-block: 13px; border-bottom: 1px solid var(--line);
  font-size: 17px;
}
.nav-panel .btn { margin-top: var(--s-4); width: 100%; }

/* The nav fits inline once there is room for all six links plus the call button. */
@media (min-width: 1040px) {
  .nav { display: flex; align-items: center; gap: 26px; }
  .nav-toggle, .nav-panel { display: none; }
}

/* ---------- breadcrumbs ---------- */
.crumbs {
  font-size: 14px; color: var(--muted);
  padding-block: var(--s-3);
  border-bottom: 1px solid var(--line);
}
.crumbs ol { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.crumbs li + li::before { content: "/"; margin-inline-end: 8px; color: var(--oak); }
.crumbs a { color: var(--muted); display: inline-block; padding-block: 4px; }
.crumbs [aria-current="page"] { color: var(--ink); }

/* ---------- hero ---------- */
.hero { display: grid; grid-template-columns: 1fr; }
.hero__text {
  display: flex; flex-direction: column; justify-content: center;
  gap: var(--s-4);
  padding-block: var(--s-6);
  width: var(--shell); margin-inline: auto;
}
.hero__media { min-height: 260px; }
.hero__actions { display: flex; flex-wrap: wrap; gap: 12px; padding-top: var(--s-1); }
.hero__actions .btn { flex: 1 1 auto; }

@media (min-width: 900px) {
  .hero { grid-template-columns: 1fr 1fr; align-items: stretch; }
  .hero__media { min-height: 560px; }
  .hero__text {
    padding-block: var(--s-8);
    /* Half of the grid, but its text still lands on the shared shell edge. */
    width: auto; margin-inline: 0;
    padding-inline-start: max(var(--gutter), (100vw - 1240px) / 2);
    padding-inline-end: var(--gutter);
  }
  .hero__actions .btn { flex: 0 0 auto; }
}

/* Compact hero for subpages: no photo, just the label and headline. */
.pagehead { padding-block: var(--s-6) var(--s-5); }
.pagehead .display { font-size: clamp(32px, 4.4vw, 52px); }
.pagehead__inner { display: flex; flex-direction: column; gap: var(--s-3); }
/* The measure belongs on the headline, not on its wrapper. A ch on the wrapper
   is measured in the 17px body font while the headline runs at up to 52px, so
   a 24ch wrapper squeezed the display type down to a few words per line. */
.pagehead .display { max-width: 17ch; }
.pagehead__lede { max-width: 60ch; margin-top: var(--s-2); }

/* ---------- trust strip ---------- */
.trust { display: grid; grid-template-columns: 1fr; gap: var(--s-4); }
.trust > div { display: flex; flex-direction: column; gap: 5px; }
.trust b {
  font: 500 12px var(--sans); letter-spacing: 0.18em;
  text-transform: uppercase; color: var(--oak);
}
.trust span { font-size: 15px; color: var(--on-dark-2); }
@media (min-width: 620px)  { .trust { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s-5); } }
@media (min-width: 1040px) { .trust { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--s-6); } }

/* ---------- grids ---------- */
/* Grid and flex children default to min-width:auto, so anything with a wide
   min-content size (form controls, long tokens, tables) refuses to shrink and
   pushes the page sideways. This is the single most common cause of a mobile
   horizontal scrollbar, so it is set once here rather than patched per case. */
.grid > *, .split > * { min-width: 0; }

.grid { display: grid; gap: var(--s-4); grid-template-columns: 1fr; }
@media (min-width: 620px)  { .grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 620px)  { .grid--3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 980px)  { .grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 620px)  { .grid--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1040px) { .grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (min-width: 620px)  { .grid--5 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s-5); } }
@media (min-width: 1040px) { .grid--5 { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: var(--s-5); } }

.split { display: grid; gap: var(--s-5); grid-template-columns: 1fr; align-items: start; }
@media (min-width: 900px) {
  .split { grid-template-columns: 1fr 1fr; gap: var(--s-7); }
  .split--lead { grid-template-columns: 0.8fr 1.2fr; }
  .split--offset > :last-child { padding-top: 34px; }
}

/* ---------- cards ---------- */
.card {
  display: flex; flex-direction: column;
  border: 1px solid var(--line); background: var(--white);
  color: var(--ink);
}
.card__body { padding: 26px 26px 30px; display: flex; flex-direction: column; gap: 10px; }
.card__body p { font-size: 15px; color: var(--body); }
.card__more {
  font: 600 13px var(--sans); letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--clay); padding-top: 4px;
}
.card .ph { border: none; border-bottom: 1px dashed var(--oak); min-height: 190px; }
.card .photo { min-height: 190px; }

/* ---------- cost tiers ---------- */
.tier {
  border: 1px solid var(--line); background: var(--white);
  padding: 36px 32px; display: flex; flex-direction: column; gap: 18px;
  position: relative;
}
.tier--pick { border-color: var(--ink); }
.tier__flag {
  position: absolute; top: -12px; inset-inline-start: 32px;
  background: var(--ink); color: var(--cream);
  font: 600 10px var(--sans); letter-spacing: 0.18em;
  text-transform: uppercase; padding: 5px 12px;
}
.tier__price { font: 400 30px var(--serif); }
/* The qualifier travels with the number. A bare figure in the card's headline
   slot reads as this business's price, and _local-facts/Valencia.md C1 is
   explicit: never present a Cost vs. Value figure as our price. Same treatment
   as .eyebrow and .photo-label, so no new visual language. */
.tier__price-note {
  font: 500 11px var(--sans); letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--muted);
}
.tier__source { font-size: 13px; color: var(--muted); margin-top: var(--s-2); }
.tier__bench {
  background: #F7F4EE; border-inline-start: 2px solid var(--oak);
  padding: 12px 14px; font-size: 14px; color: #5B534A; line-height: 1.55;
}
.tier__bench strong { font-weight: 600; color: var(--ink); }
.tier ul { padding-inline-start: 18px; font-size: 16px; color: var(--body); }
.tier li + li { margin-top: 7px; }
.tier__foot {
  border-top: 1px solid var(--oat); padding-top: 16px;
  font-size: 15px; color: var(--muted); margin-top: auto;
}

.callout {
  background: var(--oat); padding: 36px 40px;
  display: grid; gap: var(--s-4); grid-template-columns: 1fr; align-items: center;
}
@media (min-width: 900px) { .callout { grid-template-columns: 1.7fr auto; gap: var(--s-6); } }

/* ---------- numbered steps ---------- */
.step { display: flex; flex-direction: column; gap: 12px; border-top: 2px solid var(--ink); padding-top: 20px; }
.step b { font: 400 32px var(--serif); color: var(--oak); font-weight: 400; }
.step h3 { font: 600 14px var(--sans); letter-spacing: 0.1em; text-transform: uppercase; }
.step p { font-size: 15px; color: var(--body); }

/* ---------- notes list (the local section) ---------- */
.note { display: flex; flex-direction: column; gap: 8px; border-inline-start: 2px solid var(--oak); padding-inline-start: 22px; }
.note h3 { font: 500 13px var(--sans); letter-spacing: 0.14em; text-transform: uppercase; }
.note p { font-size: 16px; color: var(--body); }
.notes { display: flex; flex-direction: column; gap: var(--s-5); }

/* ---------- FAQ ---------- */
.qa { border-top: 1px solid var(--line); }
.section--ink .qa { border-color: var(--ink-2); }
.qa:last-of-type { border-bottom: 1px solid var(--line); }
.section--ink .qa:last-of-type { border-color: var(--ink-2); }
.qa summary {
  list-style: none; cursor: pointer;
  padding-block: 22px; padding-inline-end: 42px;
  position: relative;
  display: flex; align-items: baseline;
  font: 400 clamp(19px, 1.7vw, 22px) var(--serif);
}
.qa summary::-webkit-details-marker { display: none; }
/* Two bars, not a plus glyph swapped for a dash. Swapping ::after content is a
   visibility toggle with no state in between, and the character it swapped to
   was U+2013, an en dash, which this site does not use anywhere else. Rotating
   the upright bar flat reads the same and can be interrupted mid turn. */
.qa summary::before,
.qa summary::after {
  content: ""; position: absolute;
  inset-inline-end: 8px; top: 50%;
  width: 17px; height: 1.5px; background: var(--oak);
  translate: 0 -50%;
}
.qa summary::before { rotate: 90deg; }
.qa[open] summary::before { rotate: 0deg; }
.qa__a { padding-bottom: 22px; font-size: 16px; color: var(--body); max-width: 72ch; }
.section--ink .qa__a { color: var(--on-dark-2); }
.section--ink .qa__a a { color: var(--oak); border-bottom: 1px solid #6B6055; }

/* ---------- table ---------- */
.table-wrap { overflow-x: auto; }
/* A scroller is focusable so a keyboard can reach the columns that are off
   screen, and it announces itself as a region. Content hidden with no cue at
   all may as well not exist, which is why the hint below is not optional. */
.table-wrap:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; }
.table-hint { display: none; }
@media (max-width: 760px) {
  .table-hint {
    display: block; margin-top: 10px;
    font-size: 14px; color: var(--muted);
  }
}
table { border-collapse: collapse; width: 100%; min-width: 520px; font-size: 16px; }
th, td { text-align: start; padding: 14px 16px; border-bottom: 1px solid var(--line); }
th { font: 600 12px var(--sans); letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
td { color: var(--body); }
td strong { color: var(--ink); font-weight: 600; }

/* ---------- form ---------- */
.form { display: flex; flex-direction: column; gap: var(--s-4); max-width: 560px; }
.field { display: flex; flex-direction: column; gap: 7px; }
.field label { font: 600 13px var(--sans); letter-spacing: 0.06em; }
.field input, .field select, .field textarea {
  font: 400 16px var(--sans);
  padding: 14px 15px;
  border: 1px solid #DDD2C2; background: var(--white); color: var(--ink);
  border-radius: 0;
  /* Controls carry an intrinsic width from their default size attribute.
     Without these two they refuse to shrink inside a narrow column. */
  width: 100%; min-width: 0;
}
.field textarea { min-height: 130px; resize: vertical; }
.field input:focus-visible, .field select:focus-visible, .field textarea:focus-visible {
  border-color: var(--clay);
}
.field small { color: var(--muted); font-size: 13px; }
.form__error {
  background: #F7E4DC; border-inline-start: 3px solid var(--clay);
  padding: 12px 14px; font-size: 15px; color: #6B3E28;
}
.form__error[hidden] { display: none; }

/* ---------- footer ---------- */
.site-footer { background: var(--ink); color: var(--on-dark-2); padding-block: var(--s-7) 40px; }
.site-footer a:not(.btn) { color: var(--on-dark-2); font-size: 15px; }
.site-footer h2 {
  font: 600 11px var(--sans); letter-spacing: 0.18em;
  text-transform: uppercase; color: var(--on-dark);
}
.footer-grid { display: grid; gap: var(--s-5); grid-template-columns: 1fr; }
.footer-col { display: flex; flex-direction: column; gap: 11px; }
.footer-legal {
  margin-top: 40px; border-top: 1px solid var(--ink-2);
  padding-top: var(--s-4); font-size: 13px; color: var(--muted);
  display: flex; flex-wrap: wrap; gap: var(--s-3) var(--s-4); justify-content: space-between;
}
@media (min-width: 620px)  { .footer-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1040px) { .footer-grid { grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: var(--s-6); } }

/* ---------- motion ---------- */
@media (prefers-reduced-motion: no-preference) {
  a, .card { transition: color .15s ease, background-color .15s ease, border-color .15s ease; }
  .btn {
    transition: color .15s ease, background-color .15s ease, border-color .15s ease,
                scale .15s cubic-bezier(0.2, 0, 0, 1);
  }
  .qa summary::before { transition: rotate .2s cubic-bezier(0.2, 0, 0, 1); }
  .nav-toggle svg {
    transition: opacity .2s cubic-bezier(0.2, 0, 0, 1),
                scale .2s cubic-bezier(0.2, 0, 0, 1),
                filter .2s cubic-bezier(0.2, 0, 0, 1);
  }
}

@media print {
  .site-header, .site-footer, .nav-panel, .hero__media, .ph, .photo { display: none; }
  body { background: #fff; font-size: 12pt; }
}


/* Hover treatments are gated so a tap on a touch screen cannot leave a
   control stuck in its hover state after the finger lifts. */
@media (hover: hover) {
  a:hover { color: var(--ink); }
  .brand:hover { color: var(--ink); }
  .btn--primary:hover { background: var(--ink-2); color: var(--cream); }
  .btn--ghost:hover { background: var(--ink); color: var(--cream); }
  .section--ink .btn--ghost:hover { background: var(--on-dark); color: var(--ink); }
  .crumbs a:hover { color: var(--ink); }
  .card:hover { border-color: var(--oak); color: var(--ink); }
  .site-footer a:not(.btn):hover { color: var(--on-dark); }
  .qa summary:hover { color: var(--clay); }
  .qa summary:hover::before, .qa summary:hover::after { background: var(--clay); }
  .section--ink .qa summary:hover { color: var(--oak); }
  .section--ink .qa summary:hover::before,
  .section--ink .qa summary:hover::after { background: var(--on-dark); }
}
