/* ==========================================================================
   Beveridge Driveways — phone and tablet layout
   Loaded straight after styles.css. Almost every rule here is inside a media
   query for a size where the layout needed adjusting. The exception is the
   mobile call bar rule, and that bar only shows on phones.
   ========================================================================== */

/* ---------- Header: phone number as a call button where the full number doesn't fit ---------- */
@media (max-width: 760px), (min-width: 1101px) and (max-width: 1239px) {
  .header-phone {
    display: inline-flex; flex: none; justify-content: center;
    width: 44px; height: 44px; padding: 0; gap: 0;
    border: 1px solid rgba(251, 245, 234, 0.4); border-radius: 12px;
    transition: background-color 0.2s, border-color 0.2s;
  }
  .header-phone .icon { width: 20px; height: 20px; }
  /* The number stays in the link (its accessible name), just not shown */
  .header-phone__number {
    position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
    overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
  }
}
/* Where the header number would only be an icon, devices that can't call show nothing:
   an icon you can't press tells you nothing. The number is still in the hero and footer. */
@media (max-width: 760px), (min-width: 1101px) and (max-width: 1239px) {
  .no-calls .header-phone { display: none; }
}
@media (hover: hover) and (pointer: fine) and (max-width: 760px), (hover: hover) and (pointer: fine) and (min-width: 1101px) and (max-width: 1239px) {
  .header-phone:hover { background: rgba(251, 245, 234, 0.1); border-color: rgba(251, 245, 234, 0.7); }
}

/* ---------- Header menu (phones and tablets): slides down and back up ---------- */
@media (max-width: 1100px) {
  .nav {
    opacity: 1; transform: none;
    clip-path: inset(0 0 100% 0);
    transition: clip-path 0.38s var(--ease-out), visibility 0s linear 0.38s;
  }
  /* The negative bottom inset leaves room for the menu's drop shadow */
  .nav.is-open { clip-path: inset(0 0 -60px 0); transition: clip-path 0.38s var(--ease-out), visibility 0s; }
}

/* Phones: slightly smaller logo and wordmark so logo, wordmark, call and menu
   buttons all fit on one line down to 360px */
@media (max-width: 400px) {
  .header-inner { gap: 12px; }
  .header-actions { gap: 8px; }
  .site-header .brand--icon { gap: 8px; }
  .site-header .brand--icon img { width: 38px; height: 38px; border-radius: 10px; }
  .site-header .brand__name { font-size: 16px; }
}

/* ---------- Hero ---------- */
@media (max-width: 999px) {
  /* Content sets the height, so there's no empty photo under it */
  .hero { min-height: 0; }
  .hero__inner { z-index: 0; padding-bottom: 56px; }
  /* The short estimate form sits below the photo: a full-width strip of the page
     background starts 48px above the card and runs to the bottom of the hero,
     so the photo ends 56px under the ticks */
  .hero__card {
    display: block; position: relative; width: 100%; max-width: 560px;
    margin: 104px auto 0; text-align: left;
    border: 1px solid var(--line); box-shadow: var(--shadow);
  }
  .hero__card::before {
    content: ""; position: absolute; z-index: -1;
    top: -48px; bottom: -400px; left: 50%; width: 100vw; transform: translateX(-50%);
    background: var(--paper);
  }
}

/* ---------- Final estimate section: card below the photo when stacked ---------- */
@media (max-width: 980px) {
  .cta__inner { z-index: 0; }
  .cta .quote-card {
    position: relative; margin-top: 48px;
    border: 1px solid var(--line); box-shadow: var(--shadow);
  }
  .cta .quote-card::before {
    content: ""; position: absolute; z-index: -1;
    top: -48px; bottom: -400px; left: 50%; width: 100vw; transform: translateX(-50%);
    background: var(--paper);
  }
  /* No fade-in here: it would briefly layer the background strip over the card */
  .js .cta .quote-card.reveal { opacity: 1; transform: none; transition: none; }
}
@media (max-width: 560px) {
  .hero__cta { flex-direction: column; align-items: center; gap: 12px; }
  .hero__cta .btn { width: 100%; max-width: 420px; }
  /* Ticks: a left-aligned list, centred as a block */
  .hero__proof {
    flex-direction: column; align-items: flex-start; gap: 10px;
    width: fit-content; margin: 32px auto 0;
  }
}

/* ---------- Cards and trust strip on phones ---------- */
@media (max-width: 560px) {
  .quote-card { padding: 24px 18px; }
  /* Keep "Request my free estimate" on one line on narrow phones */
  .quote-card .btn--block { padding-left: 16px; padding-right: 16px; white-space: nowrap; }
  .trust__list { padding: 24px; gap: 16px 24px; }
}
/* Phones: a 16px page margin instead of 24px, so form boxes and text use more of the screen */
@media (max-width: 480px) {
  .container, .trust__list { padding-left: 16px; padding-right: 16px; }
}

/* ---------- Mobile call bar: colour change when pressed, but no grow ---------- */
.callbar .btn:active { transform: none; }

/* ---------- New estates: the three numbered steps ---------- */
/* Tablets: all three in one row, like desktop */
@media (min-width: 720px) and (max-width: 980px) {
  .estates .grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .estates .step { padding: 24px; }
}
/* Phones: one column of compact cards, number on the left, title and text beside it */
@media (max-width: 719px) {
  .estates .grid-3 { grid-template-columns: 1fr; gap: 14px; }
  .estates .step {
    display: grid; grid-template-columns: 32px minmax(0, 1fr); column-gap: 16px;
    align-items: start; padding: 20px 22px;
  }
  .estates .step__num { grid-row: 1 / span 2; font-size: 40px; line-height: 1; }
  .estates .step__title { margin: 2px 0 6px; }
  .estates .step__text { grid-column: 2; }
}

/* ---------- How it works: tablets keep the four steps in a row with the horizontal line ---------- */
@media (min-width: 700px) and (max-width: 900px) {
  .process { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 24px; }
  .process::before { left: 28px; right: 28px; top: 28px; bottom: auto; width: auto; height: 1px; transform-origin: left; }
  .process li { display: block; }
  .process h3 { margin-top: 22px; }
}
@media (min-width: 700px) and (max-width: 900px) and (prefers-reduced-motion: no-preference) {
  .js .process::before { transform: scaleX(0); }
  .js .process.is-visible::before { transform: none; }
}

/* ---------- Service areas: same heading size as other sections; wraps normally ---------- */
@media (max-width: 900px) {
  .areas__title { font-size: clamp(34px, 4.2vw, 56px); }
  .areas__title em { display: inline; white-space: normal; }
}

/* ---------- Footer ---------- */
@media (max-width: 560px) {
  .site-footer { padding: 56px 0 28px; }
  .footer-grid { gap: 32px 24px; }
  .footer-bottom { margin-top: 40px; padding-top: 20px; }
}
/* The space kept clear for the mobile call bar goes inside the dark footer,
   so there's no light strip under it */
@media (max-width: 760px) {
  body.has-callbar { padding-bottom: 0; }
  body.has-callbar .site-footer { padding-bottom: calc(36px + 84px); }
}
@media (max-width: 560px) {
  body.has-callbar .site-footer { padding-bottom: calc(28px + 84px); }
}
