/* ============================================================================
   Moving Medical Massage — WordPress additions
   Loaded after style-2.css (light) / style-3.css (dark) and written only in
   their shared custom properties, so everything here follows the active mode.
   --teal-deep only exists in the light sheet and --teal-bright only in the
   dark one, so text accents use var(--teal-deep, var(--teal-bright)).
   ==========================================================================*/

/* --------------------------------------------------- Header: mode toggle --- */
.header-tools { display: flex; align-items: center; gap: .6rem; flex: none; }

.mode-toggle {
  display: none;               /* shown once the head script has set data-mode */
  place-items: center;
  width: 46px; height: 46px;
  padding: 0;
  border: 1px solid var(--hairline);
  border-radius: 14px;
  background: var(--surface-strong);
  color: var(--ink);
  cursor: pointer;
  transition: transform .3s var(--ease), border-color .3s var(--ease), background-color .3s var(--ease);
}
[data-mode] .mode-toggle { display: grid; }
[data-mode="dark"] .mode-toggle { border-color: var(--sage); }
.mode-toggle:hover { transform: translateY(-2px); border-color: var(--sage-mid); }
.mode-toggle .icon {
  grid-area: 1 / 1;
  width: 19px; height: 19px;
  transition: opacity .35s var(--ease), transform .5s var(--ease);
}
/* Light mode offers the moon (go dark); dark mode offers the sun. */
[data-mode="dark"] .mode-icon-moon,
:root:not([data-mode="dark"]) .mode-icon-sun { opacity: 0; transform: rotate(-90deg) scale(.5); }

@media (max-width: 1150px) and (min-width: 861px) {
  .mode-toggle { width: 40px; height: 40px; border-radius: 12px; }
}

/* Custom logo (Appearance → Customize → Site Identity) */
.brand-logo { display: grid; place-items: center; flex: none; }
.brand-logo img { display: block; height: 42px; width: auto; max-width: 160px; border-radius: 10px; }

/* Admin bar offsets for logged-in editors */
.admin-bar .site-header { top: 32px; }
.admin-bar .scroll-progress { top: 32px; }
@media (max-width: 782px) {
  .admin-bar .site-header,
  .admin-bar .scroll-progress { top: 46px; }
}
@media (max-width: 600px) {
  .admin-bar .site-header,
  .admin-bar .scroll-progress { top: 0; }
}

/* Hamburger: as a grid the three bars stretched across the whole 46px button
   (row stretch + gap on top of the span margins), so they sat 18px apart and
   the ±6px "X" transform never met in the middle. Pack them in the centre. */
.nav-toggle { gap: 0; align-content: center; }

/* ------------------------------------------------- Mobile drawer + header -- */
@media (max-width: 860px) {
  /* backdrop-filter on the header makes it the containing block for the
     position:fixed drawer inside it, squashing the drawer into the header
     bar. Move the blur onto a pseudo-element so the drawer is fixed to the
     viewport again. */
  .site-header { -webkit-backdrop-filter: none; backdrop-filter: none; }
  .site-header::before {
    content: ""; position: absolute; inset: 0; z-index: -1;
    -webkit-backdrop-filter: blur(16px);
    backdrop-filter: blur(16px);
    pointer-events: none;
  }

  /* The header's z-index:100 is a stacking context, so the drawer (105) can't
     rise above the scrim (104) on the body — the scrim covered the menu.
     Put the scrim under the header, and keep the close button above the drawer. */
  .nav-scrim { z-index: 99; }
  .header-tools { position: relative; z-index: 106; }

  /* Closed drawer: hidden from tab order / screen readers, not just off-screen. */
  .nav { visibility: hidden; transition: transform .45s var(--ease), visibility 0s .45s; }
  .nav.is-open { visibility: visible; transition: transform .45s var(--ease); }

  /* Let the brand shrink instead of shoving the menu button off-screen. */
  .header-inner { gap: .75rem; }
  .brand { min-width: 0; }
  .brand-text strong { white-space: normal; }
}

@media (max-width: 480px) {
  .brand { gap: .55rem; }
  .brand-mark { width: 34px; height: 34px; border-radius: 11px; }
  .brand-mark .icon { width: 20px; height: 20px; }
  .brand-logo img { height: 34px; max-width: 120px; }
  .brand-text strong { font-size: 1.05rem; }
  .brand-text small { font-size: .58rem; letter-spacing: .14em; }
  .header-tools { gap: .4rem; }
  .nav-toggle,
  .mode-toggle { width: 42px; height: 42px; border-radius: 12px; }
}

/* ------------------------------------------------- Horizontal overflow --- */
/* The review track lays every slide side by side at 100% width each, and
   nothing clipped it — the page became N screens wide. body's overflow-x is
   ignored for layout on phones, so the viewport grew to fit and the
   right-pinned drawer opened far off to the side. Clip the slider, and clip
   <main> as a backstop (clip, unlike hidden, doesn't break the sticky header). */
