/**
 * Post Scroll Film — scoped under body.koskiniotis-post-film only.
 *
 * Overlay strategy:
 * - Film canvas stays full-bleed and visible.
 * - Atmosphere is a pure black wash; opacity comes from post settings.
 * - Text panels use the SAME overlay value for panel alpha so the slider
 *   clearly changes what you see (not only the thin margins around a brick).
 * - No backdrop-filter on mobile (Safari compositing issues).
 */

body.koskiniotis-post-film {
  --kpf-paper: #f7f2eb;
  --kpf-muted: #cfc6bc;
  --kpf-red: #ed1c24;
  --kpf-black: #0a0a0b;
  --kpf-overlay: 0.18;
  --kpf-overlay-mobile: 0.14;
  --kpf-overlay-active: var(--kpf-overlay, 0.18);
  /* Lower overlay → more film through panels. Floor keeps type readable. */
  --kpf-card-alpha: calc(0.52 + (var(--kpf-overlay-active) * 0.46));
  --kpf-card: rgba(12, 12, 14, var(--kpf-card-alpha));
  --kpf-card-border: rgba(255, 255, 255, 0.1);
  --kpf-hero-desktop: 92svh;
  --kpf-hero-mobile: 56svh;
  --kpf-hero-min: 240px;
  --kpf-hero-max: 900px;
  --kpf-content-width: 100%;
  --kpf-body-size: 1.0625rem;
  background: transparent;
  color: var(--kpf-paper);
  overflow-x: hidden;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body.koskiniotis-post-film #page,
body.koskiniotis-post-film #content,
body.koskiniotis-post-film .site-content {
  background: transparent !important;
  box-shadow: none;
  overflow: visible !important;
}

body.koskiniotis-post-film #masthead {
  z-index: 50;
  position: relative;
}

body.koskiniotis-post-film .header-spacer,
body.koskiniotis-post-film .header-spacer-singular {
  background: transparent !important;
}

body.koskiniotis-post-film .kpf-shell {
  position: relative;
  color: var(--kpf-paper);
  isolation: isolate;
}

body.koskiniotis-post-film .kpf-canvas,
body.koskiniotis-post-film .kpf-atmosphere,
body.koskiniotis-post-film .kpf-grain {
  position: fixed !important;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  height: 100vh;
  max-height: 100svh;
  pointer-events: none;
}

body.koskiniotis-post-film .kpf-canvas {
  z-index: 0;
  background: #121214;
}

/*
 * Pure black layer — strength is ONLY the opacity value from post settings.
 * Inline style on the element wins; CSS var is the fallback.
 */
body.koskiniotis-post-film .kpf-atmosphere {
  z-index: 1;
  background: #000 !important;
  opacity: var(--kpf-overlay, 0.18);
  pointer-events: none;
}

body.koskiniotis-post-film .kpf-grain {
  z-index: 2;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.92' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.6'/%3E%3C/svg%3E");
}

body.koskiniotis-post-film .kpf-film-readout {
  position: fixed;
  z-index: 15;
  left: 5.3vw;
  bottom: 28px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: #b7aaa0;
  font-size: 10px;
  letter-spacing: 0.16em;
  pointer-events: none;
}

body.koskiniotis-post-film .kpf-film-progress {
  position: fixed;
  z-index: 16;
  right: 28px;
  top: 50%;
  height: 112px;
  width: 1px;
  background: rgba(255, 255, 255, 0.2);
  transform: translateY(-50%);
  pointer-events: none;
}

body.koskiniotis-post-film .kpf-film-progress span {
  display: block;
  width: 1px;
  height: 100%;
  background: var(--kpf-red);
  transform: scaleY(0);
  transform-origin: top;
}

body.koskiniotis-post-film .kpf-main {
  position: relative;
  z-index: 3;
  background: transparent;
  width: 100%;
  max-width: 100%;
}

body.koskiniotis-post-film .kpf-hero {
  min-height: clamp(var(--kpf-hero-min), var(--kpf-hero-desktop), var(--kpf-hero-max));
  display: flex;
  align-items: flex-end;
  padding: 110px 7vw 48px;
  box-sizing: border-box;
}

body.koskiniotis-post-film .kpf-align-center .kpf-hero {
  justify-content: center;
  text-align: center;
}

body.koskiniotis-post-film .kpf-align-center .kpf-hero-inner {
  margin-inline: auto;
}

body.koskiniotis-post-film .kpf-align-right .kpf-hero {
  justify-content: flex-end;
  text-align: right;
}

