/*
Theme Name: LaLiga Tips
Description: Tema WordPress professionale per siti di pronostici sportivi. Mobile-first, ottimizzato per performance e completamente personalizzabile.
Author: LaLiga Tips Team
Version: 1.0.2
Requires at least: 6.0
Tested up to: 6.4
Requires PHP: 8.0
License: GPL v2 or later
Text Domain: laliga-tips
*/

/**
 * ===============================================
 * CSS VARIABLES - ESATTAMENTE COME NEI FILE HTML ORIGINALI
 * ===============================================
 */
:root {
  /* Variabili principali dai file HTML originali */
  --laliga-red: #ef3340;
  --laliga-dark: #000;
  --laliga-light: #fff;
  --gray-100: #f7f7f7;
  --gray-200: #e6e6e6;
  --accent: #ffc658;
  --pill-purple: #5d3eff;
  
  /* Variabili aggiuntive per pronostici singoli e schedine */
  --primary: #ef3340;
  --dark: #000;
  --light: #fff;
  --success: #28a745;
  --warning: #ffc107;
  --danger: #dc3545;
}

/**
 * ===============================================
 * RESET & BASE STYLES - IDENTICO AI FILE HTML
 * ===============================================
 */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Helvetica Neue', Arial, sans-serif;
  line-height: 1.6;
  color: #222;
  background: var(--gray-100);
  margin: 0;
}

/* Per schedina.html e single.html */
body.single-schedina,
body.single-pronostico {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

a {
  text-decoration: none;
  color: inherit;
}

img {
  max-width: 100%;
  display: block;
}

/**
 * ===============================================
 * HEADER & NAVIGATION - ESATTO DAI FILE HTML
 * ===============================================
 */
header {
  position: sticky;
  top: 0;
  left: 0;
  right: 0;
  background: var(--laliga-red);
  color: var(--laliga-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  z-index: 900;
  box-shadow: 0 2px 4px rgba(0,0,0,.15);
}

.logo {
  font-weight: 700;
  font-size: 1.25rem;
  letter-spacing: -0.5px;
}

.logo img {width:auto!important; height:50px!important;}

.menu-toggle {
  background: none;
  border: none;
  color: var(--laliga-light);
  font-size: 1.5rem;
  cursor: pointer;
}

/* Off-canvas menu - CORRETTO Z-INDEX */
.offcanvas {
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  width: 260px;
  background: var(--laliga-dark);
  color: var(--laliga-light);
  transform: translateX(-100%);
  transition: 0.3s ease-in-out;
  z-index: 1000;
  padding: 2rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.offcanvas.open {
  transform: translateX(0);
}

.offcanvas a {
  color: var(--laliga-light);
  padding: 0.5rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  transition: 0.2s ease;
}

.offcanvas a:hover {
  color: var(--accent);
  padding-left: 0.5rem;
}

.overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.5);
  backdrop-filter: blur(2px);
  opacity: 0;
  visibility: hidden;
  transition: 0.3s;
  z-index: 999;
}

.overlay.show {
  opacity: 1;
  visibility: visible;
}

/**
 * ===============================================
 * HERO SECTIONS - IDENTICO AI FILE HTML
 * ===============================================
 */
.hero {
  padding: 2rem 1rem;
  background: var(--laliga-light);
  text-align: center;
}

.hero h1 {
  font-size: clamp(1.75rem, 5vw, 2.5rem);
  color: var(--laliga-red);
  margin-bottom: 1.5rem;
}

/* Per news.html */
.hero .meta {
  font-size: 0.9rem;
  color: #666;
  display: flex;
  gap: 0.4rem;
  justify-content: center;
  flex-wrap: wrap;
}

/* Stake control per schedine */
.stake-control {
  margin-bottom: 1rem;
  font-size: 0.9rem;
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  align-items: center;
}

#stake {
  width: 80px;
  padding: 0.25rem 0.4rem;
  border: 1px solid var(--gray-200);
  border-radius: 4px;
  font-size: 0.9rem;
  text-align: right;
}

/**
 * ===============================================
 * TABELLE - IDENTICO AI FILE HTML ORIGINALI
 * ===============================================
 */
.table-wrapper {
  overflow-x: auto;
}

.schedina {
  width: 100%;
  min-width: 600px;
  border-collapse: collapse;
  font-size: 0.9rem;
  background: var(--laliga-light);
}

.schedina thead {
  background: var(--laliga-red);
  color: var(--laliga-light);
}

.schedina th,
.schedina td {
  padding: 0.65rem 0.5rem;
  text-align: center;
  border: 1px solid var(--gray-200);
}

.schedina td:first-child,
.schedina th:first-child {
  text-align: left;
}

.schedina tbody tr:nth-child(even) {
  background: var(--gray-100);
}

