/* =========================================================
   CPBPress — Cell Physiol Biochem Press
   Stylesheet for the publisher hub site.
   ========================================================= */

:root {
  /* Core palette: white / navy / anthracite */
  --navy: #101a2e;
  --navy-soft: #1c2942;
  --ink: #16202f;
  --text: #333c4a;
  --text-muted: #626c7a;
  --bg: #ffffff;
  --bg-alt: #f5f6f8;
  --border: #e2e5ea;
  --border-strong: #cbd0d8;

  /* Journal accent colors, carried over from each journal's own identity */
  --accent-cpb: #1f7a5c;
  --accent-neuro: #b52c3d;
  --accent-ppex: #2c3ed1;

  --serif: Georgia, "Iowan Old Style", "Times New Roman", Times, serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

  --max-width: 1120px;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  overflow-x: hidden;
}
img { max-width: 100%; display: block; }
a { color: inherit; }
ul { list-style: none; margin: 0; padding: 0; }
h1, h2, h3, h4, p { margin: 0; }
button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* ---------- Focus visibility ---------- */
a:focus-visible,
button:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 3px;
  border-radius: 2px;
}

/* ---------- Skip link ---------- */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--navy);
  color: #fff;
  padding: 12px 20px;
  z-index: 200;
  font-size: 0.95rem;
}
.skip-link:focus {
  left: 12px;
  top: 12px;
}

/* ---------- Layout helpers ---------- */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}
.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: #ffffff;
  border-bottom: 1px solid var(--border);
}
.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
}
.wordmark {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 1.25rem;
  letter-spacing: 0.01em;
  color: var(--navy);
  text-decoration: none;
  white-space: nowrap;
}
.wordmark small {
  display: block;
  font-family: var(--sans);
  font-weight: 400;
  font-size: 0.6rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-top: 1px;
}

.nav-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: 1px solid var(--border-strong);
  border-radius: 4px;
}
.nav-toggle svg { width: 20px; height: 20px; }
.nav-toggle .icon-close { display: none; }
.nav-toggle[aria-expanded="true"] .icon-open { display: none; }
.nav-toggle[aria-expanded="true"] .icon-close { display: block; }

.main-nav {
  position: fixed;
  inset: 68px 0 0 0;
  background: var(--bg);
  transform: translateY(-8px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.15s ease, transform 0.15s ease, visibility 0.15s;
  overflow-y: auto;
}
.main-nav.is-open {
  opacity: 1;
  transform: translateY(0);
  visibility: visible;
}
.main-nav ul {
  display: flex;
  flex-direction: column;
  padding: 8px 24px 32px;
}
.main-nav a {
  display: block;
  padding: 16px 4px;
  border-bottom: 1px solid var(--border);
  text-decoration: none;
  font-size: 1.05rem;
  color: var(--ink);
}
.main-nav a:hover { color: var(--navy); }

@media (min-width: 760px) {
  .nav-toggle { display: none; }
  .main-nav {
    position: static;
    inset: auto;
    opacity: 1;
    visibility: visible;
    transform: none;
    background: transparent;
    overflow: visible;
  }
  .main-nav ul {
    flex-direction: row;
    padding: 0;
    gap: 8px;
  }
  .main-nav a {
    border-bottom: none;
    padding: 8px 14px;
    font-size: 0.95rem;
    border-radius: 4px;
  }
  .main-nav a:hover { background: var(--bg-alt); }
}

/* ---------- Hero ---------- */
.hero {
  padding: 64px 0 56px;
}
.hero .container { max-width: 760px; }
.hero h1 {
  font-family: var(--serif);
  font-size: clamp(2rem, 4.5vw, 2.75rem);
  line-height: 1.15;
  color: var(--navy);
  letter-spacing: -0.01em;
}
.hero .subhead {
  margin-top: 14px;
  font-size: 1.15rem;
  color: var(--text);
  font-weight: 500;
}
.hero p.lede {
  margin-top: 18px;
  font-size: 1.05rem;
  color: var(--text-muted);
  max-width: 62ch;
}

/* ---------- Section scaffolding ---------- */
section { padding: 64px 0; }
.section-alt { background: var(--bg-alt); }
.section-head {
  max-width: 640px;
  margin-bottom: 40px;
}
.section-head .eyebrow {
  display: block;
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 8px;
}
.section-head h2 {
  font-family: var(--serif);
  font-size: clamp(1.5rem, 3vw, 1.9rem);
  color: var(--navy);
}
.section-head p {
  margin-top: 12px;
  color: var(--text-muted);
  font-size: 1.02rem;
}

/* ---------- Journal cards ---------- */
.journal-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
}
@media (min-width: 760px) {
  .journal-grid { grid-template-columns: repeat(3, 1fr); }
}
.journal-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: #fff;
  border: 1px solid var(--border);
  border-top: 4px solid var(--card-accent, var(--navy));
  border-radius: 6px;
  padding: 28px 26px 26px;
  text-decoration: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}
