.royal-marriage-atlas {
  --ink: #262c29;
  --muted: #515c52;
  --forest: #1e4138;
  --forest-dark: #17332d;
  --wine: #682c47;
  --gold: #eace9d;
  --surface: #fffdf7;
  --paper: #f5f1e9;
  --line: #d6cdbd;
  --serif: 'Cormorant Garamond', Georgia, serif;
  --shadow: 0 14px 38px #263e3310;
}
.royal-marriage-atlas *, .royal-marriage-atlas *::before, .royal-marriage-atlas *::after { box-sizing: border-box; }
.royal-marriage-atlas { margin: 0; background: var(--paper); color: var(--ink); font: 1rem/1.55 Inter, system-ui, sans-serif; }
.royal-marriage-atlas h1, .royal-marriage-atlas h2, .royal-marriage-atlas h3, .royal-marriage-atlas p { margin: 0; }
.royal-marriage-atlas button, .royal-marriage-atlas select { font: inherit; }
.royal-marriage-atlas button { cursor: pointer; }
.royal-marriage-atlas a { color: var(--forest); text-underline-offset: .18em; }
.royal-marriage-atlas :focus-visible { outline: 3px solid #8b4d33; outline-offset: 3px; }
.royal-marriage-atlas .wrap { width: min(1312px, calc(100% - clamp(28px, 7vw, 112px))); margin-inline: auto; }


.royal-marriage-atlas .hero { position: relative; isolation: isolate; overflow: hidden; color: #fff9ed; background: var(--forest-dark); border-bottom: 4px solid #af8750; }
.royal-marriage-atlas .hero-image { position: absolute; inset: 0 0 0 52%; margin: 0; z-index: -1; }
.royal-marriage-atlas .hero-image img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: center 38%; }
.royal-marriage-atlas .hero-image::after { content: ''; position: absolute; inset: 0; background: linear-gradient(90deg,#17332d, #17332db2 28%, #18322e28 71%), linear-gradient(0deg,#192e2ab8, transparent 45%); }
.royal-marriage-atlas .hero-image figcaption { position: absolute; bottom: .6rem; right: .9rem; z-index: 1; background: #1a302a; border-radius: 4px; padding: .15rem .45rem; font-size: .74rem; }
.royal-marriage-atlas .hero-image a { color: #fff7e8; }
.royal-marriage-atlas .hero-image a:focus-visible { outline-color: #ffd99f; }
.royal-marriage-atlas .hero-copy { position: relative; padding-block: 2rem 2.75rem; pointer-events: none; }


.royal-marriage-atlas .hero h1 { font: 700 clamp(3.2rem, 6vw, 5.8rem)/.97 var(--serif); letter-spacing: -.033em; margin: .55rem 0 .38rem; }
.royal-marriage-atlas .hero-copy > p:last-child { color: #f9efda; max-width: 35rem; font-size: 1.05rem; }
.royal-marriage-atlas .marriage-workspace { padding-block: 1.65rem 2.75rem; }
.royal-marriage-atlas .filters { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)) auto; gap: .85rem; align-items: end; padding: .95rem 1.1rem; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; box-shadow: var(--shadow); }
.royal-marriage-atlas .filters label { display: block; font-size: .9rem; font-weight: 650; margin-bottom: .25rem; }
.royal-marriage-atlas .filters select { width: 100%; min-height: 43px; border: 1px solid #aebeb1; border-radius: 5px; background: #fffefb; color: var(--ink); padding: .4rem 1.65rem .4rem .57rem; appearance: none; }
.royal-marriage-atlas .filters > div { position: relative; }
.royal-marriage-atlas .filters > div::after { content: ''; position: absolute; right: .7rem; bottom: 1.12rem; width: .45rem; height: .45rem; border-bottom: 2px solid var(--forest); border-right: 2px solid var(--forest); transform: rotate(45deg); pointer-events: none; }
.royal-marriage-atlas .clear { min-height: 43px; padding: .4rem .65rem; color: var(--forest); background: #e8f0e9; font-weight: 650; border: 1px solid #aebeb1; border-radius: 5px; }
.royal-marriage-atlas .clear:hover { background: #dce9de; }
.royal-marriage-atlas .result-count { margin: .75rem 0 .6rem; color: var(--muted); font-size: .92rem; font-weight: 620; }

.royal-marriage-atlas .explorer { display: grid; grid-template-columns: minmax(0,1.5fr) minmax(19rem,1fr); gap: 1.1rem; align-items: start; }
.royal-marriage-atlas .map-card, .royal-marriage-atlas .detail { min-width: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; box-shadow: var(--shadow); }
.royal-marriage-atlas .map-card { overflow: hidden; }
.royal-marriage-atlas .map-heading { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: .2rem 1.05rem; padding: .73rem 1rem .63rem; }
.royal-marriage-atlas h2 { color: var(--forest); font: 700 clamp(1.9rem, 3vw, 2.6rem)/1.05 var(--serif); }
.royal-marriage-atlas .map-heading p, .royal-marriage-atlas .map-caption { color: var(--muted); font-size: .875rem; }
.royal-marriage-atlas .map { position: relative; width: 100%; aspect-ratio: 1.62; min-height: 260px; background: #dbe6df; border-block: 1px solid #c4d2c6; }
.royal-marriage-atlas .map canvas, .royal-marriage-atlas .map-points { position: absolute; inset: 0; width: 100%; height: 100%; }
.royal-marriage-atlas .map-point {
  position: absolute; top: var(--top); left: var(--left);
  transform: translate(-50%, -50%); min-width: 40px; min-height: 32px;
  border: 1px solid #90765e; border-radius: 5px; background: #fffcf1; color: #413b2e;
  font-size: .875rem; font-weight: 700; padding: .14rem .29rem;
}
.royal-marriage-atlas .map-point[aria-pressed="true"] { z-index: 1; border-color: var(--wine); background: var(--wine); color: #fff8ec; }
.royal-marriage-atlas .map-point:hover { border-color: var(--wine); }
.royal-marriage-atlas .map-caption { padding: .6rem 1rem .75rem; }
.royal-marriage-atlas .detail { padding: .95rem clamp(.88rem, 2vw, 1.28rem) 1rem; border-top: 3px solid #ab7952; scroll-margin-top: 1rem; }
.royal-marriage-atlas .detail-meta { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin-bottom: .25rem; font-weight: 650; font-size: .89rem; }
.royal-marriage-atlas .detail-meta .purpose { background: #f0e4d8; color: #5b392c; padding: .12rem .42rem; border-radius: 4px; }
.royal-marriage-atlas .detail h2 { margin-bottom: .68rem; }
.royal-marriage-atlas .courts { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: .4rem; margin-bottom: .82rem; }
.royal-marriage-atlas .court { background: #edf1e9; border: 1px solid #d0dacd; padding: .4rem .58rem; border-radius: 4px; overflow-wrap: anywhere; }
.royal-marriage-atlas .court strong { display: block; font-size: .94rem; color: var(--forest); }
.royal-marriage-atlas .court span { color: var(--muted); font-size: .875rem; }
.royal-marriage-atlas .detail h3 { color: var(--forest); font-size: .95rem; margin: .75rem 0 .17rem; }
.royal-marriage-atlas .context { font-size: .97rem; }
.royal-marriage-atlas .profile-links { display: flex; flex-wrap: wrap; gap: .32rem; }
.royal-marriage-atlas .profile-links a { display: inline-block; border: 1px solid #b5c4b7; border-radius: 4px; padding: .17rem .42rem; font-size: .875rem; font-weight: 600; }
.royal-marriage-atlas .citations { padding-left: 1.12rem; margin: .25rem 0 0; font-size: .875rem; }
.royal-marriage-atlas .citations li { margin-block: .14rem; }
.royal-marriage-atlas .register { margin-top: 1.65rem; }
.royal-marriage-atlas .register-header { display: flex; align-items: baseline; flex-wrap: wrap; gap: .3rem .95rem; margin-bottom: .6rem; }
.royal-marriage-atlas .register-header p { color: var(--muted); font-size: .92rem; }
.royal-marriage-atlas .marriage-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: .68rem; }
.royal-marriage-atlas .marriage-card { display: block; min-height: 105px; text-align: left; padding: .6rem .7rem; background: var(--surface); border: 1px solid var(--line); border-radius: 5px; color: var(--ink); }
.royal-marriage-atlas .marriage-card:hover { border-color: #648879; }
.royal-marriage-atlas .marriage-card[aria-pressed="true"] { background: #e6eee6; border-color: #628473; }
.royal-marriage-atlas .marriage-card strong { display: block; color: var(--forest); font: 700 1.35rem/1.06 var(--serif); margin-block: .15rem .25rem; overflow-wrap: anywhere; }
.royal-marriage-atlas .marriage-card span { display: block; color: var(--muted); font-size: .875rem; }
.royal-marriage-atlas .marriage-card .year { color: #6e4727; font-weight: 700; }
.royal-marriage-atlas .no-results { margin: .5rem 0; color: var(--muted); }
.royal-marriage-atlas .marriage-reading { margin-top: 1.6rem; border-top: 1px solid var(--line); padding-top: .7rem; font-size: .9rem; }

@media (max-width: 940px) {
  .royal-marriage-atlas .explorer { grid-template-columns: minmax(0,1fr); }
  .royal-marriage-atlas .map { max-height: 440px; }
  .royal-marriage-atlas .marriage-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
}
@media (max-width: 680px) {
  .royal-marriage-atlas .hero-image { inset-inline-start: 27%; }
  .royal-marriage-atlas .hero-image::after { background: linear-gradient(90deg,#17332d,#17332dcf 57%,#17332d99); }
  .royal-marriage-atlas .hero-copy { padding-block: 1.35rem 3.15rem; }
  .royal-marriage-atlas .hero-image figcaption { max-width: calc(100% - 1.8rem); }
  .royal-marriage-atlas .filters { grid-template-columns: repeat(2,minmax(0,1fr)); padding: .7rem; gap: .55rem; }
  .royal-marriage-atlas .filters label { font-size: .875rem; }
  .royal-marriage-atlas .map-point { min-width: 29px; min-height: 28px; padding: .05rem .16rem; font-size: .75rem; }
}
@media (max-width: 360px) {
  .royal-marriage-atlas .marriage-grid { grid-template-columns: minmax(0,1fr); }
}

.royal-marriage-atlas [hidden] { display: none !important; }
.royal-marriage-atlas .hero { padding: 0; }
.royal-marriage-atlas .hero h1 { max-width: none; }
.royal-marriage-atlas .marriage-breadcrumb a { color: #fae2bc; font-size: .94rem; font-weight: 650; pointer-events: auto; }
.royal-marriage-atlas .explorer:has(.map-card[hidden]) { grid-template-columns: minmax(0,1fr); }
