/*
Theme Name: SIRAC Maestrale
Theme URI: https://www.sirac.it/
Author: SIRAC S.r.l.
Description: Tema SIRAC in stile Maestrale che riusa i contenuti ACF e i menu del sito esistente.
Version: 1.1
License: GNU General Public License v2 or later
Text Domain: sirac-maestrale
*/

/* Variables & Reset */
:root {
  /* Sirac Identity Colors (Updated to Green) */
  --color-primary: #009B4D; /* Sirac Green (Estimated) */
  --color-primary-light: #00b359; /* Lighter interactions */
  --color-secondary: #003366; /* Deep Navy as Secondary */
  --color-accent: #ff6b6b; /* Warm accent if needed */

  /* Neutral Tone (Maestrale Cleanliness) */
  --color-text: #1a1a1a;
  --color-text-light: #666666;
  --color-bg-light: #f8f9fa;
  --color-bg-white: #ffffff;
  --color-border: #e1e4e8;

  /* Shadows & Radius (Modern Feel) */
  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 8px 16px rgba(0, 0, 0, 0.08); /* Soft Maestrale-like shadow */
  --shadow-lg: 0 16px 32px rgba(0, 0, 0, 0.12); /* Hover state */
  --radius-md: 8px;
  --radius-lg: 16px; /* Larger radius for cards */

  /* Spacing */
  --container-width: 1200px;
  --header-height: 104px;
  --section-padding: 80px 0;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family:
    "Inter",
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    Roboto,
    sans-serif;
  color: var(--color-text);
  line-height: 1.6;
  background-color: var(--color-bg-white);
}

a {
  text-decoration: none;
  color: inherit;
  transition: all 0.3s ease;
}

ul {
  list-style: none;
}

img {
  max-width: 100%;
  display: block;
}

/* Utilities */
.container {
  max-width: var(--container-width);
  margin: 0 auto;
  padding: 0 20px;
}

.text-center {
  text-align: center;
}
.bg-light {
  background-color: var(--color-bg-light);
}
.bg-primary {
  background-color: var(--color-primary);
}
.text-white {
  color: white;
}

/* Buttons */
.btn {
  display: inline-block;
  padding: 12px 32px;
  border-radius: 50px; /* Pill shape */
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.3s ease;
}

.btn-primary {
  background-color: var(--color-primary);
  color: white;
  border: 2px solid var(--color-primary);
}

.btn-primary:hover {
  background-color: var(--color-primary-light);
  border-color: var(--color-primary-light);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.btn-outline {
  background-color: transparent;
  color: white;
  border: 2px solid white;
  margin-left: 10px;
}

.btn-outline:hover {
  background-color: white;
  color: var(--color-primary);
  transform: translateY(-2px);
}

/* Header */
.header {
  background-color: rgba(255, 255, 255, 0.98);
  height: var(--header-height);
  position: fixed;
  width: 100%;
  top: 0;
  z-index: 1000;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05); /* Softer shadow */
  backdrop-filter: blur(10px);
}

.header-container {
  height: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--color-primary);
  letter-spacing: -0.5px;
  display: flex;
  align-items: center; 
}

.logo img {
    height: 62px;
    width: auto;
    max-width: none;
}

.nav {
  display: flex;
  align-items: center;
}

.nav-list {
  display: flex;
  gap: 30px; /* Wider gap for cleaner look */
  align-items: center;
  flex-wrap: nowrap;
}

.nav-link {
  font-weight: 600;
  font-size: 0.85rem; /* Smaller, sharper */
  text-transform: uppercase; /* Maestrale style */
  letter-spacing: 1px;
  color: #333; /* Darker grey for contrast */
  position: relative;
  padding: 5px 0;
  transition: color 0.2s ease;
}

.nav-link::after {
  content: "";
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background-color: var(--color-primary);
  transition: width 0.3s ease;
}

.nav-link:hover {
    color: var(--color-primary);
}

.nav-link:hover::after {
  width: 100%;
}

.nav-link.active {
  color: var(--color-primary);
  font-weight: 700;
}

/* Voce di menu della pagina corrente: sottolineatura verde sempre visibile */
.nav-link.active::after {
  width: 100%;
}

.mobile-menu-btn {
  display: none;
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--color-text);
}

/* Hero Section */
.hero {
  height: 90vh;
  background-color: var(--color-primary); /* fallback while image loads */
  position: relative;
  overflow: hidden; /* keep the zooming image contained */
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  text-align: center;
  margin-top: var(--header-height);
}

