/* Integra Essenza — layout & alignment polish.
   One grid, one type scale, one spacing rhythm across every page.
   Loaded after the theme CSS, so it only overrides what it needs to. */

:root {
  --ie-col: 15px;                 /* theme column gutter */
  --ie-h-section: clamp(30px, 2.9vw, 40px);
  --ie-h-split:   clamp(28px, 2.6vw, 36px);
  --ie-h-card:    clamp(24px, 2.1vw, 28px);
  --ie-h-item:    21px;
  --ie-body: 16px;
}

/* ---------- typography rhythm ---------- */
#content h1, #content h2, #content h3, #content h4 { text-wrap: balance; }
#content p, #content li { text-wrap: pretty; }
/* inline "font-size: 150%" spans pasted from the editor made every heading a different size */
#content .section:not(:first-child) :is(h1, h2, h3, h4) span[style*="font-size"] { font-size: inherit !important; }

/* section titles (centred or beside an image) */
#content .section:not(:first-child) .col-inner > :is(h1, h2),
#content .section:not(:first-child) .text-inner :is(h1, h2),
#content .section:not(:first-child) .col-inner > .text > :is(h1, h2) {
  font-size: var(--ie-h-section); line-height: 1.15; margin: 0 0 14px; font-weight: 500;
}
/* titles inside boxes / panels */
#content .col-inner:has(> .is-border) :is(h1, h2, h3),
#content .col-inner:has(> .is-border) .icon-box-text :is(h1, h2, h3),
#content .col-inner.dark :is(h1, h2, h3) {
  font-size: var(--ie-h-card) !important; line-height: 1.2; margin: 0 0 12px;
}
/* titles of icon items, steps and cards in a grid */
#content .icon-box-top .icon-box-text :is(h2, h3, h4),
#content .box-text :is(h2, h3) {
  font-size: var(--ie-h-item) !important; line-height: 1.25; margin: 0 0 8px; font-weight: 500;
}
#content .icon-box-top .icon-box-text p, #content .box-text p, #content .box-text h4.serif {
  font-family: 'Inter', sans-serif; font-size: 14.5px !important; line-height: 1.6; color: #55605e; font-weight: 400; margin-bottom: 0;
}
/* lead paragraph right under a centred section title */
#content .section:not(:first-child) .col-inner > :is(h1, h2)[style*="center"] + p {
  max-width: 680px; margin-left: auto; margin-right: auto; margin-bottom: 36px; color: #55605e;
}

/* ---------- eyebrow labels ---------- */
#content .ie-eyebrow, .ie-eyebrow {
  font: 600 12.5px/1.4 'Inter', sans-serif !important; letter-spacing: .12em; text-transform: uppercase;
  color: #508f87 !important; margin: 0 0 10px !important;
}
#content .ie-eyebrow * { color: inherit !important; font: inherit !important; }
#content :is(.dark, .col-inner.dark) .ie-eyebrow { color: #8fd3c8 !important; }
#content .text-center > .ie-eyebrow, #content .ie-eyebrow[style*="center"] { text-align: center; }
/* a label always lines up with the heading under it */
#content .ie-eyebrow:has(+ :is(h1, h2, h3, h4)[style*="left"]) { text-align: left !important; }
#content .ie-eyebrow:has(+ :is(h1, h2, h3, h4)[style*="center"]) { text-align: center !important; }

/* ---------- one content grid ---------- */
/* empty spacer columns made boxes narrower than everything else: remove them on tablet/desktop */
@media (min-width: 550px) {
  #content .ie-spacer { display: none !important; }
  #content .row:has(> .ie-spacer) > .col:not(.ie-spacer) { flex: 1 1 0; max-width: 100%; }
}
/* the one full-bleed split section on the home page snaps back to the grid */
#content .section:not(:first-child) .row.row-full-width { max-width: 1080px !important; margin-left: auto !important; margin-right: auto !important; }
#content .section:not(:first-child) .row.row-full-width > .col { padding-left: var(--ie-col); padding-right: var(--ie-col); }
/* image + text sections: text vertically centred against the image */
#content .row.align-middle > .col > .col-inner { margin-top: 0 !important; }
#content .row.align-middle > .col > .col-inner > :last-child { margin-bottom: 0; }

