/* Heaven's Gate Funeral Home
 *
 * Base rules are the <helmet> block from the source design, verbatim.
 * Below them, the design's per-element `style-hover` attributes are expressed as
 * classes. Because the elements they apply to carry inline styles, each hover
 * declaration needs `!important` to win the cascade — that is what reproduces the
 * design's hover behaviour, not a shortcut.
 */

/* ------------------------------------------------- base (from <helmet>) */

* { box-sizing: border-box; }
body { margin: 0; background: #faf9f6; -webkit-font-smoothing: antialiased; }

/* The nav dropdown panels are `min-width: 232px`, absolutely positioned at the left
 * edge of their menu item. On a phone the right-hand menus start past the halfway
 * mark, so those panels stick out ~100px beyond the viewport and the page scrolls
 * sideways — even while the panels are hidden, because `visibility: hidden` still
 * takes up layout. `clip` removes the sideways scroll without creating a scroll
 * container, so the sticky header keeps working (`hidden` would break it). */
html { overflow-x: clip; }
section[id], footer[id] { scroll-margin-top: 96px; }
a { color: #0f7a68; text-decoration: none; }
a:hover { color: #0a5a4d; }
@keyframes cwFloat { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-7px); } }
@keyframes cwDot { 0%, 80%, 100% { opacity: .25; } 40% { opacity: 1; } }

/* ------------------------------------------------------ editorial scale */
/* The original comp used large display type at every turn. Funeral care needs
 * warmth and clarity, so display type is reserved for the page thesis and held
 * to a calmer scale everywhere else. Inline values come from the generated
 * templates, therefore these intentional adjustments use !important. */

#app h1 {
  font-size: clamp(36px, 3.8vw, 48px) !important;
  line-height: 1.1 !important;
  letter-spacing: -.015em;
}

#app h2[style*="font-size: 42px"],
#app h2[style*="font-size: 40px"] { font-size: 34px !important; }

#app h2[style*="font-size: 38px"] { font-size: 32px !important; }
#app h2[style*="font-size: 34px"] { font-size: 30px !important; }

#app[data-page="services"] [id="top"] > div {
  min-height: 430px !important;
}

#app[data-page="services"] [id="top"] h1 { max-width: 13.5ch !important; }
#app[data-page="services"] [id="top"] p { font-size: 20px !important; }

#app[data-page="about"] [id="top"] h1 { max-width: 15ch !important; }
#app[data-page="privacy"] [id="top"] h1 { max-width: 18ch !important; }

/* ------------------------------------------- hover states (`style-hover`) */

