/* ═══════════════════════════════════════════════════════════════════════
   LETTERPRESS — foundation.css
   Editorial, print-inspired design language. Pair with STYLE-GUIDE.md.
   Fonts: Fraunces (display) + Instrument Sans (body), e.g.:
   @import url('https://fonts.googleapis.com/css2?family=Fraunces:ital,opsz,wght@0,9..144,300..700;1,9..144,300..700&family=Instrument+Sans:ital,wght@0,400..700;1,400..700&display=swap');
   ═══════════════════════════════════════════════════════════════════════ */

:root {
  /* paper & ink */
  --paper: #f5f1e6;
  --paper-2: #ede7d7;
  --card: #faf7ef;
  --ink: #1c1a14;
  --ink-soft: #4e483b;
  --faint: #6b644f; /* darkened from #837c69 for WCAG 4.5:1 on all paper tones */
  --rule: #d6cfba;

  /* accents */
  --rust: #a8430e;
  --rust-deep: #7a2f08;
  --rust-on-dark: #c96a35;
  --seal: #31493c;

  /* inverted (ink) sections */
  --inv-text: #f0ebdd;
  --inv-muted: #a49c88;
  --inv-rule: rgba(240, 235, 221, 0.18);

  /* type */
  --serif: "Fraunces", "Iowan Old Style", Georgia, serif;
  --sans: "Instrument Sans", sans-serif;

  /* depth (the only shadow in the system) */
  --offset-shadow: 6px 6px 0 var(--ink);
  --offset-shadow-sm: 4px 4px 0 var(--ink);

  --col: min(1360px, calc(100% - 48px));
}

/* ─── Base ──────────────────────────────────────────────────────────── */
* { box-sizing: border-box; }

html {
  background: var(--paper);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.65;
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
}

/* Paper grain — subtle SVG noise so surfaces don't read as flat vector */
.lp-grain::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E");
}

::selection { background: var(--ink); color: var(--paper); }

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

.lp-col { width: var(--col); margin: 0 auto; }

/* ─── Type ──────────────────────────────────────────────────────────── */
h1, h2, h3, .lp-serif {
  font-family: var(--serif);
  font-optical-sizing: auto;
  margin: 0;
}

h1, .lp-h1 {
  font-size: clamp(44px, 6.5vw, 84px);
  font-weight: 540;
  letter-spacing: -0.015em;
  line-height: 1.02;
}

h2, .lp-h2 {
  font-size: clamp(32px, 4.2vw, 52px);
  font-weight: 520;
  letter-spacing: -0.01em;
  line-height: 1.08;
}

h3, .lp-h3 {
  font-size: 23px;
  font-weight: 560;
  line-height: 1.2;
}

p { margin: 0 0 1em; color: var(--ink-soft); }
.lp-lead { font-size: 18px; max-width: 52ch; }
.lp-meta { font-size: 13px; color: var(--faint); letter-spacing: 0.02em; line-height: 1.5; }

/* THE accent: the marked word written in by hand, tilted, over a flourish
   stroke that draws itself in shortly after load (approved spec No. 33). */
.lp-accent {
  display: inline-block;
  position: relative;
  white-space: nowrap;
  font-family: "Caveat", cursive;
  font-style: normal;
  font-weight: 600;
  font-size: 1.28em;
  line-height: 0.7;
  vertical-align: -0.05em;
  color: var(--rust);
  transform: rotate(-2deg);
}

.lp-accent .lp-accent-stroke {
  position: absolute;
  left: 2%;
  bottom: -0.3em;
  width: 94%;
  height: 0.42em;
  overflow: visible;
  pointer-events: none;
}

.lp-accent .lp-accent-stroke path {
  stroke-dasharray: 100;
  stroke-dashoffset: 100;
  animation: lp-accent-draw 0.7s ease-out 0.7s forwards;
}

@keyframes lp-accent-draw {
  to { stroke-dashoffset: 0; }
}

/* Links: real underlines, always */
a {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  text-decoration-color: var(--faint);
  transition: color 0.15s ease, text-decoration-color 0.15s ease;
}
a:hover {
  color: var(--rust);
  text-decoration-color: var(--rust);
  text-decoration-thickness: 2px;
}

/* ─── Kicker & folio ────────────────────────────────────────────────── */
.lp-kicker {
  display: flex;
  align-items: center;
  gap: 16px;
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink);
}
.lp-kicker::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--rule);
}

.lp-folio {
  font-family: var(--serif);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.06em;
  color: var(--faint);
  font-variant-numeric: tabular-nums;
}

/* Section opener: heavy rule, then folio + kicker + H2 */
.lp-rule { border: 0; height: 1px; background: var(--rule); margin: 0; }
.lp-rule-heavy { border: 0; height: 2px; background: var(--ink); margin: 0; }

