/* ==========================================================================
   M R Dental — inner pages: Quality & Certifications (quality.html), Contact Us
   (contact.html) and the policy pages (terms, privacy, returns, shipping).
   Builds on the tokens and components in main.css; nothing here restyles other pages.
   Contrast: text on deep teal is white (4.9:1); small teal text on light surfaces is
   deep teal; form-field borders are ≥3:1 against their background.
   ========================================================================== */

/* `hidden` must win over the display values set below (thank-you note, error messages). */
.page--inner [hidden] { display: none !important; }
.nowrap { white-space: nowrap; }

/* Brand guideline p. 8: on coloured (teal) backgrounds the logo is all white — as on the About page. */
.page--inner .site-header:not(.is-solid) { --logo-icon: var(--white); }

/* Focus rings: the site's teal ring disappears on teal, so it turns white on dark surfaces. */
.page--inner .site-header:not(.is-solid) :focus-visible,
.page--inner .site-header.is-open :focus-visible,
.pg-head :focus-visible, .q-check :focus-visible { outline-color: var(--white); }

/* ---------- Shared pieces ---------- */
.pg-eyebrow {
  display: flex; align-items: center; gap: 14px; margin: 0 0 22px;
  font-family: var(--font-head); font-weight: 600; font-size: var(--text-xs);
  letter-spacing: 0.18em; text-transform: uppercase; color: var(--white);
}
.pg-eyebrow::before { content: ""; width: 36px; height: 2px; background: var(--mint); flex: none; }
.pg-kicker {
  display: flex; align-items: center; gap: 14px; margin: 0 0 20px;
  font-family: var(--font-head); font-weight: 600; font-size: var(--text-xs);
  letter-spacing: 0.16em; text-transform: uppercase; line-height: 1.4; color: var(--teal-deep);
}
.pg-kicker::before { content: ""; width: 28px; height: 2px; background: var(--teal); flex: none; }
.pg-kicker--light { color: var(--white); }
.pg-kicker--light::before { background: var(--mint); }

/* In-page links (#certifications, #enquiry …) stop below the fixed header */
.page--inner main [id] { scroll-margin-top: calc(var(--header-h) + 12px); }

/* A deep-teal primary button (white on #147f6b is 4.9:1); hover inverts within the palette. */
.btn--deep { background: var(--teal-deep); color: var(--white); border-color: var(--teal-deep); }
.btn--deep:hover { background: var(--white); color: var(--teal-deep); border-color: var(--teal-deep); }

/* Scroll reveals (armed by pages.js only for blocks below the fold) */
[data-reveal].is-armed { opacity: 0; transform: translateY(24px); }
[data-reveal].is-in {
  opacity: 1; transform: none;
  transition: opacity .9s ease, transform 1.1s var(--ease-out);
  transition-delay: calc(var(--i, 0) * 100ms);
}

/* ---------- Page head ---------- */
.pg-head {
  position: relative; overflow: hidden; isolation: isolate;
  background: var(--teal-deep); color: var(--white);
  padding: calc(var(--header-h) + 56px) 0 clamp(48px, 6vw, 88px);
}
.pg-head__grid { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: clamp(32px, 5vw, 80px); align-items: center; }
.pg-head__title {
  color: var(--white); font-size: clamp(2.25rem, 1.15rem + 3.1vw, 3.75rem);
  line-height: 1.06; letter-spacing: -0.018em; max-width: 18ch; margin-bottom: 0.4em; text-wrap: balance;
}
.pg-head__lead { font-family: var(--font-head); font-weight: 400; font-size: var(--text-h3); line-height: 1.4; color: var(--white); max-width: 40ch; margin: 0; }
.pg-head__nav { display: flex; flex-wrap: wrap; gap: 8px 28px; margin-top: 32px; }
.pg-head__nav a { color: var(--white); text-decoration: none; font-weight: 600; font-size: var(--text-sm); padding: 6px 0; border-bottom: 1px solid rgba(255,255,255,.4); transition: border-color .2s; }
.pg-head__nav a:hover { border-bottom-color: var(--white); color: var(--white); }
.pg-head__media { margin: 0; }
.pg-head__media img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; border-radius: var(--radius); box-shadow: 0 24px 60px rgba(0, 0, 0, .22); }
.pg-head__media figcaption { margin-top: 12px; font-size: var(--text-xs); color: var(--white); }
.pg-head__date { margin: 0; font-size: var(--text-sm); color: var(--white); }
.pg-head--slim { padding-bottom: clamp(36px, 4vw, 56px); }
.pg-head--slim .pg-head__title { font-size: clamp(2rem, 1.2rem + 2.2vw, 3rem); max-width: none; margin-bottom: 0.25em; }

