/*
Theme Name: Arty SRLS Solar
Theme URI: https://artysrls.it
Author: Arty SRLS
Author URI: https://artysrls.it
Description: Tema one-page per Arty SRLS — installazione impianti fotovoltaici. Design moderno con galleria lightbox, sezione servizi, chi siamo, e modulo contatti.
Version: 2.4.0
Requires at least: 6.0
Tested up to: 6.7
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: arty-solar
Tags: one-page, solar, photovoltaic, business, gallery, lightbox, responsive
*/

/* ═══════════════════════════════════════════
   CSS VARIABLES (matching React index.css)
   ═══════════════════════════════════════════ */
:root {
  --background: 40 33% 98%;
  --foreground: 220 25% 12%;
  --card: 40 20% 97%;
  --card-foreground: 220 25% 12%;
  --primary: 36 85% 52%;
  --primary-foreground: 0 0% 100%;
  --secondary: 210 55% 20%;
  --secondary-foreground: 0 0% 100%;
  --muted: 40 15% 93%;
  --muted-foreground: 220 10% 46%;
  --accent: 36 85% 52%;
  --accent-foreground: 0 0% 100%;
  --border: 40 15% 88%;
  --ring: 36 85% 52%;
  --radius: 0.75rem;
  --solar-gold: 36 85% 52%;
  --solar-gold-light: 40 80% 70%;
  --solar-amber: 30 90% 48%;
  --navy: 210 55% 20%;
  --navy-deep: 215 60% 12%;
  --sky: 200 60% 94%;
  --leaf: 145 45% 42%;
}

/* ═══════════════════════════════════════════
   RESET & BASE
   ═══════════════════════════════════════════ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  font-family: 'DM Sans', system-ui, -apple-system, sans-serif;
  background: hsl(var(--background));
  color: hsl(var(--foreground));
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
  font-family: 'Playfair Display', serif;
  line-height: 1.2;
}

img { max-width: 100%; height: auto; display: block; }
a { text-decoration: none; color: inherit; }

.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* ═══════════════════════════════════════════
   UTILITY CLASSES
   ═══════════════════════════════════════════ */
.text-gradient-solar {
  background-image: linear-gradient(135deg, hsl(var(--solar-gold)), hsl(var(--solar-amber)));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.bg-gradient-solar {
  background-image: linear-gradient(135deg, hsl(var(--solar-gold)), hsl(var(--solar-amber)));
}

.bg-gradient-navy {
  background-image: linear-gradient(135deg, hsl(var(--navy)), hsl(var(--navy-deep)));
}

.shadow-solar {
  box-shadow: 0 10px 40px -10px hsl(var(--solar-gold) / 0.3);
}

/* ═══════════════════════════════════════════
   ANIMATIONS
   ═══════════════════════════════════════════ */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

.animate-fade-up {
  animation: fadeUp 0.6s ease forwards;
  opacity: 0;
}
.animate-delay-1 { animation-delay: 0.1s; }
.animate-delay-2 { animation-delay: 0.3s; }
.animate-delay-3 { animation-delay: 0.5s; }
.animate-delay-4 { animation-delay: 0.7s; }

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

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

/* ═══════════════════════════════════════════
   HEADER / NAVBAR
   ═══════════════════════════════════════════ */
.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 50;
  background: hsl(var(--navy-deep) / 0.8);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid hsl(0 0% 100% / 0.05);
  transition: background 0.3s, box-shadow 0.3s;
}

.site-header.scrolled {
  background: hsl(var(--navy-deep) / 0.95);
  box-shadow: 0 4px 20px hsl(var(--navy-deep) / 0.3);
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 5rem;
}

.site-logo {
  font-family: 'Playfair Display', serif;
  font-size: 2.25rem;
  font-weight: 700;
  color: hsl(var(--primary));
  letter-spacing: 0.01em;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 2rem;
}

.main-nav a {
  color: hsl(0 0% 100% / 0.7);
  font-weight: 500;
  transition: color 0.2s;
}

.main-nav a:hover {
  color: hsl(var(--solar-gold));
}

.btn-preventivo {
  background-image: linear-gradient(135deg, hsl(var(--solar-gold)), hsl(var(--solar-amber)));
  color: hsl(var(--primary-foreground)) !important;
  padding: 0.625rem 1.25rem;
  border-radius: var(--radius);
  font-weight: 600;
  box-shadow: 0 10px 40px -10px hsl(var(--solar-gold) / 0.3);
  transition: transform 0.2s;
}

