/**
 * Homepage hotfix — E-Service + Quick links sidebar.
 * Scoped to .nh-home and .nh-hotfix. Load only on site homepage. Safe rollback: remove link in layout.
 */

/* Design tokens (hotfix only) */
.nh-home.nh-hotfix,
.nh-home .nh-hotfix {
  --radius: 14px;
  --shadow: 0 6px 18px rgba(0, 0, 0, 0.08);
  --border: 1px solid rgba(0, 0, 0, 0.08);
  --bg-surface: rgba(255, 255, 255, 0.7);
  --text: #1f2a1f;
  --muted: rgba(0, 0, 0, 0.6);
  --accent-green: #2d5a3d;
  --accent-yellow: #c9a227;
  --accent-yellow-soft: #f5ecd8;
}

.nh-home .nh-hotfix-container {
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--nh-inner-inline);
  padding-right: var(--nh-inner-inline);
}

@media (min-width: 768px) {
  .nh-home .nh-hotfix-container {
    padding-left: var(--nh-inner-inline);
    padding-right: var(--nh-inner-inline);
  }
}

/* Shared card */
.nh-home .nh-hotfix-card {
  background: #fff;
  border: var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.nh-home .nh-hotfix-card:focus-visible {
  outline: 2px solid var(--accent-green);
  outline-offset: 2px;
}

/* Buttons */
.nh-home .nh-hotfix-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 18px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
  cursor: pointer;
  border: none;
  transition: filter 0.2s ease, box-shadow 0.2s ease;
}

.nh-home .nh-hotfix-btn:focus-visible {
  outline: 2px solid var(--accent-green);
  outline-offset: 2px;
}

.nh-home .nh-hotfix-btn--primary {
  background: var(--accent-green);
  color: #fff;
  box-shadow: 0 2px 8px rgba(45, 90, 61, 0.3);
}

.nh-home .nh-hotfix-btn--primary:hover {
  filter: brightness(1.08);
}

.nh-home .nh-hotfix-btn--secondary {
  background: var(--accent-yellow-soft);
  color: var(--text);
  border: var(--border);
}

.nh-home .nh-hotfix-btn--secondary:hover {
  box-shadow: var(--shadow);
}

/* ========== E-Service hotfix — feature panel ========== */
.nh-home .nh-eservice-hotfix {
  padding-top: 24px;
  padding-bottom: 24px;
}

.nh-home .nh-eservice-feature.nh-eservice-panel {
  background: var(--bg-surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 28px;
  border: var(--border);
  position: relative;
  overflow: hidden;
}

.nh-home .nh-eservice-feature.nh-eservice-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='80' height='80' viewBox='0 0 24 24' fill='none' stroke='%232d5a3d' stroke-opacity='0.06' stroke-width='1'%3E%3Cpath d='M12 2L2 7l10 5 10-5-10-5z'/%3E%3Cpath d='M2 17l10 5 10-5'/%3E%3C/svg%3E");
  background-repeat: repeat;
  pointer-events: none;
  z-index: 0;
}

.nh-home .nh-eservice-hotfix__header,
.nh-home .nh-eservice-hotfix__grid {
  position: relative;
  z-index: 1;
}

.nh-home .nh-eservice-hotfix__header {
  margin-bottom: 22px;
}

.nh-home .nh-eservice-hotfix__title {
  display: inline-block;
  margin: 0;
  padding: 10px 22px;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text);
  background: linear-gradient(135deg, #fef9c3 0%, #fef08a 100%);
  border-radius: 9999px;
  border: var(--border);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.nh-home .nh-eservice-hotfix__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
  align-items: stretch;
}

@media (min-width: 769px) {
  .nh-home .nh-eservice-hotfix__grid {
    grid-template-columns: 1fr 1.25fr 1fr;
  }
}

