/*
 * Personal accessibility controls — warm cream and rose, in the Larixa idiom.
 * This file only styles the launcher, dialog and opt-in page modes.
 */

.a11y-launcher[hidden],
.nav-open .a11y-launcher,
.a11y-dialog:not([open]) {
  display: none;
}

.a11y-launcher {
  position: fixed;
  z-index: 950;
  top: 47%;
  right: 0;
  display: flex;
  min-width: 44px;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  gap: .55rem;
  padding: .8rem .7rem;
  border: 1px solid #825456;
  border-right: 0;
  border-radius: 8px 0 0 8px;
  background: #f9f4ed;
  color: #493638;
  box-shadow: 0 3px 16px rgba(48, 34, 32, .16);
  font: 600 .78rem/1.25 var(--font-body, sans-serif);
  cursor: pointer;
  writing-mode: vertical-rl;
  transform: translateY(-50%);
  transition: background-color 160ms ease, color 160ms ease, padding 160ms ease;
}

.a11y-launcher svg {
  width: 21px;
  height: 21px;
  flex: 0 0 auto;
}

.a11y-launcher:hover {
  padding-block: 1rem;
  background: #ead2ce;
  color: #302323;
}

.a11y-launcher:focus-visible,
.a11y-dialog :where(button, select, input, a):focus-visible {
  outline: 3px solid #704649;
  outline-offset: 3px;
  box-shadow: 0 0 0 3px #fdfcfa;
}

.a11y-dialog {
  position: fixed;
  inset: 0;
  width: min(100% - 2rem, 36rem);
  max-width: none;
  max-height: min(46rem, calc(100dvh - 2rem));
  margin: auto;
  padding: 0;
  overflow: auto;
  overscroll-behavior: contain;
  border: 1px solid rgba(112, 70, 73, .35);
  border-radius: 12px;
  background: #fdfbf7;
  color: #302927;
  box-shadow: 0 24px 80px rgba(35, 24, 23, .28);
  font-family: var(--font-body, sans-serif);
  scrollbar-color: #b88383 #f3ece4;
}

.a11y-dialog::backdrop {
  background: rgba(35, 27, 26, .58);
}

.a11y-dialog__inner {
  padding: clamp(1.2rem, 4vw, 2rem);
}

.a11y-dialog__body {
  display: contents;
}
.a11y-dialog__description-mobile,
.a11y-dialog__mobile-note { display: none; }

.a11y-dialog__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding-bottom: 1.15rem;
  border-bottom: 1px solid rgba(112, 70, 73, .2);
}
.a11y-dialog__header > div,
.a11y-setting__copy {
  min-width: 0;
  overflow-wrap: anywhere;
}

.a11y-dialog__eyebrow {
  margin: 0 0 .35rem;
  color: #704649;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .11em;
  line-height: 1.4;
  text-transform: uppercase;
}

.a11y-dialog__header h2 {
  margin: 0;
  color: #302927;
  font-family: var(--font-heading, Georgia, serif);
  font-size: clamp(1.75rem, 5vw, 2.25rem);
  line-height: 1.12;
  letter-spacing: -.02em;
}

.a11y-dialog__close {
  display: grid;
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  place-items: center;
  border: 1px solid rgba(112, 70, 73, .3);
  border-radius: 50%;
  background: #f7f0e9;
  color: #493638;
  cursor: pointer;
  transition: background-color 160ms ease, color 160ms ease;
}

.a11y-dialog__close:hover {
  background: #ead2ce;
  color: #302323;
}

.a11y-dialog__close svg {
  width: 20px;
  height: 20px;
}

.a11y-dialog__description {
  margin: 1rem 0 1.2rem;
  color: #514743;
  font-size: .9rem;
  line-height: 1.65;
}

.a11y-settings {
  display: grid;
  gap: .65rem;
}

.a11y-setting {
  min-width: 0;
  color: #302927;
}

.a11y-setting--select {
  display: grid;
  gap: .55rem;
  padding: 1rem;
  border: 1px solid rgba(112, 70, 73, .25);
  border-radius: 8px;
  background: #f8f3ec;
}

.a11y-setting__title,
.a11y-setting__hint {
  display: block;
}

.a11y-setting__title {
  color: #302927;
  font-size: .94rem;
  font-weight: 650;
  line-height: 1.4;
}

.a11y-setting__hint {
  margin-top: .18rem;
  color: #594e49;
  font-size: .78rem;
  line-height: 1.45;
}

