/*
Theme Name: Sepalms
Theme URI: https://sepalms.org/
Author: Sepalms
Author URI: https://sepalms.org/
Description: A fast editorial theme for modern science, space, health, earth, and technology coverage.
Version: 1.0.0
Requires at least: 6.6
Tested up to: 6.9
Requires PHP: 8.1
Text Domain: sepalms
*/

:root {
  --color-base: #f7f5ef;
  --color-surface: rgba(255, 255, 255, 0.58);
  --color-surface-strong: rgba(255, 255, 255, 0.82);
  --color-ink: #101420;
  --color-muted: #5c6376;
  --color-line: rgba(16, 20, 32, 0.12);
  --color-blue: #0c65ff;
  --color-teal: #24c0b5;
  --color-warm: #f09143;
  --shadow-soft: 0 28px 70px rgba(16, 20, 32, 0.08);
  --radius-large: 38px;
  --radius-medium: 24px;
  --radius-small: 14px;
  --font-display: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Georgia, serif;
  --font-body: "Avenir Next", "Segoe UI", "Helvetica Neue", sans-serif;
  --font-mono: "IBM Plex Mono", "SFMono-Regular", Consolas, monospace;
  --content-width: min(1240px, calc(100vw - 40px));
  --reading-width: min(780px, calc(100vw - 40px));
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--color-ink);
  font-family: var(--font-body);
  line-height: 1.65;
  background: #f8f7f3;
}

body.menu-open {
  overflow: hidden;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

a {
  color: inherit;
  text-decoration: none;
  transition: color 180ms ease, opacity 180ms ease, transform 180ms ease;
}

a:hover {
  color: var(--color-blue);
}

p {
  margin: 0 0 1rem;
}

ul,
ol {
  margin: 0;
  padding: 0;
}

::selection {
  background: rgba(12, 101, 255, 0.18);
}

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

.site-shell {
  min-height: 100vh;
}

.site-header {
  position: relative;
  z-index: 20;
  background: transparent;
  border-bottom: 1px solid rgba(16, 20, 32, 0.1);
}

.site-header__inner,
.site-main > *,
.site-footer__inner {
  width: var(--content-width);
  margin: 0 auto;
}

.site-header__inner {
  padding: 1.1rem 0 0.95rem;
}

.site-header__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
}

.site-header__row + .site-header__row {
  margin-top: 0.75rem;
}

.site-header__row--meta {
  color: var(--color-muted);
  font-family: var(--font-mono);
  font-size: 0.73rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.site-header__signal,
.site-header__date {
  margin: 0;
}

.site-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  min-width: 0;
}

.site-brand__mark {
  width: 40px;
  height: 40px;
  flex: 0 0 auto;
}

.site-brand__name {
  font-family: var(--font-display);
  font-size: clamp(1.55rem, 2vw, 1.95rem);
  line-height: 1;
  letter-spacing: -0.04em;
}

.site-nav-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid var(--color-line);
  border-radius: 999px;
  background: transparent;
  color: var(--color-ink);
  cursor: pointer;
  flex: 0 0 auto;
}

.site-nav-toggle__line {
  position: absolute;
  width: 18px;
  height: 2px;
  background: currentColor;
  border-radius: 999px;
  transition: transform 180ms ease, opacity 180ms ease;
}

.site-nav-toggle__line:first-child {
  transform: translateY(-4px);
}

.site-nav-toggle__line:last-child {
  transform: translateY(4px);
}

.site-nav-toggle[aria-expanded="true"] .site-nav-toggle__line:first-child {
  transform: rotate(45deg);
}

.site-nav-toggle[aria-expanded="true"] .site-nav-toggle__line:last-child {
  transform: rotate(-45deg);
}

.site-header__row--nav {
  padding-top: 0.75rem;
  border-top: 1px solid rgba(16, 20, 32, 0.08);
}

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

.menu {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem 1.25rem;
  list-style: none;
}

.menu-item {
  list-style: none;
}

.menu-item a {
  display: inline-flex;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 0.76rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-muted);
}

.menu-item a:hover,
.menu-item.current-menu-item a {
  color: var(--color-ink);
}

.search-form {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  max-width: 340px;
  width: 100%;
}

.search-field {
  width: 100%;
  min-width: 0;
  padding: 0.95rem 1rem;
  border: 1px solid transparent;
  border-radius: 999px;
  outline: none;
  background: rgba(255, 255, 255, 0.78);
  color: var(--color-ink);
  box-shadow: inset 0 0 0 1px rgba(16, 20, 32, 0.08);
  font: inherit;
}

