/* =========================================================================
   FCT responsive layer (theme 2.2) — loaded after main.css and blocks.css,
   on the site and in the editor.

   - Wider, fluid page width on laptops and large screens (less empty margin).
   - One fluid side gutter everywhere (16px on phones … 48px on desktops).
   - Phones: compact chat button, call/book bar, stacked tables, 2-column
     footer links and trust badges, hero picture that stays on screen.
   - Tablets & small laptops: one-line navigation, centred hero picture.
   - Phones held sideways: shorter header and hero so content shows.
   ========================================================================= */

:root{
  --maxw:1440px; /* content width = --maxw − 2 × 48px = theme.json contentSize (1344px) */
  --gutter:clamp(16px, 4vw, 48px);
}

/* ---------- Page width & gutters ---------- */
.wrap,
.header-main.is-layout-flex{ max-width:var(--maxw); padding-left:var(--gutter); padding-right:var(--gutter); }
.topbar .wrap{ padding-left:var(--gutter); padding-right:var(--gutter); }
.footer .wrap{ padding-left:var(--gutter); padding-right:var(--gutter); }
/* Full-width bands built from blocks keep the same side gutter */
.search-band{ padding-left:var(--gutter) !important; padding-right:var(--gutter) !important; }
.search-band .search-form, .search-band form{ max-width:100%; }

/* Large screens: slightly bigger headings so wide layouts don't look sparse */
@media (min-width:1440px){
  .is-style-hero h1, .is-style-display, .hero h1{ font-size:3.625rem; }
  .is-style-section-head h2, .is-style-section-head-left h2{ font-size:2.625rem; }
  .is-style-hero .is-style-lead{ max-width:600px; }
}

/* ---------- Header & navigation: never wraps onto two lines ---------- */
.nav-row .wrap{ flex-wrap:nowrap; }
.nav-row .wrap > :first-child{ min-width:0; }
@media (max-width:1300px) and (min-width:981px){
  .nav-link{ padding:0 10px; font-size:.9375rem; }
  .nav-item.active > .nav-link::after{ left:10px; right:10px; }
  /* Search: icon only (the word stays for screen readers) */
  .nav-search-btn{ font-size:0; gap:0; width:44px; padding:0; justify-content:center; }
  .nav-search-btn svg{ width:19px; height:19px; }
  .call-block .cap{ max-width:230px; white-space:normal; display:-webkit-box; -webkit-box-orient:vertical; -webkit-line-clamp:2; line-clamp:2; overflow:hidden; font-size:.78rem; }
  .header-main.is-layout-flex{ gap:16px; }
}
@media (max-width:1100px) and (min-width:981px){
  .nav-link{ padding:0 8px; font-size:.9063rem; }
  .call-block .cap{ display:none; }
}

/* ---------- Hero picture ---------- */
@media (max-width:980px){
  .wp-block-fct-hero-art, .hero-art{ max-width:560px; margin-left:auto; margin-right:auto; width:100%; }
  .wp-block-fct-hero-art .fc-top{ top:-16px; left:12px; }
  .wp-block-fct-hero-art .fc-bottom{ bottom:-16px; right:12px; }
}
@media (max-width:640px){
  .wp-block-fct-hero-art .float-card{ transform:scale(.9); transform-origin:left top; }
  .wp-block-fct-hero-art .fc-bottom{ transform-origin:right bottom; }
  .hero-art-card.has-photo img{ min-height:240px; }
}

/* ---------- Trust badges: tidy grid instead of a ragged column ---------- */
@media (max-width:640px){
  .wp-block-fct-trust-badges.badges, .footer .footer-badges{ display:grid !important; grid-template-columns:repeat(2, minmax(0,1fr)); gap:10px; justify-content:stretch; }
  .wp-block-fct-trust-badges .tbadge, .footer-badges .tbadge{ width:100%; min-width:0; margin:0; }
}
@media (max-width:480px){
  .wp-block-fct-trust-badges.badges, .footer .footer-badges{ grid-template-columns:minmax(0,1fr); gap:8px; }
}

/* ---------- Services (full sections) ---------- */
@media (max-width:980px){
  /* no picture uploaded: the icon box only repeats the heading icon — skip it on small screens */
  .fct-services-detail .service-art{ display:none; }
  .fct-services-detail .service-photo{ min-height:0; aspect-ratio:16 / 10; }
  .fct-services-detail .service-row{ padding:32px 0; }
  .fct-services-detail .service-text h2{ font-size:1.5rem; }
}

