/*
Theme Name: Literature Menu
Theme URI: https://literaturemenu.com
Author: Affan Juma
Description: An accessible, navy-led editorial theme for independent health-policy research, analysis, and commentary.
Version: 1.0.0
Requires at least: 6.5
Requires PHP: 8.1
Text Domain: literature-menu
*/

:root {
  color-scheme: light;
  --navy-950: #061b35;
  --navy-900: #0a274c;
  --navy-800: #123967;
  --navy-700: #185083;
  --blue-600: #176ca4;
  --teal-700: #08766f;
  --teal-500: #24a69b;
  --teal-100: #dff4f1;
  --cream-50: #faf9f5;
  --paper: #ffffff;
  --ink: #10243a;
  --muted: #536577;
  --line: #cbd5df;
  --soft: #edf2f6;
  --focus: #ca7a00;
  --success: #116b48;
  --shadow: 0 18px 50px rgba(6, 27, 53, 0.1);
  --font-sans: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-serif: Georgia, "Times New Roman", serif;
  --content: 1180px;
  --reading: 760px;
  --radius: 0.45rem;
}

html[data-theme="dark"] {
  color-scheme: dark;
  --navy-950: #dcecff;
  --navy-900: #eef6ff;
  --navy-800: #b9d6f3;
  --navy-700: #8cbce9;
  --blue-600: #78b6e7;
  --teal-700: #65d0c5;
  --teal-500: #65d0c5;
  --teal-100: #123f4a;
  --cream-50: #071526;
  --paper: #0c2037;
  --ink: #eef6ff;
  --muted: #b7c7d6;
  --line: #35506b;
  --soft: #122b45;
  --focus: #ffc45c;
  --success: #6fd8a4;
  --shadow: 0 18px 52px rgba(0, 0, 0, 0.28);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--cream-50);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.65;
  text-rendering: optimizeLegibility;
}

body.menu-open {
  overflow: hidden;
}

img,
svg {
  display: block;
  max-width: 100%;
  height: auto;
}

button,
input,
select,
textarea {
  font: inherit;
}

button,
select {
  cursor: pointer;
}

a {
  color: var(--navy-700);
  text-underline-offset: 0.18em;
  text-decoration-thickness: 0.08em;
}

a:hover {
  color: var(--teal-700);
}

:where(a, button, input, select, textarea):focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

.skip-link {
  position: fixed;
  z-index: 1000;
  top: -6rem;
  left: 1rem;
  padding: 0.7rem 1rem;
  border: 2px solid var(--focus);
  border-radius: var(--radius);
  background: var(--paper);
  color: var(--ink);
  font-weight: 800;
}

.skip-link:focus {
  top: 1rem;
}

.screen-reader-text {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.site-shell {
  width: min(var(--content), calc(100% - 2.5rem));
  margin-inline: auto;
}

.site-header {
  position: sticky;
  z-index: 50;
  top: 0;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--cream-50) 94%, transparent);
  backdrop-filter: blur(14px);
}

.header-inner {
  display: flex;
  min-height: 76px;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
}

.site-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--ink);
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 0.2rem;
  background: #0a274c;
  color: #ffffff;
  font-family: var(--font-serif);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.13em;
}

.brand-copy {
  display: grid;
  line-height: 1.15;
}

.brand-copy strong {
  color: var(--navy-900);
  font-size: 0.96rem;
  letter-spacing: 0.01em;
}

.brand-copy small {
  margin-top: 0.2rem;
  color: var(--muted);
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.header-actions,
.primary-menu {
  display: flex;
  align-items: center;
}

.header-actions {
  gap: 0.75rem;
}

.primary-menu {
  gap: 1.35rem;
  padding: 0;
  margin: 0;
  list-style: none;
}

.primary-menu a {
  color: var(--ink);
  font-size: 0.82rem;
  font-weight: 750;
  text-decoration: none;
}

.primary-menu a:hover,
.primary-menu .current-menu-item > a {
  color: var(--teal-700);
}

.theme-toggle,
.menu-toggle {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--paper);
  color: var(--ink);
  font-size: 0.78rem;
  font-weight: 800;
}

