/* Home page banner: an image or a YouTube video (tutorial Plyr player). */
.home-banner { min-width:0; }
.home-banner-image a,.home-banner-image > img { display:block; }
.home-banner-image img { display:block; width:100%; height:auto; max-height:520px; object-fit:cover; border:1px solid var(--brand-line); border-radius:18px; background:var(--brand-surface); box-shadow:0 18px 42px rgba(0,0,0,.23); }
.home-banner-image a { border-radius:18px; transition:transform .2s ease, box-shadow .2s ease; }
.home-banner-image a:hover { transform:translateY(-2px); }
.home-banner-image a:focus-visible { outline:2px solid var(--brand-pulse); outline-offset:4px; }
/* Optional title above the banner. Over a video it follows the player column. */
.home-banner-title { margin:0 0 14px; color:var(--brand-text); font-family:var(--brand-display); font-size:clamp(21px,2.6vw,30px); line-height:1.2; overflow-wrap:anywhere; }
.home-banner-title.is-center { text-align:center; }
.home-banner-video .home-banner-title { width:min(100%,960px); margin-inline:auto; }
.home-banner-video.is-vertical .home-banner-title { width:min(100%,560px); }
/* Horizontal video: centered and not wider than a comfortable screen. */
.home-banner-video .tutorial-player-shell { width:min(100%,960px); margin-inline:auto; }
.home-banner-video .tutorial-player-shell .tutorial-video { margin-top:0; }
/* Vertical video: the tutorial 9:16 frame, centered. */
.home-banner-video.is-vertical .tutorial-player-shell { width:min(100%,360px,78vh * 9 / 16); width:min(100%,360px,78svh * 9 / 16); }
@media (prefers-reduced-motion:reduce) { .home-banner-image a { transition:none; } .home-banner-image a:hover { transform:none; } }
@media (max-width:640px) {
  /* On phones the whole image is shown, never cropped. */
  .home-banner-image img { max-height:none; object-fit:contain; border-radius:14px; }
}

