/* History of Fashion Design — Oxford Blue, Gold & Warm Sandstone Edition
   Visual system aligned with LettreAI / PDAI scholarly editions (Kepleriana, Bischoff, Sundials) */

:root {
  --oxford: #002147;
  --oxford-deep: #00152e;
  --oxford-soft: #23436b;
  --ink: #1b242d;
  --muted: #5a5246;
  --gold: #c4a15a;
  --gold-deep: #8c6d2a;
  --gold-pale: #efe3c4;
  --sand: #f6f1e7;
  --sand-deep: #ebe2d0;
  --paper: #fffdf8;
  --line: #dfd5c0;
  --line-strong: #c7b89b;
  --crimson: #8f2d26;
  --teal: #2b5b6c;
  --olive: #4f6238;
  --serif: "Source Serif 4", "Palatino Linotype", Palatino, Georgia, serif;
  --display: "Fraunces", "Source Serif 4", Palatino, Georgia, serif;
  --sans: "Source Sans 3", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", "SFMono-Regular", Menlo, monospace;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(1200px 500px at 50% -180px, rgba(196, 161, 90, 0.18), transparent 65%),
    var(--sand);
  font-family: var(--serif);
  font-size: 1.06rem;
  line-height: 1.62;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--oxford);
  text-underline-offset: 0.18em;
  transition: color 0.15s ease;
}

a:hover {
  color: var(--gold-deep);
}

img {
  max-width: 100%;
  display: block;
}

.skip {
  position: absolute;
  left: 1rem;
  top: -4rem;
  background: var(--oxford);
  color: #fff;
  padding: 0.45rem 0.8rem;
  font-family: var(--sans);
  font-size: 0.88rem;
  text-decoration: none;
  z-index: 100;
}

.skip:focus {
  top: 0.6rem;
}

/* ---------------------------------------------------------------- Masthead */
.mast {
  background: var(--oxford-deep);
  color: #f4efe4;
  border-bottom: 3px solid var(--gold);
  position: sticky;
  top: 0;
  z-index: 40;
  box-shadow: 0 4px 18px rgba(0, 15, 34, 0.18);
}

.mast-inner {
  max-width: 1260px;
  margin: 0 auto;
  padding: 0.85rem 1.6rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.brand {
  margin: 0;
  font-family: var(--sans);
  font-size: 0.92rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-weight: 650;
}

.brand a {
  color: #f4efe4;
  text-decoration: none;
}

.brand span {
  color: var(--gold);
}

.brand .sub-brand {
  color: #cbbfa8;
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0.01em;
  margin-left: 0.45rem;
}

.mast nav {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.3rem 1.15rem;
  font-family: var(--sans);
  font-size: 0.9rem;
}

.mast nav a {
  color: #e9e1d2;
  text-decoration: none;
  padding: 0.2rem 0;
  border-bottom: 2px solid transparent;
}

.mast nav a:hover,
.mast nav a[aria-current="page"] {
  color: var(--gold);
  border-bottom-color: var(--gold);
}

.lang-switch {
  display: inline-flex;
  align-items: center;
  border: 1px solid rgba(196, 161, 90, 0.75);
  border-radius: 999px;
  overflow: hidden;
  margin-left: 0.35rem;
}

.lang-switch button {
  appearance: none;
  background: transparent;
  color: #e9e1d2;
  border: 0;
  border-right: 1px solid rgba(196, 161, 90, 0.35);
  font-family: var(--sans);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  padding: 0.28rem 0.55rem;
  cursor: pointer;
}

.lang-switch button:last-child {
  border-right: 0;
}

.lang-switch button.is-on {
  background: var(--gold);
  color: var(--oxford-deep);
  font-weight: 650;
}

/* ---------------------------------------------------------------- Containers */
.wrap {
  max-width: 1260px;
  margin: 0 auto;
  padding: 0 1.6rem;
}

/* ---------------------------------------------------------------- Hero */
.hero {
  padding: 3.2rem 0 1.8rem;
}

.kicker {
  margin: 0 0 0.65rem;
  font-family: var(--sans);
  font-size: 0.8rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--gold-deep);
  font-weight: 650;
}

