/* ============================================================
   Shared A-level subject-page shell (with grade boundaries)
   Hoisted from 5 byte-identical inline <style> blocks: geography,
   government&politics, law, psychology, sociology.
   Same as style-subject-shell-alevel.css plus the .boundaries
   pill, .paper auto column, and an 880px breakpoint.
   ============================================================ */
.px-page, .px-page * { box-sizing: border-box; }

.px-page {
  --accent:        #1d4ed8;
  --accent-soft:   #dbeafe;
  --accent-border: #bfdbfe;
  --accent-text:   #1e40af;

  --text:    #111827;
  --body:    #374151;
  --muted:   #6b7280;
  --surface: #ffffff;
  --bg:      #f8fafc;
  --border:  #e5e7eb;

  background: var(--surface);
  color: var(--body);
  font-family: "Karla", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  line-height: 1.55;
  max-width: 980px;
  margin: 28px auto 56px;
  padding: 32px clamp(20px, 4vw, 44px);
  border-radius: 12px;
  box-shadow:
    0 1px 2px rgba(8, 18, 50, 0.08),
    0 8px 24px rgba(8, 18, 50, 0.18),
    0 32px 80px rgba(8, 18, 50, 0.28);
}
.px-page h1, .px-page h2, .px-page h3, .px-page h4 {
  font-family: "Manrope", "Karla", sans-serif;
  color: var(--text);
  letter-spacing: -0.015em;
}
.px-page a { color: var(--accent); text-decoration: none; }
.px-page a:hover { text-decoration: underline; }
.px-page p { margin: 0; }

