/* ==========================================
   LEENO DIGITAL MASONRY — MAIN STYLES
   ========================================== */

/* ——— CSS Variables ——— */
:root {
    --bg-primary:   #e5e5e5;
    --bg-dark:      #121a23;
    --accent-cyan:  #00e5ff;
    --accent-rust:  #ff4d2e;
    --accent-rust-hover: #ff6b50;
    --text-primary: #ffffff;
    --text-secondary: #8896ab;
    --text-dark:    #121a23;
    --font-display: 'Space Grotesk', sans-serif;
    --font-body:    'Inter', sans-serif;
    --font-mono:    'JetBrains Mono', monospace;
    --container:    1200px;
    --radius:       0px;
}

/* ——— Reset & Base ——— */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-body);
    background: var(--bg-primary);
    color: var(--text-dark);
    line-height: 1.6;
    overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-display);
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: -0.02em;
}

a {
    color: inherit;
    text-decoration: none;
    transition: color 0.2s, transform 0.2s;
}

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

::selection {
    background: var(--accent-cyan);
    color: var(--bg-dark);
}

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

.text-accent { color: var(--accent-cyan) !important; }

/* ——— Buttons ——— */
.btn-hero,
.btn-big {
    display: inline-block;
    background: var(--accent-rust);
    color: var(--bg-dark);
    font-family: var(--font-display);
    font-weight: 700;
    text-transform: uppercase;
    padding: 16px 48px;
    font-size: 1.1rem;
    letter-spacing: 0.05em;
    border: none;
    cursor: pointer;
    transition: background 0.2s, transform 0.2s;
}

.btn-hero:hover,
.btn-big:hover {
    background: var(--accent-rust-hover);
    transform: scale(1.05);
}

.btn-outline {
    display: inline-block;
    border: 2px solid var(--bg-dark);
    color: var(--bg-dark);
    font-family: var(--font-display);
    font-weight: 600;
    text-transform: uppercase;
    padding: 14px 36px;
    font-size: 0.9rem;
    letter-spacing: 0.05em;
    transition: all 0.2s;
}

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

/* ——— HEADER ——— */
.site-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 100;
    padding: 20px 0;
    transition: padding 0.3s, background 0.3s;
}

.site-header.scrolled {
    padding: 10px 0;
    background: rgba(18, 26, 35, 0.9);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.header-inner {
    max-width: var(--container);
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.site-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
    max-width: 160px;
    min-width: 0;
}

.site-logo img {
    height: 34px;
    width: auto;
    max-width: 90px;
    object-fit: contain;
    flex-shrink: 0;
}

.site-name {
    color: #fff;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1rem;
    letter-spacing: -0.02em;
    white-space: nowrap;
}

/* Navigation */
.main-nav {
    position: relative;
    flex: 1 1 auto;
    min-width: 0;
    overflow: visible;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 0;
    margin: 0;
    padding: 0;
    flex-wrap: nowrap;
    justify-content: flex-end; /* allinea le voci a destra nel nav */
}

.nav-menu > li {
    position: relative;
}

/* Top-level links */
.nav-menu > li > a {
    display: block;
    color: rgba(255,255,255,0.8);
    font-size: 0.75rem;        /* leggermente più piccolo per stare in riga */
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 8px 10px;         /* ridotto da 16px per guadagnare spazio */
    transition: color 0.2s;
    white-space: nowrap;
}

.nav-menu > li > a:hover {
    color: var(--accent-cyan);
}

.nav-menu > li.current-menu-item > a,
.nav-menu > li.current-menu-ancestor > a {
    color: var(--accent-cyan);
}

/* Sub-menu (dropdown) — hidden by default */
.nav-menu .sub-menu {
    display: block;
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 220px;
    background: var(--bg-dark);
    border: 1px solid rgba(0,229,255,0.15);
    list-style: none;
    margin: 0;
    padding: 8px 0;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: opacity 0.25s, visibility 0.25s, transform 0.25s;
    z-index: 200;
}

/* Show sub-menu on hover */
.nav-menu > li:hover > .sub-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* Sub-menu items */
.nav-menu .sub-menu li {
    display: block;
}

.nav-menu .sub-menu li a {
    display: block;
    color: rgba(255,255,255,0.7);
    font-size: 0.8rem;
    font-weight: 400;
    text-transform: none;
    letter-spacing: 0.02em;
    padding: 8px 20px;
    transition: all 0.2s;
    white-space: nowrap;
}

.nav-menu .sub-menu li a:hover {
    color: var(--accent-cyan);
    background: rgba(0,229,255,0.08);
    padding-left: 24px;
}

/* Nested sub-menus (3rd level) */
.nav-menu .sub-menu .sub-menu {
    top: 0;
    left: 100%;
    margin-left: 1px;
}

/* Arrow indicator for items with children */
.nav-menu > li.menu-item-has-children > a::after {
    content: '\25bc';
    font-size: 0.5rem;
    margin-left: 6px;
    vertical-align: middle;
    opacity: 0.5;
}

.btn-download {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    background: var(--accent-rust);
    color: var(--bg-dark);
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 0.75rem;
    text-transform: uppercase;
    padding: 10px 18px;
    letter-spacing: 0.05em;
    transition: background 0.2s, transform 0.2s;
    flex-shrink: 0;         /* non si restringe mai */
    white-space: nowrap;
}

.btn-download:hover {
    background: var(--accent-rust-hover);
    transform: scale(1.05);
}

/* Mobile menu toggle */
.menu-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
}