body.koskiniotis-post-film .kpf-hero-inner {
  width: min(680px, 100%);
  padding: 22px 24px;
  background: var(--kpf-card) !important;
  border: 1px solid var(--kpf-card-border);
  border-radius: 8px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.75);
}

body.koskiniotis-post-film .kpf-breadcrumbs,
body.koskiniotis-post-film .kpf-breadcrumbs a {
  color: var(--kpf-muted) !important;
  font-size: 0.8125rem;
}

body.koskiniotis-post-film .kpf-eyebrow {
  font-size: 0.75rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--kpf-muted);
  margin: 0 0 12px;
}

body.koskiniotis-post-film .kpf-title {
  font-size: clamp(1.85rem, 5vw, 3.4rem) !important;
  line-height: 1.12 !important;
  letter-spacing: -0.03em;
  margin: 0 0 12px;
  color: #fff !important;
  word-break: break-word;
}

body.koskiniotis-post-film .kpf-lead {
  font-size: 1.05rem;
  line-height: 1.6;
  color: var(--kpf-muted);
  max-width: 36rem;
  margin: 0;
}

body.koskiniotis-post-film .kpf-align-center .kpf-lead {
  margin-inline: auto;
}

body.koskiniotis-post-film .kpf-scroll-hint {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 18px;
  font-size: 0.6875rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #cfc4ba;
}

body.koskiniotis-post-film .kpf-align-center .kpf-scroll-hint {
  justify-content: center;
}

body.koskiniotis-post-film .kpf-scroll-hint i {
  display: block;
  position: relative;
  width: 48px;
  height: 1px;
  background: #716962;
  overflow: hidden;
}

body.koskiniotis-post-film .kpf-scroll-hint i:after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--kpf-red);
  transform: translateX(-100%);
  animation: kpf-scrollline 2.3s ease-in-out infinite;
}

@keyframes kpf-scrollline {
  0%, 100% { transform: translateX(-100%); }
  50% { transform: translateX(0%); }
}

body.koskiniotis-post-film .kpf-poster-note {
  margin-top: 16px;
  padding: 12px 14px;
  border: 1px solid rgba(237, 28, 36, 0.45);
  background: rgba(20, 12, 12, 0.95);
  font-size: 0.9375rem;
  line-height: 1.5;
  color: #e7ddd4;
}

body.koskiniotis-post-film .kpf-article-wrap {
  position: relative;
  z-index: 3;
  padding: 12px 7vw 72px;
  width: 100%;
  box-sizing: border-box;
}

/* Reading panel — alpha follows --kpf-overlay-active from post settings */
body.koskiniotis-post-film .kpf-article-surface {
  width: min(720px, 100%);
  max-width: 100%;
  margin: 0 auto;
  padding: 28px 26px;
  background: var(--kpf-card) !important;
  border: 1px solid var(--kpf-card-border);
  border-radius: 8px;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.5);
  color: var(--kpf-paper) !important;
  font-size: var(--kpf-body-size) !important;
  line-height: 1.7 !important;
  box-sizing: border-box;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

body.koskiniotis-post-film .kpf-article-surface p,
body.koskiniotis-post-film .kpf-article-surface li {
  font-size: inherit !important;
  line-height: inherit !important;
  color: var(--kpf-paper) !important;
  margin-bottom: 1em;
}

body.koskiniotis-post-film .kpf-article-surface a {
  color: #ffb7ba !important;
  text-decoration: underline;
  text-underline-offset: 2px;
}

body.koskiniotis-post-film .kpf-article-surface img,
body.koskiniotis-post-film .kpf-article-surface video,
body.koskiniotis-post-film .kpf-article-surface iframe {
  max-width: 100% !important;
  height: auto !important;
  display: block;
  margin: 1.2em auto;
}

body.koskiniotis-post-film .kpf-article-surface h1,
body.koskiniotis-post-film .kpf-article-surface h2,
body.koskiniotis-post-film .kpf-article-surface h3,
body.koskiniotis-post-film .kpf-article-surface h4 {
  color: #fff !important;
  line-height: 1.3 !important;
  margin: 1.35em 0 0.5em;
}

body.koskiniotis-post-film .kpf-article-surface h2 {
  font-size: clamp(1.3rem, 3.5vw, 1.75rem) !important;
}

body.koskiniotis-post-film .kpf-article-surface h3 {
  font-size: clamp(1.15rem, 3vw, 1.4rem) !important;
}

body.koskiniotis-post-film .post-navigation,
body.koskiniotis-post-film .comments-area {
  position: relative;
  z-index: 3;
  width: min(720px, 100%);
  max-width: 100%;
  margin: 18px auto 0;
  padding: 20px 18px;
  background: var(--kpf-card) !important;
  border: 1px solid var(--kpf-card-border);
  border-radius: 8px;
  color: var(--kpf-paper) !important;
  box-sizing: border-box;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.75);
  backdrop-filter: none !important;
}

