/* ============================================================
   Torah Code Research Group — Institutional (v2)
   References: ias.edu (Garamond-class serif + Gill Sans, navy #03315C, one-row
   header, serif dates) and royalsociety.org (contained figure hero,
   warm-neutral panels, structured footer). Hebrew: sefaria.org
   (Frank Ruhl Libre + Heebo).
   Spacing scale: 8 · 16 · 24 · 32 · 48 · 64 · 96. Nothing else.
   ============================================================ */
:root {
  --navy: #03315C;
  --navy-deep: #02264A;
  --blue: #055299;
  --ink: #1A1A1A;
  --text: #3E3E3E;
  --muted: #6B6B6B;
  --grey: #E6E6E6;
  --panel: #F6F6F6;
  --warm: #EDE7DD;
  --white: #FFFFFF;
  --accent: #722F37;
  --serif: "EB Garamond", "Garamond", "Georgia", "Times New Roman", serif;
  --sans: "Lato", "Gill Sans", "Helvetica Neue", Arial, sans-serif;
  --serif-he: "Frank Ruhl Libre", "Frank Ruehl CLM", "Times New Roman", serif;
  --sans-he: "Heebo", "Arial Hebrew", Arial, sans-serif;
  --container: 1200px;
  --gutter: 40px;
  --s1: 8px; --s2: 16px; --s3: 24px; --s4: 32px; --s5: 48px; --s6: 64px; --s7: 96px;
}
* { box-sizing: border-box; }
html { color-scheme: light; }
body { margin: 0; background: var(--white); color: var(--text); font-family: var(--sans); font-size: 16px; line-height: 1.5; -webkit-font-smoothing: antialiased; overflow-x: clip; }
a { color: inherit; text-decoration: none; }
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
img { max-width: 100%; display: block; }
.container { max-width: var(--container); margin: 0 auto; padding-inline: var(--gutter); }
h1, h2, h3, h4 { font-family: var(--serif); font-weight: 600; line-height: 1.2; margin: 0; color: var(--ink); text-wrap: balance; }
h3, h4 { font-weight: 600; }
h2 { }
h1 { }
.label { font-family: var(--sans); font-size: 12px; font-weight: 700; letter-spacing: 1.5px; text-transform: uppercase; }

/* ---------- Header: one row, 72px (IAS). header children are siblings: logo row, date row, nav ---------- */
.header-fp { background: var(--navy); color: var(--white); position: sticky; top: 0; z-index: 50; display: grid; grid-template-columns: auto 1fr auto; align-items: center; column-gap: var(--s4); height: 72px; padding-inline: max(var(--gutter), calc((100% - 1320px) / 2 + var(--gutter))); }
.header-fp > .header-top-row { grid-row: 1; grid-column: 1; justify-self: start; }
.header-fp > .header-nav-row { grid-row: 1; grid-column: 2; justify-self: center; }
.header-fp > .header-date-row { grid-row: 1; grid-column: 3; justify-self: end; }
.header-top-row { display: flex; align-items: center; flex: 0 0 auto; }
.header-side-left, .header-side-right { display: none; }
.header-logo-center { display: block; }
.scroll-container { display: flex; align-items: center; }
.scroll-handle { display: none; }
.scroll-parchment { display: flex; align-items: center; gap: var(--s2); }
.logo-main { font-family: var(--serif); font-weight: 600; font-size: 27px; letter-spacing: .07em; line-height: 1; color: var(--white); white-space: nowrap; padding-inline-end: var(--s2); border-inline-end: 1px solid rgba(255,255,255,.4); }
.logo-the { font-family: var(--sans); font-size: 11px; font-weight: 700; letter-spacing: 2px; color: rgba(255,255,255,.85); white-space: nowrap; }
.header-date-row { display: flex; gap: var(--s2); font-family: var(--serif); font-size: 14px; color: rgba(255,255,255,.7); white-space: nowrap; padding-inline-end: 0; padding-inline-start: var(--s3); border-inline-start: 1px solid rgba(255,255,255,.25); }
/* language switch: last nav item, separated by a hairline (IAS-style utility link) */
.header-nav-row a[data-hebrew], .header-nav-row a[data-english] { margin-inline-start: var(--s1); padding-inline-start: var(--s3); border-inline-start: 1px solid rgba(255,255,255,.25); color: rgba(255,255,255,.85); }
.header-nav-row a[data-hebrew] { font-family: var(--sans-he); font-size: 14px; font-weight: 500; letter-spacing: 0; text-transform: none; }
body.rtl .header-nav-row a[data-english] { font-family: var(--sans); font-size: 12px; font-weight: 700; letter-spacing: 1.5px; text-transform: uppercase; }
.header-nav-row { display: flex; align-items: center; gap: var(--s4); height: 72px; font-family: var(--sans); font-size: 12px; font-weight: 700; letter-spacing: 1.5px; text-transform: uppercase; color: var(--white); }
.header-nav-row > a, .header-nav-row > .nav-dropdown > a { display: inline-flex; align-items: center; white-space: nowrap; height: 72px; border-bottom: 3px solid transparent; margin-bottom: -3px; }
.header-nav-row a:hover, .header-nav-row a.active, .nav-dropdown:hover > a { border-bottom-color: var(--white); }
.nav-divider { display: none; }
.nav-dropdown { position: relative; }
.nav-dropdown-trigger .dropdown-arrow { font-size: 8px; margin-inline-start: 6px; }
.nav-dropdown-menu { list-style: none; margin: 0; padding: var(--s1) 0; position: absolute; top: 100%; inset-inline-start: 0; min-width: 260px; background: var(--white); color: var(--text); border-top: 3px solid var(--accent); box-shadow: 0 12px 32px rgba(3,49,92,.18); display: none; z-index: 30; text-transform: none; letter-spacing: 0; font-weight: 400; font-size: 15px; }
.nav-dropdown:hover .nav-dropdown-menu, .nav-dropdown:focus-within .nav-dropdown-menu { display: block; }
.nav-dropdown-menu li a { display: block; padding: 10px 20px; border: 0; }
.nav-dropdown-menu li a:hover { background: var(--panel); color: var(--navy); }
.mobile-menu-toggle { display: none; }
.mobile-menu { display: none; }

