/* ── Charmacu Enhancements — HTML5 Conversion Layer ── */

/* Scroll Reveal */
.reveal {
  opacity: 0;
  transform: translateY(2rem);
  filter: blur(3px);
  transition:
    opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1),
    transform 0.7s cubic-bezier(0.16, 1, 0.3, 1),
    filter 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
  filter: blur(0);
}
.reveal-delay-1 { transition-delay: 90ms; }
.reveal-delay-2 { transition-delay: 180ms; }
.reveal-delay-3 { transition-delay: 270ms; }
.reveal-delay-4 { transition-delay: 360ms; }

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; filter: none; transition: none; }
}

/* Scroll progress bar */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 2px;
  width: 100%;
  background: var(--sage);
  z-index: 200;
  transform-origin: left center;
  transform: scaleX(0);
  pointer-events: none;
}

/* Header scroll state */
.site-header {
  transition:
    box-shadow 0.4s cubic-bezier(0.16, 1, 0.3, 1),
    background 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}
.site-header.scrolled {
  box-shadow: 0 4px 32px rgba(0, 0, 0, 0.08);
}

/* ── Carousel Arrow Controls ── */
.hero-carousel-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 4;
  width: 44px;
  height: 44px;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink);
  font-size: 1.125rem;
  line-height: 1;
  pointer-events: auto;
  transition:
    background 0.4s cubic-bezier(0.16, 1, 0.3, 1),
    transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}
.hero-carousel-arrow:hover {
  background: rgba(255, 255, 255, 1);
  transform: translateY(-50%) scale(1.1);
}
.hero-carousel-arrow--prev { left: 1rem; }
.hero-carousel-arrow--next { right: 1rem; }

@media (max-width: 600px) {
  .hero-carousel-arrow { display: none; }
}

/* ── FAQ Accordion ── */
.faq-item dt {
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  user-select: none;
  -webkit-user-select: none;
}
.faq-item dt:focus-visible {
  outline: 2px solid var(--sage);
  outline-offset: 4px;
  border-radius: 4px;
}

.faq-icon {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
  position: relative;
  margin-left: 1rem;
}
.faq-icon::before,
.faq-icon::after {
  content: '';
  position: absolute;
  background: var(--ink);
  border-radius: 2px;
  transition:
    transform 0.45s cubic-bezier(0.16, 1, 0.3, 1),
    opacity 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
.faq-icon::before {
  width: 14px;
  height: 2px;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}
.faq-icon::after {
  width: 2px;
  height: 14px;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}
.faq-item.is-open .faq-icon::after {
  transform: translate(-50%, -50%) rotate(90deg);
  opacity: 0;
}

.faq-item dd {
  display: grid;
  grid-template-rows: 0fr;
  opacity: 0;
  transition:
    grid-template-rows 0.5s cubic-bezier(0.16, 1, 0.3, 1),
    opacity 0.4s cubic-bezier(0.16, 1, 0.3, 1),
    padding-top 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  margin: 0;
  padding-top: 0;
}
.faq-item dd > * {
  overflow: hidden;
}
.faq-item.is-open dd {
  grid-template-rows: 1fr;
  opacity: 1;
  padding-top: 0.75rem;
}

/* Fallback for browsers without grid-template-rows animation */
@supports not (grid-template-rows: 0fr) {
  .faq-item dd {
    max-height: 0;
    overflow: hidden;
    display: block;
    transition:
      max-height 0.5s cubic-bezier(0.16, 1, 0.3, 1),
      opacity 0.4s cubic-bezier(0.16, 1, 0.3, 1),
      padding-top 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  }
  .faq-item.is-open dd {
    max-height: 400px;
  }
}

/* ── Lightbox ── */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 9000;
  background: rgba(10, 10, 10, 0.96);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}
.lightbox.is-open {
  opacity: 1;
  pointer-events: auto;
}
.lightbox-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  max-width: min(90vw, 1100px);
  max-height: 90vh;
  transform: scale(0.9);
  transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}
.lightbox.is-open .lightbox-inner {
  transform: scale(1);
}
.lightbox-img {
  max-width: 100%;
  max-height: 90vh;
  object-fit: contain;
  border-radius: var(--radius-lg);
  display: block;
}
.lightbox-close {
  position: fixed;
  top: 1.25rem;
  right: 1.25rem;
  width: 44px;
  height: 44px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  color: white;
  font-size: 1.375rem;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
.lightbox-close:hover { background: rgba(255, 255, 255, 0.2); }

.lightbox-prev,
.lightbox-next {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  width: 52px;
  height: 52px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  color: white;
  font-size: 1.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition:
    background 0.3s cubic-bezier(0.16, 1, 0.3, 1),
    transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
.lightbox-prev { left: 1rem; }
.lightbox-next { right: 1rem; }
.lightbox-prev:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: translateY(-50%) scale(1.08);
}
.lightbox-next:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: translateY(-50%) scale(1.08);
}