/* Animated cover image (slow Ken Burns zoom/pan for subtle movement) */
.hero::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: url("https://images.unsplash.com/photo-1451187580459-43490279c0fa?ixlib=rb-1.2.1&auto=format&fit=crop&w=1920&q=80");
  background-size: cover;
  background-position: center;
  z-index: 0;
  transform: scale(1);
  animation: heroKenBurns 9s ease-in-out infinite alternate;
}

@keyframes heroKenBurns {
  from {
    transform: scale(1) translate(0, 0);
  }
  to {
    transform: scale(1.12) translate(-1.5%, -1.5%);
  }
}

.hero-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  background: linear-gradient(
        135deg,
        rgba(152, 214, 152, 0.95),
        rgba(112, 192, 112, 0.95)
    );
    opacity: 0.6;
}

.hero-content {
  position: relative;
  z-index: 2;
  max-width: 800px;
}

/* Hero text/buttons fade in on load, one after another */
.hero-title,
.hero-subtitle,
.hero-buttons {
  opacity: 0;
  animation: heroFadeUp 1.6s ease forwards;
}

.hero-title {
  animation-delay: 0.4s;
}
.hero-subtitle {
  animation-delay: 1s;
}
.hero-buttons {
  animation-delay: 1.6s;
}

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

/* Scroll Reveal (sections/cards slide in from different directions) */
.reveal {
  opacity: 0;
  transition:
    opacity 0.8s ease,
    transform 0.8s ease;
  will-change: opacity, transform;
}

.reveal-up {
  transform: translateY(45px);
}
.reveal-down {
  transform: translateY(-45px);
}
.reveal-left {
  transform: translateX(-60px);
}
.reveal-right {
  transform: translateX(60px);
}

.reveal.is-visible {
  opacity: 1;
  transform: translate(0, 0);
}

/* Stagger delays */
.delay-1 {
  transition-delay: 0.1s;
}
.delay-2 {
  transition-delay: 0.25s;
}
.delay-3 {
  transition-delay: 0.4s;
}
.delay-4 {
  transition-delay: 0.55s;
}

/* Accessibility: respect users who prefer reduced motion */
@media (prefers-reduced-motion: reduce) {
  .hero::before {
    animation: none;
  }
  .hero-title,
  .hero-subtitle,
  .hero-buttons,
  .reveal {
    animation: none;
    opacity: 1;
    transform: none;
    transition: none;
  }
}

.hero-title {
  font-size: 3.5rem;
  font-weight: 800;
  margin-bottom: 20px;
  line-height: 1.2;
}

.hero-subtitle {
  font-size: 1.25rem;
  margin-bottom: 40px;
  opacity: 0.95;
}

/* General Section */
.section {
  padding: var(--section-padding);
}

.section-header {
  margin-bottom: 60px;
  max-width: 700px;
  margin-left: auto;
  margin-right: auto;
}

.section-title {
  font-size: 2.5rem;
  color: var(--color-primary);
  margin-bottom: 15px;
  font-weight: 700;
}

.section-subtitle {
  color: var(--color-text-light);
  font-size: 1.1rem;
}

/* Split Section (Azienda) */
.row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 40px;
}

.align-center {
  align-items: center;
}

.col-text,
.col-image {
  flex: 1;
  min-width: 300px;
}

.section-text {
  color: var(--color-text-light);
  margin-bottom: 30px;
}

.feature-list li {
  margin-bottom: 15px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 500;
}

.feature-list i {
  color: var(--color-secondary);
}

.responsive-img {
  width: 100%;
  height: auto;
}

.rounded-shadow {
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
}

/* Cards (Soluzioni) */
.grid-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 30px;
}

.card {
  background: white;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  transition: all 0.3s ease;
  border: 1px solid rgba(0, 0, 0, 0.03); /* Subtle border */
  display: flex;
  flex-direction: column;
}

.card:hover {
  transform: translateY(-10px);
  box-shadow: var(--shadow-lg);
}

.card-image {
  height: 200px;
  overflow: hidden;
}

.card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.card:hover .card-image img {
  transform: scale(1.05); /* Zoom effect on image */
}

.card-content {
  padding: 30px;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}

.card-icon {
  width: 50px;
  height: 50px;
  background-color: rgba(0, 168, 232, 0.1);
  color: var(--color-primary);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  margin-bottom: 20px;
}

.card:hover .card-icon {
  background-color: var(--color-primary);
  color: white;
}

.card-title {
  font-size: 1.25rem;
  margin-bottom: 10px;
  color: var(--color-primary);
}

.card-text {
  color: var(--color-text-light);
  font-size: 0.95rem;
  margin-bottom: 25px;
  line-height: 1.6;
  flex-grow: 1;
}

.card-link {
  font-weight: 600;
  color: var(--color-primary);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
}

