/*
Theme Name: Riikka Homanen
Theme URI: https://riikkahomanen.net/
Author: Riikka Homanen
Description: A warm editorial theme for an academic personal site — Newsreader serif headings, Work Sans body text, a numbered nav and a terracotta accent. Built from the site's Claude Design mockups.
Version: 1.0.0
Requires at least: 6.0
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: riikka-homanen
*/

/* ==========================================================================
   Tokens — everything below is drawn from these variables. Retune here.
   ========================================================================== */
:root {
  --color-bg: #f3efe6;
  --color-text: #17140f;
  --color-text-muted: rgba(23, 20, 15, 0.65);
  --color-text-faint: rgba(23, 20, 15, 0.5);
  --color-border: rgba(23, 20, 15, 0.18);
  --color-border-soft: rgba(23, 20, 15, 0.12);
  --color-accent: #a8432c;

  --font-serif: 'Newsreader', Georgia, serif;
  --font-sans: 'Work Sans', system-ui, sans-serif;

  --container: 1160px;
  --gap: clamp(32px, 6vw, 60px);
  --side-pad: clamp(20px, 5vw, 40px);
}

/* ==========================================================================
   Reset + base
   ========================================================================== */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.6;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
::selection { background: var(--color-accent); color: var(--color-bg); }
:focus-visible { outline: 2px solid var(--color-accent); outline-offset: 2px; }

h1, h2, h3, h4 { font-family: var(--font-serif); font-weight: 500; margin: 0; }

.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 var(--side-pad);
}

.screen-reader-text {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

/* ==========================================================================
   Site meta bar
   ========================================================================== */
.site-meta {
  display: flex; flex-wrap: wrap; gap: 6px 16px;
  justify-content: space-between; align-items: center;
  padding: 22px 0;
  border-bottom: 1px solid var(--color-border);
  font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase;
}

/* ==========================================================================
   Nav — numbers are automatic via CSS counters, so it works for any
   number of menu items whether the default fallback or a custom menu.
   ========================================================================== */
.site-nav {
  display: flex; flex-wrap: wrap; gap: 14px 24px;
  padding: 18px 0;
  border-bottom: 1px solid var(--color-border);
  font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase;
  list-style: none; margin: 0;
  counter-reset: navnum;
}
.site-nav li { counter-increment: navnum; display: flex; }
.site-nav a {
  display: inline-block;
  border-bottom: 1px solid transparent;
  padding-bottom: 2px;
}
.site-nav a::before {
  content: counter(navnum, decimal-leading-zero) "\0020\00b7\0020";
}
.site-nav a:hover { color: var(--color-accent); }
.site-nav .current-menu-item > a,
.site-nav a[aria-current="page"] {
  border-bottom-color: var(--color-accent);
}

/* ==========================================================================
   Hero
   ========================================================================== */
.hero {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--gap);
  padding: clamp(40px, 8vw, 64px) 0 56px;
  align-items: start;
}
.hero h1 {
  font-size: clamp(42px, 9vw, 96px);
  line-height: 0.98;
  letter-spacing: -0.01em;
  margin-bottom: 22px;
}
.hero .lede {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 22px;
  line-height: 1.5;
  max-width: 46ch;
  margin: 0 0 20px;
  color: rgba(23, 20, 15, 0.85);
}
.hero .tagline {
  font-size: 14px; line-height: 1.7; max-width: 52ch;
  color: var(--color-text-muted); margin: 0;
}
.hero-figure { max-width: 420px; width: 100%; }
.hero-figure .frame {
  aspect-ratio: 4 / 5;
  border: 1px solid rgba(23, 20, 15, 0.25);
  padding: 10px;
}
.hero-figure .frame img,
.hero-figure .frame .placeholder {
  width: 100%; height: 100%; object-fit: cover; object-position: center 20%;
  filter: grayscale(1) contrast(1.05);
}
.hero-figure .frame .placeholder {
  background: var(--color-border-soft);
}
.hero-figure figcaption {
  font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--color-text-faint); margin-top: 10px;
}

/* ==========================================================================
   Numbered content sections (Research / Projects / Publications / FiReSNet / Contact)
   ========================================================================== */
.section {
  padding: 52px 0;
  border-top: 1px solid var(--color-border);
}
.section:last-child { padding-bottom: 60px; }
.section-inner {
  display: flex; flex-wrap: wrap; gap: 40px; align-items: start;
}
.section-kicker {
  font-family: var(--font-serif); font-size: 15px; color: var(--color-accent);
  flex: 0 0 120px;
}
.section-body { max-width: 760px; flex: 1 1 320px; min-width: 0; }
.section-content { flex: 1 1 320px; min-width: 0; }

