/* =========================================================================
   gimnázium.hu — akadálymentesítési widget + beállítások
   ========================================================================= */

/* —— Szöveg méret —— */
html[data-a11y-font-size="1"] { font-size: 112.5%; }
html[data-a11y-font-size="2"] { font-size: 125%; }

/* —— Magas kontraszt —— */
html[data-a11y-contrast="high"] {
  --ink: #0a0f0d;
  --ink-soft: #1a2420;
  --muted: #2a3531;
  --paper: #ffffff;
  --card: #ffffff;
  --card-warm: #f5f7f6;
  --line: rgba(0, 0, 0, 0.22);
  --line-soft: rgba(0, 0, 0, 0.12);
  --moss: #0d5c48;
  --pine: #0a3d32;
  --honey-deep: #9a5a00;
  --surface-input: #ffffff;
  --surface-header: rgba(255, 255, 255, 0.96);
}

html[data-theme="dark"][data-a11y-contrast="high"] {
  --ink: #ffffff;
  --ink-soft: #e8ecea;
  --muted: #c8d2ce;
  --paper: #000000;
  --card: #0a100e;
  --card-warm: #101816;
  --line: rgba(255, 255, 255, 0.28);
  --line-soft: rgba(255, 255, 255, 0.16);
  --moss: #9decd4;
  --pine: #c8f5e8;
  --honey: #ffcc66;
  --honey-deep: #ffe099;
  --surface-input: #101816;
  --surface-header: rgba(0, 0, 0, 0.94);
}

html[data-a11y-contrast="high"] .btn-primary {
  box-shadow: 0 0 0 2px var(--ink);
}

/* —— Linkek —— */
html[data-a11y-underline-links="1"] a:not(.btn):not(.brand):not(.a11y-widget__trigger) {
  text-decoration: underline !important;
  text-underline-offset: 0.14em;
}

/* —— Fókusz —— */
html[data-a11y-focus="1"] :focus-visible {
  outline: 4px solid var(--honey) !important;
  outline-offset: 4px !important;
}

/* —— Szürkeárnyalatos —— */
html[data-a11y-grayscale="1"] body {
  filter: grayscale(1);
}

html[data-a11y-grayscale="1"] .a11y-widget {
  filter: none;
}

/* —— Animáció csökkentés —— */
html[data-a11y-reduce-motion="1"] *,
html[data-a11y-reduce-motion="1"] *::before,
html[data-a11y-reduce-motion="1"] *::after {
  animation-duration: 0.001ms !important;
  animation-iteration-count: 1 !important;
  transition-duration: 0.001ms !important;
  scroll-behavior: auto !important;
}

html[data-a11y-reduce-motion="1"] .reveal {
  opacity: 1 !important;
  transform: none !important;
}

/* —— Lebegő widget —— */
.a11y-widget {
  position: fixed;
  left: max(1rem, env(safe-area-inset-left));
  bottom: max(1.25rem, env(safe-area-inset-bottom));
  z-index: 85;
  font-family: var(--font-body);
}

.a11y-widget--above-cta {
  bottom: calc(5.5rem + env(safe-area-inset-bottom));
}

.a11y-widget__trigger {
  display: grid;
  place-items: center;
  width: 3.15rem;
  height: 3.15rem;
  padding: 0;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  color: var(--pine-deep);
  background: linear-gradient(135deg, var(--honey), var(--honey-deep));
  box-shadow: 0 6px 22px rgba(20, 50, 41, 0.28), 0 0 0 2px rgba(255, 255, 255, 0.85);
  transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease);
}

.a11y-widget__trigger:hover {
  transform: translateY(-2px) scale(1.04);
  box-shadow: 0 10px 28px rgba(20, 50, 41, 0.34), 0 0 0 2px var(--honey);
}

.a11y-widget__trigger:focus-visible {
  outline: 3px solid var(--moss);
  outline-offset: 3px;
}

.a11y-widget.is-open .a11y-widget__trigger {
  box-shadow: 0 0 0 3px var(--moss), 0 8px 24px rgba(20, 50, 41, 0.3);
}

.a11y-widget__icon {
  width: 1.55rem;
  height: 1.55rem;
}

html[data-theme="dark"] .a11y-widget__trigger {
  color: #132820;
  box-shadow: 0 6px 22px rgba(0, 0, 0, 0.45), 0 0 0 2px rgba(255, 255, 255, 0.12);
}