/* Event styling nelle tabelle */
.event {
  text-align: left;
  font-weight: 600;
}

.event small {
  display: block;
  font-weight: 400;
  font-size: 0.8rem;
  color: #666;
}

/* Comparativa quote - IDENTICO A ARCHIVE.HTML */
.comparativa-wrapper {
  margin: 2rem auto;
  max-width: 100%;
  overflow-x: auto;
}

.comparativa {
  width: 100%;
  min-width: 450px;
  border-collapse: collapse;
  font-size: 0.9rem;
  text-align: center;
  background: var(--laliga-light);
}

.comparativa th {
  background: var(--laliga-red);
  color: var(--laliga-light);
  padding: 0.6rem 0.4rem;
}

.comparativa td {
  padding: 0.55rem 0.4rem;
  border: 1px solid var(--gray-200);
}

.comparativa .best {
  background: var(--accent);
  font-weight: 700;
  color: #000;
}

/**
 * ===============================================
 * CTA E BUTTONS - CORRETTO E OTTIMIZZATO
 * ===============================================
 */
.cta {
  display: inline-block;
  margin: 0.25rem 0;
  padding: 0.35rem 0.65rem;
  background: var(--laliga-red);
  color: var(--laliga-light);
  border-radius: 4px;
  font-size: 0.8rem;
  font-weight: 600;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
}

.cta:hover,
.cta:focus {
  transform: translateY(-2px);
  box-shadow: 0 2px 4px rgba(0,0,0,.15);
  background: #d12835; /* Versione più scura del rosso */
  text-decoration: none;
}

/* Bottoni principali - VARIABILI CORRETTE */
.btn {
  display: inline-block;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  background: var(--laliga-red);
  color: var(--laliga-light);
  font-weight: 600;
  text-decoration: none;
  border: none;
  cursor: pointer;
  font-size: 0.9rem;
  transition: all 0.3s ease;
  box-shadow: 0 2px 4px rgba(0,0,0,.1);
}

.btn:hover,
.btn:focus {
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(0,0,0,.2);
  text-decoration: none;
  background: #d12835;
}

/* Social buttons - MIGLIORATI */
.telegram {
  background: #34ace0;
  color: var(--laliga-light);
}

.telegram:hover,
.telegram:focus {
  background: #2980b9;
  color: var(--laliga-light);
}

.whatsapp {
  background: #25d366;
  color: var(--laliga-light);
}

.whatsapp:hover,
.whatsapp:focus {
  background: #1da851;
  color: var(--laliga-light);
}

/* CTA Container per sezioni social */
.cta {
  text-align: center;
}

.cta h2 {
  color: var(--laliga-red);
  margin-bottom: 1rem;
  font-size: 1.3rem;
}

.cta p {
  margin-bottom: 1.5rem;
  color: #666;
  font-size: 0.95rem;
}

.cta a {
  display: inline-block;
  width: 220px;
  padding: 0.75rem 1rem;
  margin: 0.5rem;
  border-radius: 8px;
  font-weight: 600;
  text-decoration: none;
  text-align: center;
  transition: all 0.3s ease;
  box-shadow: 0 2px 6px rgba(0,0,0,.15);
}

.cta a:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,.25);
}

/* Responsive per bottoni */
@media (max-width: 600px) {
  .cta a {
    width: 100%;
    max-width: 280px;
    display: block;
    margin: 0.5rem auto;
  }
  
  .btn,
  .cta {
    font-size: 0.85rem;
    padding: 0.6rem 1rem;
  }
}

/**
 * ===============================================
 * PILLS & BADGES - IDENTICO AI FILE HTML
 * ===============================================
 */
.pill {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  border: 1px solid var(--pill-purple);
  color: var(--pill-purple);
  padding: 0.15rem 0.7rem;
  border-radius: 9999px;
  white-space: nowrap;
}

/* Form badges per pronostici */
.form-badges {
  display: flex;
  gap: 0.35rem;
  margin-top: 0.5rem;
}

.form-badges span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-weight: 700;
  color: #fff;
}

.W {
  background: var(--success);
}

.D {
  background: var(--warning);
}

.L {
  background: var(--danger);
}

/**
 * ===============================================
 * CARDS - PER SCHEDINA.HTML E SINGLE.HTML
 * ===============================================
 */