/* ---------- Hero: full-bleed photo, even wash, one headline (Royal Society) ---------- */
.fp-hero { padding: 0 0 var(--s4); overflow-x: clip; }
.hub-grid { display: grid; grid-template-columns: repeat(3, 1fr); column-gap: var(--gutter); row-gap: 0; }
.hub-col { display: contents; }
.hub-center-card { grid-column: 1 / -1; grid-row: 1; order: -1; position: relative; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.7fr); align-items: center; justify-content: space-between; gap: var(--s6); min-height: 560px; padding: var(--s6) 0; margin-bottom: var(--s7); color: var(--ink); border-bottom: 1px solid var(--grey); }
.hub-center-card::before { content: ""; position: absolute; top: 0; bottom: 0; left: 50%; width: 100vw; transform: translateX(-50%); z-index: -1; background: var(--white); }
.hub-center-overlay { order: 1; display: flex; flex-direction: column; align-items: flex-start; gap: var(--s4); max-width: 560px; position: relative; z-index: 1; }
/* the plate: the Group's verified Corona matrix (Genesis 45-46, row length 95) set as a journal figure */
.hero-plate { order: 2; margin: 0; }
.hero-plate img { width: 100%; display: block; background: var(--white); border: 1px solid var(--grey); box-shadow: 0 1px 0 var(--grey), 0 24px 48px rgba(3,49,92,.10); }
.hub-center-overlay h2 { font-size: 62px; line-height: 1.04; color: var(--navy); font-weight: 500; max-width: 13ch; }
.hub-center-btn { font-family: var(--sans); font-size: 12px; font-weight: 700; letter-spacing: 1.5px; text-transform: uppercase; padding: 16px 28px; background: var(--navy); color: var(--white); }
.hub-center-card:hover .hub-center-btn { background: var(--accent); }

/* Article grid (IAS news grid): image → title → blurb, fixed rhythm */
.hub-article { display: grid; grid-row: span 3; grid-template-rows: subgrid; row-gap: 0; padding-bottom: var(--s6); }
.hub-article-thumb { width: 100%; aspect-ratio: 6 / 5; object-fit: cover; background: var(--panel); border: 1px solid var(--grey); margin-bottom: var(--s2); }
.hub-article-info { display: contents; }
.hub-article-info h3 { font-size: 22px; line-height: 1.25; margin-bottom: var(--s1); }
.hub-article-thumb[src$=".svg"] { object-fit: cover; object-position: center; background: var(--white); }
.hub-article:hover h3 { color: var(--blue); }
.hub-article-sub { display: block; color: var(--text); font-size: 15px; line-height: 1.5; }

/* ---------- Statement (warm panel) ---------- */
.quote-section { background: var(--warm); padding: var(--s7) 0; }
.featured-quote { margin: 0 auto; max-width: 760px; text-align: center; font-family: var(--serif); font-weight: 500; font-size: 26px; line-height: 1.5; color: var(--ink); }
.featured-quote p { margin: 0; }
.featured-quote p + p { margin-top: var(--s3); }
.featured-quote::before { content: ""; display: block; width: 48px; height: 3px; background: var(--accent); margin: 0 auto var(--s4); }

