/* ==========================================================================
   PALATEFUL — BASE
   Reset, typographic defaults, layout primitives, prose, motion primitives.
   ========================================================================== */

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

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

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  font-weight: var(--wt-regular);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

body.is-locked {
  overflow: hidden;
}

img,
picture,
video {
  max-width: 100%;
  display: block;
}

h1,
h2,
h3,
h4,
h5,
p,
figure,
blockquote,
ol,
ul {
  margin: 0;
}

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

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

button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  cursor: pointer;
}

input,
select,
textarea {
  font: inherit;
  color: inherit;
}

hr {
  border: 0;
  border-top: 1px solid var(--rule);
  margin: 0;
}

::selection {
  background: var(--pf-forest-700);
  color: var(--pf-rice);
}

:focus-visible {
  outline: 2px solid var(--pf-terracotta);
  outline-offset: 3px;
}

/* --------------------------------------------------------------------------
   Typography primitives
   -------------------------------------------------------------------------- */

.display,
.h1,
.h2,
.h3,
.h4 {
  font-family: var(--font-display);
  font-weight: var(--wt-semi);
  font-variation-settings: 'SOFT' 20, 'WONK' 0;
  color: var(--text);
  text-wrap: balance;
}

.display {
  font-size: var(--fs-display);
  line-height: var(--lh-display);
  letter-spacing: var(--ls-display);
  font-weight: var(--wt-regular);
}

.h1 {
  font-size: var(--fs-h1);
  line-height: var(--lh-tight);
  letter-spacing: var(--ls-display);
}

.h2 {
  font-size: var(--fs-h2);
  line-height: var(--lh-heading);
  letter-spacing: var(--ls-heading);
}

.h3 {
  font-size: var(--fs-h3);
  line-height: var(--lh-heading);
  letter-spacing: var(--ls-heading);
}

.h4 {
  font-size: var(--fs-h4);
  line-height: 1.32;
}

/* Small uppercase section label — the publication's connective tissue. */
.label {
  font-family: var(--font-body);
  font-size: var(--fs-label);
  font-weight: var(--wt-semi);
  letter-spacing: var(--ls-label);
  text-transform: uppercase;
  color: var(--pf-terracotta);
  line-height: 1;
}

.label--muted {
  color: var(--text-muted);
}

.label--invert {
  color: var(--pf-moss-300);
}

/* A label with a rule running off to the side, used above major sections. */
.label-rule {
  display: flex;
  align-items: center;
  gap: var(--sp-4);
  margin-bottom: var(--sp-5);
}

.label-rule::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--rule);
}

.label-rule--invert::after {
  background: var(--rule-invert);
}

.lead {
  font-size: var(--fs-lead);
  line-height: 1.58;
  color: var(--text-soft);
  max-width: var(--measure);
}

.meta {
  font-size: var(--fs-meta);
  letter-spacing: var(--ls-meta);
  text-transform: uppercase;
  color: var(--text-muted);
  line-height: var(--lh-ui);
}

.pull-quote {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 1.1rem + 1.7vw, 2.4rem);
  line-height: 1.28;
  letter-spacing: var(--ls-heading);
  font-weight: var(--wt-light);
  font-style: italic;
  color: var(--pf-forest-700);
  text-wrap: balance;
}

/* Drop-cap for the opening paragraph of long-form pieces. */
.has-dropcap::first-letter {
  font-family: var(--font-display);
  font-size: 3.9em;
  line-height: 0.82;
  font-weight: var(--wt-regular);
  float: left;
  margin: 0.08em 0.1em 0 0;
  color: var(--pf-terracotta);
}

/* --------------------------------------------------------------------------
   Layout primitives
   -------------------------------------------------------------------------- */

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

.container--narrow {
  max-width: var(--container-narrow);
}

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

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

.section--tight {
  padding-block: clamp(2.5rem, 5vw, 5rem);
}

.section--alt {
  background: var(--bg-alt);
}

.section--invert {
  background: var(--bg-invert);
  color: var(--pf-on-dark);
}

.section--invert .h1,
.section--invert .h2,
.section--invert .h3,
.section--invert .h4,
.section--invert .display {
  color: var(--pf-on-dark);
}

.section--invert .lead,
.section--invert p {
  color: var(--pf-on-dark-muted);
}

.section-head {
  max-width: var(--measure);
  margin-bottom: clamp(2rem, 4vw, 3.5rem);
}

.section-head__title {
  margin-bottom: var(--sp-4);
}