/* Entrance */
@keyframes pg-rise { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
.pg-head__text > *, .pg-head--slim .container > * { animation: pg-rise .9s var(--ease-out) both; }
.pg-head__text > :nth-child(2), .pg-head--slim .container > :nth-child(2) { animation-delay: .1s; }
.pg-head__text > :nth-child(3) { animation-delay: .2s; }
.pg-head__text > :nth-child(4) { animation-delay: .3s; }
.pg-head__media { animation: pg-rise 1.1s var(--ease-out) .25s both; }

/* Contact head: the brand pattern (guideline p. 6) — the icon in a stepped triangle */
.pg-pattern { justify-self: end; width: min(100%, 340px); height: auto; overflow: visible; --logo-icon: var(--teal); }
.pg-pattern__row { animation: pg-rise .9s var(--ease-out) both; animation-delay: calc(.2s + var(--r) * .09s); }

/* ---------- Quality: shared intro ---------- */
.q-intro { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 9fr); gap: 0 clamp(28px, 5vw, 80px); align-items: start; margin-bottom: clamp(36px, 4vw, 56px); }
.q-intro .pg-kicker { padding-top: 0.5rem; }
.q-intro__lead { font-size: clamp(1.125rem, 0.95rem + 0.6vw, 1.375rem); line-height: 1.6; color: var(--ink-strong); max-width: 56ch; margin: 0; }

/* Certifications */
.q-certs { background: var(--paper-soft); border-bottom: 1px solid var(--rule); padding-block: var(--space-section); }
.q-certs__grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.q-cert {
  position: relative; overflow: hidden; display: flex; flex-direction: column; align-items: flex-start; gap: 12px;
  min-height: 300px; padding: clamp(28px, 3vw, 44px); background: var(--white);
  border: 1px solid var(--rule); border-top: 3px solid var(--teal); border-radius: var(--radius);
}
.q-cert__type { font-family: var(--font-head); font-weight: 600; font-size: var(--text-xs); letter-spacing: 0.14em; text-transform: uppercase; color: var(--teal-deep); }
.q-cert__name { font-size: clamp(1.75rem, 1.1rem + 2vw, 2.75rem); font-weight: 300; letter-spacing: -0.015em; color: var(--ink-strong); max-width: 14ch; }
.q-cert p { margin: 0; max-width: 44ch; }
.q-cert__link { margin-top: auto; padding-top: 12px; font-weight: 600; font-size: var(--text-sm); }
.q-cert__mark { position: absolute; right: clamp(20px, 2.4vw, 36px); bottom: clamp(20px, 2.4vw, 36px); width: clamp(56px, 6vw, 84px); height: auto; --logo-icon: var(--mint); }

/* Made in Valsad: the rooms */
.q-made { padding-block: var(--space-section); }
.q-rooms { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; }
.q-room { margin: 0; }
.q-room img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; border-radius: var(--radius); background: var(--paper-soft); }
.q-room__name { display: flex; align-items: baseline; gap: 10px; margin-top: 12px; font-family: var(--font-head); font-weight: 500; font-size: var(--text-md); color: var(--ink-strong); }
.q-room__name span { font-size: var(--text-xs); font-weight: 600; letter-spacing: 0.12em; color: var(--teal-deep); }

/* Inspection band */
.q-check { background: var(--teal-deep); color: var(--white); padding-block: var(--space-section); overflow: clip; }
.q-check__grid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(32px, 6vw, 104px); align-items: center; }
.q-check__media { margin: 0; }
.q-check__media img { width: 100%; aspect-ratio: 515 / 640; object-fit: cover; border-radius: var(--radius); }
.q-check__media figcaption { margin-top: 12px; font-size: var(--text-xs); color: var(--white); }
.q-check__statement {
  font-family: var(--font-head); font-weight: 400; color: var(--white);
  font-size: clamp(1.5rem, 1.05rem + 1.4vw, 2.25rem); line-height: 1.25; letter-spacing: -0.01em;
  max-width: 30ch; margin: 0 0 1.2em; text-wrap: pretty;
}
.q-specs { margin: 0 0 36px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 32px; }
.q-specs div { padding: 16px 0 18px; border-top: 1px solid rgba(255,255,255,.25); }
.q-specs dt { font-family: var(--font-head); font-weight: 600; font-size: var(--text-md); margin-bottom: 4px; }
.q-specs dd { margin: 0; font-size: var(--text-sm); line-height: 1.5; }