.btn-preventivo:hover {
  transform: scale(1.05);
}

.menu-toggle {
  display: none;
  background: none;
  border: none;
  color: hsl(var(--primary-foreground));
  font-size: 1.5rem;
  cursor: pointer;
}

/* ═══════════════════════════════════════════
   HERO SECTION
   ═══════════════════════════════════════════ */
.hero-section {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: 0;
}

.hero-bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to right, hsl(var(--navy-deep) / 0.9), hsl(var(--navy) / 0.7), transparent);
}

.hero-content {
  position: relative;
  z-index: 10;
  padding-top: 8rem;
  padding-bottom: 8rem;
  max-width: 42rem;
}

.hero-subtitle {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: hsl(var(--solar-gold-light));
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 0.875rem;
}

.hero-subtitle .icon-sun {
  color: hsl(var(--solar-gold));
  font-size: 1.25rem;
}

.hero-title {
  font-size: clamp(2.5rem, 6vw, 4.5rem);
  font-weight: 700;
  color: hsl(var(--primary-foreground));
  line-height: 1.1;
  margin-top: 1.5rem;
}

.hero-desc {
  font-size: 1.125rem;
  line-height: 1.7;
  color: hsl(40 20% 80%);
  max-width: 32rem;
  margin-top: 1.5rem;
}

.hero-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 2rem;
}

.btn-primary {
  display: inline-block;
  background-image: linear-gradient(135deg, hsl(var(--solar-gold)), hsl(var(--solar-amber)));
  color: hsl(var(--primary-foreground));
  padding: 1rem 2rem;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 1.125rem;
  box-shadow: 0 10px 40px -10px hsl(var(--solar-gold) / 0.3);
  transition: transform 0.3s;
  border: none;
  cursor: pointer;
  text-align: center;
}

.btn-primary:hover { transform: scale(1.05); }

.btn-outline {
  display: inline-block;
  border: 2px solid hsl(var(--solar-gold) / 0.4);
  color: hsl(var(--solar-gold-light));
  padding: 1rem 2rem;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 1.125rem;
  transition: background 0.3s;
  text-align: center;
}

.btn-outline:hover { background: hsl(var(--solar-gold) / 0.1); }

.hero-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
  padding-top: 2rem;
  margin-top: 2rem;
  border-top: 1px solid hsl(0 0% 100% / 0.1);
}

.hero-stats .stat-value {
  font-family: 'Playfair Display', serif;
  font-size: clamp(1.5rem, 3vw, 2.25rem);
  font-weight: 700;
  color: hsl(var(--solar-gold));
}

.hero-stats .stat-label {
  font-size: 0.875rem;
  color: hsl(40 20% 70%);
  margin-top: 0.25rem;
}

/* ═══════════════════════════════════════════
   SECTION SHARED STYLES
   ═══════════════════════════════════════════ */
.section-header {
  text-align: center;
  max-width: 42rem;
  margin: 0 auto 4rem;
}

.section-label {
  color: hsl(var(--primary));
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 0.875rem;
}

.section-title {
  font-size: clamp(1.75rem, 4vw, 3rem);
  font-weight: 700;
  color: hsl(var(--foreground));
  margin-top: 0.75rem;
}

.section-desc {
  color: hsl(var(--muted-foreground));
  font-size: 1.125rem;
  margin-top: 1rem;
}

/* ═══════════════════════════════════════════
   SERVICES SECTION
   ═══════════════════════════════════════════ */
.services-section {
  padding: 6rem 0;
  background: hsl(var(--background));
}

.services-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
}

.service-card {
  background: hsl(var(--card));
  border-radius: var(--radius);
  padding: 2rem;
  border: 1px solid hsl(var(--border));
  transition: box-shadow 0.3s, transform 0.3s;
}

.service-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 60px -15px hsl(var(--foreground) / 0.12);
}

.service-icon {
  width: 3.5rem;
  height: 3.5rem;
  border-radius: var(--radius);
  background-image: linear-gradient(135deg, hsl(var(--solar-gold)), hsl(var(--solar-amber)));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  margin-bottom: 1.5rem;
  transition: transform 0.3s;
}

.service-card:hover .service-icon { transform: scale(1.1); }

