/* ============================
   HERO BANNER OVERLAY (from home_responsive.css)
   ============================ */

.jumbotron {
  position: relative;
  color: white;
  text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.7);
}

.jumbotron::before {
  content: "";
  position: absolute;
  top: 0; 
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5); /* semi-transparent dark overlay */
  z-index: 1;
}

.jumbotron .container {
  position: relative;
  z-index: 2;
}

/* ============================
   GLOBAL BASE TWEAKS
   ============================ */

/* Make images behave on small screens */
img {
  max-width: 100%;
  height: auto;
}

/* Prevent horizontal scroll hell */
body {
  overflow-x: hidden;
}

/* Card images default behaviour (height controlled in breakpoints) */
.card-img-top {
  object-fit: cover;
}

/* Footer Styling (merged versions) */
footer {
  padding: 1.5rem 1rem;
  font-size: 0.95rem;
  background-color: #f1f1f1;
  border-top: 1px solid #ddd;
}

footer a {
  margin-left: 0.5rem;
  font-weight: 600;
  text-decoration: none;
  color: #007bff;
}

footer a:hover {
  text-decoration: underline;
}

#cookie-banner a {
  font-weight: 600;
  text-decoration: none;
}

#cookie-banner a:hover {
  text-decoration: underline;
}

/* Policy pages layout (from home_responsive.css) */
.policy-content {
  max-width: 800px;
  margin: 0 auto;
  padding: 2rem;
  background: #ffffff;
  border: 1px solid #eee;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  border-radius: 12px;
}

.policy-content h1,
.policy-content h2 {
  font-family: 'Oswald-Bold';
  margin-top: 2rem;
  margin-bottom: 1rem;
  font-size: 2rem;
  color: #333;
}

.policy-content h2.h3 {
  font-size: 1.5rem;
  border-bottom: 2px solid #ddd;
  padding-bottom: 0.5rem;
  margin-top: 2.5rem;
}

.policy-content ul {
  padding-left: 1.5rem;
  margin-bottom: 1.5rem;
}

.policy-content ul li {
  margin-bottom: 0.5rem;
}

/* ============================
   EXTRA SMALL DEVICES (≤ 576px)
   Phones
   ============================ */
@media (max-width: 576px) {

  /* Typography scaling (headings) */
  h1, .display-4 {
    font-size: 1.8rem !important;
  }

  h2, .display-3 {
    font-size: 1.5rem !important;
  }

  h3 {
    font-size: 1.2rem !important;
  }

  /* Improved readability for body text (from home_responsive.css) */
  p, 
  .lead, 
  .card-text {
    font-size: 1.05rem;
    line-height: 1.7;
  }

  /* Navbar */
  .navbar-brand img {
    max-height: 40px;
  }

  .navbar-nav .nav-link {
    padding-left: 0.75rem;
    padding-right: 0.75rem;
  }

  /* Jumbotron / Hero sections (home, news, quote, pmiexplained) */
  .jumbotron {
    padding: 2rem 1rem !important;
    text-align: center;
    background-position: center !important;
  }

  .jumbotron .container {
    text-align: center;
  }

  .QuoteNow {
    text-align: center;
  }

  .QuoteNow .btn {
    width: 100%;
  }

  /* Insurer logos strip on home.php */
  .insurer-logo {
    max-width: 120px;
    margin: 10px auto;
    display: block;
  }

  /* Make logo row more compact – roughly 2 per row */
  .row .col-auto {
    flex: 0 0 50%;
    max-width: 50%;
  }

  /* Home – “Find and Arrange PMI…” headline */
  .row .col h5.display-3 {
    font-size: 1.6rem !important;
    text-align: center;
    margin-top: 1rem;
  }

  /* Home – FAQ & Latest News two-column section stacks nicely */
  .container-fluid .row > .col.border {
    margin-top: 1.5rem;
  }

  /* Home / News / Article cards */
  .card {
    margin-bottom: 1.5rem !important;
  }

  .card-img-top {
    height: 160px !important;
  }

  /* Force Bootstrap 3-column (col-md-4) grids into 1-column on mobile */
  .col-md-4 {
    flex: 0 0 100%;
    max-width: 100%;
  }

  /* Sidebar (news.php quote sidebar, pmiexplained.php sidebar) */
  .sidebar-col,
  .quote-sidebar,
  .col-12.col-md-4 {
    margin-top: 2rem;
  }

  /* PMI Explained – main layout */
  .content-col {
    margin-bottom: 2rem;
  }

  .sidebar-col {
    min-height: auto !important;
  }

  /* Collapsible blocks – give breathing room */
  .collapsible-block {
    margin-bottom: 1rem;
  }

  .collapsible-block .toggle-title {
    font-size: 1.1rem;
    padding: 0.5rem 0;
  }

  /* Quote page – title & stepper layout */
  #title-container {
    text-align: center;
    margin-bottom: 2rem;
  }

  #title-container h2 {
    font-size: 1.6rem;
  }

  #title-container h3 {
    font-size: 1.2rem;
  }

  #qbox-container {
    padding: 0 0.5rem !important;
  }

  #form-wrapper {
    padding: 1rem;
  }

  .step h4 {
    font-size: 1.1rem;
  }

  .form-group label {
    font-size: 0.9rem;
  }

  /* Multi-step buttons – full width on mobile */
  #q-box__buttons .btn {
    width: 100%;
    margin-bottom: 0.75rem;
  }

  /* Progress bar – a bit taller on small screens */
  .progress {
    height: 0.75rem;
  }

  /* Footer links spacing */
  footer p a {
    display: inline-block;
    margin: 0.25rem 0.5rem;
  }

  /* Cookie banner (home.php) – make buttons stack nicely */
  #cookie-banner {
    text-align: left;
    font-size: 0.9rem;
  }

  #cookie-banner button {
    margin-top: 0.5rem;
    width: 100%;
  }

  /* Policy content on small screens */
  .policy-content {
    padding: 1rem;
  }

  .policy-content h1 {
    font-size: 1.75rem;
  }

  .policy-content h2.h3 {
    font-size: 1.25rem;
  }
}

