/*
Theme Name: Web Sardinia Performance Theme
Theme URI: https://websardinia.it
Author: Web Sardinia
Author URI: https://websardinia.it
Description: Tema ufficiale ottimizzato per prestazioni e SEO. Design moderno con glassmorphism, ottimizzato per Core Web Vitals.
Version: 5.0
Requires at least: 6.0
Tested up to: 6.4
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: websardinia-performance
Tags: business, portfolio, performance, seo, glassmorphism, modern, responsive
*/

/* ===================================
   IMPORT GOOGLE FONTS
   =================================== */
@import url('https://fonts.googleapis.com/css2?family=Poppins:ital,wght@0,300;0,400;0,500;0,600;0,700;0,800;1,300;1,400;1,500;1,600;1,700;1,800&display=swap');

/* ===================================
   GLOBAL RESET & BASE STYLES
   =================================== */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    color: #1a1a1a;
    line-height: 1.7;
    overflow-x: hidden;
    background: #ffffff;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

a {
    text-decoration: none;
    color: inherit;
    transition: all 0.3s ease;
}

/* ===================================
   TYPOGRAPHY
   =================================== */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, sans-serif;
    font-weight: 700;
    line-height: 1.2;
    margin: 0 0 1rem 0;
    color: #005e8e;
}

h1 {
    font-size: clamp(2.5rem, 6vw, 4.5rem);
    font-weight: 800;
}

h2 {
    font-size: clamp(2rem, 4vw, 3rem);
}

h3 {
    font-size: clamp(1.5rem, 3vw, 2rem);
}

h4 {
    font-size: clamp(1.25rem, 2vw, 1.5rem);
}

h5 {
    font-size: 1.125rem;
}

h6 {
    font-size: 1rem;
}

p {
    margin: 0 0 1.5rem 0;
    line-height: 1.8;
}

/* ===================================
   LAYOUT CONTAINERS
   =================================== */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    width: 100%;
}

.section {
    padding: 5rem 0;
}

/* ===================================
   WORDPRESS CORE ELEMENTS
   =================================== */
.alignleft {
    float: left;
    margin-right: 1.5rem;
    margin-bottom: 1rem;
}

.alignright {
    float: right;
    margin-left: 1.5rem;
    margin-bottom: 1rem;
}

.aligncenter {
    display: block;
    margin-left: auto;
    margin-right: auto;
}

.wp-caption {
    max-width: 100%;
}

.wp-caption-text {
    font-size: 0.875rem;
    font-style: italic;
    color: #666;
    margin-top: 0.5rem;
}

.sticky {
    /* Placeholder for sticky posts */
}

.bypostauthor {
    /* Placeholder for post author */
}

.gallery-caption {
    font-size: 0.875rem;
    font-style: italic;
}

.screen-reader-text {
    clip: rect(1px, 1px, 1px, 1px);
    position: absolute !important;
    height: 1px;
    width: 1px;
    overflow: hidden;
}

.screen-reader-text:focus {
    background-color: #f1f1f1;
    border-radius: 3px;
    box-shadow: 0 0 2px 2px rgba(0, 0, 0, 0.6);
    clip: auto !important;
    color: #21759b;
    display: block;
    font-size: 14px;
    font-weight: bold;
    height: auto;
    left: 5px;
    line-height: normal;
    padding: 15px 23px 14px;
    text-decoration: none;
    top: 5px;
    width: auto;
    z-index: 100000;
}

/* ===================================
   HEADER STYLES
   =================================== */
.site-header {
    position: sticky;
    top: 0;
    z-index: 9999;
    padding: 1rem 0;
    background: linear-gradient(135deg, rgba(10, 25, 47, 0.9) 0%, rgba(20, 40, 70, 0.9) 100%);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
}

.custom-logo-link {
    display: block;
    line-height: 0;
}