@media (max-width: 600px) {
  .lightbox-prev { left: 0.5rem; }
  .lightbox-next { right: 0.5rem; }
}

/* ── Interactive Card Hovers ── */
.benefit-card {
  transition:
    transform 0.5s cubic-bezier(0.16, 1, 0.3, 1),
    box-shadow 0.5s cubic-bezier(0.16, 1, 0.3, 1),
    border-color 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}
.benefit-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.1);
  border-color: rgba(107, 143, 113, 0.2);
}

.service-block {
  transition:
    transform 0.5s cubic-bezier(0.16, 1, 0.3, 1),
    box-shadow 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}
.service-block:hover {
  transform: translateY(-4px);
  box-shadow: 0 28px 64px rgba(0, 0, 0, 0.1);
}

.quote-card {
  transition:
    transform 0.5s cubic-bezier(0.16, 1, 0.3, 1),
    box-shadow 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}
.quote-card:hover {
  transform: translateY(-6px) rotate(-0.4deg);
  box-shadow: 0 28px 64px rgba(0, 0, 0, 0.1);
}

/* ── Gallery clickable ── */
.gallery-card,
.gallery-feed-item {
  cursor: pointer;
  transition:
    transform 0.5s cubic-bezier(0.16, 1, 0.3, 1),
    box-shadow 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}
.gallery-card:hover,
.gallery-feed-item:hover {
  transform: translateY(-5px);
  box-shadow: 0 28px 64px rgba(0, 0, 0, 0.13);
}

/* ── Appointment CTA Section (dark) ── */
.appointment {
  background: linear-gradient(135deg, var(--ink) 0%, #1e2f1e 100%);
  position: relative;
  overflow: hidden;
}
.appointment::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 60% 80% at 80% 50%, rgba(107,143,113,0.18) 0%, transparent 70%);
  pointer-events: none;
}
.appointment .section-head h2 {
  color: var(--white);
}
.appointment .section-intro {
  color: rgba(255, 255, 255, 0.7);
}
.appointment .book-actions .btn-primary {
  background: var(--white);
  color: var(--ink);
}
.appointment .book-actions .btn-primary:hover {
  background: #c5dcc9;
  color: var(--ink);
}

/* ── Back to Top Button ── */
.back-to-top {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 48px;
  height: 48px;
  background: var(--ink);
  color: white;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  opacity: 0;
  transform: translateY(1rem);
  pointer-events: none;
  transition:
    opacity 0.4s cubic-bezier(0.16, 1, 0.3, 1),
    transform 0.4s cubic-bezier(0.16, 1, 0.3, 1),
    background 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 90;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.2);
}
.back-to-top.visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}
.back-to-top:hover {
  background: var(--sage-dark);
  transform: translateY(-2px);
}

/* ── Testimonials Full Page ── */
.testimonials-page {
  padding-top: calc(var(--header-h) + 3rem);
}
.testimonial-list {
  display: flex;
  flex-direction: column;
  gap: 3rem;
}
.testimonial-story-media {
  margin: 0 0 1.5rem;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid rgba(0, 0, 0, 0.06);
  box-shadow: var(--shadow);
}
.testimonial-story-media img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 3 / 2;
  object-fit: cover;
}
.testimonial-media-caption {
  margin: 0;
  padding: 0.65rem 1rem;
  font-size: 0.8125rem;
  line-height: 1.5;
  font-style: italic;
  color: var(--ink-muted);
  background: var(--cream-dark);
  border-top: 1px solid rgba(0, 0, 0, 0.06);
}
.testimonial-label {
  margin: 0 0 0.75rem;
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--sage-dark);
}
.quote-card--story p { font-weight: 500; }
.quote-card--story p + p { margin-top: 1rem; }
.quote-card--story footer { margin-top: 1.25rem; }

/* ── Gallery Full Page ── */
.gallery-page {
  padding-top: calc(var(--header-h) + 3rem);
}
.gallery-page .section-head {
  margin-bottom: 2.5rem;
}
.gallery-page .container {
  width: min(1180px, 94vw);
}