/* ---------- More from the Research Group + sidebar ---------- */
.fp-research-section { padding: var(--s7) 0; }
.research-layout { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: var(--s6); align-items: start; }
.section-header-fp { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: var(--s4); padding-bottom: var(--s2); border-bottom: 2px solid var(--navy); }
.section-header-fp h2 { font-family: var(--sans); font-size: 12px; font-weight: 700; letter-spacing: 1.5px; text-transform: uppercase; color: var(--navy); }
.see-all-link { font-family: var(--sans); font-size: 12px; font-weight: 700; letter-spacing: 1.5px; text-transform: uppercase; color: var(--blue); }
.see-all-link:hover { color: var(--accent); }
.articles-grid-fp { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--gutter); }
.article-featured-fp a, .article-mini-fp a { display: grid; row-gap: var(--s2); align-content: start; }
.article-featured-fp .featured-image img, .mini-image img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; }
.article-featured-fp h3, .mini-content h4 { font-size: 28px; line-height: 1.2; }
.article-featured-fp:hover h3, .article-mini-fp:hover h4 { color: var(--blue); }
.article-featured-fp p, .mini-content p { color: var(--text); font-size: 16px; margin: 0; }
.mini-content { display: grid; row-gap: var(--s2); }
.article-meta-fp { display: flex; flex-wrap: wrap; gap: var(--s1) var(--s2); align-items: baseline; font-family: var(--serif); font-size: 15px; color: var(--accent); }
.article-meta-fp .author { font-family: var(--sans); font-size: 12px; font-weight: 700; letter-spacing: 1.5px; text-transform: uppercase; color: var(--navy); }
.article-meta-fp .separator { color: var(--grey); }
.article-meta-fp .stats { color: #C4C4C4; font-family: var(--sans); font-size: 12px; }
.research-sidebar-fp { display: grid; row-gap: var(--s3); }
.sidebar-box { background: var(--panel); padding: var(--s4); border-top: 3px solid var(--navy); display: grid; row-gap: var(--s2); }
.sidebar-box h4 { font-size: 24px; }
.sidebar-box p { margin: 0; font-size: 15px; color: var(--text); }
.sidebar-form { display: grid; row-gap: var(--s1); }
.sidebar-form input, .sidebar-form textarea { width: 100%; font: inherit; font-size: 15px; padding: 12px 14px; border: 1px solid #CFCFCF; background: var(--white); color: var(--ink); border-radius: 0; }
.sidebar-form textarea { border: 1px solid #CFCFCF !important; border-radius: 0 !important; font-family: inherit; }
.sidebar-form input:focus, .sidebar-form textarea:focus { border-color: var(--navy); outline: none; box-shadow: 0 0 0 2px rgba(5,82,153,.15); }
.sidebar-form button { font-family: var(--sans); font-size: 12px; font-weight: 700; letter-spacing: 1.5px; text-transform: uppercase; padding: 14px 16px; background: var(--navy); color: var(--white); border: 0; cursor: pointer; margin-top: var(--s1); }
.sidebar-form button:hover { background: var(--accent); }

/* ---------- Footer: institutional, four columns + legal bar (IAS / Royal Society) ---------- */
.fp-footer { background: var(--navy); color: var(--white); padding: var(--s6) 0 var(--s4); }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1.2fr; gap: var(--s6); padding-bottom: var(--s5); border-bottom: 1px solid rgba(255,255,255,.2); }
.footer-brand { display: grid; row-gap: var(--s2); align-content: start; }
.footer-brand .logo-main { font-size: 24px; border: 0; padding: 0; }
.footer-brand .logo-the { display: block; }
.footer-brand p { margin: 0; font-size: 14px; line-height: 1.6; color: rgba(255,255,255,.75); max-width: 34ch; }
.footer-col { display: grid; align-content: start; }
.footer-col > p { margin: 0; }
.footer-col h4 { font-family: var(--sans); font-size: 12px; font-weight: 700; letter-spacing: 1.5px; text-transform: uppercase; color: rgba(255,255,255,.6); margin-bottom: var(--s2); }
.footer-col ul { list-style: none; margin: 0; padding: 0; display: grid; row-gap: 10px; }
.footer-col a { font-size: 15px; color: rgba(255,255,255,.92); }
.footer-col a:hover { text-decoration: underline; text-underline-offset: 4px; }
.footer-social-row { display: flex; gap: var(--s2); margin-top: var(--s2); }
.footer-social-row svg { width: 20px; height: 20px; fill: rgba(255,255,255,.85); }
.footer-social-row a:hover svg { fill: var(--white); }
.footer-form { display: grid; row-gap: var(--s1); margin-top: var(--s2); }
.footer-form input { font: inherit; font-size: 14px; padding: 12px 14px; border: 1px solid rgba(255,255,255,.35); background: transparent; color: var(--white); border-radius: 0; min-width: 0; }
.footer-form input::placeholder { color: rgba(255,255,255,.55); }
.footer-form button { font-family: var(--sans); font-size: 12px; font-weight: 700; letter-spacing: 1.5px; text-transform: uppercase; padding: 12px 18px; background: var(--white); color: var(--navy); border: 0; cursor: pointer; }
.footer-form button:hover { background: var(--accent); color: var(--white); }
.footer-bottom { display: flex; justify-content: space-between; flex-wrap: wrap; gap: var(--s2); padding-top: var(--s3); font-size: 13px; color: rgba(255,255,255,.7); }
.footer-bottom p { margin: 0; }
.footer-legal { display: flex; gap: var(--s3); }
.footer-legal a:hover { color: var(--white); }
.footer-version { font-family: var(--serif); font-variant-numeric: tabular-nums; color: rgba(255,255,255,.55); padding-inline-start: var(--s3); border-inline-start: 1px solid rgba(255,255,255,.25); direction: ltr; unicode-bidi: isolate; }
.back-to-top { display: none; }

/* ---------- Hebrew (Sefaria: Frank Ruhl Libre + Heebo) ---------- */
body.rtl { font-family: var(--sans-he); }
body.rtl h1, body.rtl h2, body.rtl h3, body.rtl h4, body.rtl .featured-quote, body.rtl .logo-main, body.rtl .article-meta-fp, body.rtl .header-date-row { font-family: var(--serif-he); font-variation-settings: normal; letter-spacing: 0; }
body.rtl h1, body.rtl h2 { font-weight: 500; }
body.rtl h3, body.rtl h4 { font-weight: 700; }
body.rtl .label, body.rtl .header-nav-row, body.rtl .footer-col h4, body.rtl .see-all-link, body.rtl .section-header-fp h2, body.rtl .hub-center-btn, body.rtl .sidebar-form button, body.rtl .footer-form button, body.rtl .article-meta-fp .author, body.rtl .logo-the { font-family: var(--sans-he); letter-spacing: 0; }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .header-date-row { display: none; }
  .hub-grid { grid-template-columns: repeat(2, 1fr); }
  .hub-center-card { grid-template-columns: 1fr; gap: var(--s5); min-height: 0; }
  .hero-plate { max-width: 720px; }
  .hub-center-overlay h2 { font-size: 50px; }
  .research-layout { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 720px) {
  :root { --gutter: 20px; }
  .logo-main { font-size: 20px; }
  .logo-the { display: none; }
  .header-fp { display: flex; flex-wrap: wrap; height: auto; min-height: 64px; padding-block: 0; }
  .header-nav-row a[data-hebrew], .header-nav-row a[data-english] { margin: 0; padding-inline-start: 0; border: 0; }
  .header-top-row { height: 64px; }
  .header-nav-row { display: none; }
  .mobile-menu { flex-basis: 100%; }
  .mobile-menu-toggle { display: flex; flex-direction: column; gap: 5px; position: absolute; top: 20px; inset-inline-end: 16px; background: none; border: 0; padding: 8px; cursor: pointer; }
  .mobile-menu-toggle span { width: 24px; height: 2px; background: var(--white); }
  .mobile-menu.open { display: block; background: var(--navy-deep); margin-inline: calc(-1 * var(--gutter)); }
  .mobile-menu ul { list-style: none; margin: 0; padding: var(--s1) var(--gutter) var(--s2); }
  .mobile-menu li a { display: block; padding: 12px 0; font-size: 14px; font-weight: 700; letter-spacing: 1.5px; text-transform: uppercase; color: var(--white); border-bottom: 1px solid rgba(255,255,255,.12); }
  .mobile-menu .mobile-dropdown { display: flex; flex-wrap: wrap; align-items: center; }
  .mobile-dropdown-toggle { background: none; border: 0; color: var(--white); padding: 8px; }
  .mobile-dropdown-menu { flex-basis: 100%; padding-inline-start: var(--s2) !important; display: none; }
  .mobile-dropdown-menu li a { text-transform: none; letter-spacing: 0; font-weight: 400; }
  .fp-hero { padding-bottom: var(--s5); }
  /* hero: heading on top, the plate below it at full width */
  .hub-center-card { min-height: 0; padding: var(--s5) 0; margin-bottom: var(--s5); gap: var(--s4); }
  .hub-center-overlay { gap: var(--s3); }
  .hub-center-overlay h2 { font-size: 40px; }
  .hero-plate { max-width: none; }
  /* article list: thumbnail beside the text instead of a stack of full-width images */
  .hub-grid { grid-template-columns: 1fr; row-gap: 0; }
  .hub-article { grid-row: auto; grid-template-rows: none; grid-template-columns: 104px minmax(0, 1fr); column-gap: var(--s3); align-items: start; padding: var(--s3) 0; border-top: 1px solid var(--grey); }
  .hub-article:last-child { border-bottom: 1px solid var(--grey); }
  .hub-article-thumb { aspect-ratio: 1; margin: 0; }
  .hub-article-info { display: block; }
  .hub-article-info h3 { font-size: 20px; margin-bottom: 6px; }
  .hub-article-sub { font-size: 14px; }
  .quote-section, .fp-research-section { padding: var(--s5) 0; }
  .featured-quote { font-size: 19px; line-height: 1.55; text-align: start; }
  .featured-quote::before { margin-inline: 0; }
  .articles-grid-fp { grid-template-columns: 1fr; row-gap: 0; }
  .article-featured-fp a { row-gap: var(--s2); padding-bottom: var(--s3); }
  .article-featured-fp h3 { font-size: 24px; }
  .article-mini-fp a { display: grid; grid-template-columns: 104px minmax(0, 1fr); column-gap: var(--s3); align-items: start; padding: var(--s3) 0; border-top: 1px solid var(--grey); }
  .mini-image img { aspect-ratio: 1; }
  .mini-content { row-gap: 6px; }
  .mini-content h4 { font-size: 20px; }
  .mini-content p { font-size: 14px; }
  .research-layout { gap: var(--s5); }
  .sidebar-box { padding: var(--s3); }
  .footer-grid { grid-template-columns: 1fr; gap: var(--s4); }
  .footer-bottom { flex-direction: column; }
}
@media (prefers-reduced-motion: no-preference) {
  .hub-article h3, .hub-center-btn, .sidebar-form button, .footer-form button, .header-nav-row a { transition: all .18s ease; }
}


/* ============================================================
   Inner pages — same system as the home page.
   Legacy variables used by inline styles in the source content,
   mapped onto the new tokens so the content needs no edits.
   ============================================================ */
:root {
  --accent-burgundy: var(--accent);
  --accent-primary: var(--navy);
  --border-color: var(--grey);
  --secondary-text: var(--muted);
  --primary-text: var(--text);
  --secondary-bg: var(--panel);
  --font-heading: var(--serif);
  --font-body: var(--sans);
}
main { display: block; }

/* ---------- Page header band (IAS: quiet, serif title on white, rule below) ---------- */
.page-header { padding: var(--s6) 0 var(--s4); border-bottom: 1px solid var(--grey); }
.page-header h1 { font-size: 48px; line-height: 1.1; max-width: 22ch; }
.page-header p { margin: var(--s2) 0 0; font-size: 18px; color: var(--muted); max-width: 64ch; }
.breadcrumb { padding: var(--s2) 0; }
.breadcrumb-list { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: var(--s1); font-size: 13px; color: var(--muted); }
.breadcrumb-list li + li::before { content: "/"; margin-inline-end: var(--s1); color: var(--grey); }
.breadcrumb-list a { color: var(--blue); }
.breadcrumb-list a:hover { text-decoration: underline; text-underline-offset: 3px; }

/* ---------- Article body: 700px measure, 18px, generous leading ---------- */
.article-content { max-width: 760px; margin: 0 auto; padding: var(--s4) var(--gutter) var(--s7); font-size: 18px; line-height: 1.65; color: var(--text); }
.article-content .article-meta { display: flex; flex-wrap: wrap; gap: var(--s1) var(--s3); font-family: var(--sans); font-size: 12px; font-weight: 700; letter-spacing: 1.5px; text-transform: uppercase; color: var(--muted); padding-bottom: var(--s3); margin-bottom: var(--s4); border-bottom: 1px solid var(--grey); }
.article-content h2 { font-size: 32px; margin: var(--s6) 0 var(--s3); line-height: 1.2; }
.article-content h3 { font-size: 24px; margin: var(--s5) 0 var(--s2); line-height: 1.25; }
.article-content h4 { font-size: 20px; margin: var(--s4) 0 var(--s2); }
.article-content p { margin: 0 0 var(--s3); }
.article-content ul, .article-content ol { margin: 0 0 var(--s3); padding-inline-start: 1.4em; }
.article-content li { margin-bottom: var(--s1); }
.article-content a { color: var(--blue); text-decoration: underline; text-decoration-color: rgba(5,82,153,.35); text-underline-offset: 3px; }
.article-content a:hover { text-decoration-color: var(--blue); }
.article-content blockquote { margin: var(--s4) 0; padding: var(--s3) var(--s4); border-inline-start: 3px solid var(--accent); background: var(--panel); font-family: var(--serif); font-size: 20px; line-height: 1.5; color: var(--ink); }
.article-content blockquote p:last-child { margin-bottom: 0; }
.article-content img { margin: var(--s4) auto; border: 1px solid var(--grey); }
.article-content table { border-collapse: collapse; width: 100%; font-size: 16px; margin: var(--s4) 0; }
.article-content th, .article-content td { border-bottom: 1px solid var(--grey); padding: 10px 12px; text-align: start; vertical-align: top; }
.article-content th { font-family: var(--sans); font-size: 12px; font-weight: 700; letter-spacing: 1.5px; text-transform: uppercase; color: var(--navy); }
.article-content hr { border: 0; border-top: 1px solid var(--grey); margin: var(--s5) 0; }
.article-content sup { font-size: .7em; line-height: 0; }
.article-content code, .article-content pre { font-family: "SFMono-Regular", Menlo, Consolas, monospace; font-size: .9em; }
.article-content strong { color: var(--ink); }
.article-credits { font-size: 15px; color: var(--muted); font-style: italic; }
.article-footnotes, .gans-footnotes { margin-top: var(--s6); padding-top: var(--s4); border-top: 1px solid var(--grey); font-size: 15px; line-height: 1.55; color: var(--muted); }
.article-footnotes h3, .gans-footnotes h3 { font-family: var(--sans); font-size: 12px; font-weight: 700; letter-spacing: 1.5px; text-transform: uppercase; color: var(--navy); margin: 0 0 var(--s2); }
.gans-download { display: flex; align-items: center; gap: var(--s3); flex-wrap: wrap; background: var(--panel); border: 0; border-inline-start: 3px solid var(--navy); border-radius: 0; padding: var(--s3) var(--s4); margin: 0 0 var(--s5); }
.gans-download a.btn-dl { background: var(--navy); color: var(--white); padding: 12px 20px; border-radius: 0; text-decoration: none; font-family: var(--sans); font-size: 12px; font-weight: 700; letter-spacing: 1.5px; text-transform: uppercase; }
.gans-download a.btn-dl:hover { background: var(--accent); }
.gans-download p { margin: 0; font-size: 15px; color: var(--muted); }
.gans-note { background: var(--panel); border-inline-start: 3px solid var(--accent); padding: var(--s2) var(--s3); font-size: 16px; color: var(--text); margin-bottom: var(--s4); }

/* Buttons (shared) */
.btn { display: inline-block; font-family: var(--sans); font-size: 12px; font-weight: 700; letter-spacing: 1.5px; text-transform: uppercase; padding: 14px 24px; text-decoration: none !important; border: 1px solid var(--navy); color: var(--navy); background: transparent; }
.btn:hover { background: var(--navy); color: var(--white); }
.btn-primary, .article-content a.btn-primary { background: var(--navy); color: var(--white); }
.btn-primary:hover { background: var(--accent); border-color: var(--accent); }
.btn-outline { border-color: var(--navy); }

/* Prev / next */
.article-navigation { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s3); margin-top: var(--s7); padding-top: var(--s4); border-top: 1px solid var(--grey); }
.article-nav-link { display: grid; row-gap: 6px; text-decoration: none !important; }
.article-nav-link.next { text-align: end; }
.article-nav-label { font-family: var(--sans); font-size: 12px; font-weight: 700; letter-spacing: 1.5px; text-transform: uppercase; color: var(--muted); }
.article-nav-title { font-family: var(--serif); font-size: 20px; color: var(--navy); }
.article-nav-link:hover .article-nav-title { color: var(--blue); }

/* Findings lists (inline-styled in source; only rhythm added) */
.research-list ul { display: grid; }
.research-list li { line-height: 1.5; }
.research-list li a:hover strong { text-decoration: underline; text-underline-offset: 3px; }

/* ---------- Sections used by hub / books / team / videos ---------- */
section.about, section.publications, section.research, section.featured-research, section.team-section, section.featured-video, section.videos, section.documentaries, section.lectures, section.codes-intro, section.codes-nav-tiles, section.related-articles, section.talks { padding: var(--s7) 0; }
.bg-light { background: var(--panel); }
.section-header { max-width: 760px; margin-bottom: var(--s5); }
.section-header .label { display: block; font-family: var(--sans); font-size: 12px; font-weight: 700; letter-spacing: 1.5px; text-transform: uppercase; color: var(--accent); margin-bottom: var(--s2); }
.section-header h2 { font-size: 36px; line-height: 1.15; }
.section-header p { font-size: 18px; line-height: 1.6; color: var(--text); margin: var(--s3) 0 0; }
.section-divider { width: 48px; height: 3px; background: var(--accent); margin: var(--s3) 0 0; }
.section-header p + .section-divider, .section-divider + p { margin-top: var(--s3); }

/* Cards grid (research-card) */
.research-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: var(--s4); }
.research-card { background: var(--white); border-top: 3px solid var(--navy); padding: var(--s4); display: grid; row-gap: var(--s2); align-content: start; }
.bg-light .research-card, section.research .research-card { box-shadow: 0 1px 0 var(--grey), 0 0 0 1px var(--grey); }
.research-card .number { font-family: var(--serif); font-size: 28px; color: var(--accent); line-height: 1; }
.research-card h3 { font-size: 22px; }
.research-card p { margin: 0; font-size: 15px; color: var(--text); }
.research-card .link { font-family: var(--sans); font-size: 12px; font-weight: 700; letter-spacing: 1.5px; text-transform: uppercase; color: var(--blue); text-decoration: none !important; }
.research-card .link:hover { color: var(--accent); }
.related-articles .research-grid { grid-template-columns: repeat(3, 1fr); }

