/* Derma C — smaller screens. Loaded last.
   - Tablet and below (under 1024px): a few layout steps.
   - Mobile (under 768px): the approved mobile design, ported from
     design/canvas-source/mobile.dc.html.

   Rules marked with `.js` only apply once main.js has run, so the page stays
   fully readable without JavaScript: menu open, every service expanded,
   every branch listed. */

/* Mobile-only pieces are hidden on larger screens */
.menu-toggle,
.branch-tabs,
.quick-contact,
.booking-bar,
.branch-card__cta-short{display:none}

/* ==================== Tablet and below ==================== */

@media (max-width:1023px){
  .doctors{margin:0 30px}

  /* Services: one column, heading no longer sticky */
  .services__columns{display:block}
  .services .section-head{position:static;margin-bottom:48px}
}

/* ==================== Mobile ==================== */

@media (max-width:767px){

  /* ---------- Base ---------- */

  body{font-size:15px;line-height:1.6}
  section[id]{scroll-margin-top:76px}

  .container{padding:0 20px}
  .section,
  .section--compact{padding-top:56px;padding-bottom:56px}

  .eyebrow{font-size:11px;letter-spacing:2.5px}
  .heading-group .eyebrow{margin-bottom:10px}
  .section-title{font-size:30px;line-height:1.15}
  .kicker,
  .meta-label{font-size:10px}
  .meta-value{font-size:14px}
  .placeholder__label{font-size:11px}

  .btn{justify-content:center}

  .section-head{display:block;margin-bottom:24px}
  .section-head__col + .section-head__col{margin-top:14px}
  .section-intro{max-width:none;margin:0 0 28px;text-align:left}
  .section-intro--stack{gap:12px;margin-bottom:24px}
  .section-cta{margin-top:20px}
  .section-cta .btn{display:flex}

  .band--fade{--fade:96px}

  /* Horizontal swipe row that bleeds to the right edge of the screen */
  .swipe-row{
    flex-wrap:nowrap;
    gap:14px;
    overflow-x:auto;
    margin-right:-20px;
    padding-right:20px;
    padding-bottom:14px;
    -webkit-overflow-scrolling:touch;
  }
  /* Keep the rail inside the page gutter while the cards bleed past it */
  .swipe-row::-webkit-scrollbar-track{margin-right:20px}

  /* ---------- Header and menu ---------- */

  html:not(.js) .site-header{position:static}
  .site-header__inner{padding-top:12px;padding-bottom:12px;gap:0}
  .site-header__cta{display:none}
  .brand__logo{height:22px}
  .brand__tagline{font-size:8px}

  .js .menu-toggle{
    display:flex;
    align-items:center;
    justify-content:center;
    width:44px;
    height:44px;
    padding:0;
    background:var(--surface);
    color:var(--ink);
    border:1px solid var(--line);
    border-radius:50%;
    cursor:pointer;
  }
  .menu-toggle__icon--close{display:none}
  .menu-toggle[aria-expanded="true"] .menu-toggle__icon--open{display:none}
  .menu-toggle[aria-expanded="true"] .menu-toggle__icon--close{display:block}

  .site-nav{
    /* Full-bleed: 100% plus the two 20px gutters the margins pull back */
    flex:0 0 calc(100% + 40px);
    flex-direction:column;
    flex-wrap:nowrap;
    gap:0;
    max-height:calc(100vh - 70px);
    overflow-y:auto;
    margin:12px -20px -12px;
    padding:4px 16px 16px;
    background:var(--cream);
    border-top:1px solid var(--line);
    font-family:var(--font-display);
    font-size:18px;
    font-weight:400;
  }
  .site-nav a{padding:12px 0;border-bottom:1px solid var(--line)}
  .site-nav a:last-child{border-bottom:0}
  /* The rows already have divider lines, so colour alone marks the current one */
  .site-nav a.is-active{text-decoration:none}
  .js .site-nav:not(.is-open){display:none}

  /* ---------- Hero ---------- */

  .hero{
    padding-top:40px;
    padding-bottom:48px;
    flex-direction:column;
    flex-wrap:nowrap;
    align-items:stretch;
    gap:20px;
  }
  /* Flatten the text column so the photo can sit between the paragraphs */
  .hero__content{display:contents}
  .hero__content > .eyebrow{order:1}
  .hero__title{order:2;font-size:42px;letter-spacing:0}
  .hero__lede{order:3;max-width:none;font-size:16px}
  .hero__visual{order:4;flex:none;margin-top:8px}
  .hero__text{order:5;max-width:none;font-size:15px}
  .hero__actions{
    order:6;
    flex-direction:column;
    flex-wrap:nowrap;
    gap:10px;
    padding-top:0;
  }
  .hero__media{height:400px;border-radius:180px 180px 14px 14px}
  .hero__stat{
    gap:4px;
    padding:12px 14px;
    border-radius:14px;
  }
  .hero__stat--years{left:12px;bottom:12px}
  .hero__stat--rating{right:12px;top:auto;bottom:12px}
  .hero__stat-number{font-size:28px}
  .hero__stat-label{font-size:12px;line-height:1.3}

  /* ---------- Highlights ---------- */

  .highlights{width:calc(100% - 40px)}
  .highlights__inner{display:block;padding-top:8px;padding-bottom:8px}
  .highlight{gap:14px;padding:18px 0;border-bottom:1px solid var(--line)}
  .highlight:last-child{border-bottom:0}
  .highlight .icon{flex:none;width:24px;height:24px}
  .highlight__title{margin:0;font-size:15px}
  .highlight__text{margin:2px 0 0;font-size:14px}

  /* ---------- Featured treatments (swipe row) ---------- */

  .featured{display:flex;flex-direction:column}
  .featured .section-head{display:contents}
  .featured .heading-group{order:1;max-width:none;margin-bottom:24px}
  .featured .section-title{font-size:28px;line-height:1.18}
  .featured .swipe-row{order:2}
  .featured .section-head .btn{order:3;margin-top:20px}

  .treatment-card{flex:0 0 220px;gap:12px}
  .treatment-card__media{height:260px;padding:0;border-radius:14px}
  .treatment-card .kicker{margin-bottom:0}
  .treatment-card__title{margin-top:2px;font-size:24px}

  /* ---------- About: story ---------- */

  .about__inner{
    flex-direction:column;
    flex-wrap:nowrap;
    align-items:stretch;
    gap:18px;
  }
  .about__content{display:contents}
  .about__content > .eyebrow{order:1}
  .about__content > .section-title{order:2}
  .about__media{
    order:3;
    flex:none;
    height:320px;
  }
  .about__photo--main{border-radius:14px}
  .about__photo--detail{border-width:4px;border-radius:14px 14px 80px 14px}
  .about__content > .body-copy{order:4}
  .about__promise{
    order:5;
    margin-top:6px;
    padding-top:18px;
    font-size:21px;
    line-height:1.35;
  }

  /* ---------- About: approach (2 x 2) ---------- */

  .steps{
    display:grid;
    grid-template-columns:repeat(2,minmax(0,1fr));
    gap:0 16px;
  }
  .step{padding:20px 0;gap:6px}
  .step__number{font-size:30px}
  .step__title{font-size:16px}
  .step__text{font-size:13.5px}

  /* ---------- Doctors ---------- */

  .doctors{margin:0 10px}
  .doctors > .container{display:flex;flex-direction:column;gap:20px}
  .doctors .section-head,
  .doctor-grid{display:contents}
  .doctors .heading-group{max-width:none}
  .doctors .heading-group .eyebrow{margin-bottom:20px}
  .doctors .section-head .btn{order:1;min-height:52px}

  .doctor-card{
    flex:none;
    flex-direction:column;
    flex-wrap:nowrap;
    gap:14px;
    padding:20px;
    border-radius:18px;
  }
  .doctor-card__photo{
    flex:none;
    height:280px;
    border-radius:140px 140px 12px 12px;
  }
  .doctor-card__image{width:100%}
  .doctor-card__body{flex:none;gap:14px}
  .doctor-card__name{font-size:28px}
  .doctor-card__credentials{font-size:12px}

  /* ---------- Services (accordion, tighter) ---------- */

  .services .section-head{margin-bottom:28px}

  .service-row{scroll-margin-top:76px}
  .service-row__title{font-size:22px}
  .service-row__trigger{gap:14px;min-height:64px;padding:16px 0}
  button.service-row__trigger::after{flex-basis:20px;font-size:22px}
  .service-row__number{flex-basis:28px}

  /* Panel content lines up under the service name (28px number + 14px gap) */
  .service-row__subtitle{margin-left:42px;font-size:13px}
  .service-row__body{margin-left:42px;font-size:14.5px}
  .service-row__body--stack{gap:12px}
  .service-row > .btn{margin:12px 0 22px 42px;padding:0 18px}

  .option-grid{flex-direction:column;flex-wrap:nowrap}
  .option-card{flex:none;padding:14px 16px}
  .option-card__title{font-size:14px}
  .option-card__text{margin-top:2px;font-size:13.5px}

  .expect{margin-top:36px;padding:28px 22px;border-radius:20px}
  .expect__title{margin-bottom:20px;font-size:28px}
  .expect__steps{flex-direction:column;flex-wrap:nowrap;gap:18px}
  .expect__step{flex:none}
  .expect__badge{flex-basis:32px;height:32px;font-size:13px}
  .expect__step-text{margin-top:0;font-size:14px}
  .expect__note{margin-top:22px;font-size:12.5px}

  /* ---------- Products (swipe row) ---------- */

  .product-card{flex:0 0 240px;border-radius:14px}
  .product-card__media{height:200px}
  .product-card__body{gap:6px;padding:18px}
  .product-card__title{font-size:22px}
  .product-card__text,
  .product-card__meta{font-size:13px}

  .help-banner{
    margin-top:24px;
    flex-direction:column;
    flex-wrap:nowrap;
    align-items:stretch;
    gap:12px;
    padding:24px 20px;
    border-radius:18px;
  }
  .help-banner__text{flex:none}
  .help-banner__title{font-size:26px}
  .help-banner__copy{margin-top:12px;font-size:14.5px}
  .help-banner .btn-row{flex-direction:column;flex-wrap:nowrap}

  /* ---------- Testimonials (swipe row) ---------- */

  .testimonials .section-title{font-size:28px;line-height:1.18}

  .testimonial{flex:0 0 290px;gap:14px;padding:24px;border-radius:18px}
  .testimonial .stars{width:90px;height:16px}
  .testimonial__quote{font-size:20px}
  .testimonial__source{font-size:13px}

  .proof-grid{
    margin-top:20px;
    flex-direction:column;
    flex-wrap:nowrap;
    gap:20px;
  }
  .proof{flex:none;gap:10px}
  .proof__image{border-radius:18px}
  .proof__caption{font-size:13px}

  /* ---------- Branches (tabs) ---------- */

  .branches .section-head{margin-bottom:22px}

  .js .branch-tabs{
    display:flex;
    gap:6px;
    margin-bottom:18px;
    padding:4px;
    background:var(--sand-strong);
    border-radius:var(--radius-pill);
  }
  .branch-tabs__tab{
    flex:1 1 0;
    min-height:44px;
    background:transparent;
    color:var(--ink);
    border:0;
    border-radius:var(--radius-pill);
    font-size:14px;
    font-weight:600;
    cursor:pointer;
  }
  .branch-tabs__tab[aria-pressed="true"]{background:var(--ink);color:var(--cream)}
  .js .branch-card:not(.is-active){display:none}

  .branch-card{border-radius:18px}
  .branch-card__media{height:180px}
  .branch-card__body{gap:14px;padding:22px}
  .branch-card__title{font-size:28px}
  .branch-card .meta-value{font-size:14.5px}
  .branch-card__actions{flex-wrap:nowrap}
  .branch-card__actions .btn{flex:1 1 0;min-height:46px;padding:0 8px}
  .branch-card__cta-long{display:none}
  .branch-card__cta-short{display:inline}

  /* ---------- Contact ---------- */

  .contact{flex-direction:column;flex-wrap:nowrap;gap:20px}
  .contact__info{flex:none;gap:20px}

  /* Tap-to-call tiles replace the contact list */
  .contact-list{display:none}
  .quick-contact{
    display:grid;
    grid-template-columns:repeat(2,minmax(0,1fr));
    gap:10px;
  }
  .quick-contact__tile{
    display:flex;
    flex-direction:column;
    gap:2px;
    min-height:64px;
    padding:14px 16px;
    background:var(--surface);
    color:var(--ink);
    border:1px solid var(--line);
    border-radius:14px;
    text-decoration:none;
  }
  .quick-contact__label{
    font-size:10px;
    letter-spacing:2px;
    text-transform:uppercase;
    color:var(--ink-muted);
  }
  .quick-contact__value{font-size:13px;font-weight:700}
  .quick-contact__tile--wide{grid-column:1 / -1}
  .quick-contact__tile--wide .quick-contact__value{overflow-wrap:anywhere}

  .inquiry-form{flex:none;gap:16px;padding:24px 20px;border-radius:20px}
  .inquiry-form__title{margin:0;font-size:28px}
  .form-row{display:contents}
  .form-row .field{flex:none}
  /* 16px stops iOS Safari zooming the page when a field is focused */
  .field__control{font-size:16px}
  .consent__checkbox{flex:0 0 22px;width:22px;height:22px}
  .inquiry-form__note{font-size:12.5px}

  /* ---------- Footer ---------- */

  /* No extra room needed for the booking bar: main.js hides it here */
  .site-footer__inner{
    padding-top:48px;
    padding-bottom:calc(28px + env(safe-area-inset-bottom));
    gap:28px;
  }
  .site-footer__top{
    flex-direction:column;
    flex-wrap:nowrap;
    align-items:stretch;
    gap:28px;
  }
  .site-footer__brand{gap:6px}
  .site-footer__logo{height:30px}
  .site-footer__tagline{margin-top:10px;font-size:20px}
  .site-footer__since{font-size:12.5px}
  .site-footer__nav{
    display:grid;
    grid-template-columns:repeat(2,minmax(0,1fr));
    gap:0 16px;
  }
  /* 44px touch targets */
  .site-footer__nav a{padding:11px 0}
  .site-footer__legal a{display:inline-flex;align-items:center;min-height:44px}
  .site-footer__bottom{
    flex-direction:column-reverse;
    flex-wrap:nowrap;
    gap:10px;
    padding-top:20px;
    font-size:12.5px;
  }

  /* ---------- Sticky booking bar ---------- */

  .booking-bar{
    position:fixed;
    left:0;
    right:0;
    bottom:0;
    z-index:15;
    display:flex;
    gap:10px;
    padding:12px 16px calc(16px + env(safe-area-inset-bottom));
    background:rgba(248,244,239,0.97); /* --cream at 97% */
    border-top:1px solid var(--line);
  }
  /* main.js hides the bar while the contact section or footer is on screen */
  .booking-bar.is-hidden{display:none}
  .booking-bar__message{
    flex:0 0 52px;
    height:52px;
    display:flex;
    align-items:center;
    justify-content:center;
    color:var(--ink);
    border:1px solid var(--ink);
    border-radius:50%;
  }
  .booking-bar__cta{flex:1 1 auto;min-height:52px}
}
