/*
Theme Name: CAD Theme
Author: CAD - Composite Advanced Design
Description: Tema WordPress personalizzato per ingegneria dei materiali compositi.
Version: 1.0
*/

:root {
  --cad-navy: #14213D;
  --cad-navy-rgb: 20, 33, 61;
  --cad-white: #FFFFFF;
  --cad-gray-light: #F8FAFC;
  --cad-gray: #94A3B8;
  --cad-gray-dark: #64748B;
  --cad-cyan: #06B6D4;
  --cad-cyan-glow: #22D3EE;
  --cad-cyan-dark: #0891B2;
  --gradient-primary: linear-gradient(135deg, #06B6D4, #22D3EE);
  --gradient-navy: linear-gradient(180deg, #14213D, #1a2a4a);
  --gradient-hero-overlay: linear-gradient(135deg, rgba(20, 33, 61, 0.30), rgba(20, 33, 61, 0.8));
  --shadow-card: 0 4px 20px rgba(6, 182, 212, 0.1);
  --shadow-card-hover: 0 8px 40px rgba(6, 182, 212, 0.2);
  --shadow-glow: 0 0 40px rgba(6, 182, 212, 0.3);
  --font-display: 'Orbitron', sans-serif;
  --font-body: 'Inter', sans-serif;
  --section-padding: 80px 0;
  --container-max: 1200px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body { font-family: var(--font-body); background-color: var(--cad-navy); color: var(--cad-white); line-height: 1.6; }

/* WP Admin Bar Fix */
body.admin-bar .header { top: 32px; }
@media screen and (max-width: 782px) { body.admin-bar .header { top: 46px; } }

.container { max-width: var(--container-max); margin: 0 auto; padding: 0 24px; }

/* HEADER */
.header { 
    position: fixed; 
    top: 0 !important; /* Forza l'attacco al bordo superiore */
    left: 0; 
    right: 0; 
    z-index: 10000; 
    padding: 40px 0; /* Altezza costante */
    background: #14213D; /* Colore solido (var --cad-navy) per non far vedere nulla dietro */
    border-bottom: 1px solid rgba(6, 182, 212, 0.2); 
    transition: none; /* Rimosso transition per evitare scatti durante lo scroll */
}

.header.scrolled { 
    background: #14213D; 
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3); 
}
.header.scrolled { background: rgba(20, 33, 61, 0.95); box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3); }
.header-inner { display: flex; align-items: center; justify-content: space-between; }

.logo { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.logo img { height: 48px; width: auto; }

.logo-text-group { display: flex; flex-direction: column; justify-content: center; }
.logo-text { font-family: var(--font-display); font-size: 22px; font-weight: 800; color: var(--cad-white); line-height: 1; letter-spacing: 1px; }
.logo-tagline { font-family: var(--font-body); font-size: 9px; font-weight: 500; color: var(--cad-gray); letter-spacing: 1.5px; text-transform: uppercase; margin-top: 4px; line-height: 1; }

.nav { display: flex; align-items: center; gap: 32px; }
.nav-link {
  font-size: clamp(9px, 1vw, 12px);
}
.nav-link:hover { color: var(--cad-cyan); }

/* BUTTONS */
.btn-primary {
  font-size: clamp(9px, 1vw, 11px);
  padding: clamp(6px, 0.8vw, 10px) clamp(10px, 1.5vw, 18px);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: var(--shadow-glow); }
.btn-outline { display: inline-flex; align-items: center; justify-content: center; padding: 12px 24px; background: transparent; color: var(--cad-white); font-family: var(--font-display); font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 1px; text-decoration: none; border: 1px solid rgba(255, 255, 255, 0.3); border-radius: 4px; transition: all 0.3s ease; }
.btn-outline:hover { background: rgba(255, 255, 255, 0.1); border-color: var(--cad-cyan); }

/* HERO */
.hero { position: relative; min-height: 100vh; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.hero-background { position: absolute; inset: 0; z-index: 0; }
.hero-background img { width: 100%; height: 100%; object-fit: cover; }
.hero-overlay { position: absolute; inset: 0; background: var(--gradient-hero-overlay); }
.hero-content { position: relative; z-index: 10; text-align: center; max-width: 900px; padding: 0 24px; }
.hero-badge { display: inline-block; padding: 8px 20px; background: rgba(6, 182, 212, 0.1); border: 1px solid rgba(6, 182, 212, 0.3); border-radius: 50px; font-family: var(--font-display); font-size: 12px; color: var(--cad-cyan); text-transform: uppercase; letter-spacing: 2px; margin-bottom: 32px; }
.hero-title { font-family: var(--font-display); font-size: clamp(16px, 8vw, 64px); font-weight: 700; line-height: 1.1; margin-bottom: 24px; text-transform: uppercase; word-break: break-word;}
.hero-title .highlight { background: var(--gradient-primary); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.hero-subtitle { font-size: 8px; color: var(--cad-gray); max-width: 600px; margin: 0 auto 40px; }

/* FOOTER */
.footer { padding: 60px 0 24px; background: rgba(20, 33, 61, 0.9); border-top: 1px solid rgba(6, 182, 212, 0.1); }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 48px; margin-bottom: 48px; }
.social-links { display: flex; gap: 12px; }
.social-link { width: 40px; height: 40px; display: flex; align-items: center; justify-content: center; background: rgba(6, 182, 212, 0.1); border-radius: 8px; color: var(--cad-cyan); transition: 0.3s; }
.social-link:hover { background: var(--cad-cyan); color: var(--cad-navy); }

/* ANIMATIONS & BG */
.hexagon-bg { position: fixed; inset: 0; pointer-events: none; z-index: 0; opacity: 0.3; }
.hex-float { position: absolute; width: 60px; height: 69px; background: rgba(6, 182, 212, 0.05); clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%); animation: float 20s infinite ease-in-out; }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-20px); } }
/* PROJECTS GRID */
.projects-container { position: relative; overflow: hidden; margin-top: 40px; }
.projects-slider { display: flex; gap: 24px; overflow-x: auto; scroll-behavior: smooth; -webkit-overflow-scrolling: touch; }
.projects-slider::-webkit-scrollbar { display: none; }
.project-card { flex: 0 0 auto; min-width: 280px; position: relative; padding: 24px; border-radius: 8px; cursor: pointer; overflow: hidden; transition: transform 0.3s ease; }
.project-card:hover { transform: scale(1.05); }
.project-card .sector-overlay { position: absolute; inset: 0; background: rgba(20, 33, 61, 0.2); z-index: 1; transition: all 0.4s ease; }
.project-card:hover .sector-overlay { background: rgba(6, 182, 212, 0.4); }
.project-card .sector-info { position: relative; z-index: 2; text-align: center; color: var(--cad-white); }
.project-card h3 { font-family: var(--font-display); font-size: 18px; text-transform: uppercase; margin-bottom: 12px; text-shadow: 0 2px 10px rgba(0,0,0,0.8); }
.project-card p { font-size: 14px; color: var(--cad-gray); opacity: 0.8; }
.project-card:hover p { color: white; opacity: 1; }
.project-card::before { content: ""; position: absolute; inset: 0; z-index: 0; background-size: cover; background-position: 0% center; transition: opacity 0.5s ease; opacity: 0; }
.project-card.proj-1::before { background-image: url('http://localhost:8080/wordpress/wp-content/uploads/2025/12/istockphoto-1296196406-612x612-1.jpg'); }
.project-card:hover::before { opacity: 1; animation: scroll-bg 10s linear infinite alternate; }
@keyframes scroll-bg { 0% { background-position: 0% center; } 100% { background-position: 100% center; } }

