/* Hero title — load VI font here so admin preview never falls back to broken serif */
@import url('https://fonts.googleapis.com/css2?family=Be+Vietnam+Pro:wght@600;700;800&family=Manrope:wght@500;600;700;800&display=swap');

.hero-slider {
  position: relative;
  width: 100%;
  min-height: min(88vh, 860px);
  height: min(88vh, 860px);
  overflow: hidden;
  background: #001a66;
  color: #fff;
}
/* Real phone — same fill rules */
@media (max-width: 768px) {
  .hero-slider {
    min-height: min(62vh, 560px);
    height: min(62vh, 560px);
  }
  .hero-slide__media img,
  .hero-slide__media picture,
  .hero-slide__media picture img {
    position: absolute !important;
    inset: 0 !important;
    width: 100% !important;
    height: 100% !important;
    max-width: none !important;
    object-fit: cover !important;
  }
}
.hero-slider__track {
  position: absolute;
  inset: 0;
}
.hero-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  visibility: hidden;
  transition: opacity .85s ease, visibility .85s ease;
  z-index: 1;
}
.hero-slide.is-active {
  opacity: 1;
  visibility: visible;
  z-index: 2;
}
.hero-slide__media {
  position: absolute;
  inset: 0;
  overflow: hidden;
  background: #001a66;
}
/* Absolute fill — thắng Tailwind preflight (img { height:auto }) kẻo lộ nền xanh */
.hero-slide__media img,
.hero-slide__media picture {
  position: absolute !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
  max-width: none !important;
  max-height: none !important;
  display: block !important;
  object-fit: cover !important;
  object-position: center center !important;
}
.hero-slide__media picture img {
  position: absolute !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
  max-width: none !important;
  max-height: none !important;
  object-fit: cover !important;
  object-position: center center !important;
}
/* Mode responsive: gentle Ken Burns scale */
.hero-slide[data-mode="responsive"].is-active .hero-slide__media img {
  animation: heroKen 14s ease-in-out infinite alternate;
}
/* Edit / preview: tắt Ken Burns (tránh “hở” nền xanh khi scale) */
.edit-mode .hero-slide[data-mode="responsive"].is-active .hero-slide__media img,
.hero-slider.is-slide-editing .hero-slide[data-mode="responsive"].is-active .hero-slide__media img,
.hero-slider.is-editor .hero-slide[data-mode="responsive"].is-active .hero-slide__media img {
  animation: none !important;
  transform: none !important;
}
@keyframes heroKen {
  from { transform: scale(1.02); }
  to { transform: scale(1.1); }
}
@media (prefers-reduced-motion: reduce) {
  .hero-slide[data-mode="responsive"].is-active .hero-slide__media img {
    animation: none;
  }
}

.hero-slide__overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 2;
}
.hero-slide__overlay.is-gradient-left {
  background:
    linear-gradient(105deg, rgba(0,26,102,.92) 0%, rgba(0,51,204,.72) 42%, rgba(0,170,255,.28) 72%, transparent 100%),
    radial-gradient(ellipse at bottom right, rgba(0,170,255,.22), transparent 55%);
}
.hero-slide__overlay.is-gradient-center {
  background: linear-gradient(180deg, rgba(0,26,102,.55) 0%, rgba(0,51,204,.45) 45%, rgba(0,26,102,.75) 100%);
}
.hero-slide__overlay.is-dark {
  background: rgba(0, 20, 70, .62);
}
.hero-slide__overlay.is-soft {
  background: linear-gradient(180deg, rgba(0,26,102,.25), rgba(0,26,102,.55));
}
.hero-slide__overlay.is-none {
  background: transparent;
}
/* Edit-mode: giảm độ đậm overlay để thấy ảnh nền (Desktop hay bị “mất”) */
.edit-mode .hero-slide__overlay {
  opacity: 0.68;
}