/* ============================
   SMALL / MEDIUM DEVICES
   (577px – 768px)
   Larger phones & small tablets
   ============================ */
@media (max-width: 768px) {

  .display-4 {
    font-size: 2.2rem !important;
  }

  .display-3 {
    font-size: 1.8rem !important;
  }

  .lead {
    font-size: 1rem;
  }

  /* Jumbotron text */
  .QuoteNow {
    text-align: center;
    padding: 1rem;
  }

  /* Insurer logos – 3 per row instead of all in one line */
  .row .col-auto {
    flex: 0 0 33.3333%;
    max-width: 33.3333%;
    text-align: center;
  }

  .insurer-logo {
    max-width: 130px;
  }

  /* Article grid – from 3 per row → 1 per row on phones/very small, but
     ensure at this breakpoint general col-md-4 cards take full width too
     (from original home_responsive). */
  .row > .col-md-4 {
    flex: 0 0 100%;
    max-width: 100%;
    margin-bottom: 1rem;
  }

  /* News.php: make main + sidebar spacing nicer */
  .container-fluid.my-5 .row > .col-md-8 {
    margin-bottom: 2rem;
  }

  .col-12.col-md-4 {
    margin-top: 0;
  }

  /* PMI Explained – sidebar below on small tablets too */
  .sidebar-col {
    margin-top: 2rem;
    min-height: auto !important;
  }

  /* Quote form – keep form readable and centered */
  .container-fluid.d-flex.align-items-center.py-5 {
    padding: 2rem 1rem !important;
  }

  #qbox-container {
    margin-top: 2rem;
  }
}

/* ============================
   MEDIUM DEVICES
   (769px – 992px)
   Portrait tablets, small laptops
   ============================ */
@media (max-width: 992px) {

  .display-4 {
    font-size: 2.8rem !important;
  }

  .display-3 {
    font-size: 2.2rem !important;
  }

  /* Insurer logos – sensible size */
  .insurer-logo {
    max-width: 140px;
  }

  /* Article grid: 3 → 2 per row on mid screens */
  .col-md-4 {
    flex: 0 0 50%;
    max-width: 50%;
  }

  /* PMI Explained – allow natural heights */
  .sidebar-col {
    min-height: auto !important;
  }

  /* Quote layout – text + form stacked more comfortably */
  #title-container {
    padding-right: 1rem;
  }

  #qbox-container {
    padding-left: 1rem;
  }
}

/* ============================
   LARGE DEVICES (993px – 1199px)
   Standard desktops, large tablets landscape
   ============================ */
@media (min-width: 993px) and (max-width: 1199px) {

  /* Slightly shrink huge headings to avoid wrapping too much */
  .display-4 {
    font-size: 3rem !important;
  }

  .display-3 {
    font-size: 2.4rem !important;
  }

  .insurer-logo {
    max-width: 160px;
  }

  /* News / Home cards: keep at 3 per row but roomy */
  .col-md-4 {
    flex: 0 0 33.3333%;
    max-width: 33.3333%;
  }
}

/* ============================
   EXTRA LARGE DEVICES (≥ 1200px)
   Big desktops / wide monitors
   ============================ */
@media (min-width: 1200px) {

  .insurer-logo {
    max-width: 180px;
  }

  .QuoteNow {
    max-width: 600px;
  }

  .QuoteNow h1.display-4 {
    font-size: 3.2rem;
  }

  .QuoteNow .lead {
    font-size: 1.2rem;
  }

  /* Give the main content a bit more breathing space */
  .container,
  .container-fluid.my-5 {
    padding-left: 2rem;
    padding-right: 2rem;
  }
}
