/*
  REVALYTICS — SHARED SECTION SCAFFOLD
  Reusable layout primitives: section wrappers, floating cards,
  delta badges, icon tiles, and section header/footer rows.
*/

/* ─── Section wrapper (outer gutter) ────────────────── */
.sec-wrap {
  margin: 20px 30px 0;
}

/* ─── Floating card (white bg, shadow, rounded) ──────── */
.r-float {
  background: #fff;
  border-radius: 25px;
  box-shadow: var(--card-shadow);
  overflow: hidden;
}

/* ─── Delta badge (pos / neg indicator) ──────────────── */
.r-delta {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 100px;
  font-size: 14px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

.r-delta.pos { background: var(--pos-bg); color: var(--pos); }
.r-delta.neg { background: var(--neg-bg); color: var(--neg); }

.r-delta .tri {
  width: 0;
  height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
}

.r-delta.pos .tri { border-bottom: 8px solid var(--pos); }
.r-delta.neg .tri { border-top:    8px solid var(--neg); }

/* ─── Icon tile ──────────────────────────────────────── */
.r-icon-tile {
  width: 50px;
  height: 50px;
  border-radius: 10px;
  background: var(--blue);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.r-icon-tile.navy { background: var(--navy); }

/* ─── Section header row (eyebrow + title + link) ────── */
.section-header-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 48px;
}

.section-footer-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 48px;
}

/* ─── Newsletter row ─────────────────────────────────── */
.newsletter-row {
  padding: 40px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.newsletter-headline {
  font-size: 20px;
  font-weight: 500;
  color: #fff;
  margin: 0 0 6px;
}

.newsletter-subline {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.55);
  margin: 0;
}

/* ─── Mobile overrides ───────────────────────────────── */
@media (max-width: 640px) {
  .sec-wrap,
  .feat-outer-wrap,
  .logo-strip-wrap,
  .leak-section {
    margin: 20px 0 0 !important;
    padding: 0 12px !important;
    width: 100% !important;
    box-sizing: border-box !important;
    border-radius: 0 !important;
    background: transparent !important;
  }

  .section-header-row {
    display: flex !important;
    flex-direction: column !important;
    align-items: flex-end !important;
    gap: 20px !important;
    flex-wrap: wrap !important;
    margin-bottom: 32px !important;
  }

  .section-header-row > div:first-child {
    width: 100% !important;
    text-align: left !important;
    flex: none !important;
  }

  .section-header-row > a {
    align-self: flex-end !important;
  }

  .section-header-row h2 {
    font-size: clamp(32px, 8vw, 42px) !important;
    word-wrap: break-word !important;
  }

  .section-footer-row {
    display: flex !important;
    flex-direction: row !important;
    justify-content: space-between !important;
    align-items: center !important;
    flex-wrap: wrap !important;
    gap: 12px !important;
    margin-top: 32px !important;
  }

  .section-footer-row p {
    text-align: left !important;
    margin: 0 !important;
    flex: 1 !important;
  }

  .newsletter-row {
    display: block !important;
    padding: 40px 0 0 !important;
  }

  .newsletter-headline {
    font-size: 16px !important;
    line-height: 1.3 !important;
    margin-bottom: 8px !important;
  }

  .newsletter-subline {
    font-size: 12px !important;
    margin-top: 0 !important;
    margin-bottom: 24px !important;
  }

  #newsletter-form {
    flex-direction: column !important;
    width: 100% !important;
    align-items: stretch !important;
    gap: 12px !important;
  }

  #newsletter-form input[type="email"] {
    width: 100% !important;
    box-sizing: border-box !important;
    height: 60px !important;
    padding: 0 24px !important;
    border-radius: 99px !important;
  }

  #newsletter-form button {
    width: 100% !important;
    height: 60px !important;
    border-radius: 99px !important;
    font-size: 16px !important;
    background: var(--rev-blue) !important;
    color: #fff !important;
    border: none !important;
  }
}

/* Tablet newsletter fix — only between 641px and 1024px */
@media (min-width: 641px) and (max-width: 1024px) {
  .newsletter-row {
    display: grid !important;
    grid-template-columns: 1fr auto !important;
    align-items: center !important;
    gap: 40px !important;
    text-align: left !important;
  }

  #newsletter-form {
    justify-content: flex-end !important;
  }
}
