/*
Theme Name:  Zemla
Theme URI:   https://zemla.org
Author:      Petr Zemla
Author URI:  https://zemla.org
Description: Zen minimalist personal site — blog, photo galleries, multilingual (CS/EN/JA/DE/IT), podcast-ready. Built for zemla.org.
Version: 1.8.0
Requires at least: 6.0
Tested up to: 6.7
Requires PHP: 8.0
License:     Private
Text Domain: zemla
Tags:        blog, minimalist, multilingual, photography, podcast, custom-colors, custom-logo, full-width-template, editor-style, responsive-layout
*/

/* ═══════════════════════════════════════════════════════════════
   DESIGN TOKENS
   ═══════════════════════════════════════════════════════════════ */
:root {
  /* Palette — warm near-white, deep ink, subtle sand */
  --c-bg:          #f8f7f4;
  --c-bg-alt:      #f2f0ec;
  --c-surface:     #ffffff;
  --c-border:      #e0ddd6;
  --c-ink:         #1c1b18;
  --c-ink-2:       #4a4840;
  --c-ink-3:       #8c897f;
  --c-accent:      #5c7a5c;    /* moss green — subtle, calm */
  --c-accent-light:#e8ede8;
  --c-link:        #3d5c3d;
  --c-link-hover:  #1c1b18;

  /* Typography */
  --f-body:        'Noto Serif', 'Georgia', serif;
  --f-ui:          'Noto Sans', 'Helvetica Neue', 'Arial', sans-serif;
  --f-mono:        'JetBrains Mono', 'Courier New', monospace;
  --f-ja:          'Noto Serif JP', 'Hiragino Mincho ProN', serif;

  --fs-xs:         0.75rem;
  --fs-sm:         0.875rem;
  --fs-base:       1rem;
  --fs-md:         1.125rem;
  --fs-lg:         1.375rem;
  --fs-xl:         1.75rem;
  --fs-2xl:        2.25rem;
  --fs-3xl:        3rem;

  --lh-tight:      1.3;
  --lh-base:       1.7;
  --lh-loose:      2.0;

  /* Spacing scale */
  --sp-1:  0.25rem;
  --sp-2:  0.5rem;
  --sp-3:  0.75rem;
  --sp-4:  1rem;
  --sp-6:  1.5rem;
  --sp-8:  2rem;
  --sp-12: 3rem;
  --sp-16: 4rem;
  --sp-24: 6rem;
  --sp-32: 8rem;

  /* Layout */
  --w-content:     720px;
  --w-wide:        1080px;
  --w-full:        1400px;

  /* Transitions */
  --t-fast:   150ms ease;
  --t-base:   250ms ease;
  --t-slow:   400ms ease;

  /* Radius */
  --r-sm:  3px;
  --r-md:  6px;
  --r-lg:  12px;
}

/* ═══════════════════════════════════════════════════════════════
   RESET & BASE
   ═══════════════════════════════════════════════════════════════ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--f-body);
  font-size: var(--fs-base);
  line-height: var(--lh-base);
  color: var(--c-ink);
  background: var(--c-bg);
  min-height: 100vh;
  min-height: 100svh; /* iOS Safari: exclude browser chrome */
  display: flex;
  flex-direction: column;
}

/* Japanese language override — body.lang-ja (cookie) + :lang(ja) (html attr) */
.lang-ja, :lang(ja) { font-family: var(--f-ja); }

img, video { max-width: 100%; height: auto; display: block; }
a { color: var(--c-link); text-decoration: none; transition: color var(--t-fast); }
a:hover { color: var(--c-link-hover); }

/* ═══════════════════════════════════════════════════════════════
   TYPOGRAPHY
   ═══════════════════════════════════════════════════════════════ */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--f-ui);
  font-weight: 400;
  line-height: var(--lh-tight);
  color: var(--c-ink);
  letter-spacing: -0.01em;
}
h1 { font-size: var(--fs-2xl); margin-bottom: var(--sp-6); }
h2 { font-size: var(--fs-xl); margin-bottom: var(--sp-4); }
h3 { font-size: var(--fs-lg); margin-bottom: var(--sp-3); }
h4 { font-size: var(--fs-md); margin-bottom: var(--sp-3); }

p { margin-bottom: var(--sp-6); }
p:last-child { margin-bottom: 0; }

strong, b { font-weight: 600; }
em, i { font-style: italic; }

blockquote {
  border-left: 2px solid var(--c-accent);
  padding: var(--sp-4) var(--sp-6);
  margin: var(--sp-8) 0;
  background: var(--c-bg-alt);
  font-size: var(--fs-md);
  color: var(--c-ink-2);
  font-style: italic;
}

code, pre {
  font-family: var(--f-mono);
  font-size: var(--fs-sm);
  background: var(--c-bg-alt);
}
code { padding: 2px 5px; border-radius: var(--r-sm); }
pre { padding: var(--sp-6); overflow-x: auto; border-radius: var(--r-md); margin: var(--sp-8) 0; }

hr {
  border: none;
  border-top: 1px solid var(--c-border);
  margin: var(--sp-12) 0;
}

/* ═══════════════════════════════════════════════════════════════
   LAYOUT UTILITIES
   ═══════════════════════════════════════════════════════════════ */
.container {
  width: 100%;
  max-width: var(--w-content);
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--sp-6);
  padding-right: var(--sp-6);
}
.container--wide { max-width: var(--w-wide); }
.container--full { max-width: var(--w-full); }

main { flex: 1; }

/* ═══════════════════════════════════════════════════════════════
   SITE HEADER
   ═══════════════════════════════════════════════════════════════ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(248, 247, 244, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--c-border);
  padding: var(--sp-4) 0;
  transition: box-shadow var(--t-base);
}
.site-header.scrolled { box-shadow: 0 1px 16px rgba(28,27,24,0.06); }

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-8);
}

/* Logo / wordmark */
.site-logo {
  font-family: var(--f-ui);
  font-size: var(--fs-lg);
  font-weight: 300;
  letter-spacing: 0.08em;
  color: var(--c-ink);
  text-transform: lowercase;
}
.site-logo span { color: var(--c-accent); }
.site-logo:hover { color: var(--c-ink); }

/* Primary navigation */
.site-nav { display: flex; align-items: center; gap: var(--sp-8); }
.site-nav__menu {
  display: flex;
  list-style: none;
  gap: var(--sp-6);
  flex-wrap: wrap;
}
.site-nav__menu a {
  font-family: var(--f-ui);
  font-size: var(--fs-sm);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--c-ink-2);
  padding-bottom: 2px;
  border-bottom: 1px solid transparent;
  transition: color var(--t-fast), border-color var(--t-fast);
}
.site-nav__menu a:hover,
.site-nav__menu .current-menu-item > a {
  color: var(--c-ink);
  border-bottom-color: var(--c-accent);
}

/* Language switcher */
.lang-switcher {
  display: flex;
  gap: var(--sp-2);
  align-items: center;
  font-family: var(--f-ui);
  font-size: var(--fs-xs);
  letter-spacing: 0.06em;
}
/* shared styles for <a> (Polylang) and <button> (fallback JS switcher) */
.lang-switcher a,
.lang-btn {
  color: var(--c-ink-3);
  padding: 2px 4px;
  border-radius: var(--r-sm);
  text-transform: uppercase;
  font-weight: 500;
  text-decoration: none;
  background: none;
  border: none;
  cursor: pointer;
  font-family: var(--f-ui);
  font-size: var(--fs-xs);
  letter-spacing: 0.06em;
  line-height: 1;
}
.lang-switcher a:hover,
.lang-switcher a.active,
.lang-btn:hover,
.lang-btn.active {
  color: var(--c-accent);
  background: var(--c-accent-light);
}