/* —— Panel —— */
.a11y-widget__backdrop {
  position: fixed;
  inset: 0;
  z-index: -1;
  background: rgba(10, 20, 17, 0.42);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}

.a11y-widget__panel {
  position: absolute;
  left: 0;
  bottom: calc(100% + 0.75rem);
  width: min(calc(100vw - 2rem), 22rem);
  max-height: min(70vh, 32rem);
  overflow: auto;
  background: var(--card);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 1.1rem 1.15rem 1.15rem;
}

.a11y-widget__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.35rem;
}

.a11y-widget__title {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 560;
  margin: 0;
  color: var(--ink);
}

.a11y-widget__close {
  flex: none;
  width: 2rem;
  height: 2rem;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--card-warm);
  color: var(--ink-soft);
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
  transition: background 0.18s var(--ease), color 0.18s var(--ease);
}

.a11y-widget__close:hover {
  background: var(--line-soft);
  color: var(--ink);
}

.a11y-widget__intro {
  margin: 0 0 1rem;
  font-size: 0.84rem;
  color: var(--muted);
  line-height: 1.45;
}

.a11y-widget__section {
  margin-bottom: 1rem;
}

.a11y-widget__label {
  display: block;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--honey-deep);
  margin-bottom: 0.45rem;
}

.a11y-widget__stepper {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.35rem;
}

.a11y-widget__step {
  font-family: var(--font-body);
  font-size: 0.92rem;
  font-weight: 700;
  padding: 0.55rem 0.35rem;
  border: 1.5px solid var(--line);
  border-radius: 10px;
  background: var(--surface-input);
  color: var(--ink);
  cursor: pointer;
  transition: border-color 0.18s, background 0.18s, color 0.18s;
}

.a11y-widget__step:hover {
  border-color: var(--moss);
}

.a11y-widget__step.is-active,
.a11y-widget__step.is-reset.is-active {
  background: var(--pine);
  border-color: var(--pine);
  color: #fff;
}

html[data-theme="dark"] .a11y-widget__step.is-active {
  color: #0f241f;
}

.a11y-widget__toggles {
  list-style: none;
  margin: 0 0 1rem;
  padding: 0;
  display: grid;
  gap: 0.45rem;
}

.a11y-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  background: var(--card-warm);
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  color: inherit;
  transition: border-color 0.18s, background 0.18s;
}

.a11y-toggle:hover {
  border-color: var(--line);
  background: var(--card);
}

.a11y-toggle__text {
  display: grid;
  gap: 0.12rem;
}

.a11y-toggle__text strong {
  font-size: 0.92rem;
  font-weight: 650;
  color: var(--ink);
}

.a11y-toggle__text small {
  font-size: 0.78rem;
  color: var(--muted);
  line-height: 1.35;
}

.a11y-toggle__track {
  flex: none;
  width: 2.5rem;
  height: 1.45rem;
  border-radius: var(--radius-pill);
  background: var(--line);
  position: relative;
  transition: background 0.2s var(--ease);
}

.a11y-toggle__thumb {
  position: absolute;
  top: 0.18rem;
  left: 0.18rem;
  width: 1.1rem;
  height: 1.1rem;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
  transition: transform 0.2s var(--ease);
}

.a11y-toggle.is-on .a11y-toggle__track {
  background: var(--moss);
}

.a11y-toggle.is-on .a11y-toggle__thumb {
  transform: translateX(1.05rem);
}

.a11y-widget__reset {
  width: 100%;
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 650;
  padding: 0.65rem 1rem;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--ink-soft);
  cursor: pointer;
  transition: border-color 0.18s, color 0.18s, background 0.18s;
}

.a11y-widget__reset:hover {
  border-color: var(--pine);
  color: var(--pine);
  background: var(--btn-ghost-hover);
}

@media (max-width: 640px) {
  .a11y-widget__panel {
    width: min(calc(100vw - 1.5rem), 20rem);
    max-height: min(62vh, 28rem);
  }

  .a11y-widget--above-cta {
    bottom: calc(4.75rem + env(safe-area-inset-bottom));
  }
}

@media (prefers-reduced-motion: reduce) {
  .a11y-widget__trigger,
  .a11y-toggle__track,
  .a11y-toggle__thumb {
    transition: none;
  }
}