/* ============ TITLE BLOCK ============ */
.px-title { margin-bottom: 28px; }
.px-title .px-eyebrow {
  font-family: "Manrope", sans-serif;
  font-size: 11px;
  font-weight: 700;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin-bottom: 4px;
}
.px-title h1 {
  font-size: clamp(28px, 4vw, 38px);
  font-weight: 800;
  line-height: 1.1;
  margin-bottom: 14px;
}
.cta-spec {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--accent);
  color: #fff !important;
  padding: 10px 16px;
  border-radius: 6px;
  font-family: "Manrope", sans-serif;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.02em;
  transition: background 0.12s ease;
  margin-bottom: 12px;
}
.cta-spec:hover { background: var(--accent-text); text-decoration: none; }
.cta-spec .arrow { font-size: 14px; }
.quick-links {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 6px;
}
.quick-links a {
  font-family: "Manrope", sans-serif;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.quick-links a:hover { color: var(--accent); text-decoration: none; }
.quick-links a .arrow { font-size: 11px; opacity: 0.7; }

/* ============ JUMP NAV ============ */
.jumpnav {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  padding: 14px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  margin-bottom: 28px;
  font-family: "Manrope", sans-serif;
  font-size: 13px;
  font-weight: 600;
}
.jumpnav a {
  color: var(--text);
  padding: 4px 8px;
  border-radius: 4px;
  transition: background 0.12s ease;
}
.jumpnav a:hover { background: var(--bg); color: var(--accent); text-decoration: none; }

/* ============ SECTIONS ============ */
.section { margin-bottom: 36px; }
.section-head {
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.section-head h2 {
  font-size: 20px;
  font-weight: 700;
  margin: 0;
}
.section-head .pill {
  font-family: "Manrope", sans-serif;
  font-size: 10.5px;
  font-weight: 700;
  background: var(--accent-soft);
  color: var(--accent-text);
  padding: 3px 8px;
  border-radius: 3px;
  letter-spacing: 0.06em;
}
.section-head .meta {
  font-size: 12.5px;
  color: var(--muted);
}

/* ============ UNIT CARD (collapsible) ============ */
.unit {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0;
  margin-bottom: 12px;
  background: var(--surface);
  overflow: hidden;
}
.unit > summary {
  list-style: none;
  cursor: pointer;
  padding: 16px 44px 16px 20px;
  position: relative;
  user-select: none;
}
.unit > summary::-webkit-details-marker { display: none; }
.unit > summary::after {
  content: "›";
  position: absolute;
  right: 18px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  font-size: 22px;
  line-height: 1;
  transition: transform .18s ease;
}
.unit[open] > summary::after { transform: translateY(-50%) rotate(90deg); }
.unit > summary:hover { background: var(--bg); }
.unit h3 {
  font-size: 16px;
  font-weight: 700;
  margin: 0;
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
}
.unit h3 .unit-topic {
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
  font-family: "Karla", sans-serif;
}
.unit h3 .unit-counts {
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 500;
  font-family: "Karla", sans-serif;
  margin-left: auto;
}
.unit > .papers-list { padding: 4px 20px 18px; }

/* ============ PAPER ROW ============ */
.papers-list { display: grid; gap: 6px; }
.paper {
  display: grid;
  grid-template-columns: 56px 1fr;
  gap: 14px;
  align-items: center;
  padding: 10px 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
}
.paper .year {
  font-family: "Manrope", sans-serif;
  font-weight: 700;
  font-size: 15px;
  color: var(--text);
}
.links { display: flex; gap: 6px; flex-wrap: wrap; }
.links a, .links em {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  font-weight: 600;
  padding: 5px 10px;
  border-radius: 4px;
  border: 1px solid var(--border);
  background: var(--surface);
}
.links a.qp { color: var(--accent); border-color: var(--accent-border); background: var(--accent-soft); }
.links a.qp:hover { background: var(--accent); color: #fff; text-decoration: none; }
.links a.ms { color: var(--body); }
.links a.ms:hover { background: var(--text); color: #fff; text-decoration: none; }
.links em {
  color: var(--muted);
  font-style: normal;
  opacity: 0.6;
  cursor: default;
}

/* ============ METHODS ============ */
.methods { margin-top: 18px; }
.methods h3 {
  font-size: 16px;
  font-weight: 700;
  margin: 14px 0 8px;
}
.methods h4 {
  font-size: 13px;
  font-weight: 700;
  margin: 12px 0 6px;
  color: var(--accent-text);
  font-family: "Manrope", sans-serif;
  letter-spacing: 0.02em;
}
.methods p { font-size: 13.5px; margin-bottom: 8px; color: var(--body); }
.button-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 14px; }
.button-row a {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 7px 12px;
  border-radius: 5px;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text);
  font-family: "Manrope", sans-serif;
  font-size: 12.5px;
  font-weight: 600;
  transition: all .12s ease;
}
.button-row a:hover {
  background: var(--accent-soft);
  color: var(--accent-text);
  border-color: var(--accent-border);
  text-decoration: none;
}

/* ============ AFFILIATES ============ */
.affiliates {
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-top: 28px;
  overflow: hidden;
}
.affiliates summary {
  padding: 14px 18px;
  cursor: pointer;
  font-family: "Manrope", sans-serif;
  font-weight: 700;
  font-size: 13.5px;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--text);
}
.affiliates summary::-webkit-details-marker { display: none; }
.affiliates summary::after {
  content: "›";
  color: var(--muted);
  font-size: 16px;
  transition: transform .18s ease;
}
.affiliates[open] summary::after { transform: rotate(90deg); }
.affiliates summary .lede { font-weight: 400; color: var(--muted); font-size: 12px; margin-left: 6px; }
.affiliates .panel { padding: 0 18px 18px; }
.affiliate-grid { display: grid; grid-template-columns: 1fr; gap: 12px; }
.aff {
  display: grid;
  grid-template-columns: 70px 1fr;
  gap: 12px;
  padding: 12px 0;
  border-top: 1px solid var(--border);
}
.aff img { width: 70px; height: auto; border-radius: 4px; }
.aff-title {
  font-weight: 700;
  color: var(--text);
  margin-bottom: 3px;
  display: inline-block;
  font-size: 13px;
}
.aff p { font-size: 11.5px; color: var(--muted); margin: 0; line-height: 1.5; }

.colophon {
  text-align: center;
  color: var(--muted);
  font-size: 11px;
  margin-top: 32px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.ad-slot {
  margin: 28px 0 0;
  min-height: 90px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px;
  overflow: hidden;
}
.ad-slot ins { min-height: 90px; }


/* ============ BOUNDARIES PILL ============ */
.paper { grid-template-columns: 56px 1fr auto !important; }
.boundaries {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  font-family: "Manrope", sans-serif;
  font-size: 10.5px;
}
.boundaries .g {
  display: inline-flex;
  align-items: center;
  border-radius: 3px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--surface);
}
.boundaries .g.top { border-color: #fbbf24; }
.boundaries .g.top .l { background: #fef3c7; color: #92400e; }
.boundaries .g .l {
  padding: 3px 5px;
  background: var(--bg);
  color: var(--muted);
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.boundaries .g .v {
  padding: 3px 6px;
  font-weight: 700;
  color: var(--text);
}
.boundaries .ums {
  color: var(--muted);
  margin-left: 4px;
  font-size: 10px;
}
@media (max-width: 880px) {
  .paper { grid-template-columns: 56px 1fr !important; }
  .boundaries { grid-column: 1 / -1; }
}
/* ============ RESPONSIVE ============ */
@media (min-width: 640px) {
  .affiliate-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 880px) {
  .affiliate-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 640px) {
  .px-page { margin: 16px 12px 40px; padding: 22px 18px; border-radius: 8px; }
  .paper { grid-template-columns: 1fr; gap: 8px; }
  .unit h3 { flex-direction: column; align-items: flex-start; gap: 2px; }
  .unit h3 .unit-counts { margin-left: 0; }
}