/* Mobile nav toggle */
.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: var(--sp-2);
  color: var(--c-ink);
}
.nav-toggle span {
  display: block;
  width: 22px;
  height: 1.5px;
  background: currentColor;
  margin: 5px 0;
  transition: transform var(--t-base), opacity var(--t-base);
}

/* ═══════════════════════════════════════════════════════════════
   SITE FOOTER
   ═══════════════════════════════════════════════════════════════ */
.site-footer {
  border-top: 1px solid var(--c-border);
  padding: var(--sp-12) 0 var(--sp-8);
  margin-top: var(--sp-24);
  font-family: var(--f-ui);
  font-size: var(--fs-sm);
  color: var(--c-ink-3);
}
.site-footer__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: var(--sp-8);
  margin-bottom: var(--sp-8);
}
.site-footer__col h4 {
  font-size: var(--fs-xs);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--c-ink-2);
  margin-bottom: var(--sp-4);
}
.site-footer__col ul { list-style: none; }
.site-footer__col li { margin-bottom: var(--sp-2); }
.site-footer__col a { color: var(--c-ink-3); }
.site-footer__col a:hover { color: var(--c-ink); }
.site-footer__bottom {
  border-top: 1px solid var(--c-border);
  padding-top: var(--sp-6);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--sp-4);
}

/* ═══════════════════════════════════════════════════════════════
   FRONT PAGE — HERO
   ═══════════════════════════════════════════════════════════════ */
.hero {
  padding: var(--sp-32) 0 var(--sp-24);
  text-align: left;
}
.hero__kicker {
  font-family: var(--f-ui);
  font-size: var(--fs-xs);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--c-accent);
  margin-bottom: var(--sp-6);
}
.hero__headline {
  font-family: var(--f-ui);
  font-size: clamp(2rem, 5vw, var(--fs-3xl));
  font-weight: 300;
  line-height: 1.2;
  margin-bottom: var(--sp-8);
  letter-spacing: -0.02em;
}
.hero__headline em { font-style: normal; color: var(--c-accent); }
.hero__lead {
  font-size: var(--fs-md);
  color: var(--c-ink-2);
  max-width: 580px;
  margin-bottom: var(--sp-8);
}
.hero__actions { display: flex; gap: var(--sp-4); flex-wrap: wrap; }

/* ═══════════════════════════════════════════════════════════════
   FRONT PAGE — SECTIONS
   ═══════════════════════════════════════════════════════════════ */
.section { padding: var(--sp-16) 0; }
.section--alt { background: var(--c-bg-alt); }
.section__header { margin-bottom: var(--sp-12); }
.section__kicker {
  font-family: var(--f-ui);
  font-size: var(--fs-xs);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--c-ink-3);
  margin-bottom: var(--sp-2);
}
.section__title {
  font-size: var(--fs-xl);
  font-weight: 400;
}

/* ═══════════════════════════════════════════════════════════════
   BLOG — POST LIST
   ═══════════════════════════════════════════════════════════════ */
.post-list { list-style: none; }
.post-list__item {
  padding: var(--sp-8) 0;
  border-bottom: 1px solid var(--c-border);
}
.post-list__item:first-child { border-top: 1px solid var(--c-border); }

/* ── Blog list: per-post header image thumbnail ──────────────────── */
.post-list__thumb-link {
  display: block;
  margin-bottom: var(--sp-4);
  border-radius: var(--r-md);
  overflow: hidden;
}
.post-list__thumb {
  width: 100%;
  /* Aspect ratio 16:9 — proportional, not oversized.
     max-height caps very tall viewports / portrait photos. */
  aspect-ratio: 16 / 9;
  max-height: 280px;
  object-fit: cover;
  border-radius: var(--r-md);
  display: block;
  transition: transform var(--t-slow);
}
.post-list__thumb-link:hover .post-list__thumb { transform: scale(1.02); }
@media (max-width: 700px) {
  .post-list__thumb { max-height: 200px; }
}

.post-meta {
  font-family: var(--f-ui);
  font-size: var(--fs-xs);
  color: var(--c-ink-3);
  letter-spacing: 0.04em;
  margin-bottom: var(--sp-3);
  display: flex;
  gap: var(--sp-4);
  align-items: center;
  flex-wrap: wrap;
}
.post-meta__cat {
  background: var(--c-accent-light);
  color: var(--c-accent);
  padding: 2px 8px;
  border-radius: 20px;
  font-size: var(--fs-xs);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.post-list__title {
  font-size: var(--fs-lg);
  font-weight: 400;
  margin-bottom: var(--sp-3);
  line-height: var(--lh-tight);
}
.post-list__title a { color: var(--c-ink); }
.post-list__title a:hover { color: var(--c-accent); }
.post-list__excerpt {
  color: var(--c-ink-2);
  font-size: var(--fs-base);
  margin-bottom: var(--sp-3);
}
.read-more {
  font-family: var(--f-ui);
  font-size: var(--fs-sm);
  color: var(--c-accent);
  letter-spacing: 0.03em;
}
.read-more::after { content: ' →'; }

/* ═══════════════════════════════════════════════════════════════
   SINGLE POST
   ═══════════════════════════════════════════════════════════════ */
.post-header { padding: var(--sp-16) 0 var(--sp-12); }
.post-header .post-meta { margin-bottom: var(--sp-6); }
.post-header h1 {
  font-size: clamp(1.6rem, 4vw, var(--fs-2xl));
  font-weight: 400;
  line-height: 1.25;
}

/* Single-post hero image — proportional to title, not full-width banner.
   Max-height prevents oversized images from dominating; border-radius
   and object-fit give a polished editorial appearance. */
.post-hero-img {
  display: block;
  width: 100%;
  max-height: 380px;
  object-fit: cover;
  border-radius: var(--r-lg);
}
@media (max-width: 700px) {
  .post-hero-img { max-height: 240px; }
}

.post-content {
  font-size: var(--fs-md);
  line-height: var(--lh-base);
}
.post-content h2 { margin-top: var(--sp-12); font-size: var(--fs-xl); }
.post-content h3 { margin-top: var(--sp-8); }
.post-content ul, .post-content ol {
  margin: 0 0 var(--sp-6) var(--sp-6);
}
.post-content li { margin-bottom: var(--sp-2); }
.post-content img {
  border-radius: var(--r-md);
  margin: var(--sp-8) 0;
}
.post-content a { text-decoration: underline; text-underline-offset: 3px; }

/* Language fallback notice (Z-07): shown when _zemla_content_{lang} is absent
   and EN content is served as a fallback. zemla_get_lang_content() injects it. */
.lang-fallback-notice {
  display: inline-block;
  font-family: var(--f-ui);
  font-size: var(--fs-xs);
  color: var(--c-ink-3);
  background: var(--c-bg-alt);
  border: 1px solid var(--c-border);
  border-radius: var(--r-md);
  padding: var(--sp-1) var(--sp-3);
  margin-bottom: var(--sp-6);
  letter-spacing: 0.01em;
}

/* Tags */
.post-tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2);
  margin-top: var(--sp-12);
  padding-top: var(--sp-8);
  border-top: 1px solid var(--c-border);
}
.post-tags__tag {
  font-family: var(--f-ui);
  font-size: var(--fs-xs);
  padding: 4px 10px;
  border: 1px solid var(--c-border);
  border-radius: 20px;
  color: var(--c-ink-2);
  letter-spacing: 0.04em;
}
.post-tags__tag:hover { border-color: var(--c-accent); color: var(--c-accent); }

/* ═══════════════════════════════════════════════════════════════
   GALLERY — ALBUM GRID + MEDIA GRID + LIGHTBOX
   ═══════════════════════════════════════════════════════════════ */

/* ── Gallery main layout ──────────────────────────────────────── */
.gallery-main { padding-bottom: var(--sp-16); }

.gallery-layout {
  display: grid;
  grid-template-columns: var(--gallery-sidebar-width, 220px) 1fr;
  gap: var(--sp-12);
  align-items: start;
  margin-top: var(--sp-10);
}
@media (max-width: 900px) {
  .gallery-layout { grid-template-columns: 1fr; }
}