h1 {
  margin: 0;
  font-family: var(--display);
  font-weight: 560;
  font-size: clamp(2.4rem, 5.4vw, 4.35rem);
  letter-spacing: -0.025em;
  line-height: 1.02;
  color: var(--oxford);
}

h1 em {
  font-style: italic;
  font-weight: 460;
  color: var(--gold-deep);
}

.lead {
  max-width: 52rem;
  margin: 1.25rem 0 0;
  font-size: 1.2rem;
  line-height: 1.5;
  color: var(--ink);
}

.byline {
  margin: 1rem 0 0;
  max-width: 52rem;
  color: var(--muted);
  font-family: var(--sans);
  font-size: 0.95rem;
}

.credit {
  margin: 0.9rem 0 0;
  max-width: 54rem;
  font-family: var(--sans);
  font-size: 0.88rem;
  color: var(--muted);
  border-left: 3px solid var(--gold);
  padding: 0.25rem 0 0.25rem 0.85rem;
  background: rgba(255, 253, 248, 0.55);
}

/* ---------------------------------------------------------------- Key Metrics Strip */
.figures {
  display: grid;
  grid-template-columns: repeat(var(--cols, 5), 1fr);
  gap: 0;
  margin: 2rem 0 1.8rem;
  background: var(--paper);
  border: 1px solid var(--line);
  border-top: 3px solid var(--oxford);
  box-shadow: 0 8px 24px rgba(0, 21, 46, 0.04);
}

.figures div {
  padding: 0.95rem 1rem 0.85rem;
  border-right: 1px solid var(--line);
}

.figures div:last-child {
  border-right: 0;
}

.figures .v {
  display: block;
  font-family: var(--display);
  font-size: 1.75rem;
  color: var(--oxford);
  line-height: 1.1;
  font-variant-numeric: lining-nums tabular-nums;
}

.figures .k {
  display: block;
  font-family: var(--sans);
  font-size: 0.82rem;
  color: var(--muted);
  margin-top: 0.25rem;
  line-height: 1.3;
}

/* ---------------------------------------------------------------- Magazine Cover Gallery Cards (Index) */
.section-head {
  margin: 2.8rem 0 1.2rem;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 1rem;
  border-bottom: 2px solid var(--line-strong);
  padding-bottom: 0.65rem;
}

.section-head h2 {
  margin: 0;
  font-family: var(--display);
  font-size: clamp(1.65rem, 3vw, 2.25rem);
  font-weight: 560;
  color: var(--oxford);
  letter-spacing: -0.02em;
}

.section-head p {
  margin: 0;
  font-family: var(--sans);
  font-size: 0.92rem;
  color: var(--muted);
}

.cover-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2.5rem;
}

.cover-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-top: 3px solid var(--oxford);
  border-radius: 3px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 10px 28px rgba(0, 21, 46, 0.06);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-top-color 0.18s ease;
}

.cover-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 16px 36px rgba(0, 21, 46, 0.11);
  border-top-color: var(--gold);
}

.cover-card-media {
  position: relative;
  background: #eae1cf;
  padding: 1.1rem 1.4rem;
  display: flex;
  justify-content: center;
  align-items: center;
  border-bottom: 1px solid var(--line);
  aspect-ratio: 4 / 5;
  overflow: hidden;
}

.cover-card-media img {
  max-height: 100%;
  width: auto;
  object-fit: contain;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.22);
  border: 1px solid rgba(0, 0, 0, 0.12);
  transition: transform 0.25s ease;
}

.cover-card:hover .cover-card-media img {
  transform: scale(1.025);
}

.plate-badge {
  position: absolute;
  top: 0.75rem;
  left: 0.75rem;
  background: var(--oxford-deep);
  color: var(--gold-pale);
  font-family: var(--sans);
  font-size: 0.74rem;
  font-weight: 650;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.22rem 0.55rem;
  border: 1px solid var(--gold);
}

