/*
Theme Name: LURIC Classic
Theme URI: https://www.luric.online/
Author: LURIC Studienzentrale
Description: Classic PHP theme for the LURIC study site (Ludwigshafen Risk and Cardiovascular Health Study). Ported from design-mockups.html, Variant C — "Classical, white": white background, classical serif headings, the brand green/blue used only for links, dots and thin rules. Light mode only, by design.
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.8
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: luric-classic
Tags: classic, light, german, custom-menu, translation-ready
*/

/* =========================================================================
   1. Design tokens — Variant C only. No dark scheme on purpose: the site is
   deliberately light-mode, `color-scheme: light` keeps form controls white.
   ========================================================================= */

:root {
  color-scheme: light;

  --bg: #ffffff;
  --surface: #ffffff;
  --ink: #1d221e;
  --ink-soft: #5c6259;
  --line: #e3e6df;
  --accent: #99cc33;      /* fills, dots, rules */
  --accent-ink: #5c8a1f;  /* links and accent text — contrast-checked on white */
  --accent-soft: #eef5df;
  --blue: #12648f;
  --blue-soft: #e5eef3;

  --heading-font: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, "Times New Roman", serif;
  --body-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono-font: "SF Mono", "IBM Plex Mono", Menlo, Consolas, monospace;
}

/* =========================================================================
   2. Base
   ========================================================================= */

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--body-font);
  min-height: 100vh;
  -webkit-text-size-adjust: 100%;
}

img, svg, figure, iframe { max-width: 100%; }
img { height: auto; }

a { color: var(--accent-ink); }
a:focus-visible, button:focus-visible { outline: 2px solid var(--accent-ink); outline-offset: 2px; }

/* Flex column so the footer stays at the bottom on short entries — several
   Veranstaltungen are a title plus one download and nothing else. */
.wrap {
  max-width: 78rem; margin: 0 auto; padding: 0 clamp(1.25rem, 4vw, 3rem);
  display: flex; flex-direction: column; min-height: 100vh;
}
/* min-width:0 so wide children (the facts table) scroll inside their own
   container instead of stretching the flex column past the viewport. */
.wrap > * { min-width: 0; }
.wrap > main { flex: 1 0 auto; }

/* WordPress boilerplate classes */
.screen-reader-text {
  border: 0; clip: rect(1px, 1px, 1px, 1px); clip-path: inset(50%);
  height: 1px; width: 1px; margin: -1px; padding: 0; overflow: hidden;
  position: absolute !important; word-wrap: normal !important;
}
.screen-reader-text:focus {
  background: #fff; clip: auto; clip-path: none; color: var(--ink);
  display: block; height: auto; width: auto; left: 1rem; top: 1rem;
  padding: 0.75rem 1rem; z-index: 100000; border: 1px solid var(--line);
  font-size: 0.9rem; text-decoration: none;
}
.alignleft { float: left; margin: 0.3rem 1.5rem 1rem 0; }
.alignright { float: right; margin: 0.3rem 0 1rem 1.5rem; }
.aligncenter { display: block; margin: 1.5rem auto; }
.alignwide, .alignfull { max-width: 100%; }
.wp-caption { max-width: 100%; }
.wp-caption-text, figcaption {
  font-size: 0.8rem; color: var(--ink-soft); line-height: 1.5; margin-top: 0.5rem;
}
.sticky, .gallery-caption, .bypostauthor { /* required by the theme check */ }

/* =========================================================================
   3. Masthead / navigation
   ========================================================================= */

.masthead {
  display: flex; align-items: center; justify-content: space-between; gap: 2rem;
  padding: 1.6rem 0; border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 0.75rem; text-decoration: none; }
.brand svg { width: 34px; height: 34px; flex: none; }
/* The real logo.png is 357×80 — constrain the height and let the width follow,
   so it is not squashed into the inline mark's square. */