.grid {
  display: grid;
  gap: var(--sp-6);
}

.stack > * + * {
  margin-top: var(--sp-4);
}

.rule {
  height: 1px;
  background: var(--rule);
  border: 0;
}

.sr-only {
  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 {
  position: absolute;
  top: -100px;
  left: var(--sp-4);
  z-index: 999;
  background: var(--pf-forest-700);
  color: var(--pf-rice);
  padding: var(--sp-3) var(--sp-5);
  font-size: var(--fs-meta);
  letter-spacing: var(--ls-meta);
  text-transform: uppercase;
}

.skip-link:focus {
  top: var(--sp-4);
}

/* --------------------------------------------------------------------------
   Images — the editorial image system
   -------------------------------------------------------------------------- */

.fig {
  position: relative;
  margin: 0;
  overflow: hidden;
  background: var(--pf-sand);
}

/* <picture> is inline by default, which leaves `height: 100%` on the <img>
   resolving against an auto-height parent. Making it a block gives the image a
   real containing block. */
.fig picture {
  display: block;
  width: 100%;
  height: 100%;
}

.fig img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: var(--focal, 50% 50%);
  display: block;
}

.fig--hero {
  aspect-ratio: var(--ar-hero);
}
.fig--landscape {
  aspect-ratio: var(--ar-landscape);
}
.fig--portrait {
  aspect-ratio: var(--ar-portrait);
}
.fig--tall {
  aspect-ratio: var(--ar-tall);
}
.fig--square {
  aspect-ratio: var(--ar-square);
}
.fig--wide {
  aspect-ratio: var(--ar-wide);
}

@media (max-width: 720px) {
  .fig--hero {
    aspect-ratio: var(--ar-hero-mobile);
  }
  .fig--wide {
    aspect-ratio: var(--ar-landscape);
  }
}

/* Subtle scale on hover — used only where the whole block is a link. */
.fig--zoom img {
  transition: transform var(--dur-slow) var(--ease-editorial);
}

a:hover .fig--zoom img,
a:focus-visible .fig--zoom img {
  transform: scale(1.035);
}

.fig__caption {
  margin-top: var(--sp-3);
  font-size: var(--fs-meta);
  line-height: 1.5;
  color: var(--text-muted);
  max-width: var(--measure-tight);
}

/* Warm scrim so display type stays legible over photography. */
.fig__scrim {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to top,
    rgba(18, 36, 29, 0.82) 0%,
    rgba(18, 36, 29, 0.45) 38%,
    rgba(18, 36, 29, 0.08) 72%,
    rgba(18, 36, 29, 0) 100%
  );
}

/* Placeholder shown when a photograph has not been supplied yet. */
.fig--empty {
  background: linear-gradient(135deg, var(--pf-sand) 0%, var(--pf-cream-warm) 100%);
}

.fig--empty::after {
  content: attr(data-slot);
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  padding: var(--sp-4);
  text-align: center;
  font-size: var(--fs-label);
  letter-spacing: var(--ls-label);
  text-transform: uppercase;
  color: var(--pf-ink-faint);
}

/* --------------------------------------------------------------------------
   Prose — long-form article body
   -------------------------------------------------------------------------- */

.prose {
  max-width: var(--measure);
  color: var(--text-soft);
  font-size: clamp(1.0625rem, 1.01rem + 0.28vw, 1.1875rem);
  line-height: var(--lh-body);
}

.prose > * + * {
  margin-top: 1.35em;
}

.prose h2 {
  font-family: var(--font-display);
  font-size: var(--fs-h3);
  line-height: var(--lh-heading);
  letter-spacing: var(--ls-heading);
  font-weight: var(--wt-semi);
  color: var(--text);
  margin-top: 2.2em;
}

.prose h3 {
  font-family: var(--font-display);
  font-size: var(--fs-h4);
  font-weight: var(--wt-semi);
  color: var(--text);
  margin-top: 1.8em;
}

.prose strong {
  font-weight: var(--wt-semi);
  color: var(--text);
}

.prose em {
  font-style: italic;
}

.prose a {
  color: var(--pf-terracotta-dark);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  transition: color var(--dur-fast) ease;
}

.prose a:hover {
  color: var(--pf-forest-700);
}

.prose ul,
.prose ol {
  padding-left: 1.35em;
}

.prose ul li {
  list-style: none;
  position: relative;
  padding-left: 0.15em;
}

.prose ul li::before {
  content: '';
  position: absolute;
  left: -0.95em;
  top: 0.72em;
  width: 5px;
  height: 5px;
  background: var(--pf-moss-500);
  border-radius: 50%;
}

