/* ==========================================================================
   TOKENS — project-specific. Rewrite this file per client, keep the same
   variable NAMES so base/layout/components.css never need to change.
   This build: "Fell End", a stone cottage in Wensleydale, North Yorkshire.
   Palette grounded in the fell — moss, limestone, bracken, slate, dusk.
   ========================================================================== */

:root {
  /* ---- Color: named, not generic-grey-1/2/3 ---- */
  --ink:        #2b2e28;  /* warm near-black — body text, dark sections */
  --stone:      #dcd6c9;  /* limestone / raw wool — light surfaces */
  --mist:       #f4f2ec;  /* pale wash — page background */
  --moss:       #4a5d3a;  /* fell moss — primary accent, links, CTAs */
  --moss-deep:  #364028;  /* moss, darkened — hover states */
  --bracken:    #9c5330;  /* bracken hillside — secondary accent, used once */
  --slate:      #5b6670;  /* slate-blue grey — muted text, borders, icons */
  --slate-pale: #c7cdc9;  /* light border on --mist backgrounds */

  /* Convention: every token file aliases --accent so shared base rules
     (focus rings etc.) never silently fall back to a browser default
     just because this project's accent variable has a different name. */
  --accent: var(--moss);
  --accent-contrast: #ffffff;

  --success: #3f6b3a;
  --error:   #a3402c;

  /* ---- Type ---- */
  --font-display: "Fraunces", Georgia, "Times New Roman", serif;
  --font-body:    "Work Sans", -apple-system, "Segoe UI", sans-serif;
  --font-mono:    "IBM Plex Mono", ui-monospace, "SFMono-Regular", monospace;

  --fs-eyebrow: 0.8rem;
  --fs-body:    1rem;
  --fs-lede:    1.2rem;
  --fs-h3:      1.5rem;
  --fs-h2:      clamp(1.75rem, 1.3rem + 2vw, 2.5rem);
  --fs-h1:      clamp(2.5rem, 1.7rem + 4vw, 4.25rem);

  --lh-tight: 1.1;
  --lh-body:  1.6;

  /* ---- Spacing / layout ---- */
  --container-max: 72rem;
  --container-pad: clamp(1.25rem, 5vw, 4rem);
  --section-space: clamp(3.5rem, 6vw, 7rem);

  --radius:      0.4rem;
  --radius-lg:   0.9rem;
  --border-w:    1.5px;

  --nav-height: 4.25rem;

  /* ---- Motion ---- */
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --dur:  360ms;
}

@media (prefers-reduced-motion: reduce) {
  :root { --dur: 0ms; }
}
/* ==========================================================================
   BASE — reset + element defaults. Reusable as-is across projects.
   ========================================================================== */

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

html {
  scroll-behavior: smooth;
  /* Required whenever a sticky/fixed nav is present — without this,
     every anchor jump lands its target flush under the nav bar. */
  scroll-padding-top: var(--nav-height);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  color: var(--ink);
  background: var(--mist);
}

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

h1, h2, h3, h4 {
  font-family: var(--font-display);
  line-height: var(--lh-tight);
  margin: 0;
  font-weight: 600;
}
h1 { font-size: var(--fs-h1); }
h2 { font-size: var(--fs-h2); }
h3 { font-size: var(--fs-h3); }

p { margin: 0; }

a { color: inherit; text-decoration: none; }

ul, ol { margin: 0; padding: 0; list-style: none; }

button {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
  background: none;
  border: none;
  cursor: pointer;
}

input, textarea, select {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}

/* Single, consistent focus style — every interactive element reads
   --accent, so any token file missing the --accent alias fails loudly
   (unstyled outline) rather than silently losing focus visibility. */
:focus-visible {
  outline: 2.5px solid var(--accent);
  outline-offset: 2px;
}

/* Belt-and-braces: an element hidden via the `hidden` attribute must
   stay hidden even if a later utility class (e.g. a flex/grid class on
   the same element) would otherwise override `display: none`. */
[hidden] { display: none !important; }

.visually-hidden {
  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 — visible only on keyboard focus */
.skip-link {
  position: absolute;
  left: 1rem;
  top: -3rem;
  background: var(--ink);
  color: var(--mist);
  padding: 0.6rem 1rem;
  border-radius: var(--radius);
  z-index: 100;
  transition: top var(--dur) var(--ease);
}
.skip-link:focus { top: 1rem; }
/* ==========================================================================
   LAYOUT — generic primitives. Reusable as-is. Check this file for an
   existing pattern before writing fresh flex/grid for a new section.

   Breakpoints (the only three used anywhere in this system):
     max-width: 640px   mobile
     max-width: 960px   tablet & down
     min-width: 961px   desktop & up
   ========================================================================== */

.container {
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--container-pad);
}