.a11y-setting--select select {
  width: 100%;
  min-height: 46px;
  padding: .55rem .75rem;
  border: 1px solid #806366;
  border-radius: 5px;
  background: #fffdfa;
  color: #302927;
  font: inherit;
  font-size: max(16px, .92rem);
}

.a11y-setting--check {
  position: relative;
  display: flex;
  min-height: 66px;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: .75rem 1rem;
  border: 1px solid rgba(112, 70, 73, .2);
  border-radius: 8px;
  background: #fffdfa;
  cursor: pointer;
  transition: border-color 160ms ease, background-color 160ms ease;
}

.a11y-setting--check:hover {
  border-color: #80575a;
  background: #fbf4ef;
}

.a11y-setting--check input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.a11y-switch {
  position: relative;
  width: 46px;
  height: 26px;
  flex: 0 0 46px;
  border: 1px solid #70585a;
  border-radius: 999px;
  background: #e9e0d8;
  transition: background-color 160ms ease;
}

.a11y-switch::after {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #493638;
  content: "";
  transition: transform 160ms ease, background-color 160ms ease;
}

.a11y-setting--check input:checked + .a11y-switch {
  background: #704649;
}

.a11y-setting--check input:checked + .a11y-switch::after {
  background: #fffaf5;
  transform: translateX(20px);
}

.a11y-setting--check input:focus-visible + .a11y-switch {
  outline: 3px solid #704649;
  outline-offset: 3px;
}

.a11y-dialog__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem 1rem;
  flex-wrap: wrap;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(112, 70, 73, .2);
}

.a11y-reset {
  min-height: 44px;
  padding: .5rem .1rem;
  border: 0;
  background: transparent;
  color: #59383a;
  font: 600 .84rem/1.4 var(--font-body, sans-serif);
  text-align: left;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: .2em;
  cursor: pointer;
}

.a11y-reset:hover {
  color: #302323;
}

.a11y-settings-status {
  min-height: 1.4em;
  margin: 0;
  color: #4b403b;
  font-size: .78rem;
  line-height: 1.4;
}

.a11y-dialog__more {
  margin: .8rem 0 0;
  color: #514743;
  font-size: .82rem;
  line-height: 1.55;
}

.a11y-dialog__more a {
  color: #59383a;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: .18em;
}

/* Contrast mode: light reading surfaces and dark text; imagery is untouched. */
html.a11y-high-contrast body {
  background-color: #fffdf8;
  color: #171412;
}

html.a11y-high-contrast :is(
  .homepage-modern .trust-bar,
  .homepage-modern .about,
  .homepage-modern .services,
  .homepage-modern .studio-section,
  .homepage-modern .testimonials,
  .homepage-modern .contact-section,
  .homepage-modern .cta-section,
  .legal-page,
  .pricing-page,
  .schulung-page,
  .section:not(.portfolio)
) {
  color: #171412;
}

html.a11y-high-contrast :is(
  .homepage-modern .about-text p,
  .homepage-modern .studio-content p,
  .homepage-modern .section-intro,
  .homepage-modern .trust-text span,
  .homepage-modern .testimonial-source,
  .homepage-modern .contact-info-row,
  .homepage-modern .contact-form .checkbox-label,
  .homepage-modern .about-credentials :where(p, dd),
  .homepage-modern .services-grid .service-content p,
  .homepage-modern .service-content p,
  .homepage-modern .service-features li,
  .legal-page p,
  .legal-page li,
  .pricing-page p,
  .schulung-page p
) {
  color: #29221f;
}

html.a11y-high-contrast :is(
  .homepage-modern .about-text h2,
  .homepage-modern .studio-content h2,
  .homepage-modern .section-title,
  .homepage-modern .contact-section h2,
  .homepage-modern .cta-content h2,
  .homepage-modern .service-content h3,
  .homepage-modern .testimonial-author,
  .homepage-modern .trust-text strong
) {
  color: #171412;
}

html.a11y-high-contrast :is(
  .homepage-modern .section-label,
  .homepage-modern .studio-photo-note,
  .homepage-modern .contact-section .protected-contact a,
  .homepage-modern .contact-section .contact-info-row a,
  .homepage-modern .service-btn,
  .homepage-modern .aftercare-more,
  .legal-page a:not(.btn-primary),
  .pricing-page .price-group h3,
  .pricing-page .price-list .price,
  .schulung-page .section-label
) {
  color: #633b3e;
}

