/* === Lê Mai Journal — page-specific CSS ===
   Override + extend site.css for journal homepage.
   Pattern: hero full-bleed dark + alternating section (text-left / image-right) × 2 + footer.
   Image discipline: 3 total (hero + section-2 + section-3).
*/

/* === Dropdown menu — Journal cluster overrides === */
/* Desktop: items stack vertical, min-width đủ cho longest item */
/* Position: anchor right edge của dropdown vào right edge của toggle để menu extend LEFT (vào hướng logo), tránh overflow viewport phải */
nav.top .dropdown-menu {
  min-width: 320px;
  padding: 16px 0 12px;
  left: auto;
  right: 0;
}
nav.top .dropdown-menu a {
  display: block !important;
  padding: 11px 24px;
  color: #1f1812 !important; /* default: dark text on cream bg (cluster + post pages) */
}

/* Homepage: dropdown matches dark hero theme — dark bg + cream text */
body.journal-home nav.top .dropdown-menu {
  background: #15100c;
  border-color: rgba(247, 243, 236, 0.15);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
}
body.journal-home nav.top .dropdown-menu a {
  color: #f7f3ec !important;
}
body.journal-home nav.top .dropdown-menu a:hover {
  background: rgba(247, 243, 236, 0.08);
}

/* Mobile: dropdown lives inside mobile menu (transparent bg), items wrap to multiple lines if needed */
@media (max-width: 720px) {
  nav.top .dropdown-menu {
    min-width: 0;
    padding: 8px 0 0 0;
  }
  nav.top .dropdown-menu a {
    white-space: normal;
    padding: 10px 16px;
  }
  /* Mobile journal-home: nav-menu open có dark bg, dropdown items text cream */
  body.journal-home nav.top .dropdown-menu a {
    color: #f7f3ec !important;
  }
}

/* === Nav overlay on hero === */
/* By default: nav transparent + white text overlaid on dark hero.
   When scrolled past hero (.scrolled class added by journal.js): cream bg + dark text. */

body.journal-home nav.top {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: transparent;
  border-bottom: 1px solid transparent;
}

body.journal-home nav.top .nav-logo img {
  filter: brightness(0) invert(1); /* white logo on dark hero */
  transition: filter 0.3s ease;
}

body.journal-home nav.top a,
body.journal-home nav.top .nav-menu a,
body.journal-home nav.top .dropdown-toggle {
  color: #f7f3ec;
  transition: color 0.3s ease;
}

body.journal-home nav.top .search-open,
body.journal-home nav.top .hamburger span {
  background: #f7f3ec;
}

body.journal-home nav.top .search-open svg {
  stroke: #f7f3ec;
}

/* After scroll past hero — switch to library cream look */
body.journal-home nav.top.scrolled {
  background: rgba(247, 243, 236, 0.96);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid #e5dcce;
}

body.journal-home nav.top.scrolled .nav-logo img {
  filter: none;
}

body.journal-home nav.top.scrolled a,
body.journal-home nav.top.scrolled .nav-menu a,
body.journal-home nav.top.scrolled .dropdown-toggle {
  color: #1f1812;
}

body.journal-home nav.top.scrolled .search-open svg {
  stroke: #1f1812;
}

body.journal-home nav.top.scrolled .hamburger span {
  background: #1f1812;
}

/* === Hero === */
.j-hero {
  position: relative;
  width: 100%;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  background: linear-gradient(135deg, #15100c 0%, #2b1f15 45%, #1a1410 100%);
  color: #f7f3ec;
  overflow: hidden;
  padding: 120px 32px 80px;
}

/* Optional photographic overlay layer — replace background-image below with real hero photo when ready */
.j-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(ellipse at 30% 40%, rgba(80, 60, 40, 0.35), transparent 60%),
    radial-gradient(ellipse at 70% 60%, rgba(40, 30, 20, 0.4), transparent 70%);
  pointer-events: none;
}

.j-hero-content {
  position: relative;
  z-index: 2;
  max-width: 800px;
}

.j-hero-eyebrow {
  font-family: 'Geist', system-ui, sans-serif;
  font-size: 11px;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  opacity: 0.7;
  margin-bottom: 32px;
}

.j-hero h1 {
  font-family: 'EB Garamond', Georgia, serif;
  font-weight: 400;
  font-style: italic;
  font-size: clamp(64px, 11vw, 132px);
  line-height: 0.95;
  letter-spacing: -0.01em;
  margin: 0 0 24px;
  opacity: 0.97;
}

.j-hero-jp {
  font-family: 'Noto Serif JP', serif;
  font-weight: 300;
  font-size: clamp(22px, 3vw, 32px);
  opacity: 0.62;
  letter-spacing: 0.1em;
  margin-bottom: 56px;
  display: block;
}

.j-hero-tagline {
  font-family: 'EB Garamond', Georgia, serif;
  font-size: 19px;
  line-height: 1.6;
  font-style: italic;
  opacity: 0.85;
  max-width: 520px;
  margin: 0 auto 8px;
}

.j-hero-tagline-en {
  font-family: 'Geist', system-ui, sans-serif;
  font-style: italic;
  font-size: 14px;
  opacity: 0.55;
  margin-top: 12px;
}