/* ---------- icon rows ---------- */
#content .icon-box.icon-box-top { text-align: center !important; }
#content .icon-box-top .icon-box-img { width: 84px !important; height: 84px; margin: 0 auto 18px !important; }
#content .icon-box-top .icon-box-img img { width: 84px; height: 84px; object-fit: cover; border-radius: 50%; }
#content .icon-box-top .icon-box-text { padding: 0 6px; }
#content .icon-box-top .icon-box-text :is(h2, h3, h4, p) { text-align: center !important; }
/* picture-beside-text boxes (clinic / teleconsult) */
#content .icon-box-left .icon-box-text { padding-left: 20px; text-align: left; }
#content .icon-box-left .icon-box-text h4 { font-size: 22px; margin-bottom: 6px; }
#content .icon-box-left .icon-box-text p { font-size: 14.5px; line-height: 1.6; margin-bottom: 8px; color: #55605e; }
#content .icon-box-left .icon-box-img img { border-radius: 12px; }
#content .col-inner.text-right:has(> .icon-box-left) { text-align: left !important; }
#content .icon-box-left .button { margin: 6px 0 0; }
#content .row:has(> .col > .col-inner > .icon-box-left) { align-items: flex-start; }

/* cards whose button sits under the text: buttons line up on one row */
#content .row > .col > .col-inner:has(> .box + .button) { display: flex; flex-direction: column; height: 100%; }
#content .row > .col > .col-inner:has(> .box + .button) > .button { margin-top: auto; align-self: center; }
#content .row > .col > .col-inner:has(> .box + .button) > .box { margin-bottom: 18px; }
#content .box-image img { transition: transform .5s ease; }

/* ---------- step cards ("How it works") ---------- */
#content .box-text-bottom .box-text { padding-top: 16px; padding-bottom: 0; }
#content .box-text-inner > h2 + :is(p, h4) { margin-top: 0 !important; }

/* ---------- bordered boxes ---------- */
#content .row:has(> .col > .col-inner > .is-border) { align-items: stretch; }
#content .row:has(> .col > .col-inner > .is-border) > .col > .col-inner:has(> .is-border) { height: 100%; }
#content .col-inner:has(> .is-border):not(.dark) { padding: 36px 36px 32px !important; margin: 0 !important; border-radius: 14px; }
#content .col-inner:has(> .is-border) > .is-border { border-radius: 14px !important; border-width: 1px !important; border-color: #c9d9d6 !important; }
#content .col-inner:has(> .is-border) > .gap-element:first-of-type { display: none !important; }
#content .col-inner:has(> .is-border) .row .col { padding-bottom: 0; }
#content .col-inner:has(> .is-border):not(.dark) .row { align-items: flex-start !important; }
#content .col-inner:has(> .is-border) .col-inner > .is-border { display: none; }
#content .col-inner:has(> .is-border) .icon-box-top .icon-box-img { width: 64px !important; height: 64px; }
#content .col-inner:has(> .is-border) .icon-box-top .icon-box-img img { width: 64px; height: 64px; }
#content .col-inner:has(> .is-border) .icon-box-text > p:not(.ie-eyebrow) { font-size: 15px !important; color: #55605e; }
#content .col-inner:has(> .is-border) .row .col > .col-inner { margin: 0 !important; }
#content .col-inner:has(> .is-border) > :last-child,
#content .col-inner:has(> .is-border) .col-inner > :last-child { margin-bottom: 0 !important; }
/* pasted helper blocks inside boxes */
#content .col-inner section.soft, #content .col-inner .card { padding: 0 !important; margin: 0 !important; border: 0; background: none; }
#content .col-inner .card:has(.ie-check-item) { background: #f6faf9 !important; border-radius: 12px; padding: 22px 24px !important; }
#content .col-inner .card h3 { text-align: left !important; font-size: 20px !important; margin-bottom: 10px; }