.theme-toggle {
  padding: 0.55rem 0.85rem;
}

.theme-toggle-icon {
  width: 1.1rem;
  text-align: center;
  font-size: 1rem;
  line-height: 1;
}

.menu-toggle {
  display: none;
  width: 42px;
  padding: 0;
}

.hero {
  border-bottom: 1px solid var(--line);
  background:
    linear-gradient(110deg, color-mix(in srgb, #0a274c 8%, transparent), transparent 56%),
    var(--cream-50);
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(270px, 0.62fr);
  min-height: 510px;
  border-inline: 1px solid var(--line);
}

.hero-main {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  padding: clamp(3.5rem, 8vw, 7rem) clamp(2rem, 7vw, 5.5rem);
}

.eyebrow,
.section-kicker,
.card-kicker {
  margin: 0 0 0.8rem;
  color: var(--teal-700);
  font-size: 0.72rem;
  font-weight: 850;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.eyebrow::before {
  width: 2rem;
  height: 2px;
  background: var(--teal-700);
  content: "";
}

.hero h1 {
  max-width: 760px;
  margin: 0;
  color: var(--navy-950);
  font-family: var(--font-serif);
  font-size: clamp(2.75rem, 7vw, 5.6rem);
  font-weight: 500;
  letter-spacing: -0.045em;
  line-height: 0.98;
}

.hero-intro {
  max-width: 680px;
  margin: 1.5rem 0 0;
  color: var(--muted);
  font-size: clamp(1.02rem, 2vw, 1.18rem);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  margin-top: 2rem;
}

.button {
  display: inline-flex;
  min-height: 46px;
  align-items: center;
  justify-content: center;
  padding: 0.68rem 1rem;
  border: 1px solid var(--navy-900);
  border-radius: var(--radius);
  font-size: 0.84rem;
  font-weight: 800;
  text-decoration: none;
}

.button-primary {
  background: #0a274c;
  color: #ffffff;
}

.button-primary:hover {
  background: #123967;
  color: #ffffff;
}

.button-secondary {
  background: transparent;
  color: var(--navy-900);
}

.hero-aside {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 2.3rem;
  border-left: 1px solid var(--line);
  background: #0a274c;
  color: #eaf3fb;
}

.hero-aside .card-kicker {
  color: #74d3c9;
}

.hero-aside h2 {
  margin: 0;
  color: #ffffff;
  font-family: var(--font-serif);
  font-size: 1.75rem;
  font-weight: 500;
  line-height: 1.15;
}

.hero-aside p {
  margin: 1rem 0 0;
  color: #c9d9e7;
  font-size: 0.9rem;
}

.archive-section {
  padding-block: clamp(3.5rem, 7vw, 6rem);
}

.archive-heading {
  display: grid;
  grid-template-columns: 1fr minmax(260px, 0.6fr);
  align-items: end;
  gap: 2rem;
  margin-bottom: 2rem;
}

.archive-heading h2,
.page-heading h1 {
  margin: 0;
  color: var(--navy-950);
  font-family: var(--font-serif);
  font-size: clamp(2.1rem, 4.2vw, 3.6rem);
  font-weight: 500;
  letter-spacing: -0.025em;
  line-height: 1.04;
}

.archive-heading > p {
  margin: 0;
  color: var(--muted);
}

.filter-panel {
  padding: 1.4rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  box-shadow: var(--shadow);
}

.filter-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr)) auto;
  align-items: end;
  gap: 1rem;
}

.filter-field {
  display: grid;
  gap: 0.45rem;
  color: var(--ink);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.filter-field select {
  width: 100%;
  min-height: 46px;
  padding: 0.65rem 2.2rem 0.65rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: 0.3rem;
  background: var(--cream-50);
  color: var(--ink);
}

.filter-submit {
  min-height: 46px;
  padding-inline: 1.1rem;
  border: 1px solid #0a274c;
  border-radius: 0.3rem;
  background: #0a274c;
  color: #ffffff;
  font-weight: 850;
}

.filter-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 2rem;
  margin-top: 1rem;
  color: var(--muted);
  font-size: 0.82rem;
}