.section {
  padding-block: var(--section-space);
}
.section--alt   { background: var(--stone); }
.section--dark  { background: var(--ink); color: var(--mist); }
.section--dark a { color: var(--mist); }

/* Vertical rhythm between direct children */
.stack > * + * { margin-top: var(--stack-space, 1.25rem); }
.stack--tight > * + *  { --stack-space: 0.6rem; }
.stack--loose > * + *  { --stack-space: 2.25rem; }
/* margin-top has no effect on inline elements — a footer link list of
   bare <a> tags needs this or it collapses onto one line. */
.stack > a { display: block; }

/* Horizontal wrapping group (button rows, tag lists) */
.cluster {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--cluster-gap, 0.9rem);
}

/* 50/50 two-column, collapses under 760px */
.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(2rem, 5vw, 4rem);
  align-items: center;
}
@media (max-width: 760px) {
  .split { grid-template-columns: 1fr; }
}
.split--reverse { direction: rtl; }
.split--reverse > * { direction: ltr; }
@media (max-width: 760px) {
  .split--reverse { direction: ltr; }
}

/* Self-wrapping card/image grid */
.grid-auto {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(var(--grid-auto-min, 15rem), 1fr));
  gap: clamp(1.25rem, 3vw, 2rem);
}

/* Locked-feeling 3-column grid (pricing tiers, gallery triptychs).
   Tablet fix: earlier builds forced exactly 2 columns at tablet width,
   which orphaned the 3rd item alone on its own row. auto-fit reflows
   naturally instead — 3 columns desktop, 2 at tablet, 1 on mobile,
   with no single item stranded. */
.grid-fixed-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(1.25rem, 3vw, 2rem);
}
@media (max-width: 960px) {
  .grid-fixed-3 { grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); }
}
@media (max-width: 640px) {
  .grid-fixed-3 { grid-template-columns: 1fr; }
}

.eyebrow {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: var(--fs-eyebrow);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--moss);
}
.section--dark .eyebrow { color: var(--stone); }

.lede {
  font-size: var(--fs-lede);
  max-width: 42rem;
}
/* ==========================================================================
   COMPONENTS — nav / button / card / form mechanics are reusable as-is;
   colors, radius, and the signature element below are Fell End-specific.
   ========================================================================== */

/* ---------- Nav ---------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--nav-height);
  background: rgba(244, 242, 236, 0.92);
  backdrop-filter: blur(6px);
  border-bottom: var(--border-w) solid var(--slate-pale);
}
/* .nav__bar and .nav__panel must live inside ONE flex row wrapper —
   keeping them as separate siblings is what caused nav-link
   misalignment on an earlier build. */
.nav__inner {
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--container-pad);
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
}

.nav__logo {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.25rem;
  letter-spacing: 0.01em;
}
.nav__logo span { color: var(--moss); }

.nav__links {
  display: none;
  gap: 2rem;
  font-size: 0.95rem;
}
.nav__links a:hover { color: var(--moss); }

.nav__cta {
  display: none;
}

.nav__toggle {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 2.5rem;
  height: 2.5rem;
  align-items: center;
}
.nav__toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--ink);
  border-radius: 2px;
  transition: transform var(--dur) var(--ease), opacity var(--dur) var(--ease);
}
.nav__toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav__toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav__toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Mobile dropdown panel. The class that CONTROLS visibility (.is-open)
   is the same class the CSS keys off transform/opacity from — nav.js
   must only ever toggle this class, never a separate inline style,
   or the two mechanisms drift apart and the menu silently breaks. */
.nav__panel {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--mist);
  border-bottom: var(--border-w) solid var(--slate-pale);
  padding: 1.5rem var(--container-pad) 2rem;
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
  transform: translateY(-8%);
  opacity: 0;
  visibility: hidden;
  pointer-events: none; /* fallback: an invisible panel can never block input */
  transition: transform var(--dur) var(--ease), opacity var(--dur) var(--ease), visibility var(--dur);
}
.nav__panel.is-open {
  transform: translateY(0);
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}
.nav__panel a { font-size: 1.05rem; padding: 0.35rem 0; }