/* ---------- check-mark lists ---------- */
#content ul.ie-checklist { list-style: none; margin: 16px 0 0; padding: 0; text-align: left; display: block !important; width: auto !important; }
#content ul.ie-checklist li, #content .ie-check-item {
  position: relative; padding-left: 28px; margin: 0 0 10px; text-align: left !important; line-height: 1.55; font-size: 15px; color: #3d4847; list-style: none;
}
#content ul.ie-checklist li::before, #content .ie-check-item::before {
  content: ""; position: absolute; left: 0; top: .2em; width: 18px; height: 18px; border-radius: 50%;
  background: #e3efed url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%230a4b49' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") center / 11px no-repeat;
}
#content .ie-check-item.ie-dot::before { background: #508f87; width: 7px; height: 7px; top: .62em; left: 6px; }
#content .space-y-3 { text-align: left; }

/* ---------- dark call-to-action panels ---------- */
#content .col-inner.dark[style*="background"] {
  padding: 44px 52px !important; margin: 0 !important; border-radius: 18px !important; text-align: left !important;
  background-image: radial-gradient(120% 140% at 100% 0%, rgba(80,143,135,.35), transparent 55%);
}
#content .col-inner.dark > .is-border { display: none; }
#content .col-inner.dark .row { align-items: center; margin: 0 !important; }
#content .col-inner.dark .row > .col { padding: 0 !important; }
#content .col-inner.dark .row > .col + .col { padding-left: 32px !important; }
#content .col-inner.dark .row > .col:last-child:not(:first-child) > .col-inner { text-align: right !important; }
#content .col-inner.dark .row > .col > .col-inner { margin: 0 !important; padding: 0 !important; }
#content .col-inner.dark p { margin-bottom: 0; opacity: .92; max-width: 620px; }
#content .col-inner.dark p + .button, #content .col-inner.dark p + br + .button { margin-top: 22px; }
#content .col-inner.dark .button { margin-bottom: 0; }
#content .col-inner.dark .row > .col:first-child:last-child .button { margin-top: 22px; }
#content .col-inner.dark .row > .col.large-11 { flex-basis: 100%; max-width: 100%; }

/* ---------- buttons ---------- */
#content .button { border-radius: 999px !important; padding: 0 22px; letter-spacing: .04em; }
#content .button + .button { margin-left: 6px; }

/* ---------- hero banners ---------- */
@media (min-width: 850px) {
  .banner-layers.container > .text-box.lg-x0 { left: var(--ie-col) !important; }
  .banner .text-box { width: auto !important; max-width: 620px; }
  .banner .text-box .text-inner p:not(.ie-eyebrow) { max-width: 470px; }
}
.banner .text-box h1 { line-height: 1.08; margin-bottom: 16px; }
.banner .text-box h1 span { font-size: inherit !important; }
#content > .section:first-child .banner-bg::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(90deg, rgba(255,255,255,.82) 0%, rgba(255,255,255,.55) 32%, rgba(255,255,255,0) 58%);
}

/* phones & tablets: picture on top, text underneath (text was unreadable over the photo) */
@media (max-width: 849px) {
  #content > .section:first-child .banner { padding-top: 0 !important; height: auto !important; background: #faf8f4; }
  #content > .section:first-child .banner-inner { position: relative !important; height: auto !important; }
  #content > .section:first-child .banner-bg { position: relative !important; height: clamp(250px, 46vw, 360px) !important; }
  #content > .section:first-child .banner-bg::after { background: linear-gradient(180deg, rgba(250,248,244,0) 60%, rgba(250,248,244,1) 100%); }
  #content > .section:first-child .banner-bg img { object-position: 70% 30%; }
  #content > .section:first-child .banner-layers { position: relative !important; padding: 22px 20px 40px !important; height: auto !important; }
  #content > .section:first-child .banner-layers > .fill { display: none; }
  #content > .section:first-child .banner .text-box { position: static !important; transform: none !important; width: 100% !important; max-width: none !important; margin: 0 !important; }
  #content > .section:first-child .banner .text-box .text-box-content { font-size: 100% !important; }
  #content > .section:first-child .banner .text-box h1 { font-size: 34px !important; }
  #content > .section:first-child .banner .text-box p { font-size: 15px !important; line-height: 1.55; }
  #content > .section:first-child .banner .button { margin: 6px 6px 0 0; }
  #content > .section:first-child .banner .text-inner { text-align: left !important; }
}