html.a11y-high-contrast :is(
  .homepage-modern .contact-box,
  .homepage-modern .contact-form-box,
  .homepage-modern .testimonial-card,
  .homepage-modern .services-grid .service-card,
  .homepage-modern .service-card-wide
) {
  background-color: #fffdf8;
}

html.a11y-high-contrast :is(
  .homepage-modern .portfolio,
  .portfolio,
  .footer
) {
  color: #fffdf8;
}

html.a11y-high-contrast :is(.homepage-modern .portfolio, .footer) :is(p, li, .section-intro, .section-label, h1, h2, h3, a) {
  color: #fffdf8;
}

html.a11y-high-contrast :is(.portfolio, .footer) a {
  text-decoration: underline;
  text-underline-offset: .2em;
}
html.a11y-high-contrast #portfolio :is(p, .section-intro, .section-label, h1, h2, h3, a) {
  color: #fffdf8;
}
html.a11y-high-contrast .homepage-modern .hours-row .time,
html.a11y-high-contrast .homepage-modern .contact-form .checkbox-label a {
  color: #4d292d;
}
html.a11y-high-contrast .schulung-closing-text,
html.a11y-high-contrast .schulung-closing-text .emphasis {
  color: #fffdf8 !important;
}

html.a11y-high-contrast .hero-overlay {
  background: rgba(22, 17, 16, .76);
}

html.a11y-high-contrast .hero h1,
html.a11y-high-contrast .hero-subtitle,
html.a11y-high-contrast .hero-content p,
html.a11y-high-contrast .hero-instagram {
  color: #fff;
  text-shadow: none;
}

html.a11y-high-contrast .hero h1 .highlight {
  color: #ffe0dc;
}

html.a11y-high-contrast .hero-instagram {
  background: transparent;
}

/* Added spacing applies to reading text, not controls or decorative labels. */
html.a11y-text-spacing body :where(p, li, dd, blockquote, figcaption, label, .section-intro) {
  letter-spacing: .08em !important;
  word-spacing: .16em !important;
  line-height: 1.9 !important;
}

html.a11y-text-spacing body :where(p, li, dd, blockquote, figcaption) {
  margin-bottom: 1.25em !important;
}

/* Scale-specific reflow only: retain the original layout at 100%. */
html[data-a11y-font-size] .hero {
  min-height: 100svh;
  height: auto;
  flex-direction: column;
  justify-content: center;
  gap: clamp(1rem, 4vh, 2.5rem);
  padding: calc(var(--header-height, 80px) + 2rem) 1rem 2rem;
}

html[data-a11y-font-size] .hero-content {
  width: min(100%, 52rem);
  max-width: 52rem;
  padding: 1rem;
}

html[data-a11y-font-size] .hero h1 {
  font-size: clamp(2rem, 7vw, 4rem);
  line-height: 1.12;
  overflow-wrap: anywhere;
}

html[data-a11y-font-size] .hero-subtitle {
  font-size: clamp(1rem, 2vw, 1.25rem);
}

html[data-a11y-font-size] .studio-status--hero {
  position: relative;
  inset: auto;
  width: min(100%, 34rem);
  max-width: 34rem;
  margin: 0 auto;
  transform: none;
}

html[data-a11y-font-size] .hero > .scroll-indicator {
  position: relative;
  inset: auto;
  margin: 0 auto;
  transform: none;
}

html[data-a11y-font-size] :where(.hero, .hero-content, .studio-status, .studio-status--hero) {
  min-width: 0;
  overflow-wrap: anywhere;
}

@media (max-width: 560px) {
  .a11y-dialog {
    width: calc(100% - 1rem);
    max-height: calc(100dvh - 1rem - env(safe-area-inset-top) - env(safe-area-inset-bottom));
    margin-block: max(.5rem, env(safe-area-inset-top)) max(.5rem, env(safe-area-inset-bottom));
    border-radius: 10px;
  }

  .a11y-dialog__inner {
    padding: 1rem;
  }

  .a11y-dialog__description {
    font-size: .86rem;
  }

  .a11y-setting--check {
    padding-inline: .8rem;
  }

  .a11y-launcher {
    top: 44%;
    right: .5rem;
    width: 44px;
    height: 44px;
    padding: .55rem;
    border: 1px solid #825456;
    border-radius: 50%;
    writing-mode: horizontal-tb;
  }
  .a11y-launcher:hover { padding: .55rem; }
  .a11y-launcher span { display: none; }

  html[data-a11y-font-size] .hero {
    min-height: 100svh;
    padding-inline: .75rem;
  }
}

