/* =====================================================================
   themes/default/css/theme.css
   Stili di layout del tema Default — CMS SEO/AEO
   Caricato DOPO frontend.css, PRIMA delle CSS custom properties inline.
   ===================================================================== */

/* ── HEADER ──────────────────────────────────────────────────────── */
.site-header {
    background-color: var(--color-header, #1f2937);
    color: #fff;
    position: relative;
    z-index: 1000;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}
.site-header.header-sticky { position: sticky; top: 0; }

.header-inner {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    min-height: 64px;
    position: relative;
}

/* Logo */
.site-logo { display: flex; align-items: center; flex-shrink: 0; text-decoration: none; }
.logo-img   { max-height: 48px; width: auto; }
.logo-text  { font-family: var(--font-heading, serif); font-size: 1.4rem; font-weight: 700; color: #fff; }

/* Logo center layout */
.header-logo-center .header-inner { flex-direction: column; padding: 1rem 1.25rem 0; gap: 0.5rem; }
.header-logo-center .header-top   { width: 100%; display: flex; justify-content: center; padding-bottom: 0.5rem; }
.header-logo-center .header-bottom-bar {
    width: 100%; display: flex; align-items: center;
    justify-content: center; gap: 1.5rem;
    border-top: 1px solid rgba(255,255,255,0.15);
    padding: 0.5rem 0 0.75rem;
}
.header-logo-center .main-nav { flex: 1; }

/* Main Nav */
.main-nav { flex: 1; }
.nav-list  { display: flex; align-items: center; gap: 0.25rem; flex-wrap: wrap; }

.nav-item  { position: relative; }
.nav-item > a {
    display: block; padding: 0.5rem 0.85rem;
    color: rgba(255,255,255,0.9);
    font-weight: 500; font-size: 0.92rem;
    border-radius: 4px;
    transition: background 0.2s, color 0.2s;
    white-space: nowrap;
}
.nav-item > a:hover,
.nav-item > a:focus { background: rgba(255,255,255,0.12); color: #fff; text-decoration: none; }

/* Dropdown */
.nav-item.has-dropdown { cursor: pointer; }
.dropdown-arrow { font-size: 0.7em; margin-left: 4px; opacity: 0.7; }
.dropdown-menu {
    position: absolute; top: calc(100% + 4px); left: 0;
    background: #fff; border-radius: 6px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.15);
    min-width: 200px; opacity: 0; visibility: hidden;
    transform: translateY(-6px);
    transition: opacity 0.2s, transform 0.2s, visibility 0.2s;
    z-index: 200;
}
.nav-item.has-dropdown:hover .dropdown-menu,
.nav-item.has-dropdown:focus-within .dropdown-menu {
    opacity: 1; visibility: visible; transform: translateY(0);
}
.dropdown-menu .nav-item > a {
    color: var(--color-text, #1f2937);
    padding: 0.55rem 1rem;
    border-radius: 0;
    border-bottom: 1px solid #f3f4f6;
}
.dropdown-menu .nav-item:last-child > a { border-bottom: none; }
.dropdown-menu .nav-item > a:hover { background: #f9fafb; color: var(--color-primary, #2563eb); }

/* Header actions */
.header-actions { display: flex; align-items: center; gap: 0.75rem; flex-shrink: 0; }

/* Search toggle */
.search-toggle {
    background: none; border: none; color: rgba(255,255,255,0.85); cursor: pointer;
    padding: 0.4rem; border-radius: 4px; display: flex; align-items: center;
    transition: color 0.2s;
}
.search-toggle:hover { color: #fff; }

/* Language switcher */
.lang-switcher { display: flex; align-items: center; gap: 0.35rem; }
.lang-item {
    color: rgba(255,255,255,0.7); font-size: 0.78rem; font-weight: 600;
    padding: 0.25rem 0.45rem; border-radius: 3px;
    border: 1px solid rgba(255,255,255,0.2);
    transition: all 0.2s; text-transform: uppercase; text-decoration: none;
}
.lang-item:hover, .lang-item.active {
    background: var(--color-primary, #2563eb);
    border-color: var(--color-primary, #2563eb);
    color: #fff; text-decoration: none;
}

/* Hamburger */
.hamburger {
    display: none; flex-direction: column; gap: 4px; background: none; border: none;
    cursor: pointer; padding: 6px; border-radius: 4px;
}
.hamburger-line { width: 22px; height: 2px; background: #fff; border-radius: 2px; transition: all 0.3s; }
.hamburger.is-open .hamburger-line:nth-child(1) { transform: rotate(45deg) translate(4px, 4px); }
.hamburger.is-open .hamburger-line:nth-child(2) { opacity: 0; }
.hamburger.is-open .hamburger-line:nth-child(3) { transform: rotate(-45deg) translate(4px, -4px); }

/* Mobile nav */
.mobile-nav {
    display: none; position: absolute; top: 100%; left: 0; right: 0;
    background: var(--color-header, #1f2937);
    box-shadow: 0 8px 20px rgba(0,0,0,0.2);
    z-index: 900; max-height: 80vh; overflow-y: auto;
}
.mobile-nav.is-open { display: block; }
.mobile-nav-list { padding: 0.5rem 0 1rem; }
.mobile-nav-item > a {
    display: block; padding: 0.7rem 1.5rem;
    color: rgba(255,255,255,0.9); font-weight: 500;
    border-bottom: 1px solid rgba(255,255,255,0.07);
}
.mobile-nav-item > a:hover { background: rgba(255,255,255,0.08); text-decoration: none; color: #fff; }
.mobile-submenu { background: rgba(0,0,0,0.2); }
.mobile-submenu li a { padding: 0.55rem 2.5rem; display: block; color: rgba(255,255,255,0.75); font-size: 0.9rem; }
.mobile-submenu li a:hover { color: #fff; }
.mobile-lang { padding: 0.75rem 1.5rem; border-top: 1px solid rgba(255,255,255,0.1); }
.mobile-lang .lang-item { margin-right: 0.35rem; }

/* ── HERO SLIDER ─────────────────────────────────────────────────── */
.hero-slider {
    position: relative; overflow: hidden; background: #111;
    width: 100%; aspect-ratio: 16/6; min-height: 280px; max-height: 600px;
}
.slide {
    position: absolute; inset: 0;
    opacity: 0; transition: opacity 0.7s ease; pointer-events: none;
}
.slide.is-active { opacity: 1; pointer-events: auto; }
.slide img { width: 100%; height: 100%; object-fit: cover; }
.slide-overlay {
    position: absolute; inset: 0;
    background: linear-gradient(to bottom, rgba(0,0,0,0.15) 0%, rgba(0,0,0,0.55) 100%);
}
.slide-content {
    position: absolute; bottom: 0; left: 0; right: 0;
    padding: 2rem max(1.5rem, 5%); color: #fff;
}
.slide-title    { font-size: clamp(1.2rem, 3vw, 2rem); font-family: var(--font-heading, serif); text-shadow: 0 1px 4px rgba(0,0,0,0.4); margin-bottom: 0.35rem; }
.slide-subtitle { font-size: clamp(0.85rem, 1.5vw, 1rem); opacity: 0.9; margin-bottom: 0.75rem; }
.slide-cta {
    display: inline-block; padding: 0.5rem 1.25rem;
    background: var(--color-primary, #2563eb); color: #fff;
    border-radius: 4px; font-weight: 600; font-size: 0.9rem;
    text-decoration: none; transition: background 0.2s;
}
.slide-cta:hover { background: var(--color-secondary, #1e40af); text-decoration: none; color: #fff; }

.slider-prev, .slider-next {
    position: absolute; top: 50%; transform: translateY(-50%);
    background: rgba(0,0,0,0.4); border: none; color: #fff;
    width: 44px; height: 44px; border-radius: 50%; cursor: pointer;
    font-size: 1.3rem; display: flex; align-items: center; justify-content: center;
    z-index: 10; transition: background 0.2s;
}
.slider-prev { left: 1rem; }
.slider-next { right: 1rem; }
.slider-prev:hover, .slider-next:hover { background: rgba(0,0,0,0.65); }

.slider-dots {
    position: absolute; bottom: 1rem; left: 50%; transform: translateX(-50%);
    display: flex; gap: 0.45rem; z-index: 10;
}
.slider-dot {
    width: 9px; height: 9px; border-radius: 50%;
    background: rgba(255,255,255,0.5); border: none; cursor: pointer;
    transition: background 0.2s, transform 0.2s;
}
.slider-dot.is-active { background: #fff; transform: scale(1.25); }

/* ── PAGE HEADER ─────────────────────────────────────────────────── */
.page-header-section {
    background: #f9fafb; border-bottom: 1px solid #e5e7eb;
    padding: 2rem 0 1.5rem;
}
.page-title { margin-bottom: 0.5rem; }

/* ── BLOG LIST ───────────────────────────────────────────────────── */
.blog-grid { display: grid; gap: 2rem; }
.post-card {
    background: #fff; border: 1px solid #e5e7eb; border-radius: 10px;
    overflow: hidden; transition: box-shadow 0.2s, transform 0.2s;
    display: flex; flex-direction: column;
}
.post-card:hover { box-shadow: 0 8px 24px rgba(0,0,0,0.1); transform: translateY(-2px); }
.post-card-thumb { overflow: hidden; aspect-ratio: 16/9; background: #f3f4f6; }
.post-card-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.4s; }
.post-card:hover .post-card-thumb img { transform: scale(1.05); }
.post-card-body { padding: 1.25rem; flex: 1; display: flex; flex-direction: column; gap: 0.5rem; }
.post-card-meta { display: flex; align-items: center; gap: 0.75rem; font-size: 0.78rem; color: #6b7280; flex-wrap: wrap; }
.post-card-category {
    display: inline-block; background: var(--color-primary, #2563eb); color: #fff;
    padding: 0.15rem 0.6rem; border-radius: 20px; font-size: 0.72rem; font-weight: 600;
    text-decoration: none;
}
.post-card-category:hover { background: var(--color-secondary, #1e40af); text-decoration: none; color: #fff; }
.post-card-title { font-size: 1.1rem; font-family: var(--font-heading, serif); margin-bottom: 0; }
.post-card-title a { color: var(--color-text, #1f2937); text-decoration: none; }
.post-card-title a:hover { color: var(--color-primary, #2563eb); }
.post-card-excerpt { color: #4b5563; font-size: 0.9rem; flex: 1; }
.post-card-link { margin-top: auto; }
.btn-read-more {
    display: inline-block; padding: 0.45rem 1.1rem;
    background: transparent; border: 1.5px solid var(--color-primary, #2563eb);
    color: var(--color-primary, #2563eb); border-radius: 4px;
    font-size: 0.85rem; font-weight: 600; text-decoration: none;
    transition: all 0.2s;
}
.btn-read-more:hover { background: var(--color-primary, #2563eb); color: #fff; text-decoration: none; }

/* ── SINGLE POST ─────────────────────────────────────────────────── */
.post-meta-bar {
    display: flex; flex-wrap: wrap; align-items: center; gap: 1rem;
    font-size: 0.82rem; color: #6b7280; margin-bottom: 1.5rem;
}
.post-meta-bar a { color: var(--color-primary, #2563eb); }
.post-author-name { font-weight: 600; }

/* Share buttons */
.share-buttons { margin-top: 2.5rem; padding-top: 1.5rem; border-top: 1px solid #e5e7eb; }
.share-buttons h3 { font-size: 1rem; margin-bottom: 0.75rem; }
.share-list { display: flex; gap: 0.65rem; flex-wrap: wrap; }
.share-btn {
    display: inline-flex; align-items: center; gap: 0.4rem;
    padding: 0.5rem 1rem; border-radius: 4px;
    font-size: 0.82rem; font-weight: 600; text-decoration: none;
    transition: opacity 0.2s;
}
.share-btn:hover { opacity: 0.85; text-decoration: none; }
.share-btn.facebook  { background: #1877f2; color: #fff; }
.share-btn.twitter   { background: #000; color: #fff; }
.share-btn.linkedin  { background: #0077b5; color: #fff; }
.share-btn.whatsapp  { background: #25d366; color: #fff; }

/* ── SIDEBAR ─────────────────────────────────────────────────────── */
.sidebar { position: sticky; top: 80px; display: flex; flex-direction: column; gap: 1.5rem; }
.widget { background: #f9fafb; border-radius: 8px; padding: 1.25rem; }
.widget-title { font-size: 1rem; font-family: var(--font-heading, serif); font-weight: 700; margin-bottom: 1rem; padding-bottom: 0.5rem; border-bottom: 2px solid var(--color-primary, #2563eb); }
.widget ul { display: flex; flex-direction: column; gap: 0.5rem; }
.widget ul li a { color: var(--color-text, #1f2937); font-size: 0.9rem; }
.widget ul li a:hover { color: var(--color-primary, #2563eb); }
.widget-recent-post { display: flex; gap: 0.75rem; padding: 0.5rem 0; border-bottom: 1px solid #e5e7eb; }
.widget-recent-post:last-child { border-bottom: none; }
.widget-recent-thumb { width: 60px; height: 60px; border-radius: 6px; object-fit: cover; flex-shrink: 0; }
.widget-recent-info { flex: 1; }
.widget-recent-info a { color: var(--color-text, #1f2937); font-size: 0.85rem; font-weight: 600; line-height: 1.3; display: block; }
.widget-recent-info a:hover { color: var(--color-primary, #2563eb); }
.widget-recent-date { font-size: 0.75rem; color: #6b7280; }
.tag-cloud { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.tag-link { padding: 0.25rem 0.75rem; background: #e5e7eb; border-radius: 20px; font-size: 0.8rem; color: var(--color-text, #1f2937); text-decoration: none; transition: all 0.2s; }
.tag-link:hover { background: var(--color-primary, #2563eb); color: #fff; text-decoration: none; }

/* ── GALLERY ─────────────────────────────────────────────────────── */
.gallery-section { margin-top: 2.5rem; padding-top: 1.5rem; border-top: 1px solid #e5e7eb; }
.gallery-section h2 { margin-bottom: 1rem; }
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 0.75rem;
}
.gallery-item {
    position: relative; overflow: hidden; border-radius: 6px;
    aspect-ratio: 1; cursor: pointer; background: #f3f4f6;
}
.gallery-item img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.4s; }
.gallery-item:hover img { transform: scale(1.08); }
.gallery-item-overlay {
    position: absolute; inset: 0; background: rgba(0,0,0,0);
    display: flex; align-items: center; justify-content: center;
    transition: background 0.3s;
}
.gallery-item:hover .gallery-item-overlay { background: rgba(0,0,0,0.3); }
.gallery-zoom-icon { color: #fff; opacity: 0; font-size: 1.5rem; transition: opacity 0.3s; }
.gallery-item:hover .gallery-zoom-icon { opacity: 1; }

/* ── FAQ ACCORDION ───────────────────────────────────────────────── */
.faq-section { margin-top: 2.5rem; padding-top: 1.5rem; border-top: 1px solid #e5e7eb; }
.faq-section h2 { margin-bottom: 1.25rem; }
.faq-list { display: flex; flex-direction: column; gap: 0.5rem; }
.faq-item { border: 1px solid #e5e7eb; border-radius: 8px; overflow: hidden; }
.faq-question {
    width: 100%; background: #f9fafb; border: none; text-align: left;
    padding: 1rem 1.25rem; cursor: pointer;
    display: flex; justify-content: space-between; align-items: center; gap: 1rem;
    font-family: var(--font-heading, serif); font-weight: 600; font-size: 0.95rem;
    color: var(--color-text, #1f2937); transition: background 0.2s;
}
.faq-question:hover { background: #f3f4f6; }
.faq-question.is-open { background: var(--color-primary, #2563eb); color: #fff; }
.faq-icon { font-size: 1.2rem; flex-shrink: 0; transition: transform 0.3s; }
.faq-question.is-open .faq-icon { transform: rotate(45deg); }
.faq-answer { display: none; padding: 1rem 1.25rem; font-size: 0.92rem; line-height: 1.7; color: #374151; }
.faq-answer.is-open { display: block; }
.faq-answer p:last-child { margin-bottom: 0; }

/* ── FOOTER ──────────────────────────────────────────────────────── */
.site-footer {
    background-color: var(--color-footer, #111827);
    color: rgba(255,255,255,0.75);
    padding: 3.5rem 0 0;
    margin-top: 4rem;
}
.footer-grid { display: grid; gap: 2rem; margin-bottom: 2.5rem; }
.footer-grid.cols-1 { grid-template-columns: 1fr; }
.footer-grid.cols-2 { grid-template-columns: repeat(2, 1fr); }
.footer-grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.footer-grid.cols-4 { grid-template-columns: repeat(4, 1fr); }

.footer-widget-title {
    color: #fff; font-size: 0.95rem; font-weight: 700; font-family: var(--font-heading, serif);
    margin-bottom: 1rem; padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--color-primary, #2563eb);
    text-transform: uppercase; letter-spacing: 0.05em;
}
.footer-text { font-size: 0.88rem; line-height: 1.7; }
.footer-text p { margin-bottom: 0.5rem; }
.footer-nav { display: flex; flex-direction: column; gap: 0.4rem; }
.footer-nav a { color: rgba(255,255,255,0.65); font-size: 0.88rem; text-decoration: none; transition: color 0.2s; }
.footer-nav a:hover { color: #fff; text-decoration: none; }
.footer-contact-item { display: flex; align-items: flex-start; gap: 0.5rem; margin-bottom: 0.5rem; font-size: 0.88rem; }
.footer-contact-item svg { flex-shrink: 0; margin-top: 2px; }
.footer-social { display: flex; gap: 0.6rem; margin-top: 0.75rem; flex-wrap: wrap; }
.footer-social a {
    display: inline-flex; align-items: center; justify-content: center;
    width: 36px; height: 36px; border-radius: 50%;
    background: rgba(255,255,255,0.1); color: rgba(255,255,255,0.75);
    text-decoration: none; transition: all 0.2s; font-size: 0.9rem;
}
.footer-social a:hover { background: var(--color-primary, #2563eb); color: #fff; text-decoration: none; }

.footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.1);
    padding: 1rem 0;
    display: flex; justify-content: space-between; align-items: center;
    flex-wrap: wrap; gap: 0.5rem;
    font-size: 0.8rem; color: rgba(255,255,255,0.45);
}
.footer-bottom a { color: rgba(255,255,255,0.55); text-decoration: none; }
.footer-bottom a:hover { color: #fff; }

/* ── FORMS ───────────────────────────────────────────────────────── */
.form-group { margin-bottom: 1.25rem; }
.form-label { display: block; font-weight: 600; font-size: 0.9rem; margin-bottom: 0.4rem; color: var(--color-text, #1f2937); }
.form-control {
    width: 100%; padding: 0.65rem 0.9rem;
    border: 1.5px solid #d1d5db; border-radius: 6px;
    font-family: var(--font-body, sans-serif); font-size: 0.95rem;
    color: var(--color-text, #1f2937); background: #fff;
    transition: border-color 0.2s, box-shadow 0.2s;
    appearance: none;
}
.form-control:focus { outline: none; border-color: var(--color-primary, #2563eb); box-shadow: 0 0 0 3px rgba(37,99,235,0.12); }
textarea.form-control { resize: vertical; min-height: 120px; }
.btn-primary-submit {
    display: inline-block; padding: 0.7rem 2rem;
    background: var(--color-primary, #2563eb); color: #fff;
    border: none; border-radius: 6px; font-size: 0.95rem; font-weight: 600;
    cursor: pointer; text-decoration: none; transition: background 0.2s, transform 0.15s;
    font-family: var(--font-body, sans-serif);
}
.btn-primary-submit:hover { background: var(--color-secondary, #1e40af); transform: translateY(-1px); }
.btn-primary-submit:disabled { opacity: 0.6; cursor: not-allowed; }

/* ── ALERTS ──────────────────────────────────────────────────────── */
.alert { padding: 0.85rem 1.1rem; border-radius: 6px; margin-bottom: 1rem; font-size: 0.92rem; }
.alert-success { background: #ecfdf5; color: #065f46; border: 1px solid #a7f3d0; }
.alert-danger  { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }
.alert-info    { background: #eff6ff; color: #1e40af; border: 1px solid #bfdbfe; }
.alert-warning { background: #fffbeb; color: #92400e; border: 1px solid #fde68a; }

/* ── RESPONSIVE ──────────────────────────────────────────────────── */
@media (max-width: 1024px) {
    .footer-grid.cols-4 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 900px) {
    .content-with-sidebar-right,
    .content-with-sidebar-left { grid-template-columns: 1fr; }
    .sidebar { position: static; }

    .footer-grid.cols-3 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
    .main-nav { display: none; }
    .hamburger { display: flex; }
    .header-logo-center .header-inner { flex-direction: column; }
    .header-logo-center .header-bottom-bar { justify-content: flex-end; }
    .header-logo-center .main-nav { display: none; }

    .footer-grid.cols-2,
    .footer-grid.cols-3,
    .footer-grid.cols-4 { grid-template-columns: 1fr; }

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

    .blog-grid { grid-template-columns: 1fr; }
    .gallery-grid { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); }
}

@media (max-width: 480px) {
    .post-card-body { padding: 1rem; }
    .slide-content { padding: 1rem; }
}
