/* =============================================================
   MortgageWire — style.css
   Fonts: Playfair Display (headlines/numbers), Source Sans 3 (UI/body)
   Breakpoints: 1024px (tablet), 768px (small tablet), 480px (mobile)
   ============================================================= */


/* =============================================================
   RESET & BASE
============================================================= */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: 'Source Sans 3', system-ui, sans-serif;
  background: #EEECEA;
  color: #1A1A1A;
  line-height: 1.5;
}

a {
  text-decoration: none;
  color: inherit;
}

img {
  max-width: 100%;
  display: block;
}

button {
  cursor: pointer;
  font-family: inherit;
}


/* =============================================================
   FULL-WIDTH INNER CONSTRAINT
   Used inside header and footer to match body content width
============================================================= */
.mw-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}


/* =============================================================
   MAIN CONTENT WRAPPER
============================================================= */
.mw {
  max-width: 1200px;
  margin: 0 auto;
  background: #F7F5F0;
}


/* =============================================================
   HEADER — full bleed
============================================================= */
.mw-header {
  background: #0C2340;
  position: sticky;
  top: 0;
  z-index: 100;
  width: 100%;
}


/* --- TOP NAV --- */
.mw-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
  border-bottom: 0.5px solid rgba(255,255,255,0.1);
  gap: 16px;
}

/* Logo */
.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  text-decoration: none;
}

.logo-mark {
  width: 30px;
  height: 30px;
  background: #2176C7;
  border-radius: 7px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.logo-mark svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: #ffffff;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.logo-text {
  font-size: 17px;
  font-weight: 500;
  letter-spacing: -0.5px;
  color: #ffffff;
  font-family: 'Source Sans 3', sans-serif;
}

.logo-text span {
  color: #5BA8F5;
}

/* Nav links */
.nav-center {
  display: flex;
  gap: 2px;
  flex: 1;
  justify-content: center;
}

.nav-pill {
  font-size: 13px;
  color: #A8C8F0;
  padding: 5px 12px;
  border-radius: 20px;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s, color 0.15s;
}

.nav-pill:hover {
  background: rgba(255,255,255,0.1);
  color: #ffffff;
}

.nav-pill.on {
  background: rgba(255,255,255,0.12);
  color: #ffffff;
}

/* CTA button */
.nav-right {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.btn-solid {
  font-size: 12px;
  padding: 6px 16px;
  border-radius: 20px;
  border: none;
  background: #2176C7;
  color: #ffffff;
  font-weight: 500;
  white-space: nowrap;
  transition: background 0.15s;
  display: inline-block;
}

.btn-solid:hover {
  background: #1A5FA0;
  color: #ffffff;
}

/* Hamburger toggle — hidden on desktop */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: space-between;
  width: 22px;
  height: 16px;
  background: transparent;
  border: none;
  padding: 0;
  cursor: pointer;
  flex-shrink: 0;
}

.nav-toggle span {
  display: block;
  height: 2px;
  background: #A8C8F0;
  border-radius: 2px;
  transition: all 0.2s;
}

.nav-toggle.active span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.active span:nth-child(2) { opacity: 0; }
.nav-toggle.active span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }


/* --- RATE BAR --- */
.rate-bar {
  display: flex;
  align-items: stretch;
  padding: 0;
  border-top: 0.5px solid rgba(255,255,255,0.08);
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  -webkit-overflow-scrolling: touch;
}

.rate-bar::-webkit-scrollbar {
  display: none;
}

.rc {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 20px 10px 0;
  margin-right: 20px;
  border-right: 0.5px solid rgba(255,255,255,0.1);
  flex-shrink: 0;
}

.rc:last-of-type {
  border-right: none;
  margin-right: 0;
}

.rc-label {
  font-size: 10px;
  color: #7AAAD8;
  letter-spacing: 0.5px;
  margin-bottom: 3px;
  text-transform: uppercase;
  white-space: nowrap;
}

.rc-val {
  font-size: 16px;
  font-weight: 500;
  color: #ffffff;
  white-space: nowrap;
}

.rc-chg {
  font-size: 11px;
  font-weight: 500;
  white-space: nowrap;
}

