/*
Theme Name: JC Memorial Archive
Theme URI: https://jagdeepchhokar.org/
Author: Jagdeep Chhokar Memorial Archive
Description: Respectful editorial theme for a chronological and issue-led research archive.
Version: 0.9.1
Requires at least: 6.6
Requires PHP: 8.1
Text Domain: jc
*/

:root {
  --paper: #f7f2e9;
  --paper-deep: #eee5d7;
  --ink: #24201d;
  --muted: #675f58;
  --maroon: #781f2b;
  --maroon-dark: #5d1420;
  --rule: #cfc2b2;
  --white: #fffdfa;
  --serif: Georgia, "Times New Roman", serif;
  --sans: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --shell: 67.5rem;
  --reading: 48rem;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: var(--sans); font-size: 1rem; line-height: 1.65; }
img, svg, video, iframe { display: block; max-width: 100%; height: auto; }
a { color: var(--maroon-dark); text-underline-offset: .18em; text-decoration-thickness: .07em; }
a:hover { color: var(--maroon); }
:focus-visible { outline: .2rem solid var(--maroon); outline-offset: .2rem; }
h1, h2, h3, h4 { margin: 0 0 .6em; font-family: var(--serif); font-weight: 400; line-height: 1.08; text-wrap: balance; }
h1 { font-size: 2.875rem; }
h2 { font-size: 1.9375rem; }
h3 { font-size: 1.75rem; }
p { margin: 0 0 1em; }
.shell { width: min(calc(100% - 3.5rem), var(--shell)); margin-inline: auto; }
.reading { width: min(100%, var(--reading)); }
.skip-link { position: fixed; z-index: 1000; top: .5rem; left: .5rem; transform: translateY(-180%); padding: .7rem 1rem; background: var(--ink); color: white; }
.skip-link:focus { transform: none; }
.site-header { border-bottom: 1px solid var(--rule); background: color-mix(in srgb, var(--paper) 94%, transparent); }
.header-inner { display: flex; min-height: 5.4rem; align-items: center; justify-content: space-between; gap: 1.5rem; }
.site-brand { min-width: 0; color: var(--ink); font-family: var(--serif); font-size: clamp(1.05rem, 1.6vw, 1.25rem); font-weight: 700; line-height: 1.1; text-decoration: none; }
.menu-toggle { display: none; flex: 0 0 auto; padding: .55rem .75rem; border: 1px solid var(--ink); background: transparent; color: var(--ink); font: inherit; font-weight: 700; }
.primary-nav > ul { display: flex; flex-wrap: nowrap; align-items: center; justify-content: flex-end; gap: .35rem; margin: 0; padding: 0; list-style: none; }
.nav-item { position: relative; }
.nav-tab { display: inline-block; padding: .5rem .85rem; border: 1px solid var(--rule); border-radius: .3rem; background: transparent; color: var(--ink); font-size: .78rem; font-weight: 700; white-space: nowrap; text-decoration: none; cursor: pointer; list-style: none; }
.nav-tab::marker { display: none; content: ""; }
.nav-tab::-webkit-details-marker { display: none; }
.nav-tab:hover { border-color: var(--maroon); color: var(--maroon); }
.nav-tab[aria-current="page"] { border-color: var(--maroon-dark); background: var(--maroon-dark); color: var(--white); }
.nav-dropdown[open] > .nav-tab { border-color: var(--maroon-dark); }
.nav-dropdown__menu { position: absolute; z-index: 20; top: calc(100% + .3rem); right: 0; display: grid; width: min(23rem, calc(100vw - 2rem)); max-height: min(70vh, 34rem); margin: 0; padding: .4rem; overflow-y: auto; border: 1px solid var(--rule); background: var(--paper); box-shadow: 0 .5rem 1rem rgba(36, 32, 29, .12); list-style: none; }
.nav-dropdown__menu a { display: flex; min-height: 2.75rem; align-items: center; padding: .5rem .6rem; color: var(--ink); font-size: .82rem; text-decoration: none; }
.nav-dropdown__menu a:hover, .nav-dropdown__menu a[aria-current="page"] { background: var(--paper-deep); color: var(--maroon); }
.hero { padding: 1.625rem 0 1.25rem; border-bottom: 1px solid var(--rule); }
.home .hero { padding: 2.125rem 0 1.625rem; }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1fr) 17rem; align-items: center; gap: 3rem; }
.hero h1 { max-width: 26ch; margin-bottom: .75rem; font-size: 1.9375rem; }
.home .hero h1 { max-width: 18ch; margin-bottom: 1.125rem; font-size: 3.375rem; }
.eyebrow { margin-bottom: 1rem; color: var(--maroon-dark); font-size: .75rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.lede { max-width: 62ch; color: var(--muted); font-family: var(--serif); font-size: 1.0625rem; line-height: 1.5; }
.home .lede { font-size: 1.125rem; }
.lifespan { margin-top: .8rem; color: var(--muted); font-size: 1.05rem; font-weight: 700; }
.portrait { width: min(100%, 17rem); margin: 0; justify-self: end; overflow: hidden; border: 1px solid var(--rule); background: var(--paper-deep); }
.portrait__frame { aspect-ratio: 4 / 5; overflow: hidden; }
.portrait__frame img { width: 100%; height: 100%; object-fit: cover; object-position: 14% center; }
.portrait--attachment .portrait__frame img { object-position: center; }
.portrait figcaption { padding: .65rem .8rem; border-top: 1px solid var(--rule); color: var(--muted); font-size: .72rem; line-height: 1.4; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 1.25rem; margin: 1.35rem 0 0; font-size: .86rem; font-weight: 800; }
.hero-actions a { text-decoration-thickness: .1em; }
.section { padding: 2.75rem 0; border-bottom: 1px solid var(--rule); }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 1.5rem; margin-bottom: 2rem; }
.section-head > * { margin-bottom: 0; }
.editorial-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 1rem; }
.card { grid-column: span 4; min-width: 0; padding: 1.35rem 0 1.5rem; border-top: .18rem solid var(--maroon); overflow-wrap: anywhere; }
.card--wide { grid-column: span 6; }
.card__meta, .record-meta { display: flex; flex-wrap: wrap; gap: .35rem .8rem; margin-bottom: .7rem; color: var(--muted); font-size: .78rem; font-weight: 700; letter-spacing: .025em; text-transform: uppercase; }
.card h3 a { color: var(--ink); text-decoration: none; }
.card h3 a:hover { color: var(--maroon); text-decoration: underline; }
.card__excerpt { color: var(--muted); }
.card--compact { display: grid; grid-template-columns: minmax(11rem, 15rem) minmax(0, 1fr); gap: .25rem 2rem; padding: 1.15rem 0 1.35rem; border-top-width: 1px; }
.card--compact .card__meta { grid-row: 1 / span 2; display: grid; align-content: start; gap: .2rem; margin: 0; }
.card--compact h3 { margin-bottom: .35rem; font-size: 1.45rem; }
.card--compact .card__excerpt { margin: 0; }
.archive-list { border-bottom: 1px solid var(--rule); }
.archive-list .card { width: 100%; }
.archive-count { margin-bottom: .5rem; color: var(--muted); font-size: .82rem; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }
.issue-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin: 0; padding: 0; border-top: 1px solid var(--rule); list-style: none; }
.issue-list li { border-bottom: 1px solid var(--rule); }
.issue-list a { display: block; min-height: 100%; padding: 1rem .75rem 1rem 0; color: var(--ink); font-family: var(--serif); font-size: 1.15rem; font-weight: 700; text-decoration: none; }
.issue-list a:hover { color: var(--maroon); }
.issue-list a span { display: block; margin-top: .35rem; color: var(--muted); font-family: var(--sans); font-size: .72rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.issue-list--directory a { padding-block: 1.15rem; }
.issue-list--directory strong { font-weight: 700; }
.issue-list--directory small { display: block; margin-top: .45rem; color: var(--muted); font-family: var(--sans); font-size: .82rem; font-weight: 400; line-height: 1.45; }
.archive-tools { display: flex; flex-wrap: wrap; align-items: end; gap: 1rem; margin-bottom: 2rem; padding-block: 1rem; border-block: 1px solid var(--rule); }
.filter-field { display: grid; min-width: 0; gap: .3rem; }
.archive-tools label { color: var(--muted); font-size: .75rem; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; }
.archive-tools--complete { display: grid; grid-template-columns: minmax(12rem, 1.4fr) repeat(4, minmax(8rem, 1fr)) auto auto; }
.archive-collections { margin-bottom: 1.25rem; border-block: 1px solid var(--rule); }
.archive-collections ul { display: flex; flex-wrap: wrap; gap: 0; margin: 0; padding: 0; list-style: none; }
.archive-collections a { display: flex; min-height: 2.9rem; align-items: center; gap: .45rem; padding: .65rem .9rem; color: var(--ink); font-size: .82rem; font-weight: 800; text-decoration: none; }
.archive-collections a:hover, .archive-collections a[aria-current="page"] { background: var(--paper-deep); color: var(--maroon-dark); }
.archive-collections a[aria-current="page"] { box-shadow: inset 0 -.18rem var(--maroon); }
.archive-collections a span { color: var(--muted); font-size: .7rem; }
.filter-summary { margin: -1rem 0 1.5rem; color: var(--muted); font-family: var(--serif); }
.section--archive-nav { padding-block: 1.25rem 0; border-bottom: 0; }
.section--archive-nav .archive-collections { margin-bottom: 0; }
.clear-filters { align-self: center; font-size: .86rem; font-weight: 800; }
select, input, textarea, button { max-width: 100%; font: inherit; }
.archive-tools select, .archive-tools input { width: 100%; min-width: 0; }
select, input[type="search"] { min-height: 2.75rem; padding: .5rem .7rem; border: 1px solid var(--rule); border-radius: 0; background: var(--white); color: var(--ink); }
.button, button[type="submit"] { display: inline-flex; min-height: 2.75rem; align-items: center; justify-content: center; padding: .6rem 1rem; border: 1px solid var(--maroon-dark); background: var(--maroon-dark); color: white; font-weight: 800; text-decoration: none; cursor: pointer; }
.year-nav { display: flex; flex-wrap: wrap; gap: .45rem; margin-bottom: 2rem; }
.year-nav a { padding: .35rem .6rem; border: 1px solid var(--rule); font-size: .8rem; font-weight: 700; text-decoration: none; }
.year-heading { grid-column: 1 / -1; display: grid; grid-template-columns: 5rem 1fr; align-items: center; gap: 1rem; margin: 3rem 0 1rem; color: var(--maroon-dark); }
.year-heading::after { height: 1px; background: var(--rule); content: ""; }
.record-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(14rem, 19rem); gap: clamp(2rem, 6vw, 6rem); }
.record-content { font-family: var(--serif); font-size: 1.12rem; }
.record-content > * { max-width: var(--reading); }
.record-content h2 { margin-top: 2.25rem; padding-top: 1.35rem; border-top: 1px solid var(--rule); font-size: 1.65rem; }
.record-content h2:first-child { margin-top: 0; }
.record-content li + li { margin-top: .45rem; }
.photo-essay { width: min(100%, var(--shell)); margin-top: 2.75rem; padding-top: 1.5rem; border-top: 1px solid var(--rule); }
.photo-essay h2 { margin-bottom: 1.25rem; }
.photo-essay__grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.photo-essay figure { min-width: 0; margin: 0; background: var(--paper-deep); }
.photo-essay img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; }
.photo-essay figcaption { padding: .7rem .8rem; color: var(--muted); font-size: .78rem; line-height: 1.45; }
.photo-essay__credit { margin: .85rem 0 0; color: var(--muted); font-size: .72rem; }
.source-note { margin-top: 2rem; padding-top: 1rem; border-top: 1px solid var(--rule); color: var(--muted); font-family: var(--sans); font-size: .8125rem; }
.record-aside { align-self: start; padding-top: 1rem; border-top: .18rem solid var(--maroon); font-size: .9rem; }
.record-aside h2 { font-size: 1.35rem; }
.record-aside h3 { margin-top: 1.5rem; font-family: var(--sans); font-size: .82rem; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; }
.record-aside dl { margin: 0 0 1.35rem; }
.record-aside dt { margin-top: .8rem; color: var(--muted); font-size: .72rem; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; }
.record-aside dd { margin: .1rem 0 0; overflow-wrap: anywhere; }
.record-aside ul { padding-left: 1.1rem; }
.source-link { font-weight: 800; }
.source-prompt { max-width: 34rem; padding: 1.5rem; border-block: 1px solid var(--rule); }
.source-prompt p { margin-bottom: 1rem; }
.record-layout--link-only { grid-template-columns: minmax(0, 1fr) minmax(16rem, 22rem); }
.pagination { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: 2rem; }
.pagination .page-numbers { display: inline-flex; min-width: 2.5rem; min-height: 2.5rem; align-items: center; justify-content: center; padding: .35rem .7rem; border: 1px solid var(--rule); text-decoration: none; }
.pagination .current { border-color: var(--maroon-dark); background: var(--maroon-dark); color: white; }
.citation-list { padding-left: 1.25rem; }
.empty-state { padding: 2rem 0; color: var(--muted); font-family: var(--serif); font-size: 1.2rem; }
.site-footer { padding: 3rem 0; background: var(--ink); color: #f7f2e9; }
.footer-inner { display: grid; grid-template-columns: 1fr auto; gap: 2rem; }
.site-footer a { color: white; }
.site-footer p { margin: 0; }

@media (max-width: 1120px) {
  .header-inner { gap: .75rem; }
  .site-brand { flex: 1 1 auto; max-width: calc(100% - 5rem); overflow-wrap: anywhere; }
  .menu-toggle { display: inline-flex; }
  .primary-nav { position: absolute; z-index: 20; top: calc(100% + 1px); right: 0; left: 0; display: none; padding: 1rem; border-bottom: 1px solid var(--rule); background: var(--paper); }
  .primary-nav.is-open { display: block; }
  .primary-nav > ul { display: grid; justify-content: stretch; }
  .nav-tab { display: block; width: 100%; padding: .6rem; text-align: left; }
  .nav-dropdown__menu { position: static; width: 100%; max-height: 50vh; margin-top: .25rem; padding: 0 0 0 1rem; border: none; box-shadow: none; }
  .site-header { position: relative; }
  .hero-grid, .record-layout { grid-template-columns: 1fr; }
  .home .hero-grid .portrait { order: -1; justify-self: center; }
  .portrait { max-width: 25rem; }
  .card { grid-column: span 6; }
  .issue-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .archive-tools--complete { grid-template-columns: repeat(2, minmax(9rem, 1fr)); }
}

@media (max-width: 560px) {
  .shell { width: min(calc(100% - 2rem), var(--shell)); }
  .header-inner { min-height: 4.6rem; }
  .hero, .home .hero { padding: 1.5rem 0 1.25rem; }
  .section { padding-block: 2rem; }
  .section-head { display: block; }
  .card, .card--wide { grid-column: 1 / -1; }
  .issue-list { grid-template-columns: 1fr; }
  .archive-tools { display: grid; align-items: stretch; }
  .archive-tools--complete { grid-template-columns: 1fr; }
  .footer-inner { grid-template-columns: 1fr; }
  h1 { font-size: 2.0625rem; }
  h2 { font-size: 1.625rem; }
  h3 { font-size: 1.4375rem; }
  .hero h1 { font-size: 1.625rem; }
  .home .hero h1 { font-size: 2.1875rem; }
  .hero-grid { gap: 1.25rem; }
  .home .portrait { justify-self: center; width: min(100%, 9.75rem); }
  .portrait figcaption { padding: .5rem .6rem; font-size: .65rem; }
  .card--compact { grid-template-columns: 1fr; gap: .35rem; }
  .card--compact .card__meta { grid-row: auto; display: flex; }
  .record-content h2 { font-size: 1.4rem; }
  .photo-essay__grid { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
