/*
 * benroesch.com — application styles
 *
 * Single Propshaft-served stylesheet (linked via `stylesheet_link_tag :app`).
 * Organized in sections: Tokens · Base · Landing · Footer · Motion.
 * Design system: cool paper ground, two-blue accent (cobalt + ink navy),
 * system serif for display, system sans for interface.
 */

/* ============================================================
   Tokens
   ============================================================ */
:root {
  /* core palette */
  --ground:     #EDF0F6;  /* cool paper, faint blue tint */
  --surface:    #FAFBFD;  /* raised card, near-white */
  --text:       #16181D;  /* cool near-black */
  --muted:      #5F6573;  /* cool slate, secondary text */
  --border:     #D6DBE4;  /* hairline, cool gray */

  --accent:     #2549C9;  /* cobalt — interactive */
  --accent-ink: #15264C;  /* deep navy — structure, headings */
  --accent-soft:#E2E6F6;  /* cobalt wash for fills */
  --accent-hi:  #1A38A8;  /* pressed / hover cobalt */

  /* extended — categories, highlights, signals */
  --teal:    #0F9298;
  --steel:   #46618A;
  --violet:  #6E56D8;
  --coral:   #E0765A;
  --gold:    #D29A2E;
  --success: #2E9E6B;
  --alert:   #D24A4A;

  /* type */
  --serif: ui-serif, "New York", "Iowan Old Style", Georgia, "Times New Roman", serif;
  --sans:  system-ui, -apple-system, "Segoe UI", Inter, Helvetica, Arial, sans-serif;
  --mono:  ui-monospace, "SF Mono", "JetBrains Mono", "Berkeley Mono", Menlo, monospace;

  /* spacing */
  --s1: 0.25rem; --s2: 0.5rem; --s3: 0.75rem; --s4: 1rem;
  --s5: 1.5rem;  --s6: 2rem;   --s7: 3rem;     --s8: 4rem;
  --s9: 6rem;    --s10: 8rem;

  --measure: 60ch;
  --radius: 10px;
  --radius-sm: 6px;
}

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

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--ground);
  color: var(--text);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection { background: var(--accent); color: #fff; }

a {
  color: var(--accent);
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
  transition: color .15s;
}
a:hover { color: var(--accent-hi); }
a:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 2px; }

h1, h2, h3 { font-family: var(--serif); font-weight: 500; color: var(--accent-ink); letter-spacing: -0.015em; }

/* ============================================================
   Landing
   ============================================================ */
.home {
  max-width: 720px;
  margin: 0 auto;
  padding: clamp(3.5rem, 10vw, 7rem) clamp(1.25rem, 5vw, 2rem) var(--s9);
  display: flex;
  flex-direction: column;
  gap: clamp(3rem, 7vw, 5rem);
}

.eyebrow {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent);
  display: flex;
  align-items: center;
  gap: var(--s3);
  margin: 0 0 var(--s5);
}
.eyebrow::before {
  content: "";
  width: 28px;
  height: 1px;
  background: var(--accent);
  display: inline-block;
}

.intro { margin: 0; }
.name {
  font-size: clamp(3rem, 11vw, 5.25rem);
  line-height: 0.98;
  margin: 0;
}

.rule {
  height: 2px;
  background: var(--accent);
  margin: var(--s6) 0 var(--s5);
  transform: scaleX(0);
  transform-origin: left;
  animation: draw 1.1s cubic-bezier(.2,.8,.2,1) .15s forwards;
}
@keyframes draw { to { transform: scaleX(1); } }

.bio {
  font-family: var(--serif);
  font-size: clamp(1.2rem, 2.6vw, 1.5rem);
  line-height: 1.5;
  max-width: 54ch;
  color: var(--text);
  display: flex;
  flex-direction: column;
  gap: var(--s4);
}
.bio p { margin: 0; }
.bio a { font-style: italic; }

/* work */
.section-label {
  font-family: var(--mono);
  font-weight: 600;
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 var(--s5);
}

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--s4);
}
.card {
  display: flex;
  flex-direction: column;
  gap: var(--s3);
  padding: var(--s5);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-decoration: none;
  color: inherit;
  transition: transform .15s, box-shadow .15s, border-color .15s;
}
.card:hover {
  transform: translateY(-3px);
  box-shadow: 0 14px 30px -18px rgba(21, 38, 76, .45);
  border-color: var(--accent);
}
.card:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.card .kicker {
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.card h3 { font-size: 1.35rem; margin: 0; }
.card p { margin: 0; color: var(--muted); font-size: 0.92rem; line-height: 1.55; }
.card .more {
  margin-top: auto;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent);
}
/* per-card accent on the kicker, drawn from the extended palette */
.card.hinsley   .kicker { color: var(--accent); }
.card.forecasts .kicker { color: var(--teal); }
.card.raif      .kicker { color: var(--violet); }

