/*
Theme Name: Fantardore
Theme URI: https://fantardore.it
Author: Vincenzo Guarnieri
Author URI: https://vicco.it
Description: Tema WordPress personalizzato per Fantardore.it - sviluppato con Tailwind CSS e Vite. Design moderno, performante e responsive.
Version: 1.0.0
Text Domain: fantardore
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Tags: custom-header, custom-menu, featured-images, threaded-comments, translation-ready
Requires at least: 6.0
Tested up to: 6.9
*/

:root {
  /* ============================================
     DESIGN TOKENS - Fantardore Theme
     ============================================ */
  
  /* Typography - Font Family */
  --font-sans: 'Outfit', ui-sans-serif, system-ui, sans-serif;
  
  /* Typography - Type Scale (1.25 ratio) */
  --text-xs: 0.75rem;      /* 12px */
  --text-sm: 0.875rem;     /* 14px */
  --text-base: 1rem;       /* 16px */
  --text-lg: 1.125rem;     /* 18px */
  --text-xl: 1.25rem;      /* 20px */
  --text-2xl: 1.5rem;      /* 24px */
  --text-3xl: 1.875rem;    /* 30px */
  --text-4xl: 2.25rem;     /* 36px */
  --text-5xl: 3rem;        /* 48px */
  --text-6xl: 3.75rem;     /* 60px */
  
  /* Typography - Fluid Scale for Headings */
  --text-fluid-sm: clamp(1rem, 0.95rem + 0.25vw, 1.125rem);
  --text-fluid-base: clamp(1.125rem, 1rem + 0.5vw, 1.25rem);
  --text-fluid-lg: clamp(1.25rem, 1.1rem + 0.75vw, 1.5rem);
  --text-fluid-xl: clamp(1.5rem, 1.2rem + 1.5vw, 2rem);
  --text-fluid-2xl: clamp(1.875rem, 1.4rem + 2.5vw, 2.5rem);
  --text-fluid-3xl: clamp(2.25rem, 1.6rem + 3.5vw, 3rem);
  --text-fluid-4xl: clamp(3rem, 2rem + 5vw, 4rem);
  --text-fluid-5xl: clamp(3.75rem, 2.5rem + 6.5vw, 5rem);

  /* Typography - Line Heights */
  --leading-tight: 1.1;
  --leading-snug: 1.25;
  --leading-normal: 1.5;
  --leading-relaxed: 1.625;
  --leading-loose: 2;

  /* Typography - Font Weights */
  --font-light: 300;
  --font-regular: 400;
  --font-medium: 500;
  --font-semibold: 600;
  --font-bold: 700;
  --font-extrabold: 800;

  /* Colori Primari */
  --fantardore-orange: #FF6B35;
  --fantardore-blue:   #1E40AF;
  --fantardore-dark:   #1F2937;
  
  /* Sfumature Orange Range */
  --orange-50:  #FFF7ED;
  --orange-100: #ffedd5;
  --orange-200: #fed7aa;
  --orange-300: #fdba74;
  --orange-400: #fb923c;
  --orange-500: #f97316;
  --orange-600: #ea580c;
  --orange-700: #c2410c;
  --orange-800: #9a3412;
  --orange-900: #7C2D12;

  /* Colori Utility */
  --bg-color:   #f9fafb;
  --white:      #ffffff;
  --text-base:  #374151;
  --text-muted: #6b7280;
  --border-light: #e5e7eb;

  /* ============================================
     Design Token Aliases for Consistency
     ============================================ */
  /* Border Radius Tokens */
  --radius-sm: 0.25rem;
  --radius-md: 0.375rem;
  --radius-lg: 0.5rem;
  --radius-xl: 0.75rem;
  --radius-2xl: 1rem;
  --radius-3xl: 1.5rem;
  --radius-full: 9999px;

  /* Spacing Tokens */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;

  /* Shadow Tokens */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);

  /* Transition Tokens */
  --transition-fast: 150ms;
  --transition-normal: 200ms;
  --transition-slow: 300ms;
}

