/*
Theme Name: CDM Blocks
Template: twentytwentyfive
Author: SYNF
Description: CDM Plumbing & Bathrooms conversion homepage, built in native WordPress blocks. Child of Twenty Twenty-Five.
Version: 1.0
*/

/* Sticky branded header */
header.wp-block-template-part { position: sticky; top: 0; z-index: 100; box-shadow: 0 4px 18px -10px rgba(0,0,0,.55); }

/* Button polish */
.wp-block-button__link { transition: transform .12s ease, filter .2s ease; }
.wp-block-button__link:hover { filter: brightness(.95); transform: translateY(-1px); }

/* tel links never underlined */
a[href^="tel:"] { text-decoration: none; }

/* Mobile: stack header, smaller hero heading */
@media (max-width: 781px) {
  header .wp-block-group { row-gap: 8px; }
  .wp-block-cover h1 { font-size: 2.1rem !important; }
}

/* Header navigation links (white on navy) */
header .wp-block-navigation,
header .wp-block-navigation a,
header .wp-block-navigation .wp-block-navigation-item__content {
  color: #ffffff !important;
  font-weight: 600;
}
header .wp-block-navigation a:hover,
header .wp-block-navigation .wp-block-navigation-item__content:hover {
  color: #f1b445 !important;
}
header .wp-block-navigation { --wp--style--block-gap: 13px; }
/* Dropdown submenus */
header .wp-block-navigation .wp-block-navigation__submenu-container {
  background: #ffffff !important; border: 0 !important; border-radius: 10px;
  box-shadow: 0 14px 34px -12px rgba(0,0,0,.45); padding: 6px; min-width: 230px;
  z-index: 140; margin-top: 6px;
}
header .wp-block-navigation .wp-block-navigation__submenu-container li { display: block; width: 100%; }
header .wp-block-navigation .wp-block-navigation__submenu-container a { padding: 8px 12px; display: block; }
header .wp-block-navigation .wp-block-navigation__submenu-container a,
header .wp-block-navigation .wp-block-navigation__submenu-container a .wp-block-navigation-item__label {
  color: #15316a !important; font-weight: 600;
}
header .wp-block-navigation .wp-block-navigation__submenu-container li > a:hover {
  background: #f5f7fb; border-radius: 6px;
}
@media (min-width: 782px) { header > .wp-block-group > .wp-block-group { flex-wrap: nowrap; } }

