
/* ────────────────────────────────────────────────────────────────
   Castle — Articles index.
   Same system as Castle Under Light: Castle navy on white paper,
   Castle blue as the single accent, Fraunces / Hanken / Jost.
   This page commits to the light world on purpose — it mocks up a
   live castle.co.uk page, so every colour is painted explicitly
   rather than inherited from the viewer's theme.
   ──────────────────────────────────────────────────────────────── */
:root{
  color-scheme:light;

  --paper:      #FFFFFF;
  --paper-2:    #F2F5F8;
  --ink:        #06243C;   /* Castle navy */
  --ink-2:      #0B3453;
  --muted:      #5C7488;
  --muted-2:    #93A5B4;
  --line:       #DEE6ED;
  --line-2:     #EDF1F5;
  --accent:     #1C70EE;   /* Castle blue */
  --accent-dk:  #0F55C4;
  --night:      #050506;
  --night-ink:  #F4F7FA;
  --night-mute: #97A3AD;

  --f-display: "Fraunces", "Juana", Georgia, serif;
  --f-body:    "Hanken Grotesk", "Avenir", "Segoe UI", system-ui, sans-serif;
  --f-util:    "Jost", "Avenir", system-ui, sans-serif;

  --gutter: clamp(20px, 5vw, 64px);
  --maxw: 1180px;
  --barh: 72px;   /* measured from the real header on load, see script */
}

*{box-sizing:border-box}
html{scroll-behavior:smooth;overflow-x:clip;background:var(--paper)}
body{
  margin:0;
  background:var(--paper);
  color:var(--ink);
  font-family:var(--f-body);
  font-weight:300;
  font-size:17px;
  line-height:1.65;
  -webkit-font-smoothing:antialiased;
}
@media (prefers-reduced-motion: reduce){ html{scroll-behavior:auto} }

.wrap{max-width:var(--maxw);margin-inline:auto;padding-inline:var(--gutter)}
img{max-width:100%;display:block}

h1,h2,h3{font-family:var(--f-display);font-weight:300;text-wrap:balance;margin:0;letter-spacing:-0.015em;color:var(--ink)}
h1{font-size:clamp(2.3rem,6.4vw,5.2rem);line-height:1.03}
h2{font-size:clamp(1.7rem,3vw,2.5rem);line-height:1.12}
h3{font-size:clamp(1.1rem,1.6vw,1.35rem);line-height:1.25}
p{margin:0}
a{color:inherit}
:focus-visible{outline:2px solid var(--accent);outline-offset:3px}

.eyebrow{
  font-family:var(--f-util);font-size:.72rem;font-weight:500;
  letter-spacing:.22em;text-transform:uppercase;color:var(--muted-2);margin:0;
}
.lede{font-size:clamp(1.02rem,1.4vw,1.18rem);color:var(--muted);max-width:52ch}

