/*
Theme Name: PAO Theme
Theme URI: https://www.podisticaamatoriolbia.it/
Author: PAO
Description: Tema Custom, leggero e performante (senza Elementor/Bootstrap) basato sul design system di Podistica Amatori Olbia.
Version: 1.0.17
Text Domain: pao-theme
*/

/* PAO TEMPLATE - Design System from 42K Benchmark */
:root {
  --color-primary: #253b7d;
  --color-secondary: #4d5f95;
  --color-surface: #222222;
  --color-bg: #f3f3f3;
  --text-main: #5d5d5d;
  --white: #ffffff;
  
  --font-heading: 'Dosis', sans-serif;
  --font-body: 'Poppins', sans-serif;
}

/* Reset and Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: var(--font-body);
  color: var(--text-main);
  background-color: var(--color-bg);
  line-height: 1.6;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  text-transform: uppercase;
  color: var(--color-primary);
}

a {
  text-decoration: none;
  color: var(--color-surface);
}

/* Utility Classes */
.content {
  text-align: justify;
  text-justify: inter-word;
  hyphens: auto;
}
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}
.btn {
  display: inline-block;
  padding: 12px 24px;
  background-color: var(--color-primary);
  color: var(--white);
  font-family: var(--font-heading);
  font-weight: 600;
  text-transform: uppercase;
  transition: background-color 0.3s ease;
  cursor: pointer;
  border: none;
  text-align: center;
}
.btn:hover {
  background-color: var(--color-secondary);
}
.btn-outline {
  background-color: transparent;
  border: 2px solid var(--white);
  color: var(--white);
}
.btn-outline:hover {
  background-color: var(--white);
  color: var(--color-surface);
}

/* 1. Top Announcement Bar */
.top-bar {
  background-color: var(--color-primary);
  color: var(--white);
  text-align: center;
  padding: 8px 0;
  font-family: var(--font-heading);
  font-size: 0.9rem;
  letter-spacing: 1px;
}

/* 2. Header & Sticky Navigation */
.header {
  background-color: var(--color-primary);
  position: sticky;
  top: 0;
  z-index: 1000;
  padding: 15px 0;
  box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}
.header .container {
  display: flex;
  align-items: center;
  gap: 30px;
}
.logo {
  flex-shrink: 0;
  font-family: var(--font-heading);
  font-size: 1.8rem;
  font-weight: 700;
}
.navbar {
  flex-grow: 1;
  display: flex;
  justify-content: var(--nav-justify);
}
.nav-links {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 25px;
  margin: 0;
  padding: 0;
}
.nav-links li {
  position: relative;
}
.nav-links a {
  color: var(--nav-text);
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 10px 5px;
  display: block;
  transition: color 0.3s ease, opacity 0.3s ease;
}
.nav-links a:hover,
.nav-links a:focus-visible {
  color: var(--nav-hover);
  outline: 2px dashed var(--nav-hover);
  outline-offset: 4px;
}

/* Sottomenu (Dropdown) */
.nav-links .sub-menu {
  position: absolute;
  top: 100%;
  left: 0;
  background-color: var(--nav-bg, var(--color-primary));
  list-style: none;
  min-width: 220px;
  visibility: hidden;
  opacity: 0;
  transform: translateY(15px);
  transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s ease;
  z-index: 1000;
  box-shadow: 0 10px 25px rgba(0,0,0,0.15);
  padding: 10px 0;
  border-radius: 0 0 6px 6px;
  display: block;
}
.nav-links li:hover > .sub-menu,
.nav-links li:focus-within > .sub-menu {
  visibility: visible;
  opacity: 1;
  transform: translateY(0);
}
.nav-links .sub-menu li {
  width: 100%;
}
.nav-links .sub-menu a {
  padding: 10px 20px;
  font-size: 0.85rem;
}

