/*
Theme Name: General Work
Theme URI: http://resaedilegeneralworksrl.com
Author: Ahmed
Version: 1.1
Description: Tema WordPress personalizzato per General Work S.R.L.S.
Text Domain: generalwork
*/

/* ============================================================
   RESET & BASE
   ============================================================ */
*, *::before, *::after {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
    width: 100%;
    overflow-x: hidden;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%; /* Impedisce zoom auto del testo su iOS */
}

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

/* ============================================================
   FIX CRITICO: scroll-margin uniforme e unico per tutta la nav
   Prima avevi valori diversi in header.php (80px) e style.css (120px)
   ============================================================ */
:root {
    --nav-height: 80px;
    --primary-blue: #1a2b3c;
    --accent-gold: #d4af37;
}

section[id],
div[id] {
    scroll-margin-top: var(--nav-height);
}

/* ============================================================
   COLORI — definiti una volta sola qui, non duplicati
   ============================================================ */
.bg-primary    { background-color: var(--primary-blue); }
.text-primary  { color: var(--primary-blue); }
.text-accent   { color: var(--accent-gold); }
.bg-accent     { background-color: var(--accent-gold); }
.border-accent { border-color: var(--accent-gold); }

/* ============================================================
   HERO — FIX iOS: background-attachment:fixed è rotto su Safari
   ============================================================ */
.hero-gradient {
    background: linear-gradient(rgba(26, 43, 60, 0.75), rgba(26, 43, 60, 0.75)),
        url('https://images.unsplash.com/photo-1541888946425-d81bb19240f5?ixlib=rb-1.2.1&auto=format&fit=crop&w=1950&q=80');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
}
@media (max-width: 768px) {
    .hero-gradient {
        background-attachment: scroll; /* FIX: iOS/Safari non supporta fixed */
    }
}

/* ============================================================
   COMPONENTI
   ============================================================ */
.card-hover {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.card-hover:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

.nav-link::after {
    content: '';
    display: block;
    width: 0;
    height: 2px;
    background: var(--accent-gold);
    transition: width 0.3s;
}
.nav-link:hover::after {
    width: 100%;
}

/* ============================================================
   FORM — adattamento mobile
   ============================================================ */
input,
textarea,
select {
    width: 100%;
    font-size: 16px; /* FIX: previene lo zoom automatico su iOS quando si tocca un input */
}

/* ============================================================
   LAYOUT GENERALE
   ============================================================ */
.container,
.max-w-7xl {
    width: 100%;
    padding-left: 16px;
    padding-right: 16px;
}

section,
div {
    max-width: 100%;
}

/* ============================================================
   WHATSAPP BUTTON PULSE
   ============================================================ */
.whatsapp-pulse {
    background: #25d366;
    animation: pulse-green 2s infinite;
}

@keyframes pulse-green {
    0%   { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(37, 211, 102, 0.7); }
    70%  { transform: scale(1);    box-shadow: 0 0 0 10px rgba(37, 211, 102, 0); }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(37, 211, 102, 0); }
}

/* ============================================================
   FOCUS RING — accessibilità
   ============================================================ */
input:focus,
textarea:focus,
select:focus {
    outline: none;
    ring: 2px;
    border-color: var(--accent-gold);
    box-shadow: 0 0 0 2px rgba(212, 175, 55, 0.3);
}
