/* ==========================================================================
   Family Tree Dentist – Homepage
   Follows the existing site's design language: white header with uppercase
   wordmark, heavy Source Sans headings, square buttons, orange tabs and band,
   dark bars with orange text, centred footer. The site's black is replaced
   by the deep blue of the logo.
   ========================================================================== */

:root {
  --navy: #0e2b52;
  --navy-deep: #0a2140;
  --blue: #1d64c4;
  --blue-soft: #eef4fb;
  --sky: #3d8ef0;
  --sky-soft: #e3effd;
  --orange: #fc8c1d;
  --orange-bright: #ff9a0f;
  --orange-soft: #fff3e6;
  --teal: #17b0a2;
  --teal-soft: #e2f6f3;
  --sun: #ffc533;
  --white: #ffffff;
  --text: #2f3d52;
  --muted: #5d6b80;
  --line: #d9e2ee;

  --font-head: "Source Sans 3", "Source Sans Pro", "Segoe UI", sans-serif;
  --font-body: "Poppins", "Segoe UI", sans-serif;

  --container: 1180px;
  --gutter: clamp(16px, 4vw, 32px);
  --section-y: clamp(64px, 8.5vw, 120px);
  --header-h: 88px;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: var(--header-h); -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: .95rem;
  line-height: 1.75;
  color: var(--text);
  background: var(--white);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
ul, ol { margin: 0; padding: 0; list-style: none; }
figure { margin: 0; }
h1, h2, h3 { font-family: var(--font-head); color: var(--navy); margin: 0; line-height: 1.15; }
p { margin: 0 0 1.1em; }
button { font: inherit; cursor: pointer; }
:focus-visible { outline: 3px solid var(--orange); outline-offset: 2px; }

.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: absolute; left: 16px; top: -60px; z-index: 200; padding: 10px 16px; background: var(--navy); color: var(--orange); font-weight: 600; }
.skip-link:focus { top: 12px; }

.container { width: 100%; max-width: var(--container); margin-inline: auto; padding-inline: var(--gutter); }
.section { padding-block: var(--section-y); }
.icon { width: 1.1em; height: 1.1em; flex-shrink: 0; }

/* ---------- Headings ---------- */
.title {
  font-size: clamp(1.75rem, 1.3rem + 1.5vw, 2.4rem);
  font-weight: 800;
  letter-spacing: -.005em;
  margin-bottom: 22px;
}
.title--caps { text-transform: uppercase; letter-spacing: .01em; }

.section-head { max-width: 860px; margin: 0 auto clamp(40px, 5vw, 60px); text-align: center; }
.section-head__mark { display: block; width: 30px; height: 30px; margin: 0 auto 14px; color: var(--orange); }
.section-head .title { margin-bottom: 12px; }
.section-head p { color: var(--muted); margin: 0; }