/* Scroll hint at bottom of hero */
.j-hero-scroll {
  position: absolute;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%);
  font-family: 'Geist', system-ui, sans-serif;
  font-size: 10px;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  opacity: 0.5;
  z-index: 2;
}

/* === Split sections (text left, image right — full-bleed 50/50) === */
.j-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: stretch;
  min-height: 90vh;
  max-width: none;
  margin: 0;
  padding: 0;
  gap: 0;
}

.j-split-text {
  padding: 96px 80px 96px max(64px, calc((100vw - 1400px) / 2));
  display: flex;
  flex-direction: column;
  justify-content: center;
}

/* Constrain text reading width inside left column */
.j-split-text > * {
  max-width: 560px;
}

.j-split-eyebrow {
  font-family: 'Geist', system-ui, sans-serif;
  font-size: 11px;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  opacity: 0.6;
  margin-bottom: 32px;
}

.j-split-title {
  font-family: 'EB Garamond', Georgia, serif;
  font-style: italic;
  font-weight: 400;
  font-size: clamp(34px, 4.2vw, 56px);
  line-height: 1.05;
  margin: 0 0 40px;
  letter-spacing: -0.005em;
}

.j-split-image {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 90vh;
  background: #1a1410;
  overflow: hidden;
}

.j-split-image img {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s ease;
}

.j-split-image:hover img {
  transform: scale(1.02);
}

/* === Recent posts list (Section 2) === */
.j-post-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.j-post-item {
  border-top: 1px solid #d8d0c4;
  padding: 28px 0;
  transition: opacity 0.2s ease;
}

.j-post-item:last-child {
  border-bottom: 1px solid #d8d0c4;
}

.j-post-item:hover {
  opacity: 1;
}

.j-post-link {
  text-decoration: none;
  color: inherit;
  display: block;
}

.j-post-meta {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 12px;
  font-family: 'Geist', system-ui, sans-serif;
  font-size: 10px;
  letter-spacing: 0.28em;
  text-transform: uppercase;
}

.j-post-num {
  opacity: 0.55;
}

.j-post-cluster {
  opacity: 0.75;
}

.j-post-date {
  opacity: 0.5;
  margin-left: auto;
}

.j-post-title {
  font-family: 'EB Garamond', Georgia, serif;
  font-style: italic;
  font-weight: 400;
  font-size: clamp(22px, 2vw, 28px);
  line-height: 1.2;
  margin: 0 0 8px;
  transition: opacity 0.2s ease;
}

.j-post-link:hover .j-post-title {
  opacity: 0.65;
}

.j-post-title-en {
  font-family: 'Geist', system-ui, sans-serif;
  font-style: italic;
  font-size: 13px;
  opacity: 0.55;
  letter-spacing: 0;
  display: block;
}

.j-all-posts {
  margin-top: 32px;
  display: inline-block;
  font-family: 'Geist', system-ui, sans-serif;
  font-size: 11px;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  text-decoration: none;
  color: inherit;
  opacity: 0.7;
  border-bottom: 1px solid currentColor;
  padding-bottom: 4px;
  transition: opacity 0.2s ease;
}

.j-all-posts:hover {
  opacity: 1;
}

/* === Manifesto (Section 3) === */
.j-manifesto p {
  font-family: 'EB Garamond', Georgia, serif;
  font-size: 19px;
  line-height: 1.65;
  margin: 0 0 22px;
  color: #1f1812;
}

.j-manifesto p:last-child {
  margin-bottom: 0;
}

.j-manifesto .lang-en {
  margin-top: 36px;
  padding-top: 24px;
  border-top: 1px dotted #d8d0c4;
}

.j-manifesto .lang-en p {
  font-family: 'Geist', system-ui, sans-serif;
  font-style: italic;
  font-size: 14px;
  line-height: 1.65;
  opacity: 0.85;
}

/* === Section divider === */
.j-split + .j-split {
  border-top: 1px solid #e5dcce;
}

/* === Mobile === */
@media (max-width: 900px) {
  .j-hero {
    min-height: 80vh;
    padding: 100px 24px 60px;
  }
  .j-split {
    grid-template-columns: 1fr;
    min-height: auto;
    gap: 0;
  }
  .j-split-text {
    padding: 72px 24px;
    order: 1;
  }
  .j-split-text > * {
    max-width: none;
  }
  .j-split-image {
    order: 2;
    min-height: 0;
    aspect-ratio: 3 / 4;
    height: auto;
  }
}

/* Mobile nav-menu — dark theme override để text khả kiến trên bg dark */
@media (max-width: 720px) {
  body.journal-home .nav-menu {
    background: #15100c;
    border-top: 1px solid rgba(247, 243, 236, 0.12);
    border-bottom: 1px solid rgba(247, 243, 236, 0.12);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  }
  body.journal-home .nav-menu a {
    color: #f7f3ec;
  }
  body.journal-home .nav-menu a.current {
    opacity: 0.6;
  }
}

@media (max-width: 640px) {
  .j-hero {
    padding: 90px 20px 56px;
  }
  .j-hero-eyebrow {
    margin-bottom: 24px;
    font-size: 10px;
  }
  .j-hero h1 {
    font-size: clamp(48px, 14vw, 80px);
  }
  .j-hero-jp {
    margin-bottom: 36px;
  }
  .j-split-text {
    padding: 56px 20px;
  }
  .j-post-meta {
    font-size: 9px;
  }
}