.search-field:focus {
  border-color: rgba(12, 101, 255, 0.32);
  box-shadow: inset 0 0 0 1px rgba(12, 101, 255, 0.22), 0 0 0 4px rgba(12, 101, 255, 0.08);
}

.search-submit {
  flex: 0 0 auto;
  padding: 0.92rem 1.1rem;
  border: none;
  border-radius: 999px;
  background: var(--color-ink);
  color: #fff;
  font-family: var(--font-mono);
  font-size: 0.74rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
}

.site-main {
  padding: 2.2rem 0 5rem;
}

.section-kicker {
  margin: 0 0 0.85rem;
  color: var(--color-blue);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.6rem;
}

.section-heading h2,
.section-heading p {
  margin: 0;
}

.section-heading h2,
.archive-intro h1,
.not-found h1 {
  font-family: var(--font-display);
  font-size: clamp(2.1rem, 4vw, 3.6rem);
  line-height: 0.96;
  letter-spacing: -0.05em;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(360px, 0.95fr);
  align-items: center;
  gap: clamp(2rem, 4vw, 4rem);
  margin-bottom: 2.6rem;
}

.hero__title {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(3rem, 8vw, 6.2rem);
  line-height: 0.9;
  letter-spacing: -0.07em;
  text-wrap: balance;
}

.hero__title a:hover {
  color: var(--color-ink);
}

.hero__dek {
  max-width: 40rem;
  margin: 1.45rem 0 0;
  color: var(--color-muted);
  font-size: clamp(1rem, 1.5vw, 1.18rem);
}

.hero__meta,
.story-river__meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.8rem 1.4rem;
  margin-top: 1.35rem;
  color: var(--color-muted);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.hero__link {
  display: inline-flex;
  align-items: center;
  margin-top: 1.6rem;
  padding: 0.9rem 1.35rem;
  border-radius: 999px;
  background: var(--color-ink);
  color: #fff;
  font-family: var(--font-mono);
  font-size: 0.76rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.hero__link:hover {
  color: #fff;
  transform: translateY(-1px);
}

.topic-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  margin-top: 1.7rem;
  list-style: none;
}

.topic-cloud li {
  list-style: none;
}

.topic-cloud a {
  display: inline-flex;
  align-items: center;
  padding: 0.72rem 1rem;
  border: 1px solid rgba(16, 20, 32, 0.09);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.62);
  color: var(--color-muted);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.topic-cloud a:hover {
  color: var(--color-blue);
  border-color: rgba(12, 101, 255, 0.22);
}

.hero__visual {
  position: relative;
}

.story-media {
  position: relative;
  overflow: hidden;
  border-radius: 22px;
  background: #dfe7f7;
}

.hero__media {
  min-height: min(72vw, 640px);
  aspect-ratio: 1 / 1;
  box-shadow: var(--shadow-soft);
}

.story-media--placeholder {
  isolation: isolate;
  background:
    linear-gradient(135deg, rgba(240, 145, 67, 0.9), rgba(12, 101, 255, 0.82) 52%, rgba(36, 192, 181, 0.9)),
    linear-gradient(180deg, rgba(247, 245, 239, 0.08), rgba(247, 245, 239, 0));
}

.story-media__orb,
.story-media__grid,
.story-media__label {
  position: absolute;
}

.story-media__orb {
  inset: 12% auto auto 10%;
  width: 54%;
  aspect-ratio: 1 / 1;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.55);
  box-shadow:
    0 0 0 18px rgba(255, 255, 255, 0.08),
    0 0 0 36px rgba(255, 255, 255, 0.05);
}

.story-media__grid {
  inset: auto 8% 12% auto;
  width: 46%;
  aspect-ratio: 1 / 1;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.18) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.18) 1px, transparent 1px);
  background-size: 18px 18px;
  transform: rotate(14deg);
}

