/* Nationwide 311 story section */
#National311 > .section-311-inner {
  align-items: center !important;
  padding-top: var(--content-section-safe-top) !important;
  padding-bottom: var(--content-section-safe-bottom) !important;
}

#National311 .section-311-copy {
  min-width: 0;
}

#National311 .hero-scroll-copy {
  display: grid;
  grid-template-rows: minmax(0, 1fr);
  min-height: 0;
  height: auto;
  max-height: calc(100vh - 176px);
  max-height: var(--story-text-safe-height, calc(100svh - 176px));
  overflow: hidden;
}

#National311 .hero-scroll-stage {
  min-height: 0;
  height: auto;
  max-height: calc(100vh - 176px);
  max-height: var(--story-text-safe-height, calc(100svh - 176px));
  padding: 14px 18px;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior-y: auto;
  border: 1px solid rgba(200, 16, 46, 0.12);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: inset 0 1px 8px rgba(15, 23, 42, 0.1);
  scrollbar-color: var(--red) transparent;
  scrollbar-gutter: stable;
  scrollbar-width: thin;
}

#National311 .hero-scroll-stage::-webkit-scrollbar {
  width: 8px;
}

#National311 .hero-scroll-stage::-webkit-scrollbar-track {
  background: transparent;
  border-radius: 999px;
}

#National311 .hero-scroll-stage::-webkit-scrollbar-thumb {
  border: 2px solid transparent;
  border-radius: 999px;
  background: var(--red);
  background-clip: padding-box;
}

#National311 .hero-scroll-doc {
  min-height: 0;
}

#National311 .hero-scroll-item p {
  font-size: 1rem;
  line-height: 1.85;
}

#National311 .hero-scroll-item p:last-child {
  margin-bottom: 0;
}

#National311 .section-311-visual {
  position: sticky;
  top: 120px;
  display: flex;
  flex-direction: column;
  min-height: 560px;
  align-items: center;
  justify-content: center;
  gap: clamp(10px, 2vw, 18px);
  overflow: hidden;
}

#National311 .section-311-visual > .bg-patch {
  inset: -18%;
  opacity: 0.045;
  background-image:
    repeating-linear-gradient(
      45deg,
      var(--red) 0,
      var(--red) 1.5px,
      transparent 1.5px,
      transparent 8px
    ),
    repeating-linear-gradient(
      -45deg,
      var(--red) 0,
      var(--red) 1.5px,
      transparent 1.5px,
      transparent 8px
    );
  background-size: 12px 12px;
  mask-image: radial-gradient(
    ellipse 40% 40% at 50% 50%,
    black 28%,
    rgba(0, 0, 0, 0.85) 46%,
    rgba(0, 0, 0, 0.45) 64%,
    rgba(0, 0, 0, 0.12) 78%,
    transparent 88%
  );
  -webkit-mask-image: radial-gradient(
    ellipse 40% 40% at 50% 50%,
    black 28%,
    rgba(0, 0, 0, 0.85) 46%,
    rgba(0, 0, 0, 0.45) 64%,
    rgba(0, 0, 0, 0.12) 78%,
    transparent 88%
  );
  animation-duration: 70s !important;
  animation-direction: reverse !important;
}

#National311 .section-311-quote {
  position: relative;
  z-index: 1;
  flex: 0 0 auto;
  width: min(520px, 100%);
  margin: 0;
  color: var(--red);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.05rem, 5vw, 1.35rem);
  font-style: italic;
  font-weight: 700;
  line-height: 1.12;
  text-align: center;
  text-wrap: balance;
}

#National311 .section-311-quote strong {
  color: inherit;
  font-weight: inherit;
}

#National311 .section-311-quote-number {
  font-family: "Segoe UI", Arial, sans-serif;
  font-style: italic;
  font-variant-numeric: tabular-nums;
  font-weight: 900;
  letter-spacing: 0.025em;
  white-space: nowrap;
}

#National311 .section-311-route {
  position: relative;
  z-index: 1;
  display: grid;
  flex: 1 1 auto;
  width: min(100%, 480px);
  min-height: 490px;
  place-items: center;
}

#National311 .section-311-phone-node {
  position: relative !important;
  top: auto;
  left: auto;
  z-index: 2;
  width: 244.08px;
  height: 490.42px;
  transform: none;
}