.slider { overflow: hidden; overflow-x: clip; overflow-y: visible; }
#main { overflow-x: clip; }

/* --------------------------------------------- Mobile contact + form ----- */
/* The stacked layouts used a bare "1fr", whose minimum is the widest
   unbreakable content — the email address, or a phone's native date picker —
   so the contact card and form grew past the screen edge. minmax(0, 1fr)
   lets them fit the column, and long addresses wrap instead. */
.contact-list li > div,
.field,
.field input,
.field select,
.field textarea { min-width: 0; }
.contact-list a,
.contact-list p,
.footer-contact a { overflow-wrap: anywhere; }

@media (max-width: 1024px) {
  .split, .split-narrow, .contact-grid { grid-template-columns: minmax(0, 1fr); }
  .footer-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .field-row, .footer-grid { grid-template-columns: minmax(0, 1fr); }
  .contact-info { padding: 1.6rem 1.3rem; }
  .contact-form-wrap { padding: 1.5rem 1.2rem; }
  /* iOS sizes date inputs to their own content and ignores width: 100%. */
  .field input[type="date"] { -webkit-appearance: none; appearance: none; display: block; min-height: 3.1rem; }
}

/* --------------------------------------------------- Mobile hero visual --- */
/* The glow and blobs are wider than a phone screen. */
.hero { overflow-x: clip; }

@media (max-width: 1024px) {
  /* The stones hang ~96px below their zero-size anchor, so once the visual
     stacks above the copy they landed on the eyebrow and heading. Give the
     anchor their real size so they stay inside the visual. */
  .hero-still { width: 76px; height: 96px; }

  /* And never let a decorative layer paint over the text. */
  .hero-copy { position: relative; z-index: 4; }
}

/* ------------------------------------------------------ Front-page bits --- */
/* Intro + FAQ text arrive as paragraphs from the Customizer. */
.lede p { margin-bottom: .8em; }
.lede p:last-child { margin-bottom: 0; }

/* Optional portrait photo (Customizer → About section) */
.portrait.has-photo { place-items: end start; }
.portrait-photo {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
}
.portrait.has-photo::after {
  background: linear-gradient(180deg, transparent 50%, rgba(10, 18, 14, .62) 100%);
}
.portrait.has-photo .portrait-inner {
  padding: 0 1.6rem 1.5rem;
  max-width: 70%;
  text-align: left;
  color: #fff;
  text-shadow: 0 1px 12px rgba(0, 0, 0, .35);
}

/* ------------------------------------------------- Ordinary pages/posts --- */
.page-main { min-height: 55vh; }
.page-shell { max-width: 48rem; }
.entry-head { margin-bottom: 2.2rem; }
.entry-title { margin-bottom: .3em; }

.entry-thumb { margin: 0 0 2.2rem; }
.entry-thumb img { display: block; width: 100%; height: auto; border-radius: var(--radius-lg); box-shadow: var(--shadow); }

.entry-content::after { content: ""; display: table; clear: both; }
.entry-content a:not(.btn):not(.wp-element-button) {
  color: var(--teal-deep, var(--teal-bright));
  text-decoration: underline;
  text-underline-offset: .18em;
  text-decoration-thickness: 1px;
}
.entry-content a:not(.btn):not(.wp-element-button):hover { color: var(--ink); }
.entry-content h2 { font-size: clamp(1.6rem, 1.3rem + 1.2vw, 2.2rem); margin-top: 1.7em; }
.entry-content h3 { margin-top: 1.5em; }
.entry-content h4 { font-size: 1.2rem; margin-top: 1.4em; }
.entry-content ul,
.entry-content ol { margin: 0 0 1.1em; padding-left: 1.3em; }
.entry-content li + li { margin-top: .35em; }
.entry-content img { max-width: 100%; height: auto; border-radius: var(--radius); }
.entry-content figure { margin: 2em 0; }
.entry-content blockquote {
  margin: 1.8em 0;
  padding: 1.3rem 1.5rem;
  border-left: 3px solid var(--teal);
  border-radius: var(--radius-sm);
  background: var(--surface);
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 1.35rem; line-height: 1.45;
  color: var(--ink);
}
.entry-content blockquote cite { display: block; margin-top: .6rem; font-family: "Inter", sans-serif; font-size: .82rem; font-style: normal; color: var(--ink-faint); }
.entry-content hr { border: 0; border-top: 1px solid var(--hairline); margin: 2.6em 0; }
.entry-content table { width: 100%; border-collapse: collapse; margin: 1.6em 0; font-size: .94rem; }
.entry-content th,
.entry-content td { padding: .7rem .5rem; border-bottom: 1px solid var(--hairline); text-align: left; }
.entry-content th { color: var(--ink); font-weight: 600; }
.entry-content code { padding: .1em .35em; border-radius: 6px; background: var(--surface-strong); font-size: .9em; }
.entry-content pre { padding: 1rem 1.2rem; border-radius: var(--radius-sm); background: var(--surface-strong); overflow-x: auto; font-size: .88rem; }
.entry-content pre code { padding: 0; background: none; }