.hero-slide__content {
  position: absolute;
  z-index: 3;
  max-width: min(var(--slide-max-w, 560px), calc(100% - 2rem));
  left: var(--slide-x, 6%);
  top: var(--slide-y, 68%);
  transform: translate(var(--slide-tx, 0%), var(--slide-ty, 0%))
    scale(calc(var(--slide-scale, 100) / 100));
  transform-origin: var(--slide-origin, left bottom);
  text-align: var(--slide-align, left);
  padding: .25rem;
  transition: opacity .55s ease .12s, transform .7s cubic-bezier(.2,.8,.2,1) .05s;
}
.hero-slide:not(.is-active) .hero-slide__content {
  opacity: 0;
  transform: translate(var(--slide-tx, 0%), calc(var(--slide-ty, 0%) + 18px))
    scale(calc(var(--slide-scale, 100) / 100 * .98));
}
/* Edit-mode: instant left/top moves, no transform lag while dragging */
.edit-mode .hero-slide__content,
.hero-slider.is-slide-editing .hero-slide__content,
.hero-slider.is-editor .hero-slide__content {
  outline: 2px dashed rgba(125, 211, 255, 0.7);
  outline-offset: 6px;
  cursor: grab;
  touch-action: none;
}
.hero-slider.is-editor .hero-slide__content.is-dragging {
  outline-color: #fff;
  outline-style: solid;
  cursor: grabbing;
}
.edit-mode .hero-slide__content.is-dragging {
  transition: none !important;
  z-index: 8;
  user-select: none;
  cursor: grabbing !important;
}
.hero-slider.is-dragging-slide {
  user-select: none;
  cursor: grabbing;
}
.hero-slider.is-dragging-slide .hero-slide__content [data-text-edit] {
  pointer-events: none;
}
.hero-slider.is-editor .hero-slide__content {
  outline: 2px dashed rgba(125, 211, 255, 0.7);
  outline-offset: 6px;
  cursor: grab;
  touch-action: none;
}
.hero-slider.is-editor .hero-slide__content.is-dragging {
  outline-color: #fff;
  outline-style: solid;
  cursor: grabbing;
  transition: none !important;
  z-index: 8;
  user-select: none;
}
.hero-slide__logo {
  height: var(--slide-logo-h, 3.75rem);
  width: auto;
  margin-bottom: 1rem;
  filter: drop-shadow(0 8px 18px rgba(0,0,0,.25));
  display: block;
}
.hero-slide__logo.is-hidden {
  display: none !important;
}
@media (min-width: 768px) {
  .hero-slide__logo { height: var(--slide-logo-h, 4.75rem); }
}
.hero-slide__eyebrow {
  font-size: var(--slide-eyebrow-size, .78rem);
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: #7dd3ff;
  margin-bottom: .65rem;
}
.hero-slide__title {
  /* Be Vietnam Pro — full VI glyphs (Fraunces breaks accents) */
  font-family: "Be Vietnam Pro", Manrope, "Segoe UI", system-ui, sans-serif !important;
  font-size: var(--slide-title-size, clamp(1.85rem, 4.2vw, 3.55rem));
  font-weight: 700;
  line-height: 1.22;
  letter-spacing: 0 !important;
  word-spacing: normal;
  font-kerning: normal;
  font-feature-settings: normal;
  font-variant-ligatures: none;
  text-rendering: optimizeLegibility;
  text-shadow: 0 10px 30px rgba(0,0,0,.25);
}
.hero-slide__body {
  margin-top: 1rem;
  font-size: var(--slide-body-size, clamp(1rem, 1.5vw, 1.2rem));
  line-height: 1.55;
  color: rgba(255,255,255,.88);
  max-width: 38rem;
}
.hero-slide__actions {
  margin-top: 1.5rem;
  display: flex;
  flex-wrap: wrap;
  gap: .7rem;
  justify-content: var(--slide-actions, flex-start);
}
.hero-slide__actions a {
  display: inline-flex;
  align-items: center;
  padding: .8rem 1.25rem;
  border-radius: .85rem;
  font-weight: 700;
  font-size: var(--slide-cta-size, .95rem);
  transition: transform .2s ease, background .2s ease, border-color .2s ease;
}
.hero-slide__actions a:hover { transform: translateY(-1px); }
.hero-btn-primary {
  background: #fff;
  color: #0033CC;
  box-shadow: 0 10px 28px rgba(0,0,0,.18);
}
.hero-btn-ghost {
  border: 1px solid rgba(255,255,255,.5);
  color: #fff;
  background: rgba(255,255,255,.08);
  backdrop-filter: blur(6px);
}