/* Compact visible icon; keep the full 44px touch target on phones. */
@media (max-width: 768px) {
  .a11y-launcher,
  .a11y-launcher:hover {
    top: 44%;
    right: 8px;
    width: 44px;
    height: 44px;
    padding: 13px;
    border: 0;
    border-radius: 50%;
    background: transparent;
    box-shadow: none;
    writing-mode: horizontal-tb;
  }
  .a11y-launcher::before {
    content: "";
    position: absolute;
    width: 32px;
    height: 32px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    border: 1px solid #825456;
    border-radius: 50%;
    background: #f9f4ed;
    box-shadow: 0 1px 5px rgba(48, 34, 32, .12);
    pointer-events: none;
  }
  .a11y-launcher svg {
    position: relative;
    width: 18px;
    height: 18px;
  }
  .a11y-launcher span { display: none; }
}

/* Phone dialog: a bottom sheet with a fixed, always-reachable close header. */
@media (max-width: 768px), (max-height: 560px) {
  .a11y-dialog[open] {
    position: fixed;
    inset: auto 0 0;
    width: min(100%, 42rem);
    max-width: none;
    max-height: calc(100vh - env(safe-area-inset-top) - .5rem);
    max-height: calc(100dvh - env(safe-area-inset-top) - .5rem);
    margin: 0 auto;
    padding: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid rgba(112, 70, 73, .3);
    border-bottom: 0;
    border-radius: 16px 16px 0 0;
    background: #fdfbf7;
    box-shadow: 0 -12px 44px rgba(35, 24, 23, .2);
  }

  .a11y-dialog__inner {
    display: flex;
    min-height: 0;
    max-height: inherit;
    flex-direction: column;
    padding: 0;
  }

  .a11y-dialog__header {
    position: relative;
    z-index: 1;
    flex: 0 0 auto;
    align-items: center;
    gap: .75rem;
    padding: max(.85rem, env(safe-area-inset-top)) 1rem .8rem;
    border-bottom: 1px solid rgba(112, 70, 73, .24);
    background: #fdfbf7;
  }

  .a11y-dialog__eyebrow {
    display: none;
    margin: 0 0 .2rem !important;
    font-size: .68rem;
    line-height: 1.35 !important;
    letter-spacing: .08em !important;
    word-spacing: normal !important;
  }

  .a11y-dialog__header h2 {
    font-size: clamp(1.45rem, 5vw, 1.8rem);
    line-height: 1.1;
  }

  .a11y-dialog__close {
    width: 44px;
    height: 44px;
    flex-basis: 44px;
    background: #f7f0e9;
  }

  .a11y-dialog__body {
    display: block;
    min-height: 0;
    flex: 1 1 auto;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    padding: .85rem 1rem max(1rem, env(safe-area-inset-bottom));
    scrollbar-gutter: stable;
  }

  .a11y-dialog__description {
    margin: 0 0 .9rem;
    font-size: max(16px, .86rem);
    line-height: 1.6;
  }
  .a11y-dialog__description-full { display: none; }
  .a11y-dialog__description-mobile { display: inline; }
  .a11y-dialog__mobile-note {
    display: block;
    margin: .65rem 0 0;
    color: #594e49;
    font-size: .78rem;
    line-height: 1.5;
  }

  .a11y-settings {
    gap: .55rem;
  }

  .a11y-setting--select {
    gap: .4rem;
    padding: .8rem;
  }

  .a11y-setting--check {
    min-height: 64px;
    gap: .75rem;
    padding: .65rem .8rem;
  }

  .a11y-setting__title {
    line-height: 1.35;
  }

  .a11y-setting__hint {
    line-height: 1.45;
  }

  .a11y-dialog__footer {
    align-items: flex-start;
    justify-content: flex-start;
    gap: .25rem .75rem;
    margin-top: .75rem;
    padding-top: .7rem;
  }

  .a11y-reset {
    min-height: 44px;
    max-width: 100%;
  }

  .a11y-settings-status {
    flex: 1 1 100%;
    line-height: 1.5;
  }

  .a11y-dialog__more {
    margin: .55rem 0 0;
    line-height: 1.55;
  }
}

@media (prefers-reduced-motion: reduce) {
  .a11y-launcher,
  .a11y-dialog *,
  .a11y-dialog *::before,
  .a11y-dialog *::after {
    scroll-behavior: auto;
    transition-duration: .01ms !important;
  }
}
