/* ╔══════════════════════════════════════════════════════════════════╗
   ║  LIT · Long Island Today — Design System v1                      ║
   ║  Coastal palette · Atlantic blues, sand & dune neutrals,         ║
   ║  sunset orange accent. Editorial serif + friendly sans.          ║
   ╚══════════════════════════════════════════════════════════════════╝ */

/* ── 1. Tokens ──────────────────────────────────────────────────── */
:root {
  /* Color · base */
  --ink:         #0e2330;
  --ink-2:       #1f3a4a;
  --ink-soft:    #3a5363;
  --muted:       #6b6557;
  --muted-2:     #908871;
  --line:        #ddd1b5;
  --line-soft:   #ece2c8;

  /* Color · paper (warm off-whites) */
  --paper:       #fbf6ec;
  --paper-2:     #f3ebd9;
  --paper-3:     #ece1c5;

  /* Color · Atlantic / Sound */
  --sound:       #2a6f8e;
  --sound-deep:  #133e55;
  --sound-mid:   #5a93ad;
  --sound-mist:  #c9dee7;
  --sound-fog:   #e6f0f4;

  /* Color · sand & dune */
  --sand:        #e2cf9f;
  --sand-pale:   #f3e8c9;
  --sand-deep:   #c4ab74;

  /* Color · sunset accent (heritage) */
  --accent:      #e07a3c;
  --accent-deep: #c45920;
  --accent-pale: #f6d6bf;

  /* Color · signals */
  --positive:    #2a7a4a;
  --positive-bg: #d8e9dc;
  --warn:        #c08a1a;
  --warn-bg:     #f3e4ba;
  --danger:      #b3361f;

  /* Shadows */
  --sh-0: 0 0 0 1px var(--line);
  --sh-1: 0 1px 2px rgba(14,35,48,0.06), 0 1px 1px rgba(14,35,48,0.04);
  --sh-2: 0 4px 12px rgba(14,35,48,0.08), 0 2px 4px rgba(14,35,48,0.05);
  --sh-3: 0 12px 28px rgba(14,35,48,0.12), 0 4px 10px rgba(14,35,48,0.06);
  --sh-lift: 4px 5px 0 var(--accent);

  /* Radii */
  --r-0: 0px;
  --r-1: 4px;
  --r-2: 8px;
  --r-3: 12px;
  --r-4: 18px;
  --r-pill: 999px;

  /* Type — fluid scale */
  --fs-12: 0.75rem;     /* 12 */
  --fs-13: 0.8125rem;   /* 13 */
  --fs-14: 0.875rem;    /* 14 */
  --fs-15: 0.9375rem;   /* 15 */
  --fs-16: 1rem;        /* 16 */
  --fs-18: 1.125rem;    /* 18 */
  --fs-20: 1.25rem;     /* 20 */
  --fs-24: 1.5rem;      /* 24 */
  --fs-30: 1.875rem;    /* 30 */
  --fs-36: 2.25rem;     /* 36 */
  --fs-48: 3rem;        /* 48 */
  --fs-60: 3.75rem;     /* 60 */
  --fs-72: 4.5rem;      /* 72 */

  /* Spacing (4px base) */
  --s-1:  4px;
  --s-2:  8px;
  --s-3:  12px;
  --s-4:  16px;
  --s-5:  20px;
  --s-6:  24px;
  --s-8:  32px;
  --s-10: 40px;
  --s-12: 48px;
  --s-16: 64px;
  --s-20: 80px;
  --s-24: 96px;

  /* Layout */
  --maxw:        1240px;
  --maxw-prose:  68ch;
  --gutter:      24px;
  --gutter-lg:   40px;

  /* Type families */
  --ff-display: "Newsreader", "Source Serif 4", Georgia, "Times New Roman", serif;
  --ff-sans:    "Public Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  --ff-mono:    "JetBrains Mono", "IBM Plex Mono", ui-monospace, Menlo, monospace;
}

