/* ============================================================
   MODDING CAFE — Frontend enhancements CSS
   - Inline YouTube video modal
   - Back-to-top button
   ============================================================ */

/* ===== Inline video modal ===== */
.mc-video-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
}
.mc-video-modal.is-open { display: flex; }
.mc-video-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.86);
  backdrop-filter: blur(6px);
}
.mc-video-modal__dialog {
  position: relative;
  width: min(94vw, 1200px);
  background: #000;
  border-radius: 6px;
  overflow: hidden;
  box-shadow: 0 30px 60px rgba(0,0,0,0.6);
  animation: mcVideoIn .25s ease-out;
}
@keyframes mcVideoIn { from { transform: scale(0.94); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.mc-video-modal__frame {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
}
.mc-video-modal__frame iframe {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}
.mc-video-modal__close {
  position: absolute;
  top: -42px;
  right: 0;
  background: transparent;
  border: 0;
  color: #fff;
  font-size: 34px;
  line-height: 1;
  width: 36px;
  height: 36px;
  cursor: pointer;
  font-family: "Barlow Condensed", sans-serif;
}
.mc-video-modal__close:hover { color: var(--color-orange,#FF6347); }
@media (max-width: 600px) {
  .mc-video-modal__close { top: -40px; right: 4px; }
}

/* ===== Back-to-top ===== */
.mc-back-top {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 9000;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 0;
  background: var(--color-orange, #FF6347);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px);
  transition: opacity .22s ease, transform .22s ease, background .15s ease;
  box-shadow: 0 8px 18px rgba(0,0,0,0.4);
  font-family: "Barlow Condensed", sans-serif;
}
.mc-back-top.is-visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}
.mc-back-top:hover { background: #ff7d5e; }
.mc-back-top:active { transform: scale(0.94); }
@media (max-width: 600px) {
  .mc-back-top {
    right: 14px;
    bottom: 14px;
    width: 42px;
    height: 42px;
  }
}

/* ===== Partners marquee (when > 10 logos) ===== */
.partners__marquee {
  overflow: hidden;
  position: relative;
  padding: 18px 0;
  mask-image: linear-gradient(to right, transparent 0%, #000 8%, #000 92%, transparent 100%);
  -webkit-mask-image: linear-gradient(to right, transparent 0%, #000 8%, #000 92%, transparent 100%);
}
.partners__marquee-track {
  display: flex;
  gap: 56px;
  width: max-content;
  animation: partnersMarquee 30s linear infinite;
}
.partners__marquee:hover .partners__marquee-track { animation-play-state: paused; }
.partners__marquee .partner {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 140px;
  height: 60px;
  opacity: 0.85;
  transition: opacity .2s;
}
.partners__marquee .partner:hover { opacity: 1; }
.partners__marquee .partner img { filter: grayscale(0.2); transition: filter .2s; }
.partners__marquee .partner:hover img { filter: grayscale(0); }
@keyframes partnersMarquee {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

/* ============================================================
   IMAGE LIGHTBOX — internal, real-image viewer
   ============================================================ */
.lightbox-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.94);
  backdrop-filter: blur(8px);
  padding: 48px 64px;
  font-family: "Barlow Condensed", sans-serif;
  animation: lbFade .18s ease-out;
}
.lightbox-overlay.is-open { display: flex; }
@keyframes lbFade { from { opacity: 0; } to { opacity: 1; } }
html.lb-locked { overflow: hidden; }

.lightbox-overlay .lb-stage {
  position: relative;
  max-width: min(1400px, 100%);
  max-height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}
.lightbox-overlay .lb-img {
  display: block;
  max-width: 100%;
  max-height: calc(100vh - 160px);
  object-fit: contain;
  background: #0a0a0a;
  box-shadow: 0 30px 60px rgba(0,0,0,0.6);
  border-radius: 4px;
  animation: lbImgIn .22s ease-out;
}
@keyframes lbImgIn { from { transform: scale(.96); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.lightbox-overlay .lb-error {
  color: #ffb3a4;
  text-align: center;
  max-width: 80vw;
  padding: 24px;
  border: 1px dashed rgba(var(--site-primary-rgb,255,99,71),.5);
  border-radius: 6px;
}
.lightbox-overlay .lb-error code {
  display: inline-block;
  margin-top: 8px;
  color: #f5f5f5;
  background: rgba(255,255,255,.06);
  padding: 4px 10px;
  border-radius: 4px;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 12px;
  word-break: break-all;
}
.lightbox-overlay .lb-close,
.lightbox-overlay .lb-prev,
.lightbox-overlay .lb-next {
  position: absolute;
  background: rgba(0,0,0,0.55);
  border: 1px solid rgba(255,255,255,0.18);
  color: #fff;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .15s, border-color .15s, transform .12s;
}
.lightbox-overlay .lb-close { top: 20px; right: 22px; font-size: 28px; }
.lightbox-overlay .lb-prev  { top: 50%; left: 22px; transform: translateY(-50%); }
.lightbox-overlay .lb-next  { top: 50%; right: 22px; transform: translateY(-50%); }
.lightbox-overlay .lb-close:hover,
.lightbox-overlay .lb-prev:hover,
.lightbox-overlay .lb-next:hover { background: var(--color-orange, #FF6347); border-color: var(--color-orange, #FF6347); }
.lightbox-overlay .lb-prev:hover { transform: translateY(-50%) translateX(-2px); }
.lightbox-overlay .lb-next:hover { transform: translateY(-50%) translateX(2px); }
.lightbox-overlay .lb-caption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 22px;
  text-align: center;
  color: #f5f5f5;
  font-size: 14px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-weight: 600;
  padding: 0 80px;
  pointer-events: none;
}
.lightbox-overlay .lb-count {
  position: absolute;
  top: 26px;
  left: 24px;
  color: rgba(255,255,255,0.7);
  font-size: 13px;
  letter-spacing: 0.06em;
  font-family: "JetBrains Mono", monospace;
}
@media (max-width: 640px) {
  .lightbox-overlay { padding: 60px 12px 80px; }
  .lightbox-overlay .lb-prev { left: 10px; }
  .lightbox-overlay .lb-next { right: 10px; }
  .lightbox-overlay .lb-caption { padding: 0 16px; font-size: 12px; }
}
/* Visual cursor on triggers */
[data-lightbox], [data-full] { cursor: zoom-in; }

/* ============================================================
   SOFT-EDGE IMAGE TREATMENT — applied to hero/large images
   to avoid sharp rectangular crop seams
   ============================================================ */
.image-soft-edge,
.hero-image-soft,
.home-cta__workshop,
.founder-teaser__photo,
.founder-teaser__media,
.hero-bg {
  position: relative;
  -webkit-mask-image: radial-gradient(ellipse 95% 92% at 50% 50%, #000 60%, rgba(0,0,0,0.45) 88%, transparent 100%);
          mask-image: radial-gradient(ellipse 95% 92% at 50% 50%, #000 60%, rgba(0,0,0,0.45) 88%, transparent 100%);
}
/* NOTE — .inner-hero__visual, .bio-hero__visual, .page-hero-media, .hero__media
   are deliberately excluded from the soft-edge mask above. They are owned by
   the Global Page Hero System in public.css, which handles fade via gradient
   overlays on the parent. A mask-image here would force position:relative and
   strip the multi-stop fade. */
/* Fallback for browsers without mask: vignette overlay */
@supports not ((mask-image: linear-gradient(#000, #000)) or (-webkit-mask-image: linear-gradient(#000, #000))) {
  .image-soft-edge::after,
  .hero-image-soft::after,
  .home-cta__workshop::after,
  .founder-teaser__photo::after,
  .founder-teaser__media::after {
    content: '';
    position: absolute;
    inset: 0;
    background:
      radial-gradient(ellipse at center, transparent 55%, rgba(9,11,12,0.7) 92%, rgba(9,11,12,1) 100%);
    pointer-events: none;
  }
}

/* ============================================================
   FOUNDER (home) — bỏ khung ảnh + tăng kích thước
   ============================================================ */
.founder-teaser__photo,
.founder-teaser__media,
.founder__photo,
.founder__media {
  border: none !important;
  outline: none !important;
  box-shadow: none !important;
  background-color: transparent !important;
  /* Increase ~20% */
  transform: scale(1.18);
  transform-origin: center center;
  filter: drop-shadow(0 14px 30px rgba(0,0,0,0.55));
}
.founder-teaser,
.founder-teaser__inner,
.founder {
  overflow: visible;
}
/* Apply soft fade so ảnh hòa vào nền */
.founder-teaser__photo img,
.founder-teaser__media img,
.founder__photo img,
.founder__media img {
  -webkit-mask-image: radial-gradient(ellipse 96% 92% at 50% 52%, #000 58%, rgba(0,0,0,0.4) 88%, transparent 100%);
          mask-image: radial-gradient(ellipse 96% 92% at 50% 52%, #000 58%, rgba(0,0,0,0.4) 88%, transparent 100%);
}
@media (max-width: 820px) {
  .founder-teaser__photo,
  .founder-teaser__media,
  .founder__photo,
  .founder__media { transform: scale(1.08); }
}

/* ============================================================
   BIOGRAPHY — bỏ đường viền dọc giữa text và ảnh
   ============================================================ */
.bio-hero,
.bio-hero__grid,
.bio-hero__inner,
.bio-hero__copy,
.bio-hero__visual {
  border-left: 0 !important;
  border-right: 0 !important;
}
.bio-hero__grid::before,
.bio-hero__grid::after,
.bio-hero__inner::before,
.bio-hero__inner::after {
  display: none !important;
}
.bio-hero__copy {
  background-image: none !important;
}

/* ============================================================
   FOOTER (home-cta) — ảnh workshop to + soft edge + mockup parity
   ============================================================ */
.home-cta__workshop {
  min-height: 220px;
  border-radius: 8px;
  background-size: cover !important;
  background-position: center;
  /* soft edge */
  -webkit-mask-image: radial-gradient(ellipse 96% 92% at 50% 50%, #000 60%, rgba(0,0,0,0.45) 88%, transparent 100%);
          mask-image: radial-gradient(ellipse 96% 92% at 50% 50%, #000 60%, rgba(0,0,0,0.45) 88%, transparent 100%);
}
@media (min-width: 1100px) {
  .home-cta__workshop { min-height: 320px; }
}
.home-cta__glyph img {
  max-width: 100%;
  height: auto;
  width: 220px;
  opacity: 0.92;
}
.home-cta__socials .ico svg { color: var(--color-orange); }
.home-cta__socials .label {
  font-family: "Barlow Condensed", sans-serif !important;
  text-transform: uppercase;
}
.home-cta__socials .val { font-family: "Barlow Condensed", sans-serif; }

/* ============================================================
   FOOTER CTA — title 2-color + workshop image 4-sided fade
   ============================================================ */
.home-cta__title {
  font-family: "Barlow Condensed", sans-serif !important;
  font-weight: 900 !important;
  font-size: clamp(28px, 3.2vw, 44px) !important;
  line-height: 1.05 !important;
  letter-spacing: 0.01em !important;
  margin: 0 0 18px !important;
  text-transform: uppercase;
}
.home-cta__title .home-cta__title-line {
  display: block;
  color: var(--color-text, #f5f5f5);
}
.home-cta__title .home-cta__title-accent {
  display: block;
  color: var(--color-orange, #FF6347);
  margin-top: 4px;
}
.home-cta__desc {
  font-family: "Barlow Condensed", sans-serif !important;
  font-size: 15px;
  color: var(--color-text-dim, #b5b5b5);
  max-width: 360px;
  line-height: 1.6;
  margin: 0 0 22px;
}

/* Workshop image: 4-sided fade — combined mask + overlay */
.home-cta__workshop {
  /* Force a solid box first */
  position: relative !important;
  min-height: 240px;
  /* mask: linear gradient on both axes via WebKit composite */
  -webkit-mask-image:
    linear-gradient(to right, transparent 0%, #000 10%, #000 90%, transparent 100%),
    linear-gradient(to bottom, transparent 0%, #000 10%, #000 90%, transparent 100%) !important;
  -webkit-mask-composite: source-in;
          mask-image:
    linear-gradient(to right, transparent 0%, #000 10%, #000 90%, transparent 100%),
    linear-gradient(to bottom, transparent 0%, #000 10%, #000 90%, transparent 100%) !important;
          mask-composite: intersect;
}
@media (min-width: 1100px) { .home-cta__workshop { min-height: 360px; } }
@media (max-width: 820px)  { .home-cta__workshop { min-height: 220px; } }

/* Fallback: pseudo overlay vignette (visible when mask isn't composited) */
.home-cta__workshop::before,
.home-cta__workshop::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.home-cta__workshop::before {
  background:
    linear-gradient(to right, var(--color-bg, #090b0c) 0%, transparent 14%, transparent 86%, var(--color-bg, #090b0c) 100%);
}
.home-cta__workshop::after {
  background:
    linear-gradient(to bottom, var(--color-bg, #090b0c) 0%, transparent 14%, transparent 86%, var(--color-bg, #090b0c) 100%);
}

/* ============================================================
   PAGE HERO — fade is now handled by the Global Page Hero System
   in public.css (.inner-hero / .page-hero with multi-stop overlay
   on the parent + absolute-positioned image layer).
   The legacy mask-image and pseudo-element rules that used to live
   here have been removed because they forced .inner-hero__visual to
   position:relative, which broke the new layered system.
   ============================================================ */
.hero-image-soft {
  -webkit-mask-image: linear-gradient(to right, transparent 0%, #000 12%, #000 88%, transparent 100%);
          mask-image: linear-gradient(to right, transparent 0%, #000 12%, #000 88%, transparent 100%);
}

/* ============================================================
   CONTACT MAP — premium large card (500-650px)
   ============================================================ */
.contact-map.contact-map--premium { padding: 24px 0 48px; }

.contact-map-card.contact-map-card--premium {
  background: var(--color-panel, #111416);
  border: 1px solid var(--color-border-orange, rgba(var(--site-primary-rgb,255,99,71),0.45));
  border-radius: 14px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 520px;
  box-shadow: 0 30px 60px rgba(0,0,0,0.55), 0 0 0 1px rgba(var(--site-primary-rgb,255,99,71),0.08) inset;
  position: relative;
}
@media (min-width: 1200px) { .contact-map-card.contact-map-card--premium { min-height: 600px; } }
@media (min-width: 1600px) { .contact-map-card.contact-map-card--premium { min-height: 650px; } }
@media (max-width: 700px)  { .contact-map-card.contact-map-card--premium { min-height: 360px; } }

.contact-map-card.contact-map-card--premium .contact-map-card__embed {
  position: relative;
  flex: 1;
  min-height: 380px;
  background: #0a0c0e;
}
@media (min-width: 1200px) { .contact-map-card.contact-map-card--premium .contact-map-card__embed { min-height: 460px; } }
@media (min-width: 1600px) { .contact-map-card.contact-map-card--premium .contact-map-card__embed { min-height: 520px; } }

.contact-map-card.contact-map-card--premium .contact-map-card__embed iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  filter: grayscale(0.35) contrast(1.08) brightness(0.85);
}
.contact-map-card__overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 50% 50%, transparent 35%, rgba(9,11,12,0.45) 100%),
    linear-gradient(180deg, rgba(9,11,12,0.18) 0%, transparent 30%, transparent 70%, rgba(9,11,12,0.32) 100%);
}
.contact-map-card__pin {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -100%);
  pointer-events: none;
  z-index: 2;
  filter: drop-shadow(0 8px 18px rgba(0,0,0,0.55));
  animation: mcPinBob 2.4s ease-in-out infinite;
}
@keyframes mcPinBob {
  0%, 100% { transform: translate(-50%, -100%); }
  50%      { transform: translate(-50%, -110%); }
}
.contact-map-card.contact-map-card--premium .contact-map-card__info {
  background: linear-gradient(180deg, rgba(var(--site-primary-rgb,255,99,71),0.04) 0%, rgba(9,11,12,0.92) 100%);
  border-top: 1px solid rgba(var(--site-primary-rgb,255,99,71),0.25);
  backdrop-filter: blur(10px);
}

/* ============================================================
   CONTACT MAP — legacy non-premium card
   ============================================================ */
.contact-map-card {
  background: var(--color-panel, #111416);
  border: 1px solid var(--color-border, rgba(255,255,255,0.12));
  border-radius: 10px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 360px;
}
.contact-map-card__embed {
  position: relative;
  width: 100%;
  flex: 1;
  min-height: 280px;
  background: #0a0c0e;
  border: 0;
}
.contact-map-card__embed iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  filter: grayscale(0.18) contrast(1.05);
}
.contact-map-card__info {
  padding: 18px 20px;
  border-top: 1px solid var(--color-border, rgba(255,255,255,0.12));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.contact-map-card__info-text {
  font-family: "Barlow Condensed", sans-serif;
  color: var(--color-text, #f5f5f5);
  line-height: 1.45;
}
.contact-map-card__info-text strong {
  display: block;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 4px;
  color: var(--color-orange, #FF6347);
}
.contact-map-card__info-text small {
  display: block;
  color: var(--color-text-dim, #b5b5b5);
  font-size: 13px;
}
.contact-map-card__cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 16px;
  border: 1px solid var(--color-orange, #FF6347);
  color: var(--color-orange, #FF6347);
  background: rgba(var(--site-primary-rgb,255,99,71),0.08);
  border-radius: 4px;
  text-decoration: none;
  font-family: "Barlow Condensed", sans-serif;
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
  transition: background .15s, color .15s;
}
.contact-map-card__cta:hover {
  background: var(--color-orange, #FF6347);
  color: #fff;
}
@media (max-width: 600px) {
  .contact-map-card__info { flex-direction: column; align-items: flex-start; }
  .contact-map-card__cta { width: 100%; justify-content: center; }
}

/* ============================================================
   BLOG RELATED — responsive grid (cards only, NOT the wrapping <section>)
   ----
   BUG-FIX 2026-06-23: The previous version included `.related,
   .related-posts, .blog-related` (which are the wrapping <section>
   classes) in the `display: grid` rule. That turned the entire
   <section> into a 5-column grid, collapsing the inner
   `.container-wide` down to ~258 px and crushing each card to ~24 px
   wide — so card titles wrapped one CHARACTER per line. The grid must
   only apply to `.related-grid` (the actual cards wrapper).
   ============================================================ */
.related-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 18px;
  margin-top: 18px;
}
/* Use auto-fit + minmax for the few-cards case so cards never get squashed */
.related-grid[data-related-count="1"],
.related-grid[data-related-count="2"],
.related-grid[data-related-count="3"],
.related-grid[data-related-count="4"] {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}
@media (max-width: 1100px) { .related-grid { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); } }
@media (max-width: 700px)  { .related-grid { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); } }
@media (max-width: 480px)  { .related-grid { grid-template-columns: 1fr; } }

/* ============================================================
   BLOG RELATED — card content overrides
   ----
   `.fp-card__title` in public.css ships with letter-spacing:0.16em +
   text-transform:uppercase + a flex `space-between` body that gives the
   year column equal weight. On narrow related cards (~220 px) a long
   Vietnamese title overflows and wraps one CHARACTER per line. Inside
   the related grid we relax the typography and switch the body to a
   block layout so the title takes the full width and the year sits
   below as small metadata.
   ============================================================ */
.related-grid .fp-card { display: flex; flex-direction: column; }
.related-grid .fp-card__media {
  aspect-ratio: 4 / 3;
  width: 100%;
  background-size: cover;
  background-position: center;
}
.related-grid .fp-card__body {
  display: block;
  padding: 12px 14px 14px;
}
.related-grid .fp-card__title {
  font: 600 14px/1.35 var(--font-heading);
  letter-spacing: 0.02em;
  text-transform: none;
  color: var(--color-text);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-break: normal;
  overflow-wrap: anywhere;
  margin: 0 0 6px;
}
.related-grid .fp-card__year {
  font: 500 12px/1 var(--font-mono, "JetBrains Mono", monospace);
  letter-spacing: 0.06em;
  color: var(--color-text-mute);
  display: block;
}

/* Keep typography-resize.css from re-inflating titles inside related grid
   (the file forces .fp-card__title to 16px, which becomes too large in
   the small related cards once we've removed uppercase tracking). */
html .related-grid .fp-card__title,
html[lang="vi"] .related-grid .fp-card__title { font-size: 14px !important; line-height: 1.35 !important; }
html .related-grid .fp-card__year,
html[lang="vi"] .related-grid .fp-card__year { font-size: 12px !important; }

/* Section padding (was hidden by previous display:grid bug) */
section.related,
section.related-posts,
section.blog-related {
  display: block !important;
  padding: 48px 0 60px;
}

/* ============================================================
   BLOG DETAIL — HERO VISUAL COVER OVERRIDE
   ----
   `.inner-hero__visual` ships with a static SVG background
   (`hero-projects.svg` — the orange-line / RTX 4090 placeholder) and
   ALSO hides any `.ph` descendant via `display: none`. That made the
   per-post cover image impossible to display through a child element.
   We now write the cover image straight onto the `.inner-hero__visual`
   element as an inline `background-image` (inline wins over external
   CSS for the same property). The class below tunes the framing.
   When there is no cover image, no `.has-cover` class is applied and
   the original placeholder SVG stays in place — fallback behaviour.
   ============================================================ */
.inner-hero__visual.blog-detail__hero-visual.has-cover {
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}
/* Subtle vignette so dark UI elements stay legible on bright covers
   (keeps the same mood as the original placeholder) */
.inner-hero__visual.blog-detail__hero-visual.has-cover::after {
  background: linear-gradient(
    90deg,
    rgba(9, 11, 12, 0.55) 0%,
    rgba(9, 11, 12, 0.10) 28%,
    rgba(9, 11, 12, 0.00) 50%,
    rgba(9, 11, 12, 0.10) 72%,
    rgba(9, 11, 12, 0.55) 100%
  );
}
/* Mobile (< 820 px) the hero stacks copy on top of visual — force a
   sensible aspect ratio so the cover image still has room to breathe */
@media (max-width: 820px) {
  .inner-hero__visual.blog-detail__hero-visual.has-cover {
    aspect-ratio: 16 / 10;
    min-height: 220px;
  }
}

/* ============================================================
   PROJECT DETAIL — HERO VISUAL COVER OVERRIDE
   Same pattern as blog detail. Project detail page also stuffs the
   per-project cover via inline background-image on .inner-hero__visual
   to defeat public.css's hard-coded placeholder SVG. Fallback (no
   cover_image) leaves the placeholder intact.
   ============================================================ */
.inner-hero__visual.project-detail__hero-visual.has-cover {
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}
.inner-hero__visual.project-detail__hero-visual.has-cover::after {
  background: linear-gradient(
    90deg,
    rgba(9, 11, 12, 0.55) 0%,
    rgba(9, 11, 12, 0.10) 28%,
    rgba(9, 11, 12, 0.00) 50%,
    rgba(9, 11, 12, 0.10) 72%,
    rgba(9, 11, 12, 0.55) 100%
  );
}
@media (max-width: 820px) {
  .inner-hero__visual.project-detail__hero-visual.has-cover {
    aspect-ratio: 16 / 10;
    min-height: 220px;
  }
}

/* Project detail also gets the related-section defensive block rule */
section.related-projects {
  display: block !important;
  padding: 48px 0 60px;
}

/* ============================================================
   HOME UI FINAL POLISH (2026-06-23)
   ----
   1. Header logo bigger (40 → 64 px desktop, scaled down on mobile).
   2. Timeline section gets its own workshop background + softer overlay
      so the years/labels read clearly against an image.
   3. Footer socials: hide the redundant uppercase i18n label
      (".label") and only show the CMS-supplied display text (".val"),
      so each item reads as: <icon> YouTube  instead of
      <icon> YOUTUBE  YouTube.
   ============================================================ */

/* ---- 1. Header logo size ---- */
.site-header .brand .brand__logo-img {
  height: 64px;
  max-height: 64px;
  width: auto;
  display: block;
}
/* Logo SVG riêng cho mobile — DESKTOP ẨN (chỉ bật ở ≤820px). */
.site-header .brand__logo-svg { display: none; }

/* ---- 2. Timeline workshop background ---- */
/* The wrapping .founder-teaser already has a workshop-bg + dark gradient,
   but its overlay (~85 %) is so opaque that the photo doesn't read as
   "showroom backdrop" behind the years. Layer a dedicated, lighter
   gradient on top of .timeline itself so the bg shows through under
   the timeline years/labels — without making the founder copy on the
   left side unreadable. */
.founder-teaser .timeline {
  position: relative;
  padding: 28px 24px 32px;
  background-color: rgba(9, 11, 12, 0.45);
  background-image:
    linear-gradient(180deg, rgba(9, 11, 12, 0.35) 0%, rgba(9, 11, 12, 0.55) 100%),
    url('../images/workshop/workshop-background.svg');
  background-size: cover;
  background-position: center;
  background-blend-mode: normal;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.02);
}
.founder-teaser .timeline__row { position: relative; z-index: 1; }
.founder-teaser .timeline__year { text-shadow: 0 1px 2px rgba(0,0,0,0.55); }
.founder-teaser .timeline__label { text-shadow: 0 1px 2px rgba(0,0,0,0.55); }

/* ---- 3. Footer socials — hide the redundant i18n label ---- */
.home-cta__socials .label {
  /* Visually hide but keep accessible for screen readers */
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}
.home-cta__socials .home-cta__social-link {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  color: inherit;
}
.home-cta__socials .val {
  font-size: 13.5px;
  font-weight: 500;
  color: var(--color-text);
  line-height: 1.35;
}
.home-cta__socials .home-cta__social-link:hover .val { color: var(--color-orange); }

/* ============================================================
   VIDEOS PAGE — thumbnail <img> + modal alert (2026-06-23)
   ----
   1. Replace the `<div class="ph" style="background-image:...">`
      pattern (which the original .video-card__media CSS never sized
      to inset:0 → cards rendered as black aspect-ratio boxes) with
      a regular <img class="video-thumb-img">. Object-fit cover keeps
      the 16:9 frame without distortion.
   2. Modal alert bar: orange brand color, sits ABOVE the iframe, with
      a "Watch now" button on the right that opens YouTube in a new tab.
   ============================================================ */

/* ---- 1. Video thumbnail image ---- */
.video-card__media,
.featured-video__media {
  position: relative;
  overflow: hidden;
  background: #0a0c0e;
}
.video-card__media .video-thumb-img,
.featured-video__media .video-thumb-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
  z-index: 1;
  transition: transform .35s ease;
}
.video-card:hover .video-thumb-img,
.featured-video:hover .video-thumb-img { transform: scale(1.03); }
/* Stack play button / badges above the image */
.video-card__media > *:not(.video-thumb-img),
.featured-video__media > *:not(.video-thumb-img) { position: relative; z-index: 2; }
/* Center the small play icon overlay since the image fills the box */
.video-card__media .play-btn { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); z-index: 2; }
.featured-video__media .play-btn-lg { z-index: 4; }

/* ============================================================
   VIDEOS PAGE — Featured-card info-below + Category-panel thumbs
   (2026-06-25, rev2) Layout:
   - Featured info (tag → title → meta → hashtag) sits in a clean
     block BELOW the thumbnail — nothing overlays the image, so no
     face / product / subject is ever covered.
   - .featured-video is a flex column: head + body are fixed, the
     media flexes to fill the remaining height, so the left card
     equals the right category panel height (grid stretch) with no
     dead space under the thumbnail.
   - Each category item shows the newest video's thumbnail as a
     DIMMED texture background (strong dark overlay) so the label +
     count stay the visual focus.
   ============================================================ */

/* ---- Featured card: flex column, media flexes to fill height ---- */
.featured-video {
  display: flex;
  flex-direction: column;
}
.featured-video__head { flex: 0 0 auto; }
.featured-video__media {
  aspect-ratio: auto;          /* drop the fixed 16/9 so it can flex */
  flex: 1 1 auto;
  min-height: 340px;
}

/* ---- Info block BELOW the thumbnail (tag → title → meta → hashtag) ---- */
.featured-video__body {
  flex: 0 0 auto;
  padding: 16px 22px 20px;
  border-top: 1px solid var(--color-border);
  background: var(--color-panel);
}
.featured-video__body .featured-video__sub {
  margin: 0 0 7px;
  font: 600 11px/1 var(--font-heading);
  letter-spacing: 0.22em;
  color: var(--color-orange);
  text-transform: uppercase;
}
.featured-video__body .featured-video__title {
  margin: 0;
  color: var(--color-text, #fff);
  font: 700 21px/1.2 var(--font-heading);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.featured-video__body .featured-video__meta {
  margin-top: 12px;
  display: flex; align-items: center; gap: 10px;
  flex-wrap: wrap;
  color: var(--color-orange);   /* channel + view-count shown in orange */
  font-size: 12px;
}
/* Eye icon + "Modding Cafe TV" + "N video" stay on ONE line (icon never wraps off) */
.featured-video__body .featured-video__meta > span {
  display: inline-flex; align-items: center; gap: 6px;
  white-space: nowrap;
}
.featured-video__body .featured-video__meta svg { flex: none; }
.featured-video__body .featured-video__meta .dot { opacity: 0.7; }
.featured-video__body .featured-video__meta .tags { display: flex; gap: 6px; margin-left: auto; }
/* hashtag chip keeps its muted look, not the orange meta color */
.featured-video__body .featured-video__meta .chip-mute { color: var(--color-text-dim); }

/* ---- Category panel: thumbnail as DIMMED texture, label stays focus ---- */
.playlist__item {
  position: relative;
  display: grid;
  grid-template-columns: 40px 1fr auto;
  gap: 14px;
  align-items: center;
  padding: 13px 14px;
  margin-bottom: 10px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xs);
  overflow: hidden;
  background-color: #0d0f12;
  background-size: cover;
  background-position: center;
  text-decoration: none;
  transition: var(--t);
}
/* Stronger, darker scrim → thumbnail reads as subtle texture only */
.playlist__item::before {
  content: "";
  position: absolute; inset: 0; z-index: 0;
  background: linear-gradient(90deg,
    rgba(6,7,9,0.97) 0%,
    rgba(6,7,9,0.92) 50%,
    rgba(6,7,9,0.82) 100%);
  transition: var(--t);
}
.playlist__item:hover { border-color: var(--color-border-orange); }
.playlist__item:hover::before {
  background: linear-gradient(90deg,
    rgba(6,7,9,0.95) 0%,
    rgba(6,7,9,0.86) 50%,
    rgba(6,7,9,0.70) 100%);
}
.playlist__item > * { position: relative; z-index: 1; }
.playlist__item:last-child { margin-bottom: 0; }
.playlist__icon {
  width: 40px; height: 40px;
  display: inline-flex; align-items: center; justify-content: center;
}
.playlist__icon .play-btn { width: 40px; height: 40px; }
.playlist__icon .play-btn::after {
  border-left-width: 9px; border-top-width: 6px; border-bottom-width: 6px;
}
.playlist__item .playlist__title {
  color: #fff;
  text-shadow: 0 1px 6px rgba(0,0,0,0.65);
}
.playlist__item .playlist__count { color: rgba(255,255,255,0.82); }
.playlist__item .playlist__num {
  color: var(--color-orange);
  text-shadow: 0 1px 8px rgba(0,0,0,0.7);
}

/* ---- Responsive ---- */
@media (max-width: 1100px) {
  .featured-video__media { min-height: 300px; }
}
@media (max-width: 560px) {
  .featured-video__media { min-height: 210px; }
  .featured-video__body { padding: 14px 16px 16px; }
  .featured-video__body .featured-video__title { font-size: 17px; letter-spacing: 0.03em; }
  .featured-video__body .featured-video__meta { gap: 8px; margin-top: 9px; }
  .featured-video__body .featured-video__meta .tags { margin-left: 0; flex-basis: 100%; }
}

/* ---- 2. Modal alert bar + "Watch now" button ---- */
.mc-video-modal__alert {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: var(--color-orange,#FF6347);
  color: #0a0c0e;
  font-family: var(--font-body, "Barlow Condensed", sans-serif);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.3;
  position: relative;
  z-index: 1;
}
.mc-video-modal__alert-ico {
  flex-shrink: 0;
  color: #0a0c0e;
}
.mc-video-modal__alert-text {
  flex: 1;
  min-width: 0;
  letter-spacing: 0.02em;
  text-transform: none;
  color: #0a0c0e;
}
.mc-video-modal__watch-now {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 18px;
  background: #0a0c0e;
  color: var(--color-orange,#FF6347);
  text-decoration: none;
  border-radius: 4px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-size: 13px;
  transition: background .15s ease, color .15s ease;
}
.mc-video-modal__watch-now:hover {
  background: #ffffff;
  color: #0a0c0e;
}
.mc-video-modal__watch-now svg { fill: currentColor; }

/* Mobile: stack alert content into two rows */
@media (max-width: 600px) {
  .mc-video-modal__alert {
    flex-wrap: wrap;
    padding: 10px 12px;
    gap: 8px;
  }
  .mc-video-modal__alert-text {
    flex-basis: calc(100% - 30px);
    font-size: 13px;
  }
  .mc-video-modal__watch-now {
    margin-left: auto;
    font-size: 12px;
    padding: 7px 14px;
  }
}


/* ============================================================
   GALLERY PAGE — tools row + pagination + random button (2026-06-23)
   ============================================================ */

/* ---- Tools row (cats + random) ---- */
.gallery-tools {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  padding: 14px 0;
}
.gallery-tools .gallery-cats { flex: 1 1 auto; min-width: 0; }
.gallery-tools .gallery-random-btn {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  background: var(--color-orange, #FF6347);
  color: #0a0c0e;
  text-decoration: none;
  border: 1px solid var(--color-orange, #FF6347);
  border-radius: 4px;
  font-family: var(--font-heading, "Smooch Sans", sans-serif);
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  transition: background .15s ease, color .15s ease, border-color .15s ease, transform .15s ease;
}
.gallery-tools .gallery-random-btn:hover {
  background: transparent;
  color: var(--color-orange, #FF6347);
  transform: translateY(-1px);
}
.gallery-tools .gallery-random-btn.is-active {
  background: #0a0c0e;
  color: var(--color-orange, #FF6347);
}
.gallery-tools .gallery-random-btn svg { fill: currentColor; }
.cat-count { font-size: 11px; opacity: 0.65; font-weight: 500; }

@media (max-width: 700px) {
  .gallery-tools { flex-direction: column; align-items: stretch; gap: 12px; }
  .gallery-tools .gallery-random-btn { align-self: stretch; justify-content: center; }
}

/* ---- Pagination (rewritten — supports <a> + <span>) ---- */
.pagination--gallery {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin: 40px 0 8px;
  flex-wrap: wrap;
}
.pagination--gallery .pg {
  min-width: 38px;
  height: 38px;
  padding: 0 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 4px;
  color: #cccccc;
  font-family: var(--font-heading, "Smooch Sans", sans-serif);
  font-weight: 600;
  font-size: 14px;
  letter-spacing: 0.04em;
  text-decoration: none;
  transition: background .15s ease, color .15s ease, border-color .15s ease;
  user-select: none;
}
.pagination--gallery .pg:hover {
  border-color: var(--color-orange, #FF6347);
  color: var(--color-orange, #FF6347);
}
.pagination--gallery .pg.is-active {
  background: var(--color-orange, #FF6347);
  border-color: var(--color-orange, #FF6347);
  color: #0a0c0e;
  cursor: default;
  font-weight: 700;
}
.pagination--gallery .pg.is-active:hover {
  background: var(--color-orange, #FF6347);
  color: #0a0c0e;
}
.pagination--gallery .pg-gap {
  border: 0;
  color: rgba(255, 255, 255, 0.4);
  letter-spacing: 0.2em;
  min-width: 24px;
  padding: 0 4px;
}
.pagination--gallery .pg-nav { width: 40px; padding: 0; }
.pagination--gallery .pg-nav svg { fill: currentColor; }
.pagination--gallery .pg.is-disabled {
  opacity: 0.35;
  pointer-events: none;
  border-color: rgba(255, 255, 255, 0.08);
}

.pagination__summary {
  text-align: center;
  color: var(--color-text-mute, #8a8a8a);
  font-family: var(--font-body, "Barlow Condensed", sans-serif);
  font-size: 14px;
  margin: 8px 0 40px;
  letter-spacing: 0.02em;
}
.pagination__summary strong { color: var(--color-orange, #FF6347); font-weight: 700; }

@media (max-width: 600px) {
  .pagination--gallery .pg { min-width: 34px; height: 34px; font-size: 13px; padding: 0 8px; }
  .pagination--gallery .pg-nav { width: 36px; }
  .pagination__summary { font-size: 13px; }
}

/* ============================================================
   HOME + HEADER + SEARCH FINAL POLISH (2026-06-23)
   ============================================================ */

/* ---- 1. Bio image bottom-pinned with <img> object-position ---- */
.founder-teaser__photo--bottom {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  overflow: hidden;
  /* override the SVG background that would otherwise show through transparent PNG corners */
  background-image: none !important;
}
.founder-teaser__photo--bottom .founder-teaser__photo-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center bottom;
  display: block;
}

/* ---- 3. Footer socials: icon + val on same row ---- */
.home-cta__socials {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.home-cta__socials li {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0;
  padding: 0;
}
.home-cta__socials .home-cta__social-link {
  display: inline-flex;
  align-items: center;
  gap: 0;
  text-decoration: none;
  color: inherit;
  flex: 1;
  min-width: 0;
}
.home-cta__socials .ico {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--color-orange);
}
.home-cta__socials .val {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ---- 4. Mobile menu drawer ----
   FIX (Phase 4): .site-header có backdrop-filter → tạo containing block
   cho fixed descendants → drawer bị khoá trong stacking context của header
   (z=50) và bị body::after backdrop (z=9997) đè lên → user thấy menu "mờ".
   Khi mở menu, gỡ backdrop-filter của header và dùng MOBILE-DRAWER SIBLING
   của body do JS inject (.mobile-drawer) thay vì .primary-nav nested.

   HOTFIX (Phase 4.1): drawer phải hidden mặc định ở mọi viewport — chỉ
   bật ở mobile breakpoint. Nếu không, ở desktop drawer hiện full-width
   ở cuối body (vì <aside> default display=block và không có @media match),
   logo cloned từ header phình to chiếm cả màn hình. */
.mobile-drawer,
.mobile-drawer-backdrop { display: none; }

@media (max-width: 820px) {
  /* Khi menu mở, header phải thoát stacking context để drawer hiện đúng */
  body.nav-open .site-header {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    background: rgba(7,10,13,0.92);
    z-index: 10001;            /* trên drawer để hamburger X vẫn click được */
    isolation: auto;
  }

  /* === MOBILE HEADER FIX === logo CĂN GIỮA · hamburger sát PHẢI · ẩn icon search.
     Grid 3 cột cân xứng: [spacer 1fr] [brand auto] [tools 1fr] → brand ở giữa. */
  .site-header__inner {
    grid-template-columns: 1fr auto 1fr;
    gap: 12px;
    padding: 2px 16px;          /* nút menu sát phải 16px */
    height: auto;
    min-height: 108px;          /* header cao hơn để chứa logo lớn (~90–110px) */
  }
  .site-header .header-tools {
    grid-column: 3;
    justify-self: end;
    gap: 0;                    /* chỉ còn hamburger */
  }
  .site-header .header-tools .js-search-toggle { display: none; }  /* ẩn search ngoài header — search nằm trong menu */
  /* MOBILE LOGO = logo-svg.svg (vuông). Cao 80–96px, width auto theo tỷ lệ → không méo/crop.
     Ẩn logo wordmark desktop, hiện logo SVG. Căn giữa chính xác. */
  .site-header .brand { grid-column: 2; justify-self: center; display: flex; align-items: center; justify-content: center; }
  .site-header .brand .brand__logo-img { display: none !important; }   /* ẩn wordmark trên mobile */
  .site-header .brand .brand__logo-svg {
    display: block !important;
    height: 75px !important;                         /* cao 75px theo yêu cầu */
    width: auto !important;                          /* tự động theo tỷ lệ (PNG 75×75 vuông) → không méo/crop */
    max-width: 70vw;
    object-fit: contain;
    image-rendering: auto;
  }
  .site-header .brand__name { font-size: clamp(22px, 7vw, 30px); }
  .site-header .brand__tag { font-size: 9px; }

  /* Drawer panel — sibling của body, không nested trong header */
  .mobile-drawer {
    display: flex;                /* override .mobile-drawer { display:none } default */
    position: fixed;
    inset: 0 0 0 auto;
    top: 0;
    right: 0;
    width: min(86vw, 360px);
    height: 100vh;
    height: 100dvh;
    background: #0a0c0e;
    padding: 120px 22px 28px;   /* chừa chỗ cho header cao ~108px, ô tìm kiếm không bị che */
    z-index: 10000;
    transform: translateX(100%);
    transition: transform .28s cubic-bezier(.2,.7,.3,1);
    box-shadow: -20px 0 40px rgba(0,0,0,0.5);
    border-left: 1px solid var(--color-border);
    overflow-y: auto;
    flex-direction: column;
    gap: 0;
    opacity: 1;
    filter: none;
    backdrop-filter: none;
    pointer-events: auto;
    visibility: visible;
  }
  body.nav-open .mobile-drawer { transform: translateX(0); }

  /* Ẩn logo clone trong drawer (gây "logo nhỏ mờ" trên ô tìm kiếm) — header đã có logo. */
  .mobile-drawer__brand { display: none !important; }

  /* Ô tìm kiếm CHỈ hiện trong menu mobile (theo yêu cầu) */
  .mobile-drawer__search {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 2px 0 14px;
    padding: 0 12px;
    height: 44px;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.10);
    border-radius: 10px;
    transition: border-color .15s, background .15s;
  }
  .mobile-drawer__search:focus-within {
    border-color: var(--color-orange);
    background: rgba(var(--site-primary-rgb,255,99,71),0.06);
  }
  .mobile-drawer__search svg { width: 18px; height: 18px; color: var(--color-text-mute); flex: 0 0 auto; }
  .mobile-drawer__search input {
    flex: 1;
    background: transparent;
    border: 0;
    outline: 0;
    color: var(--color-text);
    font-size: 15px;
    font-family: inherit;
    min-width: 0;
  }
  .mobile-drawer__search input::placeholder { color: var(--color-text-mute); }
  .mobile-drawer__close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 40px;
    height: 40px;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.10);
    border-radius: 50%;
    color: var(--color-text);
    font: 600 20px/1 var(--font-label);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 1;
  }
  .mobile-drawer__close:hover { background: rgba(var(--site-primary-rgb,255,99,71),0.18); color: var(--color-orange); }
  .mobile-drawer__nav {
    display: flex;
    flex-direction: column;
    gap: 0;
  }
  .mobile-drawer__nav a {
    font-size: 18px;
    padding: 14px 4px;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    color: var(--color-text);
    letter-spacing: 0.04em;
    text-transform: uppercase;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
  }
  .mobile-drawer__nav a.is-active { color: var(--color-orange); }
  .mobile-drawer__nav a:hover { color: var(--color-orange); }
  .mobile-drawer__lang {
    margin-top: 24px;
    display: flex;
    gap: 8px;
    align-items: center;
  }
  .mobile-drawer__lang a {
    flex: 1;
    text-align: center;
    padding: 10px 0;
    font: 600 11px/1 var(--font-label);
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--color-text-dim);
    border: 1px solid rgba(255,255,255,0.10);
    border-radius: 4px;
    text-decoration: none;
  }
  .mobile-drawer__lang a.is-active {
    background: var(--color-orange);
    color: #0a0a0a;
    border-color: var(--color-orange);
  }
  .mobile-drawer__socials {
    margin-top: 20px;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
  }
  .mobile-drawer__socials a {
    width: 36px; height: 36px;
    display: inline-flex; align-items: center; justify-content: center;
    color: var(--color-text-dim);
    border: 1px solid rgba(255,255,255,0.10);
    border-radius: 4px;
  }
  .mobile-drawer__socials a:hover { color: var(--color-orange); border-color: var(--color-orange); }

  /* Hide legacy nested .primary-nav drawer rules (kept as fallback target) */
  .site-header .primary-nav {
    display: none !important;
  }

  /* Backdrop — sibling div injected by JS, NOT body::after (which lives
     inside body root stacking and may be obscured by sticky header). */
  .mobile-drawer-backdrop {
    display: block;               /* override default :none from outside the @media */
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.72);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 9998;
    opacity: 0;
    pointer-events: none;
    transition: opacity .22s ease;
    cursor: pointer;
  }
  body.nav-open .mobile-drawer-backdrop {
    opacity: 1;
    pointer-events: auto;
  }
  body.nav-open { overflow: hidden; }

  /* Hamburger to X transition — toggle still visible above drawer */
  .menu-toggle { z-index: 10002; position: relative; }
  body.nav-open .menu-toggle span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  body.nav-open .menu-toggle span:nth-child(2) { opacity: 0; }
  body.nav-open .menu-toggle span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
}

/* ---- 5. Search popup ---- */
.mc-search-modal {
  position: fixed;
  inset: 0;
  z-index: 10001;
  display: none;
  align-items: flex-start;
  justify-content: center;
  background: rgba(0,0,0,0.85);
  backdrop-filter: blur(8px);
  padding: 80px 20px 20px;
}
.mc-search-modal.is-open { display: flex; }
.mc-search-modal__dialog {
  width: min(720px, 100%);
  background: var(--color-panel, #161616);
  border: 1px solid var(--color-border, #2a2a2a);
  border-radius: 8px;
  box-shadow: 0 40px 80px rgba(0,0,0,0.7);
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 100px);
  overflow: hidden;
  animation: mcSearchIn .2s ease-out;
}
@keyframes mcSearchIn { from { transform: translateY(-12px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
.mc-search-modal__head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--color-border, #2a2a2a);
  background: var(--color-bg-2, #0f0f0f);
}
.mc-search-modal__head svg { color: var(--color-orange, #FF6347); flex-shrink: 0; }
.mc-search-modal__input {
  flex: 1;
  background: transparent;
  border: 0;
  outline: 0;
  color: var(--color-text, #f5f5f5);
  font-family: var(--font-body, "Barlow Condensed", sans-serif);
  font-size: 17px;
  padding: 6px 4px;
  letter-spacing: 0.01em;
}
.mc-search-modal__input::placeholder { color: rgba(255,255,255,0.35); }
.mc-search-modal__close {
  background: transparent;
  border: 1px solid rgba(255,255,255,0.15);
  color: rgba(255,255,255,0.7);
  width: 32px;
  height: 32px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 20px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.mc-search-modal__close:hover { color: var(--color-orange); border-color: var(--color-orange); }

.mc-search-modal__body { overflow-y: auto; padding: 14px 18px 22px; flex: 1; }
.mc-search-modal__state {
  padding: 32px 16px;
  text-align: center;
  color: var(--color-text-mute, #8a8a8a);
  font-size: 14px;
}
.mc-search-modal__state strong { color: var(--color-text); }

.mc-search-modal__group { margin: 18px 0 0; }
.mc-search-modal__group-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: var(--font-heading, "Smooch Sans", sans-serif);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--color-orange, #FF6347);
  margin-bottom: 8px;
}
.mc-search-modal__group-count {
  color: var(--color-text-mute);
  font-weight: 500;
  letter-spacing: 0.04em;
}
.mc-search-modal__item {
  display: flex;
  gap: 12px;
  padding: 10px;
  border-radius: 6px;
  text-decoration: none;
  color: inherit;
  align-items: center;
  border: 1px solid transparent;
  transition: background .12s ease, border-color .12s ease;
}
.mc-search-modal__item:hover,
.mc-search-modal__item:focus {
  background: rgba(var(--site-primary-rgb,255,99,71), 0.08);
  border-color: rgba(var(--site-primary-rgb,255,99,71), 0.25);
  outline: none;
}
.mc-search-modal__thumb {
  flex-shrink: 0;
  width: 64px;
  height: 48px;
  background-size: cover;
  background-position: center;
  background-color: var(--color-bg-2, #0f0f0f);
  border-radius: 4px;
  border: 1px solid var(--color-border, #2a2a2a);
}
.mc-search-modal__text { flex: 1; min-width: 0; }
.mc-search-modal__title {
  font-family: var(--font-heading, "Smooch Sans", sans-serif);
  font-weight: 600;
  font-size: 15px;
  line-height: 1.3;
  color: var(--color-text, #f5f5f5);
  margin-bottom: 2px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.mc-search-modal__meta {
  font-size: 11px;
  color: var(--color-orange, #FF6347);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 4px;
}
.mc-search-modal__excerpt {
  font-size: 13px;
  color: var(--color-text-mute, #8a8a8a);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

@media (max-width: 600px) {
  .mc-search-modal { padding: 40px 12px 12px; }
  .mc-search-modal__dialog { max-height: calc(100vh - 60px); }
  .mc-search-modal__input { font-size: 16px; } /* avoid iOS zoom */
  .mc-search-modal__thumb { width: 52px; height: 40px; }
}

/* ============================================================
   FOUNDER + TIMELINE SECTION FINAL FIX (2026-06-23)
   Layout: 3-column desktop (founder photo | bio copy | timeline)
   - Timeline gets its bg-image from inline style (admin upload),
     CSS only adds overlay + text-shadow. The old hard-coded
     workshop-background.svg is no longer applied here.
   - Founder photo column uses align-self:end and the inner <img>
     gets object-position:bottom so the subject is locked to the
     section's bottom edge — no floating gap underneath.
   - On mobile we stack image → bio → timeline (CSS order property).
   ============================================================ */

/* Compact the overall section height — original 72px top/bottom padding
   was too tall for a teaser block; match the mockup proportions. */
.founder-teaser { padding: 48px 0 0; }
.founder-teaser__grid {
  grid-template-columns: 260px minmax(0, 1fr) minmax(0, 1.25fr);
  align-items: stretch;
  gap: 40px;
  padding: 0 40px;
}

/* Founder photo column: stretch full row height + bottom-align <img> */
.founder-teaser__photo,
.founder-teaser__photo--bottom {
  aspect-ratio: auto !important;
  align-self: stretch;
  min-height: 360px;
  border-bottom: 0 !important;
  border-left: 0 !important;
  border-right: 0 !important;
}
.founder-teaser__photo--bottom .founder-teaser__photo-img {
  object-position: center bottom;
  /* Slight overflow downwards is intentional: it visually anchors the
     subject onto the section's bottom border, matching the mockup. */
}

/* Override the previous .timeline workshop background — admin now controls
   it via inline style on the .timeline element. Keep the box treatment. */
.founder-teaser .timeline {
  background-color: rgba(9, 11, 12, 0.45);
  /* The actual background-image is provided via inline style from home.php
     (admin-uploaded image + dark gradient overlay baked in). */
  background-size: cover;
  background-position: center;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  padding: 32px 28px 36px;
  align-self: center;
}

/* Timeline row layout — 5 columns matching mockup */
.founder-teaser .timeline__row {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 18px;
  position: relative;
}
.founder-teaser .timeline__row::after {
  /* Horizontal connecting line through the dots */
  content: "";
  position: absolute;
  left: 8px; right: 8px;
  bottom: -2px;
  height: 1px;
  background: rgba(255,255,255,0.18);
  z-index: 0;
}
.founder-teaser .timeline__item {
  position: relative;
  text-align: left;
  padding-bottom: 22px;
}
.founder-teaser .timeline__year {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: #f5f5f5;
  text-shadow: 0 1px 2px rgba(0,0,0,0.65);
  line-height: 1;
}
.founder-teaser .timeline__item.is-active .timeline__year {
  color: var(--color-orange, #FF6347);
}
.founder-teaser .timeline__label {
  margin-top: 8px;
  font-size: 12px;
  font-family: var(--font-body);
  color: rgba(245,245,245,0.85);
  text-shadow: 0 1px 2px rgba(0,0,0,0.65);
  line-height: 1.4;
  letter-spacing: 0.02em;
}
.founder-teaser .timeline__item::after {
  content: "";
  position: absolute;
  left: 0; bottom: -6px;
  width: 9px; height: 9px;
  border-radius: 50%;
  background: rgba(255,255,255,0.5);
  border: 2px solid rgba(0,0,0,0.4);
  z-index: 1;
}
.founder-teaser .timeline__item.is-active::after {
  background: var(--color-orange, #FF6347);
  box-shadow: 0 0 0 4px rgba(var(--site-primary-rgb,255,99,71), 0.2);
}

/* Tablet & mobile — stack vertically with the requested order:
   1. Founder photo  2. Bio copy  3. Timeline */
@media (max-width: 980px) {
  .founder-teaser { padding: 32px 0 24px; }
  .founder-teaser__grid {
    grid-template-columns: 1fr;
    gap: 24px;
    padding: 0 22px;
  }
  .founder-teaser__photo,
  .founder-teaser__photo--bottom {
    order: 1;
    aspect-ratio: 4/5 !important;
    min-height: 0;
    max-height: 480px;
  }
  /* The "bio" column = second direct child of .founder-teaser__grid
     (the div that contains name, badges, button) — already implicit
     order: 0 from DOM but we promote it above the timeline. */
  .founder-teaser__grid > div:not(.founder-teaser__photo):not(.timeline) { order: 2; }
  .founder-teaser .timeline { order: 3; }
}
@media (max-width: 600px) {
  .founder-teaser .timeline { padding: 22px 18px 24px; }
  .founder-teaser .timeline__row { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
  .founder-teaser .timeline__year { font-size: 16px; }
  .founder-teaser .timeline__label { font-size: 10px; }
}

/* ============================================================
   FINAL POLISH ROUND 2 (2026-06-23)
   1. Mobile menu UI pro
   2. Founder image: no overflow into next section
   3. Timeline: soft vignette, no hard border
   4. Blog featured block image (paired with view changes)
   ============================================================ */

/* ---- 1. Mobile menu — pro panel ---- */
@media (max-width: 820px) {
  /* Panel solid background, no blur on panel itself */
  .site-header .primary-nav {
    background: #0b0d0f !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    border-left: 1px solid rgba(var(--site-primary-rgb,255,99,71), 0.18);
    box-shadow:
      -20px 0 60px rgba(0, 0, 0, 0.7),
      inset 1px 0 0 rgba(255, 255, 255, 0.03);
    padding: 76px 28px 32px !important;
    width: min(82vw, 340px) !important;
  }
  /* Header bar inside panel (logo + close X) — built via ::before pseudo close button */
  .site-header .primary-nav::before {
    content: "";
    position: absolute;
    left: 22px;
    right: 22px;
    top: 56px;
    height: 1px;
    background: rgba(255, 255, 255, 0.06);
  }
  /* Close X button — uses ::after on the nav itself for the symbol */
  .site-header .primary-nav::after {
    content: "×";
    position: absolute;
    top: 16px;
    right: 18px;
    width: 36px;
    height: 36px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.85);
    font-size: 28px;
    line-height: 1;
    font-family: "Barlow Condensed", sans-serif;
    cursor: pointer;
    pointer-events: auto;
    z-index: 3;
    transition: background .15s ease, border-color .15s ease, color .15s ease;
  }
  .site-header .primary-nav:hover::after { color: var(--color-orange); border-color: var(--color-orange); }

  /* Link text: bigger, sharper, no spacing blur */
  .site-header .primary-nav a {
    color: #f5f5f5 !important;
    font-size: 17px !important;
    font-weight: 600 !important;
    letter-spacing: 0.04em !important;
    padding: 16px 6px !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    transition: color .15s ease, background .15s ease, padding-left .15s ease;
    text-decoration: none;
  }
  .site-header .primary-nav a:hover {
    color: var(--color-orange) !important;
    padding-left: 12px !important;
    background: rgba(var(--site-primary-rgb,255,99,71), 0.06);
  }
  .site-header .primary-nav a.is-active {
    color: var(--color-orange) !important;
    font-weight: 700 !important;
  }
  .site-header .primary-nav a.is-active::before {
    content: "";
    position: absolute;
    left: -28px;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 24px;
    background: var(--color-orange);
    border-radius: 0 4px 4px 0;
  }
  .site-header .primary-nav a { position: relative; }

  /* Backdrop softer + clear separation */
  body.nav-open::after {
    background: rgba(0, 0, 0, 0.78) !important;
    backdrop-filter: blur(3px) !important;
  }

  /* Hamburger button — pin right with sensible padding, fix the offset */
  .site-header .header-tools {
    position: relative;
    gap: 10px;
  }
  .site-header .menu-toggle {
    margin-left: 4px;
    position: relative;
    z-index: 9999;
  }
}

/* JS-injected close button (better UX than ::after, captures clicks reliably) */
.primary-nav__close {
  position: absolute;
  top: 16px;
  right: 18px;
  width: 36px;
  height: 36px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 4px;
  display: none;
  align-items: center;
  justify-content: center;
  color: rgba(255, 255, 255, 0.85);
  font-size: 28px;
  line-height: 1;
  font-family: "Barlow Condensed", sans-serif;
  cursor: pointer;
  z-index: 4;
  transition: background .15s ease, border-color .15s ease, color .15s ease;
}
.primary-nav__close:hover { color: var(--color-orange); border-color: var(--color-orange); background: rgba(var(--site-primary-rgb,255,99,71), 0.08); }
@media (max-width: 820px) {
  .primary-nav__close { display: inline-flex; }
  /* Hide CSS ::after now that we have a real button */
  .site-header .primary-nav::after { display: none; }
}

/* ---- 2. Founder image must NOT overflow the section ---- */
.founder-teaser {
  overflow: hidden;
}
.founder-teaser__photo,
.founder-teaser__photo--bottom {
  overflow: hidden;
}
.founder-teaser__photo--bottom .founder-teaser__photo-img {
  max-height: 100%;
  /* Belt + suspenders: cover within the column bounds, never escapes */
  height: 100%;
  width: 100%;
}

/* ---- 3. Timeline soft vignette, no hard border ---- */
.founder-teaser .timeline {
  border: 0 !important;
  border-radius: 10px;
  background-color: transparent;
  box-shadow:
    inset 0 0 60px 8px rgba(0, 0, 0, 0.45),
    0 0 40px rgba(0, 0, 0, 0.35);
  /* Soft edges via mask */
  -webkit-mask-image: radial-gradient(ellipse at center, #000 65%, rgba(0,0,0,0.85) 88%, rgba(0,0,0,0) 100%);
  mask-image: radial-gradient(ellipse at center, #000 65%, rgba(0,0,0,0.85) 88%, rgba(0,0,0,0) 100%);
}
/* Year highlight tweaks */
.founder-teaser .timeline__item.is-active .timeline__year {
  color: var(--color-orange, #FF6347);
  font-weight: 700;
  text-shadow: 0 1px 3px rgba(0,0,0,0.75), 0 0 14px rgba(var(--site-primary-rgb,255,99,71), 0.3);
}
.founder-teaser .timeline__item.is-active::after {
  background: var(--color-orange, #FF6347);
  box-shadow:
    0 0 0 4px rgba(var(--site-primary-rgb,255,99,71), 0.22),
    0 0 12px rgba(var(--site-primary-rgb,255,99,71), 0.5);
  border-color: rgba(var(--site-primary-rgb,255,99,71), 0.6);
}

/* ---- 4. Blog featured block ---- */
/* (Image now comes from page_heroes.featured_image via inline style;
   keep the box but allow a proper <img> swap.) */
.blog-featured__media {
  position: relative;
  overflow: hidden;
}
.blog-featured__media .blog-featured__img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}