/* ---------- phones & tablets ---------- */
@media (max-width: 849px) {
  #content .col-inner:has(> .is-border):not(.dark) { padding: 28px 22px 24px !important; }
  #content .col-inner.dark[style*="background"] { padding: 32px 26px !important; }
  #content .col-inner.dark .row > .col + .col { padding-left: 0 !important; padding-top: 20px !important; }
  #content .col-inner.dark .row > .col:last-child:not(:first-child) > .col-inner { text-align: left !important; }
}
@media (max-width: 549px) {
  /* two-up grids of programs/steps get one column so text isn't squeezed */
  #content .section:not(:first-child) .row > .col.small-6:has(> .col-inner > .box + .button) { flex-basis: 100%; max-width: 100%; }
  #content .section:not(:first-child) .row > .col.small-6:has(> .col-inner > .box + .button) .box-image { max-width: 360px; margin: 0 auto; }
  #content .section:not(:first-child) .row > .col.small-6:has(> .col-inner > .is-border) { flex-basis: 100%; max-width: 100%; }
  #content .col-inner:has(> .is-border) .row .col + .col { padding-top: 28px !important; }
  #content .icon-box-text p { font-size: 14px !important; }
  #content .section:not(:first-child) .col-inner > :is(h1, h2)[style*="center"] + p { margin-bottom: 26px; }
  #content .button + .button { margin-left: 0; }
}

/* ---------- small info cards (contact page) ---------- */
#content .col-inner:has(> .is-border) .icon-box-left { display: block !important; }
#content .col-inner:has(> .is-border) .icon-box-left .icon-box-img { float: none !important; width: 44px !important; height: 44px; margin: 0 0 16px !important; }
#content .col-inner:has(> .is-border) .icon-box-left .icon-box-img img { width: 44px; height: 44px; object-fit: cover; border-radius: 50%; }
#content .col-inner:has(> .is-border) .icon-box-left .icon-box-text { padding-left: 0 !important; }
#content .col-inner:has(> .is-border) .icon-box-left .icon-box-text :is(h2, h3, h4) { font-size: 22px !important; margin-bottom: 8px; text-wrap: balance; }
#content .col-inner:has(> .is-border) .icon-box-left .icon-box-text p { font-size: 14.5px; line-height: 1.6; color: #55605e; overflow-wrap: anywhere; }
#content .ie-status { white-space: nowrap; }
@media (min-width: 850px) { #content .row:has(> .col.large-3 > .col-inner > .is-border) .col-inner:has(> .is-border) { padding: 30px 26px 26px !important; } }

/* ---------- contact form ---------- */
#contact-form .wpforms-field-row, #contact-form .wpforms-field-medium,
#contact-form input[type=text], #contact-form input[type=email], #contact-form textarea { width: 100% !important; max-width: 100% !important; }
#contact-form .wpforms-field-row { display: flex; gap: 12px; margin: 0 !important; }
#contact-form .wpforms-field-row-block { flex: 1; width: auto !important; padding: 0 !important; }
#contact-form input[type=text], #contact-form input[type=email], #contact-form textarea {
  border: 1px solid #cfd9d7; border-radius: 10px; padding: 10px 12px; box-shadow: none; height: auto; font-size: 15px;
}
#contact-form input:focus, #contact-form textarea:focus { border-color: #508f87; box-shadow: 0 0 0 3px rgba(80,143,135,.18); outline: 0; }
#contact-form .wpforms-field { padding: 8px 0; }
#contact-form .wpforms-field-label { font-weight: 600; font-size: 13.5px; margin-bottom: 6px; }
#contact-form .wpforms-submit { background: #0a4b49 !important; color: #fff !important; border: 0 !important; border-radius: 999px !important; padding: 12px 28px !important; font-weight: 600; letter-spacing: .03em; height: auto; line-height: 1.2; }
#contact-form .wpforms-submit:hover { background: #0d5e5b !important; }
#contact-form fieldset { padding: 0 !important; margin: 0 !important; border: 0 !important; min-width: 0; }
#contact-form textarea { min-height: 130px; }
#contact-form .wpforms-field-row, #contact-form .wpforms-field-row-block { margin: 0 !important; padding: 0 !important; float: none !important; }
#contact-form fieldset > .wpforms-field-row { padding: 0 !important; }
@media (max-width: 549px) {
  #content .section:not(:first-child) .row > .col.small-6:has(> .col-inner > .box + .button) .box-image img { aspect-ratio: 4 / 3; object-fit: cover; object-position: 50% 25%; }
}
#contact-form .wpforms-field-row::before, #contact-form .wpforms-field-row::after { display: none !important; }