.menu-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 2rem;
  cursor: pointer;
  margin-left: auto;
}
/* 3. Hero Section */
.hero {
  position: relative;
  height: 60vh;
  min-height: 400px;
  background-color: var(--color-primary);
  display: flex;
  align-items: center;
  overflow: hidden;
}
.hero img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 1;
}
.hero-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(38deg, rgba(0, 0, 0, 0.8) 0%, rgba(0, 0, 0, 0.2) 70%);
  z-index: 2;
}
.hero-content {
  position: relative;
  z-index: 3;
  color: var(--white);
  max-width: 700px;
}
.hero h1 {
  color: var(--white);
  font-size: 3.5rem;
  font-style: italic;
  margin-bottom: 20px;
  line-height: 1.1;
}
.hero-cta {
  display: flex;
  gap: 15px;
}
.hero-cta .btn-hero-1,
.hero-cta .btn-hero-2 {
  background-color: var(--bg);
  color: var(--text);
  border: 2px solid var(--bg);
}
.hero-cta .btn-hero-1:hover,
.hero-cta .btn-hero-2:hover {
  background-color: var(--hover-bg);
  color: var(--hover-text);
  border-color: var(--hover-bg);
}

/* 4. Griglia Notizie & Eventi (Card UI) */
.section {
  padding: 60px 0;
}
.section-title {
  position: relative;
  text-align: left;
  margin-bottom: 30px;
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--color-primary);
  display: block;
}
.section-title::before {
  content: '';
  display: block;
  width: 150px;
  height: 3px;
  background-color: var(--color-primary);
  margin-bottom: 15px;
}
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 30px;
}
.card {
  background-color: var(--white);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 4px 6px rgba(0,0,0,0.05);
  transition: transform 0.3s, box-shadow 0.3s;
  position: relative;
  display: flex;
  flex-direction: column;
}
.card:hover {
  transform: translateY(-5px);
  box-shadow: 12px 12px 50px rgba(0,0,0,0.1);
}
.card-img-wrapper {
  position: relative;
  height: 200px;
  overflow: hidden;
}
.card-img-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}
.card:hover .card-img-wrapper img {
  transform: scale(1.05);
}
.badge {
  position: absolute;
  top: 15px;
  right: 15px;
  background-color: var(--color-primary);
  color: var(--white);
  padding: 5px 10px;
  font-family: var(--font-heading);
  font-size: 0.8rem;
  border-radius: 4px;
}
.card-content {
  padding: 20px;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}
.card-date {
  font-size: 0.85rem;
  color: var(--color-secondary);
  font-weight: 600;
  margin-bottom: 5px;
}
.card-title {
  font-size: 1.25rem;
  margin-bottom: 10px;
  color: var(--color-surface);
}
.card-excerpt {
  font-size: 0.95rem;
  margin-bottom: 20px;
  flex-grow: 1;
  text-align: justify;
  text-justify: inter-word;
  hyphens: auto;
}