.hg-menu-item:hover { background: #f6f4ef !important; color: #0f7a68 !important; }
.hg-ghost-teal:hover { background: #dff6f1 !important; }
.hg-solid-teal:hover { background: #3bb49c !important; }
.hg-outline-dark:hover { border-color: #5ec9b4 !important; }
.hg-outline-light:hover { border-color: #5ec9b4 !important; }
.hg-nav-toggle {
  display: none;
  width: 46px;
  height: 42px;
  padding: 9px 10px;
  border: 1px solid #d9d4c9;
  background: #ffffff;
  color: #0f7a68;
  cursor: pointer;
}

.hg-nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  margin: 4px auto;
  background: currentColor;
  transition: transform 160ms ease, opacity 160ms ease;
}

.hg-nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.hg-nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.hg-nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }
.hg-service-card:hover { background: #f6f4ef !important; }
.hg-service-icon-shell {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  color: #0f7a68;
  background: #eff9f6;
  border: 1px solid #bfe8df;
  border-radius: 50%;
  box-shadow: inset 0 0 0 4px rgba(255, 255, 255, .56);
}
.hg-service-icon { display: block; width: 27px; height: 27px; }
.hg-service-card:hover .hg-service-icon-shell { background: #dff6f1; }
.hg-footer-link:hover { color: #0f7a68 !important; }
.hg-form-honeypot { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }

/* ------------------------------------------------------- language prompt */

.hg-language-modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  place-items: center;
  padding: 20px;
}

.hg-language-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(45, 40, 34, .48);
  backdrop-filter: blur(3px);
}

.hg-language-card {
  position: relative;
  width: min(100%, 450px);
  background: #faf9f6;
  border: 1px solid #e6e2d9;
  box-shadow: 0 24px 70px rgba(38, 33, 27, .2);
  padding: 38px 38px 30px;
  text-align: center;
}

.hg-language-kicker {
  color: #0f7a68;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .16em;
  margin: 0;
  text-transform: uppercase;
}

.hg-language-card h2 {
  color: #473f35;
  font-family: 'Newsreader', Georgia, serif;
  font-size: 34px;
  font-weight: 500;
  line-height: 1.12;
  margin: 14px 0 0;
}

.hg-language-card h2 span { color: #6b6459; font-size: .76em; }

.hg-language-copy {
  color: #6b6459;
  font-size: 16px;
  line-height: 1.55;
  margin: 18px auto 0;
  max-width: 34ch;
}

.hg-language-choices {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 26px;
}

.hg-language-choices button {
  border: 1.5px solid #5ec9b4;
  background: #5ec9b4;
  color: #08302a;
  cursor: pointer;
  font: 700 15px/1.2 inherit;
  min-height: 52px;
  padding: 14px 12px;
}

.hg-language-choices button + button {
  background: #ffffff;
  color: #3d372f;
}

.hg-language-choices button:hover { background: #3bb49c; }
.hg-language-choices button + button:hover { background: #dff6f1; }

.hg-language-later {
  background: none;
  border: 0;
  color: #7c7466;
  cursor: pointer;
  font: 600 13px/1.3 inherit;
  margin-top: 22px;
  padding: 6px 10px;
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* -------------------------------------------------------------- home hero */

.hg-home-hero-photo {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(90deg, rgba(250, 249, 246, .3), rgba(250, 249, 246, .04) 58%, rgba(61, 55, 47, .06)),
    url('/assets/images/home-hero-vietnamese-family.png');
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
}

/* ----------------------------------------------------------- about page */

.hg-team-portrait {
  min-height: 350px;
  display: grid;
  place-items: end center;
  padding: 28px;
  background:
    linear-gradient(135deg, rgba(223, 246, 241, .86), rgba(234, 230, 218, .92)),
    repeating-linear-gradient(135deg, #dceae4 0 14px, #e6f0eb 14px 28px);
}

.hg-team-portrait span {
  max-width: 24ch;
  padding-top: 14px;
  border-top: 1px solid rgba(71, 63, 53, .28);
  color: #55736a;
  font-family: ui-monospace, Menlo, monospace;
  font-size: 11px;
  letter-spacing: .11em;
  line-height: 1.45;
  text-align: center;
  text-transform: uppercase;
}

.hg-team-grid {
  width: 100%;
}

.hg-team-card {
  width: 100%;
  max-width: 446px;
  justify-self: center;
}

.hg-team-photo {
  display: block;
  width: 100%;
  height: clamp(300px, 28vw, 360px);
  object-fit: cover;
  object-position: center 20%;
  background: #d9d4c9;
}

.hg-home-about-photo {
  display: block;
  width: 100%;
  min-height: 300px;
  height: 100%;
  object-fit: cover;
  object-position: center 18%;
  background: #d9d4c9;
}

.hg-services-photo {
  background-color: #d9d4c9;
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
}

.hg-services-photo--hero {
  min-height: 510px;
  background-image: url('/assets/images/services-reception.png');
}

.hg-services-photo--support {
  min-height: 400px;
  background-image: url('/assets/images/services-coordination.png');
  background-position: center 34%;
}

/* ---------------------------------------------------------- privacy policy */

.hg-policy-layout {
  display: grid;
  grid-template-columns: minmax(205px, .42fr) minmax(0, 1fr);
  gap: clamp(42px, 7vw, 86px);
  align-items: start;
}

.hg-policy-contact {
  position: sticky;
  top: 112px;
  display: grid;
  gap: 12px;
  padding: 24px 0 25px 22px;
  border-left: 2px solid #5ec9b4;
}

.hg-policy-contact > span,
.hg-policy-effective {
  color: #0f7a68;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .15em;
  line-height: 1.35;
  margin: 0;
  text-transform: uppercase;
}

.hg-policy-contact h2 {
  color: #473f35;
  font-family: 'Newsreader', Georgia, serif;
  font-size: 27px;
  font-weight: 500;
  line-height: 1.12;
  margin: 0;
}

.hg-policy-contact p {
  color: #6b6459;
  font-size: 15px;
  line-height: 1.6;
  margin: 0;
}

.hg-policy-contact a {
  color: #3d372f;
  font-size: 15px;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.hg-policy-effective { margin: 0 0 28px; color: #7c7466; }
.hg-policy-sections { border-top: 1px solid #d9d4c9; }

.hg-policy-section {
  border-bottom: 1px solid #d9d4c9;
  padding: 28px 0 30px;
}

.hg-policy-section h2 {
  color: #473f35;
  font-family: 'Newsreader', Georgia, serif;
  font-size: 28px;
  font-weight: 500;
  line-height: 1.2;
  margin: 0;
}

.hg-policy-section p {
  color: #4a4339;
  font-size: 16px;
  line-height: 1.72;
  margin: 12px 0 0;
  text-wrap: pretty;
}

.hg-policy-note {
  background: #eff9f6;
  border-left: 2px solid #5ec9b4;
  margin-top: 34px;
  padding: 20px 22px;
}

.hg-policy-note p {
  color: #3d372f;
  font-size: 15px;
  line-height: 1.65;
  margin: 0;
}

/* ------------------------------------------------------------- keyboard */
/* Focus rings are invisible until a keyboard is used, so they leave the
 * design untouched while keeping the page operable without a mouse. */

.hg-skip-link {
  position: fixed;
  top: 10px;
  left: 10px;
  z-index: 200;
  transform: translateY(-180%);
  background: #08302a;
  color: #ffffff;
  padding: 12px 16px;
  font-size: 15px;
  font-weight: 700;
  box-shadow: 0 5px 18px rgba(8, 48, 42, .25);
}

.hg-skip-link:focus { transform: translateY(0); color: #ffffff; }
:focus-visible { outline: 3px solid #0f7a68; outline-offset: 3px; }
button:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible { outline-color: #08302a; }

@media (max-width: 820px) {
  .hg-topbar {
    padding-left: 20px !important;
    padding-right: 20px !important;
  }

  .hg-topbar > span { width: 100%; }
  .hg-topbar > div { gap: 12px !important; }

  .hg-site-header {
    gap: 12px !important;
    padding: 12px 20px !important;
  }

  .hg-header-main { gap: 14px !important; width: 100%; }
  .hg-brand-mark { width: 36px; height: 36px; }
  .hg-brand-copy > span:first-child { font-size: 22px !important; }
  html.hg-js .hg-nav-toggle { display: block; margin-left: auto; }
  html.hg-js .hg-main-nav { display: none !important; width: 100%; flex-basis: 100%; gap: 0 !important; font-size: 14px !important; margin-top: 8px; }
  html.hg-js .hg-main-nav[data-open="true"] { display: flex !important; }
  .hg-main-nav [data-menu-label] { padding: 7px 8px !important; }
  .hg-header-actions { width: 100%; }
  .hg-header-actions a { flex: 1 1 180px; text-align: center; }

  .hg-policy-layout { grid-template-columns: 1fr; gap: 36px; }
  .hg-policy-contact { position: static; max-width: 510px; }
  .hg-licensing-grid { grid-template-columns: 1fr !important; gap: 28px !important; }

  #app h1 { font-size: clamp(34px, 8.2vw, 42px) !important; }

  #app > main > section:not(#top),
  #app > section:not(#top) {
    padding-left: 20px !important;
    padding-right: 20px !important;
  }

  [id="top"] > div:not(.hg-home-hero-photo) {
    padding-left: 20px !important;
    padding-right: 20px !important;
  }

  [id="top"] > div[style*="grid-template-columns: minmax(0, 1fr)"] {
    grid-template-columns: 1fr !important;
  }

  #app[data-page="services"] [id="top"] > div > div:first-child {
    padding: 54px 20px !important;
  }

  .hg-home-hero-photo {
    position: relative;
    width: 100%;
    min-width: 0;
    min-height: 280px;
    background-position: 74% center;
  }

  .hg-team-portrait { min-height: 285px; }
  .hg-services-photo--hero { min-height: 320px; }
  .hg-services-photo--support { min-height: 280px; }

  [id="top"] > div[style*="grid-template-columns: minmax(0, 1.25fr)"] {
    grid-template-columns: 1fr !important;
    gap: 30px !important;
    padding-top: 62px !important;
    padding-bottom: 66px !important;
  }

  [id="our-story"] > div,
  [id="our-values"] > div > div {
    grid-template-columns: 1fr !important;
  }

  [id="our-team"] > div > div[style*="grid-template-columns: repeat(2"] {
    grid-template-columns: 1fr !important;
  }

  .hg-team-card {
    max-width: 420px;
  }

  .hg-team-photo {
    height: 320px;
  }

  [id="our-services"] > div,
  [id="our-services"] + section > div {
    grid-template-columns: 1fr !important;
  }
}

@media (max-width: 500px) {
  .hg-topbar { font-size: 12px !important; }
  .hg-topbar > div { align-items: flex-start !important; flex-direction: column; }
  .hg-site-header { padding: 11px 16px !important; }
  .hg-header-main { display: block !important; }
  .hg-header-main { display: flex !important; align-items: center; }
  .hg-main-nav { margin-top: 10px; }
  .hg-main-nav [data-menu-label] { padding: 7px 7px !important; }
  .hg-header-actions { gap: 8px !important; }
  .hg-header-actions a { flex-basis: 0; padding: 11px 8px !important; font-size: 12px !important; }
  #app[data-page="home"] [id="top"] > div:not(.hg-home-hero-photo) > div {
    padding: 30px 22px !important;
  }
  .hg-policy-contact { padding-left: 18px; }
  .hg-policy-section h2 { font-size: 26px; }
  .hg-policy-section p { font-size: 16px; }
  .hg-language-card { padding: 30px 22px 24px; }
  .hg-language-card h2 { font-size: 31px; }
}

/* --------------------------------------------------------------- motion */

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}