/* Footer links */
footer a { color: #cdd8ee; }
footer a:hover { color: #f1b445; }

/* Sticky mobile call/quote bar (mobile only) */
.cdm-mobile-bar { display: none !important; }
@media (max-width: 781px) {
  .cdm-mobile-bar {
    display: flex !important;
    position: fixed; bottom: 0; left: 0; right: 0; z-index: 200;
    box-shadow: 0 -8px 24px -8px rgba(0,0,0,.5);
  }
  .cdm-mobile-bar .wp-block-buttons { width: 100%; gap: 10px; flex-wrap: nowrap; }
  .cdm-mobile-bar .wp-block-button { flex: 1; }
  .cdm-mobile-bar .wp-block-button__link { display: block; text-align: center; }
  body { padding-bottom: 66px; }
}

/* Fluent Forms, on-brand — explicit sizes so theme fluid type can't leak in */
.fluentform { font-size: 1rem; line-height: 1.5; }
.fluentform label { color: #16233d !important; font-weight: 700; font-size: 0.88rem !important; line-height: 1.3; }
.fluentform .ff-el-input--label { margin-bottom: 7px; }
.fluentform input[type=text], .fluentform input[type=email], .fluentform input[type=tel], .fluentform select, .fluentform textarea {
  border-radius: 10px !important; border: 1.5px solid #e4e9f2 !important; padding: 12px 14px !important;
}
.fluentform .ff-btn-submit {
  background: #15316a !important; color: #fff !important; border-radius: 999px !important;
  font-weight: 800 !important; padding: 14px 30px !important; border: 0 !important;
}
.fluentform .ff-btn-submit:hover { background: #0e2350 !important; }

/* Remove the white gap between the sticky header and the page content */
.wp-site-blocks > * { margin-block: 0 !important; }
header.wp-block-template-part { margin-bottom: 0 !important; }
main.wp-block-group { margin-top: 0 !important; }

/* ===================== CDM forms: hero wizard + bathroom enquiry ===================== */
.cdm-hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; overflow: hidden; }
.cdm-btn { display: inline-flex; align-items: center; justify-content: center; gap: .4em; font-weight: 800; font-size: 1rem; padding: .85em 1.4em; border-radius: 999px; border: 0; cursor: pointer; font-family: inherit; transition: transform .12s ease, filter .2s ease; line-height: 1.1; }
.cdm-btn:hover { filter: brightness(.96); transform: translateY(-1px); }
.cdm-btn-navy { background: #15316a; color: #fff; }
.cdm-btn-gold { background: #f1b445; color: #15316a; }
.cdm-btn-lg { font-size: 1.06rem; padding: 1em 1.8em; }
.cdm-note { font-size: .78rem; color: #5d6e8c; text-align: center; margin: 12px 0 0; }
.cdm-lbl { display: block; font-weight: 700; font-size: .9rem; margin-bottom: 8px; color: #16233d; }
.cdm-opt { font-weight: 500; color: #5d6e8c; }

/* Hero wizard card */
.cdm-wiz { background: #fff; color: #16233d; border-radius: 18px; box-shadow: 0 22px 50px -18px rgba(10,27,63,.55); overflow: hidden; max-width: 430px; margin-left: auto; }
.cdm-wiz-head { background: linear-gradient(120deg,#f1b445,#f7d449); padding: 17px 22px; }
.cdm-wiz-head h3 { color: #15316a; font-size: 1.3rem; font-weight: 800; margin: 0; }
.cdm-wiz-head p { color: #5a4715; font-size: .85rem; font-weight: 600; margin: 2px 0 0; }
.cdm-wiz-body { padding: 20px 22px 22px; }
.cdm-progress { height: 6px; background: #eef2f9; border-radius: 99px; margin-bottom: 18px; overflow: hidden; }
.cdm-progress > i { display: block; height: 100%; background: #f1b445; width: 33%; transition: width .35s ease; }
.cdm-step { display: block; }
.cdm-wiz.cdm-js .cdm-step { display: none; }
.cdm-wiz.cdm-js .cdm-step.cdm-active { display: block; animation: cdmfade .3s ease; }
@keyframes cdmfade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.cdm-field { margin-bottom: 14px; }
.cdm-wiz input[type=text], .cdm-wiz input[type=tel], .cdm-wiz input[type=email] { width: 100%; padding: .8em 1em; border: 1.5px solid #e4e9f2; border-radius: 10px; font-size: 1rem; font-family: inherit; color: #16233d; }
.cdm-wiz input:focus { outline: 0; border-color: #f1b445; box-shadow: 0 0 0 3px rgba(241,180,69,.25); }
.cdm-choices { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 16px; }
.cdm-choice { position: relative; border: 1.5px solid #e4e9f2; border-radius: 12px; padding: 13px 12px; font-weight: 700; cursor: pointer; background: #fff; transition: .15s; font-size: .93rem; display: flex; align-items: center; gap: 9px; }
.cdm-choice:hover { border-color: #f1b445; background: #fffdf6; }
.cdm-choice.sel { border-color: #f1b445; background: #fff7e6; box-shadow: 0 0 0 2px rgba(241,180,69,.3); }
.cdm-choice input { position: absolute; opacity: 0; pointer-events: none; }
.cdm-choice .cdm-ic { font-size: 1.2rem; }
.cdm-choices.cdm-needpick { outline: 2px solid #e0a0a0; outline-offset: 4px; border-radius: 14px; }
.cdm-foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 6px; }
.cdm-foot-end { justify-content: flex-end; }
.cdm-back { background: none; border: 0; color: #5d6e8c; font-weight: 700; cursor: pointer; font-family: inherit; font-size: .9rem; }
.cdm-back:hover { color: #15316a; }

/* Detailed bathroom enquiry form — fully self-contained so the parent theme's
   fluid typography and browser control defaults can never leak in */
.cdm-bform { max-width: 880px; margin: 0 auto; text-align: left; font-size: 1rem; line-height: 1.5; }
.cdm-bform .cdm-sec { border: 1px solid #e4e9f2; border-radius: 16px; padding: 16px 26px 26px; margin: 0 0 22px; background: #fff; min-inline-size: auto; }
.cdm-bform legend { font-weight: 800; font-size: 1.05rem; color: #15316a; padding: 0 10px; margin-left: -10px; line-height: 1.2; }
.cdm-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px 20px; }
.cdm-bform .cdm-field { margin: 0; }
.cdm-bform .cdm-col2 { grid-column: 1 / -1; }
.cdm-bform .cdm-field > label,
.cdm-bform .cdm-lbl { display: block; margin: 0 0 7px; font-weight: 700; font-size: 0.88rem; color: #16233d; line-height: 1.3; }
.cdm-bform input[type=text], .cdm-bform input[type=tel], .cdm-bform input[type=email],
.cdm-bform select, .cdm-bform textarea {
  -webkit-appearance: none; appearance: none;
  width: 100%; min-height: 46px; padding: 11px 14px; margin: 0;
  border: 1.5px solid #dfe5ef !important; border-radius: 10px !important;
  font-size: 1rem; font-family: inherit; line-height: 1.4; color: #16233d;
  background-color: #fbfcfe; box-shadow: none;
}
.cdm-bform textarea { min-height: 70px; resize: vertical; }
.cdm-bform select {
  background-image: url("data:image/svg+xml;charset=UTF-8,%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='%2315316a' stroke-width='2' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center; padding-right: 40px; cursor: pointer;
}
.cdm-bform input:focus, .cdm-bform select:focus, .cdm-bform textarea:focus {
  outline: 0; border-color: #f1b445 !important; box-shadow: 0 0 0 3px rgba(241,180,69,.22);
  background-color: #ffffff;
}
.cdm-radios { display: flex; flex-wrap: wrap; gap: 8px 20px; padding-top: 2px; min-height: 46px; align-items: center; }
.cdm-radios label, .cdm-checks label {
  display: inline-flex; align-items: center; gap: 8px; margin: 0; cursor: pointer;
  font-size: 0.95rem; font-weight: 600; line-height: 1.3; color: #16233d;
}
.cdm-radios input[type=radio], .cdm-checks input[type=checkbox] {
  -webkit-appearance: auto; appearance: auto;
  width: 17px; height: 17px; margin: 0; flex: none; accent-color: #15316a;
}
.cdm-checks { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px 16px; }
.cdm-bform-foot { text-align: center; margin-top: 4px; }
@media (max-width: 781px) {
  .cdm-wiz { max-width: none; margin: 0; }
  .cdm-grid { grid-template-columns: 1fr; gap: 16px; }
  .cdm-bform .cdm-sec { padding: 12px 18px 20px; }
  .cdm-checks { grid-template-columns: 1fr 1fr; }
  .cdm-choices { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .cdm-checks { grid-template-columns: 1fr; }
  .cdm-radios { flex-direction: column; align-items: flex-start; gap: 8px; min-height: 0; }
}

/* ===================== QA hardening pass ===================== */
/* Anchor jumps must clear the sticky header */
html { scroll-padding-top: 96px; }
@media (max-width: 781px) { html { scroll-padding-top: 130px; } }

/* Mobile bar buttons: explicit sizing (parent theme buttons are oversized) */
@media (max-width: 781px) {
  .cdm-mobile-bar .wp-block-button__link { font-size: 1rem; padding: 12px 10px; white-space: nowrap; }
}

/* Use the hamburger overlay up to 781px (core only collapses below 600px) */
@media (min-width: 600px) and (max-width: 781px) {
  header .wp-block-navigation__responsive-container:not(.is-menu-open) { display: none !important; }
  header .wp-block-navigation__responsive-container-open { display: flex !important; }
}

/* Wizard: visible keyboard focus + clearer required-choice nudge */
.cdm-choice:focus-within { border-color: #f1b445; box-shadow: 0 0 0 3px rgba(241,180,69,.45); }
.cdm-choices.cdm-needpick { outline: 2px solid #c0392b; outline-offset: 4px; border-radius: 14px; }

/* Fieldsets may shrink on narrow screens; controls align when labels wrap */
.cdm-bform fieldset { min-inline-size: 0; }
.cdm-checks label { align-items: flex-start; }
.cdm-checks input[type=checkbox] { margin-top: 2px; }

/* Gallery: single column on small phones (core grid goes 2-up below 600px) */
@media (max-width: 480px) {
  .wp-block-gallery.columns-3 figure.wp-block-image { width: 100% !important; }
}

/* Sticky header sits below the WP admin bar when logged in */
body.admin-bar header.wp-block-template-part { top: 32px; }
@media (max-width: 782px) { body.admin-bar header.wp-block-template-part { top: 46px; } }

/* Hero: tighten heading at tablet widths so the 2-column hero fits */
@media (min-width: 782px) and (max-width: 1080px) {
  .wp-block-cover h1 { font-size: 2.3rem !important; }
}

/* Tick lists in content sections */
.cdm-ticks { list-style: none; padding-left: 0; }
.cdm-ticks li { font-weight: 600; color: #16233d; }

/* Before / after comparison slider */
.cdm-ba { position: relative; max-width: 640px; margin: 0 auto; border-radius: 16px; overflow: hidden; box-shadow: 0 18px 48px -18px rgba(15,35,80,.35); user-select: none; line-height: 0; }
.cdm-ba .cdm-ba-img { width: 100%; height: 420px; object-fit: cover; display: block; pointer-events: none; }
.cdm-ba-beforewrap { position: absolute; inset: 0; clip-path: inset(0 calc(100% - var(--pos, 50%)) 0 0); }
.cdm-ba-label { position: absolute; bottom: 12px; font-size: .72rem; font-weight: 800; letter-spacing: .06em; background: rgba(14,35,80,.85); color: #fff; padding: 4px 10px; border-radius: 6px; line-height: 1.4; text-transform: uppercase; }
.cdm-ba-label-b { left: 12px; }
.cdm-ba-label-a { right: 12px; }
.cdm-ba-line { position: absolute; top: 0; bottom: 0; left: 50%; width: 3px; background: #fff; transform: translateX(-50%); display: flex; align-items: center; justify-content: center; }
.cdm-ba-line i { position: absolute; width: 40px; height: 40px; border-radius: 50%; background: #fff; color: #15316a; display: flex; align-items: center; justify-content: center; font-weight: 900; font-style: normal; font-size: 1.05rem; box-shadow: 0 6px 18px -8px rgba(15,35,80,.5); }
.cdm-ba-range { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: ew-resize; margin: 0; -webkit-appearance: none; appearance: none; }
.cdm-ba-caption { text-align: center; color: #5d6e8c; font-size: .88rem; margin-top: 12px; }
@media (max-width: 600px) { .cdm-ba .cdm-ba-img { height: 320px; } }

/* Inline phone / WhatsApp icons */
.cdm-ico { display: inline-block; vertical-align: middle; margin-right: 7px; position: relative; top: -1px; }
header .cdm-ico { margin-right: 5px; }

/* In-content links (e.g. the linked areas list) — on-brand, not default blue */
main a:not(.wp-element-button):not(.wp-block-button__link):not([href^="tel:"]) { color: #15316a; text-decoration: underline; text-underline-offset: 2px; }
main a:not(.wp-element-button):not(.wp-block-button__link):not([href^="tel:"]):hover { color: #0e2350; }
main a[href^="tel:"] { color: #15316a; font-weight: 700; }
