/* ==========================================================================
   theme.css: the calm academic look (loaded after style.css on every page)
   One deep forest-green accent on warm white paper, serif headings, quiet cards.
   ========================================================================== */
:root {
    --paper: #F7F8F6;
    --card-bg: #FFFFFF;
    --ink: #18261F;
    --text-main: #2E3A35;
    --text-muted: #5E6B65;
    --accent: #1F5240;
    --accent-hover: #163C2F;
    --accent-tint: #EEF4F0;
    --accent-line: #CFE0D5;
    --moss: #8FB39A;
    --spruce: #1F5240;
    --spruce-soft: #EEF4F0;
    --border-light: #DCE3DE;
    --focus: #C98B1E;
    --radius-lg: 12px;
    --radius-md: 8px;
}

body { background-color: var(--paper); letter-spacing: .002em; }
.contour-bg { opacity: .045; filter: grayscale(1); }
::selection { background: #CFE0D5; color: var(--ink); }
.selection\:bg-accent ::selection, .selection\:bg-accent::selection { background: #CFE0D5; color: var(--ink); }

/* Headings: serif, generous, quiet underline */
h2, h3, .subsection-heading { font-family: var(--font-serif); letter-spacing: -.01em; }
h3.text-xl, h3.text-lg, h3.text-base { font-weight: 600; }
.section-heading { font-weight: 600; }
.section-heading::after, .subsection-heading::after { width: 32px; height: 2px; background: var(--moss); }
.lede { color: var(--text-muted); }

/* Header and navigation */
.glass-header { background: rgba(247, 248, 246, .92); }
.glass-header.is-scrolled { box-shadow: 0 1px 0 var(--border-light); }
.nav-link { color: var(--text-main); }
.nav-link:hover, .nav-link.active { color: var(--accent); }
.nav-cta { background: var(--accent); }
.nav-cta:hover, .nav-cta.active { background: var(--accent-hover); }
.btn-spruce { background: var(--accent); }
.btn-spruce:hover { background: var(--accent-hover); }

/* Cards: flat, hairline borders, a gentle lift on hover */
.dashboard-card, .research-post, .service-card {
    border-color: var(--border-light) !important;
    box-shadow: none !important;
    border-radius: var(--radius-lg);
}
.dashboard-card, .research-post { transition: border-color .2s, transform .2s, box-shadow .2s; }
a.dashboard-card:hover, .dashboard-card.is-interactive:hover, .research-post:hover, .service-card:hover {
    border-color: var(--accent-line) !important;
    box-shadow: 0 12px 28px -22px rgba(24, 38, 31, .45) !important;
}

/* Tailwind blue and sky utilities, re-toned to the green accent */
.bg-blue-50, .bg-sky-50, .hover\:bg-blue-50:hover, .hover\:bg-sky-50:hover { background-color: var(--accent-tint) !important; }
.bg-blue-50\/70 { background-color: rgba(238, 244, 240, .7) !important; }
.hover\:bg-blue-50\/40:hover { background-color: rgba(238, 244, 240, .5) !important; }
.border-blue-100, .border-blue-200, .border-sky-200 { border-color: var(--accent-line) !important; }
.border-sky-400, .border-sky-400\/40 { border-color: rgba(143, 179, 154, .5) !important; }
.text-blue-100, .text-sky-200, .text-sky-300 { color: #D6E6DB !important; }
.text-sky-400 { color: var(--moss) !important; }
.text-sky-700, .text-sky-800, .text-blue-700, .text-blue-800 { color: var(--accent) !important; }
.bg-sky-400 { background-color: var(--moss) !important; }
.bg-sky-400\/20 { background-color: rgba(143, 179, 154, .2) !important; }
.bg-sky-500, .bg-sky-600, .hover\:bg-sky-600:hover { background-color: var(--accent) !important; color: #fff !important; }
.hover\:bg-sky-600:hover { background-color: var(--accent-hover) !important; }
.from-blue-500, .from-sky-500 { --tw-gradient-from: var(--accent) !important; }
.bg-emerald-500 { background-color: #3E6E58 !important; }
.hover\:bg-emerald-600:hover { background-color: var(--accent-hover) !important; }

/* Publications: chips and the "citations received in a year" view */
.cited-year-banner {
    display: inline-block; line-height: 2.1;
    margin: 0 0 1rem; padding: .8rem 1rem; border: 1px solid var(--accent-line);
    background: var(--accent-tint); border-radius: var(--radius-md); color: var(--ink); font-size: .9rem;
}
.cited-year-banner strong { color: var(--accent); }
.cited-year-clear {
    margin-left: .8rem; padding: .3rem .8rem; line-height: 1.2; border-radius: 999px; border: 1px solid var(--accent);
    background: #fff; color: var(--accent); font-weight: 600; font-size: .8rem; cursor: pointer;
}
.cited-year-clear:hover { background: var(--accent); color: #fff; }
.cited-year-badge {
    display: inline-flex; align-items: center; gap: .35rem; padding: .15rem .55rem; border-radius: 999px;
    background: var(--accent); color: #fff; font-weight: 700; font-size: .72rem; border: 0; cursor: pointer;
}
.cited-year-badge:hover { background: var(--accent-hover); }
.cited-year-badge small { font-weight: 500; opacity: .85; }

/* ---------------------------------------------------------------- research project and article pages */
.crumbs { display: flex; flex-wrap: wrap; gap: .45rem; align-items: center; font-size: .82rem; color: var(--text-muted); margin-bottom: 1.6rem; }
.crumbs a { font-weight: 500; }
.crumbs span[aria-hidden] { color: #A9B4AE; }
.page-loading { display: flex; align-items: center; gap: .6rem; color: var(--text-muted); padding: 3rem 0; }
.spin { width: 1rem; height: 1rem; border: 2px solid var(--accent-line); border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.page-missing { padding: 3rem 0; }
.page-missing h1 { font-size: 1.8rem; margin-bottom: .6rem; }

.kicker { display: flex; flex-wrap: wrap; gap: .4rem .9rem; align-items: center; font-family: var(--font-mono); font-size: .72rem; letter-spacing: .06em; text-transform: uppercase; color: var(--text-muted); }
.kicker .tag { padding: .2rem .55rem; border-radius: 4px; background: var(--accent-tint); color: var(--accent); border: 1px solid var(--accent-line); font-weight: 600; }
.page-title { font-family: var(--font-serif); font-weight: 600; font-size: clamp(1.9rem, 4.6vw, 3rem); line-height: 1.12; letter-spacing: -.02em; color: var(--ink); margin: .9rem 0 1rem; max-width: 52rem; }
.page-sub { font-size: 1.12rem; color: var(--text-muted); line-height: 1.7; max-width: 46rem; }
.hero-img { margin: 2rem 0 2.4rem; border-radius: var(--radius-lg); overflow: hidden; border: 1px solid var(--border-light); background: #fff; }
.hero-img img { width: 100%; max-height: 520px; object-fit: cover; display: block; }
.hero-img figcaption { padding: .6rem .9rem; font-size: .8rem; color: var(--text-muted); }

/* reading column */
.prose-calm { max-width: 42rem; font-family: var(--font-serif); font-size: 1.14rem; line-height: 1.78; color: #26322D; }
.prose-calm > * + * { margin-top: 1.15em; }
.prose-calm h2 { font-size: 1.55rem; line-height: 1.25; font-weight: 600; margin-top: 2em; color: var(--ink); }
.prose-calm blockquote { margin: 1.8em 0; padding: .2em 0 .2em 1.2em; border-left: 3px solid var(--moss); color: var(--text-main); font-style: italic; font-size: 1.2rem; }
.prose-calm a { font-weight: 600; text-decoration: underline; text-decoration-color: var(--accent-line); text-underline-offset: 3px; }
.prose-calm::after { content: ''; display: block; clear: both; }
.prose-wrap { display: flex; justify-content: center; }

/* images inside an article: position and size chosen in the dashboard */
.fig { margin: 2em 0; }
.fig img { width: 100%; height: auto; display: block; border-radius: var(--radius-md); border: 1px solid var(--border-light); background: #fff; }
.fig figcaption { font-family: var(--font-sans); font-size: .82rem; line-height: 1.5; color: var(--text-muted); margin-top: .55rem; }
.fig.pos-wide { width: min(64rem, calc(100vw - 2rem)); margin-left: 50%; transform: translateX(-50%); }
.fig.pos-center { margin-left: auto; margin-right: auto; }
.fig.pos-center.size-small { width: 45%; } .fig.pos-center.size-medium { width: 70%; } .fig.pos-center.size-large { width: 100%; }
.fig.pos-left, .fig.pos-right { margin-top: .35em; margin-bottom: 1em; }
.fig.pos-left { float: left; margin-right: 1.6rem; }
.fig.pos-right { float: right; margin-left: 1.6rem; }
.fig.pos-left.size-small, .fig.pos-right.size-small { width: 34%; }
.fig.pos-left.size-medium, .fig.pos-right.size-medium { width: 46%; }
.fig.pos-left.size-large, .fig.pos-right.size-large { width: 58%; }
@media (max-width: 640px) {
    .prose-calm { font-size: 1.06rem; }
    .fig.pos-left, .fig.pos-right { float: none; width: 100% !important; margin: 1.6em 0; }
    .fig.pos-center.size-small { width: 70%; }
    .fig.pos-center.size-medium { width: 100%; }
}

#article-root .crumbs { max-width: 42rem; margin-left: auto; margin-right: auto; }

/* article list on a project page */
.section-label { font-family: var(--font-mono); font-size: .75rem; letter-spacing: .1em; text-transform: uppercase; color: var(--text-muted); margin: 3.2rem 0 1.1rem; padding-top: 1.4rem; border-top: 1px solid var(--border-light); }
.art-grid { display: grid; gap: 1.25rem; grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr)); }
.art-card { display: flex; flex-direction: column; background: #fff; border: 1px solid var(--border-light); border-radius: var(--radius-lg); overflow: hidden; color: inherit; font-weight: 400; transition: border-color .2s, transform .2s, box-shadow .2s; }
.art-card:hover { border-color: var(--accent-line); transform: translateY(-2px); box-shadow: 0 12px 28px -22px rgba(24, 38, 31, .45); color: inherit; }
.art-card .cover { height: 11rem; flex: none; overflow: hidden; background: linear-gradient(135deg, #E4EDE7, #F3F6F2); }
.art-card .cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.art-card .body { padding: 1rem 1.1rem 1.2rem; display: flex; flex-direction: column; gap: .4rem; flex: 1; }
.art-card time { font-family: var(--font-mono); font-size: .7rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: .05em; }
.art-card h3 { font-family: var(--font-serif); font-size: 1.16rem; line-height: 1.3; color: var(--ink); font-weight: 600; }
.art-card p { font-size: .9rem; color: var(--text-muted); line-height: 1.55; }
.art-card .more { margin-top: auto; padding-top: .5rem; font-size: .82rem; font-weight: 600; color: var(--accent); }
.empty-note { color: var(--text-muted); font-size: .95rem; padding: 1rem 0; }

/* previous / next */
.pager { display: grid; gap: 1rem; grid-template-columns: 1fr 1fr; margin-top: 3.5rem; padding-top: 1.6rem; border-top: 1px solid var(--border-light); max-width: 42rem; margin-left: auto; margin-right: auto; }
.pager a { display: block; padding: .9rem 1rem; border: 1px solid var(--border-light); border-radius: var(--radius-md); background: #fff; color: var(--ink); font-weight: 500; }
.pager a:hover { border-color: var(--accent); }
.pager small { display: block; font-size: .72rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: .06em; margin-bottom: .2rem; }
.pager .next { text-align: right; grid-column: 2; }
.back-link { display: inline-flex; align-items: center; gap: .45rem; margin-top: 1.4rem; font-size: .9rem; }

/* research overview cards link to their pages */
.research-post .card-foot { display: flex; justify-content: space-between; align-items: center; gap: .6rem; padding-top: .8rem; border-top: 1px solid #EEF1EE; font-size: .78rem; }
.research-post .card-foot .count { color: var(--text-muted); font-family: var(--font-mono); }
.proj-pubs { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.proj-pubs li { display: grid; grid-template-columns: 4rem 1fr; gap: 1rem; padding: 1rem 0; border-bottom: 1px solid var(--border-light); }
.proj-pubs li:first-child { padding-top: .2rem; }
.proj-pubs .pp-year { font-family: var(--font-mono); font-size: .85rem; font-weight: 600; color: var(--accent); padding-top: .15rem; }
.proj-pubs .pp-title { font-family: var(--font-serif); font-size: 1.12rem; line-height: 1.4; color: var(--ink); font-weight: 600; }
.proj-pubs .pp-title a { color: var(--ink); }
.proj-pubs .pp-title a:hover { color: var(--accent); }
.proj-pubs .pp-meta { font-size: .88rem; color: var(--text-muted); margin-top: .25rem; line-height: 1.5; }
.proj-pubs .pp-links { display: flex; flex-wrap: wrap; gap: .4rem 1.1rem; margin-top: .45rem; font-size: .82rem; }
.proj-pubs .pp-links span { color: var(--text-muted); font-family: var(--font-mono); font-size: .76rem; padding-top: .1rem; }
@media (max-width: 640px) { .proj-pubs li { grid-template-columns: 1fr; gap: .2rem; } }
.research-post h3 a { color: var(--ink); font-weight: 600; }
.research-post h3 a:hover { color: var(--accent); }
.research-post .ph { border-radius: 8px; margin: .75rem 0; height: 11rem; background: linear-gradient(135deg, #1F5240, #3E6E58); color: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 1rem; }

@media (prefers-reduced-motion: reduce) {
    .art-card, .art-card:hover, .research-post { transition: none; transform: none; }
    .spin { animation: none; }
}