/* ── Gallery sidebar (wraps ALL filter navs as one grid child)
   Root cause fix v1.6.4: when both Collections and Topics navs
   existed as separate direct children of .gallery-layout (a 2-col
   grid), CSS auto-placement put them in col-1 and col-2, pushing
   .album-grid to row-2/col-1 (220 px wide). Wrapping both in
   .gallery-sidebar gives the grid exactly 2 children at all times. ── */
.gallery-sidebar {
  position: sticky;
  top: calc(var(--sp-16) + 60px);
  display: flex;
  flex-direction: column;
}
@media (max-width: 900px) {
  .gallery-sidebar {
    position: static;
    flex-direction: column;
  }
}

/* ── Collection filter (nav inside sidebar, no longer sticky itself) ── */
.collection-filter {
}
.collection-filter__heading {
  font-family: var(--f-ui);
  font-size: var(--fs-xs);
  font-weight: 600;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: var(--c-ink-3);
  margin-bottom: var(--sp-4);
}
.collection-filter__list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: var(--sp-1);
}
@media (max-width: 900px) {
  .collection-filter { position: static; }
  .collection-filter__list { flex-direction: row; flex-wrap: wrap; }
}

.cf-btn {
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  padding: var(--sp-2) var(--sp-3);
  border-radius: var(--r-md);
  font-family: var(--f-ui);
  font-size: var(--fs-sm);
  color: var(--c-ink-2);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--sp-3);
  transition: background var(--t-fast), color var(--t-fast);
}
.cf-btn:hover { background: var(--c-bg-alt); color: var(--c-ink); }
.cf-btn--active { background: var(--c-accent-light); color: var(--c-accent); font-weight: 500; }
.cf-count {
  font-size: var(--fs-xs);
  color: var(--c-ink-3);
  background: var(--c-bg-alt);
  border-radius: 20px;
  padding: 1px 7px;
  min-width: 24px;
  text-align: center;
}
.cf-btn--active .cf-count { background: var(--c-accent-light); color: var(--c-accent); }

.collection-filter__note {
  margin-top: var(--sp-6);
  font-family: var(--f-ui);
  font-size: var(--fs-xs);
  color: var(--c-ink-3);
  line-height: var(--lh-base);
}
.collection-filter__note a { color: var(--c-accent); }

/* ── Album card grid ──────────────────────────────────────────── */
/*
 * Layout strategy — v1.6.5: VERTICAL cards (image top, text below)
 *
 *  ≥720px   — 2-column grid of vertical cards.
 *             Image fills card width at 3:2 aspect ratio.
 *             Text block below: title → tags → meta → excerpt → related link.
 *
 *  480–719px — single-column vertical cards.
 *
 *  <480px   — single column, image aspect-ratio 16/9 (landscape crop).
 */
.album-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--sp-6);              /* increased from sp-5 for visual breathing room */
  align-items: start;            /* cards don't stretch to match tallest neighbour */
}
@media (max-width: 719px) {
  .album-grid { grid-template-columns: 1fr; }
}

.album-card {
  position: relative;
  border-radius: var(--r-lg);
  overflow: hidden;
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  transition: transform var(--t-base), box-shadow var(--t-base);
  /* Vertical card: flex column so image stacks above info */
  display: flex;
  flex-direction: column;
}
.album-card:hover { transform: translateY(-3px); box-shadow: 0 8px 28px rgba(28,27,24,0.12); }
.album-card--private { border-color: var(--c-border); }

/* Card link wraps everything — flex column, full height */
.album-card__link {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
  height: 100%;
}

/* Thumbnail — top, full card width, fixed aspect ratio */
.album-card__thumb {
  width: 100%;
  aspect-ratio: 3 / 2;          /* consistent crop across all cards */
  overflow: hidden;
  background: var(--c-bg-alt);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
@media (max-width: 479px) {
  .album-card__thumb { aspect-ratio: 16 / 9; }
}
.album-card__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--t-slow);
  display: block;
}
.album-card:hover .album-card__thumb img { transform: scale(1.04); }
.album-card__thumb--empty {
  font-size: 3rem;
  color: var(--c-border);
  aspect-ratio: 3 / 2;
  width: 100%;
}

/* Lock badge — top-right of thumbnail */
.album-lock {
  position: absolute;
  top: var(--sp-3);
  right: var(--sp-3);
  font-size: 1rem;
  background: rgba(28,27,24,0.65);
  border-radius: 50%;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(4px);
}

/* Text area — below image, grows to fill card height */
.album-card__info {
  padding: var(--sp-4) var(--sp-5) var(--sp-5);
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  flex: 1;                       /* pushes card bottom even when excerpt is short */
}

/* Title — prominent, below the photo */
.album-card__title {
  font-size: var(--fs-md);
  font-weight: 600;
  color: var(--c-ink);
  margin: 0;
  line-height: var(--lh-tight);
}

/* Collection/topic tags */
.album-card__tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-1);
  margin-top: var(--sp-1);
}
.album-tag {
  font-family: var(--f-ui);
  font-size: var(--fs-xs);
  color: var(--c-accent);
  background: var(--c-accent-light);
  border-radius: 20px;
  padding: 2px 9px;
}

/* Meta row: item count + year */
.album-card__meta {
  font-family: var(--f-ui);
  font-size: var(--fs-xs);
  color: var(--c-ink-3);
  display: flex;
  gap: var(--sp-3);
  align-items: center;
}
.album-card__meta::before {        /* subtle divider above meta */
  content: '';
  display: block;
}