/* Publication rows (books, videos lectures) */
.publications-list { display: grid; }
.publication-item { display: grid; grid-template-columns: 64px 1fr auto; gap: var(--s4); align-items: start; padding: var(--s4) 0; border-top: 1px solid var(--grey); }
.publication-item:last-child { border-bottom: 1px solid var(--grey); }
.pub-year { font-family: var(--serif); font-size: 28px; color: var(--accent); line-height: 1; padding-top: 4px; }
.pub-content h3 { font-size: 24px; margin-bottom: var(--s1); }
.pub-content p { margin: 0 0 var(--s2); font-size: 16px; }
.pub-meta { display: flex; flex-wrap: wrap; gap: var(--s3); font-family: var(--sans); font-size: 12px; font-weight: 700; letter-spacing: 1.5px; text-transform: uppercase; color: var(--muted); }
.publication-item .btn { align-self: center; }

/* Books: hub inline link */
.hub-inline-link { display: grid; grid-template-columns: 1fr auto; gap: var(--s1) var(--s4); align-items: center; margin-top: var(--s4); padding: var(--s3) var(--s4); background: var(--white); border: 1px solid var(--grey); border-inline-start: 3px solid var(--navy); text-decoration: none; }
.hub-inline-title { font-family: var(--serif); font-size: 22px; color: var(--ink); grid-column: 1; }
.hub-inline-desc { font-size: 15px; color: var(--muted); grid-column: 1; }
.hub-inline-btn { grid-column: 2; grid-row: 1 / 3; font-family: var(--sans); font-size: 12px; font-weight: 700; letter-spacing: 1.5px; text-transform: uppercase; color: var(--blue); }
.hub-inline-link:hover .hub-inline-title { color: var(--blue); }

