/* ============================================
   HERO — half covered / half visible, text-as-window reveal
   ============================================
   .blog-hero-media is the full-bleed, always-crisp photo. .blog-hero-cover
   is a static dark/blurred scrim pinned over the left half only (matching
   example-blog-hero.jpg's muted/vivid split) — the right half of the photo
   is never covered.

   "DAILY JOURNALS" spans the full width across the vertical middle, on top
   of both halves. It's built from two identically-positioned copies of the
   same text, each clipped with clip-path to its own half:
     .blog-hero-heading-solid  — right half only, filled solid white so it
       reads clearly against the already-visible photo.
     .blog-hero-heading-image  — left half only, filled with the same photo
       via background-clip:text (color:transparent) instead of a solid
       color, so each letter acts as a window straight down to the crisp
       image — the only place on the covered half where the scrim's
       blur/darkness doesn't apply. That's the "reveal": confined to the
       shape of the letters, not a panel wipe.
   Both copies share one parent box (same width, same flex-centering), so
   their line breaks and glyph positions land identically and the clip-path
   seam is invisible — it reads as one continuous word. */
.blog-hero {
  position: relative;
  height: 100vh;
  width: 100%;
  overflow: hidden;
  background: var(--color-dark);
}

.blog-hero-media {
  position: absolute;
  inset: 0;
}

.blog-hero-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.blog-hero-cover {
  position: absolute;
  inset: 0;
  width: 50%;
  background: linear-gradient(
    120deg,
    rgba(22, 33, 29, 0.82) 0%,
    rgba(22, 33, 29, 0.58) 100%
  );
  backdrop-filter: blur(6px) saturate(0.35) brightness(0.7);
  -webkit-backdrop-filter: blur(6px) saturate(0.35) brightness(0.7);
  opacity: 0;
  animation: blog-hero-cover-in 1.1s cubic-bezier(0.16, 1, 0.3, 1) 0.2s forwards;
}

@keyframes blog-hero-cover-in {
  to { opacity: 1; }
}

.blog-hero-sr-title {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

.blog-hero-heading-row {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 1.5rem;
  text-align: center;
}

/* Eyebrow + subtitle, stacked on top of each other in the bottom-left
   corner of the hero — separate from the big centered headline above. This
   corner sits over the covered (left) half of the photo at every
   breakpoint (see the left/right-split note above), so the dark scrim
   behind them holds contrast regardless of screen width. */
.blog-hero-meta {
  position: absolute;
  left: clamp(1.5rem, 5vw, 3rem);
  bottom: clamp(1.5rem, 5vw, 3rem);
  z-index: 3;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-width: 20rem;
  text-align: left;
}

.blog-hero-eyebrow {
  font-family: var(--font-avenir);
  font-size: 0.75rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--color-rust);
  font-weight: 700;
  opacity: 0;
  transform: translateY(16px);
  animation: blog-hero-text-in 0.9s cubic-bezier(0.16, 1, 0.3, 1) 0.9s forwards;
}

/* Reserves layout space in the eyebrow/heading/subtitle flex column — the
   two text layers below are pulled out of flow (position:absolute) so this
   wrapper has no natural height of its own; --blog-heading-fs/--blog-
   heading-lines keep that reserved space in sync with the layers' actual
   font-size and line count at each breakpoint instead of a hardcoded
   number that could drift out of sync. */
.blog-hero-heading {
  --blog-heading-fs: clamp(2.5rem, 8.5vw, 7rem);
  --blog-heading-lines: 1;
  width: 100%;
  min-height: calc(var(--blog-heading-fs) * 1.02 * var(--blog-heading-lines));
}

/* No position:relative on .blog-hero-heading above — that's deliberate.
   It lets these layers' position:absolute skip past it and anchor to
   .blog-hero-heading-row (position:absolute; inset:0), which is the same
   full 100vw x 100vh box as the real photo in .blog-hero-media. Sizing
   background-image to that identical box (rather than to this text's own
   thin line-height) is what makes background-size:cover land on the same
   crop/scale as the real image, so the letters read as a true window into
   it — no background-attachment:fixed hack needed, which matters since
   fixed backgrounds are unreliable on several mobile browsers. */
.blog-hero-heading-layer {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  /* Nordic Alternative (the brand display font used elsewhere) is a
     single-weight decorative face with thin, hollow glyphs by design — no
     font-weight can make it "thick," and its thin strokes leave almost no
     area for the image-reveal to show through. This headline instead uses
     the site's sans stack at its heaviest weight, which gives full, solid
     glyph shapes: real boldness, and real area for the reveal. */
  font-family: var(--font-avenir);
  font-weight: 900;
  font-size: var(--blog-heading-fs);
  line-height: 1.02;
  letter-spacing: -0.015em;
  white-space: nowrap;
  opacity: 0;
  transform: translateY(20px);
  animation: blog-hero-text-in 1s cubic-bezier(0.16, 1, 0.3, 1) 1s forwards;
}

/* Left half — the letters are windows onto the crisp photo, punched
   through the scrim. Synthetic extra-bold weight plus a stroke keeps the
   glyphs thick enough to read as a clear "cut" shape rather than a thin
   outline. */
.blog-hero-heading-image {
  clip-path: inset(0 50% 0 0);
  color: transparent;
  background-image: url('/wp-content/uploads/2026/08/MG_4520-scaled.jpg');
  background-position: center;
  background-size: cover;
  -webkit-background-clip: text;
  background-clip: text;
  filter: brightness(1.2) contrast(1.1) saturate(1.15);
}

/* Right half — solid white, already sitting on the fully visible photo. */
.blog-hero-heading-solid {
  clip-path: inset(0 0 0 50%);
  color: #ffffff;
  text-shadow: 0 6px 32px rgba(0, 0, 0, 0.35);
}