/* ── 2. Reset / base ────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--ff-sans);
  font-size: var(--fs-16);
  line-height: 1.5;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img, svg, picture, video { display: block; max-width: 100%; }
button { font: inherit; color: inherit; }
:focus-visible {
  outline: 2.5px solid var(--accent);
  outline-offset: 2px;
  border-radius: var(--r-1);
}
::selection { background: var(--accent); color: var(--paper); }

a { color: var(--sound); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--sound-deep); }

h1, h2, h3, h4, h5 {
  font-family: var(--ff-display);
  font-weight: 600;
  line-height: 1.08;
  letter-spacing: -0.01em;
  margin: 0;
  color: var(--ink);
  text-wrap: balance;
}
h1 { font-size: clamp(2.25rem, 5vw + 1rem, 4rem); font-weight: 700; }
h2 { font-size: clamp(1.625rem, 2vw + 1rem, 2.25rem); }
h3 { font-size: var(--fs-24); }
h4 { font-size: var(--fs-20); }
p  { margin: 0; text-wrap: pretty; }

/* ── 3. Layout primitives ───────────────────────────────────────── */
.wrap {
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.section { padding-block: clamp(48px, 6vw, 96px); }
.section--tight { padding-block: clamp(32px, 4vw, 56px); }
.stack { display: flex; flex-direction: column; }
.row { display: flex; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: var(--s-3); }
.gap-1 { gap: var(--s-1); }
.gap-2 { gap: var(--s-2); }
.gap-3 { gap: var(--s-3); }
.gap-4 { gap: var(--s-4); }
.gap-5 { gap: var(--s-5); }
.gap-6 { gap: var(--s-6); }
.gap-8 { gap: var(--s-8); }

/* ── 4. Type helpers ────────────────────────────────────────────── */
.eyebrow {
  font-family: var(--ff-mono);
  font-size: var(--fs-12);
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}
.eyebrow--ink   { color: var(--ink); }
.eyebrow--paper { color: var(--paper); opacity: 0.85; }
.eyebrow--accent { color: var(--accent-deep); }

.display { font-family: var(--ff-display); }
.sans { font-family: var(--ff-sans); }
.mono { font-family: var(--ff-mono); }

.lead {
  font-family: var(--ff-display);
  font-size: clamp(1.125rem, 1vw + 0.875rem, 1.375rem);
  line-height: 1.4;
  color: var(--ink-2);
  text-wrap: pretty;
}

.body-sm { font-size: var(--fs-14); color: var(--ink-2); }
.body-muted { color: var(--muted); }

/* Display variant w/ subtle hand underline */
.has-mark mark {
  background: transparent;
  color: inherit;
  position: relative;
  white-space: nowrap;
}
.has-mark mark::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -0.06em;
  height: 0.18em;
  background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 40 8' preserveAspectRatio='none'><path d='M0 5 Q5 1 10 5 T20 5 T30 5 T40 5' stroke='%23e07a3c' stroke-width='2' fill='none' stroke-linecap='round'/></svg>") repeat-x;
  background-size: 24px 100%;
}