#National311 .section-311-call-phone.phone-shell {
  position: absolute !important;
  inset: auto !important;
  top: 0 !important;
  left: 0 !important;
  z-index: 1 !important;
  width: 216px;
  height: 434px;
  overflow: hidden;
  pointer-events: auto;
  transform: scale(1.13) !important;
  transform-origin: top left !important;
  box-shadow:
    0 14px 28px rgba(15, 23, 42, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.8),
    inset 0 -1px 0 rgba(255, 255, 255, 0.25) !important;
}

#National311 .section-311-call-phone .phone-app {
  display: block;
  overflow: hidden;
}

#National311 .section-311-call-screen {
  display: flex;
  height: 100%;
  flex-direction: column;
  align-items: center;
  padding: 44px 15px 18px;
  color: #0f172a;
  text-align: center;
  border: 1px solid rgba(200, 16, 46, 0.1);
  border-radius: 12px;
  background: linear-gradient(180deg, #ffffff 0%, #fff7f8 58%, #f8fafc 100%);
}

#National311 .section-311-caller {
  display: flex;
  flex-direction: column;
  align-items: center;
}

#National311 .section-311-call-number {
  color: #0f172a;
  font-size: 1.85rem;
  font-weight: 900;
  line-height: 1;
  letter-spacing: -0.04em;
}

#National311 .section-311-call-state {
  margin-top: 5px;
  color: #334155;
  font-size: 0.72rem;
  font-weight: 600;
}

#National311 .section-311-call-ellipsis {
  display: inline-flex;
  width: 24px;
  align-items: center;
  gap: 3px;
  margin-left: 4px;
}

#National311 .section-311-call-ellipsis i {
  display: block;
  width: 5px;
  height: 5px;
  flex: 0 0 5px;
  overflow: hidden;
  color: transparent;
  font-style: normal;
  opacity: 0.24;
  border-radius: 50%;
  background: #334155;
  animation: national311CallingDot 1.2s ease-in-out infinite !important;
}

#National311 .section-311-call-ellipsis i:nth-child(2) { animation-delay: 0.2s !important; }
#National311 .section-311-call-ellipsis i:nth-child(3) { animation-delay: 0.4s !important; }

/* The static story layout disables animations with a deliberately strong
   selector. Re-enable only these call-progress dots. */
#National311:not(#Donate):not(#FAQ):not(#Contact) .section-311-call-ellipsis i {
  animation-name: national311CallingDot !important;
  animation-duration: 1.2s !important;
  animation-timing-function: ease-in-out !important;
  animation-iteration-count: infinite !important;
}

#National311:not(#Donate):not(#FAQ):not(#Contact) .section-311-call-ellipsis i:nth-child(2) {
  animation-delay: 0.2s !important;
}

#National311:not(#Donate):not(#FAQ):not(#Contact) .section-311-call-ellipsis i:nth-child(3) {
  animation-delay: 0.4s !important;
}

#National311 .section-311-call-controls {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px 4px;
  width: 100%;
  margin-top: 52px;
}

#National311 .section-311-call-control {
  display: flex;
  min-width: 0;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  color: #334155;
  cursor: pointer;
  pointer-events: auto;
}

#National311 .section-311-control-icon {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  color: #ffffff;
  border-radius: 50%;
  background: linear-gradient(180deg, #df5b70 0%, var(--red) 100%);
  box-shadow: 0 4px 8px rgba(200, 16, 46, 0.16);
  transition: transform 160ms ease, box-shadow 160ms ease, filter 160ms ease !important;
}

#National311 .section-311-control-icon svg {
  width: 24px;
  height: 24px;
  overflow: visible;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

#National311 .section-311-control-icon--keypad svg {
  fill: currentColor;
  stroke: none;
}

#National311 .section-311-call-control small {
  overflow: hidden;
  max-width: 100%;
  color: inherit;
  font-size: 0.62rem;
  font-weight: 600;
  line-height: 1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#National311 .section-311-call-control--disabled {
  opacity: 0.42;
}

#National311 .section-311-call-control:hover .section-311-control-icon {
  filter: brightness(1.05);
  transform: translateY(-2px) scale(1.055);
  box-shadow: 0 7px 14px rgba(200, 16, 46, 0.24);
}

#National311:not(#Donate):not(#FAQ):not(#Contact) .section-311-control-icon,
#National311:not(#Donate):not(#FAQ):not(#Contact) .section-311-hangup {
  transition: transform 160ms ease, box-shadow 160ms ease, filter 160ms ease !important;
}

