/* =========================================================
   EXCERPT HUD BACKGROUND
   Tuned so the map is actually visible
========================================================= */

#excerpt.excerpt--hud {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  background: rgb(22, 28, 28);
}

#excerpt.excerpt--hud > .container,
#excerpt.excerpt--hud .book-excerpt-wrapper,
#excerpt.excerpt--hud .newsletter-section {
  position: relative;
  z-index: 4;
}

#excerpt.excerpt--hud .section-title h2,
#excerpt.excerpt--hud .section-title p {
  color: rgba(255, 255, 255, 0.92);
  text-shadow: 0 2px 18px rgba(0, 0, 0, 0.35);
}

#excerpt.excerpt--hud .excerpt-hud-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  padding: 0;
  overflow: hidden;
  background:
    radial-gradient(circle at 18% 24%, rgba(0, 220, 220, 0.18) 0%, rgba(0, 220, 220, 0.08) 16%, rgba(0, 0, 0, 0) 38%),
    radial-gradient(circle at 82% 72%, rgba(0, 190, 190, 0.16) 0%, rgba(0, 190, 190, 0.06) 16%, rgba(0, 0, 0, 0) 34%),
    linear-gradient(180deg, rgba(18, 24, 24, 0.74) 0%, rgba(20, 28, 28, 0.68) 100%);
}

#excerpt.excerpt--hud .excerpt-hud-bg::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background:
    linear-gradient(
      180deg,
      rgba(10, 14, 14, 0.18) 0%,
      rgba(0, 50, 50, 0.04) 30%,
      rgba(0, 50, 50, 0.08) 68%,
      rgba(10, 14, 14, 0.20) 100%
    ),
    radial-gradient(circle at 50% 50%, rgba(0, 220, 220, 0.06), rgba(0, 0, 0, 0) 62%);
}

#excerpt.excerpt--hud .excerpt-hud-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  background:
    linear-gradient(rgba(0, 220, 220, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 220, 220, 0.05) 1px, transparent 1px);
  background-size: 34px 34px, 34px 34px;
  opacity: 0.24;
  mix-blend-mode: screen;
}

#excerpt.excerpt--hud .excerpt-hud-bg .mapboxgl-map {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  background: transparent;
}

#excerpt.excerpt--hud .excerpt-hud-bg .mapboxgl-canvas-container,
#excerpt.excerpt--hud .excerpt-hud-bg canvas {
  width: 100% !important;
  height: 100% !important;
}

#excerpt.excerpt--hud .excerpt-hud-bg canvas {
  opacity: 0.72;
  filter:
    saturate(0.85)
    hue-rotate(110deg)
    brightness(0.78)
    contrast(1.14);
}

#excerpt.excerpt--hud .excerpt-hud-bg .mapboxgl-ctrl-top-left,
#excerpt.excerpt--hud .excerpt-hud-bg .mapboxgl-ctrl-top-right,
#excerpt.excerpt--hud .excerpt-hud-bg .mapboxgl-ctrl-bottom-right,
#excerpt.excerpt--hud .excerpt-hud-bg .mapboxgl-ctrl-bottom-left {
  display: none !important;
}

#excerpt.excerpt--hud .book-page-design,
#excerpt.excerpt--hud .newsletter-card {
  position: relative;
  z-index: 5;
}

#excerpt.excerpt--hud .book-page-design {
  box-shadow:
    0 10px 30px rgba(0, 0, 0, 0.16),
    0 0 0 1px rgba(255, 255, 255, 0.05);
}

#excerpt.excerpt--hud .newsletter-card {
  box-shadow:
    0 10px 30px rgba(0, 0, 0, 0.14),
    0 0 0 1px rgba(255, 255, 255, 0.04);
}

@media (max-width: 768px) {
  #excerpt.excerpt--hud .excerpt-hud-bg::after {
    background-size: 24px 24px, 24px 24px;
    opacity: 0.18;
  }

  #excerpt.excerpt--hud .excerpt-hud-bg canvas {
    opacity: 0.60;
  }
}

.excerpt .book-page-design {
  background: rgba(238, 240, 242, 0.93);
  padding: 50px 40px;
  border-radius: 10px;
  box-shadow:
    0 10px 30px rgba(0, 0, 0, 0.16),
    0 0 0 1px rgba(255, 255, 255, 0.05);
  position: relative;
  overflow: hidden;
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}

/* =========================================================
   STAY IN THE LOOP — CRT GREEN TREATMENT
   Uses existing newsletter markup only
========================================================= */

#excerpt.excerpt--hud .newsletter-card {
  --crt-bg: rgba(12, 30, 24, 0.72);
  --crt-line: rgba(84, 255, 168, 0.16);
  --crt-bright: #8dffbf;
  --crt-mid: #49d98d;
  --crt-deep: #123d2d;
  --crt-glow: rgba(73, 217, 141, 0.38);

  position: relative;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(9, 22, 18, 0.90), rgba(14, 36, 28, 0.82)),
    linear-gradient(
      180deg,
      var(--crt-line) 0%,
      transparent 2%,
      transparent 4%,
      var(--crt-line) 6%,
      transparent 8%,
      transparent 10%,
      var(--crt-line) 12%,
      transparent 14%,
      transparent 16%,
      var(--crt-line) 18%,
      transparent 20%
    );
  background-size: auto, 100% 18px;
  border: 2px solid rgba(141, 255, 191, 0.42);
  border-radius: 1.35rem;
  box-shadow:
    0 0 0 1px rgba(141, 255, 191, 0.10) inset,
    0 0 24px rgba(73, 217, 141, 0.14),
    0 0 70px rgba(18, 61, 45, 0.20),
    inset 0 0 30px rgba(18, 61, 45, 0.30);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

