/* v8.4: consistent, full-photo display without damaging any original image */
:root{--zh-fit-accent:#2C7da0;--zh-fit-frame:#dceaf2;--zh-fit-depth:rgba(24,82,108,.12)}
:root[data-theme="dark"]{--zh-fit-frame:#153140;--zh-fit-depth:rgba(0,0,0,.3)}
/* A blurred duplicate exists only as a CSS background. The visible image is never cropped. */
:is(.lead-visual,.card-image,.rail-thumb,.photo-stage,.book-cover,.zh-album-slide>a,.zh-album-choice-cover,.zh-album-thumb,.zh-media-plane).zh-fit-ready{
 position:relative;isolation:isolate;overflow:hidden;background-color:var(--zh-fit-frame);
}
:is(.lead-visual,.card-image,.rail-thumb,.photo-stage,.book-cover,.zh-album-slide>a,.zh-album-choice-cover,.zh-album-thumb,.zh-media-plane).zh-fit-ready::before{
 content:"";position:absolute;inset:-30px;z-index:-1;pointer-events:none;
 background-image:var(--zh-media-backdrop);background-repeat:no-repeat;background-size:cover;background-position:center;
 filter:blur(24px) saturate(.84) brightness(.78);opacity:0;transform:scale(1.04);
}
:is(.lead-visual,.card-image,.rail-thumb,.photo-stage,.book-cover,.zh-album-slide>a,.zh-album-choice-cover,.zh-album-thumb,.zh-media-plane).zh-fit-mismatch::before{opacity:.78}
:is(.lead-visual,.card-image,.rail-thumb,.photo-stage,.book-cover,.zh-album-slide>a,.zh-album-choice-cover,.zh-album-thumb,.zh-media-plane).zh-fit-ready::after{
 content:"";position:absolute;inset:0;z-index:-1;pointer-events:none;background:rgba(11,56,81,.10);
}
/* This must override older card rules that used object-fit:cover and hover zoom. */
:is(.lead-visual,.card-image,.rail-thumb,.photo-stage,.book-cover,.zh-album-slide>a,.zh-album-choice-cover,.zh-album-thumb,.zh-media-plane).zh-fit-ready>img:not(.lead-backdrop){
 position:relative!important;z-index:1!important;display:block!important;
 width:100%!important;height:100%!important;max-width:100%!important;max-height:100%!important;
 object-fit:contain!important;object-position:50% 50%!important;transform:none!important;
 image-rendering:auto!important;border-radius:inherit;
}
/* The stage of portrait PDF/book/media images has a predictable height. */
.post-gallery-image .zh-media-plane{height:420px;width:100%;min-width:0;border-radius:9px}
.article-cover .zh-media-plane{height:min(70vw,690px);max-height:690px;min-height:200px;width:100%;border-radius:15px}
.zh-media-plane>img{border-radius:0!important}
.zh-album-slide>a.zh-fit-ready{height:100%;width:100%;background:transparent}
/* The gallery previously introduced a second sibling background: hide it to avoid double blur. */
.zh-album-slide .zh-album-backdrop{display:none!important}
.zh-album-slide>a.zh-fit-portrait::before{filter:blur(25px) saturate(.87) brightness(.64);opacity:.96}
.zh-album-slide>a.zh-fit-landscape::before{opacity:.52}
/* Do not fill circular article portraits with this rectangular framing system. */
:is(.editorial-portrait,.ticker-cover,.category-ring) img{object-fit:cover!important}
/* Hero: new proportions, uncut media, framed copy and an unhurried dissolve. */
.front-hero .lead-slider{height:clamp(442px,37vw,515px)!important;min-height:0!important;
 background:linear-gradient(120deg,var(--card) 0%,var(--tint2) 68%,var(--card) 100%)!important;
 border:1px solid rgba(44,125,160,.32)!important;border-top:3px solid #2C7da0!important;
 box-shadow:0 13px 42px rgba(44,125,160,.14)!important;border-radius:19px!important}
.front-hero .lead-stage{height:calc(100% - 76px)!important;min-height:0!important}
.front-hero .lead-stage .lead-slide{display:grid!important;
 grid-template-columns:minmax(0,.99fr) minmax(0,1.01fr)!important;
 gap:clamp(16px,2.1vw,34px)!important;align-items:stretch!important;
 padding:clamp(17px,2vw,28px)!important;
 transition:opacity 1.15s ease,visibility 1.15s!important;
}
.front-hero .lead-slide .lead-copy-panel{display:flex!important;flex-direction:column;justify-content:center;
 align-self:stretch!important;min-width:0!important;padding:clamp(15px,2vw,27px)!important;
 background:linear-gradient(135deg,var(--card),var(--tint2))!important;
 border:1px solid rgba(44,125,160,.22)!important;border-inline-start:3px solid #2C7da0!important;
 border-radius:15px!important;box-shadow:0 8px 28px var(--zh-fit-depth)!important;
 transform:translateY(12px)!important;opacity:.35;
 transition:transform 1.15s cubic-bezier(.22,1,.36,1),opacity 1.15s ease!important;
}
.front-hero .lead-slide.is-active .lead-copy-panel{transform:translateY(0)!important;opacity:1}
.front-hero .lead-slide .lead-title{font-size:clamp(19px,1.65vw,28px)!important;
 line-height:1.7!important;-webkit-line-clamp:4;overflow-wrap:anywhere}
.front-hero .lead-slide .lead-excerpt{font-size:clamp(12px,.84vw,14px)!important;line-height:1.9!important}
.front-hero .lead-slide .lead-meta{margin-bottom:9px!important}
.front-hero .lead-slide .lead-visual{margin:0!important;width:100%!important;
 height:100%!important;min-height:0!important;max-height:none!important;
 display:grid!important;place-items:center!important;
 border:1px solid rgba(44,125,160,.28)!important;
 border-radius:16px!important;padding:6px!important;
 box-shadow:0 10px 32px rgba(44,125,160,.14)!important;
 background:var(--zh-fit-frame)!important;
 transform:translateX(-12px) scale(.985);opacity:.70;
 transition:transform 1.15s cubic-bezier(.22,1,.36,1),opacity 1.15s ease!important;
}
.front-hero .lead-slide.is-active .lead-visual{transform:translateX(0) scale(1);opacity:1}
.front-hero .lead-visual>img:not(.lead-backdrop){object-fit:contain!important;border-radius:10px!important}
.front-hero .lead-controls{height:76px!important;box-shadow:inset 0 1px 0 rgba(44,125,160,.1)}
.front-hero .lead-bar{background:rgba(44,125,160,.12)}
.front-hero .lead-bar [data-progress]{background:#2C7da0!important}
.front-hero .lead-open{background:#2C7da0!important}
/* All media frames share a calm blue backdrop; the site-wide white canvas is unchanged. */
.card-image,.photo-stage,.book-cover,.post-gallery-image .zh-media-plane{box-shadow:inset 0 0 0 1px rgba(44,125,160,.09)}
@media(max-width:690px){
 .front-hero .lead-slider{height:auto!important;min-height:0!important}
 .front-hero .lead-stage{height:var(--zh-stage-height,600px)!important;min-height:0!important}
 .front-hero .lead-stage .lead-slide{grid-template-columns:1fr!important;
  grid-template-rows:clamp(222px,58vw,300px) minmax(0,1fr)!important;
  align-items:stretch!important;gap:12px!important;padding:13px!important}
 .front-hero .lead-slide .lead-visual{grid-row:1!important;height:100%!important;min-height:0!important;max-height:none!important;padding:4px!important}
 .front-hero .lead-slide .lead-copy-panel{grid-row:2!important;padding:14px!important}
 .front-hero .lead-slide .lead-title{font-size:clamp(17px,4.4vw,22px)!important;-webkit-line-clamp:4}
 .front-hero .lead-controls{position:relative!important;height:68px!important;padding-inline:14px!important}
 .post-gallery-image .zh-media-plane{height:310px}
 .article-cover .zh-media-plane{height:clamp(250px,78vw,480px)}
}
@media(prefers-reduced-motion:reduce){
 .front-hero .lead-slide,.front-hero .lead-slide .lead-copy-panel,.front-hero .lead-slide .lead-visual{transition:none!important;transform:none!important}
}


/* v8.5 -- three agreed adjustments only: internal hero controls, larger
 * real photograph + narrower title card, ECG in the unused ticker header. */
@media (min-width: 691px) {
  .front-hero .hero-grid { align-items:stretch; }
  .front-hero .lead-column { display:flex; min-width:0; }
  .front-hero .lead-slider {
    width:100%; flex:1 1 auto; height:100%!important;
    min-height:clamp(442px,37vw,515px)!important;
  }
  .front-hero .lead-stage { height:100%!important; }
  .front-hero .lead-stage .lead-slide {
    grid-template-columns:minmax(0,.75fr) minmax(0,1.25fr)!important;
    gap:clamp(12px,1.6vw,25px)!important;
    padding:clamp(17px,1.8vw,27px)!important;
  }
  .front-hero .lead-slide .lead-copy-panel {
    min-width:0!important;padding:clamp(13px,1.6vw,23px)!important;
  }
  .front-hero .lead-slide .lead-visual {
    width:100%!important;height:100%!important;min-height:0!important;
    max-height:none!important;max-width:none!important;
  }
  /* Floating INSIDE the original slide canvas; never its own bottom row. */
  .front-hero .lead-controls {
    position:absolute!important;top:auto!important;right:auto!important;
    bottom:clamp(25px,2.6vw,40px)!important;
    left:clamp(24px,2.7vw,42px)!important;
    width:min(56%,535px)!important;max-width:calc(100% - 48px);
    height:42px!important;min-height:0!important;
    padding:5px 10px!important;margin:0!important;
    border:1px solid rgba(44,125,160,.28)!important;
    border-radius:11px!important;
    background:rgba(248,252,255,.90)!important;
    -webkit-backdrop-filter:blur(11px);backdrop-filter:blur(11px);
    box-shadow:0 6px 23px rgba(27,83,111,.20)!important;
    z-index:6;gap:11px;
  }
  .front-hero .lead-controls .lead-arrows button {width:30px;height:30px;border-radius:8px;}
  .front-hero .lead-controls .lead-counter {font-size:12px;}
}
@media (min-width:691px) and (max-width:1120px){
  .front-hero .lead-stage .lead-slide {grid-template-columns:minmax(0,.83fr) minmax(0,1.17fr)!important;gap:12px!important;padding:16px!important;}
  .front-hero .lead-controls {width:52%!important;bottom:22px!important;left:22px!important;}
}
/* On phones, controls float over the photo (first grid row), not the title
 * and not a separate bar. Stage measurements no longer reserve 68/76px. */
@media (max-width:690px){
  .front-hero .lead-slider {height:var(--zh-stage-height,535px)!important;min-height:0!important;}
  .front-hero .lead-stage {height:100%!important;min-height:0!important;}
  .front-hero .lead-stage .lead-slide {
    grid-template-columns:1fr!important;
    grid-template-rows:clamp(222px,58vw,300px) minmax(0,1fr)!important;
    padding:13px!important;gap:12px!important;
  }
  .front-hero .lead-slide .lead-visual {height:100%!important;}
  .front-hero .lead-controls {
    position:absolute!important;inset:auto 22px auto 22px!important;
    top:calc(13px + clamp(222px,58vw,300px) - 52px)!important;
    width:auto!important;height:38px!important;min-height:0!important;
    padding:4px 8px!important;margin:0!important;
    display:flex!important;gap:7px!important;
    border:1px solid rgba(44,125,160,.28)!important;
    border-radius:9px!important;
    background:rgba(249,253,255,.89)!important;
    -webkit-backdrop-filter:blur(10px);backdrop-filter:blur(10px);
    box-shadow:0 5px 17px rgba(27,83,111,.17)!important;
    z-index:6;
  }
  .front-hero .lead-controls .lead-arrows button{width:28px;height:28px;border-radius:7px;}
  .front-hero .lead-controls .lead-counter{font-size:11px;}
}
/* The heartbeat ONLY occupies the empty horizontal space beside "نوێترین".
 * It travels right-to-left, pauses at the end, then starts over. */
.cover-ticker-line {display:flex;align-items:center;}
.cover-ticker-line > strong,.cover-ticker-line > .ticker-pulse {flex:0 0 auto;}
.cover-ticker-line .zh-ecg-track {
  display:block;position:relative;flex:1 1 auto;min-width:0;
  height:32px;overflow:hidden;margin-inline-start:14px;
}
.zh-ecg-svg {width:100%;height:100%;display:block;overflow:visible;}
.zh-ecg-baseline {fill:none;stroke:rgba(44,125,160,.17);stroke-width:1.2;vector-effect:non-scaling-stroke;}
.zh-ecg-trace {
  fill:none;stroke:#2C7da0;stroke-width:2.3;
  vector-effect:non-scaling-stroke;stroke-linecap:round;stroke-linejoin:round;
  stroke-dasharray:1000;stroke-dashoffset:1000;
  filter:drop-shadow(0 0 2.5px rgba(44,125,160,.27));
  animation:zh-ecg-sweep 9s linear infinite;
}
@keyframes zh-ecg-sweep {
  0%,4%{stroke-dashoffset:1000;opacity:1}
  84%,94%{stroke-dashoffset:0;opacity:1}
  99%{stroke-dashoffset:0;opacity:0}
  100%{stroke-dashoffset:1000;opacity:0}
}
@media (max-width:420px){
  .cover-ticker-line{padding-inline:12px;gap:8px;}
  .cover-ticker-line .zh-ecg-track{margin-inline-start:5px;height:27px;}
}
@media (prefers-reduced-motion:reduce){
  .zh-ecg-trace{animation:none!important;stroke-dashoffset:0!important;opacity:1!important;}
}
:root[data-theme="dark"] .front-hero .lead-controls{
 background:rgba(15,45,63,.89)!important;
}