/* Description excerpt — below title, max 3 lines */
.album-card__excerpt {
  font-size: var(--fs-sm);
  color: var(--c-ink-2);
  line-height: var(--lh-base);
  margin-top: var(--sp-1);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Related link — optional blog/podcast connection, pinned to card bottom */
.album-card__related {
  margin-top: auto;
  padding-top: var(--sp-3);
  font-family: var(--f-ui);
  font-size: var(--fs-xs);
  font-weight: 500;
  color: var(--c-accent);
  display: inline-flex;
  align-items: center;
  gap: var(--sp-1);
  text-decoration: none;
  border-top: 1px solid var(--c-border);
}
.album-card__related::before { content: '→ '; }
.album-card__related:hover { color: var(--c-link-hover); }

/* Empty gallery state */
.gallery-empty {
  grid-column: 1 / -1;
  color: var(--c-ink-3);
  font-family: var(--f-ui);
  padding: var(--sp-16) 0;
  text-align: center;
}

/* ── Album header (single album page) ────────────────────────── */
.album-main { padding-bottom: var(--sp-16); }

.album-header {
  padding-top: var(--sp-10);
  padding-bottom: var(--sp-8);
  border-bottom: 1px solid var(--c-border);
  margin-bottom: var(--sp-10);
}
.album-breadcrumb {
  font-family: var(--f-ui);
  font-size: var(--fs-sm);
  color: var(--c-ink-3);
  margin-bottom: var(--sp-4);
}
.album-breadcrumb a { color: var(--c-ink-3); text-decoration: none; }
.album-breadcrumb a:hover { color: var(--c-accent); }
.album-header__title {
  font-size: var(--fs-2xl);
  font-weight: 400;
  display: flex;
  align-items: center;
  gap: var(--sp-3);
}
.album-header__lock { font-size: var(--fs-lg); }
.album-header__desc { color: var(--c-ink-2); margin-top: var(--sp-4); max-width: 60ch; }
.album-header__meta {
  display: flex;
  gap: var(--sp-6);
  margin-top: var(--sp-4);
  font-family: var(--f-ui);
  font-size: var(--fs-sm);
  color: var(--c-ink-3);
}

/* ── Private album gate ───────────────────────────────────────── */
.album-gate {
  display: flex;
  justify-content: center;
  padding: var(--sp-16) 0;
}
.album-gate__box {
  text-align: center;
  max-width: 380px;
  padding: var(--sp-12) var(--sp-10);
  border: 1px solid var(--c-border);
  border-radius: var(--r-lg);
  background: var(--c-surface);
}
.album-gate__icon { font-size: 3rem; display: block; margin-bottom: var(--sp-4); }
.album-gate__heading { font-size: var(--fs-xl); font-weight: 400; margin-bottom: var(--sp-3); }
.album-gate__text { color: var(--c-ink-2); margin-bottom: var(--sp-6); }

/* ── Media grid (inside single album) ────────────────────────── */
.gallery-grid {
  display: grid;
  /* Z-02: removed clamp() from minmax — Safari <15 renders 0px columns with nested clamp() */
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: var(--sp-3);
}
.gallery-grid--masonry {
  -webkit-columns: 3;
  columns: 3;
  -webkit-column-gap: var(--sp-3);
  column-gap: var(--sp-3);
}
@media (max-width: 768px) { .gallery-grid--masonry { -webkit-columns: 2; columns: 2; } }
@media (max-width: 480px) { .gallery-grid--masonry { -webkit-columns: 1; columns: 1; } }

.gallery-item {
  position: relative;
  overflow: hidden;
  border-radius: var(--r-md);
  background: var(--c-bg-alt);
  cursor: pointer;
}
.gallery-grid--masonry .gallery-item { page-break-inside: avoid; break-inside: avoid; margin-bottom: var(--sp-3); }

/* Photo items */
.gallery-item--photo {
  /* Z-02: explicit aspect-ratio ensures uniform height and enables object-fit in Safari */
  aspect-ratio: 4/3;
}
.gallery-item--photo img {
  width: 100%;
  height: 100%;   /* Z-02: Safari requires explicit height for object-fit: cover */
  display: block;
  object-fit: cover;
  transition: transform var(--t-slow);
}
.gallery-item--photo:hover img { transform: scale(1.03); }

/* Video items */
.gallery-item--video .gallery-item__video-thumb {
  width: 100%;
  display: block;
  object-fit: cover;
  background: var(--c-ink);
}
.gallery-item--video:hover .gallery-item__video-thumb { opacity: 0.85; }

.gallery-item__play-icon {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 2rem;
  color: white;
  background: rgba(28,27,24,0.55);
  width: 56px; height: 56px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  transition: background var(--t-fast), transform var(--t-fast);
  pointer-events: none;
}
.gallery-item--video:hover .gallery-item__play-icon {
  background: rgba(92,122,92,0.80);
  transform: translate(-50%, -50%) scale(1.1);
}

.gallery-item__caption {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  padding: var(--sp-4);
  background: linear-gradient(transparent, rgba(28,27,24,0.7));
  color: white;
  font-family: var(--f-ui);
  font-size: var(--fs-xs);
  opacity: 0;
  transition: opacity var(--t-base);
}
.gallery-item:hover .gallery-item__caption { opacity: 1; }

/* ── Lightbox — photo + video ─────────────────────────────────── */
.lightbox {
  display: none;
  position: fixed;
  top: 0; right: 0; bottom: 0; left: 0; /* fallback for Safari < 14.1 */
  inset: 0;
  z-index: 1000;
  background: rgba(28,27,24,0.96);
  align-items: center;
  justify-content: center;
  flex-direction: column;
}
.lightbox.active { display: flex; }

.lightbox__media {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  max-width: 90vw;
  max-height: 85vh;
}
.lightbox__img {
  max-width: 90vw;
  max-height: 85vh;
  object-fit: contain;
  border-radius: var(--r-sm);
  display: block;
}
.lightbox__video {
  max-width: 90vw;
  max-height: 85vh;
  border-radius: var(--r-sm);
  background: #000;
  display: none;
  outline: none;
}
.lightbox__video.active { display: block; }

.lightbox__close {
  position: absolute;
  top: var(--sp-6);
  right: var(--sp-6);
  background: none;
  border: none;
  color: white;
  font-size: var(--fs-xl);
  cursor: pointer;
  opacity: 0.7;
  transition: opacity var(--t-fast);
  z-index: 10;
}
.lightbox__close:hover { opacity: 1; }

.lightbox__nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: white;
  font-size: var(--fs-2xl);
  cursor: pointer;
  padding: var(--sp-4);
  opacity: 0.6;
  transition: opacity var(--t-fast);
  z-index: 10;
}
.lightbox__nav:hover { opacity: 1; }
.lightbox__prev { left: var(--sp-4); }
.lightbox__next { right: var(--sp-4); }
.lightbox__caption {
  margin-top: var(--sp-3);
  color: rgba(255,255,255,0.65);
  font-family: var(--f-ui);
  font-size: var(--fs-sm);
  text-align: center;
  max-width: 600px;
}

.album-content { margin-top: var(--sp-12); }
.album-body { padding-bottom: var(--sp-8); }

/* ═══════════════════════════════════════════════════════════════
   PODCAST
   ═══════════════════════════════════════════════════════════════ */
.episode-list { list-style: none; }
.episode-item {
  padding: var(--sp-8) 0;
  border-bottom: 1px solid var(--c-border);
  display: grid;
  grid-template-columns: auto 1fr;
  gap: var(--sp-6);
  align-items: start;
}
.episode-item:first-child { border-top: 1px solid var(--c-border); }
.episode-number {
  font-family: var(--f-ui);
  font-size: var(--fs-xs);
  font-weight: 600;
  color: var(--c-ink-3);
  letter-spacing: 0.06em;
  min-width: 2.5rem;
  padding-top: 4px;
}
.episode-title { font-size: var(--fs-lg); font-weight: 400; margin-bottom: var(--sp-2); }
.episode-title a { color: var(--c-ink); }
.episode-title a:hover { color: var(--c-accent); }
.episode-desc { color: var(--c-ink-2); margin-bottom: var(--sp-4); }
.audio-player {
  width: 100%;
  height: 36px;
  border-radius: var(--r-md);
  accent-color: var(--c-accent);
}
.episode-coming-soon {
  display: inline-block;
  font-family: var(--f-ui);
  font-size: var(--fs-xs);
  color: var(--c-ink-3);
  border: 1px dashed var(--c-border);
  padding: var(--sp-2) var(--sp-4);
  border-radius: 20px;
  letter-spacing: 0.06em;
}

/* ═══════════════════════════════════════════════════════════════
   ABOUT PAGE
   ═══════════════════════════════════════════════════════════════ */
.about-grid {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: var(--sp-16);
  align-items: start;
}
@media (max-width: 768px) { .about-grid { grid-template-columns: 1fr; } }

.about-portrait {
  position: sticky;
  top: calc(80px + var(--sp-8));
}
.about-portrait img {
  width: 100%;
  border-radius: var(--r-lg);
  filter: grayscale(20%);
}
.about-content h2 { margin-top: var(--sp-12); }
.about-content h2:first-child { margin-top: 0; }

/* ═══════════════════════════════════════════════════════════════
   BUTTONS
   ═══════════════════════════════════════════════════════════════ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  font-family: var(--f-ui);
  font-size: var(--fs-sm);
  letter-spacing: 0.04em;
  padding: var(--sp-3) var(--sp-6);
  border-radius: var(--r-md);
  border: 1px solid transparent;
  cursor: pointer;
  transition: background var(--t-fast), color var(--t-fast), border-color var(--t-fast);
  text-decoration: none;
}
.btn--primary {
  background: var(--c-ink);
  color: white;
}
.btn--primary:hover { background: var(--c-ink-2); color: white; }
.btn--outline {
  background: transparent;
  color: var(--c-ink);
  border-color: var(--c-border);
}
.btn--outline:hover { border-color: var(--c-ink); color: var(--c-ink); }
.btn--ghost {
  background: transparent;
  color: var(--c-accent);
  padding-left: 0;
  padding-right: 0;
}

/* ═══════════════════════════════════════════════════════════════
   PAGINATION
   ═══════════════════════════════════════════════════════════════ */