/* Closing call to action (shared) */
.pg-cta { background: var(--paper-soft); border-top: 1px solid var(--rule); padding-block: clamp(48px, 6vw, 88px); }
.pg-cta__inner { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 24px 32px; align-items: center; }
.pg-cta__title { font-size: clamp(1.75rem, 1.1rem + 1.8vw, 2.5rem); letter-spacing: -0.01em; margin-bottom: 0.35em; }
.pg-cta__inner p { margin: 0; max-width: 52ch; }
.pg-cta__actions { display: flex; flex-wrap: wrap; gap: 12px; justify-content: flex-end; }

/* ---------- Contact ---------- */
.ct { background: var(--paper-soft); padding-block: var(--space-section); }
.ct__grid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(32px, 6vw, 96px); align-items: start; }
.ct-place { margin-bottom: 28px; }
.ct-place h3 { font-size: var(--text-h3); font-weight: 500; color: var(--ink-strong); margin-bottom: 8px; }
.ct-place address { font-style: normal; line-height: 1.6; max-width: 36ch; }
.ct-place__note { display: block; margin-top: 4px; font-size: var(--text-xs); color: var(--ink-soft); }
.ct-place__link { display: inline-block; margin-top: 10px; font-weight: 600; font-size: var(--text-sm); }
.ct-lines { margin: 0 0 32px; padding: 0; display: grid; border-top: 1px solid var(--rule); }
.ct-lines div { display: grid; grid-template-columns: 7rem 1fr; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--rule); }
.ct-lines dt { font-weight: 600; color: var(--ink-soft); font-size: var(--text-sm); }
.ct-lines dd { margin: 0; }
.ct-lines a { font-weight: 600; text-decoration: none; font-variant-numeric: tabular-nums; white-space: nowrap; }
.ct-lines a:hover { text-decoration: underline; }

