/* ============================================================
   Noble Lords — design system
   Authoritative, heraldic: oxblood, antique gold, parchment.
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,400;0,500;0,600;0,700;1,400;1,500&family=Cormorant+SC:wght@500;600;700&family=EB+Garamond:ital,wght@0,400;0,500;0,600;1,400;1,500&display=swap');

:root {
  /* Palette */
  --oxblood: #5e1414;
  --oxblood-deep: #420d0d;
  --oxblood-ink: #2c0a0a;
  --gold: #b0863b;
  --gold-bright: #cda44e;
  --gold-pale: #e3cd97;
  --parchment: #f6efdd;
  --parchment-deep: #ece0c4;
  --parchment-card: #fbf6e9;
  --ink: #241c15;
  --ink-soft: #4d4034;
  --ink-faint: #756450;
  --rule: #d8c8a4;

  /* Type */
  --display: 'Cormorant Garamond', Georgia, 'Times New Roman', serif;
  --smallcaps: 'Cormorant SC', 'Cormorant Garamond', serif;
  --body: 'EB Garamond', Georgia, serif;

  /* Metrics */
  --measure: 68ch;
  --wide: 1180px;
  --pad: clamp(1.1rem, 4vw, 2.5rem);
  --shadow: 0 1px 2px rgba(44,10,10,.06), 0 8px 30px rgba(44,10,10,.08);
  --shadow-lift: 0 4px 12px rgba(44,10,10,.10), 0 18px 50px rgba(44,10,10,.14);
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--body);
  font-size: clamp(1.06rem, 0.65rem + 0.7vw, 1.22rem);
  line-height: 1.72;
  color: var(--ink);
  background-color: var(--parchment);
  background-image:
    radial-gradient(circle at 18% 12%, rgba(176,134,59,.07), transparent 42%),
    radial-gradient(circle at 84% 78%, rgba(94,20,20,.06), transparent 46%);
  background-attachment: fixed;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--oxblood); text-decoration-color: var(--gold); text-underline-offset: 3px; }
a:hover { color: var(--oxblood-deep); }

/* ---------- Headings ---------- */
h1, h2, h3, h4 { font-family: var(--display); font-weight: 600; color: var(--oxblood-deep); line-height: 1.1; margin: 0 0 .5em; }
h2 { font-size: clamp(1.8rem, 1.1rem + 2.4vw, 2.7rem); }
h3 { font-size: clamp(1.35rem, 1rem + 1.3vw, 1.7rem); color: var(--oxblood); }
p { margin: 0 0 1.1em; }

.kicker {
  font-family: var(--smallcaps);
  text-transform: uppercase;
  letter-spacing: .26em;
  font-size: .82rem;
  color: var(--gold);
  font-weight: 600;
  margin: 0 0 1rem;
}

/* ---------- Layout helpers ---------- */
.wrap { width: min(100% - 2*var(--pad), var(--wide)); margin-inline: auto; }
.measure { max-width: var(--measure); }
.center { text-align: center; }
.section { padding-block: clamp(3rem, 6vw, 5.5rem); }

/* Decorative rule with a central diamond */
.ornament { display: flex; align-items: center; gap: 1rem; color: var(--gold); margin: 2.2rem auto; max-width: 22rem; }
.ornament::before, .ornament::after { content: ""; height: 1px; flex: 1; background: linear-gradient(90deg, transparent, var(--gold)); }
.ornament::after { background: linear-gradient(90deg, var(--gold), transparent); }
.ornament span { font-size: 1.1rem; letter-spacing: .3em; }

/* ============================================================
   Masthead
   ============================================================ */
.masthead {
  position: sticky; top: 0; z-index: 50;
  background: rgba(246,239,221,.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--rule);
  box-shadow: 0 1px 0 rgba(176,134,59,.25);
}
.masthead__bar { display: flex; align-items: center; gap: 1rem; padding-block: .7rem; }
.brand { display: flex; align-items: center; gap: .8rem; text-decoration: none; margin-right: auto; }
.brand__crest { width: 42px; height: 42px; flex: none; }
.brand__name { font-family: var(--display); font-weight: 700; font-size: 1.5rem; color: var(--oxblood-deep); line-height: 1; }
.brand__sub { display: block; font-family: var(--smallcaps); text-transform: uppercase; letter-spacing: .2em; font-size: .58rem; color: var(--gold); margin-top: .25rem; }

