/* --- Editorial Manor: page-scoped type + texture ----------------------
   Sourced from home/index.html.erb's inline <style> (Track 6 extraction).
   Scope is the .manor root + descendants; no Tailwind color utilities are
   used here — the raw-color audit does not inspect CSS files, and this file
   intentionally carries the bespoke palette via custom properties.
   Loaded only on the home page via stylesheet_link_tag :home_manor. */

.manor {
  --serif: "Fraunces", "Times New Roman", Georgia, serif;
  --sans:  "Instrument Sans", ui-sans-serif, system-ui, sans-serif;
  --mono:  "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --paper: #f5f1e8;
  --paper-deep: #ebe4d2;
  --ink: #1c2e3a;
  --ink-soft: #3e5567;
  --gold: #a78a45;
  --gold-deep: #846c33;

  font-family: var(--sans);
  color: var(--ink);
  background:
    radial-gradient(ellipse 120% 80% at 50% -10%, rgba(198, 168, 94, 0.10), transparent 60%),
    linear-gradient(180deg, var(--paper) 0%, var(--paper-deep) 100%);
}
.manor :is(h1, h2, h3, .serif) { font-family: var(--serif); font-feature-settings: "ss01","liga"; }
.manor .mono { font-family: var(--mono); }

/* Subtle film-grain overlay, generated as tiny SVG noise. */
.manor-grain::before {
  content: "";
  position: absolute; inset: 0;
  background-image: url("data:image/svg+xml;utf8,<svg viewBox='0 0 160 160' xmlns='http://www.w3.org/2000/svg'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.1, 0 0 0 0 0.18, 0 0 0 0 0.23, 0 0 0 0.35 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
  opacity: 0.5;
  mix-blend-mode: multiply;
  pointer-events: none;
  z-index: 0;
}

/* Hairline used as a Le Monde-style rule. */
.hairline { height: 1px; background: currentColor; opacity: 0.18; }

/* Numeric tabular figures for prices and stats. */
.tnum { font-variant-numeric: tabular-nums lining-nums; }

/* Reveal on load — staggered fade-up. */
@keyframes manor-rise {
  0%   { opacity: 0; transform: translateY(14px); }
  100% { opacity: 1; transform: translateY(0); }
}
@media (prefers-reduced-motion: no-preference) {
  .manor .rise { animation: manor-rise 900ms cubic-bezier(.2,.7,.2,1) both; }
  .manor .rise-1 { animation-delay: 80ms; }
  .manor .rise-2 { animation-delay: 180ms; }
  .manor .rise-3 { animation-delay: 280ms; }
  .manor .rise-4 { animation-delay: 380ms; }
  .manor .rise-5 { animation-delay: 520ms; }
}

/* Drop-cap on the opening paragraph. */
.dropcap::first-letter {
  font-family: var(--serif);
  font-weight: 400;
  float: left;
  font-size: 4.2em;
  line-height: 0.85;
  padding: 0.1em 0.1em 0 0;
  color: var(--gold-deep);
  font-style: italic;
}

/* Link underline that grows from the start — subtle but tactile. */
.link-grow { position: relative; display: inline-block; }
.link-grow::after {
  content: ""; position: absolute; left: 0; bottom: -2px;
  width: 100%; height: 1px; background: currentColor;
  transform: scaleX(0); transform-origin: left;
  transition: transform 400ms cubic-bezier(.2,.7,.2,1);
}
.link-grow:hover::after { transform: scaleX(1); }

/* Search input: custom, refined rather than generic. */
.manor-search {
  border: 1px solid rgba(28, 46, 58, 0.18);
  background: rgba(255, 255, 255, 0.55);
  backdrop-filter: blur(8px);
  transition: border-color 200ms, background 200ms;
}
.manor-search:focus-within {
  border-color: var(--ink);
  background: #ffffff;
  box-shadow: 0 0 0 4px rgba(167, 138, 69, 0.12);
}
.manor-search input { font-family: var(--serif); font-size: 1.125rem; }
.manor-search input::placeholder { color: rgba(28, 46, 58, 0.4); font-style: italic; }

.manor-cta {
  background: var(--ink); color: #fff;
  font-family: var(--sans); letter-spacing: 0.02em;
  transition: background 200ms, transform 200ms;
}
.manor-cta:hover { background: #0a1218; transform: translateY(-1px); }

/* Featured card — large, serif-led, hairline accents. */
.manor-feature {
  position: relative;
  background: #fffdf7;
  border: 1px solid rgba(28, 46, 58, 0.12);
  overflow: hidden;
}
.manor-feature::before {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(135deg, rgba(167, 138, 69, 0.05), transparent 60%);
  pointer-events: none;
}

/* Compact listing row with a numbered gutter. */
.manor-row {
  display: grid;
  grid-template-columns: 2.5rem 1fr auto;
  gap: 1rem;
  align-items: baseline;
  padding: 1.1rem 0;
  border-bottom: 1px solid rgba(28, 46, 58, 0.08);
  transition: background 200ms, padding 200ms;
}
.manor-row:hover { background: rgba(255, 253, 247, 0.6); padding-left: 0.5rem; padding-right: 0.5rem; }
.manor-row .num {
  font-family: var(--mono); font-size: 0.75rem; letter-spacing: 0.08em;
  color: var(--gold-deep); padding-top: 0.2em;
}

/* Vintage-serif discount stamp. */
.discount-stamp {
  font-family: var(--serif); font-style: italic; font-weight: 500;
  color: var(--gold-deep); letter-spacing: -0.01em;
}

/* Edition badge. */
.edition-badge {
  font-family: var(--mono); font-size: 0.68rem; letter-spacing: 0.22em;
  color: var(--ink-soft);
}

/* Closing manifesto — ink-dominant strip with warmth. */
.manor-closer {
  background:
    radial-gradient(ellipse at 20% 20%, rgba(198, 168, 94, 0.18), transparent 55%),
    linear-gradient(180deg, #131f28 0%, #0a1218 100%);
  color: #f5f1e8;
}