.filter-clear {
  color: var(--navy-700);
  font-weight: 800;
}

.article-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.25rem;
  margin-top: 2rem;
}

.article-card {
  display: flex;
  min-height: 340px;
  flex-direction: column;
  padding: clamp(1.5rem, 3vw, 2.25rem);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  box-shadow: 0 8px 24px rgba(6, 27, 53, 0.045);
}

.article-card:hover {
  border-color: var(--navy-700);
  transform: translateY(-2px);
  transition: transform 160ms ease, border-color 160ms ease;
}

.article-taxonomies,
.article-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.55rem;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 750;
}

.term-chip {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.48rem;
  border: 1px solid color-mix(in srgb, var(--teal-700) 38%, var(--line));
  border-radius: 999px;
  background: var(--teal-100);
  color: var(--teal-700);
  line-height: 1.2;
  text-decoration: none;
}

.article-card time {
  display: block;
  margin-top: 1rem;
  color: var(--muted);
  font-size: 0.78rem;
}

.article-card h2 {
  margin: 0.65rem 0 0;
  font-family: var(--font-serif);
  font-size: clamp(1.55rem, 3vw, 2.15rem);
  font-weight: 500;
  line-height: 1.12;
}

.article-card h2 a {
  color: var(--navy-950);
  text-decoration: none;
}

.article-card h2 a:hover {
  color: var(--teal-700);
}

.article-card .summary {
  margin: 1rem 0 1.5rem;
  color: var(--muted);
}

.read-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: auto;
  color: var(--navy-700);
  font-size: 0.83rem;
  font-weight: 850;
}

.read-link::after {
  content: "→";
  font-size: 1rem;
}

.empty-state {
  padding: clamp(3rem, 8vw, 6rem) 1.5rem;
  margin-top: 2rem;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--paper) 72%, transparent);
  text-align: center;
}

.empty-state h2 {
  margin: 0;
  color: var(--navy-950);
  font-family: var(--font-serif);
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  font-weight: 500;
}

.empty-state p:last-child {
  max-width: 590px;
  margin: 1rem auto 0;
  color: var(--muted);
}

.page-heading {
  padding-block: clamp(3.5rem, 8vw, 6rem) 2rem;
}

.page-heading .archive-description {
  max-width: 760px;
  color: var(--muted);
}

.single-header {
  padding: clamp(3.5rem, 9vw, 7rem) 0 clamp(2.5rem, 6vw, 4.5rem);
  border-bottom: 1px solid var(--line);
}

.reading-width {
  width: min(var(--reading), calc(100% - 2.5rem));
  margin-inline: auto;
}

.single-header h1 {
  margin: 1rem 0 1.35rem;
  color: var(--navy-950);
  font-family: var(--font-serif);
  font-size: clamp(2.5rem, 7vw, 5rem);
  font-weight: 500;
  letter-spacing: -0.04em;
  line-height: 1.01;
}

.single-deck {
  margin: 0 0 1.5rem;
  color: var(--muted);
  font-size: clamp(1.05rem, 2.2vw, 1.3rem);
}

.single-content {
  padding-block: clamp(2.5rem, 6vw, 5rem);
}

.entry-content {
  font-family: var(--font-serif);
  font-size: clamp(1.06rem, 1.6vw, 1.17rem);
  line-height: 1.78;
}

.entry-content > * {
  margin-block: 0 1.35em;
}

.entry-content :where(h2, h3, h4) {
  margin-block: 1.7em 0.65em;
  color: var(--navy-950);
  line-height: 1.16;
}

.entry-content h2 {
  font-size: clamp(1.75rem, 4vw, 2.45rem);
}

.entry-content h3 {
  font-size: clamp(1.4rem, 3vw, 1.85rem);
}

.entry-content a {
  overflow-wrap: anywhere;
}

.entry-content blockquote {
  padding: 0.3rem 0 0.3rem 1.5rem;
  border-left: 4px solid var(--teal-700);
  color: var(--muted);
  font-style: italic;
}

