/* ============================================================
   style.css — Shared styles for Veritas Scientiae
   ============================================================ */

:root {
  --color-bg: #f4f5f7;
  --color-surface: #ffffff;
  --color-surface-alt: #f0f2f5;
  --color-text: #1c2230;
  --color-text-muted: #5b6472;
  --color-border: #e2e5ea;
  --color-border-strong: #ccd2da;
  --color-primary: #1b4d6b;
  --color-primary-dark: #123549;
  --color-accent: #2f8f7f;
  --color-accent-dark: #257566;
  --color-news: #b5541a;
  --color-reviews: #6a3f99;
  --color-research: #1b6b3f;
  --color-danger: #b3261e;
  --radius: 8px;
  --radius-lg: 12px;
  --max-width: 1120px;
  --shadow-sm: 0 1px 2px rgba(18, 53, 73, 0.06);
  --shadow-md: 0 4px 16px rgba(18, 53, 73, 0.10);
  --font-serif: Georgia, "Iowan Old Style", "Times New Roman", serif;
  font-size: 16px;
}

* { box-sizing: border-box; }

/* The [hidden] attribute is how JS toggles visibility everywhere in this
   app (auth-gated toolbars, modals, image previews, ...). Any class on the
   same element that sets its own `display` (e.g. `.people-toolbar { display:
   flex }`) has equal CSS specificity to the browser's default `[hidden] {
   display: none }` rule, and author styles win that tie — so without this,
   `hidden` silently stops hiding anything the moment a class gives it a
   display value. This rule guarantees `hidden` always wins. */