/* Block editor buttons pick up the theme's primary button */
.wp-element-button,
.wp-block-button__link {
  display: inline-flex; align-items: center; justify-content: center;
  padding: .8rem 1.5rem;
  border: 0; border-radius: var(--pill);
  background: linear-gradient(135deg, var(--teal), var(--sage-mid));
  color: var(--on-accent);
  font-weight: 500; font-size: .95rem; line-height: 1.2;
  text-decoration: none;
  transition: transform .3s var(--ease), box-shadow .3s var(--ease);
}
.wp-element-button:hover,
.wp-block-button__link:hover { color: var(--on-accent); transform: translateY(-2px); box-shadow: var(--shadow); }
.is-style-outline .wp-block-button__link { background: transparent; color: var(--ink); border: 1px solid var(--sage); }

.page-links { display: flex; gap: .5rem; margin-top: 2rem; font-size: .9rem; }

/* Blog list */
.post-list { display: grid; gap: 1.5rem; }
.post-card .service-tagline { margin-bottom: .4rem; }
.post-card-title { font-size: clamp(1.45rem, 1.2rem + .9vw, 1.9rem); margin-bottom: .5rem; }
.post-card-title a { color: var(--ink); }
.post-card-title a:hover { color: var(--teal-deep, var(--teal-bright)); }
.post-card .service-desc p { margin: 0; }
.post-card .service-foot { margin-top: 1.2rem; }

.pagination .nav-links { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 2.6rem; }
.pagination .page-numbers {
  display: inline-grid; place-items: center;
  min-width: 44px; height: 44px; padding: 0 1rem;
  border-radius: var(--pill);
  border: 1px solid var(--hairline);
  background: var(--surface);
  color: var(--ink); font-size: .9rem;
}
.pagination .page-numbers.current {
  background: linear-gradient(135deg, var(--teal), var(--sage-mid));
  border-color: transparent;
  color: var(--on-accent);
}
.pagination a.page-numbers:hover { border-color: var(--sage-mid); }

/* Comments */
.comments-area { margin-top: 3.5rem; padding-top: 2.5rem; border-top: 1px solid var(--hairline); }
.comments-title { font-size: 1.7rem; }
.comment-list { list-style: none; margin: 0 0 2rem; padding: 0; }
.comment-list .children { list-style: none; padding-left: 1.5rem; }
.comment-body {
  margin-bottom: 1rem; padding: 1.2rem 1.4rem;
  border-radius: var(--radius);
  border: 1px solid var(--hairline);
  background: var(--surface);
  font-size: .94rem;
}
.comment-author { display: flex; align-items: center; gap: .6rem; color: var(--ink); }
.comment-author img { border-radius: 50%; }
.comment-metadata { font-size: .78rem; margin-bottom: .6rem; }
.comment-metadata a { color: var(--ink-faint); }
.comment-reply-title { font-size: 1.5rem; }
.comment-form p { margin: 0; }
.comment-form label { display: block; margin-bottom: .35rem; font-size: .85rem; font-weight: 500; color: var(--ink); }
.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"],
.comment-form textarea {
  width: 100%;
  padding: .85rem 1rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--hairline);
  background: var(--surface-strong);
  color: var(--ink);
}
.comment-form-cookies-consent { display: flex; gap: .6rem; align-items: flex-start; font-size: .86rem; }
.comment-form-cookies-consent label { font-weight: 400; color: var(--ink-faint); }

/* ------------------------------------------------- WordPress core classes -- */
.screen-reader-text {
  border: 0;
  clip: rect(1px, 1px, 1px, 1px);
  clip-path: inset(50%);
  height: 1px; width: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  position: absolute !important;
  word-wrap: normal !important;
}
.screen-reader-text:focus {
  clip: auto !important; clip-path: none;
  display: block;
  height: auto; width: auto;
  left: 5px; top: 5px;
  padding: .8rem 1.2rem;
  z-index: 100000;
  background: var(--ink); color: var(--on-accent);
  border-radius: var(--radius-sm);
}
.alignleft  { float: left;  margin: .3em 1.5em 1em 0; }
.alignright { float: right; margin: .3em 0 1em 1.5em; }
.aligncenter { display: block; margin-inline: auto; }
.wp-caption { max-width: 100%; }
.wp-caption-text,
.gallery-caption,
.wp-element-caption { margin-top: .5rem; font-size: .84rem; color: var(--ink-faint); text-align: center; }
.sticky,
.bypostauthor { /* hooks for child themes */ }

@media (max-width: 640px) {
  .alignleft, .alignright { float: none; margin: 1em 0; }
}