.card {
  background: var(--light);
  border-radius: 12px;
  box-shadow: 0 2px 6px rgba(0,0,0,.08);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

.card.best {
  box-shadow: 0 0 0 3px var(--primary);
}

/* Main content container */
main {
  max-width: 900px;
  margin: 2rem auto;
  padding: 0 1rem;
}

/* Intro cards */
.intro {
  text-align: center;
}

.intro p {
  margin-bottom: 0.35rem;
}

/**
 * ===============================================
 * FILTRI - IDENTICO A ARCHIVE.HTML
 * ===============================================
 */
.filter-bar {
  display: flex;
  justify-content: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin: 2rem 0;
}

.filter-bar input,
.filter-bar select {
  padding: 0.4rem 0.6rem;
  border: 1px solid var(--gray-200);
  border-radius: 4px;
  font-size: 0.9rem;
}

/**
 * ===============================================
 * POST LAYOUTS - IDENTICO AI FILE HTML
 * ===============================================
 */
.posts {
  padding: 2rem 1rem;
  max-width: 850px;
  margin: auto;
}

.posts h2 {
  text-align: center;
  font-size: 1.5rem;
  color: var(--laliga-red);
  margin-bottom: 1.25rem;
}

/* Featured post - IDENTICO A INDEX.HTML */
.featured-post {
  background: var(--laliga-light);
  border: 1px solid var(--gray-200);
  border-radius: 20px;
  overflow: hidden;
  margin-bottom: 2rem;
  display: flex;
  flex-direction: column;
}

.featured-post img {
  width: 100%;
  height: auto;
  object-fit: cover;
  max-height: 380px;
}

.featured-post .content {
  padding: 1.5rem;
  text-align: left;
}

.featured-post h3 {
  font-size: 1.5rem;
  margin: 0.4rem 0 1rem;
  line-height: 1.25;
}

.featured-post .excerpt {
  font-size: 0.95rem;
  color: #444;
  margin-bottom: 1rem;
}

.featured-post .meta {
  font-size: 0.8rem;
  color: #666;
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}

/* Post row - IDENTICO AI FILE HTML */
.post-row {
  display: flex;
  gap: 1rem;
  align-items: center;
  background: var(--laliga-light);
  border: 1px solid var(--gray-200);
  border-radius: 20px;
  padding: 1rem;
  margin-bottom: 1.25rem;
}

.post-row img {
  width: 130px;
  height: 130px;
  object-fit: cover;
  border-radius: 16px;
  flex-shrink: 0;
}

.post-row .details {
  flex: 1;
  text-align: left;
}

.post-row h3 {
  font-size: 1.15rem;
  margin: 0.35rem 0 0.65rem;
  line-height: 1.3;
}

.post-row .excerpt {
  font-size: 0.9rem;
  color: #444;
  max-width: 95%;
}

.meta {
  font-size: 0.75rem;
  color: #666;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
}

/**
 * ===============================================
 * PAGINAZIONE - IDENTICO A ARCHIVE.HTML
 * ===============================================
 */
.pagination {
  display: flex;
  justify-content: center;
  gap: 0.4rem;
  margin: 2rem 0;
}

.pagination button {
  padding: 0.35rem 0.6rem;
  border: 1px solid var(--gray-200);
  background: var(--laliga-light);
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.85rem;
}

.pagination button.active {
  background: var(--laliga-red);
  color: var(--laliga-light);
  border-color: var(--laliga-red);
}

/**
 * ===============================================
 * SINGLE POST CONTENT - IDENTICO A NEWS.HTML
 * ===============================================
 */
.post-container {
  max-width: 850px;
  margin: 2rem auto;
  padding: 0 1rem;
}

.post-featured {
  border-radius: 20px;
  overflow: hidden;
  margin-bottom: 1.5rem;
}

.post-content p {
  margin-bottom: 1rem;
  font-size: 1rem;
  color: #333;
}

.post-content h2 {
  margin: 1.75rem 0 1rem;
  font-size: 1.4rem;
  color: var(--laliga-red);
}

.post-content blockquote {
  border-left: 4px solid var(--laliga-red);
  padding: 0.6rem 1rem;
  font-style: italic;
  background: var(--laliga-light);
  margin: 1.5rem 0;
}

.post-content img {
  margin: 1rem 0;
  border-radius: 12px;
}

.post-content ul {
  margin: 1rem 0 1rem 1.25rem;
  list-style: disc;
}

.post-content ol {
  margin: 1rem 0 1rem 1.25rem;
}

/**
 * ===============================================
 * VIDEO RESPONSIVE - IDENTICO AI FILE HTML
 * ===============================================
 */
.video-responsive {
  position: relative;
  padding-bottom: 56.25%;
  height: 0;
  overflow: hidden;
  border-radius: 12px;
  margin: 1rem 0;
}

.video-responsive iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/**
 * ===============================================
 * TABELLE INFO - IDENTICO AI FILE HTML
 * ===============================================
 */
.info-table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0;
  font-size: 0.9rem;
  background: var(--laliga-light);
}

.info-table th,
.info-table td {
  border: 1px solid var(--gray-200);
  padding: 0.55rem;
  text-align: center;
}

.info-table thead {
  background: var(--laliga-red);
  color: var(--laliga-light);
}