.zone-badge {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  background: rgba(255, 253, 248, 0.94);
  color: var(--oxford);
  font-family: var(--sans);
  font-size: 0.74rem;
  font-weight: 600;
  padding: 0.2rem 0.55rem;
  border: 1px solid var(--line-strong);
}

.cover-card-body {
  padding: 1.25rem 1.35rem 1.35rem;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.cover-card-body .mark {
  font-family: var(--sans);
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--gold-deep);
  font-weight: 650;
  margin: 0 0 0.35rem;
}

.cover-card-body h3 {
  margin: 0 0 0.45rem;
  font-family: var(--display);
  font-size: 1.45rem;
  font-weight: 560;
  line-height: 1.16;
  color: var(--oxford);
}

.cover-card-body h3 a {
  text-decoration: none;
  color: inherit;
}

.cover-card-body h3 a:hover {
  color: var(--gold-deep);
}

.cover-card-body .summary {
  margin: 0 0 0.95rem;
  font-size: 0.96rem;
  line-height: 1.5;
  color: var(--ink);
}

.meta-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.45rem 0.8rem;
  padding: 0.75rem 0;
  margin: auto 0 0.95rem;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  font-family: var(--sans);
  font-size: 0.82rem;
}

.meta-grid div strong {
  display: block;
  color: var(--muted);
  font-weight: 600;
  font-size: 0.73rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.meta-grid div span {
  color: var(--ink);
  font-weight: 560;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 1rem;
}

.chip {
  font-family: var(--sans);
  font-size: 0.74rem;
  font-weight: 560;
  padding: 0.16rem 0.5rem;
  background: var(--sand);
  border: 1px solid var(--line-strong);
  color: var(--oxford);
  border-radius: 2px;
}

.chip.gold {
  background: var(--gold-pale);
  border-color: var(--gold);
  color: var(--oxford-deep);
}

.card-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  font-family: var(--sans);
  font-size: 0.88rem;
  font-weight: 600;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--oxford);
  color: #fffdf8 !important;
  text-decoration: none;
  padding: 0.48rem 0.95rem;
  border-radius: 2px;
  font-family: var(--sans);
  font-size: 0.86rem;
  font-weight: 600;
  border: 1px solid var(--oxford);
  transition: background 0.15s ease, border-color 0.15s ease;
}

.btn-primary:hover {
  background: var(--gold-deep);
  border-color: var(--gold-deep);
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: transparent;
  color: var(--oxford);
  text-decoration: none;
  padding: 0.45rem 0.8rem;
  border-radius: 2px;
  font-family: var(--sans);
  font-size: 0.84rem;
  font-weight: 600;
  border: 1px solid var(--line-strong);
}

.btn-secondary:hover {
  border-color: var(--oxford);
  background: var(--sand);
}