.menu-toggle span {
    display: block;
    width: 24px;
    height: 2px;
    background: #fff;
    transition: all 0.3s;
}

.menu-toggle.open span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.menu-toggle.open span:nth-child(2) {
    opacity: 0;
}

.menu-toggle.open span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

/* ——— HERO ——— */
.hero-section {
    position: relative;
    width: 100%;
    height: 100vh;
    min-height: 600px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hero-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.hero-content {
    position: relative;
    z-index: 10;
    text-align: center;
    padding: 0 24px;
}

.hero-title {
    color: #fff;
    font-size: clamp(2.5rem, 8vw, 7rem);
    line-height: 0.9;
    text-transform: uppercase;
    text-shadow: 0 4px 30px rgba(0,0,0,0.5);
    margin-bottom: 24px;
}

.word-wrap {
    display: inline-block;
    overflow: hidden;
    margin: 0 6px;
}

.word-inner {
    display: inline-block;
}

.hero-subtitle {
    color: rgba(255,255,255,0.6);
    font-size: 1.1rem;
    font-weight: 300;
    letter-spacing: 0.03em;
    margin-bottom: 32px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.version-badge {
    font-family: var(--font-mono);
    color: var(--accent-cyan);
    font-size: 0.85rem;
}

/* ——— TRANSITION SECTION ——— */
.transition-section {
    position: relative;
    width: 100%;
    min-height: 60vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-dark);
    overflow: hidden;
}

.cad-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.transition-text {
    position: relative;
    z-index: 10;
    text-align: center;
    padding: 0 24px;
    max-width: 900px;
}

.transition-text p {
    color: #fff;
    font-family: var(--font-display);
    font-size: clamp(1.3rem, 3.5vw, 2.5rem);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    line-height: 1.2;
}

/* ——— FEATURES ——— */
.features-section {
    background: var(--bg-primary);
    padding: 100px 0;
}

.section-title {
    font-size: clamp(2rem, 5vw, 4rem);
    color: var(--text-dark);
    text-transform: uppercase;
    text-align: center;
    margin-bottom: 64px;
}

.section-title-dark {
    color: var(--text-dark);
}

.title-word-outer {
    display: inline-block;
    overflow: hidden;
    padding-right: 0;
}

.title-word-inner {
    display: inline-block;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 32px;
    margin-bottom: 80px;
}

.feature-card {
    background: #fff;
    padding: 40px 32px;
    border-left: 4px solid var(--accent-cyan);
    transition: transform 0.3s, box-shadow 0.3s;
}

.feature-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
}