.prose ol {
  list-style: decimal;
}

.prose li + li {
  margin-top: 0.5em;
}

.prose blockquote {
  border-left: 2px solid var(--pf-terracotta);
  padding-left: var(--sp-5);
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.15em;
  line-height: 1.45;
  color: var(--pf-forest-700);
}

/* --------------------------------------------------------------------------
   Buttons & links
   -------------------------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-3);
  padding: 0.95rem 1.9rem;
  font-size: var(--fs-meta);
  font-weight: var(--wt-semi);
  letter-spacing: var(--ls-label);
  text-transform: uppercase;
  line-height: 1;
  border: 1px solid transparent;
  transition: background var(--dur-base) var(--ease-editorial),
    color var(--dur-base) var(--ease-editorial),
    border-color var(--dur-base) var(--ease-editorial);
  min-height: 48px;
}

.btn--primary {
  background: var(--pf-forest-700);
  color: var(--pf-rice);
}

.btn--primary:hover {
  background: var(--pf-forest-900);
}

.btn--ghost {
  border-color: var(--rule-strong);
  color: var(--text);
}

.btn--ghost:hover {
  border-color: var(--pf-forest-700);
  background: var(--pf-forest-700);
  color: var(--pf-rice);
}

.btn--on-photo {
  border-color: rgba(255, 253, 248, 0.5);
  color: var(--pf-rice);
  backdrop-filter: blur(2px);
}

.btn--on-photo:hover {
  background: var(--pf-rice);
  border-color: var(--pf-rice);
  color: var(--pf-forest-900);
}

/* Text link with a travelling arrow — the site's standard "read on" cue. */
.link-arrow {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-3);
  font-size: var(--fs-meta);
  font-weight: var(--wt-semi);
  letter-spacing: var(--ls-label);
  text-transform: uppercase;
  color: var(--pf-forest-700);
  padding-bottom: 2px;
  border-bottom: 1px solid var(--rule-strong);
  transition: color var(--dur-base) ease, border-color var(--dur-base) ease;
}

.link-arrow__arrow {
  transition: transform var(--dur-base) var(--ease-editorial);
}

.link-arrow:hover {
  color: var(--pf-terracotta);
  border-color: var(--pf-terracotta);
}

.link-arrow:hover .link-arrow__arrow {
  transform: translateX(5px);
}

.link-arrow--invert {
  color: var(--pf-on-dark);
  border-color: var(--rule-invert);
}

.link-arrow--invert:hover {
  color: var(--pf-saffron);
  border-color: var(--pf-saffron);
}

/* --------------------------------------------------------------------------
   Scroll reveal — opt-in, and entirely disabled under reduced motion.
   -------------------------------------------------------------------------- */

[data-reveal] {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity var(--dur-reveal) var(--ease-out),
    transform var(--dur-reveal) var(--ease-out);
  transition-delay: var(--reveal-delay, 0ms);
}

[data-reveal].is-revealed {
  opacity: 1;
  transform: none;
}

/* Image mask reveal for feature photography.
   The clip is applied to the INNER <picture>, never to the observed element
   itself: Chrome factors clip-path into IntersectionObserver geometry, so an
   element that clips itself to zero height reports 0% visible, never fires,
   and stays hidden permanently. Clipping the child keeps the observed box
   measurable. */
[data-reveal-img] > picture,
[data-reveal-img] > img {
  clip-path: inset(0 0 100% 0);
  transition: clip-path var(--dur-reveal) var(--ease-out);
  transition-delay: var(--reveal-delay, 0ms);
}

[data-reveal-img].is-revealed > picture,
[data-reveal-img].is-revealed > img {
  clip-path: inset(0 0 0 0);
}

@media (prefers-reduced-motion: reduce) {
  [data-reveal],
  [data-reveal-img],
  [data-reveal-img] > picture,
  [data-reveal-img] > img {
    opacity: 1;
    transform: none;
    clip-path: none;
    transition: none;
  }

  .fig--zoom img,
  .link-arrow__arrow,
  .btn {
    transition: none !important;
  }

  a:hover .fig--zoom img {
    transform: none;
  }
}

/* No-JS safety: never hide content behind a reveal that will not fire. */
.no-js [data-reveal],
.no-js [data-reveal-img],
.no-js [data-reveal-img] > picture,
.no-js [data-reveal-img] > img {
  opacity: 1;
  transform: none;
  clip-path: none;
}