@media (min-width: 961px) {
  .nav__links { display: flex; }
  .nav__cta { display: inline-flex; }
  .nav__toggle { display: none; }
  .nav__panel { display: none; }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center; /* prevents a stretched full-width button from
                               pinning its label to the left in flex columns */
  gap: 0.5rem;
  padding: 0.85rem 1.6rem;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 0.95rem;
  border: var(--border-w) solid transparent;
  transition: background var(--dur) var(--ease), border-color var(--dur) var(--ease), color var(--dur) var(--ease);
  cursor: pointer;
}
.btn--primary {
  background: var(--moss);
  color: var(--accent-contrast);
}
.btn--primary:hover { background: var(--moss-deep); }

.btn--outline {
  background: transparent;
  border-color: var(--ink);
  color: var(--ink);
}
.btn--outline:hover { border-color: var(--moss); color: var(--moss); }

.btn--block { width: 100%; }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  min-height: min(88vh, 46rem);
  display: flex;
  align-items: flex-end;
}
.hero__img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
}
.hero__scrim {
  position: absolute;
  inset: 0;
  background: linear-gradient(0deg, rgba(20,20,16,0.55) 0%, rgba(20,20,16,0.05) 45%);
  z-index: 1;
}

/* Structural risk: not a centered hero — a field-note card overlaps
   the image's bottom-left edge, like a plaque staked into the ground. */
.hero__card {
  position: relative;
  z-index: 2;
  margin: 0 0 -3.5rem clamp(1.25rem, 5vw, 4rem);
  background: var(--mist);
  border: var(--border-w) solid var(--ink);
  border-radius: var(--radius-lg);
  padding: 1.75rem clamp(1.5rem, 3vw, 2.5rem);
  max-width: 30rem;
  box-shadow: 0 18px 40px rgba(20, 20, 16, 0.22);
}
.hero__card .eyebrow { margin-bottom: 0.5rem; }
.hero__card h1 { font-size: clamp(1.9rem, 1.5rem + 2vw, 2.75rem); margin-bottom: 0.6rem; }

.hero__stats {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1.1rem;
  margin-top: 1.1rem;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--slate);
}
.hero__stats strong { color: var(--ink); font-weight: 600; }
/* svg is display:block globally (base.css) so an icon-plus-text span
   needs its own flex row, otherwise the icon forces a line break
   before the label that follows it. */
.hero__stats span {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}
.hero__stats svg { flex-shrink: 0; }

/* spacer so content below the overlapping card doesn't sit under it */
.hero-spacer { height: 3.5rem; }

/* ---------- Gallery / space cards ---------- */
.gallery-card {
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--stone);
}
.gallery-card img { aspect-ratio: 4 / 5; object-fit: cover; }
.gallery-card__caption {
  padding: 0.9rem 1.1rem;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--slate);
}
.gallery-card__caption strong {
  font-family: var(--font-body);
  font-size: 0.95rem;
  color: var(--ink);
  font-weight: 600;
}

/* ---------- Amenities ---------- */
.amenity {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.85rem 1rem;
  background: var(--mist);
  border: var(--border-w) solid var(--slate-pale);
  border-radius: var(--radius);
  font-size: 0.92rem;
}
.amenity svg { flex-shrink: 0; width: 1.1rem; height: 1.1rem; color: var(--moss); }

/* ---------- Signature: contour-line motif ----------
   Used exactly once, behind the Location section heading — echoes an
   OS map's elevation contours, tying directly to the Dales setting. */
.contour-field {
  position: relative;
  isolation: isolate;
}
.contour-field::before {
  content: "";
  position: absolute;
  inset: -10% -5%;
  z-index: -1;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 400 400'%3E%3Cg fill='none' stroke='%234a5d3a' stroke-opacity='0.14' stroke-width='1.5'%3E%3Cellipse cx='260' cy='150' rx='40' ry='26'/%3E%3Cellipse cx='260' cy='150' rx='80' ry='52'/%3E%3Cellipse cx='260' cy='150' rx='120' ry='78'/%3E%3Cellipse cx='260' cy='150' rx='160' ry='104'/%3E%3Cellipse cx='260' cy='150' rx='200' ry='130'/%3E%3C/g%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right top;
  background-size: min(48rem, 90vw);
  opacity: 1;
}