/* ---------------------------------------------------------------- Single Magazine Page Composition (Full Image / Text Split) */
.breadcrumb {
  font-family: var(--sans);
  font-size: 0.84rem;
  color: var(--muted);
  padding: 1.1rem 0 0.2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.breadcrumb a {
  text-decoration: none;
  font-weight: 560;
}

.pager-top {
  display: flex;
  gap: 0.75rem;
}

.edition-spread {
  display: grid;
  grid-template-columns: minmax(340px, 44%) 1fr;
  gap: 2.4rem;
  align-items: start;
  margin: 1.4rem 0 3rem;
}

.plate-column {
  position: sticky;
  top: 4.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
}

.plate-frame {
  background: var(--paper);
  border: 1px solid var(--line-strong);
  border-top: 3px solid var(--oxford);
  padding: 1.1rem;
  box-shadow: 0 12px 32px rgba(0, 21, 46, 0.08);
}

.plate-stage {
  position: relative;
  background: #e6decb;
  padding: 0.9rem;
  border: 1px solid var(--line);
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: zoom-in;
}

.plate-stage img {
  max-height: 68vh;
  width: auto;
  box-shadow: 0 8px 26px rgba(0, 0, 0, 0.25);
}

.plate-Overlay-box {
  position: absolute;
  border: 2px solid var(--gold);
  background: rgba(196, 161, 90, 0.18);
  box-shadow: 0 0 0 9999px rgba(0, 15, 34, 0.35);
  pointer-events: none;
  opacity: 0;
  transition: all 0.22s ease;
}

.plate-Overlay-box.active {
  opacity: 1;
}

.plate-controls {
  margin-top: 0.85rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  justify-content: space-between;
  align-items: center;
}

.zone-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.zone-btn {
  font-family: var(--sans);
  font-size: 0.76rem;
  font-weight: 600;
  padding: 0.28rem 0.6rem;
  background: var(--sand);
  color: var(--oxford);
  border: 1px solid var(--line-strong);
  border-radius: 2px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.zone-btn:hover,
.zone-btn.active {
  background: var(--oxford);
  color: #fffdf8;
  border-color: var(--oxford);
}

.plate-caption {
  margin-top: 0.7rem;
  font-family: var(--sans);
  font-size: 0.82rem;
  color: var(--muted);
  line-height: 1.4;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.detail-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.65rem;
}

.detail-card {
  background: var(--paper);
  border: 1px solid var(--line);
  padding: 0.45rem;
  cursor: pointer;
  transition: border-color 0.15s ease, transform 0.15s ease;
}

.detail-card:hover {
  border-color: var(--gold-deep);
  transform: translateY(-2px);
}

.detail-card img {
  width: 100%;
  height: 76px;
  object-fit: cover;
  border: 1px solid var(--line);
}

.detail-card span {
  display: block;
  margin-top: 0.35rem;
  font-family: var(--sans);
  font-size: 0.73rem;
  font-weight: 600;
  color: var(--oxford);
  line-height: 1.25;
}

/* ---------------------------------------------------------------- Commentary Column */
.commentary-column {
  display: flex;
  flex-direction: column;
  gap: 1.65rem;
}

.issue-header {
  background: var(--paper);
  border: 1px solid var(--line);
  border-top: 4px solid var(--oxford);
  padding: 1.6rem 1.8rem;
  box-shadow: 0 8px 24px rgba(0, 21, 46, 0.05);
}

.issue-header h1 {
  font-size: clamp(1.9rem, 3.4vw, 2.75rem);
  margin-bottom: 0.5rem;
}

.issue-subtitle {
  font-family: var(--display);
  font-style: italic;
  font-size: 1.2rem;
  color: var(--muted);
  margin: 0 0 1rem;
}

.dossier-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1.1rem;
  font-family: var(--sans);
  font-size: 0.9rem;
}

.dossier-table th,
.dossier-table td {
  padding: 0.52rem 0.65rem;
  border-top: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.dossier-table th {
  width: 34%;
  color: var(--muted);
  font-weight: 650;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: rgba(246, 241, 231, 0.5);
}

.dossier-table td {
  color: var(--ink);
}

.scholarly-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-top: 3px solid var(--oxford);
  padding: 1.55rem 1.8rem;
  box-shadow: 0 8px 24px rgba(0, 21, 46, 0.04);
}

.scholarly-card.gold-top {
  border-top-color: var(--gold);
  background: linear-gradient(180deg, rgba(196, 161, 90, 0.09), transparent 4.5rem), var(--paper);
}

.scholarly-card .section-tag {
  font-family: var(--sans);
  font-size: 0.76rem;
  font-weight: 650;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--gold-deep);
  margin: 0 0 0.35rem;
}

.scholarly-card h2 {
  margin: 0 0 0.85rem;
  font-family: var(--display);
  font-size: 1.5rem;
  font-weight: 560;
  color: var(--oxford);
  line-height: 1.2;
}

.scholarly-card h3 {
  margin: 1.2rem 0 0.45rem;
  font-family: var(--sans);
  font-size: 1rem;
  font-weight: 650;
  color: var(--oxford);
}

.scholarly-card p {
  margin: 0 0 0.9rem;
}