.blog-hero-subtitle {
  font-family: var(--font-avenir);
  font-size: 0.92rem;
  color: rgba(244, 239, 232, 0.85);
  line-height: 1.55;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.3);
  opacity: 0;
  transform: translateY(16px);
  animation: blog-hero-text-in 0.9s cubic-bezier(0.16, 1, 0.3, 1) 1.3s forwards;
}

@keyframes blog-hero-text-in {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .blog-hero-cover {
    animation: none;
    opacity: 1;
  }
  .blog-hero-eyebrow,
  .blog-hero-heading-layer,
  .blog-hero-subtitle {
    animation: none;
    opacity: 1;
    transform: none;
  }
}

/* Below ~760px the headline wraps to two lines ("DAILY" / "JOURNALS") to
   stay legible, but the scrim and the left/right split stay exactly as on
   desktop — the covered/visible halves stay left/right at every width, they
   don't switch to a top/bottom split. Since clip-path splits by width
   across the full box height, it crops both wrapped lines consistently:
   whichever half of each line falls left of center reveals the image,
   whichever half falls right renders solid white — same rule, same
   boundary, just with two shorter lines. No clip-path override is needed
   here at all. */
@media (max-width: 760px) {
  .blog-hero-heading {
    --blog-heading-fs: clamp(2.1rem, 12vw, 3.5rem);
    --blog-heading-lines: 2;
  }

  .blog-hero-heading-layer {
    white-space: normal;
  }
}

/* ============================================
   POST GRID
   ============================================ */
.blog-list {
  background: var(--color-cream);
  padding: clamp(4rem, 9vw, 7rem) 1.5rem;
}

.blog-list-inner {
  max-width: 1240px;
  margin: 0 auto;
}

.blog-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(1.75rem, 3vw, 2.5rem) 2rem;
}

.blog-card {
  background: #ffffff;
  border-radius: 14px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 40px rgba(22, 33, 29, 0.08);
  opacity: 0;
  transform: translateY(32px);
  transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1),
    transform 0.7s cubic-bezier(0.16, 1, 0.3, 1),
    box-shadow 0.35s ease;
}

.blog-card.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.blog-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 28px 56px rgba(22, 33, 29, 0.16);
}

.blog-card.is-visible:hover {
  transition: transform 0.35s ease, box-shadow 0.35s ease;
}

.blog-card-media {
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: rgba(22, 33, 29, 0.06);
}

.blog-card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.blog-card:hover .blog-card-media img {
  transform: scale(1.06);
}

.blog-card-body {
  padding: 1.5rem 1.5rem 1.75rem;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.blog-card-date {
  font-family: var(--font-avenir);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--color-rust);
  font-weight: 600;
  margin-bottom: 0.6rem;
}

.blog-card-title {
  font-family: var(--font-nordic);
  font-weight: 400;
  font-size: 1.3rem;
  line-height: 1.28;
  color: var(--color-dark);
  margin-bottom: 0.65rem;
}

.blog-card-excerpt {
  font-family: var(--font-avenir);
  font-size: 0.92rem;
  line-height: 1.65;
  color: rgba(22, 33, 29, 0.72);
  margin-bottom: 1.4rem;
  flex: 1;
}

.blog-card-readmore {
  align-self: flex-start;
  font-family: var(--font-avenir);
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--color-dark);
  text-decoration: none;
  background: transparent;
  border: 1.5px solid var(--color-rust);
  padding: 0.7rem 1.5rem;
  border-radius: 999px;
  transition: background 0.3s ease, color 0.3s ease;
}

.blog-card-readmore:hover {
  background: var(--color-rust) !important;
  color: #ffffff !important;
}

/* Skeleton placeholders shown while the WordPress REST fetch is pending. */
.blog-card.is-skeleton {
  opacity: 1;
  transform: none;
  pointer-events: none;
}

.blog-card.is-skeleton .blog-card-media {
  background: linear-gradient(
    100deg,
    rgba(22, 33, 29, 0.06) 30%,
    rgba(22, 33, 29, 0.12) 50%,
    rgba(22, 33, 29, 0.06) 70%
  );
  background-size: 200% 100%;
  animation: blog-skeleton-shimmer 1.4s ease-in-out infinite;
}

.blog-card.is-skeleton .skeleton-line {
  height: 0.85rem;
  border-radius: 4px;
  background: rgba(22, 33, 29, 0.08);
  margin-bottom: 0.75rem;
  background-size: 200% 100%;
  animation: blog-skeleton-shimmer 1.4s ease-in-out infinite;
}

.blog-card.is-skeleton .skeleton-line.short { width: 40%; }
.blog-card.is-skeleton .skeleton-line.long { width: 90%; }

@keyframes blog-skeleton-shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.blog-empty {
  text-align: center;
  font-family: var(--font-avenir);
  font-size: 1rem;
  color: rgba(22, 33, 29, 0.65);
  padding: 3rem 1rem;
}

.blog-load-more[hidden] {
  display: none;
}

.blog-load-more {
  display: block;
  margin: 3rem auto 0;
  font-family: var(--font-avenir);
  font-size: 0.8rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--color-dark);
  background: transparent;
  border: 1.5px solid var(--color-dark);
  padding: 0.85rem 2.25rem;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.3s ease, color 0.3s ease, opacity 0.3s ease;
}

.blog-load-more:hover {
  background: var(--color-dark);
  color: var(--color-cream);
}

.blog-load-more:disabled {
  opacity: 0.5;
  cursor: default;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 900px) {
  .blog-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 560px) {
  .blog-grid {
    grid-template-columns: 1fr;
    max-width: 420px;
    margin: 0 auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  .blog-card {
    transition: box-shadow 0.35s ease;
    opacity: 1;
    transform: none;
  }
}