/* ---------- Buttons (square, as on the existing site) ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 50px; padding: 12px 28px;
  font-family: var(--font-head); font-size: 1.05rem; font-weight: 700; line-height: 1.2; letter-spacing: .01em;
  text-decoration: none; text-align: center;
  border: 2px solid transparent; border-radius: 2px;
  transition: background-color .2s, color .2s, border-color .2s;
}
.btn--block { width: 100%; }
.btn--orange { background: var(--orange); color: var(--navy-deep); }
.btn--orange:hover { background: #e57a0c; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: var(--white);
  border-bottom: 1px solid var(--line);
}
.site-header.is-scrolled { box-shadow: 0 4px 18px rgba(14, 43, 82, .08); }
.site-header__inner { display: flex; align-items: center; gap: 28px; height: var(--header-h); }

.brand { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; flex-shrink: 0; }
.brand img { width: auto; height: 72px; }

.nav { margin-inline: auto; }
.nav__list { display: flex; align-items: center; gap: 6px; }
.nav__list > li > a, .nav__toggle {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 8px 12px;
  font-family: var(--font-head); font-size: 1.05rem; font-weight: 600;
  color: var(--navy); text-decoration: none;
  background: none; border: 0;
  transition: color .2s;
}
.nav__list > li > a:hover, .nav__toggle:hover, .nav__list > li > a[aria-current="page"], .nav__toggle[aria-expanded="true"] { color: var(--orange); }
.nav__toggle .icon { width: 14px; height: 14px; transition: transform .2s; }
.nav__toggle[aria-expanded="true"] .icon { transform: rotate(180deg); }

.nav__item--dropdown { position: relative; }
.nav__dropdown {
  position: absolute; top: calc(100% + 18px); left: 0;
  min-width: 290px; padding: 8px 0;
  background: var(--white); border-top: 3px solid var(--orange);
  box-shadow: 0 14px 30px rgba(14, 43, 82, .14);
  opacity: 0; visibility: hidden;
  transition: opacity .15s, visibility .15s;
}
.nav__dropdown::before { content: ""; position: absolute; left: 0; right: 0; top: -21px; height: 18px; }
.nav__dropdown a {
  display: block; padding: 9px 20px;
  font-size: .9rem; color: var(--navy); text-decoration: none;
  transition: background-color .15s, color .15s;
}
.nav__dropdown a:hover { background: var(--blue-soft); color: var(--blue); }
.nav__toggle[aria-expanded="true"] + .nav__dropdown { opacity: 1; visibility: visible; }
@media (hover: hover) and (min-width: 1101px) {
  .nav__item--dropdown:hover .nav__dropdown { opacity: 1; visibility: visible; }
}

.nav__mobile-extra { display: none; }
.site-header__end { display: flex; align-items: center; gap: 18px; }

.menu-btn { display: none; position: relative; width: 44px; height: 44px; background: none; border: 0; }
.menu-btn span { position: absolute; left: 10px; width: 24px; height: 2px; background: var(--navy); transition: transform .25s, opacity .2s, top .25s; }
.menu-btn span:nth-child(1) { top: 14px; }
.menu-btn span:nth-child(2) { top: 21px; }
.menu-btn span:nth-child(3) { top: 28px; }
.menu-btn[aria-expanded="true"] span:nth-child(1) { top: 21px; transform: rotate(45deg); }
.menu-btn[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.menu-btn[aria-expanded="true"] span:nth-child(3) { top: 21px; transform: rotate(-45deg); }

/* ---------- Hero ---------- */
.hero {
  position: relative; display: grid; place-items: center; overflow: hidden;
  min-height: clamp(600px, calc(100vh - var(--header-h)), 780px);
  background: var(--navy);
}
.hero__photo { position: absolute; inset: 0; }
.hero__photo img { position: absolute; left: 0; top: -34%; width: 100%; height: 134%; object-fit: cover; object-position: 50% 30%; }
.hero__photo::after { content: ""; position: absolute; inset: 0; background: rgba(10, 33, 64, .62); }
.hero__copy { position: relative; z-index: 1; align-self: end; padding: 64px var(--gutter) clamp(48px, 6vw, 72px); text-align: center; }
.hero__copy-inner { max-width: 760px; margin: 0 auto; }
.hero h1 { font-size: clamp(2.2rem, 1.5rem + 2.2vw, 3.2rem); font-weight: 900; color: var(--white); line-height: 1.06; margin-bottom: 20px; text-shadow: 0 2px 18px rgba(10, 33, 64, .35); }
.hero h1::after { content: ""; display: block; width: 80px; height: 4px; margin: 18px auto 0; background: var(--orange); }
.hero__lead { max-width: 640px; margin: 0 auto 28px; color: #e4ebf5; font-size: 1.02rem; }

/* ---------- Highlights (colour band under the hero) ---------- */
.highlights__list { display: grid; grid-template-columns: repeat(4, 1fr); }
.highlight {
  display: flex; align-items: center; justify-content: center; gap: 12px;
  min-height: 84px; padding: 18px var(--gutter);
  font-family: var(--font-head); font-size: 1.12rem; font-weight: 800; line-height: 1.2; text-align: center;
  color: var(--navy-deep);
}
.highlight .icon { width: 28px; height: 28px; }
.highlight--orange { background: var(--orange); }
.highlight--blue { background: var(--blue); color: var(--white); }
.highlight--teal { background: var(--teal); }
.highlight--sun { background: var(--sun); }

/* ---------- Introduction ---------- */
.intro__grid { display: grid; grid-template-columns: 1.05fr 1fr; gap: clamp(36px, 5vw, 72px); align-items: center; }
.intro__photo { position: relative; }
.intro__photo::before {
  content: ""; position: absolute; left: -18px; bottom: -18px; width: 45%; height: 55%;
  background: var(--orange); z-index: -1;
}
.intro__photo { z-index: 0; }
.intro__photo::after {
  content: ""; position: absolute; right: -22px; top: -22px; width: 76px; height: 76px; border-radius: 50%;
  background: var(--sky); z-index: -1;
}
.intro__photo img { width: 100%; aspect-ratio: 4 / 3.2; object-fit: cover; object-position: 50% 40%; }
.intro__first { font-size: 1.04rem; color: var(--navy); }
.intro__copy .btn { margin-top: 8px; }

/* ---------- Dentist (white panel overlapping a wide photo) ---------- */
.dentist { background: linear-gradient(135deg, var(--sky-soft) 0%, var(--blue-soft) 55%, var(--teal-soft) 100%); }
.dentist__layout { display: grid; grid-template-columns: repeat(12, 1fr); align-items: center; }
.dentist__photo { grid-column: 4 / 13; grid-row: 1; align-self: stretch; }
.dentist__photo img { width: 100%; height: 100%; min-height: 460px; object-fit: cover; object-position: 50% 20%; }
.dentist__panel {
  grid-column: 1 / 7; grid-row: 1; position: relative; z-index: 1;
  margin-block: 56px; padding: clamp(32px, 4vw, 52px);
  background: var(--white);
  border-left: 4px solid var(--orange);
  box-shadow: 0 18px 40px rgba(14, 43, 82, .10);
}
.dentist__panel p { font-size: .95rem; }
.dentist__panel .btn { margin-top: 8px; }

/* ---------- Services (tabs, as on the existing site) ---------- */
.tabs { display: grid; grid-template-columns: 330px 1fr; border: 1px solid var(--line); }
.tabs__list { display: flex; flex-direction: column; background: var(--white); border-right: 1px solid var(--line); }
.tabs__tab {
  position: relative; padding: 18px 22px 18px 26px; text-align: left;
  font-family: var(--font-head); font-size: 1.05rem; font-weight: 700; color: var(--navy);
  background: var(--white); border: 0; border-bottom: 1px solid var(--line);
  transition: background-color .15s, color .15s;
}
.tabs__tab:last-child { border-bottom: 0; }
.tabs__tab::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 5px; background: var(--tab-colour, var(--orange)); }
.tabs__tab:nth-child(4n+2) { --tab-colour: var(--blue); }
.tabs__tab:nth-child(4n+3) { --tab-colour: var(--teal); }
.tabs__tab:nth-child(4n+4) { --tab-colour: var(--sun); }
.tabs__tab:hover { background: var(--sky-soft); }
.tabs__tab[aria-selected="true"] { background: var(--orange); color: var(--navy-deep); }
.tabs__tab[aria-selected="true"]::after {
  content: ""; position: absolute; right: -11px; top: 50%; z-index: 1; margin-top: -10px;
  border-left: 10px solid var(--orange); border-top: 10px solid transparent; border-bottom: 10px solid transparent;
}
.tabs__panels { min-width: 0; }
.tabs__panel { display: grid; grid-template-rows: auto 1fr; height: 100%; }
.tabs__panel[hidden] { display: none; }
.tabs__panel img { width: 100%; aspect-ratio: 16 / 7.4; object-fit: cover; }
.tabs__body { padding: 30px 36px 34px; }
.tabs__body h3 { color: var(--blue); font-size: 1.6rem; font-weight: 800; text-transform: uppercase; margin-bottom: 10px; }
.tabs__body p { max-width: 640px; }