/* ── 5. Buttons ─────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s-2);
  font-family: var(--ff-sans);
  font-weight: 600;
  font-size: var(--fs-15);
  line-height: 1;
  padding: 12px 18px;
  border-radius: var(--r-2);
  border: 1.5px solid transparent;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  transition: transform 80ms ease, background 120ms ease, color 120ms ease, border-color 120ms ease, box-shadow 120ms ease;
  text-decoration: none;
  min-height: 44px;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.btn--primary {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
}
.btn--primary:hover { background: var(--ink-2); border-color: var(--ink-2); color: var(--paper); }

.btn--accent {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
.btn--accent:hover { background: var(--accent-deep); border-color: var(--accent-deep); color: #fff; }

.btn--sound {
  background: var(--sound);
  color: var(--paper);
  border-color: var(--sound);
}
.btn--sound:hover { background: var(--sound-deep); border-color: var(--sound-deep); }

.btn--ghost {
  background: var(--paper);
  color: var(--ink);
  border-color: var(--line);
}
.btn--ghost:hover { border-color: var(--ink); background: var(--paper-2); }

.btn--link {
  padding: 4px 0;
  border: none;
  background: transparent;
  color: var(--ink);
  font-weight: 600;
  min-height: 0;
  border-bottom: 1.5px solid var(--ink);
  border-radius: 0;
}
.btn--link:hover { color: var(--accent-deep); border-bottom-color: var(--accent); }

.btn--lg { font-size: var(--fs-16); padding: 14px 22px; min-height: 48px; }
.btn--sm { font-size: var(--fs-13); padding: 8px 12px; min-height: 36px; }
.btn--block { width: 100%; }

/* ── 6. Tag / chip ──────────────────────────────────────────────── */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--ff-mono);
  font-size: var(--fs-12);
  font-weight: 500;
  letter-spacing: 0.04em;
  padding: 5px 10px;
  border-radius: var(--r-pill);
  background: var(--paper-2);
  color: var(--ink-2);
  border: 1px solid transparent;
  white-space: nowrap;
}
.tag--outline { background: transparent; border-color: var(--line); }
.tag--ink { background: var(--ink); color: var(--paper); }
.tag--sound { background: var(--sound-mist); color: var(--sound-deep); }
.tag--sand { background: var(--sand-pale); color: var(--ink-2); }
.tag--accent { background: var(--accent); color: #fff; }
.tag--positive { background: var(--positive-bg); color: var(--positive); }
.tag--dot::before {
  content: "";
  width: 6px; height: 6px;
  border-radius: 50%;
  background: currentColor;
  display: inline-block;
}

/* ── 7. Card ────────────────────────────────────────────────────── */
.card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--r-2);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: box-shadow 160ms ease, transform 160ms ease, border-color 160ms ease;
}
.card:hover { box-shadow: var(--sh-2); transform: translateY(-2px); border-color: var(--line-soft); }
.card__body { padding: var(--s-4); display: flex; flex-direction: column; gap: var(--s-2); flex: 1; }
.card__title { font-family: var(--ff-display); font-weight: 600; font-size: var(--fs-20); line-height: 1.18; color: var(--ink); margin: 0; text-wrap: balance; }
.card__meta { display: flex; gap: 8px; align-items: center; }
.card--featured { box-shadow: var(--sh-1); }
.card--row { flex-direction: row; align-items: stretch; }
.card--row .card__body { padding: var(--s-3) var(--s-4); justify-content: center; }
.card--bare { border: none; box-shadow: none; background: transparent; }
.card--bare:hover { box-shadow: none; transform: none; }

/* ── 8. Image placeholder ───────────────────────────────────────── */
/* Subtle film-grain noise data URI — used as a low-opacity overlay on photo tones to add atmosphere */
:root {
  --grain: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 200'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.3 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}

.img {
  position: relative;
  width: 100%;
  background:
    repeating-linear-gradient(135deg, rgba(14,35,48,0.05) 0 1px, transparent 1px 9px),
    var(--sound-mist);
  overflow: hidden;
  display: block;
  isolation: isolate;
}
.img::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: var(--grain);
  background-size: 200px 200px;
  opacity: 0.18;
  mix-blend-mode: overlay;
  pointer-events: none;
  z-index: 1;
}
.img > * { position: relative; z-index: 2; }