/* ============================================================
   Footer
   ============================================================ */
.site-footer {
  border-top: 1px solid var(--border);
  padding-top: var(--s6);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--s4);
}
.elsewhere {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s5);
  font-family: var(--mono);
  font-size: 0.8rem;
  letter-spacing: 0.04em;
}
.elsewhere a { text-decoration: none; }
.elsewhere a:hover { text-decoration: underline; }
.copyright {
  margin: 0;
  color: var(--muted);
  font-size: 0.8rem;
}

/* ============================================================
   Components — buttons
   ============================================================ */
.btn {
  font: inherit;
  font-weight: 600;
  font-size: 0.95rem;
  border-radius: var(--radius-sm);
  padding: 0.7em 1.3em;
  cursor: pointer;
  border: 1px solid transparent;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s2);
  transition: background .15s, color .15s, border-color .15s, transform .1s;
}
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hi); color: #fff; }

/* ============================================================
   Protected pages — password gate
   ============================================================ */
.gate {
  min-height: 80vh;
  display: grid;
  place-items: center;
  padding: var(--s7) var(--s4);
}
.gate-card {
  width: 100%;
  max-width: 400px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: clamp(1.75rem, 5vw, 2.5rem);
}
.gate-card h1 { font-size: 1.9rem; margin: 0 0 var(--s3); }
.gate-note { color: var(--muted); font-size: 0.95rem; margin: 0 0 var(--s5); }
.gate-error { color: var(--alert); font-size: 0.9rem; margin: 0 0 var(--s4); }
.gate-form { display: flex; flex-direction: column; gap: var(--s4); }
.gate-input {
  font: inherit;
  font-size: 1rem;
  padding: 0.65em 0.85em;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--ground);
  color: var(--text);
}
.gate-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

/* ============================================================
   Inner page (shared/protected content)
   ============================================================ */
.sheet {
  max-width: 720px;
  margin: 0 auto;
  padding: clamp(3.5rem, 10vw, 7rem) clamp(1.25rem, 5vw, 2rem) var(--s9);
}
.page-title { font-size: clamp(2.5rem, 8vw, 4rem); line-height: 1; margin: 0; }
.page-sub {
  font-family: var(--mono);
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.8rem;
  color: var(--accent);
  margin: var(--s3) 0 0;
}
.placeholder {
  font-family: var(--serif);
  font-size: 1.25rem;
  color: var(--muted);
  max-width: 50ch;
}

/* ============================================================
   Trip itinerary — Gantt
   ============================================================ */
.trip {
  max-width: 1800px;
  margin: 0 auto;
  padding: clamp(3rem, 8vw, 6rem) clamp(1.25rem, 5vw, 2rem) var(--s9);
}

/* Header block stays at the original reading width, left-aligned, while the
   Gantt below stretches to fill the wider .trip container. */
.trip-head {
  max-width: 1036px;
  margin-right: auto;
}

.gantt {
  margin-top: var(--s6);
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  -webkit-overflow-scrolling: touch;
}
.gantt:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.gantt-grid {
  display: grid;
  grid-template-columns: 140px repeat(var(--cols), minmax(140px, 1fr));
  grid-template-rows: auto auto repeat(10, minmax(56px, auto));
  min-width: max-content;
}

/* --- date header --- */
.g-corner { background: var(--surface); border-bottom: 1px solid var(--border); }
.g-day {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--s3) var(--s2);
  border-left: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  position: sticky;
  top: 0;
}
.g-day.is-weekend { background: var(--accent-soft); }
.g-dow {
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}
.g-date { font-family: var(--serif); font-size: 1.1rem; color: var(--accent-ink); line-height: 1.1; }

/* --- row labels --- */
.g-label {
  display: flex;
  align-items: center;
  padding: var(--s3) var(--s4);
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  border-top: 1px solid var(--border);
  background: var(--surface);
  position: sticky;
  left: 0;
  z-index: 2;
}
.g-label.g-lodging { border-top: none; }

