/* mobile-b.css: phone fixes (origins, finishes, yard, in-the-yard, builders, promise, guide, visit, footer, header) */

/* ==========================================================================
   Phones (<= 600px). One left edge for every section:
   panel content sits on --gutter (panel margin + border + padding),
   so the full-bleed sections (Yard, Builders, Promise, footer) use the same edge.
   ========================================================================== */
@media (max-width: 600px) {
  /* follow the shared phone tokens from mobile-a.css (--gutter, --panel-m) */
  :root { --mb-edge: var(--gutter, 24px); --mb-panel-pad: calc(var(--gutter, 24px) - var(--panel-m, 8px) - 1px); --mb-card-pad: 18px; }

  /* ---------- full-bleed sections share the panel content edge ---------- */
  .yard .wrap.section,
  .builders .wrap.section,
  .promise > .wrap,
  .footer > .wrap { padding-left: var(--mb-edge) !important; padding-right: var(--mb-edge) !important; }

  /* ======================================================================
     ORIGINS
     ====================================================================== */
  #origins .wrap > * { min-width: 0; }
  #origins .origin-band { margin: 26px 0 14px !important; }
  #origins .origin-cards {
    grid-template-columns: minmax(0, 1fr) !important;
    grid-template-rows: none !important;
    gap: 12px !important; margin: 0 0 8px !important;
  }
  #origins .origin-card {
    grid-row: auto !important; display: flex !important; flex-direction: column;
    padding: 20px var(--mb-card-pad) !important; min-width: 0;
  }
  #origins .origin-card:hover { transform: none; }
  #origins .oc-state { margin: 0 0 14px !important; padding-bottom: 12px; white-space: normal; flex-wrap: wrap; }
  #origins .oc-block { margin-bottom: 14px; padding-bottom: 0; }
  #origins .oc-towns { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; gap: 6px 14px !important; }
  #origins .oc-dist { margin-top: 2px !important; white-space: normal; }

  /* Italy: one column, the quote wraps, the three regions stack as rows */
  #origins .italy { display: grid !important; grid-template-columns: minmax(0, 1fr) !important; min-height: 0 !important; width: 100%; }
  #origins .italy-media { position: relative !important; inset: auto !important; aspect-ratio: 16 / 9; }
  #origins .italy-copy { min-width: 0; padding: 20px var(--mb-card-pad) 8px !important; gap: 14px !important; }
  #origins .italy-quote, #origins .section p.italy-quote, .section p.italy-quote {
    white-space: normal !important; font-size: var(--t-title) !important; line-height: 1.3;
  }
  #origins .italy-regions { grid-template-columns: minmax(0, 1fr) !important; column-gap: 0 !important; }
  #origins .italy-regions > div {
    grid-template-columns: auto minmax(0, 1fr) !important; column-gap: 12px; align-items: baseline;
    padding: 12px 0 !important; border-bottom: 1px solid var(--line) !important;
  }
  #origins .italy-regions > div:last-child { border-bottom: 0 !important; }
  #origins .ir-region { margin-top: 0; }
  #origins .ir-stones { grid-column: 1 / -1; letter-spacing: .12em; }

  /* ======================================================================
     FINISHES: stacked cards, photo then copy, same inner padding
     ====================================================================== */
  .finishes .finish-grid { grid-template-columns: minmax(0, 1fr) !important; }
  .finishes .finish > h3, .finishes .finish > .f-feel, .finishes .finish > p { padding: 0 var(--mb-card-pad) !important; }
  .finishes .f-img { aspect-ratio: 16 / 10; }

  /* ======================================================================
     THE YARD
     ====================================================================== */
  .yard .yard-copy .btn { width: 100%; justify-content: center; }

  /* ======================================================================
     IN THE YARD NOW: swipe strip bleeds to the panel edge, first card on the gutter
     ====================================================================== */
  #in-the-yard .in-yard-head { gap: 14px; }
  #in-the-yard .in-yard-head .section-head { margin-bottom: 0 !important; }
  #in-the-yard .in-yard-head .btn { width: 100%; justify-content: center; }
  #in-the-yard .yard-gallery {
    margin-left: calc(-1 * var(--mb-panel-pad)); margin-right: calc(-1 * var(--mb-panel-pad));
    padding-left: var(--mb-panel-pad); padding-right: var(--mb-panel-pad);
    scroll-padding-inline: var(--mb-panel-pad) !important;
    -webkit-overflow-scrolling: touch; touch-action: pan-x pan-y;
    -webkit-mask-image: none; mask-image: none;
  }
  #in-the-yard .yard-item, #in-the-yard .yard-item.wide { width: 74vw !important; max-width: 300px; }
  #in-the-yard .yard-open, #in-the-yard .yard-item:not(.wide) .yard-open { height: 240px !important; width: 100%; }

  /* ======================================================================
     BUILDERS: copy aligned to the same left edge as every other section
     ====================================================================== */
  .builders.city { text-align: left; }
  .builders .city-copy { justify-items: start; }
  .builders .city-copy::before { inset: -6% -10%; }
  .builders .eyebrow.center::after { display: none; }
  .builders .city-big { max-width: none; }
  .builders .builder-types { display: flex !important; flex-wrap: wrap; justify-content: flex-start; gap: 8px !important; padding: 0; margin: 4px 0 6px; }
  .builders .builder-types li { padding: 9px 12px; }
  .builders .city-copy .btn { width: 100%; justify-content: center; gap: 12px; padding: 0 16px !important; letter-spacing: .14em !important; white-space: nowrap; }

  /* ======================================================================
     PROMISE: centred quote, same gutters
     ====================================================================== */
  .promise blockquote { max-width: none; }

  /* ======================================================================
     GUIDE / FAQ
     ====================================================================== */
  #guide .faq-aside h2 { margin: 16px 0 14px !important; }
  #guide .faq-aside p { margin-bottom: 20px; }
  #guide .faq-aside .btn { width: 100%; justify-content: center; }
  #guide .faq-grid { grid-template-columns: minmax(0, 1fr) !important; gap: 28px !important; }
  #guide .faq-list { margin-top: 0; }
  #guide .faq summary { min-height: 44px; padding: 14px 0; gap: 16px; }

  /* ======================================================================
     VISIT: full-width fields, full-width Send, WhatsApp centred under it
     ====================================================================== */
  #visit .visit-grid { grid-template-columns: minmax(0, 1fr) !important; gap: 28px; }
  #visit .visit-grid > div:first-child > h2 { margin: 16px 0 14px !important; }
  #visit .form { grid-template-columns: minmax(0, 1fr) !important; gap: 16px; }
  #visit .form-row { grid-template-columns: minmax(0, 1fr) !important; gap: 16px; }
  #visit .field input, #visit .field select, #visit .field textarea { width: 100%; min-height: 48px; box-sizing: border-box; }
  #visit .field textarea { height: 110px; min-height: 96px; }
  #visit .cf-turnstile { width: 100%; }
  #visit .cf-turnstile:empty { display: none; }
  #visit .form-actions { flex-direction: column; align-items: stretch; gap: 16px; margin-top: 4px; }
  #visit .form-actions .btn { width: 100%; justify-content: center; }
  #visit .form-actions .link-line { align-self: center; position: relative; }
  #visit .form-actions .link-line::before { content: ""; position: absolute; inset: -14px -18px; }
  #visit .form-status:empty { min-height: 0; }
  #visit .form-status, #visit .form-note { margin: 0; text-align: center; }

  /* contact card: label above value, map full width */
  #visit .visit-card { padding: 22px var(--mb-card-pad) !important; }
  #visit .visit-card .visit-row { grid-template-columns: minmax(0, 1fr) !important; row-gap: 6px; }
  #visit .visit-card .visit-row .v { white-space: normal !important; overflow-wrap: anywhere; }
  #visit .visit-card .visit-row .v a, #visit .visit-card .visit-row .link-line { display: inline-flex; align-items: center; min-height: 44px; }
  #visit .visit-card .visit-row:first-child .link-line { margin-top: 0 !important; padding-bottom: 0; }
  #visit .visit-card .visit-map { aspect-ratio: 4 / 3 !important; height: auto; }

  /* ======================================================================
     FOOTER: one column, clear of the floating Sound and WhatsApp buttons
     ====================================================================== */
  .footer { padding-bottom: 96px; }
  .footer-top { grid-template-columns: minmax(0, 1fr) !important; gap: 30px; }
  .footer .brand { min-height: 44px; align-items: center; }
  .footer ul { gap: 0 !important; }
  .footer li { display: flex; align-items: center; min-height: 40px; padding: 4px 0; }
  .footer li a { display: inline-flex; align-items: center; min-height: 44px; margin: -6px 0; }
  .footer-big { font-size: min(11.2vw, 3.4rem) !important; white-space: nowrap; letter-spacing: 0 !important; }
  .footer-base { flex-direction: column; gap: 8px; }
}