/* Hub page */
.codes-intro-content { max-width: 760px; font-size: 18px; line-height: 1.65; }
.codes-intro-content h2 { font-size: 36px; margin-bottom: var(--s3); }
.codes-intro-content p { margin: 0 0 var(--s3); }
.tiles-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--s3); }
.tile-item { display: flex; align-items: flex-end; min-height: 150px; padding: var(--s3); background: var(--white); border: 1px solid var(--grey); border-top: 3px solid var(--navy); text-decoration: none; }
.tile-item:hover { border-top-color: var(--accent); }
.tile-item:hover .tile-text { color: var(--blue); }
.tile-text { font-family: var(--serif); font-size: 22px; color: var(--ink); }
.tile-disabled { opacity: .45; pointer-events: none; }

/* Team / videos: image + text split */
.about-grid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: var(--s6); align-items: center; }
.about-image img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; border: 1px solid var(--grey); }
.about-content { font-size: 17px; line-height: 1.65; }
.about-content p { margin: 0 0 var(--s3); }
.about-content h3 { font-size: 28px; margin: var(--s2) 0; }
.about-content .label { display: block; font-family: var(--sans); font-size: 12px; font-weight: 700; letter-spacing: 1.5px; text-transform: uppercase; color: var(--accent); }
.about-content ul { padding-inline-start: 1.2em; margin: 0 0 var(--s3); }
.team-section .section-header { max-width: none; }
.team-section ul { font-size: 17px; line-height: 1.65; }
.team-section li strong { font-family: var(--serif); font-size: 22px; color: var(--ink); font-weight: 500; display: inline-block; margin-bottom: 4px; }
.team-section li a { color: var(--blue); }
.team-section > .container > p { font-size: 15px; }
/* Team quote (distinct from the home statement panel) */
.team-section + .quote-section { background: var(--navy); color: var(--white); }
.team-section + .quote-section .quote-content { max-width: 760px; margin: 0 auto; text-align: center; }
.team-section + .quote-section .quote-mark { font-family: var(--serif); font-size: 72px; line-height: .6; color: var(--accent); }
.team-section + .quote-section blockquote { margin: var(--s3) 0; font-family: var(--serif); font-size: 26px; line-height: 1.45; color: var(--white); }
.team-section + .quote-section .quote-author { font-family: var(--sans); font-size: 12px; font-weight: 700; letter-spacing: 1.5px; text-transform: uppercase; color: rgba(255,255,255,.7); }