.btn{
  display:inline-flex;align-items:center;gap:.6em;
  font-family:var(--f-util);font-size:.84rem;font-weight:500;letter-spacing:.1em;text-transform:uppercase;
  padding:1em 1.9em;border:1px solid transparent;border-radius:2px;
  text-decoration:none;cursor:pointer;background:none;color:var(--ink);
  transition:background .25s ease, border-color .25s ease, color .25s ease;
}
.btn-primary{background:var(--accent);border-color:var(--accent);color:#fff}
.btn-primary:hover{background:var(--accent-dk);border-color:var(--accent-dk)}
.btn-ghost{border-color:var(--line);color:var(--ink)}
.btn-ghost:hover{border-color:var(--ink)}
.btn-light{border-color:rgba(244,247,250,.32);color:var(--night-ink)}
.btn-light:hover{border-color:var(--night-ink);background:rgba(244,247,250,.08)}

/* ── header: on an interior page the plate is white from the top ── */
header{position:fixed;top:0;left:0;right:0;z-index:60;background:var(--paper);border-bottom:1px solid var(--line)}
.bar{display:flex;align-items:center;justify-content:space-between;gap:24px;padding-block:16px}
.logo{display:block;height:100%;width:100%}
.mark{
  display:block;text-decoration:none;color:var(--ink);
  width:clamp(100px,10.5vw,128px);aspect-ratio:69.94/12.45;
}
nav ul{display:flex;gap:30px;list-style:none;margin:0;padding:0}
nav a{
  font-family:var(--f-util);font-size:.82rem;letter-spacing:.06em;text-decoration:none;
  color:var(--muted);transition:color .2s ease;
}
nav a:hover{color:var(--ink)}
nav a[aria-current="page"]{color:var(--ink)}
nav a[aria-current="page"]::after{
  content:"";display:block;height:1px;background:var(--accent);margin-top:5px;
}
.bar .btn{padding:.72em 1.3em;font-size:.74rem}
@media (max-width:820px){ nav{display:none} }

/* ── masthead ───────────────────────────────────────────────── */
.masthead{padding-top:calc(var(--barh) + clamp(48px,7vw,96px));padding-bottom:clamp(34px,4vw,54px)}
/* the title and its standfirst run the full measure — the dateline below
   is the only thing that breaks the column */
.masthead .inner{display:grid;gap:clamp(18px,2vw,26px);max-width:none}
.masthead h1{max-width:none}
.masthead .lede{max-width:none;font-size:clamp(1.05rem,1.6vw,1.32rem)}
.dateline{
  display:flex;flex-wrap:wrap;gap:10px 28px;margin-top:clamp(26px,3vw,38px);
  padding-top:20px;border-top:1px solid var(--line);
  font-family:var(--f-util);font-size:.74rem;letter-spacing:.14em;text-transform:uppercase;color:var(--muted-2);
}
.dateline b{color:var(--ink);font-weight:500;font-variant-numeric:tabular-nums}

/* ── lead story: the one piece that gets the whole width ────── */
.lead{padding-bottom:clamp(48px,6vw,84px)}
.lead-grid{display:grid;grid-template-columns:1.35fr 1fr;gap:clamp(28px,3.4vw,54px);align-items:center}
.lead-shot{
  position:relative;display:block;overflow:hidden;border-radius:4px;
  aspect-ratio:16/10;background:var(--paper-2);
  box-shadow:0 1px 2px rgba(6,36,60,.06), 0 18px 40px -22px rgba(6,36,60,.3);
}
.lead-shot img{width:100%;height:100%;object-fit:cover;transition:transform .8s cubic-bezier(.2,.7,.3,1)}
.lead-grid:hover .lead-shot img{transform:scale(1.03)}
.flag{
  position:absolute;top:14px;left:14px;z-index:1;
  font-family:var(--f-util);font-size:.62rem;font-weight:500;letter-spacing:.2em;text-transform:uppercase;
  background:var(--accent);color:#fff;padding:.5em .9em;border-radius:2px;
}
.lead-copy{display:grid;gap:15px;align-content:center}
.lead-copy h2{transition:color .3s ease}
.lead-copy p{color:var(--muted);font-size:1.02rem;max-width:44ch}
.lead-copy .more{
  font-family:var(--f-util);font-size:.78rem;letter-spacing:.14em;text-transform:uppercase;
  color:var(--accent);text-decoration:none;margin-top:4px;
}
.lead-grid:hover .lead-copy h2{color:var(--accent)}
.lead-copy a{text-decoration:none}
@media (max-width:860px){ .lead-grid{grid-template-columns:1fr} }

/* the two runners-up sit under the lead as a hairline pair */
.also{
  display:grid;grid-template-columns:1fr 1fr;gap:0 clamp(28px,3.4vw,54px);
  border-top:1px solid var(--line);margin-top:clamp(34px,4vw,54px);
}
.side{
  display:grid;grid-template-columns:136px 1fr;gap:20px;align-items:start;
  text-decoration:none;padding:26px 0;
}
.also .side + .side{border-left:1px solid var(--line);padding-left:clamp(28px,3.4vw,54px)}
.side-shot{display:block;overflow:hidden;border-radius:3px;aspect-ratio:16/10;background:var(--paper-2)}
.side-shot img{width:100%;height:100%;object-fit:cover}
.side-copy{display:grid;gap:7px}
.side h3{font-size:1.04rem;transition:color .3s ease}
.side:hover h3{color:var(--accent)}
.side .meta{
  font-family:var(--f-util);font-size:.68rem;letter-spacing:.16em;text-transform:uppercase;color:var(--muted-2);
}
@media (max-width:860px){
  .also{grid-template-columns:1fr}
  .also .side + .side{border-left:0;border-top:1px solid var(--line);padding-left:0}
}

/* ── the filter rail: sticks under the header while you scan ── */
.rail{position:sticky;top:var(--barh);z-index:50;background:var(--paper);border-block:1px solid var(--line)}
.rail-in{display:flex;align-items:center;gap:18px;padding-block:13px}
.rail-lab{
  font-family:var(--f-util);font-size:.68rem;letter-spacing:.2em;text-transform:uppercase;
  color:var(--muted-2);white-space:nowrap;flex:none;
}
/* ten categories never fit a phone, so the row scrolls horizontally and
   the fade on each edge is the affordance — JS adds .more-l / .more-r
   only when there is actually something to scroll to */
.scroller{position:relative;flex:1;min-width:0}
.chips{
  display:flex;gap:8px;overflow-x:auto;overscroll-behavior-x:contain;
  scroll-snap-type:x proximity;-webkit-overflow-scrolling:touch;
  scrollbar-width:none;padding-block:2px;
}
.chips::-webkit-scrollbar{display:none}
.scroller::before,
.scroller::after{
  content:"";position:absolute;top:0;bottom:0;width:34px;pointer-events:none;z-index:2;
  opacity:0;transition:opacity .2s ease;
}
.scroller::before{left:0;background:linear-gradient(90deg, var(--paper) 15%, rgba(255,255,255,0))}
.scroller::after{right:0;background:linear-gradient(270deg, var(--paper) 15%, rgba(255,255,255,0))}
.scroller.more-l::before,
.scroller.more-r::after{opacity:1}
.chip{
  flex:none;scroll-snap-align:start;
  font-family:var(--f-util);font-size:.76rem;letter-spacing:.06em;
  background:none;border:1px solid var(--line);border-radius:999px;color:var(--muted);
  padding:.5em 1em;min-height:34px;cursor:pointer;white-space:nowrap;
  transition:border-color .2s ease, color .2s ease, background .2s ease;
}
.chip span{color:var(--muted-2);font-variant-numeric:tabular-nums;margin-left:.35em;font-size:.92em}
.chip:hover{border-color:var(--ink);color:var(--ink)}
.chip[aria-pressed="true"]{background:var(--ink);border-color:var(--ink);color:#fff}
.chip[aria-pressed="true"] span{color:rgba(255,255,255,.6)}

/* on a phone the label gives up its width to the chips, but stays
   readable to a screen reader since it names the group */
@media (max-width:720px){
  .rail-in{gap:0}
  .rail-lab{
    position:absolute;width:1px;height:1px;overflow:hidden;
    clip-path:inset(50%);white-space:nowrap;
  }
  .chips{gap:7px}
  .chip{font-size:.78rem;padding:.55em .95em;min-height:38px}   /* thumb-sized */
  .scroller::before,.scroller::after{width:26px}
}

/* ── the grid: the card from the design, now carrying real art ── */
.feed{padding-block:clamp(40px,5vw,68px)}
.feed-head{
  display:flex;justify-content:space-between;align-items:baseline;gap:20px;flex-wrap:wrap;
  margin-bottom:clamp(24px,3vw,36px);
}
.count{font-family:var(--f-util);font-size:.74rem;letter-spacing:.14em;text-transform:uppercase;color:var(--muted-2)}
.count b{color:var(--ink);font-weight:500;font-variant-numeric:tabular-nums}
.notes{display:grid;grid-template-columns:repeat(3,1fr);gap:clamp(24px,3vw,44px)}
@media (max-width:900px){ .notes{grid-template-columns:repeat(2,1fr)} }
@media (max-width:600px){ .notes{grid-template-columns:1fr} }
.note{
  display:grid;gap:0;text-decoration:none;align-content:start;
  background:var(--paper);border-radius:4px;overflow:hidden;
  box-shadow:0 1px 2px rgba(6,36,60,.06),
             0 10px 26px -16px rgba(6,36,60,.24);
  transition:box-shadow .45s ease, transform .45s cubic-bezier(.2,.7,.3,1);
}
.note:hover{
  transform:translateY(-4px);
  box-shadow:0 2px 4px rgba(6,36,60,.07),
             0 24px 46px -20px rgba(6,36,60,.32);
}
.note-shot{
  position:relative;display:block;aspect-ratio:16/10;overflow:hidden;
  background:var(--paper-2);border-bottom:1px solid var(--line);
}
.note-shot img{width:100%;height:100%;object-fit:cover}
.note .meta{
  display:block;padding:clamp(15px,1.5vw,19px) clamp(16px,1.6vw,21px) 0;
  font-family:var(--f-util);font-size:.7rem;letter-spacing:.16em;text-transform:uppercase;color:var(--muted-2);
}
.note h3{
  font-size:1.18rem;transition:color .3s ease;
  padding:7px clamp(16px,1.6vw,21px) 0;
}
.note:hover h3{color:var(--accent)}
.note-foot{
  display:block;padding:11px clamp(16px,1.6vw,21px) clamp(18px,1.8vw,22px);
  font-family:var(--f-util);font-size:.68rem;letter-spacing:.1em;color:var(--muted-2);
}
.note[hidden]{display:none}

.feed-more{display:flex;justify-content:center;margin-top:clamp(32px,4vw,52px)}
.feed-more[hidden]{display:none}
.empty{padding:clamp(40px,6vw,80px) 0;text-align:center;color:var(--muted)}
.empty[hidden]{display:none}

/* ── the sign-off band: the one dark surface on the page ────── */
.close{background:var(--night);color:var(--night-ink)}
.close-in{
  display:grid;grid-template-columns:1.2fr auto;gap:clamp(24px,4vw,60px);
  align-items:center;padding-block:clamp(52px,7vw,92px);
}
.close h2{color:#fff;max-width:26ch;margin-top:14px}
.close p{color:var(--night-mute);margin-top:16px;max-width:46ch}
.close .eyebrow{color:rgba(244,247,250,.5)}
@media (max-width:760px){ .close-in{grid-template-columns:1fr} }

/* ── footer ─────────────────────────────────────────────────── */
footer{background:var(--night);color:var(--night-mute);border-top:1px solid #14181C}
footer .wrap{padding-block:clamp(44px,5vw,68px) 30px}
.fgrid{display:grid;grid-template-columns:1.4fr repeat(3,1fr);gap:clamp(24px,3vw,44px)}
footer .mark{color:var(--night-ink)}
footer h4{
  font-family:var(--f-util);font-size:.7rem;font-weight:500;letter-spacing:.2em;text-transform:uppercase;
  color:var(--night-ink);margin:0 0 14px;
}
footer ul{list-style:none;margin:0;padding:0;display:grid;gap:9px}
footer a{color:var(--night-mute);text-decoration:none;font-size:.92rem;transition:color .2s ease}
footer a:hover{color:var(--night-ink)}
.fnote{font-size:.92rem;display:grid;gap:6px;margin-top:18px}
.legal{
  display:flex;flex-wrap:wrap;gap:8px 26px;margin-top:clamp(34px,4vw,52px);
  padding-top:22px;border-top:1px solid #16191D;
  font-family:var(--f-util);font-size:.7rem;letter-spacing:.12em;text-transform:uppercase;color:#6C7A85;
}
@media (max-width:760px){ .fgrid{grid-template-columns:1fr 1fr} }

/* ── one motion device, reused from the parent design ───────── */
.rise{opacity:0;transform:translateY(18px);transition:opacity .7s cubic-bezier(.2,.7,.3,1), transform .7s cubic-bezier(.2,.7,.3,1)}
.rise.in{opacity:1;transform:none}
@media (prefers-reduced-motion: reduce){
  .rise{opacity:1;transform:none;transition:none}
  .lead-grid:hover .lead-shot img{transform:none}
  .note{transition:none}
  .note:hover{transform:none}
}