.feature-icon {
    width: 48px;
    height: 48px;
    background: var(--bg-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 24px;
    transition: background 0.3s;
}

.feature-icon svg {
    color: var(--accent-cyan);
    transition: color 0.3s;
}

.feature-card:hover .feature-icon {
    background: var(--accent-cyan);
}

.feature-card:hover .feature-icon svg {
    color: var(--bg-dark);
}

.feature-title {
    font-size: 1.2rem;
    text-transform: uppercase;
    letter-spacing: -0.01em;
    margin-bottom: 12px;
    color: var(--text-dark);
}

.feature-desc {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.7;
}

/* Screenshot */
.screenshot-wrap {
    position: relative;
    margin-top: 40px;
}

.screenshot-frame {
    border: 2px solid var(--bg-dark);
    overflow: hidden;
}

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

.screenshot-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    background: var(--bg-dark);
    padding: 12px 24px;
}

.caption-text {
    font-family: var(--font-mono);
    color: var(--accent-cyan);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

/* ——— METRICS ——— */
.metrics-section {
    position: relative;
    background: var(--bg-dark);
    padding: 100px 0;
    overflow: hidden;
}

.metrics-section .relative {
    position: relative;
    z-index: 10;
}

.metrics-heading {
    color: #fff;
    font-size: clamp(1.5rem, 4vw, 3rem);
    text-align: center;
    margin-bottom: 64px;
}

.metrics-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 40px;
    margin-bottom: 80px;
}

.metric-item {
    text-align: center;
}

.metric-number {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 4px;
    margin-bottom: 8px;
}

.flip-stat {
    font-family: var(--font-mono);
    font-size: clamp(2.5rem, 6vw, 4.5rem);
    font-weight: 700;
    color: #fff;
    line-height: 1;
}

.metric-suffix {
    font-family: var(--font-display);
    font-size: clamp(1.5rem, 3vw, 2.5rem);
    font-weight: 700;
    color: var(--accent-cyan);
}

.metric-label {
    color: var(--text-secondary);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

/* Prezzari */
.prezzari-section {
    border-top: 1px solid rgba(255,255,255,0.1);
    padding-top: 64px;
}

.prezzari-title {
    color: #fff;
    font-size: clamp(1.2rem, 2.5vw, 1.8rem);
    text-align: center;
    margin-bottom: 32px;
}

.prezzari-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
}

.prezzari-tag {
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    padding: 12px 16px;
    text-align: center;
    color: rgba(255,255,255,0.8);
    font-family: var(--font-mono);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    transition: all 0.2s;
    cursor: default;
}

.prezzari-tag:hover {
    background: rgba(0,229,255,0.1);
    border-color: rgba(0,229,255,0.3);
}

/* ——— BLOG SECTION ——— */
.blog-section {
    background: var(--bg-primary);
    padding: 100px 0;
}

.posts-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 32px;
}

.post-card {
    background: #fff;
    overflow: hidden;
    transition: transform 0.3s, box-shadow 0.3s;
}

.post-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 24px 48px rgba(0,0,0,0.12);
}

.post-thumb {
    display: block;
    overflow: hidden;
    aspect-ratio: 16 / 10;
}

.post-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s;
}

.post-card:hover .post-img {
    transform: scale(1.05);
}

.post-body {
    padding: 24px;
}