.nav { display: flex; align-items: center; gap: .3rem; }
.nav a {
  font-family: var(--smallcaps); text-transform: uppercase; letter-spacing: .12em;
  font-size: .82rem; color: var(--ink-soft); text-decoration: none;
  padding: .5rem .7rem; border-radius: 3px; white-space: nowrap;
}
.nav a:hover, .nav a[aria-current="page"] { color: var(--oxblood-deep); background: rgba(176,134,59,.12); }

.nav-toggle { display: none; background: none; border: 1px solid var(--rule); border-radius: 4px; padding: .5rem .6rem; cursor: pointer; color: var(--oxblood-deep); font-size: 1.1rem; line-height: 1; }

@media (max-width: 860px) {
  .nav-toggle { display: block; }
  .nav {
    position: absolute; inset: 100% 0 auto 0; flex-direction: column; align-items: stretch;
    background: var(--parchment); border-bottom: 1px solid var(--rule);
    padding: .5rem var(--pad) 1rem; gap: 0; display: none; box-shadow: var(--shadow);
  }
  .nav.open { display: flex; }
  .nav a { padding: .75rem .3rem; border-bottom: 1px solid var(--rule); }
}

/* ============================================================
   Hero
   ============================================================ */
.hero { position: relative; text-align: center; padding-block: clamp(3.2rem, 8vw, 6.5rem); overflow: hidden; }
.hero__crest { width: clamp(72px, 12vw, 116px); margin: 0 auto 1.4rem; }
.hero__title { font-size: clamp(2.6rem, 1.4rem + 5vw, 5rem); font-weight: 700; letter-spacing: .01em; }
.hero__sub { font-family: var(--display); font-style: italic; font-size: clamp(1.15rem, .9rem + 1vw, 1.7rem); color: var(--ink-soft); max-width: 40ch; margin: .4rem auto 0; }
.hero--home { background:
   linear-gradient(180deg, rgba(94,20,20,.04), transparent 60%); }
/* keep the homepage tagline on a single line (wraps only on narrow screens) */
.hero--home .hero__sub { max-width: none; }
/* hero illustration: blended onto the parchment so the white ground disappears */
.hero__figures { display: block; width: min(860px, 100%); margin: 2.6rem auto 0; mix-blend-mode: multiply; }

/* Title meta line (region · rank) */
.titlemeta { font-family: var(--smallcaps); text-transform: uppercase; letter-spacing: .22em; font-size: .8rem; color: var(--gold); margin-top: 1.2rem; }
.titlemeta span + span::before { content: "·"; margin: 0 .6rem; color: var(--rule); }

/* ============================================================
   Article
   ============================================================ */
.article { padding-block: clamp(2rem, 5vw, 3.5rem); }
.article .lede { font-size: 1.18em; color: var(--ink-soft); font-family: var(--display); font-weight: 500; }
.article .lede::first-letter,
.dropcap::first-letter {
  float: left; font-family: var(--display); font-weight: 700; color: var(--oxblood);
  font-size: 3.6em; line-height: .72; padding: .08em .12em 0 0;
}
.article h3 { margin-top: 2.2rem; }
.article h3::before { content: "❧"; color: var(--gold); margin-right: .5rem; font-size: .8em; vertical-align: .08em; }

blockquote {
  margin: 1.8rem 0; padding: .2rem 0 .2rem 1.4rem;
  border-left: 3px solid var(--gold);
  font-family: var(--display); font-style: italic; font-size: 1.25em; color: var(--oxblood);
}

/* Figures & image slots */
figure { margin: 2rem 0; }
figure.wide { }
figure.portrait { max-width: 30rem; margin-inline: auto; }
figure img { border-radius: 3px; box-shadow: var(--shadow); border: 1px solid var(--rule); }
figcaption { font-family: var(--display); font-style: italic; color: var(--ink-faint); font-size: .95em; text-align: center; margin-top: .6rem; }