.service-card h3 {
  font-size: 1.25rem;
  font-weight: 700;
  color: hsl(var(--foreground));
  margin-bottom: 0.75rem;
}

.service-card p {
  color: hsl(var(--muted-foreground));
  line-height: 1.6;
}

/* ═══════════════════════════════════════════
   GALLERY SECTION
   ═══════════════════════════════════════════ */
.gallery-section {
  padding: 6rem 0;
  background: hsl(var(--muted) / 0.5);
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
}

.gallery-item {
  position: relative;
  aspect-ratio: 4 / 3;
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s;
}

.gallery-item:hover img {
  transform: scale(1.1);
}

.gallery-item .caption {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, hsl(var(--navy-deep) / 0.8), transparent, transparent);
  display: flex;
  align-items: flex-end;
  padding: 2.75rem;
  opacity: 0;
  transition: opacity 0.3s;
}

.gallery-item:hover .caption {
  opacity: 1;
}

.gallery-item .caption span {
  color: hsl(var(--primary-foreground));
  font-weight: 600;
  font-size: 1.125rem;
}

/* ═══════════════════════════════════════════
   LIGHTBOX
   ═══════════════════════════════════════════ */
.gallery-lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: hsl(var(--navy-deep) / 0.95);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}

.gallery-lightbox.active {
  opacity: 1;
  pointer-events: auto;
}

.gallery-lightbox img {
  max-width: 100%;
  max-height: 85vh;
  border-radius: var(--radius);
  object-fit: contain;
  animation: scaleIn 0.3s ease;
}

.lightbox-close {
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
  background: none;
  border: none;
  color: hsl(0 0% 100% / 0.8);
  font-size: 2rem;
  cursor: pointer;
  transition: color 0.2s;
  z-index: 101;
}

.lightbox-close:hover { color: hsl(var(--primary-foreground)); }

.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: hsl(0 0% 100% / 0.1);
  backdrop-filter: blur(4px);
  border: 1px solid hsl(0 0% 100% / 0.15);
  color: hsl(var(--primary-foreground));
  font-size: 2rem;
  width: 3rem;
  height: 3rem;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
  z-index: 101;
}

.lightbox-nav:hover { background: hsl(0 0% 100% / 0.2); }
.lightbox-prev { left: 1.5rem; }
.lightbox-next { right: 1.5rem; }

.lightbox-caption {
  position: absolute;
  bottom: 2rem;
  text-align: center;
  width: 100%;
  color: hsl(var(--primary-foreground));
  font-weight: 600;
  font-size: 1.125rem;
}

/* ═══════════════════════════════════════════
   ABOUT SECTION
   ═══════════════════════════════════════════ */
.about-section {
  padding: 6rem 0;
  background: hsl(var(--background));
}

.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: center;
}

.about-text .section-label { display: block; margin-bottom: 0.5rem; }

.about-text .section-title {
  text-align: left;
  margin-top: 0.75rem;
}

.about-text .section-desc {
  text-align: left;
  margin-top: 1.5rem;
  line-height: 1.7;
}

.check-list {
  list-style: none;
  margin-top: 2rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.check-list li {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  color: hsl(var(--foreground));
}

.check-list li::before {
  content: "✓";
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.5rem;
  height: 1.5rem;
  color: hsl(var(--primary));
  font-weight: 700;
  margin-top: 0.125rem;
}

.stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
}

.stat-card {
  border-radius: var(--radius);
  padding: 2rem;
  color: hsl(var(--primary-foreground));
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  aspect-ratio: 1;
}

.stat-card .stat-value {
  font-family: 'Playfair Display', serif;
  font-size: 2.25rem;
  font-weight: 700;
}

.stat-card .stat-label {
  margin-top: 0.5rem;
  color: hsl(0 0% 100% / 0.8);
  font-weight: 500;
}

/* ═══════════════════════════════════════════
   CONTACT SECTION
   ═══════════════════════════════════════════ */
.contact-section {
  padding: 6rem 0;
  background-image: linear-gradient(135deg, hsl(var(--navy)), hsl(var(--navy-deep)));
}

.contact-section .section-label {
  color: hsl(var(--solar-gold));
}

.contact-section .section-title {
  color: hsl(var(--primary-foreground));
}

.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  max-width: 64rem;
  margin: 0 auto;
}

.contact-form {
  background: hsl(0 0% 100% / 0.05);
  backdrop-filter: blur(8px);
  border-radius: var(--radius);
  padding: 2rem;
  border: 1px solid hsl(0 0% 100% / 0.1);
}

