/* ===============================================================
 * JP Dental — custom overrides on top of the template's style.css
 * Ported from the previous Next.js build (app/globals.css).
 * Loaded last in includes/header.php so these rules win.
 * =============================================================== */

/* Fix for side menu scroll */
#extra-content {
    overflow-y: auto !important;
    right: 0 !important;
    width: 100% !important;
    padding-right: 0 !important;
}

/* Hide body scroll when menu is open */
body.no-scroll {
    overflow: hidden !important;
}

/* Custom scrollbar for side menu */
#extra-content::-webkit-scrollbar {
  width: 6px;
}
#extra-content::-webkit-scrollbar-thumb {
  background-color: rgba(255,255,255,0.2);
  border-radius: 3px;
}

/* Team photos — source images vary in aspect ratio, so crop them to a
   consistent portrait frame instead of letting each one set its own height. */
.team-photo {
  display: block;
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  object-position: center top;
}

/* Larger frame for the full profile blocks on the Dentists page */
.team-photo-lg {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  object-position: center top;
}

/* The phone and email items in the dark contact strip are real tel:/mailto:
   links, so keep them looking like the surrounding text rather than picking up
   the default link colour and underline. */
.contact-link,
.contact-link:hover,
.contact-link:focus {
  color: inherit;
  text-decoration: none;
}

.contact-link h4,
.contact-link p {
  color: inherit;
}

.contact-link {
  transition: opacity 0.2s ease;
}

.contact-link:hover {
  opacity: 0.75;
}

.contact-link:focus-visible {
  outline: 2px solid var(--primary-color, #f75023);
  outline-offset: 6px;
  border-radius: 4px;
}

/* ---------------------------------------------------------------
 * Mobile refinements (phone widths only — desktop layout unchanged)
 * --------------------------------------------------------------- */
@media (max-width: 767px) {

  /* Contact strip: stack the icon above its text so all three items read as
     one tidy centred column, instead of three rows indented differently by
     their own label widths. */
  .contact-strip .d-flex {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .contact-strip .d-flex > div {
    margin-left: 0 !important;
    margin-top: 10px;
  }

  .contact-strip i {
    font-size: 44px !important;
    line-height: 1;
  }

  .contact-strip p {
    margin-bottom: 0;
  }

  .contact-strip .mb-sm-30 {
    margin-bottom: 26px !important;
  }

  /* Footer: centre every column and the subfooter row. */
  footer {
    padding-top: 60px;
  }

  footer .container > .row > [class*="col-"] {
    text-align: center;
    margin-bottom: 30px;
  }

  footer .logo-footer {
    display: block;
    margin: 0 auto;
  }

  footer .widget {
    margin-bottom: 30px;
  }

  .subfooter .de-flex,
  .subfooter .de-flex > .de-flex-col {
    text-align: center;
    justify-content: center;
  }

  .subfooter .menu-simple {
    margin-top: 12px;
  }

  .subfooter .menu-simple li {
    margin: 0 10px;
  }
}

/* ---------------------------------------------------------------
 * Sticky mobile action bar (phones only)
 * --------------------------------------------------------------- */
.mobile-action-bar {
  display: none;
}

@media (max-width: 767px) {
  .mobile-action-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1030;
    padding: 8px 12px;
    /* sit above the iOS home indicator rather than under it */
    padding-bottom: calc(8px + env(safe-area-inset-bottom));
    background: #ffffff;
    border-top: 1px solid rgba(18, 40, 90, 0.12);
    box-shadow: 0 -4px 16px rgba(18, 40, 90, 0.1);
  }

  .mobile-action-bar .mab-item {
    flex: 1 1 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    padding: 6px 4px;
    font-size: 11px;
    font-weight: 600;
    line-height: 1.2;
    color: var(--secondary-color);
    text-decoration: none;
  }

  .mobile-action-bar .mab-item i {
    font-size: 17px;
    color: var(--primary-color);
  }

  .mobile-action-bar .mab-item:hover,
  .mobile-action-bar .mab-item:active {
    color: var(--primary-color);
  }

  .mobile-action-bar .mab-cta {
    flex: 1.5 1 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px 10px;
    border-radius: 8px;
    background: var(--primary-color);
    color: #ffffff;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.2;
    text-align: center;
    text-decoration: none;
    white-space: nowrap;
  }

  .mobile-action-bar .mab-cta:hover,
  .mobile-action-bar .mab-cta:active {
    background: var(--secondary-color);
    color: #ffffff;
  }

  .mobile-action-bar a:focus-visible {
    outline: 2px solid var(--secondary-color);
    outline-offset: 2px;
    border-radius: 8px;
  }

  /* Keep the bar from covering the end of the page or the back-to-top button. */
  #wrapper {
    padding-bottom: calc(68px + env(safe-area-inset-bottom));
  }

  #back-to-top.show {
    bottom: calc(80px + env(safe-area-inset-bottom));
  }
}

