/* ============================================
   PROMESAS DE PAPEL - Unified Stylesheet
   ============================================ */

/* ============ CSS Variables ============ */
:root {
  /* Primary Colors */
  --color-primary: #009B97;
  --color-primary-dark: #007a70;
  --color-secondary: #C0392B;
  --color-secondary-dark: #9a2e22;

  /* Background Colors */
  --color-bg-light: #F9F7F1;
  --color-bg-dark: #1a1a1a;

  /* Surface Colors */
  --color-surface-light: #ffffff;
  --color-surface-dark: #262626;
  --color-card-dark: #2d2d2d;

  /* Text Colors */
  --color-text-light: #2D2D2D;
  --color-text-dark: #e5e5e5;
  --color-text-muted: #6b7280;

  /* Border Colors */
  --color-border: #171212;
  --color-border-light: #e5e5e5;

  /* Accent Colors */
  --color-accent-green: #27AE60;
  --color-accent-yellow: #FEF3C7;

  /* Shadows */
  --shadow-neo: 4px 4px 0px 0px rgba(0, 0, 0, 1);
  --shadow-neo-sm: 2px 2px 0px 0px rgba(0, 0, 0, 1);
  --shadow-neo-dark: 4px 4px 0px 0px rgba(255, 255, 255, 0.1);

  /* Border Radius */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 16px;

  /* Fonts */
  --font-display: 'Playfair Display', serif;
  --font-body: 'Inter', sans-serif;
  --font-hand: 'Caveat', cursive;

  /* Transitions */
  --transition-fast: 0.2s ease;
  --transition-medium: 0.3s ease;
  --transition-slow: 0.5s ease;
}

/* ============ Dark Mode Variables ============ */
.dark {
  --color-bg: var(--color-bg-dark);
  --color-surface: var(--color-surface-dark);
  --color-text: var(--color-text-dark);
  --shadow-neo: var(--shadow-neo-dark);
}

/* ============ Dark Mode Enhanced Contrast ============ */
.dark body {
  background-color: #121212;
  color: #f5f5f5;
}

/* Dark mode text contrast improvements */
.dark .text-gray-500 {
  color: #a3a3a3 !important;
}

.dark .text-gray-600 {
  color: #b3b3b3 !important;
}

.dark .text-gray-400 {
  color: #c4c4c4 !important;
}

.dark .text-gray-700 {
  color: #d4d4d4 !important;
}

.dark .text-gray-800 {
  color: #e5e5e5 !important;
}

/* Dark mode card backgrounds */
.dark .bg-white {
  background-color: #1e1e1e !important;
}

.dark .bg-background-light {
  background-color: #121212 !important;
}

/* Dark mode borders */
.dark .border-black {
  border-color: #404040 !important;
}

.dark .border-gray-200 {
  border-color: #3d3d3d !important;
}

/* Dark mode heading and title colors */
.dark h1,
.dark h2,
.dark h3,
.dark h4,
.dark h5,
.dark h6 {
  color: #ffffff;
}

/* Dark mode subtitle and description colors */
.dark .font-serif.italic {
  color: #c4c4c4;
}

/* Dark mode primary colors adjustment for visibility */
.dark .text-primary {
  color: #00c4be !important;
}

.dark .text-primary-teal {
  color: #00d4ce !important;
}

/* Dark mode yellow backgrounds need dark text */
.dark .bg-yellow-50,
.dark .bg-yellow-100,
.dark .bg-yellow-200 {
  background-color: #2d2d1a !important;
}

.dark .bg-yellow-50 p,
.dark .bg-yellow-100 p,
.dark .bg-yellow-200 p {
  color: #e5e5e5 !important;
}

/* Dark mode amber backgrounds */
.dark .bg-amber-200 {
  background-color: #3d3520 !important;
  color: #f5f5f5 !important;
}

/* Dark mode input fields */
.dark input,
.dark select,
.dark textarea {
  background-color: #2d2d2d;
  color: #f5f5f5;
  border-color: #404040;
}

.dark input::placeholder {
  color: #888888;
}

/* Dark mode footer text */
.dark footer .text-gray-400 {
  color: #9ca3af !important;
}

.dark footer .text-gray-500 {
  color: #9ca3af !important;
}

/* Dark mode dropdown menu */
.dark .group-hover\\:bg-gray-100:hover {
  background-color: #2d2d2d !important;
}

/* Dark mode book card quote boxes */
.dark .bg-yellow-50.dark\\:bg-gray-800 p {
  color: #e5e5e5 !important;
}

/* Dark mode breadcrumb */
.dark nav ol span.font-semibold {
  color: #ffffff;
}

/* Dark mode filter sidebar */
.dark aside .text-gray-500 {
  color: #b3b3b3 !important;
}