.entry-content :where(pre, code) {
  font-family: ui-monospace, "SFMono-Regular", Consolas, monospace;
}

.entry-content pre {
  overflow-x: auto;
  padding: 1rem;
  border: 1px solid var(--line);
  background: var(--soft);
  font-size: 0.86rem;
}

.entry-content table {
  display: block;
  width: 100%;
  overflow-x: auto;
  border-collapse: collapse;
  font-family: var(--font-sans);
  font-size: 0.9rem;
}

.entry-content :where(th, td) {
  padding: 0.65rem;
  border: 1px solid var(--line);
  text-align: left;
}

.entry-content th {
  background: var(--soft);
}

.article-footer {
  padding-top: 2rem;
  margin-top: 3rem;
  border-top: 1px solid var(--line);
  font-family: var(--font-sans);
}

.post-navigation .nav-links {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  padding-top: 2rem;
  margin-top: 2rem;
  border-top: 1px solid var(--line);
}

.post-navigation a {
  display: grid;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  text-decoration: none;
}

.nav-subtitle {
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.nav-title {
  margin-top: 0.35rem;
  color: var(--navy-900);
  font-family: var(--font-serif);
  font-size: 1.05rem;
}

.pagination {
  margin-top: 2rem;
}

.nav-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.page-numbers {
  display: grid;
  min-width: 42px;
  min-height: 42px;
  place-items: center;
  padding: 0.4rem 0.65rem;
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--ink);
  text-decoration: none;
}

.page-numbers.current {
  border-color: #0a274c;
  background: #0a274c;
  color: #ffffff;
}

.site-footer {
  margin-top: clamp(3rem, 7vw, 6rem);
  border-top: 1px solid var(--line);
  background: #061b35;
  color: #d8e5ef;
}

.footer-inner {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: end;
  gap: 2rem;
  padding-block: 2.5rem;
}

.footer-title {
  margin: 0;
  color: #ffffff;
  font-family: var(--font-serif);
  font-size: 1.45rem;
}

.footer-copy {
  max-width: 620px;
  margin: 0.65rem 0 0;
  color: #aebfd0;
  font-size: 0.86rem;
}

.footer-meta {
  color: #aebfd0;
  font-size: 0.76rem;
  text-align: right;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}

@media (max-width: 900px) {
  .hero-grid,
  .archive-heading {
    grid-template-columns: 1fr;
  }

  .hero-aside {
    min-height: 260px;
    border-top: 1px solid #34506b;
    border-left: 0;
  }

  .filter-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .filter-submit {
    width: 100%;
  }
}

@media (max-width: 720px) {
  .site-shell,
  .reading-width {
    width: min(100% - 1.5rem, var(--content));
  }

  .header-inner {
    min-height: 68px;
  }

  .brand-copy small,
  .theme-toggle-label {
    display: none;
  }

  .theme-toggle {
    width: 42px;
    padding: 0;
  }

  .menu-toggle {
    display: inline-flex;
  }

  .site-navigation {
    position: absolute;
    top: calc(100% + 1px);
    right: 0;
    left: 0;
    display: none;
    padding: 1rem 1.25rem 1.4rem;
    border-bottom: 1px solid var(--line);
    background: var(--paper);
    box-shadow: var(--shadow);
  }

  .site-navigation.is-open {
    display: block;
  }

  .primary-menu {
    align-items: stretch;
    flex-direction: column;
    gap: 0;
  }

  .primary-menu a {
    display: block;
    padding: 0.8rem 0;
    border-bottom: 1px solid var(--line);
  }

  .hero-grid {
    min-height: 0;
    border-inline: 0;
  }

  .hero-main {
    min-height: 440px;
    padding-inline: 0.75rem;
  }

  .hero h1 {
    font-size: clamp(2.7rem, 15vw, 4.2rem);
  }

  .article-grid,
  .filter-grid,
  .post-navigation .nav-links,
  .footer-inner {
    grid-template-columns: 1fr;
  }

  .article-card {
    min-height: 0;
  }

  .filter-summary {
    align-items: flex-start;
    flex-direction: column;
  }

  .footer-meta {
    text-align: left;
  }
}