/* ---------- Map ---------- */
.map-frame {
  width: 100%;
  aspect-ratio: 4 / 3;
  border: var(--border-w) solid var(--slate-pale);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--stone);
}
.map-frame iframe { width: 100%; height: 100%; border: 0; }

/* ---------- Reviews ---------- */
.review-card {
  background: var(--mist);
  border: var(--border-w) solid var(--slate-pale);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
}
.review-card__stars {
  display: flex;
  gap: 0.2rem;
  margin-bottom: 0.9rem;
}
.review-card__stars svg { width: 1rem; height: 1rem; color: var(--bracken); }
.review-card__quote { font-size: 0.98rem; margin-bottom: 1.1rem; }
.review-card__author {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--slate);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* ---------- Forms ---------- */
.field { margin-bottom: 1.1rem; }
.field label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 0.4rem;
}
.field input,
.field textarea {
  /* explicit width + min-width guards against a field sizing to its own
     intrinsic width in a flex/grid layout and overflowing its column */
  width: 100%;
  min-width: 0;
  padding: 0.8rem 0.9rem;
  border: var(--border-w) solid var(--slate);
  border-radius: var(--radius);
  background: #ffffff;
  box-sizing: border-box;
  /* themes the native date/time picker's calendar icon + selected-date
     highlight to the site's own accent instead of default browser blue */
  accent-color: var(--moss);
}
.field textarea { min-height: 8rem; resize: vertical; }
.field input:focus, .field textarea:focus { border-color: var(--moss); }

/* ---------- Admin panel ----------
   Styles the internal booking-management page (admin.html). Functional
   markup/ids/script are untouched — this only adds classes for layout
   and reuses .field/.btn from elsewhere in this file. */
.admin-shell {
  max-width: 38rem;
  margin: 3rem auto;
  padding-inline: var(--container-pad);
}
.admin-shell h1 {
  font-size: var(--fs-h2);
  margin-bottom: 2rem;
}

.admin-login {
  max-width: 22rem;
  margin: 4rem auto;
  padding-inline: var(--container-pad);
  text-align: center;
}
.admin-login h1 { font-size: var(--fs-h3); margin-bottom: 1.5rem; }
.admin-login .field { text-align: left; }

/* Resets fieldset's own default border/padding so it can be restyled
   as a card matching every other card on the site. */
.admin-card {
  border: var(--border-w) solid var(--slate-pale);
  border-radius: var(--radius-lg);
  padding: 1.5rem clamp(1.25rem, 4vw, 2rem);
  margin: 0 0 1.75rem;
  background: var(--mist);
}
.admin-card legend {
  font-family: var(--font-display);
  font-size: var(--fs-h3);
  font-weight: 600;
  padding: 0 0.4rem;
}
.admin-card > p:first-of-type {
  color: var(--slate);
  font-size: 0.92rem;
  margin: 0.4rem 0 1.25rem;
}

.admin-list { margin-top: 1rem; }
.admin-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem 0;
  border-bottom: var(--border-w) solid var(--slate-pale);
  font-size: 0.92rem;
}
.admin-list li:last-child { border-bottom: none; }
.admin-list button {
  flex-shrink: 0;
  background: transparent;
  border: var(--border-w) solid var(--slate);
  border-radius: var(--radius);
  padding: 0.35rem 0.8rem;
  font-size: 0.82rem;
  cursor: pointer;
}
.admin-list button:hover { border-color: var(--error); color: var(--error); }

.success { color: var(--success); font-weight: 600; }
.error   { color: var(--error);   font-weight: 600; }

/* ---------- Footer ---------- */
.footer {
  background: var(--ink);
  color: var(--stone);
  padding-block: var(--section-space);
}
.footer a:hover { color: var(--mist); }
.footer__grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 2.5rem;
}
@media (max-width: 760px) {
  .footer__grid { grid-template-columns: 1fr; gap: 2rem; }
}
.footer__bottom {
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: var(--border-w) solid rgba(244,242,236,0.15);
  font-size: 0.82rem;
  color: var(--slate-pale);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.75rem;
}

/* ---------- Reveal-on-scroll ----------
   The hidden starting state is added by reveal.js itself (.reveal-pending),
   never unconditionally in CSS — if the script fails to run, content
   stays visible instead of vanishing permanently. */
.reveal-pending {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 640ms var(--ease), transform 640ms var(--ease);
}
.reveal-pending.is-visible {
  opacity: 1;
  transform: translateY(0);
}