.ct-form-wrap {
  background: var(--white); border: 1px solid var(--rule); border-radius: var(--radius);
  padding: clamp(24px, 3.4vw, 48px); box-shadow: 0 24px 60px rgba(20, 127, 107, .08);
}
.ct-form__title { font-size: clamp(1.5rem, 1.15rem + 1vw, 2.125rem); letter-spacing: -0.01em; margin-bottom: 24px; }
.ct-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 20px; }
.ct-field { display: grid; gap: 8px; margin-bottom: 20px; }
.ct-field label { font-weight: 600; font-size: var(--text-sm); color: var(--ink-strong); }
.ct-req { color: var(--teal-deep); }
.ct-field input, .ct-field textarea {
  width: 100%; font: inherit; font-size: 1rem; line-height: 1.5; color: var(--ink-strong);
  background: var(--white); border: 1px solid #879390; border-radius: var(--radius); padding: 12px 14px;
  transition: border-color .2s, box-shadow .2s;
}
.ct-field textarea { resize: vertical; min-height: 148px; }
.ct-field input:focus-visible, .ct-field textarea:focus-visible { outline: none; border-color: var(--teal-deep); box-shadow: 0 0 0 3px rgba(36, 168, 143, .35); }
.ct-field [aria-invalid="true"] { border-color: #d11515; }
.ct-field [aria-invalid="true"]:focus-visible { box-shadow: 0 0 0 3px rgba(209, 21, 21, .2); }
.ct-error { margin: 0; font-size: var(--text-xs); font-weight: 600; color: #d11515; }
.ct-hp { position: absolute !important; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.ct-submit { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 24px; margin-top: 8px; }
.ct-submit .btn[disabled] { opacity: .7; cursor: progress; }
.ct-note { margin: 0; font-size: var(--text-xs); color: var(--ink-soft); }
.ct-thanks {
  display: none; grid-template-columns: 28px 1fr; gap: 14px; align-items: start; margin-bottom: 24px;
  padding: 18px 20px; background: var(--paper-soft); border-left: 3px solid var(--teal); border-radius: var(--radius);
}
.ct-thanks.is-shown, .ct-thanks:target { display: grid; }
.page--inner main .ct-thanks[id] { scroll-margin-top: calc(var(--header-h) + 96px); } /* keeps the form heading in view */
.ct-thanks:focus { outline: none; }
.ct-thanks svg { width: 28px; height: 28px; fill: none; stroke: var(--teal-deep); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.ct-thanks strong { display: block; font-family: var(--font-head); font-weight: 600; font-size: var(--text-lg); color: var(--ink-strong); }
.ct-thanks p { margin: 2px 0 0; }

.ct-map { padding-block: clamp(56px, 7vw, 104px); }
.ct-map__head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px 24px; margin-bottom: 20px; }
.ct-map__head .pg-kicker, .ct-map__head .ct-place__link { margin: 0; }
/* A fixed height, not aspect-ratio + min-height: that pair widens the box past narrow screens. */
.ct-map__frame { position: relative; height: clamp(340px, 38vw, 560px); border-radius: var(--radius); overflow: hidden; background: var(--paper-soft); border: 1px solid var(--rule); }
.ct-map__frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
/* Shown under the map while it loads, or if a browser or network blocks Google Maps */
.ct-map__fallback {
  position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 10px;
  padding: 24px; text-align: center; color: var(--ink-soft); font-size: var(--text-sm);
}
.ct-map__fallback svg { width: 40px; height: 40px; --logo-icon: var(--mint); }
.ct-map__fallback strong { font-family: var(--font-head); font-weight: 500; font-size: var(--text-lg); color: var(--ink-strong); }

/* ---------- Policy pages ---------- */
.lg { padding-block: clamp(48px, 6vw, 96px); }
/* The reading column lines up with the page title above it */
.lg__inner > * { max-width: 780px; }
.lg h2 { font-family: var(--font-head); font-weight: 600; font-size: var(--text-md); letter-spacing: 0.02em; color: var(--ink-strong); line-height: 1.35; margin: 2.2em 0 0.7em; }
.lg h2:first-child { margin-top: 0; }
.lg p, .lg li { max-width: 72ch; }
.lg ul { padding-left: 1.2em; margin: 0 0 1.25em; }
.lg li + li { margin-top: 0.5em; }
.lg-more { display: flex; flex-wrap: wrap; gap: 8px 28px; margin-top: 56px; padding-top: 24px; border-top: 1px solid var(--rule); }
.lg-more a { font-weight: 600; font-size: var(--text-sm); }
.lg .lg-more__title { flex-basis: 100%; margin: 0; font-size: var(--text-xs); letter-spacing: 0.16em; text-transform: uppercase; color: var(--ink-soft); }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .q-rooms { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 28px; }
}
@media (max-width: 900px) {
  .pg-head__grid, .q-intro, .q-check__grid, .ct__grid, .pg-cta__inner { grid-template-columns: 1fr; }
  .q-intro .pg-kicker { padding-top: 0; }
  .pg-head__media { max-width: 640px; }
  .pg-pattern { justify-self: start; width: 200px; order: -1; margin-bottom: 4px; }
  .q-check__media { max-width: 420px; }
  .pg-cta__actions { justify-content: flex-start; }
}
@media (max-width: 860px) {
  .pg-head { padding-top: calc(var(--header-h) + 28px); }
}
@media (max-width: 680px) {
  .q-certs__grid { grid-template-columns: 1fr; }
  .q-cert { min-height: 0; padding-bottom: 104px; }
  .ct-row { grid-template-columns: 1fr; }
  .q-specs { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  /* rooms become a swipeable strip */
  .q-rooms { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: 72vw; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 12px; margin-inline: calc(-1 * var(--gutter)); padding-inline: var(--gutter); scroll-padding-inline: var(--gutter); }
  .q-room { scroll-snap-align: start; }
  .q-rooms:focus-visible { outline-offset: -2px; border-radius: var(--radius); }
}

/* ---------- Motion preferences and print ---------- */
@media (prefers-reduced-motion: reduce) {
  .pg-head__text > *, .pg-head--slim .container > *, .pg-head__media, .pg-pattern__row { animation: none !important; }
  [data-reveal].is-armed, [data-reveal].is-in { opacity: 1; transform: none; transition: none; }
}
@media print {
  [data-reveal].is-armed { opacity: 1; transform: none; }
  .ct-map, .ct-form-wrap { display: none; }
}