.story-media__label {
  left: 8%;
  bottom: 8%;
  padding: 0.65rem 0.95rem;
  border-radius: 999px;
  background: rgba(16, 20, 32, 0.28);
  color: #fff;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.signal-strip,
.story-river,
.coverage-map,
.related-stories,
.archive-intro,
.not-found {
  margin-top: 3.8rem;
}

.signal-strip {
  padding: 1.6rem 0 1.4rem;
  border-top: 1px solid var(--color-line);
  border-bottom: 1px solid var(--color-line);
}

.signal-strip__list {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1.25rem;
  margin-top: 1.3rem;
  list-style: none;
}

.signal-strip__item {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.9rem;
  align-items: start;
  list-style: none;
}

.signal-strip__index {
  color: rgba(16, 20, 32, 0.28);
  font-family: var(--font-display);
  font-size: 2.3rem;
  line-height: 0.8;
}

.signal-strip__label,
.story-river__label,
.coverage-map__topic {
  margin: 0 0 0.35rem;
  color: var(--color-blue);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.signal-strip__item a {
  display: inline;
  font-size: 1rem;
  line-height: 1.45;
}

.story-river__list {
  margin-top: 0.6rem;
}

.story-river__item {
  display: grid;
  grid-template-columns: minmax(200px, 280px) minmax(0, 1fr);
  gap: clamp(1rem, 3vw, 2rem);
  align-items: center;
  padding: 1.35rem 0;
  border-top: 1px solid var(--color-line);
}

.story-river__item:first-child {
  border-top: none;
}

.story-river__media {
  display: block;
}

.story-river__image {
  aspect-ratio: 4 / 3;
  min-height: 180px;
}

.story-river__copy h2,
.story-river__copy h3,
.coverage-map__panel h3,
.archive-lead__copy h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.55rem, 3vw, 2.35rem);
  line-height: 0.98;
  letter-spacing: -0.05em;
  text-wrap: balance;
}

.story-river__copy h3 {
  font-size: clamp(1.35rem, 2.8vw, 2rem);
}

.story-river__copy p:last-child,
.coverage-map__panel p:last-child,
.archive-lead__copy p:last-child {
  margin-bottom: 0;
}

.story-river__copy > p:not(.story-river__label) {
  margin-top: 0.95rem;
  color: var(--color-muted);
}

.story-river__empty,
.not-found {
  padding: 2rem 0;
  border-top: 1px solid var(--color-line);
}

.story-river__empty h3,
.story-river__empty h2,
.not-found h1 {
  margin: 0;
  font-family: var(--font-display);
  line-height: 0.96;
  letter-spacing: -0.05em;
}

.story-river__empty p:not(.section-kicker),
.not-found p:not(.section-kicker) {
  max-width: 40rem;
  margin-top: 1rem;
  color: var(--color-muted);
}

.coverage-map__grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.4rem 2rem;
}

.coverage-map__panel {
  position: relative;
  min-height: 220px;
  padding: 1.3rem 0 1.4rem;
  border-top: 1px solid var(--color-line);
}

.coverage-map__panel::after {
  content: "";
  position: absolute;
  inset: auto 0 0 auto;
  width: 110px;
  height: 110px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(12, 101, 255, 0.09), transparent 70%);
  pointer-events: none;
}

.coverage-map__panel h3 {
  margin-bottom: 0.8rem;
}

.coverage-map__panel p:not(.coverage-map__topic) {
  color: var(--color-muted);
}

.archive-intro {
  max-width: 48rem;
}

.archive-intro p:not(.section-kicker) {
  color: var(--color-muted);
  font-size: 1.05rem;
}

.archive-lead {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(320px, 0.9fr);
  align-items: center;
  gap: 2rem;
  margin-top: 2rem;
  padding-bottom: 2rem;
}

.archive-lead__media {
  display: block;
}

.archive-lead__image {
  aspect-ratio: 4 / 3;
  min-height: 320px;
}

.archive-lead__copy p:not(.section-kicker) {
  margin-top: 1rem;
  color: var(--color-muted);
}

.article-shell {
  margin-top: 1rem;
}

.article-header {
  width: min(900px, 100%);
  margin: 0 auto;
}

.article-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(2.8rem, 6.4vw, 5.4rem);
  line-height: 0.92;
  letter-spacing: -0.06em;
  text-wrap: balance;
}

.article-excerpt {
  max-width: 42rem;
  margin-top: 1.2rem;
  color: var(--color-muted);
  font-size: 1.12rem;
}

.article-visual {
  width: min(1120px, 100%);
  margin: 2rem auto 0;
}

.article-visual__image {
  aspect-ratio: 16 / 9;
  min-height: 340px;
}

.article-content {
  width: var(--reading-width);
  margin: 2.3rem auto 0;
  font-size: 1.08rem;
}

.article-content > * + * {
  margin-top: 1.35rem;
}

.article-content h2,
.article-content h3,
.article-content h4 {
  margin-top: 2.2rem;
  margin-bottom: 0;
  font-family: var(--font-display);
  line-height: 1.02;
  letter-spacing: -0.04em;
}

.article-content h2 {
  font-size: clamp(2rem, 4vw, 3rem);
}