[hidden] { display: none !important; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  background: var(--color-bg);
  color: var(--color-text);
  line-height: 1.55;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

body > main, body > .hero { flex: none; }
body > footer { margin-top: auto; }

h1, h2, h3, h4 {
  font-family: var(--font-serif);
  color: var(--color-primary-dark);
  line-height: 1.25;
  margin: 0 0 0.5em;
}

a { color: var(--color-primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* One consistent, always-visible keyboard focus ring. */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[contenteditable]:focus-visible {
  outline: 3px solid var(--color-accent);
  outline-offset: 2px;
  border-radius: 3px;
}

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.25rem;
  width: 100%;
}

/* ---------- Header / Nav ---------- */

#app-header {
  background: var(--color-primary-dark);
  color: #fff;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-sm);
}

.header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0.7rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.brand {
  color: #fff;
  font-family: var(--font-serif);
  font-size: 1.2rem;
  font-weight: bold;
  letter-spacing: 0.02em;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  white-space: nowrap;
}
.brand:hover { text-decoration: none; opacity: 0.9; }
.brand-mark { color: var(--color-accent); }

.site-nav { flex: 1 1 auto; }

.nav-list {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin: 0;
  padding: 0;
}

.nav-item { position: relative; }

/* Push the auth controls to the far right of the nav row. */
.nav-item:has(> .nav-btn-link),
.nav-item:has(> .nav-user) { margin-left: auto; }
.nav-item:has(> .nav-user) + .nav-item { margin-left: 0; }

.site-nav a,
.nav-menu-btn {
  color: #dbe4ea;
  font-size: 0.93rem;
  font-weight: 500;
  font-family: inherit;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.45rem 0.7rem;
  border-radius: var(--radius);
  background: transparent;
  border: none;
  cursor: pointer;
  line-height: 1.3;
  white-space: nowrap;
}
.site-nav a:hover,
.nav-menu-btn:hover { color: #fff; background: rgba(255, 255, 255, 0.09); text-decoration: none; }

.site-nav a.active,
.nav-menu-btn.active {
  color: #fff;
  box-shadow: inset 0 -2px 0 var(--color-accent);
}

.nav-caret {
  border: 4px solid transparent;
  border-top-color: currentColor;
  margin-top: 3px;
  transition: transform 0.15s ease;
}
.nav-item.open .nav-caret { transform: rotate(180deg); margin-top: -3px; }

/* ---------- Dropdown menus ---------- */

.nav-menu {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  min-width: 15rem;
  list-style: none;
  margin: 0;
  padding: 0.4rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  z-index: 120;
}
.nav-item.open .nav-menu { display: block; }

.nav-menu a {
  display: block;
  color: var(--color-text);
  padding: 0.55rem 0.75rem;
  border-radius: var(--radius);
  font-weight: 500;
}
.nav-menu a:hover { background: var(--color-surface-alt); color: var(--color-primary-dark); }
.nav-menu a.active {
  color: var(--color-primary);
  background: #eaf2f6;
  box-shadow: none;
  font-weight: 600;
}

.nav-btn-link {
  background: var(--color-accent);
  color: #fff !important;
  padding: 0.45rem 0.9rem !important;
  border-radius: var(--radius);
  white-space: nowrap;
}
.nav-btn-link:hover { background: var(--color-accent-dark); text-decoration: none; }

.nav-btn {
  background: transparent;
  border: 1px solid #4c6577;
  color: #dbe4ea;
  padding: 0.35rem 0.8rem;
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 0.88rem;
  font-family: inherit;
  white-space: nowrap;
}
.nav-btn:hover { background: #22475e; color: #fff; }

.nav-user {
  color: #9fb3c0;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0 0.4rem;
  white-space: nowrap;
}

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 6px;
  margin-left: auto;
}
.nav-toggle span {
  width: 22px;
  height: 2px;
  background: #fff;
  display: block;
}

.header-search {
  display: flex;
  align-items: center;
  /* Shrinks before the nav labels do, so those never wrap mid-word. */
  flex: 0 1 220px;
  min-width: 8rem;
}
.header-search input[type="search"] {
  width: 100%;
  padding: 0.42rem 0.7rem;
  border: 1px solid #3c5b70;
  border-right: none;
  border-radius: var(--radius) 0 0 var(--radius);
  font-size: 0.86rem;
  font-family: inherit;
  background: #1c3a4d;
  color: #fff;
}
.header-search input[type="search"]::placeholder { color: #a9bdc9; }
.header-search button {
  background: var(--color-accent);
  color: #fff;
  border: none;
  padding: 0.42rem 0.65rem;
  border-radius: 0 var(--radius) var(--radius) 0;
  cursor: pointer;
  font-size: 0.92rem;
  line-height: 1.4;
}
.header-search button:hover { background: var(--color-accent-dark); }

/* ---------- Accessibility utilities ---------- */

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

.skip-link {
  position: absolute;
  left: 0.5rem;
  top: -3rem;
  background: var(--color-accent);
  color: #fff;
  padding: 0.6rem 1rem;
  border-radius: var(--radius);
  z-index: 1000;
  transition: top 0.15s ease;
}
.skip-link:focus {
  top: 0.5rem;
  text-decoration: none;
}

/* ---------- Hero / sections ---------- */

.hero {
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
  color: #fff;
  padding: 3.5rem 1.25rem;
  text-align: center;
}
.hero h1 { color: #fff; font-size: 2.4rem; margin-bottom: 0.6rem; letter-spacing: 0.01em; }
.hero p { color: #dbe4ea; max-width: 640px; margin: 0 auto; font-size: 1.05rem; }

.section { padding: 2.5rem 0; }

.section-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
  border-bottom: 2px solid var(--color-border-strong);
  padding-bottom: 0.5rem;
}
.section-header h2 { margin: 0; font-size: 1.45rem; }
.section-header a { font-size: 0.9rem; white-space: nowrap; font-weight: 600; }

.page-header { padding: 2.25rem 0 1.25rem; }
.page-header-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1.5rem;
  border-bottom: 2px solid var(--color-border-strong);
  padding-bottom: 1rem;
}
.page-header h1 { font-size: 2rem; margin-bottom: 0.35rem; }
.page-intro, .page-header p {
  color: var(--color-text-muted);
  margin: 0;
  max-width: 60ch;
}
.section-intro { color: var(--color-text-muted); margin: -0.5rem 0 1.25rem; }

/* ---------- Article listing rows ----------
   A narrow rail (type + date), the title/byline, and a fixed-ratio
   cover image on the right. The ratio + object-fit pairing is what
   keeps uploads of any shape cropped rather than stretched. */

.article-list {
  display: flex;
  flex-direction: column;
}

.article-card {
  display: grid;
  grid-template-columns: 8.5rem minmax(0, 1fr) 12.5rem;
  gap: 1.75rem;
  align-items: start;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 1.4rem 1.5rem;
  margin-bottom: 1rem;
  transition: box-shadow 0.15s ease, border-color 0.15s ease;
}
.article-card:hover { box-shadow: var(--shadow-md); border-color: var(--color-border-strong); }

.article-card-rail {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.45rem;
  padding-top: 0.15rem;
}

.article-card-main { min-width: 0; }
.article-card h3 {
  font-size: 1.28rem;
  margin: 0 0 0.4rem;
  line-height: 1.3;
}
.article-card h3 a { color: var(--color-primary-dark); }
.article-card h3 a:hover { text-decoration: underline; }

.article-thumb-link {
  display: block;
  border-radius: var(--radius);
  overflow: hidden;
}
.article-thumb {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  background: var(--color-surface-alt);
}
.article-thumb-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-serif);
  font-size: 1.4rem;
  color: #fff;
  opacity: 0.85;
}
.tag-bg-news { background: var(--color-news); }
.tag-bg-reviews { background: var(--color-reviews); }
.tag-bg-research { background: var(--color-research); }

.article-date { color: var(--color-text-muted); font-size: 0.83rem; }
.article-author { color: var(--color-text-muted); font-size: 0.92rem; margin: 0; }
.article-author a { color: var(--color-primary); font-weight: 500; }

.tag {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.22rem 0.55rem;
  border-radius: 999px;
  color: #fff;
  white-space: nowrap;
}
.tag-news { background: var(--color-news); }
.tag-reviews { background: var(--color-reviews); }
.tag-research { background: var(--color-research); }

.link-btn {
  background: none;
  border: none;
  color: var(--color-primary);
  font-weight: 600;
  cursor: pointer;
  padding: 0;
  font-size: 0.9rem;
}
.link-btn:hover { text-decoration: underline; }

.empty-state {
  color: var(--color-text-muted);
  padding: 2rem;
  text-align: center;
  border: 1px dashed var(--color-border-strong);
  border-radius: var(--radius);
  background: var(--color-surface);
}

/* ---------- Staff / Authors directory ---------- */

.people-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1.25rem;
}
.person-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 1.5rem 1.25rem 1.25rem;
  text-align: center;
  scroll-margin-top: 90px;
  transition: box-shadow 0.15s ease, border-color 0.15s ease;
}
.person-card:hover { box-shadow: var(--shadow-md); border-color: var(--color-border-strong); }
.person-card-link { display: block; color: inherit; }
.person-card-link:hover { text-decoration: none; }
.person-card-link:hover h3 { text-decoration: underline; }
.person-card h3 { font-size: 1.08rem; margin: 0 0 0.15rem; }