.post-meta {
    display: flex;
    gap: 12px;
    margin-bottom: 12px;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.post-cat {
    color: var(--accent-cyan);
    font-weight: 600;
}

.post-date {
    color: var(--text-secondary);
}

.post-title {
    font-size: 1.1rem;
    margin-bottom: 10px;
    line-height: 1.3;
}

.post-title a {
    color: var(--text-dark);
    transition: color 0.2s;
}

.post-title a:hover {
    color: var(--accent-rust);
}

.post-excerpt {
    color: var(--text-secondary);
    font-size: 0.85rem;
    line-height: 1.6;
    margin-bottom: 16px;
}

.post-read {
    color: var(--bg-dark);
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    transition: color 0.2s;
}

.post-read:hover {
    color: var(--accent-rust);
}

.no-posts {
    grid-column: 1 / -1;
    text-align: center;
    color: var(--text-secondary);
    padding: 40px;
}

.view-all {
    text-align: center;
    margin-top: 48px;
}

/* ——— PAGE / SINGLE ——— */
.page-content,
.single-content {
    padding-top: 100px;
    min-height: 60vh;
}

.page-header {
    background: var(--bg-dark);
    padding: 80px 0 40px;
    margin-bottom: 48px;
}

.page-title {
    color: #fff;
    font-size: clamp(1.8rem, 4vw, 3rem);
    text-transform: uppercase;
}

.page-desc {
    color: var(--text-secondary);
    margin-top: 12px;
}

.content-layout {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 48px;
}

.content-main {
    min-width: 0;
}

.content-sidebar {
    border-left: 1px solid rgba(0,0,0,0.08);
    padding-left: 32px;
}

.widget {
    margin-bottom: 32px;
}

.widget-title {
    font-family: var(--font-display);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--accent-cyan);
}

.widget a {
    color: var(--text-secondary);
    font-size: 0.85rem;
    transition: color 0.2s;
}

.widget a:hover {
    color: var(--accent-cyan);
}

.widget ul {
    list-style: none;
}

.widget li {
    padding: 6px 0;
    border-bottom: 1px solid rgba(0,0,0,0.05);
}

/* Single article */
.single-header {
    background: var(--bg-dark);
    padding: 100px 0 48px;
}

.single-meta {
    display: flex;
    gap: 16px;
    margin-bottom: 16px;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.single-cat { color: var(--accent-cyan); font-weight: 600; }
.single-date { color: var(--text-secondary); }
.single-author { color: rgba(255,255,255,0.5); }

.single-title {
    color: #fff;
    font-size: clamp(1.6rem, 3.5vw, 2.8rem);
    text-transform: uppercase;
    max-width: 800px;
}

.single-featured {
    padding: 32px 0 0;
    background: var(--bg-dark);
}

.single-img {
    width: 100%;
    max-height: 500px;
    object-fit: cover;
}

.single-body {
    padding: 48px 0;
}

.entry-content {
    font-size: 1rem;
    line-height: 1.8;
    color: var(--text-dark);
}

.entry-content h2,
.entry-content h3 {
    margin: 32px 0 16px;
    color: var(--text-dark);
}

.entry-content p {
    margin-bottom: 16px;
}

.entry-content a {
    color: var(--accent-rust);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.entry-content a:hover {
    color: var(--accent-rust-hover);
}

.entry-content img {
    margin: 24px 0;
    border-radius: var(--radius);
}

.entry-content ul,
.entry-content ol {
    margin: 16px 0 16px 24px;
}

.entry-content blockquote {
    border-left: 4px solid var(--accent-cyan);
    padding-left: 20px;
    margin: 24px 0;
    color: var(--text-secondary);
    font-style: italic;
}

.post-navigation {
    display: flex;
    justify-content: space-between;
    margin-top: 48px;
    padding-top: 24px;
    border-top: 1px solid rgba(0,0,0,0.1);
}

.nav-prev,
.nav-next {
    font-family: var(--font-display);
    font-size: 0.85rem;
    color: var(--text-secondary);
    transition: color 0.2s;
}

.nav-prev:hover,
.nav-next:hover {
    color: var(--accent-rust);
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 48px;
}

.pagination a,
.pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 12px;
    background: #fff;
    color: var(--text-dark);
    font-family: var(--font-display);
    font-size: 0.85rem;
    font-weight: 600;
    transition: all 0.2s;
}

.pagination a:hover {
    background: var(--accent-cyan);
    color: var(--bg-dark);
}

.pagination .current {
    background: var(--bg-dark);
    color: #fff;
}

/* Breadcrumbs */
.breadcrumbs {
    color: var(--text-secondary);
    font-size: 0.8rem;
    margin-top: 12px;
}

.breadcrumbs a {
    color: var(--accent-cyan);
}

/* ——— FOOTER ——— */
.footer-cta {
    background: var(--bg-dark);
    padding: 80px 0;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.footer-links-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    margin-bottom: 64px;
}

.footer-cta-card {
    display: block;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    padding: 32px;
    transition: all 0.3s;
}

.footer-cta-card:hover {
    background: rgba(0,229,255,0.1);
    border-color: rgba(0,229,255,0.4);
}

.cta-card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.cta-card-header svg {
    color: var(--accent-cyan);
    flex-shrink: 0;
}

.cta-title {
    font-family: var(--font-display);
    font-size: clamp(1rem, 2vw, 1.3rem);
    font-weight: 700;
    color: #fff;
    transition: color 0.2s;
}

.footer-cta-card:hover .cta-title {
    color: var(--accent-cyan);
}

.cta-card-header svg:last-child {
    color: rgba(255,255,255,0.3);
    margin-left: auto;
    transition: color 0.2s;
}

.footer-cta-card:hover .cta-card-header svg:last-child {
    color: var(--accent-cyan);
}

.cta-desc {
    color: var(--text-secondary);
    font-family: var(--font-mono);
    font-size: 0.8rem;
}

.footer-big-cta {
    text-align: center;
}

.btn-big {
    display: inline-block;
    background: var(--accent-rust);
    color: var(--bg-dark);
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.3rem;
    text-transform: uppercase;
    padding: 20px 64px;
    letter-spacing: 0.05em;
    transition: background 0.2s, transform 0.2s;
}

.btn-big:hover {
    background: var(--accent-rust-hover);
    transform: scale(1.05);
}

.btn-sub {
    display: block;
    color: var(--text-secondary);
    font-family: var(--font-mono);
    font-size: 0.8rem;
    margin-top: 16px;
}

.footer-bottom {
    background: var(--bg-dark);
    padding: 40px 0;
}

.footer-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 32px;
}