.imgslot {
  position: relative; display: grid; place-items: center; text-align: center;
  background:
    repeating-linear-gradient(45deg, rgba(176,134,59,.05) 0 12px, transparent 12px 24px),
    var(--parchment-card);
  border: 1.5px dashed var(--gold); border-radius: 4px;
  color: var(--ink-faint); padding: 2.2rem 1.4rem; min-height: 180px;
}
.imgslot.portrait { aspect-ratio: 3/4; }
.imgslot.wide { aspect-ratio: 16/9; }
.imgslot__mark { font-size: 1.8rem; color: var(--gold); opacity: .55; }
.imgslot__cap { font-family: var(--display); font-style: italic; font-size: 1.05em; color: var(--ink-soft); margin-top: .4rem; max-width: 36ch; }
.imgslot__path { font-family: ui-monospace, monospace; font-size: .72rem; letter-spacing: .02em; color: var(--gold); margin-top: .7rem; opacity: .8; }

/* ============================================================
   Quick facts panel
   ============================================================ */
.facts {
  background: var(--parchment-card); border: 1px solid var(--rule);
  border-top: 3px solid var(--gold); border-radius: 4px;
  padding: 1.4rem 1.5rem; box-shadow: var(--shadow); margin: 2rem 0;
}
.facts h4 { font-family: var(--smallcaps); text-transform: uppercase; letter-spacing: .2em; font-size: .85rem; color: var(--gold); margin: 0 0 1rem; }
.facts dl { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: .55rem 1.1rem; }
.facts dt { font-family: var(--smallcaps); text-transform: uppercase; letter-spacing: .08em; font-size: .78rem; color: var(--ink-faint); padding-top: .15rem; }
.facts dd { margin: 0; color: var(--ink); }

/* ============================================================
   Succession roll
   ============================================================ */
.roll { background: var(--parchment-card); border: 1px solid var(--rule); border-radius: 4px; padding: clamp(1.4rem,3vw,2.2rem); margin: 2.5rem 0; box-shadow: var(--shadow); }
.roll > h3 { margin-top: 0; text-align: center; }
.roll > h3::before { content: none; }
.roll__group { margin-top: 1.6rem; }
.roll__group h4 { font-family: var(--smallcaps); text-transform: uppercase; letter-spacing: .18em; font-size: .8rem; color: var(--gold); border-bottom: 1px solid var(--rule); padding-bottom: .35rem; margin: 0 0 .7rem; }
.roll ol { list-style: none; margin: 0; padding: 0; }
.roll li { display: grid; grid-template-columns: 3.2rem 1fr; gap: .8rem; padding: .45rem 0; border-bottom: 1px dotted var(--rule); align-items: baseline; }
.roll li:last-child { border-bottom: none; }
.roll .gen { font-family: var(--display); font-weight: 700; color: var(--gold); font-size: 1.05rem; text-align: right; }
.roll .who { color: var(--ink); }
.roll .who b { color: var(--oxblood-deep); font-weight: 600; }
.roll .who small { display: block; color: var(--ink-faint); font-size: .9em; }

/* ============================================================
   Cards (legacies index, featured, armorial)
   ============================================================ */
.grid { display: grid; gap: 1.6rem; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.card {
  background: var(--parchment-card); border: 1px solid var(--rule); border-radius: 5px;
  box-shadow: var(--shadow); overflow: hidden; text-decoration: none; color: inherit;
  display: flex; flex-direction: column; transition: transform .25s ease, box-shadow .25s ease;
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lift); }
.card__top { background: linear-gradient(160deg, var(--oxblood), var(--oxblood-deep)); color: var(--parchment); padding: 1.5rem 1.4rem 1.2rem; display: flex; gap: 1rem; align-items: center; }
.card__top .shield { width: 52px; flex: none; }
.card__kicker { font-family: var(--smallcaps); text-transform: uppercase; letter-spacing: .18em; font-size: .68rem; color: var(--gold-pale); }
.card__title { font-family: var(--display); font-weight: 600; font-size: 1.4rem; line-height: 1.1; color: #fbf6e9; }
.card__body { padding: 1.1rem 1.4rem 1.4rem; color: var(--ink-soft); flex: 1; }
.card__more { font-family: var(--smallcaps); text-transform: uppercase; letter-spacing: .14em; font-size: .74rem; color: var(--gold); padding: 0 1.4rem 1.3rem; }

/* Armorial grid of shields */
.armorial { display: grid; gap: 2rem 1.4rem; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); }
.achievement { text-align: center; text-decoration: none; color: inherit; }
.achievement .shield { width: clamp(96px, 14vw, 132px); margin: 0 auto .8rem; filter: drop-shadow(0 6px 14px rgba(44,10,10,.18)); transition: transform .25s ease; }
.achievement:hover .shield { transform: translateY(-4px) scale(1.03); }
.achievement__name { font-family: var(--display); font-weight: 600; font-size: 1.18rem; color: var(--oxblood-deep); line-height: 1.1; }
.achievement__blazon { font-style: italic; color: var(--ink-faint); font-size: .86rem; margin-top: .25rem; }