.nh-home .nh-eservice-card {
  background: #fff;
  border: var(--border);
  border-radius: var(--radius);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.06);
  padding: 20px;
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.nh-home .nh-eservice-card--main {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.98) 0%, rgba(240, 253, 244, 0.5) 100%);
  border-color: rgba(45, 90, 61, 0.2);
}

.nh-home .nh-eservice-card__heading {
  margin: 0 0 8px;
  font-size: 1.12rem;
  font-weight: 700;
  color: var(--text);
}

.nh-home .nh-eservice-card__sub {
  margin: 0 0 16px;
  font-size: 0.9rem;
  color: var(--muted);
  line-height: 1.4;
}

.nh-home .nh-eservice-card__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.nh-home .nh-eservice-qr-link {
  display: block;
  margin-top: 10px;
}

.nh-home .nh-eservice-qr-img {
  max-width: 140px;
  height: auto;
  display: block;
  border-radius: 10px;
}

.nh-home .nh-eservice-qr-placeholder {
  min-height: 120px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background: rgba(0, 0, 0, 0.04);
  border-radius: 10px;
  padding: 16px;
  margin-top: 10px;
}

.nh-home .nh-eservice-qr-placeholder__text {
  font-size: 0.9rem;
  color: var(--muted);
}

.nh-home .nh-eservice-shortcuts__heading {
  margin: 0 0 12px;
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
}

.nh-home .nh-eservice-shortcuts {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.nh-home .nh-eservice-shortcut {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 88px;
  padding: 14px 10px;
  text-align: center;
  font-weight: 600;
  font-size: 0.88rem;
  color: var(--text);
  text-decoration: none;
  background: #fff;
  border: var(--border);
  border-radius: var(--radius);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.nh-home .nh-eservice-shortcut:focus-visible {
  outline: 2px solid var(--accent-green);
  outline-offset: 2px;
}

.nh-home .nh-eservice-shortcut__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 8px;
  color: var(--accent-green);
}

.nh-home .nh-eservice-shortcut__icon svg {
  width: 28px;
  height: 28px;
}

.nh-home .nh-eservice-shortcut__label {
  line-height: 1.3;
}

@media (hover: hover) {
  .nh-home .nh-eservice-shortcut:hover,
  .nh-home .nh-eservice-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
  }
}

@media (max-width: 768px) {
  .nh-home .nh-eservice-hotfix__grid {
    grid-template-columns: 1fr;
  }
  .nh-home .nh-eservice-feature.nh-eservice-panel {
    padding: 18px;
  }
}

/* ========== EMERGENCY: Mobile containment — prevent huge phone/SVG and vertical spacing ========== */
/* Root cause: SVG/imagery in E-Service hotfix can expand on mobile (e.g. flex/grid or global svg rules). */

/* 1) All img/svg inside hotfix section cannot exceed container */
.nh-hotfix.nh-eservice-hotfix img,
.nh-home .nh-hotfix.nh-eservice-hotfix img {
  max-width: 100%;
  height: auto;
  display: block;
}

.nh-hotfix.nh-eservice-hotfix svg,
.nh-home .nh-hotfix.nh-eservice-hotfix svg {
  max-width: 100%;
  height: auto;
  display: block;
}

/* 2) Phone graphic wrapper (shortcut icon + shortcuts column): hard max size on mobile */
.nh-home .nh-eservice-shortcut__icon {
  flex-shrink: 0;
  max-width: 48px;
  max-height: 48px;
}

.nh-home .nh-eservice-shortcut__icon svg {
  width: 28px !important;
  height: 28px !important;
  max-width: 28px !important;
  max-height: 28px !important;
}