.person-avatar, .person-photo {
  width: 84px; height: 84px;
  border-radius: 50%;
  margin: 0 auto 0.85rem;
  display: flex;
  align-items: center;
  justify-content: center;
}
.person-avatar {
  background: var(--color-primary);
  color: #fff;
  font-family: var(--font-serif);
  font-size: 1.6rem;
  letter-spacing: 0.02em;
}
.person-photo {
  object-fit: cover;
  border: 2px solid var(--color-border);
  display: block;
}

.person-role { color: var(--color-accent); font-weight: 600; font-size: 0.88rem; margin-bottom: 0.6rem; }
.person-card-cta { font-size: 0.85rem; color: var(--color-primary); font-weight: 600; }
.person-actions { display: flex; gap: 0.5rem; justify-content: center; margin-top: 1rem; padding-top: 0.9rem; border-top: 1px solid var(--color-border); }
.people-toolbar { display: flex; justify-content: flex-end; margin-bottom: 1.25rem; }

/* ---------- Person profile page ---------- */

.profile-header {
  display: flex;
  align-items: center;
  gap: 1.75rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  margin-bottom: 1.5rem;
}
.profile-header .person-avatar,
.profile-header .person-photo {
  width: 128px; height: 128px;
  margin: 0;
  flex: none;
  font-size: 2.4rem;
}
.profile-header h1 { font-size: 1.9rem; margin-bottom: 0.25rem; }
.profile-header .person-role { font-size: 1rem; margin-bottom: 0; }
.profile-bio {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  margin-bottom: 2rem;
}
.profile-bio h2 { font-size: 1.15rem; }
.profile-bio p { margin: 0; white-space: pre-line; max-width: 68ch; }