.hero-slider__nav {
  position: absolute;
  inset: 0;
  z-index: 5;
  pointer-events: none;
}
.hero-slider__arrow {
  pointer-events: auto;
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.35);
  background: rgba(0,26,102,.35);
  color: #fff;
  display: grid;
  place-items: center;
  backdrop-filter: blur(8px);
  cursor: pointer;
  transition: background .2s ease, border-color .2s ease;
}
.hero-slider__arrow:hover {
  background: rgba(0,51,204,.7);
  border-color: rgba(255,255,255,.7);
}
.hero-slider__arrow.prev { left: 1rem; }
.hero-slider__arrow.next { right: 1rem; }
.hero-slider__dots {
  pointer-events: auto;
  position: absolute;
  left: 50%;
  bottom: 1.25rem;
  transform: translateX(-50%);
  display: flex;
  gap: .45rem;
  align-items: center;
}
.hero-slider__dot {
  width: .55rem;
  height: .55rem;
  border-radius: 999px;
  border: 0;
  background: rgba(255,255,255,.4);
  cursor: pointer;
  transition: width .25s ease, background .25s ease;
}
.hero-slider__dot.is-active {
  width: 1.55rem;
  background: #fff;
}
.hero-slider__progress {
  position: absolute;
  left: 0;
  bottom: 0;
  height: 3px;
  width: 0;
  background: linear-gradient(90deg, #00AAFF, #fff);
  z-index: 6;
}

/* —— Mobile / preview-mobile: chrome + type (layout comes from content_mobile) —— */
@media (max-width: 768px) {
  .hero-slide__logo:not([data-show-mobile="1"]) { display: none; }
  .hero-slide__logo[data-show-mobile="1"]:not(.is-hidden) { display: block; }
  .hero-slide__eyebrow {
    font-size: var(--slide-eyebrow-size, .68rem);
    letter-spacing: .08em;
    margin-bottom: .45rem;
  }
  .hero-slide__title {
    font-size: var(--slide-title-size, clamp(1.35rem, 6.2vw, 1.75rem));
    line-height: 1.22;
    letter-spacing: 0 !important;
  }
  .hero-slide__body {
    margin-top: .55rem;
    font-size: var(--slide-body-size, .9rem);
    line-height: 1.45;
  }
  .hero-slide__actions {
    margin-top: .95rem;
    gap: .5rem;
  }
  .hero-slide__actions a {
    padding: .68rem .95rem;
    font-size: var(--slide-cta-size, .86rem);
    border-radius: .75rem;
    justify-content: center;
    min-width: 0;
    text-align: center;
  }
  .hero-slide__content {
    max-width: min(var(--slide-max-w, 560px), calc(100% - 1.5rem));
  }
  .hero-slider__arrow {
    top: auto;
    bottom: .7rem;
    transform: none;
    width: 2.15rem;
    height: 2.15rem;
  }
  .hero-slider__arrow.prev { left: .65rem; }
  .hero-slider__arrow.next { right: .65rem; }
  .hero-slider__arrow svg { width: 15px; height: 15px; }
  .hero-slider__dots {
    bottom: 1rem;
    max-width: calc(100% - 6rem);
  }
}

html[data-preview-device="mobile"] .hero-slide__logo:not([data-show-mobile="1"]),
html[data-preview-device="tablet"] .hero-slide__logo:not([data-show-mobile="1"]) {
  display: none;
}
html[data-preview-device="mobile"] .hero-slide__logo[data-show-mobile="1"]:not(.is-hidden),
html[data-preview-device="tablet"] .hero-slide__logo[data-show-mobile="1"]:not(.is-hidden) {
  display: block;
}
html[data-preview-device="mobile"] .hero-slide__title {
  font-size: var(--slide-title-size, clamp(1.35rem, 6.2vw, 1.75rem));
  line-height: 1.18;
}
html[data-preview-device="mobile"] .hero-slide__body {
  margin-top: .55rem;
  font-size: var(--slide-body-size, .9rem);
  line-height: 1.45;
}
html[data-preview-device="mobile"] .hero-slide__content {
  max-width: min(var(--slide-max-w, 560px), calc(100% - 1.5rem));
}
html[data-preview-device="tablet"] .hero-slide__title {
  font-size: var(--slide-title-size, clamp(1.55rem, 3.2vw, 2.25rem));
  line-height: 1.2;
}
html[data-preview-device="tablet"] .hero-slide__body {
  margin-top: .65rem;
  font-size: var(--slide-body-size, .95rem);
  line-height: 1.45;
}
html[data-preview-device="tablet"] .hero-slide__eyebrow {
  font-size: var(--slide-eyebrow-size, .72rem);
  letter-spacing: .1em;
}
html[data-preview-device="mobile"] .hero-slider__arrow {
  top: auto;
  bottom: .7rem;
  transform: none;
  width: 2.15rem;
  height: 2.15rem;
}
html[data-preview-device="mobile"] .hero-slider__arrow.prev { left: .65rem; }
html[data-preview-device="mobile"] .hero-slider__arrow.next { right: .65rem; }
html[data-preview-device="mobile"] .hero-slider__dots {
  bottom: 1rem;
  max-width: calc(100% - 6rem);
}

@media (max-width: 380px) {
  .hero-slide__actions { flex-direction: column; }
  .hero-slide__actions a { width: 100%; }
  .hero-slide__body { font-size: .85rem; }
}

/* Admin slide editor */
.slide-editor-shell {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(300px, .9fr);
  gap: 18px;
  align-items: start;
}
@media (max-width: 1100px) {
  .slide-editor-shell { grid-template-columns: 1fr; }
}
.slide-preview {
  position: relative;
  border-radius: 14px;
  overflow: hidden;
  background: #001a66;
  width: 100%;
  height: min(62vh, 580px);
  min-height: 420px;
  aspect-ratio: auto;
  border: 1px solid #d6e4f5;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.04);
}
.slide-preview .hero-slider {
  min-height: 100% !important;
  height: 100% !important;
}
.slide-preview .hero-slider.is-editor .hero-slide__media img,
.slide-preview .hero-slider.is-editor .hero-slide[data-mode="responsive"].is-active .hero-slide__media img {
  animation: none !important;
  object-fit: cover;
  object-position: center center;
  transform: none !important;
}
.slide-preview .hero-slide.is-active .hero-slide__content {
  outline: 2px dashed rgba(125,211,255,.85);
  outline-offset: 6px;
  cursor: grab;
}
.slide-preview-fit {
  display: inline-flex;
  gap: 4px;
  padding: 3px;
  border-radius: 999px;
  background: #eef4ff;
  margin-left: auto;
}
.slide-preview-fit button {
  border: 0;
  background: transparent;
  border-radius: 999px;
  padding: 6px 12px;
  font-weight: 800;
  font-size: .78rem;
  color: #5a6b85;
  cursor: pointer;
}
.slide-preview-fit button.is-active {
  background: #0033CC;
  color: #fff;
}
.slide-preview.is-fit-contain .hero-slide__media img {
  object-fit: contain !important;
  background: #000814;
}
.color-field {
  display: flex;
  gap: 8px;
  align-items: center;
}
.color-field input[type="color"] {
  width: 42px;
  height: 38px;
  padding: 2px;
  border: 1px solid #d6e4f5;
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
}
.color-field input[type="text"] {
  flex: 1;
}
.slide-size-btns {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}
.slide-size-btns .btn {
  padding: 6px 10px;
  font-size: .8rem;
}
.slide-size-controls input[type="range"] {
  width: 100%;
}
.slide-hotkeys {
  margin-top: 10px;
  font-size: .85rem;
  color: #5a6b85;
  line-height: 1.5;
  background: #f3f7fc;
  border-radius: 10px;
  padding: 10px 12px;
  border: 1px solid #d6e4f5;
}
.slide-hotkeys kbd {
  display: inline-block;
  min-width: 1.4rem;
  text-align: center;
  padding: 1px 6px;
  border-radius: 5px;
  border: 1px solid #c5d6ea;
  background: #fff;
  font-size: .78rem;
  font-weight: 700;
  color: #0033CC;
}
.mode-pill {
  display: inline-flex;
  gap: 6px;
  background: #eef4ff;
  padding: 4px;
  border-radius: 999px;
}
.mode-pill label {
  cursor: pointer;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: .85rem;
  font-weight: 700;
  color: #5a6b85;
}
.mode-pill input { display: none; }
.mode-pill input:checked + span {
  background: #0033CC;
  color: #fff;
  display: inline-block;
  padding: 6px 12px;
  border-radius: 999px;
}
.mode-pill label span {
  display: inline-block;
  padding: 6px 12px;
  border-radius: 999px;
}

/* Keep legacy class hooks inert — style is inline now */
.hero-slide__overlay.is-gradient-left,
.hero-slide__overlay.is-gradient-center,
.hero-slide__overlay.is-dark,
.hero-slide__overlay.is-soft,
.hero-slide__overlay.is-none {
  /* no-op when style attr present */
}