.pagination {
  display: flex;
  justify-content: center;
  gap: var(--sp-2);
  margin-top: var(--sp-12);
  font-family: var(--f-ui);
  font-size: var(--fs-sm);
}
.pagination a, .pagination span {
  padding: var(--sp-2) var(--sp-4);
  border-radius: var(--r-md);
  border: 1px solid var(--c-border);
  color: var(--c-ink-2);
}
.pagination a:hover { border-color: var(--c-accent); color: var(--c-accent); }
.pagination .current {
  background: var(--c-ink);
  color: white;
  border-color: var(--c-ink);
}

/* ═══════════════════════════════════════════════════════════════
   SEARCH FORM
   ═══════════════════════════════════════════════════════════════ */
.search-form {
  display: flex;
  gap: var(--sp-3);
  margin: var(--sp-8) 0;
}
.search-form input[type="search"] {
  flex: 1;
  padding: var(--sp-3) var(--sp-4);
  border: 1px solid var(--c-border);
  border-radius: var(--r-md);
  background: var(--c-surface);
  font-family: var(--f-body);
  font-size: var(--fs-base);
  color: var(--c-ink);
  transition: border-color var(--t-fast);
}
.search-form input[type="search"]:focus {
  outline: none;
  border-color: var(--c-accent);
}

/* ═══════════════════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════════════════ */
@media (max-width: 900px) {
  .site-nav__menu { gap: var(--sp-4); }
  .gallery-grid { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); } /* Z-02: clamp() in minmax removed */
}

@media (max-width: 768px) {
  .site-nav__menu {
    display: none;
    position: fixed;
    top: 65px;
    left: 0;
    right: 0;
    background: var(--c-bg);
    border-bottom: 1px solid var(--c-border);
    flex-direction: column;
    padding: var(--sp-6);
    gap: var(--sp-3);
    box-shadow: 0 8px 24px rgba(28,27,24,0.1);
  }
  .site-nav__menu.open { display: flex; }
  .nav-toggle { display: block; }
  .hero { padding: var(--sp-16) 0 var(--sp-12); }
  .hero__headline { font-size: 1.8rem; }
}

/* ═══════════════════════════════════════════════════════════════
   WORDPRESS ALIGNMENTS
   ═══════════════════════════════════════════════════════════════ */
.alignleft  { float: left; margin-right: var(--sp-6); margin-bottom: var(--sp-4); }
.alignright { float: right; margin-left: var(--sp-6); margin-bottom: var(--sp-4); }
.aligncenter { margin-left: auto; margin-right: auto; text-align: center; }
.alignwide  { max-width: var(--w-wide); margin-left: auto; margin-right: auto; }
.alignfull  { width: 100vw; margin-left: calc(-50vw + 50%); }
.wp-caption { max-width: 100%; }
.wp-caption-text {
  font-family: var(--f-ui);
  font-size: var(--fs-xs);
  color: var(--c-ink-3);
  text-align: center;
  padding-top: var(--sp-2);
}

/* ═══════════════════════════════════════════════════════════════
   SCROLL FADE-IN (progressive enhancement)
   ═══════════════════════════════════════════════════════════════ */
.fade-in {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.fade-in.visible { opacity: 1; transform: none; }

/* ═══════════════════════════════════════════════════════════════
   FRONT PAGE — ENSŌ CIRCLE LAYOUT
   ═══════════════════════════════════════════════════════════════

   Geometry (all % of .enso-stage square container):
     Brushstroke ring r=80 in 200×200 viewBox → 40% of container
     Gap 60° at BOTTOM (6 o'clock, 180°): start 210° / end 150°
     Node positions (centre of glyph, transform: translate(-50%,-50%)):
       ψ  NW 315° : left 21.7%  top 21.7%
       א  NE  45° : left 78.3%  top 21.7%
       道  SE 135° : left 78.3%  top 78.3%
       声  SW 225° : left 21.7%  top 78.3%
       無限 centre : left 50%    top 50%
   ═══════════════════════════════════════════════════════════════ */

.front-main { display: flex; flex-direction: column; }

/* Full-viewport hero */
.front-hero {
  min-height: calc(100vh - 65px);
  min-height: calc(100svh - 65px); /* iOS Safari */
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--sp-8) var(--sp-6);
}

/* ── Ensō stage container ─────────────────────────────────────── */
.enso-stage {
  position: relative;
  width:  min(88vw, 480px);
  height: min(88vw, 480px);
  flex-shrink: 0;
  overflow: hidden;   /* clip thick stroke at container boundary */
}

/* ── SVG ensō ring ────────────────────────────────────────────── */
.enso-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;  /* clicks fall through to the symbol nodes */
  z-index: 1;
}
/* Calligraphic brushstroke — soft warm grey, glyphs readable against it */
.enso-body {
  fill: #9a9490;                  /* soft warm grey — ink washed, not sumi-black */
  opacity: 0.32;                  /* light enough for text to sit on top */
  transition: opacity 0.7s ease;
}
.enso-stage:hover .enso-body { opacity: 0.44; }

/* ── Symbol nodes ─────────────────────────────────────────────── */
.enso-node {
  position: absolute;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-decoration: none;
  color: var(--c-ink);
  z-index: 10;            /* always above SVG */
  cursor: pointer;
  /* tooltip anchor */
}

/* Cardinal positions — on the circle (r=80 in 200×200 vb → 40% radius, 315°/45°/135°/225°) */
.enso-node--nw { left: 21.7%; top: 21.7%; }
.enso-node--ne { left: 78.3%; top: 21.7%; }
.enso-node--se { left: 78.3%; top: 78.3%; }
.enso-node--sw { left: 21.7%; top: 78.3%; }

.enso-glyph {
  font-family: var(--f-ja);      /* Noto Serif JP — calligraphic for all symbols */
  font-size: clamp(2.2rem, 6vw, 3.4rem);
  font-weight: 400;
  line-height: 1;
  display: block;
  color: var(--c-ink);
  /* paper-white halo — keeps glyph readable on bold ink ring */
  text-shadow:
    0 0 10px var(--c-bg),
    0 0 18px var(--c-bg),
    0 0  6px var(--c-bg);
  transition: color var(--t-base), transform var(--t-base), text-shadow var(--t-base);
}

.enso-node:hover .enso-glyph {
  color: var(--c-accent);
  transform: scale(1.12);
  text-shadow:
    0 0 10px var(--c-bg),
    0 0 20px var(--c-bg),
    0 0  6px var(--c-bg),
    0 2px 8px rgba(92, 122, 92, 0.22);
}

/* Tooltip — appears on hover, positioned outward from centre */
.enso-tooltip {
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  pointer-events: none;
  opacity: 0;
  transform: scale(0.92);
  transition: opacity var(--t-base), transform var(--t-base);
  white-space: normal;        /* v1.5.8: allow wrapping for longer locale strings */
  max-width: 10rem;           /* cap width — tooltip stays compact */
  font-family: var(--f-ui);
}
.enso-tooltip strong {
  font-size: var(--fs-xs);
  font-weight: 500;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--c-ink);
  line-height: 1.2;
  /* halo keeps text readable if tooltip overlaps the brushstroke ring */
  text-shadow:
    0 0 8px var(--c-bg),
    0 0 14px var(--c-bg),
    0 0  4px var(--c-bg);
}
.enso-tooltip em {
  font-size: var(--fs-xs);
  font-style: normal;
  color: var(--c-ink-2);
  letter-spacing: 0.04em;
  line-height: 1.3;
  text-shadow:
    0 0 8px var(--c-bg),
    0 0 14px var(--c-bg),
    0 0  4px var(--c-bg);
}
.enso-node:hover .enso-tooltip {
  opacity: 1;
  transform: scale(1);
}