/* Without JS: tab list hidden, every service listed */
html:not(.js) .tabs { grid-template-columns: 1fr; }
html:not(.js) .tabs__list { display: none; }
html:not(.js) .tabs__panel + .tabs__panel { border-top: 1px solid var(--line); }

/* ---------- Open six days ---------- */
.visit { background: var(--orange-soft); }
.visit__grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); gap: clamp(36px, 5vw, 72px); align-items: center; }
.visit__copy .btn { margin-top: 8px; }
.visit__photo { position: relative; z-index: 0; }
.visit__photo::before {
  content: ""; position: absolute; right: -18px; top: -18px; width: 45%; height: 55%;
  background: var(--blue); z-index: -1;
}
.visit__photo::after {
  content: ""; position: absolute; left: -16px; bottom: -16px; width: 64px; height: 64px; border-radius: 50%;
  background: var(--teal); z-index: -1;
}
.visit__photo img { width: 100%; aspect-ratio: 4 / 3.2; object-fit: cover; object-position: 60% 50%; box-shadow: 0 18px 40px rgba(14, 43, 82, .10); }

/* ---------- Reviews ---------- */
.reviews { background: var(--navy); padding-block: clamp(64px, 7vw, 100px); }
.reviews__inner { text-align: center; }
.reviews .title { color: var(--white); margin-bottom: 36px; }