.lp-section { padding: 96px 0; }
.lp-section-head { display: grid; gap: 14px; margin-bottom: 48px; }
@media (max-width: 720px) { .lp-section { padding: 64px 0; } }

/* ─── Buttons ───────────────────────────────────────────────────────── */
.lp-btn, .lp-btn-ghost {
  display: inline-block;
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.02em;
  padding: 14px 26px;
  border: 1px solid var(--ink);
  border-radius: 0;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.lp-btn { background: var(--ink); color: var(--paper); }
.lp-btn:hover { background: var(--rust); border-color: var(--rust); color: var(--paper); }
.lp-btn-ghost { background: transparent; color: var(--ink); }
.lp-btn-ghost:hover { background: var(--ink); color: var(--paper); }

/* ─── Cards (shared-border drawn grid) ──────────────────────────────── */
/* Wrap cards in .lp-grid so 1px gaps read as drawn rules, not islands. */
.lp-grid {
  display: grid;
  gap: 1px;
  background: var(--rule);
  border: 1px solid var(--rule);
}
.lp-grid-3 { grid-template-columns: repeat(3, 1fr); }
.lp-grid-2 { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 860px) { .lp-grid-3, .lp-grid-2 { grid-template-columns: 1fr; } }

.lp-card {
  background: var(--card);
  padding: 28px;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.lp-card-hover:hover {
  position: relative;
  z-index: 2;
  outline: 1px solid var(--ink);
  transform: translate(-2px, -2px);
  box-shadow: var(--offset-shadow);
}

/* ─── Ledger table ──────────────────────────────────────────────────── */
.lp-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--card);
  border: 1px solid var(--rule);
  font-variant-numeric: tabular-nums;
}
.lp-table th {
  background: var(--paper-2);
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-align: left;
  padding: 12px 16px;
  border-bottom: 1px solid var(--rule);
}
.lp-table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--rule);
  color: var(--ink-soft);
  font-size: 15px;
}
.lp-table tr:last-child td { border-bottom: 0; }
.lp-table td:first-child { color: var(--ink); font-weight: 500; }
.lp-table .lp-num { text-align: right; }

/* ─── Index list (signature component) ──────────────────────────────── */
.lp-index { border-top: 1px solid var(--rule); }
.lp-index-row {
  display: grid;
  grid-template-columns: 64px 1fr auto;
  align-items: baseline;
  gap: 24px;
  padding: 22px 12px;
  border-bottom: 1px solid var(--rule);
  text-decoration: none;
  color: var(--ink);
  transition: background 0.15s ease, color 0.15s ease;
}
.lp-index-row .lp-index-no {
  font-family: var(--serif);
  font-size: 15px;
  color: var(--faint);
  font-variant-numeric: tabular-nums;
  transition: color 0.15s ease;
}
.lp-index-row .lp-index-title {
  font-family: var(--serif);
  font-size: clamp(20px, 2.6vw, 28px);
  font-weight: 520;
}
.lp-index-row .lp-index-meta {
  font-size: 13px;
  color: var(--faint);
  transition: color 0.15s ease;
}
.lp-index-row:hover {
  background: var(--ink);
  color: var(--paper);
}
.lp-index-row:hover .lp-index-no { color: var(--rust-on-dark); }
.lp-index-row:hover .lp-index-meta { color: var(--inv-muted); }
@media (max-width: 640px) {
  .lp-index-row { grid-template-columns: 48px 1fr; }
  .lp-index-row .lp-index-meta { grid-column: 2; }
}

/* ─── Stamp ─────────────────────────────────────────────────────────── */
.lp-stamp {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  width: 108px;
  height: 108px;
  border: 2px solid var(--rust);
  border-radius: 50%;
  transform: rotate(-8deg);
  color: var(--rust);
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  line-height: 1.4;
  padding: 10px;
  transition: transform 0.15s ease;
}
.lp-stamp:hover { transform: rotate(-4deg); }

/* ─── Margin note ───────────────────────────────────────────────────── */
.lp-note {
  font-family: var(--serif);
  font-style: italic;
  font-size: 15px;
  color: var(--rust);
}
.lp-note::before { content: "\2731\00a0\00a0"; font-style: normal; } /* ✱ */

/* ─── Pull quote band ───────────────────────────────────────────────── */
.lp-quote-band {
  background: var(--paper-2);
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  padding: 80px 0;
}
.lp-quote {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 480;
  font-size: clamp(24px, 3vw, 34px);
  line-height: 1.35;
  max-width: 28ch;
  margin: 0 0 20px;
}