/* Tone variants — multi-stop gradients with subtle atmospheric highlights */
.img--sound {
  background:
    radial-gradient(ellipse 70% 40% at 70% 18%, rgba(255,220,170,0.18), transparent 60%),
    radial-gradient(ellipse 90% 50% at 50% 105%, rgba(255,255,255,0.06), transparent 60%),
    linear-gradient(170deg, #0a2b3e 0%, var(--sound-deep) 40%, var(--sound) 100%);
}
.img--sand {
  background:
    radial-gradient(ellipse 60% 40% at 30% 100%, rgba(196,171,116,0.4), transparent 70%),
    radial-gradient(ellipse 50% 30% at 80% 10%, rgba(255,255,255,0.35), transparent 70%),
    linear-gradient(165deg, var(--sand) 0%, var(--sand-pale) 55%, #fbf6ec 100%);
}
.img--sunset {
  background:
    radial-gradient(circle 200px at 70% 30%, rgba(255,225,180,0.5), transparent 70%),
    radial-gradient(ellipse 70% 40% at 50% 105%, rgba(180,80,30,0.4), transparent 60%),
    linear-gradient(160deg, #f4a06b 0%, var(--accent) 40%, #c45920 100%);
}
.img--ink {
  background:
    radial-gradient(ellipse 50% 30% at 80% 18%, rgba(255,200,150,0.18), transparent 65%),
    radial-gradient(ellipse 70% 40% at 50% 110%, rgba(42,111,142,0.45), transparent 60%),
    linear-gradient(170deg, #050f17 0%, var(--ink) 50%, #112b3a 100%);
}
.img--fog {
  background:
    linear-gradient(180deg, var(--sound-fog), var(--sound-mist));
}
.img--mist {
  background:
    radial-gradient(ellipse 60% 40% at 30% 110%, rgba(201,222,231,0.6), transparent 60%),
    linear-gradient(160deg, var(--sound-mist), var(--sand-pale));
}
.img--dune {
  background:
    radial-gradient(ellipse 80% 40% at 50% 100%, rgba(196,171,116,0.7), transparent 50%),
    radial-gradient(ellipse 60% 35% at 70% 20%, rgba(255,255,255,0.3), transparent 70%),
    linear-gradient(180deg, #c9dee7 0%, #e7d8b6 55%, #c4ab74 100%);
}
.img--vineyard {
  background:
    repeating-linear-gradient(85deg, rgba(0,0,0,0.05) 0 2px, transparent 2px 18px),
    radial-gradient(ellipse 50% 30% at 50% 15%, rgba(255,225,180,0.4), transparent 70%),
    linear-gradient(180deg, #d6b890 0%, #b89366 55%, #7d5c3a 100%);
}

/* Subtle horizon line for ocean-type imagery */
.img--horizon::before {
  content: "";
  position: absolute;
  left: 0; right: 0;
  top: 58%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.25), transparent);
  z-index: 2;
}

/* Sun motif — used on sunset/scene images */
.img--sun::before {
  content: "";
  position: absolute;
  top: 18%; right: 22%;
  width: 80px; height: 80px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255,250,235,0.85) 0%, rgba(255,225,180,0.3) 50%, transparent 75%);
  z-index: 2;
}

/* Photo caption overlay */
.img__cap {
  position: absolute;
  left: 12px; bottom: 12px;
  font-family: var(--ff-mono);
  font-size: var(--fs-12);
  color: var(--paper);
  background: rgba(14,35,48,0.65);
  backdrop-filter: blur(6px);
  padding: 4px 10px;
  border-radius: var(--r-1);
  letter-spacing: 0.02em;
  z-index: 3;
}

/* Hide caption pills on small thumbnails — they're overlay noise at small sizes. */
.event-row .img__cap,
.news-row .img__cap,
.card.reso-card .img__cap,
.social__rail .img__cap,
.cat-card .img__cap,
.region-card .img__cap {
  display: none;
}

/* Real-photo overlay inside the .img placeholder (sits below the grain so the noise sells the atmosphere) */
.img > .img__photo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
  display: block;
  border-radius: inherit;
}
.img:has(.img__photo)::after { opacity: 0.08; }

/* Aspect ratios */
.img--16x9 { aspect-ratio: 16 / 9; }
.img--4x3 { aspect-ratio: 4 / 3; }
.img--3x2 { aspect-ratio: 3 / 2; }
.img--1x1 { aspect-ratio: 1 / 1; }
.img--4x5 { aspect-ratio: 4 / 5; }
.img--9x16 { aspect-ratio: 9 / 16; }
.img--21x9 { aspect-ratio: 21 / 9; }

/* ── 9. Section header ──────────────────────────────────────────── */
.section-h {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--s-4);
  margin-bottom: var(--s-6);
  padding-bottom: var(--s-3);
  border-bottom: 1px solid var(--line);
}
.section-h__title { font-size: clamp(1.5rem, 1.5vw + 1rem, 2rem); margin-top: 6px; }
.section-h__more { font-family: var(--ff-sans); font-size: var(--fs-14); font-weight: 600; color: var(--ink); text-decoration: none; border-bottom: 1.5px solid var(--accent); padding-bottom: 2px; white-space: nowrap; }
.section-h__more:hover { color: var(--accent-deep); }