.brand img { height: 34px; width: auto; max-width: 14rem; flex: none; }
.brand .name {
  display: block;
  font-family: var(--heading-font); font-weight: 700; font-size: 1.5rem;
  letter-spacing: 0.01em; color: var(--ink); line-height: 1.15;
}
.brand .tagline {
  display: block;
  font-size: 0.72rem; color: var(--ink-soft); letter-spacing: 0.02em;
}
/* custom_logo_link wraps the logo in its own <a>; neutralise its layout. */
.brand .custom-logo-link { display: inline-flex; }

nav.primary ul {
  display: flex; gap: 1.75rem; font-size: 0.88rem;
  list-style: none; margin: 0; padding: 0;
}
nav.primary a { color: var(--ink-soft); text-decoration: none; }
nav.primary a:hover, nav.primary a:focus-visible { color: var(--accent-ink); }
nav.primary .current-menu-item > a,
nav.primary .current_page_item > a,
nav.primary .current-menu-parent > a,
nav.primary .current-luric-item > a { color: var(--ink); }
/* Sub-menus are flattened: the IA is one level deep by design. */
nav.primary ul ul { display: none; }
@media (max-width: 640px) {
  nav.primary ul { flex-wrap: wrap; gap: 0.9rem 1.25rem; font-size: 0.82rem; }
  .masthead { flex-direction: column; align-items: flex-start; gap: 1rem; }
}

/* =========================================================================
   4. Hero (front page)
   ========================================================================= */

.hero { padding: clamp(2.5rem, 6vw, 4.5rem) 0 clamp(2rem, 5vw, 3rem); }
.hero-simple { padding: clamp(2.25rem, 5vw, 3.75rem) 0 clamp(2rem, 4vw, 2.5rem); }

.overline {
  font-size: 0.78rem; letter-spacing: 0.04em; text-transform: uppercase;
  color: var(--ink-soft); margin: 0 0 0.85rem; font-weight: 500;
}

h1.display {
  font-family: var(--heading-font); font-weight: 700; margin: 0 0 1rem;
  font-size: clamp(2.1rem, 4.2vw, 3.1rem); line-height: 1.08; text-wrap: balance;
  color: var(--ink);
}
/* German compound words ("Herzkreislaufgesundheit") are wider than a phone
   column at the display size — hyphenate rather than overflow. */
h1.display, .page-head h1, .entry-header h1,
.entry-content h1, .entry-content h2, .entry-title {
  hyphens: auto; overflow-wrap: break-word;
}
@media (max-width: 480px) {
  h1.display { font-size: 1.85rem; }
}
h1.display em { font-style: normal; color: var(--accent-ink); }
.display-plain { max-width: 21ch; }

.lede { font-size: 1.02rem; line-height: 1.65; color: var(--ink-soft); max-width: 46ch; margin: 0; }
.lede-wide { max-width: 58ch; margin-top: 1.1rem; font-size: 1.05rem; }

/* Stat bar — grid of key figures under the hero lede. */
.stats {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px;
  background: var(--line); border: 1px solid var(--line);
  margin: clamp(1.75rem, 4vw, 2.5rem) 0 0;
}
@media (max-width: 700px) { .stats { grid-template-columns: repeat(2, 1fr); } }
.stat { background: var(--surface); padding: 1.1rem 1.3rem; }
.stat .n {
  font-family: var(--mono-font); font-variant-numeric: tabular-nums;
  font-size: clamp(1.5rem, 3vw, 2rem); color: var(--accent-ink); display: block; line-height: 1;
}
.stat .l { font-size: 0.74rem; color: var(--ink-soft); margin-top: 0.5rem; display: block; line-height: 1.4; }

/* =========================================================================
   5. Section blocks
   ========================================================================= */

section.block { padding: clamp(2rem, 4vw, 3rem) 0; border-top: 1px solid var(--line); }
.block-head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 1rem; margin-bottom: 1.5rem; flex-wrap: wrap;
}
h2.section-title {
  font-family: var(--heading-font); font-weight: 700; font-size: 1.5rem;
  margin: 0; color: var(--ink);
}
.block-head .count { font-size: 0.78rem; color: var(--ink-soft); font-family: var(--mono-font); }

/* =========================================================================
   6. Studienverlauf timeline
   ========================================================================= */