@media (max-width: 768px) {
  .nh-home .nh-eservice-hotfix .nh-eservice-shortcuts {
    max-width: 360px;
    margin-left: auto;
    margin-right: auto;
    overflow: hidden;
  }

  .nh-home .nh-eservice-hotfix .nh-eservice-hotfix__col--shortcuts {
    max-width: 360px;
    margin-left: auto;
    margin-right: auto;
    overflow: hidden;
  }

  /* Section: no excessive vertical space on mobile */
  .nh-home .nh-eservice-hotfix {
    padding-top: 20px;
    padding-bottom: 20px;
  }

  .nh-home .nh-eservice-feature.nh-eservice-panel {
    padding: 16px;
    min-height: 0;
  }

  /* QR/line image containment in LINE card */
  .nh-home .nh-eservice-qr-link {
    max-width: 200px;
    margin-left: auto;
    margin-right: auto;
    overflow: hidden;
  }

  .nh-home .nh-eservice-qr-img {
    max-width: 100%;
    height: auto;
    display: block;
  }
}

/* Banner + LINE QR layout (replacement content) */
.nh-home .nh-eservice-bannerLine {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
  gap: 20px;
  align-items: stretch;
}

@media (max-width: 1024px) {
  .nh-home .nh-eservice-bannerLine {
    grid-template-columns: 1fr;
  }
}

.nh-home .nh-eservice-bannerCard,
.nh-home .nh-eservice-qrCard {
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: var(--border);
}

.nh-home .nh-eservice-bannerCard {
  padding: 0;
}

.nh-home .nh-eservice-bannerWrap {
  position: relative;
  width: 100%;
  overflow: hidden;
  border-radius: var(--radius);
}

.nh-home .nh-eservice-bannerImg {
  display: block;
  width: 100%;
  height: auto;
  object-fit: cover;
}

.nh-home .nh-eservice-bannerPlaceholder {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 180px;
  padding: 20px;
  text-align: center;
  background: linear-gradient(135deg, #e8f5e9 0%, #d1fae5 100%);
}

.nh-home .nh-eservice-bannerPlaceholder__text {
  font-size: 0.95rem;
  color: var(--muted);
}

.nh-home .nh-eservice-qrCard {
  padding: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 12px;
}

.nh-home .nh-eservice-qrHeader {
  width: 100%;
}

.nh-home .nh-eservice-qrLabel {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text);
}

.nh-home .nh-eservice-qrHandle {
  margin: 2px 0 0;
  font-size: 0.85rem;
  color: var(--muted);
}

.nh-home .nh-eservice-qrBox {
  width: 100%;
  max-width: 220px;
  aspect-ratio: 1 / 1;
  border-radius: 16px;
  overflow: hidden;
  background: #f1f5f9;
  display: flex;
  align-items: center;
  justify-content: center;
}