/* ---------- Prose pages (About Us / Contact) ---------- */

.prose {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 2.25rem 2.5rem;
  max-width: 74ch;
  font-size: 1.03rem;
}
.prose > :first-child { margin-top: 0; }
.prose > :last-child { margin-bottom: 0; }
.prose h2 { font-size: 1.3rem; margin: 1.8em 0 0.5em; }
.prose h3 { font-size: 1.1rem; margin: 1.5em 0 0.4em; }
.prose p { margin: 0 0 1em; }
.prose ul, .prose ol { margin: 0 0 1em; padding-left: 1.3em; }
.prose li { margin-bottom: 0.4em; }
.prose img { max-width: 100%; border-radius: var(--radius); }
.prose blockquote {
  margin: 1.2em 0;
  padding: 0.4em 0 0.4em 1.2em;
  border-left: 3px solid var(--color-accent);
  color: var(--color-text-muted);
  font-style: italic;
}

/* ---------- Forms ---------- */

.form-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 2rem;
  max-width: 420px;
  margin: 0 auto;
}
.form-group { margin-bottom: 1.1rem; }
label { display: block; font-weight: 600; margin-bottom: 0.35rem; font-size: 0.9rem; }
input[type="text"], input[type="email"], input[type="password"],
input[type="date"], input[type="search"], select, textarea {
  width: 100%;
  padding: 0.55rem 0.7rem;
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius);
  font-size: 0.95rem;
  font-family: inherit;
  background: #fff;
  color: var(--color-text);
}
textarea { resize: vertical; min-height: 90px; }

.photo-field { display: flex; gap: 1rem; align-items: flex-start; }
.photo-preview {
  width: 84px; height: 84px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--color-border);
  flex: none;
}