.article-content h3 {
  font-size: clamp(1.6rem, 3vw, 2.2rem);
}

.article-content ul,
.article-content ol {
  padding-left: 1.25rem;
}

.article-content li + li {
  margin-top: 0.7rem;
}

.article-content a {
  text-decoration: underline;
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.14em;
}

.article-content blockquote {
  margin: 2rem 0;
  padding: 0.2rem 0 0.2rem 1.35rem;
  border-left: 3px solid rgba(12, 101, 255, 0.34);
  color: var(--color-muted);
  font-family: var(--font-display);
  font-size: clamp(1.4rem, 2vw, 1.85rem);
  line-height: 1.25;
}

.article-content figure {
  margin: 2rem 0;
}

.article-content figcaption {
  margin-top: 0.7rem;
  color: var(--color-muted);
  font-size: 0.92rem;
}

.article-footer {
  width: var(--reading-width);
  margin: 2.6rem auto 0;
  padding-top: 1.5rem;
  border-top: 1px solid var(--color-line);
}

.article-footer__taxonomy {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
}

.article-footer__taxonomy a,
.article-content .post-page-numbers {
  display: inline-flex;
  align-items: center;
  padding: 0.62rem 0.95rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--color-muted);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.article-navigation {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  margin-top: 1.35rem;
}

.article-navigation a {
  display: inline-flex;
  align-items: center;
  min-height: 64px;
  padding: 1rem 1.1rem;
  border-radius: var(--radius-small);
  background: rgba(255, 255, 255, 0.68);
  box-shadow: inset 0 0 0 1px rgba(16, 20, 32, 0.06);
}

.article-navigation div:last-child {
  text-align: right;
}

.article-navigation div:last-child a {
  justify-content: flex-end;
}

.pagination {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--color-line);
}

.pagination .nav-links {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.7rem;
}

.pagination .page-numbers {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  height: 44px;
  padding: 0 1rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.68);
  color: var(--color-muted);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.pagination .current {
  background: var(--color-ink);
  color: #fff;
}

.not-found .search-form {
  max-width: 520px;
  margin-top: 1.5rem;
}

.site-footer {
  margin-top: 4rem;
  padding: 2rem 0 3rem;
  border-top: 1px solid var(--color-line);
  background: transparent;
}

.site-footer__inner {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) auto;
  gap: 1.5rem;
  align-items: start;
}

.site-footer__meta {
  color: var(--color-muted);
}

.site-footer__meta {
  font-size: 0.92rem;
  text-align: right;
}

.menu--footer {
  justify-content: center;
}

.js [data-reveal] {
  opacity: 0;
  transform: translateY(26px);
  transition:
    opacity 700ms ease,
    transform 820ms cubic-bezier(0.22, 1, 0.36, 1);
}

.js [data-reveal].is-visible {
  opacity: 1;
  transform: none;
}

@media (max-width: 1120px) {
  .hero,
  .archive-lead,
  .site-footer__inner {
    grid-template-columns: 1fr;
  }

  .hero__visual,
  .archive-lead__media {
    order: -1;
  }

  .hero__media {
    min-height: 420px;
    aspect-ratio: 16 / 10;
  }

  .coverage-map__grid,
  .signal-strip__list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .site-footer__meta {
    text-align: left;
  }
}

@media (max-width: 980px) {
  .site-nav-toggle {
    position: relative;
    display: inline-flex;
  }

  .site-header__row--nav {
    display: none;
    flex-direction: column;
    align-items: stretch;
    padding-top: 1rem;
    border-top: 1px solid var(--color-line);
  }

  body.menu-open .site-header__row--nav {
    display: flex;
  }

  .site-navigation .menu,
  .menu--footer {
    flex-direction: column;
    align-items: flex-start;
  }

  .search-form {
    max-width: none;
  }

  .story-river__item {
    grid-template-columns: 1fr;
  }

  .story-river__image {
    min-height: 240px;
  }
}

@media (max-width: 720px) {
  .site-main {
    padding-top: 1.75rem;
  }

  .site-header__inner {
    padding: 0.9rem 0 1rem;
  }

  .signal-strip__list,
  .coverage-map__grid,
  .article-navigation {
    grid-template-columns: 1fr;
  }

  .section-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .story-river__item,
  .coverage-map__panel,
  .signal-strip__item {
    gap: 0.9rem;
  }

  .hero__media,
  .archive-lead__image,
  .article-visual__image {
    min-height: 240px;
  }

  .site-footer {
    padding-bottom: 2rem;
  }
}