/**
 * ===============================================
 * HERO IMAGE - PER SINGLE.HTML
 * ===============================================
 */
.hero-image {
  position: relative;
  max-height: 420px;
  overflow: hidden;
}

.hero-image img {
  width: 100%;
  height: auto;
  object-fit: cover;
}

.hero-title {
  position: absolute;
  bottom: 1rem;
  left: 50%;
  transform: translateX(-50%);
  color: var(--light);
  background: rgba(0,0,0,.55);
  padding: 0.75rem 1.25rem;
  border-radius: 14px;
  font-size: clamp(1.5rem,4vw,2.5rem);
  line-height: 1.25;
  text-align: center;
  backdrop-filter: blur(4px);
}

/**
 * ===============================================
 * TIMELINE - PER SINGLE.HTML
 * ===============================================
 */
.timeline {
  position: relative;
  list-style: none;
  margin: 0;
  padding-left: 1.5rem;
}

.timeline::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  width: 2px;
  height: 100%;
  background: var(--gray-200);
}

.timeline li {
  position: relative;
  margin-bottom: 1rem;
}

.timeline li::before {
  content: "";
  position: absolute;
  left: -6px;
  top: 6px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--primary);
}

.match-date {
  font-size: 0.875rem;
  color: #555;
  margin-right: 0.4rem;
}

.match-score {
  font-weight: 600;
}

/**
 * ===============================================
 * QUOTE GRIDS - PER SINGLE.HTML
 * ===============================================
 */
.quote-grid,
.bonus-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
  margin-top: 0.75rem;
}

.quote-card,
.bonus-card {
  border: 1px solid var(--gray-200);
  border-radius: 12px;
  padding: 1rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.quote-card h4,
.bonus-card h4 {
  margin: 0.25rem 0;
  font-size: 1rem;
  color: var(--primary);
}

.odds {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.25rem;
  font-size: 0.9rem;
}

.odds span {
  padding: 0.45rem 0;
  border-radius: 6px;
  border: 1px solid var(--gray-200);
}

/**
 * ===============================================
 * RELATED POSTS - IDENTICO AI FILE HTML
 * ===============================================
 */
.related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1rem;
  margin-top: 0.75rem;
}

.related-card {
  border: 1px solid var(--gray-200);
  border-radius: 12px;
  padding: 1rem;
  transition: transform 0.2s, box-shadow 0.2s;
}

.related-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 4px 10px rgba(0,0,0,.1);
}

.related-card h3 {
  font-size: 1rem;
  margin-bottom: 0.4rem;
  color: var(--primary);
}

.related-card p {
  font-size: 0.875rem;
  color: #555;
}

/**
 * ===============================================
 * INFO BOX - IDENTICO A INDEX.HTML
 * ===============================================
 */
.info-box {
  padding: 2rem 1rem;
  background: var(--gray-100);
}

.info-box h2 {
  color: var(--laliga-red);
  margin-bottom: 1rem;
}

.info-box h3 {
  color: var(--laliga-red);
  margin-bottom: 1rem;
}

.info-box p {
  color: #000;
  margin-bottom: 20px;
}

.info-box .lead {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
}

.info-box ul,
.info-box ol {
  margin: 0 0 1rem 1.25rem;
}

.info-box blockquote {
  border-left: 4px solid var(--laliga-red);
  padding: 0.6rem 1rem;
  font-style: italic;
  background: var(--laliga-light);
  margin: 1rem 0;
}

/**
 * ===============================================
 * FOOTER - IDENTICO AI FILE HTML
 * ===============================================
 */
footer {
  background: var(--laliga-dark);
  color: var(--laliga-light);
  text-align: center;
  padding: 1.5rem 0.75rem;
  font-size: 0.85rem;
}

/**
 * ===============================================
 * RESPONSIVE - IDENTICO AI FILE HTML ORIGINALI
 * ===============================================
 */
@media(max-width: 600px) {
  .post-row {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .post-row img {
    width: 100%;
    height: auto;
  }
  
  .schedina th:nth-child(4),
  .schedina td:nth-child(4) {
    display: none;
  }
}

/**
 * ===============================================
 * PAYOUTS - PER SCHEDINA.HTML
 * ===============================================
 */
.payouts {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 1.25rem;
}

/**
 * ===============================================
 * WORDPRESS CORE COMPATIBILITY
 * ===============================================
 */
.wp-block-group {
  margin-bottom: 1.5rem;
}

.wp-block-image {
  margin-bottom: 1rem;
}

.alignwide {
  width: 100vw;
  position: relative;
  left: 50%;
  right: 50%;
  margin-left: -50vw;
  margin-right: -50vw;
}

.alignfull {
  width: 100vw;
  position: relative;
  left: 50%;
  right: 50%;
  margin-left: -50vw;
  margin-right: -50vw;
}