/* style.css — hand-written styles layered on top of the Tailwind CDN build.
   Keeps the payload tiny: no custom fonts, just system-ui, plus the handful
   of things Tailwind utilities alone can't express (toggle states, keyframe
   animations, RTL tweaks, print-free focus rings). */

:root {
  color-scheme: light dark;
}

html,
body {
  background-color: #f8fafc;
}

html.dark body {
  background-color: #0f172a;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

/* Respect reduced-motion preference everywhere. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

/* --- Mobile menu --- */
[data-mobile-menu] {
  display: none;
}
[data-mobile-menu].open {
  display: block;
}

/* --- Language dropdown --- */
[data-lang-menu] {
  display: none;
}
[data-lang-menu].open {
  display: block;
}

/* --- Quiz option buttons --- */
.option-selected {
  border-color: #0891b2 !important;
  background-color: #ecfeff;
}
html.dark .option-selected {
  background-color: #164e63;
}

/* --- Favorite heart pulse --- */
.favorite-heart {
  transition: transform 0.15s ease;
}
.favorite-heart:active {
  transform: scale(1.3);
}

/* --- Line clamp fallback (Tailwind CDN build may lack the plugin) --- */
.line-clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* --- Simple keyframe animations --- */
@keyframes bounce-slow {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}
.animate-bounce-slow {
  animation: bounce-slow 2s ease-in-out infinite;
}

@keyframes fade-in-up {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}
.animate-fade-in-up {
  animation: fade-in-up 0.4s ease-out both;
}

/* --- Accessible focus ring --- */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid #0891b2;
  outline-offset: 2px;
}

/* --- Skip link --- */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 200;
  background: #0891b2;
  color: #fff;
  padding: 0.75rem 1.25rem;
  border-radius: 0 0 0.5rem 0;
}
.skip-link:focus {
  left: 0;
}

/* --- Progress bar track --- */
[data-progress-track] {
  height: 8px;
  border-radius: 9999px;
  background-color: #e2e8f0;
  overflow: hidden;
}
html.dark [data-progress-track] {
  background-color: #334155;
}

/* --- RTL support --- */
html[dir='rtl'] .rtl-flip {
  transform: scaleX(-1);
}
html[dir='rtl'] [data-lang-menu],
html[dir='rtl'] [data-mobile-menu] {
  text-align: right;
}

/* --- Cookie banner / language suggestion banner --- */
[data-cookie-banner].hidden,
[data-lang-suggestion].hidden {
  display: none;
}

/* --- Minimum tap target --- */
button, a.block, .tap-target {
  min-height: 44px;
}