/* Tooltip positions — pushed away from centre */
.enso-node--nw .enso-tooltip { bottom: 105%; right: -20%; text-align: right; align-items: flex-end; }
.enso-node--ne .enso-tooltip { bottom: 105%; left: -20%;  text-align: left;  align-items: flex-start; }
.enso-node--se .enso-tooltip { top:    105%; left: -20%;  text-align: left;  align-items: flex-start; }
.enso-node--sw .enso-tooltip { top:    105%; right: -20%; text-align: right; align-items: flex-end; }

/* ── Centre — 無限 ────────────────────────────────────────────── */
.enso-centre {
  position: absolute;
  left: 50%;
  top:  50%;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-1);
  color: var(--c-ink);
  z-index: 10;
}
.enso-centre__glyph {
  font-family: var(--f-ja);
  font-size: clamp(2.4rem, 7vw, 4.4rem);
  font-weight: 300;
  line-height: 1;
  display: block;
  transition: transform var(--t-slow);
  pointer-events: none; /* glyph is decorative — links below are clickable */
}
.enso-centre:hover .enso-centre__glyph {
  transform: scale(1.06);
}

/* ── Two sub-links: blog · gallery ──────────────────────────── */
.enso-centre__links {
  display: flex;
  align-items: center;
  gap: 0.35em;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity var(--t-base), transform var(--t-base);
}
.enso-centre:hover .enso-centre__links { opacity: 1; transform: none; }

.enso-centre__link {
  font-family: var(--f-ui);
  font-size: var(--fs-xs);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--c-ink-3);
  text-decoration: none;
  transition: color var(--t-base);
}
.enso-centre__link:hover { color: var(--c-accent); }

.enso-centre__sep {
  font-size: var(--fs-xs);
  color: var(--c-ink-3);
  opacity: 0.45;
  pointer-events: none;
}

/* ── Tagline ──────────────────────────────────────────────────── */
.enso-motto {
  margin-top: var(--sp-8);
  font-family: var(--f-body);
  font-size: var(--fs-sm);
  font-style: italic;
  color: var(--c-ink-3);
  letter-spacing: 0.03em;
  text-align: center;
}

/* ── Minimal header on front page ────────────────────────────── */
.site-header--front {
  background: transparent;
  border-bottom-color: transparent;
  box-shadow: none;
}
.site-header--front.scrolled {
  background: rgba(248, 247, 244, 0.92);
  border-bottom-color: var(--c-border);
  backdrop-filter: blur(8px);
}

/* ── Nav glyph in inner-page header ──────────────────────────── */
.nav-glyph {
  font-family: var(--f-ui);
  font-size: 1.05em;
  opacity: 0.65;
  margin-right: 3px;
}

/* ── Recent notes strip ───────────────────────────────────────── */
.front-recent {
  padding: var(--sp-16) 0 var(--sp-24);
  border-top: 1px solid var(--c-border);
  width: 100%;
}
.recent-note {
  display: flex;
  align-items: baseline;
  gap: var(--sp-6);
  padding: var(--sp-4) 0;
  border-bottom: 1px solid var(--c-border);
  color: var(--c-ink);
  text-decoration: none;
  transition: color var(--t-fast);
}
.recent-note:first-child { border-top: 1px solid var(--c-border); }
.recent-note:hover { color: var(--c-accent); }
.recent-note__date {
  font-family: var(--f-ui);
  font-size: var(--fs-xs);
  color: var(--c-ink-3);
  min-width: 90px;
  flex-shrink: 0;
}
.recent-note__title { font-size: var(--fs-base); }

/* ── Responsive — small screens ──────────────────────────────── */
@media (max-width: 480px) {
  .enso-stage { width: 92vw; height: 92vw; }
  .enso-glyph { font-size: clamp(1.6rem, 7vw, 2.4rem); }
  .enso-centre__glyph { font-size: clamp(1.8rem, 9vw, 3rem); }
  /* On very small screens collapse tooltips to always visible, smaller */
  .enso-tooltip {
    position: static;
    opacity: 1 !important;
    transform: none !important;
    margin-top: 4px;
  }
  .enso-node--nw .enso-tooltip,
  .enso-node--ne .enso-tooltip,
  .enso-node--se .enso-tooltip,
  .enso-node--sw .enso-tooltip {
    text-align: center;
    align-items: center;
  }
}

/* ── Section landing pages (ψ / א / 道) ──────────────────────── */
.section-landing { padding: var(--sp-24) 0; text-align: center; }
.section-landing__symbol {
  font-size: clamp(3rem, 10vw, 7rem);
  font-family: var(--f-ui);
  font-weight: 300;
  line-height: 1;
  color: var(--c-ink);
  margin-bottom: var(--sp-6);
}
.section-landing__title  { font-size: var(--fs-xl); font-weight: 400; margin-bottom: var(--sp-4); }
.section-landing__lead   { color: var(--c-ink-2); max-width: 560px; margin: 0 auto var(--sp-12); }
.section-landing__sub-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: var(--sp-6);
  max-width: var(--w-wide);
  margin: 0 auto;
  text-align: left;
}
.sub-card {
  border: 1px solid var(--c-border);
  border-radius: var(--r-lg);
  padding: var(--sp-8);
  background: var(--c-surface);
  transition: transform var(--t-base), box-shadow var(--t-base);
  text-decoration: none;
  color: var(--c-ink);
  display: block;
}
.sub-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 28px rgba(28,27,24,0.08);
  color: var(--c-ink);
}
/* ── Blog category filter — horizontal row variant of .cf-btn ─────────── */
.cat-filter .cf-btn {
  width: auto;
  display: inline-flex;
  text-decoration: none;
  padding: 4px 12px;
  font-size: var(--fs-sm);
}

.sub-card__glyph { display:block; font-size:1.6rem; line-height:1; margin-bottom:var(--sp-3); color:var(--c-ink-3); }
.sub-card__title { font-size: var(--fs-lg); font-weight: 400; margin-bottom: var(--sp-3); }
.sub-card__body  { font-size: var(--fs-sm); color: var(--c-ink-2); line-height: var(--lh-base); }

/* ═══════════════════════════════════════════════════════════════
   MATHEMATICS — KaTeX rendering
   ═══════════════════════════════════════════════════════════════ */

/* Display / block equations */
.math-display,
.katex-display {
  display: block;
  overflow-x: auto;
  overflow-y: hidden;
  padding: var(--sp-6) 0;
  margin: var(--sp-8) 0;
  text-align: center;
  -webkit-overflow-scrolling: touch;
}

/* Inline math — sits naturally in flow text */
.math-inline,
.katex {
  font-size: 1.05em;
}

/* Scrollable on narrow viewports without breaking layout */
.katex-display > .katex {
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  padding-bottom: var(--sp-2);
}

/* Error styling */
.katex-error {
  color: #c00;
  font-family: var(--f-mono);
  font-size: var(--fs-sm);
}

/* Within post content — extra breathing room */
.post-content .katex-display {
  margin: var(--sp-10) 0;
  padding: var(--sp-4) var(--sp-6);
  background: var(--c-bg-alt);
  border-radius: var(--r-md);
  border-left: 2px solid var(--c-border);
}

/* Equation numbering helper — optional, manual */
.eq-numbered {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: var(--sp-4);
}
.eq-numbered .eq-num {
  font-family: var(--f-ui);
  font-size: var(--fs-sm);
  color: var(--c-ink-3);
}

/* ── Accessibility & Touch: minimum tap targets ─────────────────── */
.zemla-player button,
.zemla-player input[type="range"],
.filter-tag,
.lang-switcher a { min-height: 44px; min-width: 44px; }