.btn {
  display: inline-block;
  background: var(--color-primary);
  color: #fff;
  border: none;
  padding: 0.6rem 1.2rem;
  border-radius: var(--radius);
  font-size: 0.95rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  text-align: center;
}
.btn:hover { background: var(--color-primary-dark); text-decoration: none; color: #fff; }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.btn-danger { background: var(--color-danger); }
.btn-danger:hover { background: #8f1e18; }
.btn-secondary { background: transparent; color: var(--color-primary); border: 1px solid var(--color-primary); }
.btn-secondary:hover { background: #eaf2f6; color: var(--color-primary); }
.btn-sm { padding: 0.35rem 0.75rem; font-size: 0.85rem; }

.form-error {
  color: var(--color-danger);
  font-size: 0.88rem;
  margin-top: 0.5rem;
  min-height: 1.2em;
}
.form-note {
  color: var(--color-text-muted);
  font-size: 0.85rem;
  margin-top: 1rem;
  text-align: center;
}
.form-inline-note { color: var(--color-text-muted); font-size: 0.82rem; margin: 0.4rem 0 0; }

/* ---------- Dashboard ---------- */

.dash-toolbar {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 1.5rem;
}
.dash-toolbar select { width: auto; }
.dash-toolbar label { margin: 0; }

.dash-table-wrap {
  overflow-x: auto;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
}
table.dash-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 720px;
}
.dash-table th, .dash-table td {
  text-align: left;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--color-border);
  font-size: 0.92rem;
  vertical-align: top;
}
.dash-table tr:last-child td { border-bottom: none; }
.dash-table th {
  background: var(--color-surface-alt);
  font-family: var(--font-serif);
}
.status-pill {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  white-space: nowrap;
}
.status-approved { background: #dcf3e6; color: #1b6b3f; }
.status-pending { background: #fbe8d7; color: #b5541a; }
.role-admin { background: #e4defa; color: #4a2f99; }
.role-editor { background: #dbe9f2; color: #1b4d6b; }
.dash-actions { display: flex; gap: 0.4rem; flex-wrap: wrap; }

/* Modals */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(20, 26, 34, 0.55);
  display: flex; align-items: center; justify-content: center;
  padding: 1rem;
  z-index: 200;
}
.modal {
  background: #fff;
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  max-width: 560px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-md);
}
.modal-wide { max-width: 960px; }
.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.6rem;
  margin-top: 1rem;
}

/* ---------- Rich-text editor ----------
   Toolbar sits in a sticky column to the RIGHT of the writing area, so the
   formatting controls stay in reach at any scroll position in a long
   article rather than scrolling off the top. */

.rte-wrap {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 12.5rem;
  gap: 1rem;
  align-items: start;
}

.rte-editable {
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius);
  padding: 1rem 1.15rem;
  min-height: 320px;
  background: #fff;
  font-size: 0.98rem;
  line-height: 1.6;
  overflow-wrap: anywhere;
}
.rte-editable:empty:before {
  content: attr(data-placeholder);
  color: var(--color-text-muted);
}
.rte-editable img { max-width: 100%; border-radius: 4px; margin: 0.5rem 0; }
.rte-editable blockquote {
  margin: 1em 0;
  padding-left: 1em;
  border-left: 3px solid var(--color-accent);
  color: var(--color-text-muted);
}

.rte-toolbar {
  position: sticky;
  top: 5.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  background: var(--color-surface-alt);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 0.85rem;
}
.rte-group { display: flex; flex-direction: column; gap: 0.35rem; }
.rte-group-label {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--color-text-muted);
}
.rte-btn-row { display: flex; flex-wrap: wrap; gap: 0.3rem; }
.rte-toolbar button {
  background: #fff;
  border: 1px solid var(--color-border-strong);
  border-radius: 4px;
  min-width: 2.1rem;
  padding: 0.3rem 0.45rem;
  font-size: 0.83rem;
  font-family: inherit;
  color: var(--color-text);
  cursor: pointer;
  flex: 0 0 auto;
}
.rte-toolbar button:hover { background: #e9edf1; border-color: var(--color-primary); }
.rte-toolbar select {
  width: 100%;
  padding: 0.3rem 0.4rem;
  font-size: 0.83rem;
  border: 1px solid var(--color-border-strong);
  border-radius: 4px;
  background: #fff;
}

.image-preview {
  display: block;
  max-width: 220px;
  max-height: 140px;
  object-fit: cover;
  border-radius: var(--radius);
  border: 1px solid var(--color-border);
  margin-top: 0.5rem;
}

/* ---------- Article detail page ---------- */

.article-detail {
  max-width: 760px;
  margin: 0 auto;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 2.25rem 2.5rem 2.5rem;
}
.article-detail-hero {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: var(--radius);
  margin-bottom: 1.5rem;
  display: block;
}
.article-detail h1 { font-size: 1.95rem; margin: 0.6rem 0 0.5rem; }
.article-detail-meta { color: var(--color-text-muted); margin-bottom: 1.5rem; }

/* Summary (News) / Abstract (Research, Reviews) — moved off the listing
   pages, where a long one stretched the row, to here above the body. */
.article-abstract {
  background: #f2f6f8;
  border-left: 4px solid var(--color-accent);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 1.15rem 1.4rem;
  margin-bottom: 1.75rem;
}
.article-abstract h2 {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--color-accent-dark);
  font-family: inherit;
  margin: 0 0 0.4rem;
}
.article-abstract p { margin: 0; font-size: 1rem; }

.article-body { font-size: 1.03rem; line-height: 1.7; }
.article-body p { margin: 0 0 1em; }
.article-body img { max-width: 100%; border-radius: var(--radius); margin: 0.75em 0; }
.article-body h2, .article-body h3 { margin-top: 1.4em; }
.article-body blockquote {
  margin: 1.2em 0;
  padding: 0.4em 0 0.4em 1.2em;
  border-left: 3px solid var(--color-accent);
  color: var(--color-text-muted);
  font-style: italic;
}
.back-link { display: inline-block; margin-bottom: 1.25rem; font-weight: 600; }
.pending-banner {
  background: #fbe8d7;
  color: #7a3d0e;
  border: 1px solid #f0c396;
  border-radius: var(--radius);
  padding: 0.75rem 1rem;
  margin-bottom: 1.5rem;
  font-size: 0.9rem;
  font-weight: 600;
}

/* ---------- Footer ---------- */