/* Gallery feed */
.gallery-feed {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.625rem;
  align-items: start;
}
.gallery-feed-col {
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
  min-width: 0;
}
.gallery-feed-col--center .gallery-feed-item:first-child {
  margin-top: 3.25rem;
}
.gallery-feed-item {
  display: flex;
  flex-direction: column;
  margin: 0;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid rgba(0, 0, 0, 0.06);
  background: var(--white);
  box-shadow: var(--shadow);
}
.gallery-feed-item--pull-up { margin-top: -0.5rem; }
.gallery-feed-media {
  display: block;
  width: 100%;
  overflow: hidden;
}
.gallery-feed-media--ar-wide  { aspect-ratio: 5 / 3; }
.gallery-feed-media--ar-md    { aspect-ratio: 4 / 5; }
.gallery-feed-media--ar-tall  { aspect-ratio: 3 / 5; }
.gallery-feed-media--ar-hero  { aspect-ratio: 9 / 16; }
.gallery-feed-media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}
.gallery-feed-item:hover .gallery-feed-media img {
  transform: scale(1.04);
}
.gallery-feed-panel {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.3rem;
  min-height: 5rem;
  padding: 0.85rem 1rem;
  background: var(--white);
}
.gallery-feed-title {
  margin: 0;
  font-size: 0.9375rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--ink);
}
.gallery-feed-caption {
  margin: 0;
  font-size: 0.8125rem;
  line-height: 1.45;
  color: var(--ink-muted);
}
@media (max-width: 720px) {
  .gallery-feed { grid-template-columns: 1fr; }
  .gallery-feed-col--center .gallery-feed-item:first-child { margin-top: 0; }
}

/* Gallery img hover */
.gallery-card img {
  transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}
.gallery-card:hover img {
  transform: scale(1.04);
}

/* ── Book Page ── */
.book-page {
  padding-top: calc(var(--header-h) + 2rem);
  padding-bottom: 4rem;
}
.book-container {
  width: min(1120px, 92vw);
  margin-inline: auto;
}
.book-layout {
  display: grid;
  grid-template-columns: minmax(0, 320px) minmax(0, 1fr);
  gap: clamp(2rem, 4vw, 3rem);
  align-items: start;
}
.book-aside {
  position: sticky;
  top: calc(var(--header-h) + 1rem);
}
.book-aside-visual {
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid rgba(0, 0, 0, 0.08);
  margin-bottom: 1.25rem;
  aspect-ratio: 4 / 5;
  max-height: 280px;
  background: var(--cream-dark);
}
.book-aside-photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.book-aside-kicker {
  font-family: var(--font-display);
  font-size: 0.8125rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--sage-dark);
  margin: 0 0 0.5rem;
}
.book-aside-lead {
  font-size: 1.0625rem;
  color: var(--ink-muted);
  line-height: 1.55;
  margin: 0 0 1rem;
}
.book-aside-list {
  margin: 0;
  padding: 0 0 0 1.2rem;
  color: var(--ink-muted);
  font-size: 0.9375rem;
  line-height: 1.55;
}
.book-aside-list li { margin-bottom: 0.65rem; }
.book-aside-list li:last-child { margin-bottom: 0; }
.book-aside-icon {
  margin-top: 1.25rem;
  color: var(--sage-dark);
  opacity: 0.45;
}
.book-main-head { margin-bottom: 1.25rem; }
.book-main-title {
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 3vw, 2.25rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  margin: 0 0 0.5rem;
  line-height: 1.15;
}
.book-main-intro {
  margin: 0;
  color: var(--ink-muted);
  font-size: 1.0625rem;
}
.book-paths {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.25rem;
  align-items: stretch;
  margin-top: 1.5rem;
}
.book-cta-card {
  padding: 2rem 1.75rem;
  background: var(--white);
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  text-align: center;
  transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}
.book-cta-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 28px 64px rgba(0, 0, 0, 0.1);
}
.book-card-title {
  font-family: var(--font-display);
  font-size: 1.125rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0 0 1rem;
  color: var(--ink);
}
.book-cta-sub {
  margin: 1rem 0 0;
  font-size: 0.9375rem;
  color: var(--ink-muted);
  line-height: 1.5;
}
.book-cta-sub--top { margin: 0 0 1.25rem; }
.book-cta-hint {
  margin: 0 0 1rem;
  font-size: 0.8125rem;
  color: var(--ink-muted);
  line-height: 1.45;
}
.book-cta-second { margin-top: 0.75rem; }
.btn-book-lg {
  width: 100%;
  justify-content: center;
  padding: 1rem 1.75rem;
  font-size: 1.0625rem;
}
.book-info-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-top: 2rem;
}
.book-info-card {
  padding: 1.5rem;
  background: var(--cream-dark);
  border-radius: var(--radius);
  border: 1px solid rgba(0, 0, 0, 0.06);
}
.book-info-card h4 {
  font-size: 0.8125rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 600;
  color: var(--ink-muted);
  margin: 0 0 0.5rem;
}
.book-info-card p {
  margin: 0;
  font-size: 0.9375rem;
  color: var(--ink);
  line-height: 1.5;
}
.book-info-card a {
  color: var(--sage-dark);
}
@media (max-width: 900px) {
  .book-layout { grid-template-columns: 1fr; }
  .book-aside { position: static; }
  .book-aside-visual { max-height: 200px; aspect-ratio: 21 / 9; }
}