.journal-card:hover,
.journal-card:focus-visible {
  border-color: var(--border-strong);
  box-shadow: 0 10px 24px -16px rgba(16, 26, 46, 0.35);
  transform: translateY(-2px);
}
.journal-card--cpb   { --card-accent: var(--accent-cpb); }
.journal-card--neuro { --card-accent: var(--accent-neuro); }
.journal-card--ppex  { --card-accent: var(--accent-ppex); }

.journal-card .kicker {
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--card-accent);
  font-weight: 600;
  margin-bottom: 10px;
}
.journal-card h3 {
  font-family: var(--serif);
  font-size: 1.28rem;
  color: var(--ink);
  line-height: 1.3;
}
.journal-card p {
  margin-top: 12px;
  color: var(--text-muted);
  font-size: 0.98rem;
  flex-grow: 1;
}
.journal-card .journal-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 16px;
  font-size: 0.82rem;
  color: var(--text-muted);
}
.journal-card .journal-meta img {
  border-radius: 2px;
  flex-shrink: 0;
}

.journal-card .cta {
  margin-top: 20px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--ink);
}
.journal-card .cta svg {
  width: 14px;
  height: 14px;
  transition: transform 0.15s ease;
}
.journal-card:hover .cta svg { transform: translateX(3px); }

/* ---------- About ---------- */
.about .container { max-width: 720px; }
.about p {
  font-size: 1.03rem;
  color: var(--text);
  margin-bottom: 18px;
}
.about p:last-child { margin-bottom: 0; }

/* ---------- Publishing principles ---------- */
.principles-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 28px;
}
@media (min-width: 640px) {
  .principles-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 960px) {
  .principles-grid { grid-template-columns: repeat(4, 1fr); }
}
.principle {
  padding-top: 8px;
  border-top: 1px solid var(--border-strong);
}
.principle .num {
  font-family: var(--serif);
  font-size: 0.95rem;
  color: var(--text-muted);
  display: block;
  margin-bottom: 10px;
}
.principle h3 {
  font-size: 1.05rem;
  color: var(--ink);
  margin-bottom: 8px;
}
.principle p {
  font-size: 0.95rem;
  color: var(--text-muted);
}
.principles-more {
  margin-top: 36px;
  font-size: 0.95rem;
}
.principles-more a {
  color: var(--navy);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ---------- Footer / Contact ---------- */
.site-footer {
  background: var(--navy);
  color: #dbe1ea;
  padding: 64px 0 28px;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 40px;
}
@media (min-width: 760px) {
  .footer-grid { grid-template-columns: 1.1fr 0.9fr; }
}
.site-footer h2 {
  font-family: var(--serif);
  font-size: 1.5rem;
  color: #fff;
  margin-bottom: 18px;
}
.site-footer address {
  font-style: normal;
  font-size: 0.98rem;
  line-height: 1.8;
  color: #c3cbd8;
}
.site-footer address a {
  color: #fff;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.footer-legal-block {
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid var(--navy-soft);
  font-size: 0.9rem;
  color: #a9b3c4;
  line-height: 1.8;
}
.footer-links h3,
.footer-legal h3 {
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #8b96aa;
  margin-bottom: 14px;
}
.footer-links h3 + ul + h3 {
  margin-top: 28px;
}
.footer-links ul { display: flex; flex-direction: column; gap: 10px; }
.footer-links a {
  color: #dbe1ea;
  text-decoration: none;
  font-size: 0.98rem;
}
.footer-links a:hover { color: #fff; text-decoration: underline; }

.footer-bottom {
  margin-top: 48px;
  padding-top: 24px;
  border-top: 1px solid var(--navy-soft);
  display: flex;
  flex-wrap: wrap;
  gap: 12px 24px;
  justify-content: space-between;
  font-size: 0.85rem;
  color: #8b96aa;
}
.footer-bottom a { color: #8b96aa; text-decoration: underline; text-underline-offset: 2px; }
.footer-bottom a:hover { color: #fff; }

/* ---------- Subpages (Ethics / Contact) ---------- */
.subpage-hero {
  padding: 48px 0 8px;
}
.subpage-hero .container { max-width: 760px; }
.subpage-hero .eyebrow {
  display: block;
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 10px;
}
.subpage-hero h1 {
  font-family: var(--serif);
  font-size: clamp(1.8rem, 4vw, 2.3rem);
  color: var(--navy);
}
.subpage .container { max-width: 760px; }
.subpage h2 {
  font-family: var(--serif);
  font-size: 1.3rem;
  color: var(--navy);
  margin-top: 36px;
  margin-bottom: 12px;
}
.subpage h2:first-child { margin-top: 0; }
.subpage p { margin-bottom: 16px; font-size: 1.02rem; }
.subpage a { color: var(--navy); text-decoration: underline; text-underline-offset: 3px; }
.back-link {
  display: inline-block;
  margin-top: 8px;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--navy);
  text-decoration: none;
}
.back-link:hover { text-decoration: underline; }