/* CARDS ARROWS */
.projects-arrow { position: absolute; top: 50%; transform: translateY(-50%); width: 40px; height: 60px; background: rgba(6, 182, 212, 0.2); border-radius: 8px; display: flex; align-items: center; justify-content: center; cursor: pointer; z-index: 10; transition: background 0.3s; }
.projects-arrow:hover { background: rgba(6, 182, 212, 0.5); }
.projects-arrow-left { left: 10px; }
.projects-arrow-right { right: 10px; }
.projects-arrow svg { width: 20px; height: 20px; fill: white; }

/* FORM DI CONTATTO */
.cad-form-container {
    max-width: 500px;
    margin: 40px auto;
    text-align: left;
    position: relative;
    z-index: 10;
}
.cad-form-label { display: block; color: var(--cad-gray); font-size: 11px; font-weight: 700; margin-bottom: 8px; text-transform: uppercase; letter-spacing: 1px; }
.cad-form-group { margin-bottom: 20px; }
.cad-form-input, .cad-form-textarea {
    width: 100%;
    background-color: rgba(20, 33, 61, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    padding: 14px;
    color: #fff;
    font-family: var(--font-body);
    transition: all 0.3s ease;
}
.cad-form-input:focus, .cad-form-textarea:focus {
    outline: none;
    border-color: var(--cad-cyan-glow);
    box-shadow: 0 0 15px rgba(34, 211, 238, 0.2);
    background-color: rgba(20, 33, 61, 0.8);
}
.cad-submit-button {
    width: 100%;
    background: var(--cad-cyan-glow);
    color: var(--cad-navy);
    border: none;
    padding: 16px;
    border-radius: 4px;
    font-family: var(--font-display);
    font-weight: 700;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    cursor: pointer;
    transition: 0.3s;
}
.cad-submit-button:hover {
    background: var(--cad-white);
    transform: translateY(-2px);
    box-shadow: var(--shadow-glow);
}
/* PAGE-ID SPECIFIC STYLES */
.page-id-22 .hero-content { position: relative; z-index: 10; max-width: 800px; margin: 0 auto; padding: 0 20px; display: flex; flex-direction: column; align-items: center; }
.page-id-22 .hero-title { font-family: var(--font-display); font-size: clamp(24px, 5vw, 48px); font-weight: 700; line-height: 1.1; margin-bottom: 20px; text-transform: uppercase; text-align: justify; width: 100%; display: flex; justify-content: space-between; }
.page-id-22 .hero-subtitle { font-size: 16px; color: var(--cad-gray); margin-bottom: 40px; line-height: 1.8; text-align: justify; width: 100%; hyphens: auto; }
.page-id-22 .hero-badge { margin-bottom: 20px; text-align: center; }
.page-id-22 .cad-form-container { width: 100%; max-width: 550px; margin: 0 auto; text-align: left; }
.page-id-22 .cad-form-input, .page-id-22 .cad-form-textarea { background-color: rgba(20, 33, 61, 0.4); border: 1px solid rgba(255, 255, 255, 0.1); border-radius: 4px; }
.page-id-22 .cad-form-input:focus, .page-id-22 .cad-form-textarea:focus { border-color: var(--cad-cyan-glow); box-shadow: 0 0 10px rgba(34, 211, 238, 0.3); }
.page-id-22 .cad-submit-button { width: 100%; background: var(--cad-cyan-glow); color: var(--cad-navy); font-weight: 700; }

/* ============================================================
   SPECIFICO PER PAGINA ABOUT/TEAM (ID: 17) 
   ============================================================ */

.page-id-17 .about-container {
    padding: 120px 24px 60px;
    max-width: var(--container-max);
    margin: 0 auto;
    position: relative;
    z-index: 10;
}

.page-id-17 .about-header.left-align {
    text-align: left;
    margin-bottom: 5px;
}

.page-id-17 .about-header.left-align .hero-badge {
    display: inline-block;
    padding: 8px 24px;
    background: rgba(6,182,212,.1);
    border: 1px solid rgba(6,182,212,.3);
    border-radius: 50px;
    font-family: var(--font-display);
    font-size: 12px;
    color: var(--cad-cyan);
    text-transform: uppercase;
    letter-spacing: 2px;
}

.page-id-17 .about-grid {
    display: grid;
    grid-template-columns: 350px 1fr;
    gap: 48px;
    align-items: start;
}

.page-id-17 .about-sidebar {
    background: rgba(20, 33, 61, 0.4);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 40px;
    border-radius: 8px;
    text-align: center;
    position: sticky;
    top: 120px;
}

.page-id-17 .profile-img {
    width: 180px; height: 180px;
    border-radius: 50%;
    border: 2px solid var(--cad-cyan-glow);
    margin-bottom: 24px;
    object-fit: cover;
    box-shadow: var(--shadow-glow);
}

.page-id-17 .profile-name {
    font-family: var(--font-display);
    font-size: 22px;
    color: var(--cad-white);
    margin-bottom: 8px;
    text-transform: uppercase;
}

.page-id-17 .profile-title {
    color: var(--cad-cyan-glow);
    font-size: 12px;
    font-family: var(--font-display);
    letter-spacing: 1px;
    margin-bottom: 32px;
}

.page-id-17 .contact-info {
    display: flex; flex-direction: column; gap: 16px;
    text-align: left;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 24px;
}

.page-id-17 .contact-info a, 
.page-id-17 .contact-info span {
    color: var(--cad-gray);
    text-decoration: none;
    font-size: 14px;
    display: flex; align-items: center; gap: 12px;
    transition: 0.3s;
}

.page-id-17 .contact-info a:hover { color: var(--cad-cyan-glow); }

.page-id-17 .about-content { display: flex; flex-direction: column; gap: 24px; }

.page-id-17 .cv-section {
    background: rgba(255, 255, 255, 0.03);
    padding: 32px;
    border-radius: 8px;
    border-left: 3px solid var(--cad-cyan-glow);
    transition: background 0.3s ease;
}

.page-id-17 .cv-section:hover { background: rgba(255, 255, 255, 0.05); }

.page-id-17 .section-label {
    font-family: var(--font-display);
    color: var(--cad-white);
    font-size: 18px;
    margin-bottom: 24px;
    display: flex; align-items: center; gap: 12px;
    text-transform: uppercase;
}

.page-id-17 .cv-item h4 { color: var(--cad-white); font-size: 17px; margin-bottom: 4px; }
.page-id-17 .cv-meta { color: var(--cad-cyan-glow); font-size: 12px; font-weight: 600; text-transform: uppercase; }
.page-id-17 .cv-item p { color: var(--cad-gray); font-size: 14px; }

/* ============================================================
   STILI SPECIFICI PAGINA SERVICES (ID: 22)
   ============================================================ */

.page-id-22 .hero-content { 
    position: relative; 
    z-index: 10; 
    max-width: 1200px; 
    margin: 0 auto; 
    padding: 0 24px; 
}

/* Griglia Servizi Engineering */
.page-id-22 .services-section {
    margin-top: 80px;
    width: 100%;
}

.page-id-22 .sectors-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr); /* 3 colonne come da immagine */
    gap: 24px;
    margin-top: 40px;
}