body.koskiniotis-post-film .comments-area label,
body.koskiniotis-post-film .comments-area .logged-in-as,
body.koskiniotis-post-film .comments-area h3 {
  color: var(--kpf-paper) !important;
}

body.koskiniotis-post-film .comments-area textarea,
body.koskiniotis-post-film .comments-area input[type="text"],
body.koskiniotis-post-film .comments-area input[type="email"],
body.koskiniotis-post-film .comments-area input[type="url"] {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  background: #18181b;
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: var(--kpf-paper);
  min-height: 44px;
  font-size: 1rem;
  border-radius: 4px;
}

body.koskiniotis-post-film .newsletter-section {
  position: relative;
  z-index: 4;
  background: #0c0c0e !important;
}

body.koskiniotis-post-film #colophon {
  position: relative;
  z-index: 4;
  background: #0a0a0b !important;
  color: var(--kpf-paper);
}

/* ========== Mobile ========== */
@media (max-width: 900px) {
  body.koskiniotis-post-film {
    --kpf-body-size: 1.125rem;
    --kpf-overlay-active: var(--kpf-overlay-mobile, 0.14);
  }

  body.koskiniotis-post-film .kpf-atmosphere {
    /* Mobile uses dedicated opacity; JS also sets inline style on resize. */
    opacity: var(--kpf-overlay-mobile, 0.14);
  }

  body.koskiniotis-post-film .kpf-grain {
    opacity: 0.02;
  }

  body.koskiniotis-post-film .kpf-hero {
    min-height: 52svh !important;
    padding: 84px 14px 20px !important;
    align-items: flex-end;
  }

  body.koskiniotis-post-film .kpf-hero-inner {
    width: 100%;
    padding: 16px 16px 18px;
    background: var(--kpf-card) !important;
    border-radius: 10px;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
  }

  body.koskiniotis-post-film .kpf-title {
    font-size: clamp(1.45rem, 6.5vw, 2rem) !important;
    line-height: 1.2 !important;
  }

  body.koskiniotis-post-film .kpf-lead {
    font-size: 1rem;
    line-height: 1.55;
  }

  body.koskiniotis-post-film .kpf-film-readout {
    display: none;
  }

  body.koskiniotis-post-film .kpf-film-progress {
    top: auto;
    bottom: 8px;
    right: 14px;
    left: 14px;
    width: auto;
    height: 3px;
    transform: none;
    background: rgba(255, 255, 255, 0.22);
    border-radius: 999px;
    overflow: hidden;
  }

  body.koskiniotis-post-film .kpf-film-progress span {
    width: 100%;
    height: 3px;
    transform: scaleX(0);
    transform-origin: left;
  }

  body.koskiniotis-post-film .kpf-article-wrap {
    padding: 10px 12px 56px;
  }

  body.koskiniotis-post-film .kpf-article-surface {
    width: 100%;
    padding: 20px 16px;
    border-radius: 10px;
    background: var(--kpf-card) !important;
    font-size: 1.125rem !important;
    line-height: 1.65 !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
  }

  body.koskiniotis-post-film .kpf-article-surface h2 {
    font-size: 1.35rem !important;
  }

  body.koskiniotis-post-film .kpf-article-surface h3 {
    font-size: 1.2rem !important;
  }

  body.koskiniotis-post-film .post-navigation,
  body.koskiniotis-post-film .comments-area {
    width: 100%;
    margin-top: 12px;
    padding: 16px 14px;
    background: var(--kpf-card) !important;
  }

  body.koskiniotis-post-film .comments-area .form-submit input,
  body.koskiniotis-post-film .comments-area input[type="submit"] {
    min-height: 48px;
    width: 100%;
    font-size: 1rem;
  }
}

@media (max-width: 430px) {
  body.koskiniotis-post-film .kpf-hero {
    min-height: 48svh !important;
    padding: 76px 10px 16px !important;
  }

  body.koskiniotis-post-film .kpf-hero-inner,
  body.koskiniotis-post-film .kpf-article-surface {
    padding: 16px 14px;
  }

  body.koskiniotis-post-film .kpf-article-wrap {
    padding: 8px 10px 48px;
  }

  body.koskiniotis-post-film .kpf-title {
    font-size: 1.4rem !important;
  }

  body.koskiniotis-post-film .kpf-article-surface {
    font-size: 1.0625rem !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  body.koskiniotis-post-film .kpf-scroll-hint i:after {
    animation: none;
  }
}