/* ═══════════════════════════════════════════════════════════════════
   3-FOLD-PATH GRAPHIC ELEMENTS — HMSW / VMSW series  (v1.5.4)
   Horizontal Motif Strip Width-25 — Sengai □△○ repeating divider
   Source: assets/images/HMSW25.svg (630×320 viewBox, rendered 25×13)
   ═══════════════════════════════════════════════════════════════════ */

:root {
  --hmsw-tile-w:   30px;         /* zemla.org override — slightly larger tile */
  --hmsw-tile-h:   15px;
  --hmsw-opacity:  0.12;         /* subtle on artistic/dark backgrounds */
}

/* Base horizontal divider — use as <hr class="hmsw25"> */
.hmsw25 {
  border: none;
  height: var(--hmsw-tile-h);
  width: 100%;
  background-image: url('assets/images/HMSW25.svg');
  background-repeat: repeat-x;
  background-size: var(--hmsw-tile-w) var(--hmsw-tile-h);
  background-position: center;
  opacity: var(--hmsw-opacity);
  margin: var(--sp-6) 0;
  display: block;
}

/* Accent variant — bolder presence for major section breaks */
.hmsw25--accent {
  --hmsw-opacity: 0.22;
  --hmsw-tile-w: 38px;
  --hmsw-tile-h: 19px;
}

/* HMSW33 — finer 1/33 downscale; carousel-border-only use (3-fold-path shared) */
.hmsw33 {
  border: none;
  height: 9px;
  background-image: url('assets/images/HMSW25.svg');
  background-repeat: repeat-x;
  background-size: 19px 9px;
  background-position: center;
  opacity: 0.20;
  margin: 0;
  display: block;
}
.hmsw33--carousel-top    { margin-bottom: 0; border-radius: var(--r-sm) var(--r-sm) 0 0; }
.hmsw33--carousel-bottom { margin-top: 0;    border-radius: 0 0 var(--r-sm) var(--r-sm); }

/* Dynamic variant — full CSS-custom-property control */
.hmsw-dynamic {
  border: none;
  height: var(--hmsw-tile-h, 15px);
  background-image: url('assets/images/HMSW25.svg');
  background-repeat: repeat-x;
  background-size: var(--hmsw-tile-w, 30px) var(--hmsw-tile-h, 15px);
  background-position: center;
  opacity: var(--hmsw-opacity, 0.12);
  margin: var(--sp-5) 0;
  display: block;
}

/* Section wrapper with top + bottom HMSW25 lining */
.hmsw25-strip {
  position: relative;
}
.hmsw25-strip::before,
.hmsw25-strip::after {
  content: '';
  display: block;
  height: var(--hmsw-tile-h, 15px);
  background-image: url('assets/images/HMSW25.svg');
  background-repeat: repeat-x;
  background-size: var(--hmsw-tile-w, 30px) var(--hmsw-tile-h, 15px);
  background-position: center;
  opacity: var(--hmsw-opacity, 0.12);
}

/* VMSW25 — FUTURE: vertical strip variant (codename VMSW25)
   Pending: generate VMSW25.svg (90° rotation of tile, repeat-y)
.vmsw25 {
  width: var(--hmsw-tile-h, 15px);
  background-image: url('assets/images/VMSW25.svg');
  background-repeat: repeat-y;
  background-size: var(--hmsw-tile-h, 15px) var(--hmsw-tile-w, 30px);
  opacity: var(--hmsw-opacity, 0.12);
  display: inline-block;
}
*/

/* ═══════════════════════════════════════════════════════════════
   RICH MEDIA CONTENT — Hory (Mountains) + Oceán (Ocean) pages
   v1.5.6 — zemla-section-intro, video-hero, playlist-embed
   ═══════════════════════════════════════════════════════════════ */

/* Section intro block */
.zemla-section-intro {
  margin-bottom: var(--sp-16);
  padding: var(--sp-8) var(--sp-12);
  border-left: 3px solid var(--c-accent);
  background: rgba(var(--c-accent-rgb, 100 130 160) / 0.05);
  border-radius: 0 6px 6px 0;
}
.zemla-section-intro p {
  font-size: var(--fs-md);
  line-height: var(--lh-base);
  color: var(--c-ink-2);
  margin: 0;
}

/* Hero video pair — side by side on wide, stack on mobile */
.zemla-video-hero {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-8);
  margin: var(--sp-12) 0 var(--sp-16);
}
@media (max-width: 680px) {
  .zemla-video-hero {
    grid-template-columns: 1fr;
  }
}

/* Responsive iframe container — 16:9 aspect ratio */
.zemla-video-embed {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #0a0a0a;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 12px rgba(0,0,0,0.25);
}
.zemla-video-embed iframe {
  position: absolute;
  top: 0; left: 0;
  width: 100%;
  height: 100%;
  border: none;
}

/* Playlist embed — full width, taller for playlist UI */
.zemla-playlist-embed {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #0a0a0a;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 12px rgba(0,0,0,0.25);
  margin: var(--sp-8) 0 var(--sp-16);
}
.zemla-playlist-embed iframe {
  position: absolute;
  top: 0; left: 0;
  width: 100%;
  height: 100%;
  border: none;
}

/* Rich media content — sub-headers and links */
.zemla-rich-media-content h3 {
  font-size: var(--fs-lg);
  font-weight: 400;
  color: var(--c-ink);
  margin: var(--sp-16) 0 var(--sp-4);
  letter-spacing: 0.01em;
}
.zemla-rich-media-content h3:first-child {
  margin-top: 0;
}
.zemla-rich-media-content p {
  color: var(--c-ink-2);
  line-height: var(--lh-base);
  margin-bottom: var(--sp-6);
}
.zemla-rich-media-content a {
  color: var(--c-link, var(--c-accent));
  text-decoration: underline;
  text-decoration-color: transparent;
  transition: text-decoration-color 0.15s;
}
.zemla-rich-media-content a:hover {
  text-decoration-color: currentColor;
}

/* ── Enso tooltip expansion (Psychologie a Hory / Buddhadharma a Oceán) ── */
/* Tooltip width bump — longer labels need a wider tip */
.enso-node--nw .enso-tooltip,
.enso-node--ne .enso-tooltip {
  min-width: 160px;
}


/* ============================================================================
   ZEMLA v1.6.8 — style.css APPEND BLOCK
   Apply: WP Admin → Appearance → Theme File Editor → style.css
          Scroll to bottom → paste entire block → Update File

   Contents:
     §Z-15   Podcast cover art — constrain + float right               (BUG-003)
     §Z-16   Podcast player augmentation — skip + speed controls       (BUG-004)
     §PHYS   Physics section page styling — Standard Model blocks
     §MOB    Mobile polish — physics + podcast at 480 / 520 / 860 px
   ============================================================================ */


/* ── §Z-15: Podcast Episode — Featured Image ──────────────────────────────────
   Scope: .single-zemla_episode (CPT: zemla_episode)
   Fix:   cover art renders ≤200×200px, floated right, player clears below
   Ref:   hotfix-Z15-podcast-cover.css / BUG-003
   -------------------------------------------------------------------------- */
.single-zemla_episode .wp-post-image {
  float: right;
  max-width: 200px;
  max-height: 200px;
  width: auto;
  height: auto;
  margin: 0 0 var(--sp-4, 1rem) var(--sp-6, 1.5rem);
  border-radius: 4px;
  display: block;
}

.single-zemla_episode .zp-player {
  clear: both;
}


/* ── §Z-16 v2: Podcast Player — single-row horizontal layout ─────────────────
   HOTFIX-ZP-002: compact transport row, intendedRate JS fixes (speed drift, skip restart)
   DOM after JS injection: .zp-skip-back .zp-play .zp-skip-fwd .zp-progress-wrap
                           .zp-time .zp-speed .zp-download
   -------------------------------------------------------------------------- */

/* Player container ─────────────────────────────────────────────────────────── */
.zp-player {
  display: flex;
  flex-direction: row;
  align-items: center;
  flex-wrap: nowrap;
  gap: 6px;
  padding: 10px 14px;
  border-radius: 6px;
  background: var(--c-surface, rgba(0,0,0,0.04));
  max-width: 640px;
}

