/* Barrio News — Stage 7.4 weather and forecast tool */

.bn-weather-tool {
  padding: clamp(46px, 5.5vw, 84px) 0 clamp(74px, 8vw, 120px);
}

.bn-weather-header {
  border-top: 4px solid var(--bn-color-ink);
  padding-top: clamp(28px, 3vw, 44px);
  max-width: 1040px;
}

.bn-weather-header h1 {
  margin: 8px 0 14px;
  max-width: 980px;
  font-family: var(--bn-font-serif);
  font-size: clamp(52px, 5.5vw, 86px);
  line-height: .96;
  letter-spacing: -.035em;
  color: var(--bn-color-ink);
}

.bn-weather-header__intro {
  margin: 0;
  max-width: 780px;
  color: var(--bn-color-muted);
  font-size: clamp(18px, 1.6vw, 22px);
  line-height: 1.55;
}

.bn-weather-header__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 22px;
  margin-top: 22px;
  color: var(--bn-color-muted);
  font-size: 14px;
}

.bn-weather-header__meta span + span::before {
  content: "•";
  color: var(--bn-color-accent-600);
  margin-right: 20px;
}

.bn-weather-current {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(320px, .8fr);
  gap: clamp(34px, 4vw, 64px);
  margin-top: clamp(42px, 5vw, 72px);
  border-top: 4px solid var(--bn-color-ink);
  padding-top: 24px;
}

.bn-weather-current__main {
  min-width: 0;
}

.bn-weather-current__label h2,
.bn-weather-section-heading h2,
.bn-weather-source h2,
.bn-weather-unavailable h2 {
  margin: 4px 0 0;
  font-family: var(--bn-font-serif);
  color: var(--bn-color-ink);
}

.bn-weather-current__label h2 {
  font-size: clamp(31px, 3.2vw, 48px);
  line-height: 1;
}

.bn-weather-current__condition {
  display: flex;
  align-items: center;
  gap: clamp(22px, 3vw, 40px);
  margin-top: clamp(28px, 4vw, 52px);
}

.bn-weather-current__icon {
  display: grid;
  place-items: center;
  width: clamp(110px, 13vw, 176px);
  aspect-ratio: 1;
  border-radius: 50%;
  background: linear-gradient(145deg, var(--bn-color-primary-950), #0d68c2 58%, var(--bn-color-accent-700));
  color: #fff;
}

.bn-weather-icon {
  width: 48px;
  height: 48px;
}

.bn-weather-icon--current {
  width: 62%;
  height: 62%;
}

.bn-weather-current__temp {
  margin: 0;
  font-family: var(--bn-font-serif);
  color: var(--bn-color-ink);
  font-size: clamp(68px, 8vw, 118px);
  line-height: .82;
  letter-spacing: -.055em;
}

.bn-weather-current__temp span {
  margin-left: 6px;
  font-family: var(--bn-font-sans);
  font-size: .28em;
  font-weight: 700;
  letter-spacing: 0;
  vertical-align: top;
}

.bn-weather-current__text {
  margin: 14px 0 0;
  color: var(--bn-color-muted);
  font-size: clamp(18px, 1.8vw, 24px);
  line-height: 1.35;
}

.bn-weather-current__details {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-self: stretch;
  border-left: 1px solid var(--bn-color-border);
  border-top: 1px solid var(--bn-color-border);
}

.bn-weather-stat {
  min-height: 126px;
  padding: 22px;
  border-right: 1px solid var(--bn-color-border);
  border-bottom: 1px solid var(--bn-color-border);
}

.bn-weather-stat span {
  display: block;
  color: var(--bn-color-muted);
  font-size: 14px;
  line-height: 1.35;
}

.bn-weather-stat strong {
  display: block;
  margin-top: 12px;
  color: var(--bn-color-ink);
  font-family: var(--bn-font-serif);
  font-size: clamp(24px, 2vw, 33px);
  line-height: 1.05;
}

.bn-weather-forecast {
  margin-top: clamp(58px, 7vw, 92px);
  border-top: 4px solid var(--bn-color-ink);
  padding-top: 22px;
}

.bn-weather-section-heading {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 24px;
}

.bn-weather-section-heading h2 {
  font-size: clamp(32px, 3vw, 46px);
  line-height: 1;
}

.bn-weather-updated {
  margin: 0;
  color: var(--bn-color-muted);
  font-size: 14px;
}

.bn-weather-days {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  margin-top: 24px;
  border-top: 1px solid var(--bn-color-border);
  border-left: 1px solid var(--bn-color-border);
}

.bn-weather-day {
  min-width: 0;
  padding: clamp(18px, 2vw, 26px);
  border-right: 1px solid var(--bn-color-border);
  border-bottom: 1px solid var(--bn-color-border);
}

.bn-weather-day__date {
  margin: 0;
  color: var(--bn-color-accent-600);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .06em;
  font-size: 13px;
}

.bn-weather-day__icon {
  margin-top: 22px;
  color: var(--bn-color-primary-700);
}

.bn-weather-day__condition {
  min-height: 2.8em;
  margin: 14px 0 0;
  color: var(--bn-color-ink);
  font-family: var(--bn-font-serif);
  font-size: clamp(18px, 1.55vw, 23px);
  font-weight: 700;
  line-height: 1.15;
}

.bn-weather-day__temps {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin: 20px 0 0;
  color: var(--bn-color-muted);
  font-size: 18px;
}

.bn-weather-day__temps strong {
  color: var(--bn-color-ink);
  font-size: 28px;
}

.bn-weather-source {
  display: grid;
  grid-template-columns: minmax(260px, .7fr) minmax(0, 1fr);
  gap: clamp(32px, 5vw, 74px);
  margin-top: clamp(56px, 7vw, 90px);
  border-top: 4px solid var(--bn-color-ink);
  padding-top: 24px;
}

.bn-weather-source h2 {
  font-size: clamp(28px, 2.6vw, 40px);
  line-height: 1.05;
}

.bn-weather-source__copy {
  color: var(--bn-color-muted);
  font-size: 16px;
  line-height: 1.65;
}

.bn-weather-source__copy p {
  margin: 0 0 12px;
}

.bn-weather-source__copy a {
  color: var(--bn-color-primary-900);
  font-weight: 700;
}

.bn-weather-unavailable {
  margin-top: clamp(42px, 5vw, 72px);
  border-top: 4px solid var(--bn-color-ink);
  background: var(--bn-color-surface-soft);
  padding: clamp(44px, 7vw, 88px) var(--bn-gutter);
}

.bn-weather-unavailable__inner {
  max-width: 680px;
  margin: 0 auto;
  text-align: center;
}

.bn-weather-icon--state {
  width: 72px;
  height: 72px;
  margin-bottom: 18px;
  color: var(--bn-color-primary-700);
}

.bn-weather-unavailable h2 {
  font-size: clamp(28px, 3vw, 42px);
  line-height: 1.08;
}

.bn-weather-unavailable p {
  margin: 16px auto 0;
  max-width: 560px;
  color: var(--bn-color-muted);
  font-size: 16px;
  line-height: 1.6;
}

.bn-weather-unavailable .bn-weather-admin-note {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--bn-color-border);
  font-size: 14px;
}