/* Dark mode event cards date section text improvement */
.dark .bg-black span.text-white {
  color: #ffffff !important;
}

/* Dark mode hover states */
.dark a:hover {
  color: #00d4ce;
}

/* Dark mode prose content */
.dark .prose p,
.dark .prose li {
  color: #d4d4d4;
}

.dark .prose h3 {
  color: #ffffff;
}

/* ============ Base Styles ============ */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  font-family: var(--font-body);
  background-color: var(--color-bg-light);
  color: var(--color-text-light);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-wrap: break-word;
}

img,
picture,
video,
canvas,
svg {
  max-width: 100%;
  height: auto;
}

picture {
  display: block;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px dashed var(--color-primary);
  outline-offset: 3px;
}

.dark body {
  background-color: var(--color-bg-dark);
  color: var(--color-text-dark);
}

/* ============ Typography ============ */
h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.2;
}

.font-display {
  font-family: var(--font-display);
}

.font-body {
  font-family: var(--font-body);
}

.font-hand {
  font-family: var(--font-hand);
}

/* ============ Links ============ */
a {
  color: inherit;
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--color-primary);
}

/* ============ Custom Scrollbar ============ */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: var(--color-bg-light);
}

::-webkit-scrollbar-thumb {
  background: var(--color-primary);
  border-radius: var(--radius-sm);
}

.dark ::-webkit-scrollbar-track {
  background: var(--color-bg-dark);
}

/* ============ Neo-Brutalist Components ============ */
.neo-box {
  border: 2px solid var(--color-border);
  box-shadow: var(--shadow-neo);
  background-color: var(--color-surface-light);
  transition: all var(--transition-fast);
}

.dark .neo-box {
  border-color: rgba(255, 255, 255, 0.2);
  background-color: var(--color-surface-dark);
}

.neo-box:hover {
  transform: translate(-2px, -2px);
  box-shadow: 6px 6px 0px 0px rgba(0, 0, 0, 1);
}

.neo-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  font-weight: 700;
  border: 2px solid var(--color-border);
  box-shadow: var(--shadow-neo);
  transition: all var(--transition-fast);
  cursor: pointer;
}

.neo-btn:active {
  box-shadow: none;
  transform: translate(4px, 4px);
}

.neo-btn-primary {
  background-color: var(--color-secondary);
  color: white;
}

.neo-btn-primary:hover {
  background-color: var(--color-secondary-dark);
  color: white;
}

.neo-btn-outline {
  background-color: transparent;
  color: var(--color-text-light);
}

.neo-btn-outline:hover {
  background-color: var(--color-border);
  color: white;
}

/* ============ Cards ============ */
.book-card {
  background-color: var(--color-surface-light);
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-neo);
  transition: transform var(--transition-medium);
}

.dark .book-card {
  background-color: var(--color-card-dark);
  border-color: rgba(255, 255, 255, 0.2);
}

.book-card:hover {
  transform: translateY(-8px);
}

.book-card img {
  width: 100%;
  height: auto;
  object-fit: cover;
  filter: grayscale(100%);
  transition: filter var(--transition-slow);
}

.book-card:hover img {
  filter: grayscale(0%);
}

/* ============ Event Cards ============ */
.event-card {
  display: flex;
  flex-direction: column;
  background-color: var(--color-surface-light);
  border: 2px solid var(--color-border);
  box-shadow: var(--shadow-neo);
  transition: all var(--transition-medium);
}

@media (min-width: 768px) {
  .event-card {
    flex-direction: row;
  }
}

.event-card:hover {
  transform: translateY(-4px);
}

.event-date {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  text-align: center;
  background-color: var(--color-border);
  color: white;
}

.event-date .month {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--color-primary);
}

.event-date .day {
  font-size: 3rem;
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1;
}

.event-date .time {
  font-size: 0.75rem;
  margin-top: 0.25rem;
}

/* ============ Form Elements ============ */
.neo-input {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 2px solid var(--color-border);
  background-color: var(--color-surface-light);
  font-family: var(--font-body);
  transition: all var(--transition-fast);
}

.neo-input:focus {
  outline: none;
  box-shadow: var(--shadow-neo-sm);
}

.dark .neo-input {
  background-color: var(--color-surface-dark);
  color: var(--color-text-dark);
  border-color: rgba(255, 255, 255, 0.2);
}

/* ============ Tags & Badges ============ */
.tag {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border: 1px solid currentColor;
}

.tag-primary {
  color: var(--color-primary);
  border-color: var(--color-primary);
}

.tag-secondary {
  color: var(--color-secondary);
  background-color: var(--color-secondary);
  color: white;
}