/* Review carousel: native horizontal scroll with snap, buttons added by JS */
.carousel { margin-bottom: 40px; text-align: left; }
.carousel__track {
  display: grid; grid-auto-flow: column; grid-auto-columns: calc((100% - 2 * 24px) / 3); gap: 24px;
  overflow-x: auto; scroll-snap-type: x mandatory; scroll-behavior: smooth;
  padding-bottom: 6px; scrollbar-width: none;
}
.carousel__track::-webkit-scrollbar { display: none; }
.review {
  display: flex; flex-direction: column; scroll-snap-align: start;
  padding: 28px 28px 24px;
  background: rgba(255, 255, 255, .05); border-top: 3px solid var(--orange);
}
.review__stars { color: var(--orange); font-size: 1.1rem; letter-spacing: .14em; margin-bottom: 14px; }
.review__star-off { color: rgba(255, 255, 255, .25); }
.review__text { margin: 0; }
.review__text p {
  margin: 0; color: var(--white); font-size: .95rem; line-height: 1.7;
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 6; overflow: hidden;
}
.review.is-open .review__text p { -webkit-line-clamp: unset; display: block; }
.review__more { align-self: flex-start; margin-top: 8px; padding: 0; background: none; border: 0; color: var(--orange); font-family: var(--font-head); font-weight: 700; font-size: .95rem; }
.review__more:hover { text-decoration: underline; text-underline-offset: 3px; }
.review__author { display: flex; align-items: center; gap: 12px; margin: auto 0 0; padding-top: 22px; }
.review__avatar {
  display: grid; place-items: center; width: 40px; height: 40px; flex-shrink: 0; border-radius: 50%;
  background: var(--orange); color: var(--navy-deep); font-family: var(--font-head); font-weight: 800; font-size: 1.1rem;
}
.review:nth-child(4n+2) { border-top-color: var(--sky); }
.review:nth-child(4n+3) { border-top-color: var(--teal); }
.review:nth-child(4n+4) { border-top-color: var(--sun); }
.review:nth-child(4n+2) .review__avatar { background: var(--sky); }
.review:nth-child(4n+3) .review__avatar { background: var(--teal); }
.review:nth-child(4n+4) .review__avatar { background: var(--sun); }
.review__author strong { display: block; font-family: var(--font-head); font-size: 1.02rem; color: var(--white); line-height: 1.3; }
.review__author small { display: inline-flex; align-items: center; gap: 6px; font-size: .78rem; color: #a9b9d0; }
.review__author .icon { width: 13px; height: 13px; }

.carousel__controls { display: flex; justify-content: center; gap: 10px; margin-top: 24px; }
.carousel__btn {
  display: grid; place-items: center; width: 50px; height: 50px;
  background: transparent; color: var(--orange); border: 2px solid var(--orange); border-radius: 2px;
  transition: background-color .2s, color .2s, opacity .2s;
}
.carousel__btn:hover:not(:disabled) { background: var(--orange); color: var(--navy-deep); }
.carousel__btn:disabled { opacity: .35; cursor: default; }
.carousel__btn[data-carousel-prev] .icon { transform: rotate(180deg); }
html:not(.js) .carousel__controls { display: none; }


/* ---------- Footer (centred, as on the existing site) ---------- */
.site-footer { font-size: .88rem; background: var(--navy-deep); color: #b8c6da; border-top: 4px solid var(--orange); }
.site-footer__main { display: grid; grid-template-columns: 1.1fr 3fr; gap: 48px; padding-block: 44px 40px; }
.site-footer__brand { align-self: start; }
.site-footer__brand img { width: 180px; margin-bottom: 18px; }
.site-footer__brand p:last-child { margin: 0; line-height: 1.6; }
.site-footer__cols { display: grid; grid-template-columns: 1.7fr 1fr 1fr; gap: 32px; }
.site-footer h2 { color: var(--orange); font-size: .95rem; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; margin-bottom: 10px; }
.site-footer__cols ul { display: grid; gap: 2px; align-content: start; }
.site-footer__details strong { font-family: var(--font-head); font-size: .95rem; color: var(--white); }
.site-footer__cols a { color: #dbe4f0; text-decoration: none; }
.site-footer__cols a:hover { color: var(--orange); text-decoration: underline; }
.site-footer__social a { display: inline-flex; align-items: center; gap: 10px; }
.site-footer__social { gap: 6px !important; }
.site-footer__social .icon { width: 26px; height: 26px; padding: 6px; border-radius: 50%; background: rgba(255, 255, 255, .1); color: var(--orange); transition: background-color .2s, color .2s; }
.site-footer__social a:hover .icon { background: var(--orange); color: var(--navy-deep); }
.site-footer__bar { background: #071a33; border-top: 1px solid rgba(255, 255, 255, .08); color: var(--orange); font-family: var(--font-head); font-weight: 700; font-size: .92rem; }
.site-footer__bar-inner { display: flex; justify-content: space-between; align-items: center; gap: 8px 24px; flex-wrap: wrap; padding-block: 12px; }
.site-footer__bar p { margin: 0; text-transform: uppercase; letter-spacing: .04em; }
.site-footer__bar ul { display: flex; gap: 22px; }
.site-footer__bar a { color: #cdd8e8; text-decoration: none; font-weight: 600; }
.site-footer__bar a:hover { color: var(--orange); }

.mobile-book { display: none; }

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 1100px) {
  :root { --header-h: 70px; }
  .menu-btn { display: block; margin-right: -10px; }
  .site-header__end { margin-left: auto; }
  .nav {
    position: fixed; inset: var(--header-h) 0 0 0; margin: 0;
    display: none; flex-direction: column; gap: 22px;
    padding: 12px var(--gutter) 32px; overflow-y: auto;
    background: var(--white); border-top: 1px solid var(--line);
  }
  .nav.is-open { display: flex; }
  .nav__list { flex-direction: column; align-items: stretch; gap: 0; }
  .nav__list > li { border-bottom: 1px solid var(--line); }
  .nav__list > li > a, .nav__toggle { width: 100%; justify-content: space-between; padding: 15px 2px; font-size: 1.15rem; }
  .nav__dropdown { position: static; min-width: 0; padding: 0 0 10px; border: 0; box-shadow: none; opacity: 1; visibility: visible; display: none; }
  .nav__dropdown::before { display: none; }
  .nav__toggle[aria-expanded="true"] + .nav__dropdown { display: block; }
  .nav__dropdown a { padding: 8px 12px; font-size: .95rem; }
  .nav__mobile-extra { display: grid; gap: 14px; }
  .nav__phone { display: flex; align-items: center; justify-content: center; gap: 10px; font-family: var(--font-head); font-weight: 700; font-size: 1.1rem; color: var(--navy); text-decoration: none; }
  .nav__phone .icon { color: var(--orange); }
  body.nav-open { overflow: hidden; }

  .tabs { grid-template-columns: 270px 1fr; }
  .highlights__list { grid-template-columns: repeat(2, 1fr); }
  .site-footer__main { grid-template-columns: 1fr; gap: 28px; }
}

@media (max-width: 900px) {
  .carousel__track { grid-auto-columns: calc((100% - 24px) / 2); }
  .hero { display: flex; flex-direction: column; min-height: 0; }
  .hero__photo { position: relative; order: -1; width: 100%; height: auto; aspect-ratio: 4 / 3; }
  .hero__photo img { top: 0; height: 100%; object-position: 50% 35%; }
  .hero__photo::after { display: none; }
  .hero__copy { padding: 40px var(--gutter) 52px; }


  .intro__grid, .visit__grid { grid-template-columns: 1fr; }
  .dentist__layout { grid-template-columns: 1fr; }
  .dentist__photo, .dentist__panel { grid-column: 1; grid-row: auto; }
  .dentist__photo img { min-height: 0; aspect-ratio: 16 / 10; }
  .dentist__panel { margin: -40px 12px 0; padding: 28px 22px 32px; }
  .visit__photo { order: -1; margin: 18px 18px 8px 0; }
  .intro__photo { margin: 0 0 8px 18px; }
  .intro__photo::after { right: -10px; top: -14px; width: 52px; height: 52px; }
  .visit__photo::after { left: -10px; bottom: -12px; width: 48px; height: 48px; }

  /* Services: tabs become a plain stacked list */
  .tabs { grid-template-columns: 1fr; border: 0; }
  .tabs__list { display: none; }
  .tabs__panels { display: grid; gap: 36px; }
  .tabs__panel[hidden] { display: grid; }
  .tabs__panel { border-bottom: 1px solid var(--line); }
  .tabs__panel img { aspect-ratio: 16 / 8; }
  .tabs__body { padding: 22px 0 30px; border-top: 4px solid var(--orange); }
  .tabs__panel:nth-child(4n+2) .tabs__body { border-top-color: var(--blue); }
  .tabs__panel:nth-child(4n+3) .tabs__body { border-top-color: var(--teal); }
  .tabs__panel:nth-child(4n+4) .tabs__body { border-top-color: var(--sun); }
  .tabs__body h3 { font-size: 1.35rem; }

}

@media (max-width: 640px) {
  .header-book { display: none; }
    .brand img { height: 58px; }

  .hero .btn, .reviews__inner > .btn { width: 100%; }
  .highlight { min-height: 72px; padding: 14px 12px; font-size: .98rem; gap: 8px; flex-direction: column; }
  .highlight .icon { width: 24px; height: 24px; }
  .carousel__track { grid-auto-columns: 88%; gap: 14px; }
  .review { padding: 24px 22px 22px; }


  .site-footer__cols { grid-template-columns: 1fr 1fr; gap: 22px; }
  .site-footer__details { grid-column: 1 / -1; }
  .site-footer__bar-inner { justify-content: center; text-align: center; }
  .site-footer { padding-bottom: 66px; }

  .mobile-book {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 90;
    display: flex; background: var(--navy);
    padding-bottom: env(safe-area-inset-bottom);
    transform: translateY(100%); transition: transform .25s;
  }
  .mobile-book.is-visible { transform: none; }
  .mobile-book .btn { flex: 1; min-height: 56px; border-radius: 0; }
  .mobile-book__call { display: grid; place-items: center; width: 64px; color: var(--orange); }
  .mobile-book__call .icon { width: 22px; height: 22px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}

/* ---------- Avily "Designed by" credit ---------- */
.avily-credit .avily-link { text-decoration: none; }
.avily-credit .avily-link:hover { text-decoration: underline; }
.avily-credit img { height: 1em; width: auto; vertical-align: middle; margin: 0 4px; }