.card-link:hover {
  color: var(--color-secondary);
  gap: 12px; /* Arrow moves */
}

/* Stats Section */
.grid-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 30px;
}

.stat-number {
  font-size: 3rem;
  font-weight: 800;
  margin-bottom: 10px;
  color: var(--color-secondary);
}

.stat-label {
  font-size: 1.1rem;
  opacity: 0.9;
}

/* Footer */
.footer {
  background-color: #112;
  color: white;
  padding-top: 80px;
}

.grid-footer {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 50px;
  padding-bottom: 50px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-logo {
  font-size: 1.8rem;
  font-weight: 700;
  margin-bottom: 20px;
}

.footer-logo span {
  color: var(--color-secondary);
}

.footer-col h4 {
  font-size: 1.2rem;
  margin-bottom: 25px;
  color: white;
}

.footer-col ul li {
  margin-bottom: 12px;
}

.footer-col ul li a,
.contact-info li {
  color: #a0a0a0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.footer-col ul li a:hover {
  color: white;
  padding-left: 5px;
}

.social-links {
  margin-top: 25px;
  display: flex;
  gap: 15px;
}

.social-links a {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s;
}

.social-links a:hover {
  background: var(--color-primary);
}

.footer-bottom {
  padding: 25px 0;
  font-size: 0.9rem;
  color: #666;
}

/* ---- Footer color variants ---- */
/* White footer (used on the Home page) */
.footer--light {
  background-color: var(--color-bg-white);
  color: var(--color-text);
  border-top: 1px solid var(--color-border);
}
.footer--light .grid-footer {
  border-bottom-color: var(--color-border);
}
.footer--light p,
.footer--light .footer-col ul li a,
.footer--light .contact-info li {
  color: var(--color-text-light);
}
.footer--light .footer-col h4 {
  color: var(--color-text);
}
.footer--light .footer-col ul li a:hover {
  color: var(--color-primary);
}
.footer--light .social-links a {
  background: rgba(0, 0, 0, 0.06);
  color: var(--color-text);
}
.footer--light .social-links a:hover {
  background: var(--color-primary);
  color: #fff;
}
.footer--light .footer-bottom {
  color: var(--color-text-light);
}

/* Green separation strip above the white footer (used on inner pages,
   not on the Home where it's already separated by the light border) */
.footer--sep-green {
  border-top: 4px solid var(--color-primary);
}

/* Green footer (brand color, used on Servizi page) */
.footer--green {
  background-color: var(--color-primary);
  color: #fff;
}
.footer--green .grid-footer {
  border-bottom-color: rgba(255, 255, 255, 0.25);
}
.footer--green p,
.footer--green .footer-col ul li a,
.footer--green .contact-info li {
  color: rgba(255, 255, 255, 0.88);
}
.footer--green .footer-col h4 {
  color: #fff;
}
.footer--green .footer-col ul li a:hover {
  color: #fff;
}
.footer--green .social-links a {
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
}
.footer--green .social-links a:hover {
  background: #fff;
  color: var(--color-primary);
}
.footer--green .footer-bottom {
  color: rgba(255, 255, 255, 0.75);
}

/* Responsive */
@media (max-width: 992px) {
  .hero-title {
    font-size: 2.8rem;
  }
}

@media (max-width: 768px) {
  .nav {
    position: absolute;
    top: var(--header-height);
    left: 0;
    width: 100%;
    background: white;
    padding: 20px;
    box-shadow: var(--shadow-md);
    transform: translateY(-150%); /* Hidden by default */
    transition: transform 0.3s ease;
    z-index: 999;
    flex-direction: column;
    justify-content: center;
  }

  .nav.active {
    transform: translateY(0);
  }

  .nav-list {
    flex-direction: column;
    align-items: center;
    gap: 20px;
  }

  .mobile-menu-btn {
    display: block;
  }

  .hero-title {
    font-size: 2.2rem;
  }

  .row {
    flex-direction: column;
  }

  .grid-stats,
  .grid-footer {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .footer-col ul li a,
  .contact-info li,
  .social-links {
    justify-content: center;
  }

  .hero-buttons {
    display: flex;
    flex-direction: column;
    gap: 15px;
  }

  .btn-outline {
    margin-left: 0;
  }
}

/* Page Headers (Sub-pages) */
.page-header {
    height: 350px;
    background-size: cover;
    background-position: center;
    background-color: var(--color-primary); /* Green fallback */
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: white;
    margin-top: var(--header-height);
}

.page-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        135deg, 
        rgba(152, 214, 152, 0.95), 
        rgba(112, 192, 112, 0.95)
    );
    opacity: 0.6;
    z-index: 1;
}