#National311 .section-311-call-control:active .section-311-control-icon {
  transform: scale(0.94);
}

#National311 .section-311-hangup {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  margin-top: auto;
  color: #ffffff;
  border-radius: 50%;
  background: var(--red);
  box-shadow: 0 6px 12px rgba(200, 16, 46, 0.22);
  cursor: pointer;
  pointer-events: auto;
  transition: transform 160ms ease, box-shadow 160ms ease, filter 160ms ease !important;
}

#National311 .section-311-hangup svg {
  width: 24px;
  height: 24px;
  fill: currentColor;
  transform: rotate(135deg);
}

#National311 .section-311-hangup:hover {
  filter: brightness(1.06);
  transform: translateY(-2px) scale(1.055);
  box-shadow: 0 9px 16px rgba(200, 16, 46, 0.3);
}

#National311 .section-311-hangup:active {
  transform: scale(0.94);
}

@keyframes national311CallingDot {
  0%, 20%, 100% { opacity: 0.24; transform: translateY(0); }
  45% { opacity: 1; transform: translateY(-1px); }
}

html.paragraph-scroll-enhanced #National311.story-section.paragraph-scroll-section > .section-311-inner {
  padding-top: var(--content-section-safe-top) !important;
  padding-bottom: var(--content-section-safe-bottom) !important;
}

html.paragraph-scroll-enhanced #National311.story-section .hero-scroll-copy {
  display: grid !important;
  grid-template-rows: minmax(0, 1fr) !important;
}

html.paragraph-scroll-enhanced #National311.story-section .hero-scroll-stage {
  overflow-y: auto !important;
}

@media (min-width: 901px) {
  #National311 .section-311-visual {
    align-self: stretch;
  }

  #National311 .section-311-quote {
    position: absolute;
    top: 15px;
    left: 50%;
    margin: 0;
    transform: translateX(-50%);
  }
}

@media (orientation: landscape) and (min-width: 1101px) and (max-height: 900px) {
  #National311 .section-311-route {
    min-height: 417px;
  }

  #National311 .section-311-phone-node {
    width: 207.36px;
    height: 416.64px;
  }

  #National311 .section-311-call-phone.phone-shell {
    transform: scale(0.96) !important;
  }
}

@media (orientation: landscape) and (min-width: 1101px) and (max-height: 820px) {
  #National311 .section-311-route {
    min-height: 356px;
  }

  #National311 .section-311-phone-node {
    width: 177.12px;
    height: 355.88px;
  }

  #National311 .section-311-call-phone.phone-shell {
    transform: scale(0.82) !important;
  }
}

@media (max-width: 900px),
  (orientation: landscape) and (max-width: 1100px) and (max-height: 650px) {
  #National311 .section-311-visual {
    gap: 3px;
  }

  #National311 .section-311-route {
    flex: 1 1 auto;
    width: 100%;
    min-height: 0;
  }

  #National311 .section-311-phone-node {
    width: 82.08px;
    height: 164.92px;
  }

  #National311 .section-311-call-phone.phone-shell {
    transform: scale(0.38) !important;
  }
}

@media (orientation: landscape) and (max-width: 1100px) and (max-height: 650px) {
  #National311 .section-311-phone-node {
    width: 103.68px;
    height: 208.32px;
  }

  #National311 .section-311-call-phone.phone-shell {
    transform: scale(0.48) !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  #National311:not(#Donate):not(#FAQ):not(#Contact) .section-311-call-ellipsis i {
    animation: none !important;
  }

  #National311:not(#Donate):not(#FAQ):not(#Contact) .section-311-call-ellipsis i {
    opacity: 1;
    transform: none;
  }

  #National311 .section-311-control-icon,
  #National311 .section-311-hangup {
    transition: none !important;
  }

}

