/*
 * Hawaii Guide editorial mastheads
 * Opt-in through _data/editorial_heroes.yml. The shared structure stays
 * recognizable while guide, place, and story variants carry distinct tone.
 */

body.hg-editorial-hero-page {
  --hg-editorial-accent: #f2b544;
  --hg-editorial-scrim: rgba(3, 31, 27, 0.94);
  --hg-editorial-scrim-soft: rgba(3, 31, 27, 0.38);
}

body.hg-editorial-hero--place {
  --hg-editorial-accent: #73c9dc;
  --hg-editorial-scrim: rgba(5, 37, 50, 0.94);
  --hg-editorial-scrim-soft: rgba(5, 37, 50, 0.34);
}

body.hg-editorial-hero--story {
  --hg-editorial-accent: #f28b66;
  --hg-editorial-scrim: rgba(40, 25, 21, 0.95);
  --hg-editorial-scrim-soft: rgba(40, 25, 21, 0.35);
}

body.hg-editorial-hero-page .hero-top,
body.hg-editorial-hero-page .single-slide-top,
body.hg-editorial-hero-page .bg-image-top {
  height: clamp(560px, 53vw, 760px);
  min-height: 0;
}

body.hg-editorial-hero-page .image-container-main,
body.hg-editorial-hero-page .video-container.main-image {
  height: clamp(560px, 53vw, 760px);
  min-height: 0;
  aspect-ratio: auto;
  overflow: hidden;
  isolation: isolate;
}

body.hg-editorial-hero-page .image-container-main .hero-img,
body.hg-editorial-hero-page .image-container-main .hero-video,
body.hg-editorial-hero-page .video-container.main-image > video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

body.hg-editorial-hero-page .image-container-main.has-overlay-title::after,
body.hg-editorial-hero-page .image-container-main::after,
body.hg-editorial-hero-page .video-container.main-image::after {
  content: "";
  position: absolute;
  inset: 0 !important;
  height: 100% !important;
  z-index: 2;
  pointer-events: none;
  background:
    linear-gradient(90deg, var(--hg-editorial-scrim) 0%, var(--hg-editorial-scrim-soft) 48%, rgba(0, 0, 0, 0.03) 78%),
    linear-gradient(0deg, rgba(0, 0, 0, 0.58) 0%, transparent 42%) !important;
}

body.hg-editorial-hero-page.hg-editorial-hero--align-right .image-container-main::after,
body.hg-editorial-hero-page.hg-editorial-hero--align-right .video-container.main-image::after {
  background:
    linear-gradient(270deg, var(--hg-editorial-scrim) 0%, var(--hg-editorial-scrim-soft) 48%, rgba(0, 0, 0, 0.03) 78%),
    linear-gradient(0deg, rgba(0, 0, 0, 0.58) 0%, transparent 42%) !important;
}

body.hg-editorial-hero-page .hero-title-overlay-box.hg-editorial-masthead {
  position: absolute;
  left: 8%;
  right: auto;
  bottom: 88px;
  z-index: 5;
  width: min(720px, 76vw);
  max-width: 76vw;
  padding: 4px 0 4px 28px !important;
  border: 0 !important;
  border-left: 4px solid var(--hg-editorial-accent) !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  pointer-events: auto;
  text-align: left;
}

body.hg-editorial-hero-page .hero-title-overlay-box.hg-editorial-masthead--right,
body.hg-editorial-hero--align-right .hero-title-overlay-box.hg-editorial-masthead {
  left: auto;
  right: 8%;
}

body.hg-editorial-hero-page .hg-editorial-kicker {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 0 0 10px;
  color: var(--hg-editorial-accent);
  font-family: 'Proxima', Helvetica, Arial, sans-serif;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.12em;
  line-height: 1.2;
  text-transform: uppercase;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.55);
}

body.hg-editorial-hero-page .hg-editorial-kicker::before {
  content: "";
  display: block;
  width: 28px;
  height: 2px;
  flex: 0 0 28px;
  background: currentColor;
}

body.hg-editorial-hero-page .hero-title-overlay-box .hero-overlay-title {
  margin: 0 0 10px;
  max-width: 720px;
  color: #fff;
  font-family: 'brother-1816-printed', 'Proxima', Helvetica, Arial, sans-serif !important;
  font-size: clamp(42px, 5.2vw, 68px) !important;
  font-weight: 700;
  letter-spacing: -0.018em;
  line-height: 0.98;
  text-wrap: balance;
  text-shadow: 0 3px 18px rgba(0, 0, 0, 0.58);
}

body.hg-editorial-hero--story .hero-title-overlay-box .hero-overlay-title {
  font-size: clamp(40px, 4.8vw, 62px) !important;
}