/* ---------------------------------------------------------------
 * Page subheader clearance on tablet/phone
 * --------------------------------------------------------------- */
/* style.css has two conflicting mobile rules: the 992px block forces
   `padding: 40px 0 !important`, which beats the 767px block's `padding-top:
   100px`. 40px is less than the height of the absolutely-positioned header, so
   the page title ends up tucked behind the logo. `body` prefix raises
   specificity so this wins regardless of stylesheet order. */
@media (max-width: 992px) {
  body #subheader {
    padding: 120px 0 50px 0 !important;
  }
}

@media (max-width: 575px) {
  body #subheader {
    padding: 110px 0 40px 0 !important;
  }
}

/* ---------------------------------------------------------------
 * Form feedback + honeypot
 * --------------------------------------------------------------- */
.jp-alert {
  padding: 18px 20px;
  border-radius: 8px;
  margin-bottom: 24px;
  border-left: 4px solid;
  font-size: 15px;
}

.jp-alert-success {
  background: #e8f6ec;
  border-left-color: #2e7d32;
  color: #1b5e20;
}

.jp-alert-error {
  background: #fdecea;
  border-left-color: #c62828;
  color: #8e1c1c;
}

.jp-alert ul {
  padding-left: 18px;
}

.jp-alert a {
  color: inherit;
  font-weight: 700;
  text-decoration: underline;
}

/* Honeypot field: off-screen for people, still fillable by naive bots.
   display:none would let smarter bots skip it. */