footer {
  border-top: 1px solid var(--color-border);
  margin-top: 3rem;
  background: var(--color-surface);
  color: var(--color-text-muted);
  font-size: 0.88rem;
}
.footer-inner {
  display: grid;
  grid-template-columns: 2fr repeat(auto-fit, minmax(150px, 1fr));
  gap: 2rem;
  padding-top: 2.5rem;
  padding-bottom: 2rem;
}
.footer-col h4 {
  font-family: inherit;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-text);
  margin-bottom: 0.75rem;
}
.footer-col ul { list-style: none; margin: 0; padding: 0; }
.footer-col li { margin-bottom: 0.45rem; }
.footer-brand .brand-line {
  font-family: var(--font-serif);
  font-size: 1.1rem;
  font-weight: bold;
  color: var(--color-primary-dark);
  margin-bottom: 0.5rem;
}
.footer-brand p { margin: 0; max-width: 34ch; }
.footer-base {
  border-top: 1px solid var(--color-border);
  padding: 1.1rem 1.25rem;
  text-align: center;
  font-size: 0.82rem;
}

/* ---------- Responsive ---------- */

@media (max-width: 980px) {
  .article-card { grid-template-columns: 7rem minmax(0, 1fr) 10rem; gap: 1.25rem; }
  .rte-wrap { grid-template-columns: minmax(0, 1fr) 11rem; }
}

/* The nav collapses earlier than the content reflows. A signed-in editor's
   header carries three extra items (Dashboard, role, Sign out), and with
   nowrap labels that row runs out of space around 1030px — well before the
   article grid needs to change. So the two breakpoints are deliberately
   separate rather than sharing one value. */
@media (max-width: 1080px) {
  .nav-toggle { display: flex; }
  .header-inner { flex-wrap: wrap; row-gap: 0.6rem; }

  .site-nav { display: none; flex-basis: 100%; }
  .site-nav.open { display: block; }
  .nav-list {
    flex-direction: column;
    align-items: stretch;
    gap: 0.15rem;
    padding: 0.5rem 0;
  }
  .nav-item:has(> .nav-btn-link),
  .nav-item:has(> .nav-user) { margin-left: 0; }
  .site-nav a, .nav-menu-btn, .nav-btn, .nav-btn-link {
    display: flex;
    width: 100%;
    justify-content: flex-start;
  }
  .nav-btn-link { justify-content: center; }
  .nav-menu-btn { justify-content: space-between; }

  /* Dropdowns become inline, indented sub-lists inside the collapsed nav. */
  .nav-menu {
    position: static;
    min-width: 0;
    box-shadow: none;
    border: none;
    background: rgba(255, 255, 255, 0.06);
    margin: 0.15rem 0 0.35rem 0.75rem;
    padding: 0.25rem;
  }
  .nav-menu a { color: #dbe4ea; }
  .nav-menu a:hover { background: rgba(255, 255, 255, 0.09); color: #fff; }
  .nav-menu a.active { background: rgba(255, 255, 255, 0.12); color: #fff; }

  .header-search { order: 3; flex: 1 1 100%; }
}

@media (max-width: 860px) {
  .hero h1 { font-size: 1.75rem; }

  /* Cover image drops below the text rather than squeezing into a sliver. */
  .article-card {
    grid-template-columns: minmax(0, 1fr);
    gap: 0.85rem;
  }
  .article-card-rail { flex-direction: row; align-items: center; gap: 0.75rem; }
  .article-thumb { aspect-ratio: 16 / 9; }
  .article-thumb-link { order: -1; }

  .rte-wrap { grid-template-columns: minmax(0, 1fr); }
  .rte-toolbar { position: static; flex-direction: row; flex-wrap: wrap; gap: 1rem; }
  .rte-group { flex: 0 0 auto; }
  .rte-toolbar select { width: auto; }

  .profile-header { flex-direction: column; text-align: center; gap: 1rem; }
  .profile-header .person-avatar, .profile-header .person-photo { margin: 0 auto; }

  .prose { padding: 1.5rem 1.35rem; }
  .article-detail { padding: 1.5rem 1.35rem 2rem; }
  .page-header-row { flex-direction: column; gap: 0.85rem; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