/* buttons keep their arrow on the same line */
#content .button { white-space: nowrap; max-width: 100%; }
#content .button span { white-space: normal; }
@media (min-width: 550px) and (max-width: 849px) {
  #content > .section:first-child .banner-layers { padding: 28px 32px 44px !important; }
  #content > .section:first-child .banner .text-box h1 { font-size: 42px !important; }
  #content .button { font-size: 13px; padding: 0 16px; }
}

/* small program boxes (Core Wellness, Metabolic Support…): words never break in the middle; tablets show 3 per row */
#content .col.medium-2 .box-text h4 { overflow-wrap: normal; word-break: normal; hyphens: none; }
@media (min-width: 550px) and (max-width: 1023px) {
  #content .row > .col.medium-2 { flex-basis: 33.333%; max-width: 33.333%; }
  #content .col.medium-2 .box-text h4 { font-size: 15px !important; letter-spacing: .04em; line-height: 1.35; }
}
@media (min-width: 1024px) and (max-width: 1279px) {
  #content .col.medium-2 .box-text h4 { font-size: 14px !important; letter-spacing: .03em; }
}

/* ---------- article sidebar search ---------- */
.wp-block-search__inside-wrapper { display: flex; gap: 8px; }
.wp-block-search__input { flex: 1 1 auto; min-width: 0; margin: 0 !important; border-radius: 10px !important; }
.wp-block-search__button { flex: none; margin: 0 !important; border-radius: 999px !important; background: #0a4b49 !important; color: #fff !important; padding: 0 18px !important; white-space: nowrap; }
.wp-block-search__label { font: 600 12.5px 'Inter', sans-serif; letter-spacing: .12em; text-transform: uppercase; color: #508f87; }

/* Home, "Advancing Regenerative Care": the photo runs to the left edge of the screen and fills the
   section height (like the original site); the text sits beside it, inside the page width */
@media (min-width: 850px) {
  #content #row-760765580.row-full-width { max-width: none !important; width: 100% !important; margin: 0 !important; display: flex; align-items: stretch !important; }
  #content #row-760765580 > .col:first-child { padding: 0 !important; flex: 0 0 46%; max-width: 46%; }
  #content #row-760765580 > .col:first-child .col-inner,
  #content #row-760765580 > .col:first-child .img,
  #content #row-760765580 > .col:first-child .img-inner { height: 100%; margin: 0 !important; }
  #content #row-760765580 > .col:first-child img { width: 100%; height: 100%; min-height: 560px; object-fit: cover; display: block; border-radius: 0; }
  #content #row-760765580 > .col:last-child { flex: 0 0 54%; max-width: 54%; align-self: center; padding: 48px 40px 48px 48px !important; }
  /* the text uses the whole right side; the four icons are bigger */
  #content #row-760765580 > .col:last-child .col-inner { max-width: 820px; }
  #content #row-760765580 #row-180895974 { max-width: none !important; margin-left: -8px !important; margin-right: -8px !important; }
  #content #row-760765580 #row-180895974 > .col { padding: 0 8px 20px !important; }
  #content #row-760765580 #row-180895974 .box-image { width: 100% !important; max-width: 190px; margin: 0 auto; }
  #content #row-760765580 #row-180895974 .box-image img { width: 100%; height: auto; }
  #content #row-760765580 #row-180895974 h4 { font-size: 19px; margin-top: 6px; }
}