.footer-brand {
    display: flex;
    align-items: center;
    gap: 16px;
}

.footer-logo {
    height: 32px;
    width: auto;
}

.footer-license {
    color: rgba(255,255,255,0.4);
    font-family: var(--font-mono);
    font-size: 0.75rem;
}

.footer-external {
    display: flex;
    flex-wrap: wrap;
    gap: 24px;
}

.footer-external a {
    color: var(--text-secondary);
    font-family: var(--font-mono);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    transition: color 0.2s, transform 0.2s;
}

.footer-external a:hover {
    color: var(--accent-cyan);
    transform: skewX(-10deg);
}

.footer-copyright {
    text-align: center;
    padding-top: 24px;
    border-top: 1px solid rgba(255,255,255,0.05);
}

.footer-copyright p {
    color: rgba(255,255,255,0.3);
    font-family: var(--font-mono);
    font-size: 0.7rem;
}

/* ——— RESPONSIVE ——— */
@media (max-width: 1024px) {
    .features-grid { grid-template-columns: repeat(2, 1fr); }
    .metrics-grid { grid-template-columns: repeat(2, 1fr); gap: 32px; }
    .posts-grid { grid-template-columns: repeat(2, 1fr); }
    .prezzari-grid { grid-template-columns: repeat(2, 1fr); }
    .content-layout { grid-template-columns: 1fr; }
    .content-sidebar { display: none; }
}