.badge-new {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  padding: 0.25rem 0.5rem;
  font-size: 0.75rem;
  font-weight: 700;
  background-color: var(--color-secondary);
  color: white;
  z-index: 10;
}

/* ============ Section Styling ============ */
.section-title {
  font-family: var(--font-display);
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 1rem;
}

.section-subtitle {
  font-family: var(--font-display);
  font-style: italic;
  color: var(--color-text-muted);
}

/* ============ Container ============ */
.container {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 1rem;
}

@media (min-width: 640px) {
  .container {
    padding: 0 1.5rem;
  }
}

@media (min-width: 1024px) {
  .container {
    padding: 0 2rem;
  }
}

/* ============ Celestina Note ============ */
.celestina-note {
  position: relative;
  padding: 1.5rem;
  background-color: var(--color-accent-yellow);
  border-left: 4px solid var(--color-accent-green);
  transform: rotate(-1deg);
}

.celestina-note p {
  font-family: var(--font-hand);
  font-size: 1.25rem;
  color: var(--color-text-light);
  font-style: italic;
}

/* ============ Utility Classes ============ */
.text-primary {
  color: var(--color-primary);
}

.text-secondary {
  color: var(--color-secondary);
}

.text-muted {
  color: var(--color-text-muted);
}

.bg-primary {
  background-color: var(--color-primary);
}

.bg-secondary {
  background-color: var(--color-secondary);
}

.border-primary {
  border-color: var(--color-primary);
}

.border-secondary {
  border-color: var(--color-secondary);
}

/* ============ Animations ============ */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.animate-fade-in-up {
  animation: fadeInUp 0.6s ease forwards;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ============ Print Styles ============ */
@media print {
  .no-print {
    display: none !important;
  }
}

/* ============ Preloader ============ */
.preloader {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--color-bg-light);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  transition: opacity 0.6s ease, visibility 0.6s ease;
}

.dark .preloader {
  background: var(--color-bg-dark);
}

.preloader.fade-out {
  opacity: 0;
  visibility: hidden;
}

.preloader-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  animation: fadeInPreloader 0.8s ease forwards;
}

.preloader-logo {
  width: 180px;
  height: auto;
  margin-bottom: 2rem;
  animation: logoFloat 2s ease-in-out infinite;
}

/* Book Animation Container */
.preloader-book {
  position: relative;
  width: 80px;
  height: 60px;
  margin-bottom: 1.5rem;
}

.preloader-book .book-inner {
  position: absolute;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  perspective: 200px;
}

/* Book Pages */
.preloader-book .page {
  position: absolute;
  width: 40px;
  height: 50px;
  background: white;
  border: 2px solid var(--color-border);
  border-radius: 0 3px 3px 0;
  transform-origin: left center;
  left: 50%;
  top: 5px;
}

.dark .preloader-book .page {
  background: #3d3d3d;
  border-color: #5d5d5d;
}

.preloader-book .page:nth-child(1) {
  animation: flipPage 1.8s ease-in-out infinite;
  animation-delay: 0s;
  z-index: 4;
}

.preloader-book .page:nth-child(2) {
  animation: flipPage 1.8s ease-in-out infinite;
  animation-delay: 0.15s;
  z-index: 3;
}

.preloader-book .page:nth-child(3) {
  animation: flipPage 1.8s ease-in-out infinite;
  animation-delay: 0.3s;
  z-index: 2;
}

/* Book Spine */
.preloader-book .spine {
  position: absolute;
  width: 10px;
  height: 56px;
  background: var(--color-primary);
  left: 50%;
  top: 2px;
  transform: translateX(-50%);
  border: 2px solid var(--color-border);
  border-radius: 2px;
  box-shadow: var(--shadow-neo-sm);
}

/* Loading Text */
.preloader-text {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--color-text-light);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  animation: textPulse 1.5s ease-in-out infinite;
}

.dark .preloader-text {
  color: var(--color-text-dark);
}

/* Loading Dots */
.preloader-dots {
  display: flex;
  gap: 0.5rem;
  margin-top: 1rem;
}

.preloader-dots span {
  width: 10px;
  height: 10px;
  background: var(--color-primary);
  border: 2px solid var(--color-border);
  animation: dotBounce 1.4s ease-in-out infinite;
}

.preloader-dots span:nth-child(2) {
  animation-delay: 0.2s;
}

.preloader-dots span:nth-child(3) {
  animation-delay: 0.4s;
}

/* Decorative Quote */
.preloader-quote {
  position: absolute;
  bottom: 3rem;
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1rem;
  color: var(--color-text-muted);
  text-align: center;
  padding: 0 2rem;
  max-width: 400px;
  opacity: 0;
  animation: fadeInQuote 1s ease 0.5s forwards;
}