/* -------------------------------------------------------------------------- */
/* Typography Base Styles - Improved Readability */
/* -------------------------------------------------------------------------- */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-sans);
  font-weight: var(--font-bold);
  line-height: var(--leading-tight);
  color: var(--fantardore-dark);
}

p {
  line-height: var(--leading-relaxed);
  margin-bottom: 1rem;
}

/* Better link styles */
a {
  color: var(--fantardore-orange);
  text-decoration: none;
  transition: color var(--transition-fast) ease;
}

a:hover {
  color: var(--orange-600);
}

/* Text container for optimal readability */
.text-content {
  max-width: 65ch;
  line-height: var(--leading-relaxed);
}

/* -------------------------------------------------------------------------- */
/* Reset Base & Typography (Allineato a Vite)
/* -------------------------------------------------------------------------- */
* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  overflow-x: hidden;
}

body {
  font-family: 'Outfit', ui-sans-serif, system-ui, sans-serif;
  line-height: 1.6;
  color: var(--text-base);
  overflow-x: hidden;
  background-color: var(--white);
  margin: 0;
  padding: 0;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* -------------------------------------------------------------------------- */
/* Components (Allineati a index.css di Vite)
/* -------------------------------------------------------------------------- */
.btn-primary {
  background-color: var(--fantardore-orange);
  color: white;
  font-weight: 600;
  padding: 0.75rem 1.5rem;
  border-radius: 0.5rem;
  transition: all 0.3s;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.btn-primary:hover {
  background-color: var(--orange-600);
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.btn-secondary {
  background-color: white;
  color: var(--fantardore-blue);
  border: 2px solid var(--fantardore-blue);
  font-weight: 600;
  padding: 0.75rem 1.5rem;
  border-radius: 0.5rem;
  transition: all 0.3s;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.btn-secondary:hover {
  background-color: var(--bg-color);
  box-shadow: var(--shadow-xl);
}

.card {
  background-color: var(--white);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  transition: all var(--transition-slow);
  padding: 1.5rem;
}
@media (min-width: 640px) {
  .card { padding: 1.5rem; }
}
.card:hover {
  box-shadow: var(--shadow-xl);
}

.gradient-text {
  color: var(--fantardore-orange);
}

.glass-effect {
  background-color: rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-xl);
}

.bg-hero-gradient {
  background: var(--fantardore-orange);
}

.bg-card-gradient {
  background: var(--white);
}

.bg-orange-gradient {
  background: var(--fantardore-orange);
}

.hover-lift {
  transition: all var(--transition-slow) ease-out;
}
.hover-lift:hover {
  transform: translateY(-0.25rem);
  box-shadow: var(--shadow-lg);
}

.form-input {
  transition: all var(--transition-slow);
  border: 2px solid var(--border-light);
  min-height: 48px;
  padding-left: 1rem;
  padding-right: 1rem;
  border-radius: var(--radius-lg);
  font-size: 0.875rem;
  width: 100%;
}
@media (min-width: 640px) {
  .form-input { font-size: 1rem; }
}
.form-input:focus {
  border-color: var(--fantardore-orange);
  outline: none;
  box-shadow: 0 0 0 3px rgba(255, 107, 53, 0.15);
}

.mobile-padding {
  padding-left: 1rem;
  padding-right: 1rem;
}
@media (min-width: 640px) {
  .mobile-padding { padding-left: 1.5rem; padding-right: 1.5rem; }
}
@media (min-width: 1024px) {
  .mobile-padding { padding-left: 2rem; padding-right: 2rem; }
}

.container-custom {
  max-width: 1280px;
  margin-left: auto;
  margin-right: auto;
}

/* -------------------------------------------------------------------------- */
/* Utilities & Animazioni (Allineate a Vite)
/* -------------------------------------------------------------------------- */
.text-balance {
  text-wrap: balance;
}

.animate-fade-in {
  animation: fadeIn 0.6s ease-in-out;
}

.animate-slide-up {
  animation: slideUp 0.8s ease-out forwards;
}

.animate-float {
  animation: float 6s ease-in-out infinite;
}

.bg-glass {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.min-touch-target {
  min-height: 44px;
  min-width: 44px;
}

.line-clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.line-clamp-3 {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* -------------------------------------------------------------------------- */
/* Animation Timing Variables */
/* -------------------------------------------------------------------------- */
:root {
  --ease-out-quart: cubic-bezier(0.25, 1, 0.5, 1);
  --ease-out-quint: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.4, 0, 0.2, 1);
}

/* Keyframes */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

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

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-20px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

@keyframes float {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-10px); }
}

@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

/* -------------------------------------------------------------------------- */
/* Micro-interactions */
/* -------------------------------------------------------------------------- */

/* Button press effect */
.btn-press:active {
  transform: scale(0.97);
}

/* Input focus transition */
.form-input {
  transition: border-color 0.2s var(--ease-out-quart), box-shadow 0.2s var(--ease-out-quart);
}

.form-input:focus {
  border-color: var(--fantardore-orange);
  outline: none;
  box-shadow: 0 0 0 3px rgba(255, 107, 53, 0.15);
}

/* Link underline animation */
a.animated-underline {
  position: relative;
}

a.animated-underline::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background-color: var(--fantardore-orange);
  transition: width 0.3s var(--ease-out-quart);
}

a.animated-underline:hover::after {
  width: 100%;
}

/* Card hover lift */
.card-lift {
  transition: transform 0.3s var(--ease-out-quart), box-shadow 0.3s var(--ease-out-quart);
}

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

/* Icon rotate on hover */
.icon-rotate {
  transition: transform 0.3s var(--ease-out-quart);
}

.icon-rotate:hover {
  transform: rotate(15deg);
}

/* Stagger delay utilities */
.stagger-1 { animation-delay: 0.1s; }
.stagger-2 { animation-delay: 0.2s; }
.stagger-3 { animation-delay: 0.3s; }
.stagger-4 { animation-delay: 0.4s; }
.stagger-5 { animation-delay: 0.5s; }

/* -------------------------------------------------------------------------- */
/* Accessibility - Focus States */
/* -------------------------------------------------------------------------- */
*:focus {
  outline: 2px solid var(--fantardore-orange);
  outline-offset: 2px;
}

*:focus:not(:focus-visible) {
  outline: none;
}

*:focus-visible {
  outline: 2px solid var(--fantardore-orange);
  outline-offset: 2px;
}

a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--fantardore-orange);
  outline-offset: 2px;
  border-radius: 0.25rem;
}