/* Videos */
.video-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: var(--s4); }
.video-card { background: var(--white); border: 1px solid var(--grey); cursor: pointer; display: grid; }
.video-thumbnail { position: relative; aspect-ratio: 16 / 9; overflow: hidden; background: var(--navy); }
.video-thumbnail img { width: 100%; height: 100%; object-fit: cover; }
.play-button { position: absolute; inset: 0; margin: auto; width: 64px; height: 64px; border-radius: 50%; background: rgba(255,255,255,.92); display: grid; place-items: center; }
.play-button svg { width: 22px; height: 22px; fill: var(--navy); margin-inline-start: 3px; }
.video-card:hover .play-button { background: var(--accent); }
.video-card:hover .play-button svg { fill: var(--white); }
.video-info { padding: var(--s3); display: grid; row-gap: var(--s1); }
.video-info .episode { font-family: var(--sans); font-size: 12px; font-weight: 700; letter-spacing: 1.5px; text-transform: uppercase; color: var(--accent); }
.video-info h3 { font-size: 22px; }
.video-info p { margin: 0; font-size: 15px; color: var(--text); }
.video-meta { display: flex; flex-wrap: wrap; gap: var(--s3); font-size: 13px; color: var(--muted); margin-top: var(--s1); }
.video-modal { display: none; position: fixed; inset: 0; background: rgba(3,49,92,.92); z-index: 100; align-items: center; justify-content: center; padding: var(--s4); }
.video-modal.active { display: flex; }
.video-modal-content { position: relative; width: min(1100px, 100%); aspect-ratio: 16 / 9; background: #000; }
.video-modal-content iframe { width: 100%; height: 100%; border: 0; }
.video-modal-close { position: absolute; top: -44px; inset-inline-end: 0; background: none; border: 0; color: var(--white); font-size: 32px; cursor: pointer; }

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
  .tiles-grid { grid-template-columns: repeat(2, 1fr); }
  .related-articles .research-grid { grid-template-columns: 1fr; }
  .about-grid { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .page-header { padding: var(--s5) 0 var(--s3); }
  .page-header h1 { font-size: 34px; }
  .article-content { font-size: 17px; padding-top: var(--s3); padding-bottom: var(--s6); }
  .article-content h2 { font-size: 26px; }
  .article-content h3 { font-size: 21px; }
  .article-navigation { grid-template-columns: 1fr; }
  .article-nav-link.next { text-align: start; }
  section.about, section.publications, section.research, section.featured-research, section.team-section, section.featured-video, section.videos, section.documentaries, section.lectures, section.codes-intro, section.codes-nav-tiles, section.related-articles { padding: var(--s6) 0; }
  .section-header h2 { font-size: 28px; }
  .publication-item { grid-template-columns: 1fr; gap: var(--s2); }
  .pub-year { display: none; }
  section.about, section.publications, section.research, section.featured-research, section.team-section, section.featured-video, section.videos, section.documentaries, section.lectures, section.codes-intro, section.codes-nav-tiles, section.related-articles, section.talks { padding: var(--s5) 0; }
  .codes-intro-content { font-size: 17px; }
  .codes-intro-content h2, .section-header h2 { font-size: 28px; }
  .tiles-grid { grid-template-columns: 1fr; gap: var(--s1); }
  .tile-item { min-height: 0; padding: 14px var(--s3); }
  .tile-text { font-size: 19px; }
  .hub-inline-link { grid-template-columns: 1fr; }
  .hub-inline-btn { grid-column: 1; grid-row: auto; }
}

/* Article pages: title band and breadcrumb align with the 760px reading column */
.page-article .page-header .container, .page-article .breadcrumb .container { max-width: 760px; }
.page-header h1 { max-width: 30ch; }
.research-list strong { font-family: var(--serif); font-weight: 500; font-size: 20px; line-height: 1.3; }
.research-list li > a { display: block; }

/* ---------- Papers timeline (findings) ---------- */
.timeline { list-style: none; margin: 0 0 var(--s5); padding: 0; position: relative; }
.timeline::before { content: ""; position: absolute; top: 8px; bottom: 8px; inset-inline-start: 72px; width: 1px; background: var(--grey); }
.tl-item { display: grid; grid-template-columns: 56px 1fr; column-gap: var(--s4); padding: var(--s3) 0; border-bottom: 1px solid var(--grey); position: relative; }
.tl-item:last-child { border-bottom: 0; }
.tl-year { font-family: var(--serif); font-size: 20px; color: var(--accent); line-height: 1.2; text-align: end; }
.tl-year::after { content: ""; position: absolute; inset-inline-start: 68px; top: calc(var(--s3) + 8px); width: 9px; height: 9px; border-radius: 50%; background: var(--accent); }
.tl-year-repeat { visibility: hidden; }
.tl-year-repeat::after { visibility: visible; background: var(--white); border: 2px solid var(--accent); width: 7px; height: 7px; }
.tl-undated .tl-year { color: var(--muted); }
.tl-undated .tl-year::after { background: var(--grey); }
.tl-body { font-size: 16px; line-height: 1.5; }
.tl-body strong { font-family: var(--serif); font-weight: 500; font-size: 20px; line-height: 1.3; }
.tl-body > a { display: block; }

/* ---------- Latest findings ---------- */
.finding-featured { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--s5); align-items: center; margin: var(--s5) 0 var(--s6); padding: var(--s4); background: var(--panel); border-top: 3px solid var(--navy); }
.finding-featured-media img { width: 100%; aspect-ratio: 6 / 5; object-fit: cover; object-position: top; border: 1px solid var(--grey); margin: 0; background: var(--white); }
.finding-featured-text { display: grid; row-gap: var(--s2); justify-items: start; }
.finding-featured-text .label { color: var(--accent); }
.finding-featured-text h2 { margin: 0; font-size: 30px; }
.finding-featured-text p { margin: 0; font-size: 15px; color: var(--muted); }
.finding-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s3); margin-bottom: var(--s5); }
.finding-card { display: grid; row-gap: var(--s2); align-content: start; padding: var(--s3) 0 0; border-top: 1px solid var(--navy); }
.finding-card h3 { margin: 0; font-size: 22px; }
.finding-words { margin: 0 !important; font-size: 15px !important; line-height: 1.6 !important; color: var(--text); }
.finding-status { margin: 0 !important; font-family: var(--sans); font-size: 12px; font-weight: 700; letter-spacing: 1.5px; text-transform: uppercase; color: var(--muted); }
.finding-status::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--grey); margin-inline-end: 8px; vertical-align: 1px; }
.page-article .article-content:has(.finding-grid) { max-width: 1000px; }