.timeline { margin: 0; }
.timeline-row {
  display: grid; grid-template-columns: 1.25rem 1fr; column-gap: 1.1rem;
  padding-bottom: 1.85rem; position: relative;
}
.timeline-row:last-child { padding-bottom: 0; }
.timeline-rail { position: relative; }
.timeline-rail::before {
  content: ""; position: absolute; top: 0.45rem; bottom: -1.85rem; left: 50%;
  width: 1px; background: var(--line); transform: translateX(-50%);
}
.timeline-row:last-child .timeline-rail::before { display: none; }
.timeline-dot {
  width: 8px; height: 8px; border-radius: 50%; background: var(--accent);
  margin-top: 0.32rem; position: relative;
}
.timeline-year {
  display: block; font-family: var(--mono-font); font-variant-numeric: tabular-nums;
  font-size: 0.78rem; letter-spacing: 0.02em; color: var(--accent-ink);
  margin-bottom: 0.3rem; font-weight: 600;
}
.timeline-content h3 {
  font-family: var(--heading-font); font-size: 1.02rem; margin: 0;
  color: var(--ink); font-weight: 700;
}
.timeline-content p {
  font-size: 0.9rem; line-height: 1.6; color: var(--ink-soft);
  margin: 0.4rem 0 0; max-width: 58ch;
}

/* =========================================================================
   7. Teilprojekte — plain rows, no cards
   ========================================================================= */

.projects { display: flex; flex-direction: column; }
.project-plain { padding: 1.05rem 0; border-bottom: 1px solid var(--line); }
.project-plain:first-child { border-top: 1px solid var(--line); }
.project-plain .name {
  font-family: var(--heading-font); font-weight: 700; font-size: 1rem; color: var(--ink);
}
.project-plain .meta {
  font-family: var(--body-font); font-weight: 400; font-size: 0.8rem; color: var(--ink-soft);
}
.project-plain .desc {
  font-size: 0.86rem; color: var(--ink-soft); margin-top: 0.35rem;
  max-width: 58ch; line-height: 1.55;
}

/* =========================================================================
   8. Daten & Fakten — cohort split bar + facts table
   ========================================================================= */

.cohort-visual { max-width: 36rem; margin: 0 0 2rem; }
.cohort-visual-head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 1rem; margin-bottom: 0.8rem; flex-wrap: wrap;
}
.cohort-visual-head h3 {
  font-family: var(--heading-font); font-size: 0.98rem; font-weight: 700;
  margin: 0; color: var(--ink);
}
.cohort-visual-sub {
  font-size: 0.76rem; color: var(--ink-soft); font-family: var(--mono-font);
  font-variant-numeric: tabular-nums;
}
.split-bar { display: flex; gap: 2px; height: 14px; }
.split-seg { height: 100%; border-radius: 7px; }
.split-men { background: var(--accent-ink); }
.split-women { background: var(--blue); }
.split-legend {
  display: flex; gap: 1.5rem; margin-top: 0.7rem; font-size: 0.82rem;
  color: var(--ink-soft); flex-wrap: wrap; font-variant-numeric: tabular-nums;
}
.legend-item { display: inline-flex; align-items: center; gap: 0.45rem; }
.swatch { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex: none; }
.swatch-men { background: var(--accent-ink); }
.swatch-women { background: var(--blue); }
.cohort-visual-note {
  font-size: 0.82rem; color: var(--ink-soft); line-height: 1.6;
  margin: 0.9rem 0 0; max-width: 56ch;
}