/* 4.5 Modulo Eventi in Evidenza */
.events-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}
.event-card {
  position: relative;
  aspect-ratio: 3/4;
  border-radius: 0;
  overflow: hidden;
  text-decoration: none;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.event-card-bg {
  position: absolute;
  top: 0; left: 0; width: 100%; height: 100%;
  background-size: cover;
  background-position: center;
  transition: transform 0.4s ease;
  z-index: 1;
}
.event-card:hover .event-card-bg {
  transform: scale(1.08);
}
.event-card-overlay {
  position: absolute;
  top: 0; left: 0; width: 100%; height: 100%;
  background: linear-gradient(to bottom, rgba(0,0,0,0.1) 0%, rgba(0,0,0,0.7) 100%);
  z-index: 2;
  transition: background 0.3s ease;
}
.event-card:hover .event-card-overlay {
  background: linear-gradient(to bottom, rgba(0,0,0,0) 0%, rgba(0,0,0,0.8) 100%);
}
.event-card-content {
  position: relative;
  z-index: 3;
  padding: 30px 20px 20px 20px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 100%;
  text-align: center;
}
.event-card-title {
  color: #fff;
  font-family: var(--font-heading);
  font-size: 1.8rem;
  font-weight: 700;
  line-height: 1.1;
  margin: 0;
  text-shadow: 1px 1px 3px rgba(0,0,0,0.6);
}
.event-card-btn {
  align-self: stretch;
  width: 100%;
  padding: 15px 20px;
  font-size: 1rem;
  font-weight: 700;
  border-radius: 0;
  transition: opacity 0.3s ease, background-color 0.3s ease;
}
.event-card:hover .event-card-btn {
  opacity: 1;
}

/* ==========================================================================
   6. SOCIAL STRIP
   ========================================================================== */
.social-strip {
  /* background & padding inline with style attribute in template */
}
.social-grid {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 3rem;
  flex-wrap: wrap;
}
.social-item {
  display: flex;
  align-items: center;
  gap: 15px;
  text-decoration: none;
  transition: transform 0.3s ease, opacity 0.3s ease;
}
.social-item:hover {
  transform: translateY(-2px);
  opacity: 0.8;
}
.social-icon svg {
  display: block;
}
.social-text {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}
.social-label {
  font-size: 0.75rem;
  color: var(--text-main);
  text-transform: uppercase;
}
.social-name {
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 700;
  color: var(--color-primary);
  text-transform: uppercase;
}

/* ==========================================================================
   7. MEDIA QUERIES
   ========================================================================== */
@media (max-width: 991px) {
  .events-grid { grid-template-columns: repeat(2, 1fr); }
  .social-grid { gap: 1.5rem; justify-content: flex-start; }
}
@media (max-width: 768px) {
  .menu-toggle {
    display: block;
  }
  .navbar {
    position: fixed;
    top: 0;
    right: -300px;
    width: 280px;
    height: 100vh;
    background-color: var(--nav-bg);
    flex-direction: column;
    justify-content: flex-start;
    padding: 80px 30px;
    transition: right 0.3s ease;
    z-index: 1000;
    box-shadow: -5px 0 15px rgba(0,0,0,0.1);
  }
  .navbar.active {
    right: 0;
  }
  .nav-links {
    flex-direction: column;
    align-items: flex-start;
    width: 100%;
  }
  .nav-links a {
    font-size: 1.2rem;
    padding: 15px 0;
    width: 100%;
    border-bottom: 1px solid rgba(255,255,255,0.1);
  }
  /* Fix sub-menu per mobile */
  .nav-links .sub-menu {
    position: static;
    visibility: visible;
    opacity: 1;
    transform: none;
    box-shadow: none;
    background-color: transparent;
    padding: 10px 0 10px 20px;
    width: 100%;
    display: block;
  }
  .nav-links .sub-menu a {
    font-size: 1rem;
    padding: 10px 0;
    border-bottom: 1px solid rgba(255,255,255,0.05);
  }
}
@media (max-width: 575px) {
  .events-grid { grid-template-columns: 1fr; }
  .social-grid { flex-direction: column; align-items: flex-start; }
}

/* 5. Footer */
.footer {
  background-color: var(--color-primary);
  color: var(--white);
  padding: 60px 0 20px;
}
.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 40px;
  margin-bottom: 40px;
}
.footer-col h4 {
  color: var(--white);
  margin-bottom: 20px;
}
.footer-col ul {
  list-style: none;
}
.footer-col li {
  margin-bottom: 8px;
}
.footer-col a {
  color: #999999;
  transition: color 0.3s;
}
.footer-col a:hover {
  color: var(--color-secondary);
}
.footer-bottom {
  text-align: center;
  padding-top: 20px;
  border-top: 1px solid #444;
  color: #999999;
  font-size: 0.85rem;
}