.rc-ts {
  margin-left: auto;
  font-size: 10px;
  color: #7AAAD8;
  white-space: nowrap;
  align-self: center;
  padding-left: 16px;
  flex-shrink: 0;
}

/* --- SUBNAV MOBILE SELECT --- */
/* Hidden on desktop, shown on mobile via media query */
.subnav-select-wrap {
  display: none;
  background: #0A1C30;
  border-top: 0.5px solid rgba(255,255,255,0.06);
  padding: 8px 16px;
}

.subnav-select {
  width: 100%;
  padding: 8px 12px;
  font-size: 13px;
  font-family: 'Source Sans 3', sans-serif;
  color: #ffffff;
  background: #0C2340;
  border: 0.5px solid rgba(255,255,255,0.2);
  border-radius: 8px;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%237AAAD8' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
}


/* --- SUBNAV --- */
/* Wrapper provides the fade-right scroll hint */
.subnav-wrap {
  background: #0A1C30;
  border-top: 0.5px solid rgba(255,255,255,0.06);
  position: relative;
}

/* Fade-right gradient hint — shows there are more items */
.subnav-wrap::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 40px;
  height: 100%;
  background: linear-gradient(to right, transparent, #0A1C30);
  pointer-events: none;
  z-index: 1;
}

.subnav {
  background: transparent;
  display: flex;
  padding: 0;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  -webkit-overflow-scrolling: touch; /* iOS momentum scroll */
}

.subnav::-webkit-scrollbar {
  display: none;
}

.sn {
  font-size: 14px;
  color: #7AAAD8;
  padding: 9px 14px;
  cursor: pointer;
  white-space: nowrap;
  border-bottom: 2px solid transparent;
  transition: color 0.15s, border-color 0.15s;
  display: block;
  flex-shrink: 0; /* prevent items from squishing */
}

.sn:hover {
  color: #ffffff;
}

.sn.on {
  color: #ffffff;
  border-bottom-color: #2176C7;
}


/* =============================================================
   MAIN BODY LAYOUT
============================================================= */
.mw-body {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 20px;
  padding: 20px;
  align-items: start;
}


/* =============================================================
   MAIN FEED
============================================================= */
.feed {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0; /* prevent grid blowout */
}


/* --- HERO / BREAKING --- */
.hero {
  background: #0C2340;
  border-radius: 10px;
  overflow: hidden;
  cursor: pointer;
  border: 0.5px solid #2176C7;
  transition: border-color 0.15s;
  display: block;
  text-decoration: none;
  color: inherit;
}

.hero:hover {
  border-color: #5BA8F5;
}

.hero-inner {
  padding: 22px;
}

.hero-eyebrow {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 12px;
}

.live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #7ED4B2;
  flex-shrink: 0;
}

.hero-tag {
  font-size: 10px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: #7ED4B2;
  font-weight: 500;
}

.hero-hed {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 21px;
  font-weight: 500;
  color: #ffffff;
  line-height: 1.35;
  margin-bottom: 10px;
  letter-spacing: -0.2px;
}

.hero-dek {
  font-size: 13px;
  color: #A8C8F0;
  line-height: 1.65;
}

.hero-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 11px 22px;
  background: rgba(0,0,0,0.2);
  border-top: 0.5px solid rgba(255,255,255,0.08);
}

.hero-source {
  font-size: 12px;
  color: #7AAAD8;
}

.hero-source b {
  color: #A8C8F0;
  font-weight: 500;
}

.hero-arr {
  font-size: 12px;
  color: #5BA8F5;
  white-space: nowrap;
}


/* --- SECONDARY CARD GRID --- */
.card-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.card {
  background: #ffffff;
  border-radius: 10px;
  border: 0.5px solid #E0DDD6;
  padding: 16px;
  cursor: pointer;
  transition: border-color 0.15s;
  display: block;
  text-decoration: none;
  color: inherit;
}

.card:hover {
  border-color: #2176C7;
}

/* Category tags */
.tag {
  display: inline-block;
  font-size: 10px;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  padding: 3px 9px;
  border-radius: 20px;
  margin-bottom: 11px;
  font-weight: 500;
}