/* ─── Inverted (ink) sections ───────────────────────────────────────── */
.lp-inverted {
  background: var(--ink);
  color: var(--inv-text);
}
.lp-inverted p { color: var(--inv-muted); }
.lp-inverted .lp-accent { color: var(--rust-on-dark); }
.lp-inverted a { color: var(--inv-text); text-decoration-color: var(--inv-muted); }
.lp-inverted a:hover { color: var(--rust-on-dark); text-decoration-color: var(--rust-on-dark); }
.lp-inverted .lp-rule { background: var(--inv-rule); }
.lp-inverted .lp-kicker { color: var(--inv-text); }
.lp-inverted .lp-meta { color: var(--inv-muted); }
.lp-inverted .lp-kicker::after { background: var(--inv-rule); }
.lp-inverted .lp-btn {
  background: var(--inv-text);
  border-color: var(--inv-text);
  color: var(--ink);
}
.lp-inverted .lp-btn:hover { background: var(--rust-on-dark); border-color: var(--rust-on-dark); color: var(--ink); }

/* ─── Nav ───────────────────────────────────────────────────────────── */
.lp-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--card);
  border-bottom: 1px solid var(--rule);
}
.lp-nav-inner {
  width: var(--col);
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 32px;
  height: 64px;
}
.lp-wordmark {
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.01em;
  text-decoration: none;
  color: var(--ink);
  margin-right: auto;
}
.lp-wordmark:hover { color: var(--ink); text-decoration: none; }
.lp-nav-link {
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  color: var(--ink-soft);
}
.lp-nav-link:hover { color: var(--rust); text-decoration: underline; }

/* ─── Forms — native (.lp-form) AND Fluent Forms (.fluentform) ──────── */
/* The .fluentform selectors match Fluent Forms' rendered WordPress markup
   so an embedded form inherits the Letterpress look with no extra work.  */

.lp-form, .fluentform { font-family: var(--sans); }

.lp-field,
.fluentform .ff-el-group { margin-bottom: 22px; }

.lp-form label,
.fluentform .ff-el-input--label label {
  display: block;
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink);
  margin-bottom: 8px;
}
.lp-form label .req::after,
.fluentform .ff-el-is-required.asterisk-right label::after {
  content: " *";
  color: var(--rust);
}

.lp-form input:not([type="submit"]):not([type="checkbox"]):not([type="radio"]),
.lp-form select,
.lp-form textarea,
.fluentform .ff-el-form-control {
  width: 100%;
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: 0;
  padding: 13px 14px;
  font-family: var(--sans);
  font-size: 16px;
  color: var(--ink);
  line-height: 1.4;
  box-shadow: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.lp-form ::placeholder,
.fluentform .ff-el-form-control::placeholder { color: var(--faint); opacity: 1; }

.lp-form input:focus,
.lp-form select:focus,
.lp-form textarea:focus,
.fluentform .ff-el-form-control:focus {
  outline: none;
  border-color: var(--ink);
  box-shadow: var(--offset-shadow-sm);
  background: var(--paper);
}

.lp-form select,
.fluentform select.ff-el-form-control {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%231c1a14' stroke-width='1.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 38px;
}

.lp-form textarea,
.fluentform textarea.ff-el-form-control { min-height: 120px; resize: vertical; }

.lp-form input[type="checkbox"],
.lp-form input[type="radio"],
.fluentform .ff-el-form-check-input { accent-color: var(--rust); width: 16px; height: 16px; }
.fluentform .ff-el-form-check-label {
  font-size: 15px; color: var(--ink-soft);
  text-transform: none; letter-spacing: 0; font-weight: 450;
}

/* Two-up field row (native). Fluent Forms uses its own container columns;
   its .ff-t-cell cells simply inherit the input styles above. */
.lp-form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
@media (max-width: 640px) { .lp-form-row { grid-template-columns: 1fr; } }

/* Submit: identical to .lp-btn */
.lp-form [type="submit"],
.fluentform .ff-btn-submit {
  display: inline-block;
  background: var(--ink);
  color: var(--paper);
  border: 1px solid var(--ink);
  border-radius: 0;
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.02em;
  padding: 14px 26px;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.lp-form [type="submit"]:hover,
.fluentform .ff-btn-submit:hover { background: var(--rust); border-color: var(--rust); color: var(--paper); }

/* Validation + result messages */
.fluentform .ff-el-is-error .ff-el-form-control { border-color: var(--rust); }
.lp-form .lp-error,
.fluentform .text-danger,
.fluentform .error {
  color: var(--rust);
  font-family: var(--serif);
  font-style: italic;
  font-size: 14px;
}
.fluentform .ff-message-success,
.lp-form .lp-success {
  background: var(--card);
  border: 1px solid var(--seal);
  color: var(--seal);
  border-radius: 0;
  box-shadow: none;
  padding: 16px 18px;
  font-size: 15px;
}

/* ─── Reveal motion (the only entrance animation) ───────────────────── */
@keyframes lp-reveal {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: none; }
}
.lp-reveal { animation: lp-reveal 0.5s ease-out both; }
.lp-reveal-1 { animation-delay: 0.08s; }
.lp-reveal-2 { animation-delay: 0.16s; }
.lp-reveal-3 { animation-delay: 0.24s; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