.facts { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
.facts caption { text-align: left; font-size: 0.78rem; color: var(--ink-soft); margin-bottom: 0.6rem; }
.facts th, .facts td {
  padding: 0.6rem 1rem 0.6rem 0; border-bottom: 1px solid var(--line); text-align: left;
}
.facts thead th {
  color: var(--ink-soft); font-weight: 600; font-size: 0.72rem;
  text-transform: uppercase; letter-spacing: 0.04em;
}
.facts td.num, .facts th.num {
  font-family: var(--mono-font); font-variant-numeric: tabular-nums;
  text-align: right; padding-right: 0.5rem;
}
.facts tbody th { font-weight: 500; color: var(--ink); }
.table-scroll { overflow-x: auto; }

/* =========================================================================
   9. Archives — quiet dated rows
   ========================================================================= */

.page-head { padding: clamp(2.25rem, 5vw, 3.5rem) 0 1.75rem; }
.page-head h1 {
  font-family: var(--heading-font); font-weight: 700; margin: 0;
  font-size: clamp(1.8rem, 3.4vw, 2.4rem); line-height: 1.15; color: var(--ink);
}
.page-head .page-intro {
  font-size: 0.95rem; line-height: 1.65; color: var(--ink-soft);
  max-width: 58ch; margin: 0.9rem 0 0;
}
.page-head .count {
  display: block; margin-top: 0.9rem; font-family: var(--mono-font);
  font-size: 0.78rem; color: var(--ink-soft); font-variant-numeric: tabular-nums;
}

.entry-list { border-top: 1px solid var(--line); margin: 0 0 clamp(2rem, 4vw, 3rem); }
.entry-row {
  display: grid; grid-template-columns: 7.5rem 1fr; gap: 0.35rem 1.5rem;
  padding: 1.15rem 0; border-bottom: 1px solid var(--line);
}
@media (max-width: 640px) { .entry-row { grid-template-columns: 1fr; } }
.entry-row .entry-date {
  font-family: var(--mono-font); font-variant-numeric: tabular-nums;
  font-size: 0.78rem; color: var(--ink-soft); padding-top: 0.2rem; letter-spacing: 0.02em;
}
.entry-row .entry-title {
  font-family: var(--heading-font); font-weight: 700; font-size: 1.02rem;
  margin: 0; line-height: 1.35;
}
.entry-row .entry-title a { color: var(--ink); text-decoration: none; }
.entry-row .entry-title a:hover, .entry-row .entry-title a:focus-visible {
  color: var(--accent-ink); text-decoration: underline; text-underline-offset: 2px;
}
.entry-row .entry-summary {
  font-size: 0.88rem; line-height: 1.6; color: var(--ink-soft);
  margin: 0.35rem 0 0; max-width: 62ch;
}
.entry-row .entry-meta {
  font-size: 0.78rem; color: var(--ink-soft); margin: 0.4rem 0 0;
  font-family: var(--mono-font); font-variant-numeric: tabular-nums;
}
.entry-row .entry-meta a { color: var(--accent-ink); text-decoration: none; }
.entry-row .entry-meta a:hover { text-decoration: underline; }
/* Entries whose only payload is a download (7 of the Veranstaltungen) — the
   marker keeps the row from reading as an empty, half-broken record. */
.entry-row .entry-attachment {
  font-size: 0.82rem; color: var(--ink-soft); margin: 0.4rem 0 0;
  display: inline-flex; align-items: baseline; gap: 0.4rem;
}
.entry-row .entry-attachment::before {
  content: ""; width: 6px; height: 6px; border-radius: 50%;
  background: var(--accent); flex: none; transform: translateY(-1px);
}

.empty-note {
  font-size: 0.92rem; color: var(--ink-soft); line-height: 1.6;
  padding: 1.5rem 0 2.5rem; max-width: 58ch;
}

/* Pagination. the_posts_pagination() puts the links in a .nav-links child of
   the <nav>, so the flex row has to sit there, not on the nav itself. */
.pagination { padding-bottom: clamp(2rem, 4vw, 3rem); font-size: 0.85rem; }
.pagination .nav-links {
  display: flex; gap: 0.5rem; flex-wrap: wrap; align-items: center;
}
.pagination .page-numbers {
  display: inline-block; padding: 0.35rem 0.7rem; border: 1px solid var(--line);
  color: var(--ink-soft); text-decoration: none; font-variant-numeric: tabular-nums;
}
.pagination .page-numbers:hover { color: var(--accent-ink); border-color: var(--accent); }
.pagination .page-numbers.current { color: var(--ink); border-color: var(--ink); }

/* =========================================================================
   10. Single entries & pages — typography for the migrated content
   The whole migrated corpus uses only: p, strong, br, ul, li, h1, h2, h5
   (+ h3 "Downloads" and figure/img appended at import time).
   ========================================================================= */

.entry { padding: clamp(2.25rem, 5vw, 3.5rem) 0 clamp(2.5rem, 5vw, 3.5rem); }
.entry-header { margin-bottom: 1.75rem; }
.entry-header .kicker {
  font-size: 0.76rem; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--ink-soft); margin: 0 0 0.7rem; font-weight: 500;
}
.entry-header h1 {
  font-family: var(--heading-font); font-weight: 700; margin: 0;
  font-size: clamp(1.7rem, 3.2vw, 2.3rem); line-height: 1.18;
  color: var(--ink); max-width: 30ch; text-wrap: balance;
}
.entry-header .entry-date {
  display: block; margin-top: 0.8rem; font-family: var(--mono-font);
  font-size: 0.78rem; color: var(--ink-soft); font-variant-numeric: tabular-nums;
}