/* ── 10. Form fields ────────────────────────────────────────────── */
.field {
  display: flex;
  align-items: stretch;
  background: var(--paper);
  border: 1.5px solid var(--ink);
  border-radius: var(--r-2);
  overflow: hidden;
  box-shadow: var(--sh-1);
}
.field input {
  flex: 1;
  border: none;
  background: transparent;
  padding: 14px 18px;
  font-family: var(--ff-sans);
  font-size: var(--fs-16);
  color: var(--ink);
  min-width: 0;
}
.field input::placeholder { color: var(--muted); }
.field input:focus { outline: none; }
.field .btn { border-radius: 0; min-height: auto; padding-inline: 22px; }

.field--inline { flex-direction: row; }
@media (max-width: 540px) {
  .field--inline { flex-direction: column; border-radius: var(--r-2); }
  .field--inline input { padding: 14px 16px; border-bottom: 1.5px solid var(--ink); }
  .field--inline .btn { padding: 14px 16px; min-height: 48px; }
}

/* ── 11. Heritage lighthouse mark ───────────────────────────────── */
.lh-mark {
  display: inline-flex;
  align-items: center;
  color: var(--ink);
  text-decoration: none;
  line-height: 0;
}
.lh-mark img {
  height: var(--lh-size, 44px);
  width: auto;
  display: block;
  -webkit-user-select: none;
  user-select: none;
}
/* Default logo art is white strokes on transparent — used as-is on dark surfaces */
.lh-mark--light img {
  filter: invert(1) brightness(0.08) saturate(0.4);
}
.lh-mark--sm { --lh-size: 36px; }
.lh-mark--lg { --lh-size: 72px; }
.lh-mark--xl { --lh-size: 96px; }

/* ── 12. Utility ────────────────────────────────────────────────── */
.divider { height: 1px; background: var(--line); border: 0; margin: 0; }
.divider--dashed { background: transparent; border-top: 1.5px dashed var(--line); }
.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;
}
.dot { width: 4px; height: 4px; border-radius: 50%; background: var(--muted); display: inline-block; vertical-align: middle; }

/* Grid utilities */
.grid { display: grid; gap: var(--s-4); }
.grid-cols-2 { grid-template-columns: repeat(2, 1fr); }
.grid-cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid-cols-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 1024px) {
  .md\:grid-cols-2 { grid-template-columns: repeat(2, 1fr); }
  .md\:grid-cols-1 { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .sm\:grid-cols-1 { grid-template-columns: 1fr; }
  .sm\:grid-cols-2 { grid-template-columns: repeat(2, 1fr); }
}

/* Horizontal scroll rail (mobile) */
.h-rail {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(260px, 1fr);
  gap: var(--s-4);
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding-bottom: 8px;
  margin-inline: calc(-1 * var(--gutter));
  padding-inline: var(--gutter);
  scrollbar-width: thin;
}
.h-rail > * { scroll-snap-align: start; }
@media (min-width: 900px) {
  .h-rail--md-grid { display: grid; grid-auto-flow: row; grid-template-columns: repeat(4, 1fr); margin-inline: 0; padding-inline: 0; }
}