@media (max-width: 768px) {
    .main-nav { display: none; }
    .btn-download { display: none; }
    .menu-toggle { display: flex; }

    .main-nav.active {
        display: block;
        position: fixed;
        top: 60px;
        left: 0;
        right: 0;
        bottom: 0;
        background: var(--bg-dark);
        z-index: 99;
        overflow-y: auto;
        padding: 24px 32px;
    }

    .main-nav.active .nav-menu {
        display: flex;
        flex-direction: column;
        gap: 0;
    }

    .main-nav.active .nav-menu > li > a {
        padding: 14px 0;
        font-size: 1rem;
        border-bottom: 1px solid rgba(255,255,255,0.08);
    }

    /* Mobile: sub-menus always visible (accordion style) */
    .main-nav.active .nav-menu .sub-menu {
        position: static;
        opacity: 1;
        visibility: visible;
        transform: none;
        display: none;
        background: rgba(0,0,0,0.2);
        border: none;
        min-width: auto;
        padding: 0 0 0 16px;
        margin: 0;
    }

    .main-nav.active .nav-menu > li.submenu-open > .sub-menu {
        display: block;
    }

    .main-nav.active .nav-menu .sub-menu li a {
        padding: 10px 16px;
        font-size: 0.9rem;
    }

    .features-grid { grid-template-columns: 1fr; }
    .metrics-grid { grid-template-columns: 1fr 1fr; }
    .posts-grid { grid-template-columns: 1fr; }
    .footer-links-grid { grid-template-columns: 1fr; }
    .prezzari-grid { grid-template-columns: 1fr 1fr; }
    .footer-row { flex-direction: column; gap: 24px; text-align: center; }
    .footer-external { justify-content: center; }

    .hero-section { min-height: 500px; }
    .hero-title { font-size: clamp(2rem, 10vw, 4rem); }

    .btn-hero,
    .btn-big {
        padding: 14px 32px;
        font-size: 1rem;
    }

    .page-header { padding: 60px 0 32px; }
}

@media (max-width: 480px) {
    .metrics-grid { grid-template-columns: 1fr; }
    .prezzari-grid { grid-template-columns: 1fr; }
    .flip-stat { font-size: 3rem; }
    .metric-suffix { font-size: 1.8rem; }
}

/* ——— SCROLLBAR ——— */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-tr

/* ============================================================
   IMPROVEMENTS v1.1
   ============================================================ */

/* ——— Skip link accessibility ——— */
.skip-link {
    position: absolute;
    top: -100px;
    left: 16px;
    background: var(--accent-cyan);
    color: var(--bg-dark);
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 0.85rem;
    padding: 10px 20px;
    z-index: 9999;
    transition: top 0.2s;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.skip-link:focus {
    top: 8px;
}

/* ——— Header scrolled: border bottom ——— */
.site-header.scrolled {
    border-bottom: 1px solid rgba(0, 229, 255, 0.12);
}

/* ——— Nav: active page indicator ——— */
.nav-menu > li > a {
    position: relative;
}
.nav-menu > li > a::before {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 16px;
    right: 16px;
    height: 2px;
    background: var(--accent-cyan);
    transform: scaleX(0);
    transition: transform 0.25s ease;
}
.nav-menu > li.current-menu-item > a::before,
.nav-menu > li.current-menu-ancestor > a::before {
    transform: scaleX(1);
}
.nav-menu > li > a:hover::before {
    transform: scaleX(1);
}

/* ——— Btn download: aggiunta icona ——— */
.btn-download {
    display: inline-flex;
    align-items: center;
    gap: 7px;
}

/* ——— Hero: doppio CTA ——— */
.hero-ctas {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    flex-wrap: wrap;
}

.btn-hero {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-hero-ghost {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: rgba(255, 255, 255, 0.75);
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border: 2px solid rgba(255, 255, 255, 0.25);
    padding: 14px 32px;
    transition: all 0.25s;
}
.btn-hero-ghost:hover {
    color: #fff;
    border-color: rgba(255, 255, 255, 0.6);
    background: rgba(255, 255, 255, 0.06);
}
.btn-hero-ghost svg {
    transition: transform 0.25s;
}
.btn-hero-ghost:hover svg {
    transform: translateY(3px);
}

/* ——— Hero: scroll hint ——— */
.hero-scroll-hint {
    position: absolute;
    bottom: 32px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
    display: flex;
    justify-content: center;
}
.hero-scroll-hint span {
    display: block;
    width: 1px;
    height: 48px;
    background: linear-gradient(to bottom, rgba(255,255,255,0.5), transparent);
    animation: scrollHint 1.8s ease-in-out infinite;
}
@keyframes scrollHint {
    0%, 100% { opacity: 0.3; transform: scaleY(1); }
    50%       { opacity: 1;   transform: scaleY(1.15); }
}

/* ——— Feature cards: hover migliorato ——— */
.feature-card {
    position: relative;
    border-left: none;
    border-bottom: 4px solid transparent;
    transition: transform 0.3s, box-shadow 0.3s, border-color 0.3s;
}
.feature-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--accent-cyan);
    transition: width 0.3s ease;
}
.feature-card:hover::before {
    width: 100%;
    opacity: 0.04;
}
.feature-card::after {
    content: '';
    position: absolute;
    inset: 0;
    left: 4px;
    pointer-events: none;
}