.scholarly-card p:last-child {
  margin-bottom: 0;
}

.scholarly-card ul,
.scholarly-card ol {
  margin: 0.5rem 0 0.95rem;
  padding-left: 1.35rem;
}

.scholarly-card li {
  margin-bottom: 0.45rem;
}

/* Diplomatic Transcription Box */
.transcription-box {
  background: var(--sand);
  border: 1px solid var(--line-strong);
  border-left: 4px solid var(--oxford);
  padding: 1rem 1.2rem;
  margin: 0.8rem 0;
  font-family: var(--mono);
  font-size: 0.86rem;
  line-height: 1.55;
}

.transcription-box .zone-label {
  font-family: var(--sans);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--gold-deep);
  display: block;
  margin-top: 0.6rem;
}

.transcription-box .zone-label:first-child {
  margin-top: 0;
}

/* Pattern Code Decode Grid */
.pattern-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 0.8rem;
  margin-top: 0.9rem;
}

.pattern-item {
  background: var(--sand);
  border: 1px solid var(--line-strong);
  padding: 0.75rem 0.9rem;
  border-radius: 2px;
}

.pattern-item code {
  font-family: var(--mono);
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--oxford);
  background: var(--gold-pale);
  padding: 0.1rem 0.4rem;
  border: 1px solid var(--gold);
}

.pattern-item p {
  margin: 0.45rem 0 0;
  font-family: var(--sans);
  font-size: 0.85rem;
  line-height: 1.4;
  color: var(--ink);
}

/* Comparative Table */
.table-scroll {
  overflow-x: auto;
  background: var(--paper);
  border: 1px solid var(--line);
  border-top: 3px solid var(--oxford);
  box-shadow: 0 8px 24px rgba(0, 21, 46, 0.04);
}

.comp-table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--sans);
  font-size: 0.88rem;
}

.comp-table th,
.comp-table td {
  padding: 0.75rem 0.9rem;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.comp-table thead th {
  background: var(--oxford-deep);
  color: #f4efe4;
  font-weight: 650;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 2px solid var(--gold);
}

.comp-table tbody tr:hover {
  background: rgba(196, 161, 90, 0.08);
}

.comp-table td.num {
  font-variant-numeric: lining-nums tabular-nums;
  white-space: nowrap;
}

/* Timeline / Context Grid */
.context-columns {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.25rem;
  margin: 1.2rem 0 2.5rem;
}

/* Lightbox Modal */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0, 15, 32, 0.9);
  z-index: 200;
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 1.5rem;
}

.lightbox.open {
  display: flex;
}

.lightbox-bar {
  width: 100%;
  max-width: 1200px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: #f4efe4;
  font-family: var(--sans);
  font-size: 0.92rem;
  margin-bottom: 0.75rem;
}

.lightbox-close {
  background: var(--gold);
  color: var(--oxford-deep);
  border: none;
  padding: 0.38rem 0.85rem;
  font-family: var(--sans);
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  border-radius: 2px;
}

.lightbox-img-wrap {
  max-width: 94vw;
  max-height: 84vh;
  overflow: auto;
  border: 2px solid var(--gold);
  background: #111;
}

.lightbox-img-wrap img {
  max-height: 82vh;
  width: auto;
  margin: 0 auto;
}

/* Footer */
footer {
  margin-top: 3.5rem;
  background: var(--oxford-deep);
  color: #d9cfbe;
  border-top: 3px solid var(--gold);
  padding: 2.2rem 0 2.6rem;
  font-family: var(--sans);
  font-size: 0.88rem;
}

footer .footer-grid {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 1.5rem;
}

footer a {
  color: var(--gold-pale);
}

footer a:hover {
  color: #fff;
}

footer p {
  margin: 0.25rem 0;
}

@media (max-width: 960px) {
  .edition-spread {
    grid-template-columns: 1fr;
  }
  .plate-column {
    position: static;
  }
  .figures {
    grid-template-columns: repeat(2, 1fr);
  }
}