/* ---------- Tables become cards on phones ---------- */
@media (max-width:640px){
  .wp-block-table.is-style-fct, .table-wrap{ overflow:visible; }
  .wp-block-table.is-style-fct table, .rate-table{ border:0 !important; background:none !important; }
  .wp-block-table.is-style-fct thead, .rate-table thead{ position:absolute; width:1px; height:1px; overflow:hidden; clip:rect(0 0 0 0); white-space:nowrap; }
  .wp-block-table.is-style-fct tbody, .rate-table tbody,
  .wp-block-table.is-style-fct tr, .rate-table tr{ display:block; }
  .wp-block-table.is-style-fct tr, .rate-table tr{ background:#fff; border:1px solid var(--line); border-radius:16px; padding:14px 16px; margin-bottom:12px; box-shadow:var(--shadow-soft, 0 4px 14px rgba(20,50,45,.06)); }
  .wp-block-table.is-style-fct td, .rate-table td, .rate-table tbody th{ display:grid; grid-template-columns:minmax(0, 42%) minmax(0,1fr); gap:12px; padding:8px 0 !important; border:0 !important; background:none !important; white-space:normal !important; text-align:left; font-size:1rem; }
  .wp-block-table.is-style-fct td + td, .rate-table td{ border-top:1px dashed var(--line) !important; }
  .wp-block-table.is-style-fct td::before, .rate-table td::before, .rate-table tbody th::before{ content:attr(data-label); font-family:"Montserrat",sans-serif; font-size:.75rem; font-weight:700; letter-spacing:.5px; text-transform:uppercase; color:var(--ink-500); padding-top:3px; }
  .wp-block-table.is-style-fct td:not([data-label])::before, .rate-table td:not([data-label])::before{ content:none; }
  .wp-block-table.is-style-fct td:not([data-label]), .rate-table td:not([data-label]){ grid-template-columns:minmax(0,1fr); }
  .wp-block-table.is-style-fct td a{ white-space:normal; }
  .rate-table tbody th{ font-size:1.125rem; color:var(--teal-900); }
  .rate-table tbody th::before{ content:none; }
  .rate-table tbody th{ grid-template-columns:minmax(0,1fr); }
  .rate-table td > small{ grid-column:2; margin-top:-6px; color:var(--ink-500); }
  /* the old 640px rule hid the 3rd column of .tbl tables; cards show everything */
  .tbl th:nth-child(3), .tbl td:nth-child(3){ display:revert; }
}

/* ---------- Footer: two columns of links on phones ---------- */
@media (max-width:781px){
  .footer-top.wp-block-columns{ display:grid !important; grid-template-columns:repeat(2, minmax(0,1fr)); gap:30px 20px; }
  .footer-top.wp-block-columns > .wp-block-column{ flex-basis:auto !important; min-width:0; }
  .footer-top.wp-block-columns > .footer-brand,
  .footer-top.wp-block-columns > .wp-block-column:nth-child(4),
  .footer-top.wp-block-columns > .wp-block-column:last-child{ grid-column:1 / -1; }
  .footer-top.wp-block-columns > .wp-block-column:nth-child(4) ul{ columns:2; column-gap:20px; }
  .footer-top.wp-block-columns > .wp-block-column:nth-child(4) li{ break-inside:avoid; }
  .footer .fct-menu a{ min-height:40px; }
  .footer-contact a, .footer .contact-list a{ overflow-wrap:anywhere; }
}
@media (max-width:359px){
  .footer-top.wp-block-columns{ grid-template-columns:minmax(0,1fr); }
}
/* Small laptops, tablets & phones held sideways: logo on its own row, four link columns below */
@media (min-width:782px) and (max-width:1100px){
  .footer-top.wp-block-columns{ display:grid !important; grid-template-columns:repeat(4, minmax(0,1fr)); gap:30px 24px; }
  .footer-top.wp-block-columns > .wp-block-column{ flex-basis:auto !important; min-width:0; }
  .footer-top.wp-block-columns > .footer-brand,
  .footer-top.wp-block-columns > .wp-block-column:first-child{ grid-column:1 / -1; max-width:560px; }
}

/* ---------- Phones: call/book bar + compact chat button ---------- */
@media (max-width:767.98px){
  .mbar{ display:flex; padding:10px max(14px, env(safe-area-inset-right)) calc(10px + env(safe-area-inset-bottom)) max(14px, env(safe-area-inset-left)); }
  body{ padding-bottom:calc(78px + env(safe-area-inset-bottom)); }
  /* Built-in live chat: a round button above the bar instead of a wide pill over the content */
  .fct-lc .fct-lc-launcher{ padding:0; width:58px; height:58px; justify-content:center; right:14px; }
  .fct-lc .fct-lc-launcher .fct-lc-label{ position:absolute !important; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip:rect(0 0 0 0); white-space:nowrap; border:0; }
  .fct-lc .fct-lc-launcher > .fct-lc-dot{ left:auto; right:6px; top:6px; }
  .chat-fab{ right:14px; }
  /* Buttons that sit side by side wrap neatly */
  .wp-block-buttons > .wp-block-button{ flex:1 1 auto; }
  .is-style-card .wp-block-buttons > .wp-block-button, .aud-card .wp-block-buttons > .wp-block-button{ flex:1 1 100%; }
  .is-style-card .wp-block-button__link, .aud-card .wp-block-button__link{ width:100%; }
}
/* No call/book bar (switched off): chat button goes back to the corner */
body:not(:has(.mbar)) { --fct-chat-bottom:20px; }

/* ---------- Phones: spacing & type ---------- */
@media (max-width:640px){
  .wp-block-group.is-style-panel, .fct-form-block.card, .est-form.card{ padding:22px 16px; }
  .is-style-card{ --card-pad:22px; }
  .pagehead h1{ font-size:1.875rem; line-height:1.15; }
  .is-style-hero h1, .is-style-display, .hero h1{ font-size:2.125rem; line-height:1.12; }
  p.is-style-eyebrow{ font-size:.75rem; letter-spacing:1.2px; padding:7px 14px 7px 12px; }
  .crumbs{ flex-wrap:wrap; row-gap:4px; }
  .fct-estimator .radio-cards{ gap:10px; }
  .est-result.card{ padding:22px 18px; }
  .table-wrap{ margin-left:0; margin-right:0; }
}

/* ---------- Phones held sideways (short screens) ---------- */
@media (max-height:520px) and (orientation:landscape){
  .wp-site-blocks > header.wp-block-template-part{ position:relative; top:auto; }
  .topbar{ display:none; }
  .header-main.is-layout-flex{ padding-top:6px; padding-bottom:6px; }
  .wp-block-group.is-style-hero{ padding-top:24px; padding-bottom:32px; }
  .is-style-hero h1, .is-style-display, .hero h1{ font-size:2rem; }
  .pagehead{ padding:28px 0 26px; }
  .pagehead h1{ font-size:1.75rem; }
  .fct-lc .fct-lc-launcher{ bottom:16px; padding:0; width:52px; height:52px; justify-content:center; right:14px; }
  .fct-lc .fct-lc-launcher .fct-lc-label{ position:absolute !important; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip:rect(0 0 0 0); white-space:nowrap; border:0; }
  .fct-lc .fct-lc-launcher > .fct-lc-dot{ left:auto; right:5px; top:5px; }
  .fct-lc .fct-lc-panel{ top:8px; bottom:8px; }
}

/* ---------- Tablets ---------- */
@media (min-width:641px) and (max-width:980px){
  .is-style-hero h1, .is-style-display{ font-size:2.75rem; }
  .fct-paths .aud-grid{ grid-template-columns:repeat(2, minmax(0,1fr)); }
  .fct-paths .aud-grid > :last-child:nth-child(odd){ grid-column:1 / -1; }
}

/* ---------- Page-header picture: smaller file on phones ---------- */
@media (max-width:767.98px){
  .pagehead[style*="--fct-ph-sm"]{ background-image:linear-gradient(rgba(10,40,36,.84),rgba(10,40,36,.84)), var(--fct-ph-sm) !important; }
}

/* ---------- Media never overflows its box ---------- */
img, video, iframe, svg{ max-width:100%; }
img{ height:auto; }
.wp-block-embed iframe, .fct-booking iframe{ width:100%; }