.page-id-22 .sector-card {
    min-height: auto; /* Altezza dinamica per le card servizi */
    background: rgba(20, 33, 61, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 32px;
    text-align: left;
    align-items: flex-start;
    justify-content: flex-start;
    transition: all 0.3s ease;
}

.page-id-22 .sector-card:hover {
    border-color: var(--cad-cyan-glow);
    transform: translateY(-5px);
    background: rgba(20, 33, 61, 0.6);
    box-shadow: var(--shadow-card);
}

.page-id-22 .sector-card h3 {
    font-size: 20px;
    margin-bottom: 16px;
    text-align: left;
    text-shadow: none;
}

.page-id-22 .sector-card p {
    text-align: left;
    opacity: 0.7;
    font-size: 14px;
    line-height: 1.6;
}

/* Decorazione Esagonale nelle card */
.page-id-22 .hex-decoration {
    position: absolute;
    top: 20px;
    right: 20px;
    opacity: 0.1;
    width: 40px;
    height: 40px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Cpolygon points='50 3 95 25 95 75 50 97 5 75 5 25' fill='none' stroke='%23ffffff' stroke-width='5'/%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
}
/* ============================================================
   OPERATING SECTORS - PAGE ID 22 (Dimensioni 240x360)
   ============================================================ */

/* Contenitore limitato per mantenere le proporzioni 240px x 4 colonne */
.page-id-22 .about-container > .sectors-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0;
    margin: 40px auto;
    background: transparent;
    max-width: 960px; /* 240px * 4 = 960px */
}