/* Admin form */
.home-banner-status { display:flex; flex-wrap:wrap; align-items:center; justify-content:space-between; gap:14px; margin:14px 0 20px; padding:14px 16px; border:1px solid var(--brand-line); border-left-width:4px; border-radius:12px; }
.home-banner-status strong { display:block; color:var(--brand-text); }
.home-banner-status span { display:block; margin-top:3px; color:var(--brand-muted); font-size:13px; }
.home-banner-status.is-on { border-left-color:var(--brand-pulse); }
.home-banner-status.is-off { border-left-color:#d9a441; }
.home-banner-status.is-empty { border-style:dashed; border-left-style:solid; }
.home-banner-preview-title:empty { display:none; }
.home-banner-preview-title { margin-top:10px; max-width:640px; }
.home-banner-preview-title .home-banner-title { width:auto; margin-bottom:0; }
.home-banner-check { display:flex; align-items:center; gap:10px; margin-bottom:14px; font-weight:600; }
.home-banner-check input { width:auto; }
.home-banner-current { display:block; max-width:min(100%,420px); border:1px solid var(--brand-line); border-radius:12px; }
.home-banner-preview-box { margin:6px 0 18px; padding:16px; border:1px dashed var(--brand-line); border-radius:14px; }
.home-banner-preview { margin-top:10px; color:var(--brand-muted); font-size:13px; }
.home-banner-preview .home-banner-video .tutorial-player-shell { width:min(100%,560px); margin-inline:0; }
.home-banner-preview .home-banner-video.is-vertical .tutorial-player-shell { width:min(100%,260px); }
.home-banner-preview .home-banner-image { max-width:640px; }
.home-banner-preview > small { display:block; margin-top:8px; }
.home-banner-form [hidden] { display:none !important; }

/* Admin: one block per saved banner, plus the "new banner" block. */
.home-banner-cards { display:grid; grid-template-columns:repeat(auto-fill,minmax(230px,1fr)); gap:14px; margin-bottom:20px; }
.home-banner-card { position:relative; display:flex; flex-direction:column; min-width:0; border:1px solid var(--brand-line); border-radius:14px; background:var(--brand-surface); overflow:hidden; transition:border-color .2s ease, box-shadow .2s ease; }
.home-banner-card.is-active { border-color:var(--brand-pulse); box-shadow:0 0 0 1px var(--brand-pulse); }
.home-banner-card.is-selected { box-shadow:0 0 0 2px var(--brand-text); }
.home-banner-card.is-saved { animation:home-banner-saved 1.6s ease 2; }
@keyframes home-banner-saved { 50% { box-shadow:0 0 0 3px var(--brand-pulse); } }
.home-banner-card-open { display:flex; flex-direction:column; width:100%; padding:0; border:0; background:none; color:inherit; font:inherit; text-align:left; cursor:pointer; }
.home-banner-card-open:focus-visible { outline:2px solid var(--brand-pulse); outline-offset:-2px; }
.home-banner-card-thumb { position:relative; display:block; aspect-ratio:16 / 9; background:rgba(0,0,0,.25); }
.home-banner-card-thumb img { display:block; width:100%; height:100%; object-fit:cover; }
.home-banner-card-play { position:absolute; inset:50% auto auto 50%; width:44px; height:44px; margin:-22px 0 0 -22px; border-radius:50%; background:rgba(0,0,0,.6); }
.home-banner-card-play::after { content:''; position:absolute; top:50%; left:55%; border-style:solid; border-width:8px 0 8px 13px; border-color:transparent transparent transparent #fff; transform:translate(-50%,-50%); }
.home-banner-card-body { display:block; padding:12px 14px 4px; min-width:0; }
.home-banner-card-body strong { display:block; color:var(--brand-text); overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.home-banner-card-body small { display:block; margin-top:3px; color:var(--brand-muted); font-size:12px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.home-banner-card-badge { position:absolute; top:10px; left:10px; padding:4px 10px; border-radius:999px; background:var(--brand-pulse); color:#06130d; font-size:12px; font-weight:700; pointer-events:none; }
.home-banner-card-actions { display:flex; flex-wrap:wrap; gap:8px; margin-top:auto; padding:10px 14px 14px; }
.home-banner-card-actions .edge-btn { flex:1 1 auto; }
.home-banner-card-new { align-items:center; justify-content:center; gap:4px; min-height:220px; padding:20px; border-style:dashed; background:none; color:var(--brand-muted); font:inherit; cursor:pointer; }
.home-banner-card-new > span { font-size:34px; line-height:1; color:var(--brand-pulse); }
.home-banner-card-new strong { color:var(--brand-text); }
.home-banner-card-new small { font-size:12px; }
.home-banner-card-new:hover,.home-banner-card-new:focus-visible { border-color:var(--brand-pulse); outline:none; }
/* Editor of the opened block. */
.home-banner-editor { padding-top:18px; border-top:1px solid var(--brand-line); scroll-margin-top:80px; }
.home-banner-editor-head { display:flex; flex-wrap:wrap; align-items:flex-start; justify-content:space-between; gap:12px; margin-bottom:16px; }
.home-banner-editor-head h2 { margin:4px 0 0; color:var(--brand-text); font-size:20px; overflow-wrap:anywhere; }
@media (prefers-reduced-motion:reduce) { .home-banner-card { transition:none; } .home-banner-card.is-saved { animation:none; box-shadow:0 0 0 3px var(--brand-pulse); } }
@media (max-width:520px) { .home-banner-cards { grid-template-columns:1fr; } .home-banner-card-new { min-height:120px; } }
/* Badges of a block: on the home page below the opening, and/or in the opening. */
.home-banner-card-badges { position:absolute; top:10px; left:10px; display:flex; flex-wrap:wrap; gap:6px; max-width:calc(100% - 20px); pointer-events:none; }
.home-banner-card-badges .home-banner-card-badge { position:static; }
.home-banner-card-badge.is-hero { background:var(--brand-cyan); color:#04161c; }
.home-banner-admin-head h2 { margin:4px 0 8px; color:var(--brand-text); font-size:22px; }

/* Opening section showing a banner in its place. */
.home-hero-slot { width:min(1360px,100%); margin:0 auto; padding:28px 28px 0; }
.home-hero-slot:empty { display:none; }
.home-hero-slot .home-banner-title { font-size:clamp(26px,3.4vw,44px); }
/* Background image covering the whole opening, under a stronger shade. */
.hero-banner.brand-hero.is-full-art .brand-hero-art { inset:0; width:100%; }
.hero-banner.brand-hero.is-full-art .brand-hero-shade {
  background:
    linear-gradient(90deg, #080b0f 0%, rgba(8,11,15,.9) 30%, rgba(8,11,15,.5) 62%, rgba(8,11,15,.25) 100%),
    linear-gradient(0deg, #080b0f 0%, transparent 34%, rgba(8,11,15,.12) 100%);
}

/* Admin: the opening editor, above the banners. */
.home-hero-admin { margin-bottom:22px; scroll-margin-top:80px; }
.home-hero-preview { margin:0 0 16px; }
.home-hero-preview-frame { --hero-preview-scale:.4; position:relative; width:100%; max-width:860px; aspect-ratio:1360 / 640; overflow:hidden; border:1px solid var(--brand-line); border-radius:14px; background:#071018; }
.home-hero-preview-stage { position:absolute; top:0; left:0; width:1360px; height:640px; transform:scale(var(--hero-preview-scale)); transform-origin:0 0; pointer-events:none; user-select:none; }
.home-hero-preview-stage .hero-banner.brand-hero { height:100%; margin:0; padding:0; border-bottom:0; }
.home-hero-preview-banner { position:relative; max-width:640px; overflow:hidden; border:1px solid var(--brand-line); border-radius:14px; background:var(--brand-surface); }
.home-hero-preview-banner img { display:block; width:100%; height:auto; }
.home-hero-preview-banner.is-video { aspect-ratio:16 / 9; }
.home-hero-preview-banner.is-video img { height:100%; object-fit:cover; }
.home-hero-preview-empty { padding:28px 16px; border:1px dashed var(--brand-line); border-radius:14px; color:var(--brand-muted); text-align:center; }
.home-hero-editor { padding-top:18px; border-top:1px solid var(--brand-line); }
.home-hero-admin [hidden] { display:none !important; }
.home-hero-modes { display:flex; flex-wrap:wrap; gap:10px 22px; margin:0 0 18px; padding:14px 16px; border:1px solid var(--brand-line); border-radius:12px; }
.home-hero-modes legend { padding:0 6px; color:var(--brand-text); font-weight:700; }
.home-hero-modes label { display:flex; align-items:center; gap:8px; font-weight:600; cursor:pointer; }
.home-hero-modes input { width:auto; }
.home-hero-modes small { flex-basis:100%; }
.home-hero-pair { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:0 16px; }
.home-hero-note { display:block; margin:-6px 0 16px; }
/* Wide screens: while editing, the preview stays beside the form. */
@media (min-width:1100px) {
  .home-hero-admin.is-editing .home-hero-admin-body { display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1.1fr); gap:24px; align-items:start; }
  .home-hero-admin.is-editing .home-hero-preview { position:sticky; top:84px; order:2; }
  .home-hero-admin.is-editing .home-hero-editor { order:1; padding-top:0; border-top:0; }
}
@media (max-width:767px) {
  .home-hero-slot { padding:18px 16px 0; }
  .hero-banner.brand-hero.is-full-art .brand-hero-art { inset:0; height:100%; opacity:.8; }
  .hero-banner.brand-hero.is-full-art .brand-hero-shade { background:linear-gradient(180deg, rgba(8,11,15,.6) 0%, rgba(8,11,15,.78) 45%, rgba(8,11,15,.62) 75%, #080b0f 100%); }
  .home-hero-preview-frame { max-width:320px; aspect-ratio:390 / 650; }
  .home-hero-preview-stage { width:390px; height:650px; }
}
@media (max-width:520px) { .home-hero-pair { grid-template-columns:1fr; } }

/* Admin: sales page video. The status shows the saved video thumbnail. */
.sales-video-status { justify-content:flex-start; }
.sales-video-status img { width:96px; aspect-ratio:16 / 9; object-fit:cover; border-radius:8px; flex:none; }
.sales-video-status > div { flex:1 1 220px; }
.sales-video-admin .home-banner-form { margin-top:4px; }