/* ——— Metriche: transizione al reveal ——— */
.metric-item {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}
.metric-item.is-visible {
    opacity: 1;
    transform: translateY(0);
}
.metric-item:nth-child(1) { transition-delay: 0.05s; }
.metric-item:nth-child(2) { transition-delay: 0.15s; }
.metric-item:nth-child(3) { transition-delay: 0.25s; }
.metric-item:nth-child(4) { transition-delay: 0.35s; }

/* ——— Prezzari tag: linkabili ——— */
a.prezzari-tag {
    text-decoration: none;
    cursor: pointer;
    display: block;
}
a.prezzari-tag:hover {
    background: rgba(0, 229, 255, 0.12);
    border-color: rgba(0, 229, 255, 0.4);
    color: var(--accent-cyan);
    transform: translateY(-2px);
    transition: all 0.2s;
}

/* ============================================================
   WP FILEBASE — stile personalizzato
   ============================================================ */

/* Wrapper generale della pagina prezzari */
.wpfb-cat-list,
.wpfb-file-list,
#wpfb-all-files {
    font-family: var(--font-body);
}

/* Intestazione categoria (Puglia, RFI, ecc.) */
.wpfb-cat-header,
.wpfb-catname,
h3.wpfb-cat,
.wpfb-cat-title {
    background: var(--bg-dark) !important;
    color: #fff !important;
    font-family: var(--font-display) !important;
    font-weight: 700 !important;
    font-size: 0.95rem !important;
    text-transform: uppercase !important;
    letter-spacing: 0.06em !important;
    padding: 10px 20px !important;
    margin: 0 0 0 0 !important;
    border-left: 4px solid var(--accent-cyan) !important;
}

/* Tabella file */
table.wpfb-table,
.wpfb-file-list table,
#wpfb-all-files table {
    width: 100% !important;
    border-collapse: collapse !important;
    margin: 0 0 32px 0 !important;
    background: #fff !important;
    font-size: 0.88rem !important;
}

/* Intestazione colonne */
table.wpfb-table thead th,
.wpfb-file-list table thead th {
    background: rgba(18, 26, 35, 0.06) !important;
    color: var(--text-dark) !important;
    font-family: var(--font-display) !important;
    font-weight: 700 !important;
    font-size: 0.75rem !important;
    text-transform: uppercase !important;
    letter-spacing: 0.06em !important;
    padding: 10px 16px !important;
    border-bottom: 2px solid var(--bg-dark) !important;
    text-align: left !important;
}

/* Righe dati */
table.wpfb-table tbody tr,
.wpfb-file-list table tbody tr {
    border-bottom: 1px solid rgba(0, 0, 0, 0.06) !important;
    transition: background 0.15s !important;
}
table.wpfb-table tbody tr:nth-child(even),
.wpfb-file-list table tbody tr:nth-child(even) {
    background: rgba(0, 0, 0, 0.025) !important;
}
table.wpfb-table tbody tr:hover,
.wpfb-file-list table tbody tr:hover {
    background: rgba(0, 229, 255, 0.06) !important;
}

/* Celle dati */
table.wpfb-table tbody td,
.wpfb-file-list table tbody td {
    padding: 10px 16px !important;
    color: var(--text-dark) !important;
    vertical-align: middle !important;
}

/* Nome file: link */
.wpfb-table .wpfb-filename a,
.wpfb-file-list .wpfb-filename a {
    color: var(--text-dark) !important;
    font-weight: 500 !important;
    text-decoration: none !important;
    transition: color 0.2s !important;
}
.wpfb-table .wpfb-filename a:hover,
.wpfb-file-list .wpfb-filename a:hover {
    color: var(--accent-rust) !important;
}