a:focus:not(:focus-visible),
button:focus:not(:focus-visible) {
  outline: none;
}

/* Skip to content link */
.skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  background: var(--fantardore-orange);
  color: white;
  padding: 8px 16px;
  z-index: 99999;
  transition: top 0.3s;
}

.skip-link:focus {
  top: 0;
}

/* -------------------------------------------------------------------------- */
/* Accessibility - Reduced Motion */
/* -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* -------------------------------------------------------------------------- */
/* Hardening - Text Overflow */
/* -------------------------------------------------------------------------- */
.text-overflow-ellipsis {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.text-overflow-clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.text-overflow-clamp-3 {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Flex/Grid overflow prevention */
.flex-min-width-0 {
  min-width: 0;
}

.grid-min-width-0 {
  min-width: 0;
}

/* Performance - Content Visibility */
.content-visibility-auto {
  content-visibility: auto;
  contain-intrinsic-size: 1px 500px;
}

.content-visibility-auto section {
  content-visibility: auto;
  contain-intrinsic-size: 1px 300px;
}

/* Category Badge Colors */
.cat-fantacalcio { background-color: #F3E8FF; color: #7C3AED; border-color: #C4B5FD; }
.cat-serie-a { background-color: #DCFCE7; color: #16A34A; border-color: #86EFAC; }
.cat-calciomercato { background-color: #DBEAFE; color: #2563EB; border-color: #93C5FD; }
.cat-sport { background-color: #FFEDD5; color: #EA580C; border-color: #FDBA74; }
.cat-generale { background-color: #F3F4F6; color: #374151; border-color: #D1D5DB; }
.cat-tornei { background-color: #FEF9C3; color: #CA8A04; border-color: #FDE047; }
.cat-voti { background-color: #E0E7FF; color: #4F46E5; border-color: #A5B4FC; }

/* Prize Category Gradients */
.prize-gold { background: linear-gradient(to bottom right, #FBBF24, #D97706); }
.prize-blue { background: linear-gradient(to bottom right, #60A5FA, #2563EB); }
.prize-purple { background: linear-gradient(to bottom right, #C084FC, #7C3AED); }
.prize-gray { background: linear-gradient(to bottom right, #9CA3AF, #4B5563); }

/* ============================================
   HERO CAROUSEL
   ============================================ */

.hero-carousel {
    position: relative;
    min-height: 100vh;
    overflow: hidden;
}

.hero-slides-wrapper {
    display: flex;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    width: 100%;
    height: 100%;
}

.hero-slide {
    flex: 0 0 100%;
    width: 100%;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

/* Single league - no transitions */
.hero-carousel.no-transition .hero-slides-wrapper {
    transition: none;
}

.hero-carousel.single-slide .hero-slides-wrapper {
    transition: none;
}

/* Dots Navigation */
.hero-dots {
    display: flex;
    gap: 0.5rem;
    z-index: 20;
}

.hero-dots .dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.5);
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 0;
}

.hero-dots .dot.active {
    background-color: white;
    transform: scale(1.2);
}

.hero-dots .dot:hover {
    background-color: rgba(255, 255, 255, 0.8);
}

.hero-dots .dot:focus {
    outline: 2px solid white;
    outline-offset: 2px;
}

/* Content inside slide */
.hero-slide .hero-title,
.hero-slide .hero-subtitle,
.hero-slide .hero-description {
    position: relative;
    z-index: 10;
}

/* Responsive */
@media (max-width: 640px) {
    .hero-dots .dot {
        width: 10px;
        height: 10px;
    }
}

/* Animation for stats */
.hero-slide .stat-item {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.hero-slide.active .stat-item {
    opacity: 1;
    transform: translateY(0);
}

.hero-slide.active .stat-item.stagger-1 { transition-delay: 0.1s; }
.hero-slide.active .stat-item.stagger-2 { transition-delay: 0.2s; }
.hero-slide.active .stat-item.stagger-3 { transition-delay: 0.3s; }
.hero-slide.active .stat-item.stagger-4 { transition-delay: 0.4s; }

/* ============================================
   HERO SLIDE WITH BACKGROUND IMAGE
   ============================================ */

.hero-slide-bg-image {
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

/* Dark overlay for text readability */
.hero-slide-bg-image::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.3), rgba(0, 0, 0, 0.5));
    z-index: 1;
}

/* Ensure content stays above overlay */
.hero-slide-bg-image .hero-slide-content {
    position: relative;
    z-index: 2;
}

/* Optional: Add texture or pattern overlay */
.hero-slide-bg-image::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.05'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    opacity: 0.5;
    z-index: 1;
    pointer-events: none;
}

/* ==========================================================================
   Block Pattern Preview Styles (Gutenberg Editor)
   ========================================================================== */

/* Pattern preview container in the inserter sidebar */
.block-editor-block-patterns-list__item .block-editor-block-preview__container {
    background-color: #ffffff;
    padding: 0;
}

/* Pattern preview content area */
.block-editor-block-patterns-list__item .block-editor-block-preview__content {
    background-color: #ffffff;
    padding: 0;
    max-width: 100%;
}

/* Ensure pattern content uses theme styles when previewed */
.block-editor-iframe__body .wp-block-group.alignfull {
    padding-top: var(--wp--preset--spacing--60);
    padding-bottom: var(--wp--preset--spacing--60);
}

/* Clean up the inserter preview background to match frontend */
[data-type="core/group"][data-align="full"] .block-editor-block-preview__content {
    background: transparent;
}

/* Pattern item in the list */
.block-editor-block-patterns-list__item {
    border-radius: 8px;
    overflow: hidden;
}