@media (max-width: 1023px) {
  .bn-weather-current {
    grid-template-columns: 1fr;
  }

  .bn-weather-current__details {
    border-left: 1px solid var(--bn-color-border);
  }

  .bn-weather-days {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .bn-weather-source {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 767px) {
  .bn-weather-tool {
    padding: 52px 0 78px;
  }

  .bn-weather-header h1 {
    font-size: clamp(46px, 12.5vw, 64px);
    line-height: .98;
  }

  .bn-weather-header__intro {
    font-size: 18px;
  }

  .bn-weather-header__meta {
    display: grid;
    gap: 8px;
  }

  .bn-weather-header__meta span + span::before {
    content: none;
  }

  .bn-weather-current {
    margin-top: 44px;
  }

  .bn-weather-current__condition {
    gap: 20px;
  }

  .bn-weather-current__icon {
    width: 104px;
  }

  .bn-weather-current__temp {
    font-size: clamp(64px, 18vw, 88px);
  }

  .bn-weather-current__details {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .bn-weather-stat {
    min-height: 112px;
    padding: 18px;
  }

  .bn-weather-section-heading {
    display: grid;
    align-items: start;
  }

  .bn-weather-days {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .bn-weather-day__condition {
    min-height: 0;
  }
}

@media (max-width: 430px) {
  .bn-weather-current__condition {
    align-items: flex-start;
  }

  .bn-weather-current__icon {
    width: 86px;
  }

  .bn-weather-current__details {
    grid-template-columns: 1fr 1fr;
  }

  .bn-weather-stat {
    padding: 16px 14px;
  }
}

@media (max-width: 339px) {
  .bn-weather-current__condition {
    display: grid;
  }

  .bn-weather-current__details,
  .bn-weather-days {
    grid-template-columns: 1fr;
  }
}

/* 0.7.7 QA hardening ------------------------------------------------------ */
.bn-weather-tool {
  position: relative;
  isolation: isolate;
  overflow-x: clip;
  background: #fff;
}

/* BN-T01 remains dormant until Stage 8. If enabled later, keep it in flow. */
.bn-weather-tool .bn-ad-slot {
  position: static;
  inset: auto;
  z-index: auto;
  overflow: hidden;
  background: transparent;
}

.bn-weather-current,
.bn-weather-forecast,
.bn-weather-source,
.bn-weather-unavailable {
  position: relative;
  z-index: 1;
}

.bn-weather-updated {
  max-width: 280px;
  text-align: right;
  line-height: 1.4;
}

@media (max-width: 767px) {
  .bn-weather-current__condition {
    min-width: 0;
  }

  .bn-weather-current__condition > div:last-child {
    min-width: 0;
  }

  .bn-weather-current__temp {
    white-space: nowrap;
  }

  .bn-weather-updated {
    max-width: none;
    text-align: left;
  }

  .bn-weather-days > .bn-weather-day:last-child:nth-child(odd) {
    grid-column: 1 / -1;
  }
}

@media (max-width: 430px) {
  .bn-weather-header h1 {
    font-size: clamp(42px, 12vw, 54px);
  }

  .bn-weather-current__condition {
    gap: 16px;
  }

  .bn-weather-current__temp {
    font-size: clamp(58px, 17vw, 76px);
  }

  .bn-weather-current__text {
    margin-top: 8px;
    font-size: 17px;
  }

  .bn-weather-stat strong {
    font-size: clamp(22px, 7vw, 29px);
  }
}

@media (max-width: 339px) {
  .bn-weather-days > .bn-weather-day:last-child:nth-child(odd) {
    grid-column: auto;
  }
}