.custom-logo {
    max-height: 75px;
    width: auto;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

.custom-logo:hover {
    transform: scale(1.05);
}

.site-title {
    font-size: 1.5rem;
    font-weight: 800;
    margin: 0;
}

.site-title a {
    color: #ffffff;
}

/* Navigation */
.main-navigation {
    display: flex;
    align-items: center;
}

.main-navigation ul {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 2rem;
}

.main-navigation li {
    position: relative;
}

.main-navigation a {
    color: #ffffff;
    font-weight: 600;
    font-size: 1rem;
    padding: 0.5rem 0;
    display: block;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    position: relative;
}

.main-navigation a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: #FDCB6E;
    transition: width 0.3s ease;
}

.main-navigation a:hover::after,
.main-navigation .current-menu-item a::after {
    width: 100%;
}

/* Mobile Menu Toggle */
.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    flex-direction: column;
    gap: 0.25rem;
}

.mobile-menu-toggle span {
    display: block;
    width: 25px;
    height: 3px;
    background: #ffffff;
    border-radius: 2px;
    transition: all 0.3s ease;
}

/* ===================================
   FOOTER STYLES
   =================================== */
.site-footer {
    background: linear-gradient(135deg, #0a192f 0%, #14284669 100%);
    color: #ffffff;
    padding: 3rem 0 2rem;
    margin-top: 5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-content {
    text-align: center;
}

.footer-info {
    margin-bottom: 1.5rem;
}

.footer-info h2 {
    color: #FDCB6E;
    margin-bottom: 0.5rem;
    font-size: 1.5rem;
}

.footer-tagline {
    color: rgba(255, 255, 255, 0.8);
    font-size: 1.1rem;
}

.footer-contacts {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin: 2rem 0;
    flex-wrap: wrap;
}

.footer-contact-item {
    color: rgba(255, 255, 255, 0.9);
    font-size: 1rem;
}

.footer-contact-item a {
    color: #FDCB6E;
    font-weight: 600;
}

.footer-contact-item a:hover {
    color: #ffffff;
}

.footer-credits {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.9rem;
}

.footer-credits a {
    color: #FDCB6E;
    font-weight: 600;
}

.footer-credits a:hover {
    color: #ffffff;
}

.footer-link {
    color: #FDCB6E;
    font-weight: 600;
}

.footer-link:hover {
    color: #ffffff;
}

/* ===================================
   PAGE CONTENT
   =================================== */
.site-main {
    min-height: 60vh;
}

.entry-title {
    margin-bottom: 2rem;
}

.entry-content {
    line-height: 1.8;
}

.entry-content>*:last-child {
    margin-bottom: 0;
}

/* Hide page title on homepage */
.home .entry-title {
    display: none;
}

/* ===================================
   GUTENBERG BLOCK SUPPORT
   =================================== */
.wp-block-cover {
    position: relative;
    min-height: 50vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.wp-block-cover__image-background,
.wp-block-cover__video-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 0;
}

.wp-block-cover__inner-container {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

.wp-block-columns {
    display: flex;
    gap: 2rem;
    flex-wrap: wrap;
}

.wp-block-column {
    flex: 1;
    min-width: 280px;
}

.wp-block-buttons {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.wp-block-button__link {
    padding: 1rem 2rem;
    border-radius: 8px;
    font-weight: 600;
    display: inline-block;
    transition: all 0.3s ease;
}

/* ===================================
   GLASSMORPHISM COMPONENTS
   =================================== */

/* Glass Hero Section */
.glass-hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.glass-hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(0, 94, 142, 0.5) 0%, rgba(0, 60, 90, 0.4) 100%);
    z-index: 1;
}

.glass-hero-content {
    position: relative;
    z-index: 3;
    text-align: center;
    padding: 3rem;
}

.glass-hero h1,
.glass-hero h2 {
    color: #ffffff;
    text-shadow: 0 4px 30px rgba(0, 0, 0, 0.8);
}

.hero-subtitle {
    font-size: clamp(1.2rem, 2.5vw, 1.6rem);
    color: #ffffff;
    margin-bottom: 2.5rem;
    text-shadow: 0 2px 15px rgba(0, 0, 0, 0.9);
}

.gradient-text {
    background: linear-gradient(135deg, #FDCB6E 0%, #fff 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Glass Cards */
.glass-cards-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2.5rem;
    margin: 3rem 0;
}

.glass-card {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 30px;
    padding: 0;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.glass-card:hover {
    transform: translateY(-15px);
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.15);
}

.glass-card.featured {
    border: 2px solid #FDCB6E;
}

.card-image {
    width: 100%;
    height: 250px;
    overflow: hidden;
}

.card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.glass-card:hover .card-image img {
    transform: scale(1.1);
}

.card-content {
    padding: 2rem;
    flex-grow: 1;
}

.card-icon {
    font-size: 3rem;
    text-align: center;
    margin: 1.5rem 0 1rem;
}

.card-badge {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: #FDCB6E;
    color: #1a1a1a;
    padding: 0.5rem 1rem;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    z-index: 2;
}

/* Glass Buttons */
.glass-button-primary .wp-block-button__link,
.glass-button-primary.wp-block-button__link {
    background: rgba(255, 255, 255, 0.85) !important;
    color: #0073aa !important;
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.5);
    box-shadow: 0 8px 24px rgba(0, 115, 170, 0.2);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 1rem 2.5rem;
    border-radius: 20px;
}

.glass-button-primary:hover .wp-block-button__link,
.glass-button-primary.wp-block-button__link:hover {
    background: #ffffff !important;
    transform: translateY(-4px);
    box-shadow: 0 12px 32px rgba(0, 115, 170, 0.3);
}

/* Gallery */
.glass-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin: 3rem 0;
}

.gallery-item {
    position: relative;
    border-radius: 20px;
    overflow: hidden;
    aspect-ratio: 4/3;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    transition: all 0.4s ease;
}

.gallery-item:hover {
    transform: translateY(-10px);
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.15);
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.gallery-item:hover img {
    transform: scale(1.1);
}

/* ===================================
   RESPONSIVE DESIGN
   =================================== */
@media (max-width: 768px) {
    .main-navigation {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100vh;
        background: rgba(10, 25, 47, 0.98);
        flex-direction: column;
        justify-content: center;
        align-items: center;
        z-index: 10000;
    }

    .main-navigation.active {
        display: flex;
    }

    .main-navigation ul {
        flex-direction: column;
        text-align: center;
        gap: 2rem;
    }

    .main-navigation a {
        font-size: 1.5rem;
    }

    .mobile-menu-toggle {
        display: flex;
        z-index: 10001;
    }

    .mobile-menu-toggle.active span:nth-child(1) {
        transform: rotate(45deg) translate(5px, 5px);
    }

    .mobile-menu-toggle.active span:nth-child(2) {
        opacity: 0;
    }

    .mobile-menu-toggle.active span:nth-child(3) {
        transform: rotate(-45deg) translate(7px, -6px);
    }

    .container {
        padding: 0 1.5rem;
    }

    .section {
        padding: 3rem 0;
    }

    .wp-block-columns {
        flex-direction: column;
    }

    .glass-cards-container,
    .glass-gallery {
        grid-template-columns: 1fr;
    }

    .footer-contacts {
        flex-direction: column;
        gap: 1rem;
    }
}

/* ===================================
   UTILITIES
   =================================== */
.text-center {
    text-align: center;
}

.mb-0 {
    margin-bottom: 0;
}

.mb-1 {
    margin-bottom: 1rem;
}

.mb-2 {
    margin-bottom: 2rem;
}

.mb-3 {
    margin-bottom: 3rem;
}

.mt-0 {
    margin-top: 0;
}

.mt-1 {
    margin-top: 1rem;
}

.mt-2 {
    margin-top: 2rem;
}

.mt-3 {
    margin-top: 3rem;
}