body.hg-editorial-hero-page .hero-title-overlay-box .hero-overlay-subtitle {
  margin: 0 0 18px;
  max-width: 640px;
  color: rgba(255, 255, 255, 0.91);
  font-family: 'Proxima', Helvetica, Arial, sans-serif;
  font-size: clamp(16px, 1.8vw, 21px);
  font-weight: 600;
  line-height: 1.35;
  text-wrap: balance;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.58);
}

body.hg-editorial-hero-page .hg-editorial-byline {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 16px;
  min-width: 0;
}

body.hg-editorial-hero-page .hg-editorial-avatars {
  display: inline-flex;
  flex: 0 0 auto;
  padding-left: 0;
}

body.hg-editorial-hero-page .hg-editorial-avatars img {
  display: block;
  width: 38px !important;
  height: 38px !important;
  margin: 0 0 0 -8px;
  border: 2px solid rgba(255, 255, 255, 0.86) !important;
  border-radius: 50% !important;
  object-fit: cover;
  background: #fff;
}

body.hg-editorial-hero-page .hg-editorial-avatars img:first-child {
  margin-left: 0;
}

body.hg-editorial-hero-page .hg-editorial-byline-copy {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 3px 10px;
  min-width: 0;
  color: rgba(255, 255, 255, 0.9);
  font-family: 'Proxima', Helvetica, Arial, sans-serif;
  font-size: 14px;
  line-height: 1.3;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.62);
}

body.hg-editorial-hero-page .hg-editorial-author-line,
body.hg-editorial-hero-page .hg-editorial-date-line {
  white-space: nowrap;
}

body.hg-editorial-hero-page .hg-editorial-date-line::before {
  content: "•";
  margin-right: 10px;
  color: var(--hg-editorial-accent);
}

body.hg-editorial-hero-page .hg-editorial-byline a {
  color: #fff;
  border-bottom: 1px dotted rgba(255, 255, 255, 0.65);
  text-decoration: none;
}

body.hg-editorial-hero-page .hg-editorial-byline a:hover,
body.hg-editorial-hero-page .hg-editorial-byline a:focus-visible {
  color: var(--hg-editorial-accent);
}

/* The masthead owns the screen title and byline. Remove legacy duplicates from
   both the visual and accessibility trees while preserving print styles. */
@media screen {
  body.hg-editorial-hero-page .article-header.clearfix,
  body.hg-editorial-hero-page .article-content .firstpar > h1.entry-title:first-child {
    display: none !important;
  }
}

/* Keep photo attribution clear of the masthead and the mobile wave. */
body.hg-editorial-hero-page .hero-photo-credit {
  top: 18px;
  bottom: auto;
}

/* The legacy island-map script positions its badge at the bottom of the hero.
   Editorial mastheads also occupy that zone, so move the badge into a stable
   upper corner instead of letting it cover the subtitle or byline. */
body.hg-editorial-hero-page #hawaii-top .island-map-badge {
  top: 14px !important;
  right: 14px !important;
  bottom: auto !important;
  left: auto !important;
}

/* Desktop navigation overlays the hero instead of taking up its own row. */
@media (min-width: 1024px) {
  body.hg-editorial-hero-page #hawaii-top .island-map-badge {
    top: 100px !important;
    right: 22px !important;
  }
}

@media (max-width: 1023px) {
  body.hg-editorial-hero-page .hero-top,
  body.hg-editorial-hero-page .single-slide-top,
  body.hg-editorial-hero-page .bg-image-top {
    height: 430px;
    min-height: 0;
  }

  body.hg-editorial-hero-page .image-container-main,
  body.hg-editorial-hero-page .video-container.main-image {
    height: 430px;
    min-height: 0;
  }

  body.hg-editorial-hero-page .image-container-main.has-overlay-title::after,
  body.hg-editorial-hero-page .image-container-main::after,
  body.hg-editorial-hero-page .video-container.main-image::after,
  body.hg-editorial-hero-page.hg-editorial-hero--align-right .image-container-main::after,
  body.hg-editorial-hero-page.hg-editorial-hero--align-right .video-container.main-image::after {
    background:
      linear-gradient(0deg, var(--hg-editorial-scrim) 0%, var(--hg-editorial-scrim-soft) 56%, rgba(0, 0, 0, 0.02) 86%) !important;
  }

  body.hg-editorial-hero-page .hero-title-overlay-box.hg-editorial-masthead,
  body.hg-editorial-hero-page .hero-title-overlay-box.hg-editorial-masthead--right,
  body.hg-editorial-hero--align-right .hero-title-overlay-box.hg-editorial-masthead {
    left: 20px;
    right: 20px;
    bottom: 54px;
    width: auto;
    max-width: none;
    padding: 3px 0 3px 18px !important;
  }

  body.hg-editorial-hero-page .hero-title-overlay-box .hero-overlay-title,
  body.hg-editorial-hero--story .hero-title-overlay-box .hero-overlay-title {
    max-width: 100%;
    font-size: clamp(29px, 8.2vw, 42px) !important;
    line-height: 1.02;
  }

  body.hg-editorial-hero-page .hero-title-overlay-box .hero-overlay-subtitle {
    margin-bottom: 12px;
    max-width: 92%;
    font-size: 15px;
    line-height: 1.3;
  }

  body.hg-editorial-hero-page .hero-photo-credit {
    top: 12px;
    bottom: auto;
  }
}