.page-id-22 .about-container > .sectors-grid .sector-card {
    position: relative;
    /* Altezza impostata per riflettere i 360px dell'immagine originale */
    min-height: 360px; 
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: transparent;
    transition: all 0.5s ease;
    overflow: hidden;
    border: none;
}

/* Overlay di base */
.page-id-22 .about-container > .sectors-grid .sector-overlay {
    position: absolute;
    inset: 0;
    background: rgba(20, 33, 61, 0.4);
    transition: all 0.4s ease;
    z-index: 1;
}

/* Gestione Immagini in Hover */
.page-id-22 .about-container > .sectors-grid .sector-card:hover {
    background-size: cover;
    background-position: center;
}

.page-id-22 .about-container > .sectors-grid .sector-card.automotive:hover { 
    background-image: url('http://localhost:10004/wp-content/uploads/2025/12/pagani-1.png'); 
}
.page-id-22 .about-container > .sectors-grid .sector-card.aerospace:hover { 
    background-image: url('http://localhost:10004/wp-content/uploads/2025/12/HD-wallpaper-technology-spacex-crew-dragon-1.jpg'); 
}
.page-id-22 .about-container > .sectors-grid .sector-card.energy:hover { 
    background-image: url('http://localhost:10004/wp-content/uploads/2025/12/wind-turbine.jpg'); 
}
.page-id-22 .about-container > .sectors-grid .sector-card.ships:hover { 
    background-image: url('http://localhost:10004/wp-content/uploads/2025/12/luna-rossa-1.jpg'); 
}