.nh-home .nh-eservice-qrBoxImg {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.nh-home .nh-eservice-qrBox--placeholder {
  border: 1px dashed rgba(148, 163, 184, 0.7);
}

/* ========== EMERGENCY: Exec section — phone SVG containment (root cause: .exec-profile__hotline-icon) ========== */
.nh-home .section.exec .exec-profile__hotline-icon {
  flex-shrink: 0;
  width: 24px !important;
  height: 24px !important;
  max-width: 24px !important;
  max-height: 24px !important;
  overflow: hidden;
}

.nh-home .section.exec .exec-profile__hotline-icon svg {
  width: 24px !important;
  height: 24px !important;
  max-width: 24px !important;
  max-height: 24px !important;
  display: block;
}

/* Exec section: all img/svg cannot exceed container on mobile */
.nh-home .section.exec img,
.nh-home .section.exec svg {
  max-width: 100%;
  height: auto;
}

@media (max-width: 768px) {
  .nh-home .section.exec .exec-profile__hotline-icon,
  .nh-home .section.exec .exec-profile__hotline-icon svg {
    width: 22px !important;
    height: 22px !important;
    max-width: 22px !important;
    max-height: 22px !important;
  }

  .nh-home .section.exec .exec__container {
    overflow: hidden;
  }
}


.nh-home .nh-quicklinks-hotfix {
  width: 100%;
}

.nh-home .nh-quicklinks-hotfix__list {
  display: flex;
  flex-direction: column;
  gap: var(--tt-gap, 0.75rem);
}

/* Unify with tt-card: same radius, border, shadow, hover/focus */
.nh-home .nh-ql {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-height: 72px;
  padding: 0.75rem 1rem;
  border-radius: var(--tt-card-radius, 12px);
  border: var(--tt-card-border, 1px solid #e2e8f0);
  box-shadow: var(--tt-card-shadow, 0 1px 3px rgba(0, 0, 0, 0.06));
  text-decoration: none;
  color: inherit;
  position: relative;
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
  overflow: visible;
}

.nh-home .nh-ql:focus-visible {
  outline: 2px solid var(--primary-600);
  outline-offset: 2px;
}

/* Tag pill: same radius and font as tt-sectionPill */
.nh-home .nh-ql-badge {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  font-size: 0.8125rem;
  font-weight: 600;
  line-height: 1.3;
  padding: 0.25rem 0.5rem;
  border-radius: 9999px;
  background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
  color: #334155;
  border: 1px solid rgba(0, 0, 0, 0.06);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
  letter-spacing: 0.02em;
}

.nh-home .nh-ql-icon {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: var(--tt-card-radius, 12px);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
}

.nh-home .nh-ql-icon svg {
  width: 1.25rem;
  height: 1.25rem;
}

.nh-home .nh-ql--blue .nh-ql-icon {
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.4);
}

.nh-home .nh-ql--green .nh-ql-icon {
  background: linear-gradient(135deg, #16a34a 0%, #15803d 100%);
  box-shadow: 0 2px 8px rgba(22, 163, 74, 0.4);
}

.nh-home .nh-ql--sky .nh-ql-icon {
  background: linear-gradient(135deg, #0ea5e9 0%, #0284c7 100%);
  box-shadow: 0 2px 8px rgba(14, 165, 233, 0.4);
}

.nh-home .nh-ql--blue { background: linear-gradient(135deg, rgba(239, 246, 255, 0.95) 0%, rgba(219, 234, 254, 0.9) 100%); }
.nh-home .nh-ql--green { background: linear-gradient(135deg, rgba(240, 253, 244, 0.95) 0%, rgba(220, 252, 231, 0.9) 100%); }
.nh-home .nh-ql--sky { background: linear-gradient(135deg, rgba(224, 242, 254, 0.95) 0%, rgba(186, 230, 253, 0.9) 100%); }

.nh-home .nh-ql-text {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
  padding-right: 0.5rem;
}

.nh-home .nh-ql-title {
  font-size: 0.9375rem;
  font-weight: 600;
  line-height: 1.35;
  display: block;
}

.nh-home .nh-ql-sub {
  font-size: 0.8125rem;
  color: #64748b;
  line-height: 1.3;
}

.nh-home .nh-ql-updating {
  font-size: 0.75rem;
  color: #b45309;
  font-weight: 600;
  margin-top: 0.125rem;
}

@media (hover: hover) {
  .nh-home .nh-ql:hover {
    border-color: #cbd5e1;
    box-shadow: var(--tt-card-shadow-hover, 0 4px 12px rgba(0, 0, 0, 0.08));
  }
}

@media (min-width: 1024px) {
  .nh-home .nh-quicklinks-hotfix {
    width: 300px;
    max-width: 100%;
  }
}

@media (max-width: 768px) {
  .nh-home .nh-quicklinks-hotfix__list {
    display: grid;
    grid-template-columns: 1fr;
  }
}

/* ========== Executive + Video block: vertical cards, clear phone buttons, strong CTAs ========== */
/* Grid is defined in home-tuning.css (.nh-execGrid). Here we only refine card internals. */
.nh-home .nh-execCard.tt-exec-card,
.nh-home .nh-videoCard.tt-exec-card {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.06);
  border: 1px solid rgba(148, 163, 184, 0.5);
  padding: 18px 16px;
}

/* Mayor: slightly more prominent with a green accent border */
.nh-home .nh-execCard--mayor.tt-exec-card {
  border-width: 2px;
  border-color: rgba(15, 91, 58, 0.85);
}

/* Personnel card: portrait on top, text below (vertical layout) */
.nh-home .tt-exec-card--personnel {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.6rem;
  padding: 18px 16px;
}

.nh-home .nh-execCard__photo {
  display: block;
  margin-bottom: 0.5rem;
}

.nh-home .nh-execCard__photo .tt-exec-personnel__photo,
.nh-home .nh-execCard__photo .tt-exec-personnel__photo--placeholder {
  border-radius: 10px;
  display: block;
  margin-left: auto;
  margin-right: auto;
}

.nh-home .nh-execCard__body {
  width: 100%;
}

.nh-home .nh-execCard__body .tt-exec-personnel__name {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 0.15rem;
}

.nh-home .nh-execCard--mayor .tt-exec-personnel__name {
  font-size: 1.1rem;
  font-weight: 800;
}

.nh-home .nh-execCard__body .tt-exec-personnel__role {
  font-size: 0.9rem;
  color: #64748b;
  margin-bottom: 0.4rem;
}

/* Phone button: full-width, strong tel: CTA with icon + number */
.nh-home .nh-execPhoneBtn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  margin-top: 0.5rem;
  padding: 0.45rem 0.75rem;
  border-radius: 9999px;
  background: linear-gradient(135deg, var(--brand-g1, #0f5b3a) 0%, var(--brand-g2, #0a7a4b) 100%);
  color: #fff;
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
  gap: 0.35rem;
  box-shadow: 0 2px 8px rgba(15, 91, 58, 0.35);
}

.nh-home .nh-execPhoneBtn .tt-exec-personnel__hotline-icon {
  display: inline-flex;
}

.nh-home .nh-execPhoneBtn .tt-exec-personnel__hotline-icon svg {
  width: 1rem;
  height: 1rem;
}

@media (hover: hover) {
  .nh-home .nh-execPhoneBtn:hover {
    filter: brightness(1.06);
  }
}

/* Video card: tighten spacing + strong dual CTAs */
.nh-home .nh-videoCard .tt-exec-video__head {
  margin-bottom: 0.75rem;
}

.nh-home .nh-videoCard .tt-exec-video__wrap {
  margin-bottom: 0.75rem;
}

.nh-home .nh-videoCard__ctas {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
}

.nh-home .nh-videoCard__ctas .pill-btn {
  flex: 0 1 auto;
  width: auto;
  max-width: 100%;
  border-radius: 9999px;
  font-weight: 600;
  justify-content: center;
  color: #fff !important;
}

.nh-home .nh-videoCard__ctas a.pill-btn {
  color: #fff !important;
}

@media (max-width: 768px) {
  .nh-home .nh-execCard.tt-exec-card,
  .nh-home .nh-videoCard.tt-exec-card {
    padding: 16px 14px;
  }
  .nh-home .nh-videoCard__ctas {
    flex-direction: column;
  }
}

/* ========== Quick links (image-only buttons) ========== */
.nh-home .nh-quicklinks-hotfix__list--image {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.nh-home .nh-ql-image {
  display: block;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid rgba(148, 163, 184, 0.45);
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.08);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
  background: #fff;
}

.nh-home .nh-ql-image:focus-visible {
  outline: 2px solid var(--primary-600, #0f4c81);
  outline-offset: 2px;
}

.nh-home .nh-ql-image__img {
  width: 100%;
  height: auto;
  display: block;
  vertical-align: middle;
}

.nh-home .nh-ql-image__fallback {
  display: flex;
  min-height: 72px;
  align-items: center;
  justify-content: center;
  padding: 0.75rem;
  text-align: center;
  font-size: 0.9rem;
  font-weight: 600;
  color: #334155;
  background: #f8fafc;
}

@media (hover: hover) {
  .nh-home .nh-ql-image:hover {
    transform: translateY(-2px);
    border-color: rgba(51, 65, 85, 0.28);
    box-shadow: 0 6px 16px rgba(15, 23, 42, 0.14);
  }
}