.tag-rates       { background: #EAF2FC; color: #1A5FA0; }
.tag-housing     { background: #EAF3E6; color: #2E6B1A; }
.tag-reg         { background: #EEEDFB; color: #4A42A8; }
.tag-tech        { background: #E3F5EF; color: #0D6B4F; }
.tag-fed         { background: #FDF0E0; color: #8A5200; }
.tag-origination { background: #FDF0E0; color: #8A5200; }
.tag-industry    { background: #F0EEF8; color: #4A3A80; }
.tag-servicing   { background: #FCEBEB; color: #A03020; }
.tag-servicing { background: #FEF0F0; color: #A03020; }
.tag-commercial { background: #F0EEF8; color: #4A3A80; }

.card h2 {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 15px;
  font-weight: 400;
  color: #1A1A1A;
  line-height: 1.5;
  margin-bottom: 10px;
  letter-spacing: 0;
}

.card-meta {
  font-size: 11px;
  color: #999490;
}

.card-source {
  font-weight: 500;
  color: #666660;
}


/* --- MORE HEADLINES LIST --- */
.story-list {
  background: #ffffff;
  border-radius: 10px;
  border: 0.5px solid #E0DDD6;
  overflow: hidden;
}

.sl-head {
  padding: 10px 16px;
  border-bottom: 0.5px solid #E0DDD6;
  font-size: 10px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: #999490;
  font-weight: 500;
  background: #F7F5F0;
}

.story {
  display: flex;
  gap: 14px;
  padding: 13px 16px;
  border-bottom: 0.5px solid #F0EDE6;
  cursor: pointer;
  align-items: flex-start;
  transition: background 0.1s;
  text-decoration: none;
  color: inherit;
}

.story:last-child {
  border-bottom: none;
}

.story:hover {
  background: #FAFAF8;
}

.story:hover .s-hed {
  color: #2176C7;
}

.s-num {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 18px;
  font-weight: 400;
  color: #D0CCC4;
  min-width: 22px;
  line-height: 1.3;
  padding-top: 2px;
  flex-shrink: 0;
}

.s-body {
  min-width: 0;
}

.s-hed {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 14px;
  font-weight: 400;
  color: #1A1A1A;
  line-height: 1.5;
  margin-bottom: 4px;
  transition: color 0.15s;
}

.s-meta {
  font-size: 11px;
  color: #999490;
}

.s-source {
  font-weight: 500;
  color: #666660;
}


/* --- AD SLOTS --- */
.ad-slot {
  border-radius: 8px;
  overflow: hidden;
}

.ad-placeholder {
  background: #F0EDE6;
  border: 0.5px dashed #D0CCC4;
  border-radius: 8px;
  text-align: center;
  padding: 20px;
  font-size: 11px;
  color: #999490;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.ad-slot--leaderboard .ad-placeholder {
  min-height: 90px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ad-slot--sidebar .ad-placeholder,
.ad-slot--sidebar-bottom .ad-placeholder {
  min-height: 250px;
  display: flex;
  align-items: center;
  justify-content: center;
}


/* --- TRENDING TOPICS --- */
.topics-row {
  background: #ffffff;
  border-radius: 10px;
  border: 0.5px solid #E0DDD6;
  padding: 14px 16px;
}

.topics-label {
  font-size: 10px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: #999490;
  margin-bottom: 10px;
  font-weight: 500;
}

.topics {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tp {
  font-size: 11px;
  padding: 5px 12px;
  border-radius: 20px;
  border: 0.5px solid #D0CCC4;
  color: #666660;
  cursor: pointer;
  background: #ffffff;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  display: inline-block;
}

.tp:hover {
  background: #EAF2FC;
  color: #1A5FA0;
  border-color: #2176C7;
}


/* =============================================================
   SIDEBAR
============================================================= */
.sidebar {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
  position: sticky;
  top: 130px; /* clears sticky header */
}


/* --- LOAN PULSE CALCULATOR --- */
.calc-widget {
  border-radius: 10px;
  overflow: hidden;
  border: 0.5px solid #2176C7;
}

.cw-head {
  background: #2176C7;
  padding: 13px 16px;
}

.cw-label {
  font-size: 10px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: #A8D0F5;
  margin-bottom: 3px;
  font-weight: 500;
}

.cw-title {
  font-size: 15px;
  font-weight: 500;
  color: #ffffff;
}

.cw-body {
  background: #ffffff;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.cf {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1px 0;
}

.cf-l {
  font-size: 12px;
  color: #888880;
}

.cf-r {
  font-size: 12px;
  font-weight: 500;
  color: #2A2A2A;
}

.cw-divider {
  height: 0.5px;
  background: #E0DDD6;
  margin: 2px 0;
}

.cw-result {
  background: #EAF2FC;
  border-radius: 8px;
  padding: 11px 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 4px;
}

.cwr-label {
  font-size: 11px;
  color: #1A5FA0;
  margin-bottom: 2px;
}

.cwr-val {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 24px;
  font-weight: 400;
  color: #0C2340;
  letter-spacing: -0.5px;
}

.cwr-right {
  text-align: right;
}

.cwr-sub {
  font-size: 10px;
  color: #7AAAD8;
}

.cwr-sub-val {
  font-size: 14px;
  font-weight: 500;
  color: #2176C7;
}

.cw-cta {
  display: block;
  width: 100%;
  padding: 10px;
  font-size: 12px;
  font-weight: 500;
  color: #2176C7;
  border: none;
  background: #F7F5F0;
  cursor: pointer;
  border-top: 0.5px solid #E0DDD6;
  text-align: center;
  transition: background 0.15s;
  font-family: 'Source Sans 3', sans-serif;
}

.cw-cta:hover {
  background: #EAF2FC;
  color: #2176C7;
}

.cw-features {
  font-size: 10px;
  color: #999490;
  text-align: center;
  padding: 6px 14px 10px;
  background: #F7F5F0;
  border-top: 0.5px solid #E0DDD6;
}


/* --- RATE SIGNAL WIDGET --- */
.rates-widget {
  background: #ffffff;
  border-radius: 10px;
  border: 0.5px solid #E0DDD6;
  overflow: hidden;
}

.rw-head {
  padding: 10px 16px;
  background: #F7F5F0;
  border-bottom: 0.5px solid #E0DDD6;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.rw-title {
  font-size: 10px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: #999490;
  font-weight: 500;
}

.rw-link {
  font-size: 11px;
  color: #2176C7;
  cursor: pointer;
}

.rw-link:hover {
  text-decoration: underline;
}

.rw-body {
  padding: 4px 16px;
}

.rl {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 9px 0;
  border-bottom: 0.5px solid #F0EDE6;
}

.rl:last-child {
  border-bottom: none;
}

.rl-name {
  font-size: 12px;
  color: #666660;
}

.rl-right {
  text-align: right;
}

.rl-val {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 15px;
  font-weight: 400;
  color: #1A1A1A;
}

.rl-chg {
  font-size: 11px;
  font-weight: 500;
}


/* --- NEWSLETTER --- */
.nl {
  background: #ffffff;
  border-radius: 10px;
  border: 0.5px solid #E0DDD6;
  padding: 16px;
}

.nl-hed {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 15px;
  font-weight: 400;
  color: #1A1A1A;
  margin-bottom: 5px;
}

.nl-sub {
  font-size: 12px;
  color: #888880;
  line-height: 1.6;
  margin-bottom: 12px;
}

.nl-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.nl-input {
  width: 100%;
  padding: 9px 12px;
  font-size: 12px;
  border-radius: 8px;
  border: 0.5px solid #D0CCC4;
  background: #F7F5F0;
  color: #1A1A1A;
  font-family: 'Source Sans 3', sans-serif;
  transition: border-color 0.15s;
}

.nl-input:focus {
  outline: none;
  border-color: #2176C7;
}

.nl-btn {
  width: 100%;
  padding: 9px;
  font-size: 12px;
  font-weight: 500;
  border-radius: 8px;
  border: none;
  background: #2176C7;
  color: #ffffff;
  cursor: pointer;
  font-family: 'Source Sans 3', sans-serif;
  transition: background 0.15s;
}

.nl-btn:hover {
  background: #1A5FA0;
}


/* =============================================================
   FOOTER
============================================================= */
.mw-footer {
  background: #0A1C30;
  width: 100%;
  border-top: 0.5px solid rgba(255,255,255,0.06);
}

.mw-footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  padding-top: 14px;
  padding-bottom: 14px;
}

.mw-fl {
  font-size: 11px;
  color: #7AAAD8;
}

.mw-fr {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
}

.mw-fr a {
  font-size: 11px;
  color: #7AAAD8;
  transition: color 0.15s;
}

.mw-fr a:hover {
  color: #ffffff;
}


/* =============================================================
   RESPONSIVE — TABLET (max 1024px)
============================================================= */
@media (max-width: 1024px) {
  .mw-body {
    grid-template-columns: 1fr 260px;
    gap: 16px;
    padding: 16px;
  }

  .hero-hed {
    font-size: 19px;
  }

  .sidebar {
    top: 120px;
  }
}


/* =============================================================
   RESPONSIVE — SMALL TABLET (max 768px)
============================================================= */
@media (max-width: 768px) {

  /* Nav: show hamburger, hide center links by default */
  .nav-toggle {
    display: flex;
    order: 3;
  }

  .nav-center {
    display: none;
    position: absolute;
    top: 56px;
    left: 0;
    right: 0;
    background: #0C2340;
    flex-direction: column;
    padding: 12px 16px;
    border-top: 0.5px solid rgba(255,255,255,0.1);
    border-bottom: 0.5px solid rgba(255,255,255,0.1);
    z-index: 200;
    gap: 4px;
  }

  .nav-center.open {
    display: flex;
  }

  .nav-pill {
    padding: 8px 12px;
    border-radius: 8px;
  }

  .nav-right {
    order: 2;
  }

  /* Hide scrolling subnav at this width, show select instead */
  .subnav-wrap {
    display: none;
  }

  .subnav-select-wrap {
    display: block;
  }

  /* Rate bar: compress */
  .rc {
    padding: 8px 14px 8px 0;
    margin-right: 14px;
  }

  .rc-val {
    font-size: 14px;
  }

  .rc-ts {
    display: none;
  }

  /* Body: sidebar drops below feed */
  .mw-body {
    grid-template-columns: 1fr;
    padding: 14px;
    gap: 14px;
  }

  /* Sidebar: unstick, full width row layout */
  .sidebar {
    position: static;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
  }

  /* Calc widget spans full width on tablet */
  .calc-widget {
    grid-column: 1 / -1;
  }

  /* Hide sidebar ad slots on tablet to reduce clutter */
  .ad-slot--sidebar,
  .ad-slot--sidebar-bottom {
    display: none;
  }

  .hero-hed {
    font-size: 18px;
  }
}


/* =============================================================
   RESPONSIVE — MOBILE (max 480px)
============================================================= */
@media (max-width: 480px) {

  .mw-nav {
    padding: 0 16px;
    height: 52px;
  }

  .logo-text {
    font-size: 15px;
  }

  .btn-solid {
    font-size: 11px;
    padding: 5px 12px;
  }

  /* Rate bar: show only first 2 rates */

  .rc:nth-child(n+3) {
    display: none;
  }

  /* Hide scrolling subnav on mobile, show select instead */
  .subnav-wrap {
    display: none;
  }

  .subnav-select-wrap {
    display: block;
  }

  /* Body */
  .mw-body {
    padding: 12px;
    gap: 12px;
  }

  /* Hero */
  .hero-inner {
    padding: 16px;
  }

  .hero-hed {
    font-size: 17px;
  }

  .hero-dek {
    font-size: 12px;
  }

  .hero-foot {
    padding: 10px 16px;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }

  /* Card grid: single column */
  .card-grid {
    grid-template-columns: 1fr;
  }

  /* Sidebar: single column */
  .sidebar {
    grid-template-columns: 1fr;
  }

  /* Footer */
  .mw-footer {
    flex-direction: column;
    align-items: flex-start;
    padding: 14px 16px;
  }

  .mw-fr {
    gap: 12px;
  }
}