.jp-hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* Blog thumbnails: post images vary, so crop to a consistent card ratio. */
.blog-thumb {
  display: block;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.blog-thumb:hover {
  transform: scale(1.04);
}

.blog-article p {
  margin-bottom: 1.1rem;
}

/* ---------------------------------------------------------------
 * "Why Patients Choose Us" — treatment pages
 * Replaces the old half-split block that paired a tick list with a
 * generic stock photo of Western models.
 * --------------------------------------------------------------- */
.jp-reasons {
  background: #fff;
}

.jp-reason {
  height: 100%;
  padding: 34px 30px;
  background: #fff;
  border: 1px solid rgba(18, 40, 90, 0.1);
  border-radius: 14px;
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

.jp-reason:hover {
  transform: translateY(-4px);
  border-color: rgba(242, 101, 34, 0.35);
  box-shadow: 0 14px 34px rgba(18, 40, 90, 0.09);
}

.jp-reason-icon {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  margin-bottom: 20px;
  border-radius: 15px;
  background: rgba(242, 101, 34, 0.1);
  color: var(--primary-color);
  font-size: 27px;
  line-height: 1;
  transition: background 0.3s ease, color 0.3s ease;
}

.jp-reason:hover .jp-reason-icon {
  background: var(--primary-color);
  color: #fff;
}

.jp-reason h4 {
  margin-bottom: 9px;
  font-size: 19px;
}

.jp-reason p {
  margin-bottom: 0;
  font-size: 15px;
}

@media (max-width: 767px) {
  .jp-reason {
    padding: 26px 22px;
  }

  .jp-reason-icon {
    width: 50px;
    height: 50px;
    font-size: 23px;
    margin-bottom: 15px;
  }
}

/* ---------------------------------------------------------------
 * Treatment page sections: signs, process, FAQ, related
 * --------------------------------------------------------------- */

/* --- Who it's for --------------------------------------------- */
.jp-sign {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  height: 100%;
  padding: 16px 18px;
  background: #fff;
  border-radius: 11px;
  font-weight: 600;
  font-size: 15px;
  line-height: 1.45;
  color: var(--heading-font-color, #12285a);
}

.jp-sign i {
  flex: 0 0 auto;
  margin-top: 2px;
  font-size: 19px;
  color: var(--primary-color);
}

/* --- Treatment process ---------------------------------------- */
.jp-step {
  position: relative;
  height: 100%;
  padding: 34px 26px 28px;
  background: #fff;
  border: 1px solid rgba(18, 40, 90, 0.1);
  border-radius: 14px;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.jp-step:hover {
  border-color: rgba(242, 101, 34, 0.35);
  box-shadow: 0 12px 30px rgba(18, 40, 90, 0.08);
}

.jp-step-num {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  margin-bottom: 16px;
  border-radius: 50%;
  background: var(--primary-color);
  color: #fff;
  font-size: 17px;
  font-weight: 800;
  line-height: 1;
}

.jp-step h4 { margin-bottom: 8px; font-size: 18px; }
.jp-step p  { margin-bottom: 0; font-size: 15px; }

/* --- FAQ accordion -------------------------------------------- */
.jp-faq-item {
  background: #fff;
  border: 1px solid rgba(18, 40, 90, 0.1);
  border-radius: 12px;
  margin-bottom: 12px;
  overflow: hidden;
}

.jp-faq-item[open] {
  border-color: rgba(242, 101, 34, 0.35);
}

.jp-faq-item summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 24px;
  cursor: pointer;
  font-weight: 700;
  font-size: 17px;
  color: var(--heading-font-color, #12285a);
  list-style: none;
}

/* Hide the native disclosure triangle in both engines */
.jp-faq-item summary::-webkit-details-marker { display: none; }
.jp-faq-item summary::marker { content: ''; }

.jp-faq-item summary:hover { color: var(--primary-color); }

.jp-faq-item summary i {
  flex: 0 0 auto;
  font-size: 20px;
  color: var(--primary-color);
  transition: transform 0.25s ease;
}

.jp-faq-item[open] summary i { transform: rotate(180deg); }

.jp-faq-body {
  padding: 0 24px 22px;
}

.jp-faq-body p {
  margin: 0;
  font-size: 15.5px;
}

/* --- Related treatments --------------------------------------- */
.jp-related-card {
  display: block;
  height: 100%;
  padding: 30px 26px;
  background: #fff;
  border: 1px solid rgba(18, 40, 90, 0.1);
  border-radius: 14px;
  text-decoration: none;
  color: inherit;
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

.jp-related-card:hover {
  transform: translateY(-4px);
  border-color: rgba(242, 101, 34, 0.35);
  box-shadow: 0 14px 34px rgba(18, 40, 90, 0.09);
}

.jp-related-icon {
  width: 52px;
  height: 52px;
  object-fit: contain;
  margin-bottom: 16px;
}

.jp-related-card h4 {
  margin-bottom: 8px;
  font-size: 18px;
  color: var(--heading-font-color, #12285a);
}

.jp-related-card:hover h4 { color: var(--primary-color); }

.jp-related-card p {
  margin-bottom: 14px;
  font-size: 15px;
}

.jp-related-more {
  font-weight: 700;
  font-size: 14px;
  color: var(--primary-color);
}

.jp-related-more i {
  transition: transform 0.25s ease;
  display: inline-block;
}

.jp-related-card:hover .jp-related-more i { transform: translateX(4px); }

@media (max-width: 767px) {
  .jp-step,
  .jp-related-card { padding: 24px 20px; }
  .jp-faq-item summary { padding: 16px 18px; font-size: 16px; }
  .jp-faq-body { padding: 0 18px 18px; }
}

/* ---------------------------------------------------------------
 * Treatment hero images
 * Source photos arrive in whatever shape the camera gave them (the
 * children-dentistry pair range from 1.50 to 0.47 aspect), so crop both
 * to the ratios the layout was designed around instead of letting each
 * image set its own height and push the composition apart.
 * --------------------------------------------------------------- */
.jp-treatment-hero {
  display: block;
  width: 100%;
  aspect-ratio: 3 / 2;
  object-fit: cover;
  object-position: center;
}

.jp-treatment-inset {
  display: block;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  object-position: center top;
}

/* ---------------------------------------------------------------
 * About page — first section image pair
 * The two source photos are 1.50 and 0.67 aspect. Crop each to the
 * shape its slot was designed for, so the staggered composition holds.
 * --------------------------------------------------------------- */
.jp-about-landscape {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  object-position: center;
}

.jp-about-portrait {
  display: block;
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  object-position: center top;
}

/* ---------------------------------------------------------------
 * Patient reviews (real Google reviews)
 * --------------------------------------------------------------- */
.jp-rating-card {
  display: flex;
  align-items: center;
  gap: 26px;
  flex-wrap: wrap;
  padding: 28px 32px;
  background: #fff;
  border: 1px solid rgba(18, 40, 90, 0.1);
  border-radius: 14px;
}

.jp-rating-score {
  text-align: center;
  padding-right: 26px;
  border-right: 1px solid rgba(18, 40, 90, 0.1);
}

.jp-rating-score strong {
  display: block;
  font-size: 46px;
  line-height: 1;
  color: var(--secondary-color);
  font-weight: 800;
}

.jp-rating-score .d-stars {
  display: block;
  margin-top: 6px;
  color: #fbbc04;   /* Google's own star colour */
  font-size: 14px;
}

.jp-rating-meta { flex: 1 1 260px; }
.jp-rating-meta p { margin-bottom: 0; }

.jp-review {
  height: 100%;
  padding: 28px 26px;
  background: #fff;
  border: 1px solid rgba(18, 40, 90, 0.1);
  border-radius: 14px;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.jp-review:hover {
  border-color: rgba(242, 101, 34, 0.3);
  box-shadow: 0 12px 30px rgba(18, 40, 90, 0.07);
}

.jp-review .d-stars { color: #fbbc04; font-size: 14px; }

.jp-review p {
  font-size: 15px;
  margin-bottom: 0.9rem;
}

.jp-review p:last-child { margin-bottom: 0; }

.jp-review-head {
  display: flex;
  align-items: center;
  gap: 13px;
  margin-bottom: 14px;
}

.jp-review-avatar {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--secondary-color);
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.jp-review-who { flex: 1 1 auto; min-width: 0; }

.jp-review-who h4 {
  margin: 0;
  font-size: 16px;
  line-height: 1.3;
}

.jp-review-meta {
  font-size: 12.5px;
  color: var(--body-font-color, #6b7590);
}

.jp-review-topic {
  flex: 0 0 auto;
  padding: 4px 11px;
  border-radius: 20px;
  background: rgba(242, 101, 34, 0.1);
  color: var(--primary-color);
  font-size: 11.5px;
  font-weight: 700;
  white-space: nowrap;
}

/* Compact variant used on the homepage */
.jp-review-sm { display: flex; flex-direction: column; }

.jp-review-quote {
  flex: 1 1 auto;
  font-size: 14.5px !important;
  margin-bottom: 18px !important;
}

.jp-review-head-sm {
  margin-bottom: 0;
  padding-top: 16px;
  border-top: 1px solid rgba(18, 40, 90, 0.08);
}

.jp-review-head-sm .jp-review-avatar {
  width: 38px;
  height: 38px;
  font-size: 13px;
}

@media (max-width: 767px) {
  .jp-rating-card { padding: 22px; gap: 18px; }
  .jp-rating-score { padding-right: 18px; }
  .jp-rating-score strong { font-size: 38px; }
  .jp-review { padding: 22px 20px; }
  .jp-review-topic { display: none; }
}

/* ---------------------------------------------------------------
 * About page — sterilisation & clinic standards
 * Replaces the old two-column wall of text and tick list.
 * --------------------------------------------------------------- */
.jp-standard {
  height: 100%;
  padding: 32px 28px;
  background: #fff;
  border: 1px solid rgba(18, 40, 90, 0.1);
  border-radius: 14px;
  text-align: center;
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

.jp-standard:hover {
  transform: translateY(-4px);
  border-color: rgba(242, 101, 34, 0.35);
  box-shadow: 0 14px 34px rgba(18, 40, 90, 0.09);
}

.jp-standard-icon {
  display: grid;
  place-items: center;
  width: 62px;
  height: 62px;
  margin: 0 auto 18px;
  border-radius: 50%;
  background: rgba(242, 101, 34, 0.1);
  color: var(--primary-color);
  font-size: 28px;
  line-height: 1;
  transition: background 0.3s ease, color 0.3s ease;
}

.jp-standard:hover .jp-standard-icon {
  background: var(--primary-color);
  color: #fff;
}

.jp-standard h4 { margin-bottom: 9px; font-size: 18px; }
.jp-standard p  { margin-bottom: 0; font-size: 15px; }

/* Highlight chips */
.jp-highlight {
  display: flex;
  align-items: flex-start;
  gap: 13px;
  height: 100%;
  padding: 20px 20px;
  background: #fff;
  border: 1px solid rgba(18, 40, 90, 0.08);
  border-radius: 12px;
  font-weight: 600;
  font-size: 14.5px;
  line-height: 1.45;
  color: var(--heading-font-color, #12285a);
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.jp-highlight:hover {
  border-color: rgba(242, 101, 34, 0.3);
  box-shadow: 0 10px 26px rgba(18, 40, 90, 0.07);
}

.jp-highlight i {
  flex: 0 0 auto;
  margin-top: 1px;
  font-size: 21px;
  color: var(--primary-color);
}

@media (max-width: 767px) {
  .jp-standard  { padding: 26px 22px; }
  .jp-highlight { padding: 16px 18px; }
}

/* ---------------------------------------------------------------
 * Fifth-width column
 * Bootstrap's 12-column grid has no 5-across option, so the treatment
 * grid lays out as 5 + 4 instead of leaving a lone card on its own row.
 * Only applies at desktop; below that the normal col-md/col-sm rules win.
 * --------------------------------------------------------------- */
@media (min-width: 992px) {
  .jp-col-5 {
    flex: 0 0 auto;
    width: 20%;
  }
}

/* ---------------------------------------------------------------
 * Treatment cards — uniform height
 * Descriptions vary in length, so without this the cards end at
 * different heights and the "+" buttons sit at different levels.
 * The card fills its column and the button is pushed to the bottom.
 * --------------------------------------------------------------- */
.jp-tcard {
  display: flex;
  flex-direction: column;
  height: 100%;
  border: 1px solid rgba(18, 40, 90, 0.08);
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

/* The template wraps each card in .hover, which has no height of its own. */
.hover:has(.jp-tcard) { height: 100%; }

.jp-tcard > .relative {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
}

.jp-tcard h4 {
  min-height: 2.6em;      /* one- and two-line titles align */
  margin-bottom: 10px;
}

.jp-tcard p {
  flex: 1 1 auto;
  margin-bottom: 20px;
}

.jp-tcard .btn-plus {
  margin-top: auto;       /* pin to the bottom of every card */
  align-self: flex-start;
}

.jp-tcard img {
  height: 62px;
  width: auto;
  object-fit: contain;
}

.jp-tcard:hover {
  transform: translateY(-4px);
  border-color: rgba(242, 101, 34, 0.3);
  box-shadow: 0 14px 34px rgba(18, 40, 90, 0.09);
}

@media (max-width: 991px) {
  .jp-tcard h4 { min-height: 0; }
}

/* Fallback: older engines ignore :has(), so stretch every .hover in a
   treatments row instead. */
.row > [class*="col"] > .hover { height: 100%; }

/* ---------------------------------------------------------------
 * Floating WhatsApp button
 * Desktop only — on phones the sticky action bar already carries
 * WhatsApp, and a float would sit on top of it.
 * --------------------------------------------------------------- */
.jp-wa-float {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 1035;
  display: flex;
  align-items: center;
  gap: 0;
  height: 56px;
  padding: 0 16px;
  border-radius: 28px;
  background: #25d366;          /* WhatsApp brand green — recognised instantly */
  color: #fff;
  text-decoration: none;
  box-shadow: 0 6px 20px rgba(37, 211, 102, 0.4);
  overflow: hidden;
  transition: box-shadow 0.3s ease, transform 0.3s ease;
}

.jp-wa-float i {
  font-size: 27px;
  line-height: 1;
}

/* Label stays collapsed until hover, so the button reads as an icon at rest. */
.jp-wa-label {
  max-width: 0;
  opacity: 0;
  white-space: nowrap;
  font-weight: 700;
  font-size: 15px;
  transition: max-width 0.35s ease, opacity 0.25s ease, margin-left 0.35s ease;
}

.jp-wa-float:hover,
.jp-wa-float:focus-visible {
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 10px 26px rgba(37, 211, 102, 0.5);
}

.jp-wa-float:hover .jp-wa-label,
.jp-wa-float:focus-visible .jp-wa-label {
  max-width: 160px;
  opacity: 1;
  margin-left: 10px;
}

.jp-wa-float:focus-visible {
  outline: 3px solid var(--secondary-color);
  outline-offset: 3px;
}

/* Keep the back-to-top button clear of the float — desktop only, so the
   mobile rule that clears the sticky action bar (and the iOS safe area)
   still applies on phones. */
@media (min-width: 768px) {
  #back-to-top.show {
    bottom: 88px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .jp-wa-float,
  .jp-wa-label { transition: none; }
}

/* Phones already have WhatsApp in the sticky bar. */
@media (max-width: 767px) {
  .jp-wa-float { display: none; }
}

/* ---------------------------------------------------------------
 * Always-visible sticky header
 *
 * The template ships an auto-hide header: on3step.js adds .scroll-down
 * while scrolling down, and style.css:327 pulls it off-screen with
 * margin-top:-90px. The header only reappeared when scrolling back up.
 * Neutralising the offset keeps it fixed and visible in both directions;
 * the .smaller class still handles the fixed positioning and shrink.
 * --------------------------------------------------------------- */
@media (min-width: 992px) {
  header.scroll-down,
  header.nav-up,
  header.header-center.scroll-down {
    margin-top: 0;
  }
}