/* Progress bar: fills remaining space ──────────────────────────────────────── */
.zp-progress-wrap {
  flex: 1 1 60px;
  min-width: 60px;
  cursor: pointer;
  position: relative;
}

/* Time display ──────────────────────────────────────────────────────────────── */
.zp-time {
  font-size: 0.72rem;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  opacity: 0.7;
  flex-shrink: 0;
}

/* Play + skip buttons ───────────────────────────────────────────────────────── */
.zp-play,
.zp-skip {
  flex-shrink: 0;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  color: inherit;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  transition: opacity 0.15s;
}
.zp-play { padding: 4px 6px; }
.zp-play:hover,
.zp-skip:hover { opacity: 0.6; }
.zp-play:focus-visible,
.zp-skip:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 2px;
}

/* Icon-only in horizontal mode — hide text labels */
.zp-skip-label { display: none; }

/* Speed toggle ──────────────────────────────────────────────────────────────── */
.zp-speed {
  flex-shrink: 0;
  background: none;
  border: 1px solid currentColor;
  border-radius: 4px;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.72rem;
  font-weight: 700;
  color: inherit;
  padding: 2px 6px;
  min-width: 2.4rem;
  text-align: center;
  opacity: 0.65;
  transition: opacity 0.15s;
  line-height: 1.5;
}
.zp-speed:hover { opacity: 1; }
.zp-speed:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 2px;
}
.zp-speed[data-speed="1.5"],
.zp-speed[data-speed="2"] { opacity: 1; font-style: italic; }

/* Download link ─────────────────────────────────────────────────────────────── */
.zp-download {
  flex-shrink: 0;
  opacity: 0.55;
  transition: opacity 0.15s;
  font-size: 0.72rem;
  line-height: 1;
  display: inline-flex;
  align-items: center;
}
.zp-download:hover { opacity: 1; }

/* Fill transition ───────────────────────────────────────────────────────────── */
.zp-fill {
  transition: width 0.1s linear;
}

/* Mobile: wrap progress + time below transport at narrow viewports ───────────── */
@media (max-width: 420px) {
  .zp-player   { flex-wrap: wrap; gap: 6px 4px; }
  .zp-progress-wrap { order: 10; flex-basis: 100%; }
  .zp-time          { order: 11; flex-basis: 100%; text-align: center; }
}


/* ── §PHYS: Physics section — Standard Model page layout ─────────────────────
   Scope: Physics landing (page-id-95) + all child pages
          Child pages tagged via .page-physics-section body class
          (added by functions.php zemla_physics_body_class hook below)
   -------------------------------------------------------------------------- */

/* Physics landing page — Standard Model section blocks */
.page-id-95 h2.wp-block-heading {
  font-size: clamp(1.4rem, 2.5vw, 1.9rem);
  margin-bottom: 0.75rem;
  letter-spacing: -0.01em;
}

/* Section h3 headings — linked Standard Model titles */
.page-id-95 h3.wp-block-heading,
.page-physics-section h3.wp-block-heading {
  font-size: clamp(1.1rem, 2vw, 1.4rem);
  margin-bottom: 0.5rem;
}

.page-id-95 h3.wp-block-heading a {
  text-decoration: none;
  border-bottom: 2px solid currentColor;
  padding-bottom: 1px;
  transition: opacity 0.15s;
}
.page-id-95 h3.wp-block-heading a:hover {
  opacity: 0.65;
}

/* Sub-section link row (→ Heavy Fermionic · → High-Tc) */
.page-id-95 p:last-child a,
.page-id-95 .wp-block-paragraph a[href*="heavy-fermionic"],
.page-id-95 .wp-block-paragraph a[href*="high-tc"],
.page-id-95 .wp-block-paragraph a[href*="standard-model"] {
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* Separator between Standard Model sections */
.page-id-95 .wp-block-separator {
  border: none;
  border-top: 1px solid rgba(0, 0, 0, 0.12);
  margin: 2.5rem 0;
  opacity: 1;
}

/* Physics content pages — general prose improvements */
.page-physics-section .wp-block-heading {
  line-height: 1.25;
}

.page-physics-section .wp-block-separator {
  border: none;
  border-top: 1px solid rgba(0, 0, 0, 0.10);
  margin: 2rem 0;
  opacity: 1;
}

/* Reference list — tighter, smaller font */
.page-physics-section .wp-block-list {
  font-size: 0.9rem;
  line-height: 1.7;
}

.page-physics-section .wp-block-list li {
  margin-bottom: 0.35rem;
}

/* Blockquotes (Dirac quotes on AMP-01) */
.page-physics-section .wp-block-quote {
  border-left: 3px solid currentColor;
  padding-left: 1.25rem;
  margin: 1.5rem 0;
  opacity: 0.85;
}

.page-physics-section .wp-block-quote p {
  font-style: italic;
}

.page-physics-section .wp-block-quote cite {
  display: block;
  margin-top: 0.5rem;
  font-size: 0.85rem;
  font-style: normal;
  opacity: 0.75;
}

/* Confidence flags — (Confidence: MEDIUM ...) — style inline */
.page-physics-section p em:first-child {
  display: block;
  font-size: 0.82rem;
  opacity: 0.7;
  margin-top: 0.5rem;
  font-style: italic;
}

/* Back-link to parent page */
.page-physics-section .wp-block-paragraph a[href*="/standard-model-atomic/"],
.page-physics-section .wp-block-paragraph a[href*="/physics/"] {
  font-weight: 600;
}


/* ── §MOB: Mobile polish ──────────────────────────────────────────────────────
   Physics pages + podcast at narrow viewports
   -------------------------------------------------------------------------- */

/* Podcast cover — stack above content on phones */
@media (max-width: 520px) {
  .single-zemla_episode .wp-post-image {
    float: none;
    max-width: 100%;
    max-height: none;
    width: 100%;
    height: auto;
    margin: 0 0 var(--sp-4, 1rem) 0;
    border-radius: 6px;
  }
}

/* Physics landing — tighten section gaps on mobile */
@media (max-width: 860px) {
  .page-id-95 .wp-block-separator {
    margin: 1.75rem 0;
  }
  .page-id-95 h2.wp-block-heading {
    font-size: 1.35rem;
  }
}

@media (max-width: 480px) {
  .page-id-95 h2.wp-block-heading {
    font-size: 1.2rem;
  }
  .page-id-95 h3.wp-block-heading {
    font-size: 1.05rem;
  }
  .page-id-95 .wp-block-separator {
    margin: 1.25rem 0;
  }

  /* Physics content pages — tighten reference list padding */
  .page-physics-section .wp-block-list {
    padding-left: 1.2rem;
  }
  .page-physics-section .wp-block-quote {
    padding-left: 1rem;
  }
}


/* ============================================================================
   HOTFIX-ZP-001 — style.css APPEND BLOCK
   Apply: WP Admin → Appearance → Theme File Editor → style.css
          Scroll to bottom → paste entire block → Update File

   Fixes:
     §HZP-A  Podcast cover art — suppress entirely on episode pages   (BUG-018a)
             Supersedes §Z-15 float:right approach (leave §Z-15 in place,
             this rule wins via specificity + !important)
   ============================================================================ */


/* ── §HZP-A: Podcast episode — suppress featured image ───────────────────────
   Scope: .single-zemla_episode (CPT: zemla_episode)
   Decision (2026-04-24): remove cover art from episode page body entirely.
   §Z-15 float:right had no effect against theme stacking/wrapper styles.
   display:none is clean and does not leave layout gaps.
   -------------------------------------------------------------------------- */
.single-zemla_episode .wp-post-image,
.single-zemla_episode .post-thumbnail,
.single-zemla_episode .wp-post-image-wrap {
  display: none !important;
}