.page-header .container {
    position: relative;
    z-index: 2;
}

.page-title {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 10px;
}

.page-subtitle {
    font-size: 1.2rem;
    opacity: 0.9;
}

/* Nav Extra & Small Buttons */
.nav-extra {
    margin-left: 20px;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 0.85rem;
}

.btn-outline-primary {
    color: var(--color-primary);
    border: 2px solid var(--color-primary);
    background: transparent;
}

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

/* Update Nav for responsive button */
@media (max-width: 992px) {
    .nav-list {
        gap: 15px;
    }
    .nav-extra {
        display: none; /* Hide button in nav list on tablet */
    }
}

@media (max-width: 768px) {
    .nav-extra {
        display: block;
        margin: 20px 0;
    }
    .page-title { font-size: 2.2rem; }
}

.btn-dark:hover {
    background: #333;
    color: white;
}

/* Product Page Anchors & Categories */
.anchor-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    margin-bottom: 60px;
    padding: 20px;
    background: var(--color-bg-light);
    border-radius: var(--radius-md);
}

.anchor-link {
    display: inline-block;
    padding: 8px 16px;
    background: white;
    border: 1px solid var(--color-border);
    border-radius: 20px;
    color: var(--color-text);
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s ease;
    cursor: pointer;
}

.anchor-link:hover,
.anchor-link.active {
    background: var(--color-primary);
    color: white;
    border-color: var(--color-primary);
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

.category-section {
    margin-bottom: 80px;
    padding-top: 20px; /* Offset for sticky header if needed */
}

.category-title {
    font-size: 2rem;
    color: var(--color-primary);
    margin-bottom: 30px;
    position: relative;
    padding-bottom: 15px;
}

.category-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 60px;
    height: 3px;
    background: var(--color-secondary);
}

.category-title strong {
    font-weight: 800;
}

.prodotti-desc {
    text-align: center;
    max-width: 800px;
    margin: 0 auto 40px;
    font-size: 1.1rem;
    color: var(--color-text-light);
}

/* Mobile optimizations for anchors */
@media (max-width: 768px) {
    .anchor-nav {
        flex-wrap: nowrap;
        overflow-x: auto;
        justify-content: flex-start;
        padding-bottom: 15px;
        -webkit-overflow-scrolling: touch;
    }
    .anchor-link {
        white-space: nowrap;
    }
}

/* ---- Form (contatti / area riservata) ---- */
.sirac-form{background:var(--color-bg-light);border:1px solid var(--color-border);border-radius:var(--radius-md);padding:30px;}
.sirac-form .form-row{display:flex;gap:20px;flex-wrap:wrap;}
.sirac-form .form-field{flex:1;min-width:220px;margin-bottom:18px;display:flex;flex-direction:column;}
.sirac-form label{font-weight:600;font-size:.85rem;margin-bottom:6px;color:var(--color-text);}
.sirac-form input,.sirac-form textarea{border:1px solid var(--color-border);border-radius:8px;padding:12px 14px;font-family:inherit;font-size:1rem;background:#fff;width:100%;}
.sirac-form input:focus,.sirac-form textarea:focus{outline:none;border-color:var(--color-primary);}
.sirac-form textarea{min-height:140px;resize:vertical;}
.sirac-form .form-acceptance{margin:10px 0 20px;font-size:.9rem;color:var(--color-text-light);}
.sirac-form .form-acceptance a{color:var(--color-primary);text-decoration:underline;}
.news-date{font-size:.85rem;color:var(--color-text-light);margin-bottom:8px;}
.page-content{line-height:1.7;}
.page-content h2{color:var(--color-primary);margin:25px 0 12px;}
.page-content h3{margin:20px 0 10px;}
.page-content p{margin-bottom:15px;}
.page-content img{border-radius:var(--radius-md);height:auto;}
.page-content ul{margin:0 0 15px 20px;list-style:disc;}
.page-content a{color:var(--color-primary);text-decoration:underline;}

/* ---- Validazione form ---- */
.sirac-form .obbligo{border-color:#c0392b !important;background:#fff6f6;}

/* ---- Hero: bottoni un po' piu' staccati dal testo ---- */
.hero-buttons{margin-top:24px;}

/* ---- Contatti: form + mappa affiancati ---- */
.contatti-grid{display:flex;flex-wrap:wrap;gap:40px;align-items:stretch;}
.contatti-grid .contatti-col{flex:1;min-width:300px;}
.sirac-map{width:100%;height:100%;min-height:460px;border:0;border-radius:var(--radius-md);box-shadow:var(--shadow-md);display:block;}
@media (max-width:768px){.sirac-map{min-height:320px;}}