.section-body h2 { font-size: 34px; margin-bottom: 16px; }
.section-body h2 em { font-style: normal; color: var(--color-accent); }
.section-body > p { font-size: 15px; line-height: 1.75; color: var(--color-text-muted); margin: 0 0 18px; }
.section-intro { font-size: 15px; line-height: 1.6; color: var(--color-text-muted); max-width: 60ch; margin: 0 0 32px; }

.text-link {
  font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase;
  border-bottom: 1px solid var(--color-text); padding-bottom: 2px;
}
.text-link:hover { color: var(--color-accent); border-color: var(--color-accent); }

/* — featured project (current research), shown large above the grid — */
.project-featured {
  max-width: 760px;
  padding-bottom: 32px; margin-bottom: 32px;
  border-bottom: 1px solid var(--color-border-soft);
}
.project-featured .project-meta {
  font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--color-accent); margin: 0 0 10px;
}
.project-featured h3 { font-size: 32px; margin: 0 0 14px; }
.project-featured p { font-size: 15px; line-height: 1.75; color: var(--color-text-muted); margin: 0 0 18px; }

/* — projects grid — */
.projects-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 44px;
}
.project-card .project-meta {
  font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--color-text-faint); margin: 0 0 8px;
}
.project-card h3 { font-size: 20px; margin: 0 0 10px; }
.project-card p { font-size: 13px; line-height: 1.65; color: var(--color-text-muted); margin: 0 0 12px; }
.project-card a { font-size: 12px; border-bottom: 1px solid var(--color-text); padding-bottom: 1px; }
.project-card a:hover { color: var(--color-accent); border-color: var(--color-accent); }

/* — publications list — */
.pub-list { max-width: 760px; }
.pub-item {
  display: flex; gap: 18px; padding: 16px 0;
  border-bottom: 1px solid var(--color-border-soft);
}
.pub-item:last-child { border-bottom: 0; }
.pub-year {
  font-family: var(--font-serif); font-style: italic; color: var(--color-accent);
  font-size: 14px; flex: none;
}
.pub-citation { margin: 0 0 4px; font-size: 15px; }
.pub-citation em { font-style: italic; }
.pub-venue { margin: 0; font-size: 12px; color: var(--color-text-faint); }

/* — FiReSNet — */
.section-body.with-rule {
  border-left: 3px solid var(--color-accent); padding-left: 28px;
}

/* — contact — */
.contact-grid { flex: 1 1 220px; min-width: 220px; }
.contact-grid h3 { font-size: 22px; margin-bottom: 10px; }
.contact-grid .email { font-size: 15px; border-bottom: 1px solid var(--color-text); padding-bottom: 1px; }
.contact-grid .email:hover { color: var(--color-accent); border-color: var(--color-accent); }
.contact-address {
  font-size: 13px; line-height: 1.7; color: var(--color-text-muted);
  flex: 1 1 220px; min-width: 220px;
}

/* ==========================================================================
   About page
   ========================================================================== */
.about-hero {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--gap);
  padding: clamp(32px, 7vw, 56px) 0;
  align-items: start;
}
.about-kicker {
  font-family: var(--font-serif); font-size: 15px; color: var(--color-accent);
  margin: 0 0 10px;
}
.about-hero h1 { font-size: clamp(34px, 7vw, 52px); line-height: 1.02; margin-bottom: 14px; }
.about-role {
  font-family: var(--font-serif); font-style: italic; font-size: 19px;
  color: rgba(23, 20, 15, 0.85); margin: 0 0 28px;
}
.about-bio { font-size: 15px; line-height: 1.8; color: rgba(23, 20, 15, 0.8); max-width: 64ch; }
.about-bio p { margin: 0 0 1.6em; }
.about-bio a { border-bottom: 1px solid var(--color-accent); color: var(--color-accent); }
.about-links { display: flex; flex-wrap: wrap; gap: 16px 28px; margin-top: 24px; }

/* ==========================================================================
   Generic page fallback
   ========================================================================== */
.page-content { padding: clamp(40px, 8vw, 64px) 0 60px; max-width: 760px; }
.page-content h1 { font-size: clamp(34px, 6vw, 48px); margin-bottom: 24px; }
.page-content p, .page-content li { font-size: 15px; line-height: 1.8; color: rgba(23, 20, 15, 0.8); }

/* ==========================================================================
   Print / misc
   ========================================================================== */
.hr { height: 1px; border: 0; margin: 0; background: var(--color-border); }

@media (max-width: 640px) {
  .section-kicker { flex-basis: 100%; }
}