/* ---------- Classic home variant (original 3 | centre | 3 grid, set to the IAS system) ---------- */
.home-classic .fp-hero { padding: var(--s6) 0 var(--s7); }
.home-classic .fp-hero .container { max-width: 1320px; }
.home-classic .hub-grid { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1.4fr) minmax(0, 1.1fr); column-gap: var(--s6); align-items: stretch; row-gap: 0; }
.home-classic .hub-col-left, .home-classic .hub-col-right { display: grid; grid-template-rows: repeat(3, minmax(0, 1fr)); align-items: stretch; }
.home-classic .hub-col-center { display: block; }
/* side columns: a reading list — square thumbnail, serif title, one-line-ish blurb, hairline between items */
.home-classic .hub-article { display: grid; grid-template-columns: 144px minmax(0, 1fr); grid-template-rows: auto 1fr; column-gap: var(--s3); align-items: start; padding: var(--s3) 0; row-gap: 0; }
.home-classic .hub-article + .hub-article { border-top: 1px solid var(--grey); }
.home-classic .hub-article:first-child { padding-top: 0; }
.home-classic .hub-article:last-child { padding-bottom: 0; }
.home-classic .hub-article-thumb { aspect-ratio: 4 / 3; margin: 0; grid-row: 1 / 3; }
.home-classic .hub-article-thumb[src*="codes-bengurion"], .home-classic .hub-article-thumb[src*="rabin-code"] { object-fit: contain; background: var(--white); padding: 4px; }
.home-classic .hub-article-info { display: contents; }
.home-classic .hub-article-info h3 { font-size: 21px; line-height: 1.2; margin: 0 0 6px; }
.home-classic .hub-article-sub { font-size: 14.5px; line-height: 1.5; }
/* centre: the matrix as a framed print on a warm panel, title and button beneath it */
.home-classic .hub-center-card { grid-column: auto; grid-row: auto; order: 0; display: flex; flex-direction: column; align-items: stretch; justify-content: flex-start; gap: 0; min-height: 0; height: 100%; padding: var(--s4); margin: 0; color: var(--ink); background: var(--warm); border: 1px solid #E2DBCE; }
.home-classic .hub-center-card::before { display: none; }
.home-classic .hub-center-card img { order: 0; width: 100%; aspect-ratio: auto; object-fit: contain; background: var(--white); padding: var(--s2); border: 1px solid var(--grey); box-shadow: 0 12px 32px rgba(3,49,92,.10); }
.home-classic .hub-center-overlay { order: 1; margin-top: auto; padding-top: var(--s4); flex-direction: column; align-items: center; text-align: center; gap: var(--s3); max-width: none; }
.home-classic .hub-center-overlay::before { content: ""; display: block; width: 40px; height: 2px; background: var(--accent); }
.home-classic .hub-center-overlay h2 { font-size: 34px; line-height: 1.1; color: var(--navy); font-weight: 500; }
.home-classic .hub-center-btn { background: var(--navy); color: var(--white); padding: 14px 26px; }
.home-classic .hub-center-card:hover .hub-center-btn { background: var(--accent); }
.home-classic .hub-center-card:hover h2 { color: var(--blue); }
@media (max-width: 1100px) {
  .home-classic .hub-grid { grid-template-columns: 1fr 1fr; column-gap: var(--s5); }
  .home-classic .hub-col-center { grid-column: 1 / -1; order: -1; margin-bottom: var(--s5); }
  .home-classic .hub-col-left, .home-classic .hub-col-right { grid-template-rows: none; }
}
@media (max-width: 720px) {
  .finding-featured { grid-template-columns: 1fr; }
  .finding-grid { grid-template-columns: 1fr; }
  .tl-item { grid-template-columns: 44px 1fr; column-gap: var(--s2); }
  .timeline::before { inset-inline-start: 52px; } .tl-year::after { inset-inline-start: 48px; } .tl-year { font-size: 16px; }
  .home-classic .hub-grid { grid-template-columns: 1fr; }
}

/* ---------- Latest Findings: sample matrices (the Group's own images, cropped only) ---------- */
.page-article .article-content:has(.finding-grid-samples) { max-width: 1160px; }
.finding-grid-samples { grid-template-columns: minmax(0, 1fr); gap: var(--s5); }
.finding-grid-samples .finding-card { row-gap: var(--s3); }
.finding-grid-samples .finding-card h3 { font-size: 28px; }
.finding-grid-samples .finding-words { max-width: 78ch; }
.samples { display: grid; row-gap: var(--s4); margin-top: var(--s1); }
.sample { margin: 0; display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); column-gap: var(--s4); row-gap: var(--s3); align-items: start; padding: var(--s3); background: var(--panel); border: 1px solid var(--grey); }
.sample-matrix { background: var(--white); border: 1px solid var(--grey); padding: 10px; display: flex; justify-content: center; }
.sample-matrix a { display: block; border: 0; }
.article-content .sample-matrix img { display: block; max-width: 100%; height: auto; margin: 0; border: 0; }
.sample-side { display: grid; row-gap: var(--s3); align-content: start; }
.sample-photo { display: grid; row-gap: 6px; }
.article-content .sample-photo img { display: block; width: auto; max-width: min(100%, 300px); max-height: 300px; height: auto; margin: 0; border: 1px solid var(--grey); background: var(--white); }
.article-content .sample-photo-waze img, .article-content .sample-photo-pager img { max-width: 220px; padding: 14px; }
.sample-credit { font-family: var(--sans); font-size: 11px; line-height: 1.45; color: var(--muted); max-width: 300px; text-align: left; }
.sample-credit a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
.sample-lists { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: var(--s2); }
.article-content ul.sample-terms { list-style: none; margin: 0; padding: 12px 14px; background: var(--white); border: 1px solid var(--grey); font-size: 15px; line-height: 1.55; color: var(--ink); }
.article-content ul.sample-terms li { margin: 0; padding: 0; display: flex; justify-content: space-between; gap: 12px; }
.article-content ul.sample-terms li::before { content: none; }
.sample-terms[lang="he"] { font-family: var(--sans-he); font-size: 16px; }
.sample-terms .skip { font-variant-numeric: tabular-nums; color: var(--muted); }
/* very wide matrices take the full width; the lists go underneath */
.sample-wide { grid-template-columns: minmax(0, 1fr); }
.sample-wide .sample-side { grid-template-columns: minmax(0, 280px) minmax(0, 1fr); column-gap: var(--s4); }
.sample-wide .sample-side > .sample-lists:only-child { grid-column: 1 / -1; max-width: 520px; }
@media (max-width: 860px) {
  .sample { grid-template-columns: minmax(0, 1fr); padding: var(--s2); }
  .sample-matrix { padding: 6px; }
  .sample-side, .sample-wide .sample-side { grid-template-columns: minmax(0, 1fr); }
  .finding-grid-samples .finding-card h3 { font-size: 24px; }
}