.contact-form form { display: flex; flex-direction: column; gap: 1.25rem; }

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
}

.contact-form input,
.contact-form textarea {
  width: 100%;
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  background: hsl(0 0% 100% / 0.1);
  border: 1px solid hsl(0 0% 100% / 0.1);
  color: hsl(var(--primary-foreground));
  font-family: 'DM Sans', sans-serif;
  font-size: 1rem;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.contact-form input::placeholder,
.contact-form textarea::placeholder {
  color: hsl(0 0% 100% / 0.4);
}

.contact-form input:focus,
.contact-form textarea:focus {
  border-color: hsl(var(--primary));
  box-shadow: 0 0 0 3px hsl(var(--primary) / 0.2);
}

.contact-form textarea { resize: none; }
.contact-form .btn-primary { width: 100%; }

.form-success {
  background: hsl(var(--leaf) / 0.15);
  color: hsl(145 60% 70%);
  padding: 1rem;
  border-radius: var(--radius);
  margin-bottom: 1rem;
  text-align: center;
  font-weight: 500;
}

.form-error {
  background: hsl(0 60% 50% / 0.15);
  color: hsl(0 70% 70%);
  padding: 1rem;
  border-radius: var(--radius);
  margin-bottom: 1rem;
  text-align: center;
  font-weight: 500;
}

.contact-info {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 2rem;
}

.contact-item {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
}

.icon-box {
  width: 3rem;
  height: 3rem;
  border-radius: var(--radius);
  background-image: linear-gradient(135deg, hsl(var(--solar-gold)), hsl(var(--solar-amber)));
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 1.25rem;
}

.contact-item h4 {
  color: hsl(var(--primary-foreground));
  font-weight: 600;
  font-size: 1.125rem;
}

.contact-item p {
  color: hsl(0 0% 100% / 0.6);
  margin-top: 0.25rem;
}

.contact-item p a {
  color: hsl(0 0% 100% / 0.6);
  transition: color 0.2s;
}

.contact-item p a:hover { color: hsl(var(--solar-gold)); }

/* ═══════════════════════════════════════════
   FOOTER
   ═══════════════════════════════════════════ */
.site-footer {
  background: hsl(var(--navy-deep));
  padding: 3rem 0;
  border-top: 1px solid hsl(0 0% 100% / 0.05);
}

.site-footer .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.footer-links {
  display: flex;
  gap: 2rem;
}

.footer-links a {
  color: hsl(0 0% 100% / 0.5);
  font-size: 0.875rem;
  transition: color 0.2s;
}

.footer-links a:hover { color: hsl(var(--solar-gold)); }

.footer-copy {
  color: hsl(0 0% 100% / 0.3);
  font-size: 0.875rem;
}

/* ═══════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════ */
@media (max-width: 1024px) {
  .services-grid { grid-template-columns: repeat(2, 1fr); }
  .gallery-grid  { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .main-nav { display: none; }
  .main-nav.open {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 5rem;
    left: 0; right: 0;
    background: hsl(var(--navy-deep) / 0.95);
    backdrop-filter: blur(12px);
    padding: 1.5rem;
    border-top: 1px solid hsl(0 0% 100% / 0.05);
    gap: 1rem;
    animation: fadeIn 0.3s ease;
  }
  .main-nav.open a {
    font-size: 1.125rem;
    padding: 0.5rem 0;
    color: hsl(0 0% 100% / 0.8);
  }
  .main-nav.open .btn-preventivo {
    text-align: center;
    margin-top: 0.5rem;
  }
  .menu-toggle { display: block; }

  .hero-title { font-size: 2.5rem; }
  .hero-buttons { flex-direction: column; }

  .services-grid { grid-template-columns: 1fr; }
  .gallery-grid  { grid-template-columns: 1fr; }
  .about-grid    { grid-template-columns: 1fr; }
  .contact-grid  { grid-template-columns: 1fr; }

  .site-footer .container {
    flex-direction: column;
    text-align: center;
  }
}

@media (max-width: 480px) {
  .hero-stats { grid-template-columns: repeat(3, 1fr); gap: 1rem; }
  .hero-stats .stat-value { font-size: 1.25rem; }
  .form-row { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .stat-card { aspect-ratio: auto; padding: 1.5rem; }
}