/* --- meal / activity cells --- */
.g-cell {
  display: flex;
  flex-direction: column;
  gap: var(--s2);
  padding: var(--s3);
  border-left: 1px solid var(--border);
  border-top: 1px solid var(--border);
}
.g-item {
  font: inherit;
  font-size: 0.82rem;
  line-height: 1.35;
  text-align: left;
  color: #fff;
  background: var(--item-bg, var(--accent));
  border: none;
  border-radius: var(--radius-sm);
  padding: var(--s2) var(--s3);
  width: 100%;
  cursor: pointer;
  transition: filter .12s, transform .12s;
}
.g-item:hover { filter: brightness(1.08); }
.g-item:active { transform: translateY(1px); }
.g-item:focus-visible { outline: 2px solid var(--accent-ink); outline-offset: 2px; }
/* per-category fills, echoing the lodging bars */
.g-cell-transit     { --item-bg: var(--steel); }
.g-cell-breakfast   { --item-bg: var(--gold); }
.g-cell-lunch       { --item-bg: var(--teal); }
.g-cell-dinner      { --item-bg: var(--coral); }
.g-cell-activities  { --item-bg: var(--accent); }
.g-cell-mel_chuck   { --item-bg: var(--accent-ink); }
.g-cell-laura_dom   { --item-bg: var(--violet); }
.g-cell-ben_pam     { --item-bg: var(--success); }
.g-cell-greg_robin  { --item-bg: var(--teal); }
.g-cell-matt_jamiee { --item-bg: var(--muted); }

/* separator between the logistics rows and the per-family rows */
.g-cell-mel_chuck,
.g-label.g-mel_chuck { border-top: 2px solid var(--accent-ink); }
.g-cell.is-empty { background: repeating-linear-gradient(135deg, transparent, transparent 7px, rgba(214,219,228,.28) 7px, rgba(214,219,228,.28) 8px); }

/* --- lodging bars --- */
.g-stay {
  font: inherit;
  text-align: left;
  margin: var(--s2);
  padding: var(--s2) var(--s3);
  border: none;
  border-radius: var(--radius-sm);
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 1px;
  color: #fff;
  overflow: hidden;
  align-self: stretch;
  cursor: pointer;
  transition: filter .12s, transform .12s;
}
.g-stay:hover { filter: brightness(1.08); }
.g-stay:active { transform: translateY(1px); }
.g-stay:focus-visible { outline: 2px solid var(--accent-ink); outline-offset: 2px; }
.g-stay-name { font-weight: 600; font-size: 0.85rem; line-height: 1.2; }
.g-stay-place { font-size: 0.72rem; opacity: 0.88; }
.g-stay-note { font-family: var(--mono); font-size: 0.62rem; letter-spacing: 0.03em; opacity: 0.85; margin-top: 1px; }
.tone-violet { background: var(--violet); }
.tone-teal   { background: var(--teal); }
.tone-coral  { background: var(--coral); }

/* A lodging bar that rides inside a family row drops to the bottom of the cell
   so it sits below that row's own items (e.g. a flight) instead of covering
   them; the taller row gives both room to breathe. */
.g-cell-mel_chuck { min-height: 124px; }
.g-stay.in-row { align-self: end; }

.gantt-hint {
  margin: var(--s4) 0 0;
  font-size: 0.85rem;
  color: var(--muted);
}

/* ============================================================
   Trip itinerary — mobile agenda (day-by-day reflow)
   The Gantt can't shrink to a phone, so below the breakpoint we swap it for a
   vertical agenda built from the same data and the same detail-modal payloads.
   ============================================================ */
.trip-agenda {
  display: none;          /* desktop shows the Gantt instead */
  list-style: none;
  margin: 0;
  padding: 0;
}

.day-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--s4) var(--s4) var(--s5);
  display: flex;
  flex-direction: column;
  gap: var(--s4);
}
.day-card.is-weekend { background: var(--accent-soft); }

.day-card-head {
  display: flex;
  align-items: baseline;
  gap: var(--s3);
  padding-bottom: var(--s3);
  border-bottom: 1px solid var(--border);
}
.day-card-dow {
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}
.day-card-date { font-family: var(--serif); font-size: 1.35rem; color: var(--accent-ink); line-height: 1; }