/* Compact in-app browsers and split-screen tablets can be phone-width without
   having a full phone-height viewport. Let the masthead stay complete without
   letting the hero consume the entire embedded window. */
@media (max-width: 641px) {
  /* On phones the vertical masthead rule already supplies the decorative
     structure. Give the kicker, headline, and subtitle one shared text edge,
     then stack the author metadata into a clean column beside the avatar. */
  body.hg-editorial-hero-page .hg-editorial-kicker {
    display: block;
    width: fit-content;
  }

  body.hg-editorial-hero-page .hg-editorial-kicker::before {
    display: none;
  }

  body.hg-editorial-hero-page .hg-editorial-byline-copy {
    flex-flow: column nowrap;
    align-items: flex-start;
    gap: 1px;
  }

  body.hg-editorial-hero-page .hero-title-overlay-box.hg-editorial-masthead,
  body.hg-editorial-hero-page .hero-title-overlay-box.hg-editorial-masthead--right,
  body.hg-editorial-hero--align-right .hero-title-overlay-box.hg-editorial-masthead {
    padding: 12px 32px 12px 18px !important;
    background: linear-gradient(90deg, rgba(2, 22, 20, 0.84) 0%, rgba(2, 22, 20, 0.68) 66%, rgba(2, 22, 20, 0.16) 100%) !important;
  }

  body.hg-editorial-hero-page .hg-editorial-date-line::before {
    content: none;
    margin-right: 0;
  }

  body.hg-editorial-hero-page .hero-top,
  body.hg-editorial-hero-page .single-slide-top,
  body.hg-editorial-hero-page .bg-image-top,
  body.hg-editorial-hero-page .image-container-main,
  body.hg-editorial-hero-page .video-container.main-image {
    height: 430px;
    height: clamp(390px, 58svh, 430px);
  }

  body.hg-editorial-hero-page .hero-title-overlay-box .hero-overlay-title,
  body.hg-editorial-hero--story .hero-title-overlay-box .hero-overlay-title {
    font-size: clamp(30px, 7.6vw, 38px) !important;
  }

  body.hg-editorial-hero-page #hawaii-top .island-map-badge {
    top: 10px !important;
    right: 10px !important;
  }
}

@media (max-width: 380px) {
  body.hg-editorial-hero-page .hero-top,
  body.hg-editorial-hero-page .single-slide-top,
  body.hg-editorial-hero-page .bg-image-top {
    height: 450px;
    min-height: 0;
  }

  body.hg-editorial-hero-page .image-container-main,
  body.hg-editorial-hero-page .video-container.main-image {
    height: 450px;
    min-height: 0;
  }

  body.hg-editorial-hero-page .hero-title-overlay-box.hg-editorial-masthead,
  body.hg-editorial-hero-page .hero-title-overlay-box.hg-editorial-masthead--right,
  body.hg-editorial-hero--align-right .hero-title-overlay-box.hg-editorial-masthead {
    left: 16px;
    right: 16px;
    bottom: 48px;
    padding: 12px 24px 12px 15px !important;
  }

  body.hg-editorial-hero-page .hero-title-overlay-box .hero-overlay-title,
  body.hg-editorial-hero--story .hero-title-overlay-box .hero-overlay-title {
    font-size: clamp(27px, 8.7vw, 34px) !important;
  }

  body.hg-editorial-hero-page .hg-editorial-kicker {
    margin-bottom: 8px;
    font-size: 11px;
  }

  body.hg-editorial-hero-page .hg-editorial-byline {
    gap: 9px;
    margin-top: 12px;
  }

  body.hg-editorial-hero-page .hg-editorial-avatars img {
    width: 34px !important;
    height: 34px !important;
  }

  body.hg-editorial-hero-page .hg-editorial-byline-copy {
    gap: 1px 8px;
    font-size: 12px;
  }

  body.hg-editorial-hero-page .hg-editorial-date-line::before {
    margin-right: 8px;
  }
}

@media (prefers-reduced-motion: reduce) {
  body.hg-editorial-hero-page .image-container-main .hero-video,
  body.hg-editorial-hero-page .video-container.main-image > video {
    display: none;
  }
}

@media print {
  body.hg-editorial-hero-page .hg-editorial-kicker,
  body.hg-editorial-hero-page .hg-editorial-byline {
    display: none !important;
  }
}