.entry-content { max-width: 68ch; font-size: 1rem; line-height: 1.7; color: var(--ink); }
.entry-content p { margin: 0 0 1.1rem; }
.entry-content strong { font-weight: 700; color: var(--ink); }
.entry-content a { color: var(--accent-ink); text-underline-offset: 2px; }

.entry-content h1 {
  font-family: var(--heading-font); font-weight: 700; margin: 2rem 0 1rem;
  font-size: clamp(1.7rem, 3.2vw, 2.3rem); line-height: 1.18; color: var(--ink);
}
.entry-content h1:first-child { margin-top: 0; }
.entry-content h2 {
  font-family: var(--heading-font); font-weight: 700; margin: 2rem 0 0.8rem;
  font-size: 1.35rem; line-height: 1.25; color: var(--ink);
}
.entry-content h2:first-child { margin-top: 0; }
/* The legal pages open with <h2>LURIC</h2> as an eyebrow above their own <h1>. */
.entry-content h2:first-child + p {
  font-size: 0.78rem; letter-spacing: 0.05em; text-transform: uppercase;
  color: var(--ink-soft);
}
.entry-content h3 {
  font-family: var(--heading-font); font-weight: 700; margin: 2.25rem 0 0.8rem;
  font-size: 1.05rem; color: var(--ink);
}
/* h5 is body text in the source, not a heading: 20 of them across the 10
   Publikationen carry abstracts and journal citations. Styled as prose. */
.entry-content h5 {
  font-family: var(--body-font); font-weight: 400; font-size: 0.94rem;
  line-height: 1.7; color: var(--ink-soft); margin: 0 0 1.1rem; max-width: 68ch;
}
.entry-content ul { margin: 0 0 1.1rem; padding-left: 1.25rem; }
.entry-content li { margin-bottom: 0.4rem; line-height: 1.65; }
.entry-content figure { margin: 1.75rem 0; }
.entry-content img { display: block; border: 1px solid var(--line); }
.entry-content table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.entry-content th, .entry-content td {
  padding: 0.55rem 1rem 0.55rem 0; border-bottom: 1px solid var(--line); text-align: left;
}

/* Downloads — the <h3>Downloads</h3> + <p><a>…</a></p> the importer appends,
   plus the standalone .downloads block used when the body is empty. */
.entry-content h3 + p a,
.downloads a {
  display: inline-flex; align-items: baseline; gap: 0.45rem;
  color: var(--accent-ink); text-decoration: none;
}
.entry-content h3 + p a::before,
.downloads a::before {
  content: ""; width: 7px; height: 7px; border-radius: 50%;
  background: var(--accent); flex: none; transform: translateY(-1px);
}
.entry-content h3 + p a:hover, .downloads a:hover { text-decoration: underline; }

.downloads { margin-top: 2rem; padding-top: 1.5rem; border-top: 1px solid var(--line); max-width: 68ch; }
.downloads h2 {
  font-family: var(--heading-font); font-size: 1.05rem; font-weight: 700;
  margin: 0 0 0.9rem; color: var(--ink);
}
.downloads ul { list-style: none; margin: 0; padding: 0; }
.downloads li { margin-bottom: 0.55rem; font-size: 0.95rem; }