/* 6. Tabelle Classifiche (Responsive) */
.table-responsive {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin-bottom: 30px;
  box-shadow: 0 4px 6px rgba(0,0,0,0.05);
  border-radius: 8px;
}
.table {
  width: 100%;
  border-collapse: collapse;
  min-width: 600px;
  background-color: var(--white);
}
.table th, .table td {
  padding: 12px 15px;
  border-bottom: 1px solid #eee;
  text-align: left;
}
.table th {
  background-color: var(--color-primary);
  color: var(--white);
  font-family: var(--font-heading);
  letter-spacing: 1px;
}
.table tr:last-child td {
  border-bottom: none;
}
.table tr:hover {
  background-color: var(--color-bg);
}


/* 7. Filtri Interattivi */
.filters {
  display: flex;
  justify-content: center;
  gap: 15px;
  margin-bottom: 30px;
  flex-wrap: wrap;
}
.filter-btn {
  background-color: var(--white);
  border: 1px solid #ddd;
  padding: 8px 16px;
  font-family: var(--font-heading);
  font-weight: 600;
  text-transform: uppercase;
  cursor: pointer;
  border-radius: 20px;
  transition: all 0.3s ease;
  color: var(--text-main);
}
.filter-btn:hover, .filter-btn.active {
  background-color: var(--color-primary);
  color: var(--white);
  border-color: var(--color-primary);
}

/* 8. Modale */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 2000;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}
.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}
.modal-content {
  background: var(--white);
  padding: 30px;
  border-radius: 8px;
  width: 90%;
  max-width: 500px;
  position: relative;
  transform: translateY(20px);
  transition: transform 0.3s ease;
}
.modal-overlay.active .modal-content {
  transform: translateY(0);
}
.modal-close {
  position: absolute;
  top: 15px;
  right: 15px;
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--text-main);
  transition: color 0.3s;
}
.modal-close:hover {
  color: var(--color-primary);
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
  .navbar {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background-color: var(--color-primary);
    flex-direction: column;
    padding: 20px;
    gap: 15px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
  }
  .navbar.active {
    display: flex;
  }
  .menu-toggle {
    display: block;
  }
  .hero h1 {
    font-size: 2.5rem;
  }
  .hero-cta {
    flex-direction: column;
  }
  .hero-cta .btn {
    width: 100%;
  }
}


/* 8. Hero Slider Extension */
.hero {
  position: relative;
  overflow: hidden;
}
.hero-slides-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
}
.hero-slide {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 1.5s ease-in-out;
}
.hero-slide.is-active {
  opacity: 1;
}
.hero-overlay {
  z-index: 2;
}
.hero-content {
  z-index: 3;
  position: relative;
}

.hero-dots {
  position: absolute;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 12px;
  z-index: 4;
}
.hero-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background-color: transparent;
  border: 2px solid var(--white);
  cursor: pointer;
  padding: 0;
  transition: all 0.3s ease;
  opacity: 0.7;
}
.hero-dot.is-active, .hero-dot:hover {
  background-color: var(--white);
  opacity: 1;
  transform: scale(1.2);
  }

/* 9. Back to Top Button */
.back-to-top {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 50px;
  height: 50px;
  background-color: var(--white);
  border-radius: 50%;
  box-shadow: 0 4px 10px rgba(0,0,0,0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px);
  transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s ease;
}

.back-to-top.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.back-to-top:hover {
  box-shadow: 0 6px 15px rgba(0,0,0,0.3);
  transform: translateY(-3px);
}

.progress-circle {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.progress-background {
  fill: none;
  stroke: #e0e0e0;
  stroke-width: 8;
}

.progress-bar {
  fill: none;
  stroke: var(--color-secondary);
  stroke-width: 8;
  stroke-linecap: round;
  stroke-dasharray: 289;
  stroke-dashoffset: 289;
  transition: stroke-dashoffset 0.1s ease-out;
}

.chevron-up {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: var(--text-main);
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  z-index: 2;
  transition: stroke 0.3s ease;
}

.back-to-top:hover .chevron-up {
  stroke: var(--color-primary);
}