/* Dimensione file e contatore: stile mono badge */
.wpfb-table .wpfb-filesize,
.wpfb-file-list .wpfb-filesize,
.wpfb-table .wpfb-hits,
.wpfb-file-list .wpfb-hits {
    font-family: var(--font-mono) !important;
    font-size: 0.78rem !important;
    color: var(--text-secondary) !important;
    white-space: nowrap !important;
}

/* Pulsante download inline */
.wpfb-dl-btn,
.wpfb-button,
a.wpfb-dl-btn,
.wpfb-table .dl-button a,
.wpfb-file-list .dl-button a {
    display: inline-flex !important;
    align-items: center !important;
    gap: 6px !important;
    background: var(--accent-rust) !important;
    color: var(--bg-dark) !important;
    font-family: var(--font-display) !important;
    font-weight: 700 !important;
    font-size: 0.72rem !important;
    text-transform: uppercase !important;
    letter-spacing: 0.05em !important;
    padding: 6px 14px !important;
    border: none !important;
    border-radius: 0 !important;
    text-decoration: none !important;
    transition: background 0.2s, transform 0.2s !important;
    cursor: pointer !important;
    white-space: nowrap !important;
}
.wpfb-dl-btn:hover,
.wpfb-button:hover,
.wpfb-table .dl-button a:hover,
.wpfb-file-list .dl-button a:hover {
    background: var(--accent-rust-hover) !important;
    transform: scale(1.04) !important;
}

/* Icona download nei link wpfb */
.wpfb-table .wpfb-filename .wpfb-icon,
.wpfb-file-list .wpfb-filename .wpfb-icon {
    opacity: 0.5;
    margin-right: 6px;
    vertical-align: middle;
}

/* Separatore tra categorie */
.wpfb-cat-block,
.wpfb-cat-section {
    margin-bottom: 40px !important;
    border: 1px solid rgba(0, 0, 0, 0.08) !important;
    overflow: hidden !important;
}

/* Header di pagina Prezzari */
.page-prezzari .page-header {
    padding-bottom: 32px;
}
.prezzari-search-bar {
    margin-top: 20px;
    max-width: 420px;
}
.prezzari-search-bar input[type="text"] {
    width: 100%;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
    font-family: var(--font-body);
    font-size: 0.9rem;
    padding: 10px 16px;
    outline: none;
    transition: border-color 0.2s;
}
.prezzari-search-bar input[type="text"]::placeholder {
    color: rgba(255, 255, 255, 0.4);
}
.prezzari-search-bar input[type="text"]:focus {
    border-color: var(--accent-cyan);
}

/* ============================================================
   Tabelle nei post (entry-content)
   ============================================================ */
.entry-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 24px 0;
    font-size: 0.88rem;
    overflow: hidden;
}
.entry-content table thead th {
    background: var(--bg-dark);
    color: #fff;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 10px 14px;
    text-align: left;
}
.entry-content table tbody tr:nth-child(even) {
    background: rgba(0, 0, 0, 0.03);
}
.entry-content table tbody td {
    padding: 9px 14px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.07);
    color: var(--text-dark);
    vertical-align: middle;
}
.entry-content table tbody tr:hover {
    background: rgba(0, 229, 255, 0.05);
}

/* ============================================================
   Breadcrumb — stile migliorato
   ============================================================ */
.breadcrumbs {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    font-size: 0.78rem;
    color: var(--text-secondary);
    margin-top: 14px;
}
.breadcrumbs a {
    color: rgba(255, 255, 255, 0.5);
    transition: color 0.2s;
}
.breadcrumbs a:hover {
    color: var(--accent-cyan);
}
.breadcrumbs .sep {
    color: rgba(255, 255, 255, 0.2);
    font-size: 0.7rem;
}
.breadcrumbs .current {
    color: var(--accent-cyan);
    font-weight: 500;
}

/* ============================================================
   Responsive tweaks per le novità
   ============================================================ */
@media (max-width: 480px) {
    .hero-ctas { flex-direction: column; align-items: stretch; }
    .btn-hero-ghost { text-align: center; justify-content: center; }
    .wpfb-table .wpfb-hits { display: none; }
}