/* Preloader Animations */
@keyframes fadeInPreloader {
  from {
    opacity: 0;
    transform: scale(0.95);
  }

  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes logoFloat {

  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-8px);
  }
}

@keyframes flipPage {

  0%,
  100% {
    transform: rotateY(0deg);
  }

  50% {
    transform: rotateY(-160deg);
  }
}

@keyframes textPulse {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.6;
  }
}

@keyframes dotBounce {

  0%,
  80%,
  100% {
    transform: scale(1);
    opacity: 0.6;
  }

  40% {
    transform: scale(1.3);
    opacity: 1;
  }
}

@keyframes fadeInQuote {
  to {
    opacity: 1;
  }
}

/* Progress Bar Alternative */
.preloader-progress {
  width: 200px;
  height: 4px;
  background: var(--color-border-light);
  border: 1px solid var(--color-border);
  margin-top: 1.5rem;
  overflow: hidden;
}

.dark .preloader-progress {
  background: #3d3d3d;
  border-color: #5d5d5d;
}

.preloader-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--color-primary), var(--color-secondary));
  width: 0;
  animation: loadProgress 2s ease-in-out infinite;
}

@keyframes loadProgress {
  0% {
    width: 0;
    margin-left: 0;
  }

  50% {
    width: 100%;
    margin-left: 0;
  }

  100% {
    width: 0;
    margin-left: 100%;
  }
}

/* ============ Literary Quotes ============ */
.literary-quote-container {
  padding: 4rem 1.5rem;
  text-align: center;
  position: relative;
  overflow: hidden;
  max-width: 1024px;
  margin: 0 auto;
}

.literary-quote {
  font-family: var(--font-hand);
  font-size: 2.25rem;
  line-height: 1.3;
  color: var(--color-primary);
  max-width: 900px;
  margin: 0 auto 1.5rem;
  position: relative;
  font-weight: 500;
}

.literary-quote::before,
.literary-quote::after {
  content: '"';
  font-family: var(--font-display);
  font-size: 6rem;
  color: var(--color-secondary);
  opacity: 0.15;
  position: absolute;
  line-height: 1;
}

.literary-quote::before {
  top: -2rem;
  left: -1rem;
}

.literary-quote::after {
  bottom: -4rem;
  right: -1rem;
}

.literary-quote-author {
  font-family: var(--font-display);
  font-size: 0.9rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--color-text-muted);
  position: relative;
  display: inline-block;
}

.literary-quote-author::before {
  content: '';
  display: block;
  width: 50px;
  height: 2px;
  background-color: var(--color-secondary);
  margin: 0 auto 0.75rem;
}

.dark .literary-quote {
  color: #26c6da;
}

.dark .literary-quote-author {
  color: var(--color-text-dark);
}

/* Compact home closing quote */
.quote-compact .literary-quote-container {
  padding: 2.5rem 1.25rem;
}

.quote-compact .literary-quote {
  font-size: 1.6rem;
  max-width: 780px;
}

.quote-compact .literary-quote-author {
  font-size: 0.8rem;
  letter-spacing: 0.16em;
}

/* Header logo hover effect */
.logo-hover img {
  transition: transform 0.25s ease, filter 0.25s ease;
}

.logo-hover:hover img {
  transform: scale(1.08) rotate(-1deg);
  filter: drop-shadow(0 6px 12px rgba(0, 0, 0, 0.18));
}

.dark .logo-hover:hover img {
  filter: drop-shadow(0 6px 12px rgba(0, 0, 0, 0.35));
}

@media (min-width: 768px) {
  .quote-compact .literary-quote {
    font-size: 1.8rem;
  }
}

@media (min-width: 768px) {
  .literary-quote {
    font-size: 3rem;
  }

  .literary-quote::before {
    left: -3rem;
  }

  .literary-quote::after {
    right: -3rem;
  }
}