#excerpt.excerpt--hud .newsletter-card::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(
      180deg,
      rgba(255, 255, 255, 0.05) 0%,
      rgba(255, 255, 255, 0.015) 8%,
      rgba(0, 0, 0, 0) 20%,
      rgba(0, 0, 0, 0) 100%
    ),
    radial-gradient(circle at 50% 0%, rgba(141, 255, 191, 0.08), transparent 48%);
  mix-blend-mode: screen;
  opacity: 0.9;
}

#excerpt.excerpt--hud .newsletter-card::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    repeating-linear-gradient(
      to bottom,
      rgba(141, 255, 191, 0.06) 0,
      rgba(141, 255, 191, 0.06) 1px,
      transparent 1px,
      transparent 5px
    );
  opacity: 0.38;
}

#excerpt.excerpt--hud .newsletter-signup {
  position: relative;
  z-index: 2;
  text-align: left;
}

#excerpt.excerpt--hud .newsletter-signup h3 {
  color: var(--crt-bright);
  text-shadow: 0 0 10px rgba(141, 255, 191, 0.18);
  letter-spacing: 0.03em;
}

#excerpt.excerpt--hud .newsletter-signup .signup-subtext {
  color: rgba(220, 255, 235, 0.88);
}

#excerpt.excerpt--hud .newsletter-signup em {
  color: var(--crt-bright);
}

#excerpt.excerpt--hud .sign-up-form {
  position: relative;
  z-index: 2;
  background: rgba(7, 19, 15, 0.72) !important;
  border: 1px solid rgba(141, 255, 191, 0.28) !important;
  border-radius: 1rem !important;
  box-shadow:
    0 0 0 1px rgba(141, 255, 191, 0.05) inset,
    inset 0 0 25px rgba(18, 61, 45, 0.22),
    0 0 24px rgba(73, 217, 141, 0.08);
}

#excerpt.excerpt--hud .sign-up-form input[type="text"],
#excerpt.excerpt--hud .sign-up-form input[type="email"] {
  background: rgba(5, 15, 12, 0.88) !important;
  border: 1px solid rgba(141, 255, 191, 0.24) !important;
  color: #dfffea !important;
  border-radius: 0.85rem !important;
  box-shadow:
    0 0 0 1px rgba(141, 255, 191, 0.04) inset,
    inset 0 0 18px rgba(18, 61, 45, 0.22);
}

#excerpt.excerpt--hud .sign-up-form input[type="text"]::placeholder,
#excerpt.excerpt--hud .sign-up-form input[type="email"]::placeholder {
  color: rgba(181, 241, 205, 0.56) !important;
}

#excerpt.excerpt--hud .sign-up-form input[type="text"]:focus,
#excerpt.excerpt--hud .sign-up-form input[type="email"]:focus {
  background: rgba(10, 24, 18, 0.95) !important;
  border-color: rgba(141, 255, 191, 0.60) !important;
  box-shadow:
    0 0 0 1px rgba(141, 255, 191, 0.18) inset,
    0 0 18px rgba(73, 217, 141, 0.18),
    inset 0 0 18px rgba(18, 61, 45, 0.24) !important;
}

#excerpt.excerpt--hud .sign-up-form input[type="submit"] {
  background:
    linear-gradient(180deg, rgba(39, 130, 82, 0.95), rgba(20, 86, 53, 0.98)) !important;
  border: 1px solid rgba(141, 255, 191, 0.42) !important;
  color: #eafff2 !important;
  border-radius: 0.95rem !important;
  box-shadow:
    0 0 0 1px rgba(141, 255, 191, 0.08) inset,
    0 0 18px rgba(73, 217, 141, 0.18),
    inset 0 0 20px rgba(141, 255, 191, 0.08) !important;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 700 !important;
}

#excerpt.excerpt--hud .sign-up-form input[type="submit"]:hover {
  background:
    linear-gradient(180deg, rgba(57, 158, 102, 0.98), rgba(26, 104, 64, 1)) !important;
  box-shadow:
    0 0 0 1px rgba(141, 255, 191, 0.12) inset,
    0 0 22px rgba(73, 217, 141, 0.24),
    inset 0 0 20px rgba(141, 255, 191, 0.10) !important;
}

#excerpt.excerpt--hud .php-email-form .loading,
#excerpt.excerpt--hud .php-email-form .error-message,
#excerpt.excerpt--hud .php-email-form .sent-message {
  position: relative;
  z-index: 2;
  border-radius: 0.85rem;
  border: 1px solid rgba(141, 255, 191, 0.18);
}

#excerpt.excerpt--hud .php-email-form .loading {
  background: rgba(8, 20, 16, 0.88);
  color: #dfffea;
}

#excerpt.excerpt--hud .php-email-form .sent-message {
  background: rgba(21, 80, 50, 0.88);
  color: #f2fff7;
}

#excerpt.excerpt--hud .php-email-form .error-message {
  background: rgba(84, 26, 26, 0.88);
  color: #fff2f2;
}

@media (max-width: 768px) {
  #excerpt.excerpt--hud .newsletter-signup {
    text-align: center;
  }
}