/* ---------- Full paper: figures and tables taken from the original PDF ---------- */
.article-content .paper-fig { margin: var(--s4) auto; padding: 0; text-align: center; }
.article-content .paper-fig a { display: block; border: 0; }
.article-content .paper-fig img { display: block; width: 100%; height: auto; margin: 0 auto; border: 1px solid var(--grey); background: var(--white); padding: 10px; box-sizing: border-box; }
.article-content .paper-fig figcaption { margin-top: 10px; font-size: 15px; line-height: 1.5; color: var(--muted); }
.article-content .paper-table { width: auto; border-collapse: collapse; margin: var(--s3) auto var(--s4); font-size: 16px; }
.article-content .paper-table td, .article-content .paper-table th { padding: 7px 18px; border: 1px solid var(--grey); text-align: start; font-weight: 400; white-space: nowrap; }
.article-content .paper-table-sets td { border: 0; padding: 5px 28px; }
.article-content .paper-table-words th { font-family: inherit; font-size: inherit; letter-spacing: 0; text-transform: none; font-weight: 700; color: var(--ink); }
@media (max-width: 720px) {
  .article-content .paper-fig { max-width: 100% !important; }
  .article-content .paper-fig img { padding: 6px; }
  .article-content .paper-table { font-size: 13px; display: block; overflow-x: auto; max-width: 100%; }
  .article-content .paper-table td, .article-content .paper-table th { padding: 5px 8px; }
}