/* ============ Menú Emocional Destacado ============ */
.emotional-nav-btn {
  background: linear-gradient(135deg, #C0392B 0%, #E74C3C 50%, #9B59B6 100%);
  color: white;
  font-weight: 700;
  padding: 0.5rem 1rem;
  border: 2px solid #1a1a1a;
  box-shadow: 2px 2px 0px 0px rgba(0, 0, 0, 1);
  transition: all 0.2s ease;
  font-size: 0.875rem;
}

.emotional-nav-btn:hover {
  transform: translate(-1px, -1px);
  box-shadow: 3px 3px 0px 0px rgba(0, 0, 0, 1);
  color: white;
}

.emotional-nav-dropdown {
  background: linear-gradient(135deg, #FDF2F8 0%, #F3E8FF 100%);
  border: 2px solid #9B59B6;
  border-radius: 0.5rem;
  box-shadow: 4px 4px 0px 0px rgba(0, 0, 0, 1);
}

.dark .emotional-nav-dropdown {
  background: linear-gradient(135deg, #2d1f3d 0%, #1f2937 100%);
  border-color: #C0392B;
}

.emotional-nav-item {
  display: block;
  padding: 0.75rem 1rem;
  border-radius: 0.375rem;
  transition: all 0.2s ease;
}

.emotional-nav-item:hover {
  background-color: rgba(255, 255, 255, 0.5);
  color: inherit;
}

.dark .emotional-nav-item:hover {
  background-color: rgba(75, 85, 99, 0.5);
}

.emotional-nav-item .emoji {
  font-size: 1.25rem;
  margin-right: 0.5rem;
}

.emotional-nav-item .subtitle {
  display: block;
  font-size: 0.75rem;
  color: #6b7280;
  margin-top: 0.25rem;
}

.dark .emotional-nav-item .subtitle {
  color: #9ca3af;
}

/* Mobile emotional nav */
.emotional-mobile-header {
  background: linear-gradient(135deg, #C0392B 0%, #9B59B6 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-weight: 700;
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.5rem 0;
  border-bottom: 2px dashed #9B59B6;
  margin-bottom: 0.5rem;
}

.emotional-mobile-item {
  display: flex;
  align-items: center;
  padding: 0.5rem 0;
  font-weight: 500;
}


/* ============ Scroll Reveal Animations ============ */
.reveal {
    opacity: 0;
    transform: translateY(50px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

.reveal-left {
    opacity: 0;
    transform: translateX(-60px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.reveal-left.active {
    opacity: 1;
    transform: translateX(0);
}

.reveal-right {
    opacity: 0;
    transform: translateX(60px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.reveal-right.active {
    opacity: 1;
    transform: translateX(0);
}

.reveal-scale {
    opacity: 0;
    transform: scale(0.9);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.reveal-scale.active {
    opacity: 1;
    transform: scale(1);
}

/* Stagger delays for grid items */
.reveal-delay-1 { transition-delay: 0.1s; }
.reveal-delay-2 { transition-delay: 0.2s; }
.reveal-delay-3 { transition-delay: 0.3s; }
.reveal-delay-4 { transition-delay: 0.4s; }

header nav img[alt="Promesas de Papel"] {
  height: 56px;
  width: auto;
}

@media (min-width: 1024px) {
  header nav img[alt="Promesas de Papel"] {
    height: 64px;
  }
}

.footer-logo {
  height: 48px;
  width: auto;
  display: block;
}

footer .flex.space-x-4 a {
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

footer .flex.space-x-4 a svg {
  width: 20px;
  height: 20px;
  display: block;
}

/* Quiz Literario */
.quiz-section {
  background: #FDFBF7;
  color: #2C2C2C;
  font-family: 'Montserrat', 'Inter', sans-serif;
  background-image:
    radial-gradient(circle at 12% 18%, rgba(197, 160, 89, 0.08), transparent 45%),
    radial-gradient(circle at 85% 20%, rgba(44, 44, 44, 0.05), transparent 50%);
}

.quiz-app {
  font-family: 'Montserrat', 'Inter', sans-serif;
  position: relative;
  max-width: 880px;
  margin: 0 auto;
}

.quiz-screen {
  display: none;
  gap: 20px;
  align-content: start;
  opacity: 0;
  transform: translateY(14px);
  pointer-events: none;
  transition: opacity 0.35s ease, transform 0.35s ease;
}

.quiz-screen.is-active {
  display: grid;
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
  animation: quizScreenEnter 0.35s ease both;
}

.quiz-shell {
  border: 2px solid #2C2C2C;
  background: linear-gradient(180deg, #FFFDF8 0%, #F8F1E4 100%);
  box-shadow: 8px 8px 0 #2C2C2C;
  border-radius: 16px;
  padding: 32px;
  position: relative;
  overflow: hidden;
  transition: box-shadow 0.35s ease;
}

.quiz-shell::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    linear-gradient(140deg, rgba(197, 160, 89, 0.08), transparent 50%),
    radial-gradient(circle at 90% 10%, rgba(44, 44, 44, 0.06), transparent 50%);
  pointer-events: none;
  z-index: 0;
}

.quiz-shell::after {
  content: '';
  position: absolute;
  inset: 16px;
  border-radius: 12px;
  border: 1px dashed rgba(44, 44, 44, 0.16);
  pointer-events: none;
  z-index: 0;
}

.quiz-shell > * {
  position: relative;
  z-index: 1;
}

.quiz-toolbar {
  position: absolute;
  top: 16px;
  right: 16px;
  display: flex;
  gap: 8px;
  z-index: 2;
}

.quiz-tool {
  width: 40px;
  height: 40px;
  border-radius: 999px;
  border: 2px solid #2C2C2C;
  background: #ffffff;
  box-shadow: 4px 4px 0 #2C2C2C;
  display: grid;
  place-items: center;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.quiz-tool:hover {
  transform: translate(2px, 2px);
  box-shadow: none;
}

.quiz-tool.is-active {
  background: #C5A059;
}

.quiz-tool.is-muted {
  background: #ffffff;
  opacity: 0.7;
}

@keyframes quizScreenEnter {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.quiz-book {
  position: relative;
  width: 240px;
  height: 320px;
  border-radius: 18px;
  border: 2px solid #2C2C2C;
  background: linear-gradient(150deg, #C5A059, #EAD8B0);
  box-shadow: 10px 10px 0 #2C2C2C;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 24px;
  overflow: hidden;
  transition: transform 0.6s ease, box-shadow 0.6s ease;
}

.quiz-book::before {
  content: '';
  position: absolute;
  top: 8px;
  bottom: 8px;
  right: 6px;
  width: 26px;
  background: linear-gradient(90deg, #ffffff, #f1e6d0);
  border-left: 1px solid rgba(44, 44, 44, 0.2);
  opacity: 0;
  transform: translateX(24px);
  transition: transform 0.6s ease, opacity 0.6s ease;
}

.quiz-book::after {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 12px;
  background: rgba(0, 0, 0, 0.12);
}

.quiz-book.is-open {
  transform: rotate(-1.5deg);
  box-shadow: 6px 6px 0 #2C2C2C;
}

.quiz-book.is-open::before {
  opacity: 1;
  transform: translateX(0);
}

.quiz-book-title,
.quiz-book-tag {
  position: relative;
  z-index: 1;
}

.quiz-book-title {
  font-family: 'Playfair Display', serif;
  font-size: 20px;
  font-weight: 700;
}

.quiz-book-tag {
  margin-top: 8px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
}

@media (max-width: 640px) {
  .quiz-book {
    width: 200px;
    height: 260px;
  }
}

.quiz-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid #2C2C2C;
  background: rgba(197, 160, 89, 0.12);
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.quiz-primary-btn {
  background: #C5A059;
  color: #2C2C2C;
  border: 2px solid #2C2C2C;
  padding: 14px 24px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  box-shadow: 4px 4px 0 #2C2C2C;
}

.quiz-primary-btn:hover {
  transform: translate(2px, 2px);
  box-shadow: none;
}

.quiz-progress {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  font-size: 14px;
  font-weight: 600;
}

.quiz-progress-bar {
  flex: 1;
  height: 8px;
  background: #EEE6D9;
  border-radius: 999px;
  overflow: hidden;
}

.quiz-progress-bar span {
  display: block;
  height: 100%;
  background: #C5A059;
  width: 20%;
  transition: width 0.3s ease;
}

.quiz-question-card {
  position: relative;
  border: 2px solid #2C2C2C;
  border-radius: 16px;
  background: #ffffff;
  padding: 24px;
  box-shadow: 8px 8px 0 #2C2C2C;
  transform-origin: left center;
  transition: transform 0.35s ease, box-shadow 0.35s ease, opacity 0.35s ease;
}

.quiz-question-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, transparent 58%, rgba(0, 0, 0, 0.08) 66%, transparent 74%);
  transform: translateX(-120%);
  pointer-events: none;
  opacity: 0;
  transition: transform 0.5s ease, opacity 0.3s ease;
}

.quiz-question-card::after {
  content: '';
  position: absolute;
  top: 12px;
  bottom: 12px;
  right: 12px;
  width: 10px;
  border-radius: 8px;
  background: linear-gradient(90deg, rgba(0, 0, 0, 0), rgba(0, 0, 0, 0.12));
}

.quiz-question-card.is-turning {
  transform: rotateY(-12deg) translateX(8px);
  box-shadow: 3px 3px 0 #2C2C2C;
  opacity: 0.88;
}

.quiz-question-card.is-turning::before {
  transform: translateX(120%);
  opacity: 1;
}

.quiz-question-card.is-swapping {
  opacity: 0;
  transform: translateY(10px) rotateX(6deg);
}

.quiz-question-card.is-reveal .quiz-option {
  animation: optionRise 0.45s ease both;
  animation-delay: var(--delay, 0ms);
}

.quiz-question-card.is-reveal h3,
.quiz-question-card.is-reveal p {
  animation: textFade 0.35s ease both;
}

.quiz-options {
  display: grid;
  gap: 12px;
}

.quiz-option {
  width: 100%;
  text-align: left;
  padding: 14px 18px;
  border: 2px solid #2C2C2C;
  border-radius: 12px;
  background: #ffffff;
  font-weight: 600;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.quiz-option:hover {
  background: rgba(197, 160, 89, 0.15);
  transform: translate(2px, 2px);
  box-shadow: none;
}

@keyframes optionRise {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes textFade {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.quiz-result-grid {
  display: grid;
  gap: 20px;
}

.quiz-result-cover {
  border: 2px solid #2C2C2C;
  border-radius: 16px;
  overflow: hidden;
  background: #F7F2E9;
  box-shadow: 8px 8px 0 #2C2C2C;
}

.quiz-result-cover img {
  width: 100%;
  height: auto;
  display: block;
}

.quiz-cover-fallback {
  padding: 24px;
  min-height: 240px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 12px;
  background: linear-gradient(135deg, #C5A059, #F2E6D2);
  color: #2C2C2C;
}

.quiz-cover-fallback.small {
  min-height: 180px;
  padding: 18px;
}

.quiz-cover-fallback.small .quiz-cover-title {
  font-size: 16px;
}

.quiz-cover-fallback.small .quiz-cover-author {
  font-size: 11px;
}

.quiz-cover-title {
  font-family: 'Playfair Display', serif;
  font-size: 22px;
  font-weight: 700;
}

.quiz-cover-author {
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.quiz-share {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.quiz-share button {
  border: 1px solid #2C2C2C;
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 13px;
  background: #ffffff;
  transition: background 0.2s ease;
}

.quiz-share button:hover {
  background: rgba(44, 44, 44, 0.08);
}

.quiz-share button.is-copied {
  background: rgba(197, 160, 89, 0.25);
}

.quiz-carousel {
  position: relative;
}

.quiz-carousel-track {
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(220px, 1fr);
  gap: 24px;
  padding-bottom: 8px;
}

.quiz-book-card {
  scroll-snap-align: start;
  border: 2px solid #2C2C2C;
  border-radius: 16px;
  background: #ffffff;
  box-shadow: 6px 6px 0 #2C2C2C;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.quiz-book-cover {
  display: block;
  background: #F7F2E9;
}

.quiz-book-cover img {
  width: 100%;
  height: auto;
  display: block;
}

.quiz-book-info {
  padding: 16px;
  display: grid;
  gap: 6px;
}

.quiz-book-info h4 {
  font-family: 'Playfair Display', serif;
  font-size: 18px;
  font-weight: 700;
}

.quiz-book-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #6B5E4E;
}

.quiz-carousel-controls {
  position: absolute;
  top: -46px;
  right: 0;
  display: flex;
  gap: 10px;
}

.quiz-carousel-controls button {
  width: 40px;
  height: 40px;
  border-radius: 999px;
  border: 2px solid #2C2C2C;
  background: #ffffff;
  font-weight: 700;
}

.quiz-outro {
  margin-top: 32px;
}

.quiz-outro-card {
  border: 2px solid #2C2C2C;
  border-radius: 24px;
  background: linear-gradient(135deg, #fdf6e9 0%, #f5efe4 50%, #efe4d1 100%);
  box-shadow: 10px 10px 0 #2C2C2C;
  padding: 32px;
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  gap: 24px;
  align-items: center;
  position: relative;
  overflow: hidden;
}

.quiz-outro-card::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 20% 20%, rgba(197, 160, 89, 0.18), transparent 55%),
    radial-gradient(circle at 80% 70%, rgba(197, 160, 89, 0.12), transparent 60%);
  pointer-events: none;
}

.quiz-outro-content {
  position: relative;
  z-index: 1;
}

.quiz-outro-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.quiz-secondary-btn {
  border: 2px solid #2C2C2C;
  padding: 14px 24px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #2C2C2C;
  background: transparent;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  box-shadow: 4px 4px 0 #2C2C2C;
}

.quiz-secondary-btn:hover {
  transform: translate(2px, 2px);
  box-shadow: none;
}

.quiz-outro-media {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: center;
}

.quiz-outro-media img {
  width: min(320px, 100%);
  height: auto;
  filter: drop-shadow(0 30px 60px rgba(44, 44, 44, 0.25));
}

.quiz-outro-glow {
  position: absolute;
  width: 260px;
  height: 260px;
  background: radial-gradient(circle, rgba(197, 160, 89, 0.35), transparent 60%);
  filter: blur(6px);
  opacity: 0.9;
  z-index: -1;
}

.quiz-recommendations {
  display: grid;
  gap: 20px;
}

.quiz-recommendation-card {
  display: grid;
  gap: 16px;
  border: 2px solid #2C2C2C;
  border-radius: 16px;
  background: #ffffff;
  box-shadow: 6px 6px 0 #2C2C2C;
  padding: 16px;
}

.quiz-recommendation-cover {
  border: 2px solid #2C2C2C;
  border-radius: 12px;
  overflow: hidden;
  background: #F7F2E9;
}

.quiz-recommendation-cover img {
  width: 100%;
  height: auto;
  display: block;
}

.quiz-recommendation-body h4 {
  font-family: 'Playfair Display', serif;
  font-weight: 700;
  font-size: 18px;
  margin-bottom: 6px;
}

.quiz-recommendation-body h4,
.quiz-recommendation-body p {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.quiz-recommendation-meta {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #6B5E4E;
  margin-bottom: 12px;
}

.quiz-recommendation-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 16px;
  border: 2px solid #2C2C2C;
  background: #C5A059;
  color: #2C2C2C;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  box-shadow: 4px 4px 0 #2C2C2C;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.quiz-recommendation-btn:hover {
  transform: translate(2px, 2px);
  box-shadow: none;
}

@media (min-width: 768px) {
  .quiz-recommendations {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .quiz-recommendation-card {
    grid-template-columns: 0.8fr 1.2fr;
    align-items: start;
  }
}

@media (prefers-reduced-motion: reduce) {
  .quiz-book,
  .quiz-question-card {
    transition: none;
  }

  .quiz-question-card.is-reveal .quiz-option,
  .quiz-question-card.is-reveal h3,
  .quiz-question-card.is-reveal p {
    animation: none;
  }
}

.quiz-section.quiz-night {
  background: #0B1220;
  color: #F5F0E6;
  background-image:
    radial-gradient(circle at 12% 18%, rgba(197, 160, 89, 0.12), transparent 50%),
    radial-gradient(circle at 85% 20%, rgba(255, 255, 255, 0.05), transparent 55%);
}

.quiz-section.quiz-night .quiz-shell {
  background: linear-gradient(180deg, #141C2C 0%, #0F1724 100%);
  border-color: rgba(245, 240, 230, 0.7);
  box-shadow: 8px 8px 0 rgba(245, 240, 230, 0.35);
}

.quiz-section.quiz-night .quiz-shell::after {
  border-color: rgba(245, 240, 230, 0.2);
}

.quiz-section.quiz-night .quiz-badge {
  border-color: rgba(245, 240, 230, 0.5);
  background: rgba(197, 160, 89, 0.2);
  color: #F5F0E6;
}

.quiz-section.quiz-night .quiz-question-card,
.quiz-section.quiz-night .quiz-result-cover,
.quiz-section.quiz-night .quiz-recommendation-card,
.quiz-section.quiz-night .quiz-book-card,
.quiz-section.quiz-night .quiz-share button,
.quiz-section.quiz-night .quiz-option {
  background: #151E2D;
  border-color: rgba(245, 240, 230, 0.5);
  color: #F5F0E6;
  box-shadow: 6px 6px 0 rgba(245, 240, 230, 0.25);
}

.quiz-section.quiz-night .quiz-option:hover,
.quiz-section.quiz-night .quiz-share button:hover {
  background: rgba(197, 160, 89, 0.2);
}

.quiz-section.quiz-night .quiz-primary-btn,
.quiz-section.quiz-night .quiz-recommendation-btn,
.quiz-section.quiz-night .quiz-secondary-btn {
  border-color: rgba(245, 240, 230, 0.6);
  box-shadow: 4px 4px 0 rgba(245, 240, 230, 0.3);
}

.quiz-section.quiz-night .quiz-primary-btn {
  color: #1C1C1C;
}

.quiz-section.quiz-night .quiz-tool {
  background: #141C2C;
  border-color: rgba(245, 240, 230, 0.6);
  color: #F5F0E6;
}

.quiz-section.quiz-night .quiz-tool.is-active {
  background: #C5A059;
  color: #2C2C2C;
}

.quiz-section.quiz-night .quiz-progress-bar {
  background: rgba(245, 240, 230, 0.2);
}

.quiz-section.quiz-night .quiz-progress-bar span {
  background: #C5A059;
}

.quiz-section.quiz-night .text-gray-900 {
  color: #F5F0E6 !important;
}

.quiz-section.quiz-night .text-gray-700 {
  color: #D7CDBE !important;
}

.quiz-section.quiz-night .text-gray-600 {
  color: #C9BFAE !important;
}

.quiz-section.quiz-night .text-gray-500 {
  color: #B2A996 !important;
}

@media (min-width: 900px) {
  .quiz-result-grid {
    grid-template-columns: 0.9fr 1.1fr;
    align-items: center;
  }
}

@media (max-width: 768px) {
  .quiz-shell {
    padding: 24px;
  }

  .quiz-result-grid {
    grid-template-columns: 1fr;
  }

  .quiz-outro-card {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .quiz-outro-actions {
    justify-content: center;
  }
}