/* ============================================================
   Bands / callouts
   ============================================================ */
.band { background: linear-gradient(160deg, var(--oxblood), var(--oxblood-ink)); color: var(--parchment); }
.band h2 { color: #fbf6e9; }
.band .kicker { color: var(--gold-bright); }
.band a { color: var(--gold-pale); }

.btn {
  display: inline-block; font-family: var(--smallcaps); text-transform: uppercase; letter-spacing: .16em;
  font-size: .82rem; text-decoration: none; padding: .8rem 1.6rem; border-radius: 3px;
  background: var(--gold); color: var(--oxblood-ink); border: 1px solid var(--gold-bright);
  transition: background .2s ease, transform .2s ease;
}
.btn:hover { background: var(--gold-bright); transform: translateY(-2px); color: var(--oxblood-ink); }
.btn--ghost { background: transparent; color: var(--gold-pale); border-color: var(--gold); }
.btn--ghost:hover { background: rgba(176,134,59,.16); color: #fff; }

/* ============================================================
   Footer
   ============================================================ */
.footer { background: var(--oxblood-ink); color: var(--parchment-deep); padding-block: 3rem 2rem; margin-top: 3rem; border-top: 3px solid var(--gold); }
.footer__crest { width: 56px; margin: 0 auto 1.2rem; opacity: .92; }
.footer__nav { display: flex; flex-wrap: wrap; justify-content: center; gap: .4rem 1.4rem; margin-bottom: 1.6rem; }
.footer__nav a { font-family: var(--smallcaps); text-transform: uppercase; letter-spacing: .14em; font-size: .78rem; color: var(--gold-pale); text-decoration: none; }
.footer__nav a:hover { color: #fff; }
.footer__lines { text-align: center; font-family: var(--display); font-style: italic; color: var(--gold-pale); }
.footer__lines p { margin: .2rem 0; }
.footer__legal { text-align: center; font-size: .8rem; color: rgba(227,205,151,.5); margin-top: 1.4rem; }

/* ---------- Two-column article layout ---------- */
.layout { display: grid; gap: clamp(1.5rem, 4vw, 3rem); }
/* image-based arms (e.g. real coats of arms) scale like the drawn shields */
img.shield { height: auto; object-fit: contain; }
.hero__crest .shield,
.armorial > .shield { width: 100%; height: auto; }

/* blazon line beneath the hero crest */
.hero__blazon { font-family: var(--display); font-style: italic; color: var(--gold); margin: .8rem 0 0; font-size: 1.05rem; }

/* article hero sits closer to the fact ledger below it */
.hero--doc { padding-block: clamp(2.2rem, 5vw, 3.4rem) .6rem; }

/* Quick-facts: a refined ledger framed by hairline rules */
.factbar-wrap { padding: 0 var(--pad); }
.factbar { max-width: 54rem; margin: 0 auto; padding: 1.6rem 0; text-align: center;
  border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }
.factbar h4 { font-family: var(--smallcaps); text-transform: uppercase; letter-spacing: .28em; font-size: .78rem; color: var(--gold); margin: 0 0 1.3rem; }
.factbar dl { margin: 0; display: grid; gap: 1.4rem 1.1rem; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.factbar .fact { text-align: center; padding: 0 .6rem; }
.factbar dt { font-family: var(--smallcaps); text-transform: uppercase; letter-spacing: .14em; font-size: .68rem; color: var(--gold); }
.factbar dd { margin: .35rem 0 0; color: var(--ink); line-height: 1.35; font-family: var(--display); font-size: 1.14rem; font-weight: 500; }

/* two-column article layout: content + a short arms sidebar (arms & blazon only) */
.layout__aside { order: -1; }            /* mobile: arms panel sits above the article body (below Quick Facts) */
@media (min-width: 960px) {
  .layout { grid-template-columns: 1fr 19rem; align-items: start; }
  .layout__aside { order: 0; position: sticky; top: 5.5rem; }   /* desktop: back to the right column */
}
.armspanel {
  background: var(--parchment-card); border: 1px solid var(--rule);
  border-top: 3px solid var(--gold); border-radius: 4px;
  padding: 1.4rem; text-align: center; box-shadow: var(--shadow);
}
.armspanel .shield { width: 100%; height: auto; max-width: 6rem; margin: 0 auto; display: block; }
/* larger arms shown at the top of an article, above the title */
.hero__arms { width: clamp(110px, 15vw, 168px); margin: 0 auto 1.4rem; }
.hero__arms .shield { width: 100%; height: auto; }
.armspanel__title { font-family: var(--display); font-weight: 600; font-size: 1.3rem; color: var(--oxblood-deep); line-height: 1.12; margin: .15rem 0 0; }
.armspanel__blazon { font-family: var(--display); font-style: italic; color: var(--ink-faint); margin: .8rem 0 0; font-size: .95rem; line-height: 1.4; }
.armspanel__facts { margin: 1.1rem 0 0; padding-top: 1.1rem; border-top: 1px solid var(--rule); text-align: left; display: grid; gap: .8rem; }
.armspanel__facts dt { font-family: var(--smallcaps); text-transform: uppercase; letter-spacing: .12em; font-size: .66rem; color: var(--gold); }
.armspanel__facts dd { margin: .15rem 0 0; color: var(--ink); font-size: 1rem; line-height: 1.35; }

/* keep reference scans modest; the hero image keeps full width */
figure:not(.figure--hero) { max-width: 28rem; margin-inline: auto; }
figure:not(.figure--hero) img { max-height: 70vh; width: auto; max-width: 100%; margin-inline: auto; }

/* ---------- Contact form ---------- */
.form { margin: 1.6rem 0 0; display: grid; gap: 1.1rem; max-width: 34rem; }
.form .hp { position: absolute; left: -9999px; opacity: 0; height: 0; width: 0; }
.form__field { display: grid; gap: .35rem; }
.form__field > span { font-family: var(--smallcaps); text-transform: uppercase; letter-spacing: .12em; font-size: .74rem; color: var(--gold); }
.form input, .form textarea {
  font-family: var(--body); font-size: 1rem; color: var(--ink);
  background: var(--parchment-card); border: 1px solid var(--rule); border-radius: 4px;
  padding: .7rem .8rem; width: 100%; transition: border-color .2s ease, box-shadow .2s ease;
}
.form input:focus, .form textarea:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(176,134,59,.18); }
.form textarea { resize: vertical; }
.form .btn { justify-self: start; cursor: pointer; }
.form__status { margin: 0; min-height: 1.2em; font-family: var(--display); font-style: italic; font-size: 1.05rem; }
.form__status--ok { color: var(--vert, #2f6d4a); }
.form__status--err { color: var(--oxblood); }

/* ---------- Image credits ---------- */
.credits { list-style: none; padding: 0; margin: 1.5rem 0; }
.credits li { padding: .7rem 0; border-bottom: 1px dotted var(--rule); }
.footer__legal a { color: var(--gold-pale); text-decoration-color: var(--gold); }

/* ---------- Utilities ---------- */
.lead-list { list-style: none; padding: 0; margin: 1.2rem 0; }
.lead-list li { padding-left: 1.6rem; position: relative; margin-bottom: .7rem; }
.lead-list li::before { content: "✦"; position: absolute; left: 0; color: var(--gold); font-size: .85em; top: .15em; }
.muted { color: var(--ink-faint); }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 1rem; top: 1rem; background: var(--gold); padding: .5rem 1rem; border-radius: 3px; z-index: 100; }