/* Hover Effects */
.page-id-22 .about-container > .sectors-grid .sector-card:hover .sector-overlay { 
    background: rgba(6, 182, 212, 0.5); 
}

.page-id-22 .about-container > .sectors-grid .sector-info {
    position: relative;
    z-index: 2;
    text-align: center;
}

.page-id-22 .about-container > .sectors-grid .sector-card h3 {
    font-family: var(--font-display);
    font-size: 16px; /* Leggermente ridotto per rettangoli stretti */
    color: var(--cad-white);
    text-transform: uppercase;
    margin-bottom: 12px;
    text-shadow: 0 2px 8px rgba(0,0,0,0.9);
}

.page-id-22 .about-container > .sectors-grid .sector-card p {
    font-size: 13px;
    color: var(--cad-white);
    line-height: 1.4;
    opacity: 0; /* Nascondiamo il testo e lo mostriamo solo in hover */
    transform: translateY(10px);
    transition: all 0.3s ease;
}

.page-id-22 .about-container > .sectors-grid .sector-card:hover p {
    opacity: 1;
    transform: translateY(0);
}

/* Mobile Responsive */
@media (max-width: 992px) {
    .page-id-22 .about-container > .sectors-grid {
        grid-template-columns: repeat(2, 1fr);
        max-width: 480px;
    }
}

@media (max-width: 480px) {
    .page-id-22 .about-container > .sectors-grid {
        grid-template-columns: 1fr;
        max-width: 240px;
    }
}

/* ============================================================
   SISTEMA ESAGONI GHOST & CARBON DOTS (ID: 17 & ID: 22)
   ============================================================ */

.page-id-17 .assistance-flex-container,
.page-id-22 .assistance-flex-container {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 60px;
    align-items: center;
    margin: 80px 0;
}

.page-id-17 .assistance-visual-side,
.page-id-22 .assistance-visual-side {
    position: relative;
    height: 600px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.hex-system {
    position: relative;
    width: 100%;
    height: 100%;
    /* Assicura che il centro del sistema sia il punto di riferimento */
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Esagono GHOST */
.hex-ghost {
    position: absolute;
    top: 50%;
    left: 50%;
    /* Il transform viene gestito dallo script JS per la fluttuazione */
    background-color: transparent;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Cpolygon points='50 3 95 25 95 75 50 97 5 75 5 25' fill='none' stroke='%2322D3EE' stroke-width='2'/%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: transform 0.15s ease-out; /* Leggermente più morbido per la fluttuazione */
}

/* Atomi di Carbonio (Cerchi ai vertici) */
.carbon-atom {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 12px;
    height: 12px;
    background-color: var(--cad-cyan-glow);
    border-radius: 50%;
    box-shadow: 0 0 15px var(--cad-cyan-glow), inset 0 0 5px white;
    border: 1px solid rgba(255, 255, 255, 0.4);
    z-index: 12;
    pointer-events: none;
    transition: transform 0.15s ease-out;
}

/* Dimensioni e Z-Index */
.hex-ghost.central, .hex-ghost.satellite {
    width: 200px;
    height: 200px;
}

.hex-ghost.central { z-index: 10; }
.hex-ghost.satellite { z-index: 5; opacity: 0.6; } /* Satelliti leggermente più eterei */

.hex-text {
    color: var(--cad-cyan-glow);
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 28px;
    text-shadow: 0 0 15px rgba(34, 211, 238, 0.6);
    z-index: 15;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */

@media (max-width: 1024px) {
    .page-id-22 .sectors-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
    .page-id-17 .about-grid,
    .page-id-22 .sectors-grid,
    .page-id-17 .assistance-flex-container,
    .page-id-22 .assistance-flex-container {
        grid-template-columns: 1fr;
    }
    
    .page-id-17 .assistance-visual-side,
    .page-id-22 .assistance-visual-side { height: 400px; }
    
    .hex-ghost.central, .hex-ghost.satellite {
        width: 150px;
        height: 150px;
    }
    
    .carbon-atom {
        width: 10px;
        height: 10px;
    }
}
@media (max-width: 480px) {
  .nav-link {
    font-size: 8px;
  }

  .btn-primary {
    font-size: 8px;
    padding: 6px 10px;
  }
}
@media (max-width: 768px) {
  .page-id-17 .about-header {
    margin-top: 80px;
  }
}
@media (max-width: 992px) { .sectors-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 900px) { .sectors-grid { grid-template-columns: 1fr; } }