/* Keep template content out of the first frame while real news are loading. */
.news-loading-status {
  display: none;
  min-height: clamp(260px, 40vw, 460px);
  margin: 0;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--muted);
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 16px;
  font-weight: 700;
  text-align: center;
}

.news-section.is-news-loading .news-grid,
.news-section.is-news-empty .news-grid,
.news-section.is-news-error .news-grid {
  display: none;
}

.news-section.is-news-loading .news-loading-status,
.news-section.is-news-empty .news-loading-status,
.news-section.is-news-error .news-loading-status {
  display: flex;
}

.news-section.is-news-loading .news-loading-status::before {
  width: 28px;
  height: 28px;
  border: 2px solid var(--line);
  border-top-color: var(--accent);
  border-radius: 50%;
  content: "";
  animation: news-loading-spin .8s linear infinite;
}

@keyframes news-loading-spin {
  to { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
  .news-section.is-news-loading .news-loading-status::before {
    animation: none;
  }
}

@media (max-width: 700px) {
  .branch-switcher {
    position: relative;
    top: auto;
    height: auto;
    min-height: 0;
    padding: 8px 0 10px;
  }

  .branch-switcher-track {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    grid-template-rows: repeat(3, 34px);
    gap: 4px 0;
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 0 6px;
    overflow: hidden;
  }

  .branch-switcher-track::before,
  .branch-switcher-track::after {
    content: none;
  }

  .branch-switcher-track > :nth-child(1) { grid-area: 1 / 1 / 2 / 4; }
  .branch-switcher-track > :nth-child(5) { grid-area: 1 / 4 / 2 / 7; }
  .branch-switcher-track > :nth-child(8) { grid-area: 1 / 7 / 2 / 10; }
  .branch-switcher-track > :nth-child(13) { grid-area: 1 / 10 / 2 / 13; }

  .branch-switcher-track > :nth-child(2) { grid-area: 2 / 1 / 3 / 4; }
  .branch-switcher-track > :nth-child(3) { grid-area: 2 / 4 / 3 / 7; }
  .branch-switcher-track > :nth-child(4) { grid-area: 2 / 7 / 3 / 10; }
  .branch-switcher-track > :nth-child(7) { grid-area: 2 / 10 / 3 / 13; }

  .branch-switcher-track > :nth-child(6) { grid-area: 3 / 1 / 4 / 3; }
  .branch-switcher-track > :nth-child(9) { grid-area: 3 / 3 / 4 / 6; }
  .branch-switcher-track > :nth-child(10) { grid-area: 3 / 6 / 4 / 8; }
  .branch-switcher-track > :nth-child(11) { grid-area: 3 / 8 / 4 / 10; }
  .branch-switcher-track > :nth-child(12) { grid-area: 3 / 10 / 4 / 13; }

  .branch-switcher a {
    justify-content: center;
    width: 100%;
    min-width: 0;
    min-height: 34px;
    padding: 6px 2px;
    font-size: 10px;
    text-align: center;
    white-space: nowrap;
  }

  .hero .hero-visual {
    order: 1;
  }

  .hero .hero-mobile-eyebrow {
    order: 2;
    padding-top: 18px;
    padding-bottom: 10px;
  }

  .hero .hero-copy {
    order: 3;
  }
}

@media (max-width: 340px) {
  .branch-switcher-track {
    padding-inline: 3px;
  }

  .branch-switcher a {
    min-height: 32px;
    padding: 5px 1px;
    font-size: 9px;
  }
}