@media (max-width: 900px) {
  html.paragraph-scroll-enhanced #National311.story-section.paragraph-scroll-section {
    min-height: var(--mobile-card-height, 100dvh) !important;
    margin-top: 0;
  }

  html.paragraph-scroll-enhanced #National311.story-section.paragraph-scroll-section > .section-311-inner {
    height: var(--mobile-card-height, 100dvh) !important;
    min-height: var(--mobile-card-height, 100dvh) !important;
    grid-template-columns: minmax(0, 1fr) !important;
    grid-template-rows: minmax(0, calc(27svh - 38px)) minmax(0, 1fr) !important;
    gap: 12px !important;
    padding: calc(68px + env(safe-area-inset-top)) 7% calc(68px + env(safe-area-inset-bottom)) !important;
    overflow: hidden !important;
  }

  html.paragraph-scroll-enhanced #National311 .section-311-copy {
    position: relative;
    z-index: 2;
    grid-column: 1;
    grid-row: 2;
    min-height: 0 !important;
    padding-bottom: 0 !important;
    justify-content: center;
  }

  html.paragraph-scroll-enhanced #National311 .hero-scroll-copy {
    flex: 0 1 auto !important;
    width: 100%;
    height: auto;
    min-height: 0;
    max-height: 100%;
  }

  html.paragraph-scroll-enhanced #National311 .hero-scroll-stage {
    height: auto;
    max-height: 100%;
  }

  #National311 .section-311-visual {
    position: relative;
    top: auto;
    grid-column: 1;
    grid-row: 1;
    min-height: 0;
    height: auto;
    overflow: hidden;
  }

  #National311 .section-311-visual > .bg-patch {
    inset: auto;
    top: -20%;
    left: 50%;
    width: 120%;
    height: 140%;
    transform: translateX(-50%);
  }

  #National311 .section-311-quote {
    width: min(92vw, 420px);
    font-size: clamp(1.05rem, 5vw, 1.35rem);
  }
}

@media (orientation: landscape) and (max-width: 1100px) and (max-height: 650px) {
  html.paragraph-scroll-enhanced #National311.story-section.paragraph-scroll-section {
    height: var(--mobile-card-height, 100svh) !important;
    min-height: var(--mobile-card-height, 100svh) !important;
    max-height: var(--mobile-card-height, 100svh) !important;
    overflow: hidden !important;
  }

  html.paragraph-scroll-enhanced #National311.story-section.paragraph-scroll-section > .section-311-inner {
    width: 100% !important;
    height: var(--mobile-card-height, 100svh) !important;
    min-height: var(--mobile-card-height, 100svh) !important;
    max-height: var(--mobile-card-height, 100svh) !important;
    grid-template-columns: minmax(0, 1.3fr) minmax(190px, 0.7fr) !important;
    grid-template-rows: minmax(0, 1fr) !important;
    align-items: stretch !important;
    gap: clamp(16px, 3vw, 32px) !important;
    padding: max(58px, calc(env(safe-area-inset-top) + 50px)) clamp(20px, 5vw, 64px) max(56px, calc(env(safe-area-inset-bottom) + 50px)) !important;
    overflow: hidden !important;
  }

  html.paragraph-scroll-enhanced #National311 .section-311-copy {
    grid-column: 1;
    grid-row: 1;
    width: 100%;
    height: 100%;
    min-height: 0 !important;
    padding: 0 !important;
    overflow: hidden;
    justify-content: center;
  }

  html.paragraph-scroll-enhanced #National311 .hero-scroll-copy,
  html.paragraph-scroll-enhanced #National311 .hero-scroll-stage {
    width: 100% !important;
    height: auto !important;
    min-height: 0 !important;
    max-height: 100% !important;
  }

  html.paragraph-scroll-enhanced #National311 .hero-scroll-copy {
    flex: 0 1 auto !important;
  }

  html.paragraph-scroll-enhanced #National311 .hero-scroll-stage {
    padding: 11px 14px !important;
    overflow-y: auto !important;
    overscroll-behavior-y: contain !important;
  }

  #National311 .hero-scroll-item p {
    font-size: clamp(0.74rem, 1.35vw, 0.86rem) !important;
    line-height: 1.48 !important;
  }

  #National311 .section-311-visual {
    position: relative !important;
    inset: auto !important;
    grid-column: 2;
    grid-row: 1;
    align-self: stretch !important;
    width: 100%;
    height: 100%;
    min-height: 0;
    max-height: 100%;
  }

  #National311 .section-311-quote {
    width: min(100%, 300px);
    margin: 0;
    font-size: clamp(0.76rem, 1.65vw, 0.98rem);
    line-height: 1.08;
  }
}

@media (orientation: landscape) and (max-width: 1100px) and (max-height: 360px) {
  html.paragraph-scroll-enhanced #National311.story-section.paragraph-scroll-section > .section-311-inner {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  #National311 .section-311-visual {
    display: none !important;
  }

  html.paragraph-scroll-enhanced #National311 .section-311-copy {
    grid-column: 1;
    grid-row: 1;
  }
}