/* lodging chip — echoes the Gantt's lodging bars (tone-* set the fill) */
.day-stay {
  font: inherit;
  text-align: left;
  border: none;
  border-radius: var(--radius-sm);
  padding: var(--s2) var(--s3);
  color: #fff;
  display: flex;
  flex-direction: column;
  gap: 1px;
  cursor: pointer;
  transition: filter .12s, transform .12s;
}
.day-stay:hover { filter: brightness(1.08); }
.day-stay:active { transform: translateY(1px); }
.day-stay:focus-visible { outline: 2px solid var(--accent-ink); outline-offset: 2px; }
.day-stay-label {
  font-family: var(--mono);
  font-size: 0.6rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  opacity: 0.85;
}
.day-stay-name { font-weight: 600; font-size: 0.9rem; line-height: 1.25; }

/* reset Gantt-cell rules that ride along on the shared g-cell-* classes
   (the family rows carry a min-height and a heavy separator border there) */
.day-group { display: flex; flex-direction: column; gap: var(--s2); min-height: 0; border-top: none; }
.day-group-label {
  font-family: var(--mono);
  font-size: 0.62rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}
.day-group-items { display: flex; flex-direction: column; gap: var(--s2); }
/* bigger tap target than the dense Gantt pills */
.day-group-items .g-item { font-size: 0.92rem; padding: var(--s3); }

.day-empty { margin: 0; font-size: 0.9rem; color: var(--muted); font-style: italic; }

@media (max-width: 768px) {
  .gantt, .gantt-only { display: none; }
  .trip-agenda {
    display: flex;
    flex-direction: column;
    gap: var(--s4);
    margin-top: var(--s6);
  }
}

.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;
}

/* ============================================================
   Itinerary detail modal
   ============================================================ */
.item-modal {
  width: min(440px, calc(100vw - 2rem));
  max-height: 85vh;
  overflow-y: auto;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 30px 70px -24px rgba(21, 38, 76, .55);
}
.item-modal::backdrop {
  background: rgba(21, 38, 76, .42);
  backdrop-filter: blur(2px);
}
.item-modal-body { position: relative; padding: clamp(1.5rem, 4vw, 2.25rem); }

.item-modal-close {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  width: 2rem;
  height: 2rem;
  font-size: 1.4rem;
  line-height: 1;
  color: var(--muted);
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background .12s, color .12s;
}
.item-modal-close:hover { background: var(--ground); color: var(--text); }
.item-modal-close:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.item-modal-type {
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 var(--s2);
}
.item-modal-title {
  font-size: 1.5rem;
  line-height: 1.15;
  margin: 0 0 var(--s4);
  padding-right: 1.5rem;
}
.item-modal-flag {
  font-size: 0.78rem;
  color: var(--gold);
  background: rgba(210, 154, 46, .12);
  border-radius: var(--radius-sm);
  padding: var(--s2) var(--s3);
  margin: 0 0 var(--s4);
}

.item-modal-meta {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: var(--s2) var(--s4);
  margin: 0 0 var(--s4);
}
.item-modal-meta:empty { display: none; }
.item-modal-meta dt {
  font-family: var(--mono);
  font-size: 0.64rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  padding-top: 2px;
}
.item-modal-meta dd { margin: 0; font-size: 0.92rem; }

.item-modal-notes ul {
  margin: 0 0 var(--s5);
  padding-left: 1.1rem;
  display: flex;
  flex-direction: column;
  gap: var(--s2);
}
.item-modal-notes li { font-size: 0.92rem; line-height: 1.5; color: var(--text); }

.item-modal-options {
  display: flex;
  flex-direction: column;
  gap: var(--s3);
  margin: 0 0 var(--s5);
}
.item-modal-options:empty { display: none; }
.item-modal-option {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--s2) var(--s3);
  padding: var(--s3);
  background: var(--ground);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.item-modal-option-name { margin: 0; font-size: 0.88rem; font-weight: 600; flex: 1 1 12rem; }
.item-modal-option-links { display: flex; gap: var(--s2); flex-shrink: 0; }
.item-modal-option-links .item-modal-link { padding: 0.35em 0.7em; font-size: 0.8rem; }

.item-modal-links { display: flex; flex-wrap: wrap; gap: var(--s3); }
.item-modal-links:empty { display: none; }
.item-modal-link {
  font-size: 0.88rem;
  font-weight: 600;
  text-decoration: none;
  color: var(--accent);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.5em 0.9em;
  transition: border-color .12s, background .12s;
}
.item-modal-link:hover { border-color: var(--accent); background: var(--accent-soft); }
.item-modal-link:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ============================================================
   Motion
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .rule { animation: none; transform: scaleX(1); }
}