/* Source / PMID reference block on Publikationen */
.entry-source {
  margin-top: 1.75rem; padding-top: 1.75rem; border-top: 1px solid var(--line);
  font-size: 0.85rem; color: var(--ink-soft); max-width: 68ch;
  font-variant-numeric: tabular-nums;
}
.entry-source dl { display: grid; grid-template-columns: 8rem 1fr; gap: 0.45rem 1.25rem; margin: 0; }
@media (max-width: 560px) { .entry-source dl { grid-template-columns: 1fr; gap: 0.15rem; } }
.entry-source dt { color: var(--ink-soft); font-family: var(--mono-font); font-size: 0.76rem; text-transform: uppercase; letter-spacing: 0.04em; padding-top: 0.1rem; }
.entry-source dd { margin: 0; color: var(--ink); word-break: break-word; }
.entry-source dd a { color: var(--accent-ink); }

/* Prev/next between entries. The margin keeps the rule clear of the preceding
   block — without it the border lands on the descenders of a long source URL. */
.entry-nav {
  display: flex; justify-content: space-between; gap: 1.5rem; flex-wrap: wrap;
  margin-top: clamp(1.75rem, 4vw, 2.5rem);
  padding: clamp(1.75rem, 4vw, 2.5rem) 0 0; border-top: 1px solid var(--line); font-size: 0.85rem;
  max-width: 68ch; /* same measure as .entry-content / .downloads / .entry-source */
}
.entry-nav a { color: var(--ink-soft); text-decoration: none; max-width: 28ch; }
.entry-nav a:hover { color: var(--accent-ink); }
.entry-nav .label {
  display: block; font-family: var(--mono-font); font-size: 0.72rem;
  text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 0.25rem;
}
.entry-nav .next { text-align: right; margin-left: auto; }

/* Search form */
.search-form { display: flex; gap: 0.5rem; margin: 1.5rem 0 0; max-width: 30rem; }
.search-form input[type="search"] {
  flex: 1; font: inherit; font-size: 0.9rem; padding: 0.5rem 0.7rem;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink);
}
.search-form button {
  font: inherit; font-size: 0.9rem; padding: 0.5rem 1rem; cursor: pointer;
  border: 1px solid var(--ink); background: var(--ink); color: #fff;
}
.search-form button:hover { background: var(--accent-ink); border-color: var(--accent-ink); }

/* =========================================================================
   11. Footer
   ========================================================================= */

footer.site-footer {
  border-top: 1px solid var(--line); padding: clamp(2rem, 4vw, 2.75rem) 0 3rem;
  display: grid; grid-template-columns: 1.2fr 1fr 1fr; gap: 2rem; font-size: 0.85rem;
}
@media (max-width: 700px) { footer.site-footer { grid-template-columns: 1fr; } }
footer.site-footer h2 {
  font-family: var(--heading-font); font-size: 0.8rem; margin: 0 0 0.7rem;
  color: var(--ink-soft); text-transform: uppercase; letter-spacing: 0.06em; font-weight: 600;
}
footer.site-footer address, footer.site-footer p {
  font-style: normal; margin: 0; line-height: 1.6; color: var(--ink-soft);
}
footer.site-footer ul { list-style: none; margin: 0; padding: 0; line-height: 1.8; }
footer.site-footer a { color: var(--ink-soft); text-decoration: none; }
footer.site-footer a:hover, footer.site-footer a:focus-visible {
  color: var(--accent-ink); text-decoration: underline; text-underline-offset: 2px;
}
footer.site-footer .legal { display: flex; gap: 1.25rem; font-size: 0.78rem; flex-wrap: wrap; }

/* =========================================================================
   12. Print — the publications list gets printed and handed around
   ========================================================================= */

@media print {
  nav.primary, .entry-nav, .pagination, .search-form { display: none; }
  body { color: #000; }
  a { color: #000; text-decoration: underline; }
  .entry-content { max-width: none; }
}
