/*
Theme Name: Preghierai
Description: Un tema WordPress basato su design social per condividere preghiere, poesie e contenuti spirituali
Version: 1.0
Author: Byte Systems
*/

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    overflow-x: hidden;
    max-width: 100%;
}

:root {
    --primary-color: #e6d3a7;
    --secondary-color: #c5b693;
    --background-color: #ffffff;
    --surface-color: #f9f6f1;
    --text-primary: #2c2c2c;
    --text-secondary: #6c6c6c;
    --border-color: #e0d5c4;
    --hover-color: #f2ead9;
    --success-color: #4caf50;
    --danger-color: #f44336;
    --warning-color: #ff9800;
    --dark-overlay: rgba(0, 0, 0, 0.05);
}

[data-theme="dark"] {
    --background-color: #1a1a1a;
    --surface-color: #2d2d2d;
    --text-primary: #ffffff;
    --text-secondary: #cccccc;
    --border-color: #404040;
    --hover-color: #333333;
    --dark-overlay: rgba(255, 255, 255, 0.05);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: var(--background-color);
    color: var(--text-primary);
    line-height: 1.6;
}

/* Prevent horizontal overflow globally */
img, video, iframe, embed, object {
    max-width: 100%;
    height: auto;
}

table {
    max-width: 100%;
    overflow-x: auto;
    display: block;
}

pre, code {
    max-width: 100%;
    overflow-x: auto;
}

/* Header */
.site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 100px;
    background-color: var(--background-color);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    z-index: 1000;
    box-shadow: 0 2px 10px var(--dark-overlay);
}

.site-logo:hover {
    color: var(--secondary-color);
}

.main-nav {
    display: flex;
    align-items: center;
    gap: 30px;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 20px;
}

.nav-menu a {
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 500;
    padding: 8px 16px;
    border-radius: 20px;
    transition: all 0.3s ease;
}

.nav-menu a:hover {
    background-color: var(--hover-color);
    color: var(--primary-color);
}

.user-actions {
    display: flex;
    align-items: center;
    gap: 15px;
}

.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    font-weight: 500;
    text-decoration: none;
    display: inline-block;
    text-align: center;
    transition: all 0.3s ease;
}

.btn-primary {
    background-color: var(--primary-color);
    color: var(--text-primary);
}

.btn-primary:hover {
    background-color: var(--secondary-color);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(230, 211, 167, 0.3);
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
}

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

.btn-icon {
    background: none;
    border: none;
    padding: 10px;
    border-radius: 50%;
    cursor: pointer;
    color: var(--text-secondary);
    font-size: 20px;
    transition: all 0.3s ease;
}

.btn-icon:hover {
    background-color: var(--hover-color);
    color: var(--primary-color);
}

/* Main Content */
.main-content {
    margin-top: 60px;
    min-height: calc(100vh - 60px);
    padding: 40px 20px;
    width: 100%;
    overflow-x: hidden;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    width: 100%;
}

/* Grid Layout */
.content-grid {
    display: grid;
    grid-template-columns: 250px 1fr 300px;
    gap: 40px;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}

/* Sidebar */
.sidebar {
    background-color: var(--surface-color);
    border-radius: 20px;
    padding: 30px;
    height: fit-content;
    position: sticky;
    top: 100px;
    border: 1px solid var(--border-color);
}

.sidebar h3 {
    color: var(--primary-color);
    margin-bottom: 20px;
    font-size: 20px;
}

.sidebar-menu {
    list-style: none;
}

.sidebar-menu li {
    margin-bottom: 15px;
}

.sidebar-menu a {
    color: var(--text-primary);
    text-decoration: none;
    padding: 12px 16px;
    border-radius: 15px;
    display: block;
    transition: all 0.3s ease;
}

.sidebar-menu a:hover {
    background-color: var(--hover-color);
    color: var(--primary-color);
}

.sidebar-menu a.current {
    background-color: var(--primary-color);
    color: var(--text-primary);
}

/* Post Content */
.post-content {
    background-color: var(--surface-color);
    border-radius: 20px;
    padding: 40px;
    margin-bottom: 15px;
    border: 1px solid var(--border-color);
}

.post-content h1 {
    color: var(--primary-color);
    margin-bottom: 20px;
    font-size: 2.5em;
}

.post-content h2 {
    color: var(--secondary-color);
    margin: 30px 0 15px 0;
    font-size: 2em;
}

.post-content h3 {
    color: var(--text-primary);
    margin: 25px 0 10px 0;
    font-size: 1.5em;
}

.post-content p {
    margin-bottom: 20px;
    line-height: 1.8;
}

.post-content blockquote {
    background-color: var(--hover-color);
    border-left: 4px solid var(--primary-color);
    padding: 20px;
    margin: 20px 0;
    border-radius: 10px;
    font-style: italic;
}

/* Post Meta */
.post-meta {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 30px;
    color: var(--text-secondary);
    font-size: 14px;
}

.post-author {
    display: flex;
    align-items: center;
    gap: 10px;
}

.author-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-primary);
    font-weight: bold;
}

/* Layout base */
.post-categories,
.post-tags {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .5rem;
  margin-bottom: 1rem;
}

/* Etichetta "Categorie:" / "Tag:" */
.post-categories .color-muted,
.post-tags .color-muted {
  margin-right: .25rem;
  opacity: .8;
}

/* Chip stile bottone (valido sia con classi che solo per <a> interni) */
.post-categories a,
.post-tags a,
a.tax-chip {
  --chip-bg: #f9fafb;
  --chip-border: #e5e7eb;
  --chip-fg: #111827;
  --chip-hover-bg: #eef2ff;
  --chip-hover-border: #6366f1;
  --chip-focus: #6366f1;

  display: inline-flex;
  align-items: center;
  padding: .38rem .72rem;
  border: 1px solid var(--chip-border);
  background: var(--chip-bg);
  color: var(--chip-fg);
  border-radius: 999px;
  text-decoration: none;
  font-size: .875rem; /* 14px */
  line-height: 1;
  transition: background-color .2s ease, border-color .2s ease, transform .05s ease;
  white-space: nowrap;
}

.post-categories a:hover,
.post-tags a:hover,
a.tax-chip:hover {
  background: var(--chip-hover-bg);
  border-color: var(--chip-hover-border);
}

.post-categories a:active,
.post-tags a:active,
a.tax-chip:active {
  transform: translateY(1px);
}

/* Accessibilità focus */
.post-categories a:focus-visible,
.post-tags a:focus-visible,
a.tax-chip:focus-visible {
  outline: 2px solid var(--chip-focus);
  outline-offset: 2px;
}

/* Varianti (facoltative) per distinguere categorie e tag */
.tax-chip--category { }
.tax-chip--tag { }

/* Supporto dark mode (se usi .dark sul <html> o <body>) */
.dark .post-categories a,
.dark .post-tags a,
.dark a.tax-chip {
  --chip-bg: #0b1220;
  --chip-border: #1f2937;
  --chip-fg: #e5e7eb;
  --chip-hover-bg: #111827;
  --chip-hover-border: #818cf8;
  --chip-focus: #818cf8;
}



/* Content Cards */
.content-card {
    background-color: var(--surface-color);
    border-radius: 20px;
    padding: 30px;
    margin-bottom: 30px;
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

.content-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px var(--dark-overlay);
}

.content-card h3 {
    color: var(--primary-color);
    margin-bottom: 15px;
    font-size: 1.4em;
}

.content-card p {
    color: var(--text-secondary);
    margin-bottom: 15px;
}

.content-card .read-more {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
}

.content-card .read-more:hover {
    color: var(--secondary-color);
}

/* Form Styles */
.form-container {
    background-color: var(--surface-color);
    border-radius: 20px;
    padding: 40px;
    border: 1px solid var(--border-color);
    max-width: 600px;
    margin: 0 auto;
}

.form-group {
    margin-bottom: 25px;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--text-primary);
}

.form-input {
    width: 100%;
    padding: 15px;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    background-color: var(--background-color);
    color: var(--text-primary);
    font-size: 16px;
    outline: none;
    transition: all 0.3s ease;
}

.form-input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(230, 211, 167, 0.2);
}

.form-textarea {
    resize: vertical;
    min-height: 120px;
    font-family: inherit;
}

.form-select {
    width: 100%;
    padding: 15px;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    background-color: var(--background-color);
    color: var(--text-primary);
    font-size: 16px;
    outline: none;
    cursor: pointer;
}

/* Profile Page */
.profile-header {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border-radius: 20px;
    padding: 40px;
    text-align: center;
    margin-bottom: 30px;
    color: var(--text-primary);
}

.profile-avatar-large {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background-color: var(--background-color);
    margin: 0 auto 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 48px;
    font-weight: bold;
    color: var(--primary-color);
}

.profile-name {
    font-size: 2.5em;
    margin-bottom: 10px;
}

.profile-bio {
    font-size: 1.2em;
    opacity: 0.9;
    max-width: 600px;
    margin: 0 auto;
}

.profile-stats {
    display: flex;
    justify-content: center;
    gap: 40px;
    margin-top: 30px;
}

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

.stat-number {
    font-size: 2em;
    font-weight: bold;
    display: block;
}

.stat-label {
    font-size: 0.9em;
    opacity: 0.8;
}

/* Content Grid */
.content-grid-posts {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin-top: 40px;
}

/* Auth Forms */
.auth-container {
    background-color: var(--surface-color);
    border-radius: 20px;
    padding: 40px;
    max-width: 500px;
    margin: 60px auto;
    border: 1px solid var(--border-color);
}

.auth-header {
    text-align: center;
    margin-bottom: 30px;
}

.auth-title {
    color: var(--primary-color);
    font-size: 2.5em;
    margin-bottom: 10px;
}

.auth-subtitle {
    color: var(--text-secondary);
    font-size: 1.1em;
}

.auth-tabs {
    display: flex;
    margin-bottom: 30px;
    background-color: var(--background-color);
    border-radius: 15px;
    padding: 5px;
    border: 1px solid var(--border-color);
}

.auth-tab {
    flex: 1;
    padding: 15px;
    text-align: center;
    background: none;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 500;
    color: var(--text-secondary);
    transition: all 0.3s ease;
}

.auth-tab.active {
    background-color: var(--primary-color);
    color: var(--text-primary);
}

.password-container {
    position: relative;
}

.password-toggle {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-secondary);
    font-size: 18px;
}

/* Notifications */
.notification {
    padding: 15px 20px;
    border-radius: 10px;
    margin-bottom: 20px;
    border-left: 4px solid;
}

.notification.success {
    background-color: rgba(76, 175, 80, 0.1);
    border-left-color: var(--success-color);
    color: var(--success-color);
}

.notification.error {
    background-color: rgba(244, 67, 54, 0.1);
    border-left-color: var(--danger-color);
    color: var(--danger-color);
}

.notification.warning {
    background-color: rgba(255, 152, 0, 0.1);
    border-left-color: var(--warning-color);
    color: var(--warning-color);
}

/* Comments */
.comments-section {
    background-color: var(--surface-color);
    border-radius: 20px;
    padding: 30px;
    margin-top: 40px;
    border: 1px solid var(--border-color);
}

.comment {
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 20px;
}

.comment:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.comment-author {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
}

.comment-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-primary);
    font-weight: bold;
}

.comment-meta {
    color: var(--text-secondary);
    font-size: 14px;
}

.comment-content {
    margin-left: 52px;
    line-height: 1.6;
}

/* Footer */
.site-footer {
    background-color: var(--surface-color);
    border-top: 1px solid var(--border-color);
    padding: 40px 20px;
    margin-top: 60px;
    text-align: center;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
}

.footer-menu {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-bottom: 20px;
    list-style: none;
}

.footer-menu a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-menu a:hover {
    color: var(--primary-color);
}

.footer-text {
    color: var(--text-secondary);
    font-size: 14px;
}

/* Theme Toggle */
.theme-toggle {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background-color: var(--primary-color);
    color: var(--text-primary);
    border: none;
    cursor: pointer;
    font-size: 24px;
    box-shadow: 0 5px 20px rgba(230, 211, 167, 0.3);
    transition: all 0.3s ease;
    z-index: 1000;
}

.theme-toggle:hover {
    transform: scale(1.1);
    box-shadow: 0 8px 25px rgba(230, 211, 167, 0.4);
}

/* Hamburger Menu Button */
.hamburger-menu {
    display: none;
    flex-direction: column;
    justify-content: space-around;
    width: 30px;
    height: 25px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 1001;
}

.hamburger-menu span {
    width: 100%;
    height: 3px;
    background-color: var(--text-primary);
    border-radius: 10px;
    transition: all 0.3s ease;
}

.hamburger-menu.active span:nth-child(1) {
    transform: rotate(45deg) translate(8px, 8px);
}

.hamburger-menu.active span:nth-child(2) {
    opacity: 0;
}

.hamburger-menu.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -7px);
}

/* Mobile Menu Overlay */
.mobile-menu-overlay {
    position: fixed;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100vh;
    background-color: var(--background-color);
    z-index: 999;
    transition: left 0.3s ease;
    overflow-y: auto;
}

.mobile-menu-overlay.active {
    left: 0;
}

.mobile-menu-content {
    padding: 120px 30px 40px;
}

.mobile-nav-menu {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0;
}

.mobile-nav-menu li {
    border-bottom: 1px solid var(--border-color);
}

.mobile-nav-menu a {
    display: block;
    padding: 20px 10px;
    color: var(--text-primary);
    text-decoration: none;
    font-size: 18px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.mobile-nav-menu a:hover {
    color: var(--primary-color);
    padding-left: 20px;
}

.mobile-user-actions {
    margin-top: 40px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    padding-top: 30px;
    border-top: 2px solid var(--border-color);
}

.mobile-menu-item {
    display: block;
    padding: 18px 20px;
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 500;
    font-size: 16px;
    border-radius: 15px;
    background-color: var(--surface-color);
    transition: all 0.3s ease;
    text-align: center;
}

.mobile-menu-item:hover {
    background-color: var(--hover-color);
    transform: translateX(5px);
}

.mobile-btn-outline {
    background: transparent;
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
}

.mobile-btn-primary {
    background-color: var(--primary-color);
    color: var(--text-primary);
}

/* Responsive Design */
@media (max-width: 1024px) {
    .content-grid {
        grid-template-columns: 1fr 300px;
    }

    .sidebar {
        display: none;
    }
}

@media (max-width: 768px) {
    /* Prevent horizontal overflow on mobile */
    .content-grid,
    .primary-content,
    .content-card,
    .post-content {
        max-width: 100%;
        overflow-x: hidden;
    }

    .hamburger-menu {
        display: flex;
    }

    .content-grid {
        grid-template-columns: 1fr;
        gap: 20px;
        padding: 0 10px;
    }

    .main-nav {
        display: none;
    }

    .user-actions {
        display: none;
    }

    .site-header {
        padding: 0 15px;
        height: 80px;
    }

    .site-logo__img {
        width: 60px;
        height: 60px;
    }

    .container {
        padding: 0 15px;
    }

    .main-content {
        padding: 90px 10px 20px;
    }

    /* Auth pages responsive */
    .auth-container {
        margin: 20px 10px;
        padding: 25px 20px;
        max-width: 100%;
    }

    .auth-title {
        font-size: 2em;
    }

    .auth-subtitle {
        font-size: 1em;
    }

    .auth-tabs {
        flex-direction: row;
        padding: 4px;
    }

    .auth-tab {
        padding: 12px 10px;
        font-size: 14px;
    }

    .primary-content {
        padding: 0;
    }

    .content-card {
        padding: 20px 15px;
        border-radius: 15px;
    }

    .post-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }

    .post-author {
        width: 100%;
    }

    .post-taxonomy {
        width: 100%;
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 8px !important;
    }

    .post-actions {
        flex-wrap: wrap;
        gap: 10px;
    }

    .post-content, .form-container, .auth-container {
        padding: 20px 15px;
    }

    .profile-header {
        padding: 30px 20px;
    }

    .profile-avatar-large {
        width: 100px;
        height: 100px;
        font-size: 42px;
    }

    .profile-name {
        font-size: 2em;
    }

    .profile-bio {
        font-size: 1.1em;
    }

    .profile-stats {
        gap: 20px;
        flex-wrap: wrap;
    }

    .stat-item {
        min-width: calc(33.33% - 15px);
    }

    .stat-number {
        font-size: 1.5em;
    }

    .content-grid-posts {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    /* Single post improvements */
    .post-header {
        margin-bottom: 20px !important;
    }

    .post-stats {
        flex-wrap: wrap;
        gap: 10px;
        font-size: 13px !important;
    }

    .rating-section {
        margin: 20px 0 !important;
        padding: 20px 15px !important;
    }

    .tax-chip {
        font-size: 11px !important;
        padding: 4px 10px !important;
    }

    /* Form improvements */
    .form-group {
        margin-bottom: 20px;
    }

    input[type="text"],
    input[type="email"],
    input[type="password"],
    textarea,
    select {
        font-size: 16px; /* Prevents zoom on iOS */
    }

    /* Button improvements */
    .btn {
        width: 100%;
        padding: 14px 20px;
        font-size: 16px;
    }

    .btn-group {
        flex-direction: column;
        gap: 10px;
    }

    /* Footer responsive */
    .site-footer {
        padding: 30px 15px;
        margin-top: 40px;
    }

    .footer-menu {
        flex-wrap: wrap;
        gap: 15px 20px;
        margin-bottom: 25px;
    }

    .footer-menu li {
        flex: 0 0 auto;
    }

    .footer-text {
        font-size: 13px;
    }

    .footer-text p {
        margin-bottom: 15px;
    }
}

@media (max-width: 480px) {
    .site-header {
        height: 70px;
    }

    .site-logo__img {
        width: 50px;
        height: 50px;
    }

    .logo-badge {
        font-size: 8px;
        padding: 2px 6px;
        right: -8px;
        top: -8px;
    }

    .main-content {
        padding: 80px 8px 20px;
    }

    .content-card {
        padding: 15px 12px;
        margin-bottom: 15px;
    }

    .post-content h1 {
        font-size: 1.75em;
        line-height: 1.3;
    }

    .post-content h2 {
        font-size: 1.4em;
        line-height: 1.3;
    }

    .profile-header {
        padding: 25px 15px;
    }

    .profile-avatar-large {
        width: 85px;
        height: 85px;
        font-size: 36px;
        margin-bottom: 15px;
    }

    .profile-name {
        font-size: 1.75em;
    }

    .profile-bio {
        font-size: 0.95em;
    }

    .profile-stats {
        gap: 15px;
        flex-direction: column;
    }

    .stat-item {
        min-width: 100%;
        padding: 10px;
        background-color: rgba(255, 255, 255, 0.1);
        border-radius: 10px;
    }

    .stat-number {
        font-size: 1.8em;
    }

    .auth-title {
        font-size: 1.75em;
    }

    .rating-section {
        margin: 15px 0 !important;
        padding: 18px 12px !important;
    }

    .post-stats {
        font-size: 12px !important;
    }

    .form-container {
        padding: 20px 12px;
    }

    .btn {
        padding: 12px 18px;
        font-size: 15px;
    }

    .post-author {
        font-size: 14px;
    }

    .author-avatar {
        width: 40px;
        height: 40px;
        font-size: 18px;
    }

    .mobile-menu-content {
        padding: 100px 20px 30px;
    }

    .mobile-nav-menu a {
        font-size: 16px;
        padding: 18px 8px;
    }

    .mobile-menu-item {
        padding: 15px 18px;
        font-size: 15px;
    }

    /* Footer responsive small screens */
    .site-footer {
        padding: 25px 10px;
        margin-top: 30px;
    }

    .footer-menu {
        flex-direction: column;
        gap: 12px;
        align-items: center;
        margin-bottom: 20px;
    }

    .footer-menu li {
        width: 100%;
        text-align: center;
    }

    .footer-menu a {
        display: block;
        padding: 10px;
    }

    .footer-text {
        font-size: 12px;
        line-height: 1.6;
    }

    .footer-text br {
        display: none;
    }

    .theme-toggle {
        width: 50px;
        height: 50px;
        font-size: 20px;
        bottom: 15px;
        right: 15px;
    }
}

/* ==========================
   PWA INSTALL
   ========================== */

/* PWA Install Button */
.pwa-install-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
    color: white !important;
    border: none !important;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.pwa-install-btn:hover {
    transform: translateX(5px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.3);
}

/* iOS Install Modal */
.ios-install-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
}

.ios-install-modal.active {
    display: flex;
}

.ios-install-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
}

.ios-install-content {
    position: relative;
    background: var(--background-color);
    border-radius: 20px;
    padding: 30px 25px;
    max-width: 400px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.ios-close-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    font-size: 28px;
    color: var(--text-secondary);
    cursor: pointer;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.ios-close-btn:hover {
    background: var(--hover-color);
    color: var(--text-primary);
}

.ios-install-title {
    font-size: 24px;
    font-weight: bold;
    color: var(--primary-color);
    margin-bottom: 10px;
    text-align: center;
}

.ios-install-subtitle {
    color: var(--text-secondary);
    text-align: center;
    margin-bottom: 30px;
    font-size: 15px;
    line-height: 1.5;
}

.ios-install-steps {
    margin-bottom: 25px;
}

.ios-step {
    display: flex;
    gap: 15px;
    margin-bottom: 25px;
    align-items: flex-start;
}

.ios-step-number {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 16px;
}

.ios-step-content {
    flex: 1;
}

.ios-step-content p {
    margin: 0 0 10px 0;
    color: var(--text-primary);
    font-size: 15px;
}

.ios-share-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: var(--surface-color);
    border-radius: 8px;
    color: #007AFF;
    margin-top: 5px;
}

.ios-action-icon {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: var(--surface-color);
    border-radius: 8px;
    font-size: 14px;
    color: var(--text-primary);
    margin-top: 5px;
}

.ios-got-it-btn {
    position: static !important;
    width: 100%;
    padding: 14px 20px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: var(--text-primary);
    border: none;
    border-radius: 12px;
    font-weight: 600;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.ios-got-it-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(230, 211, 167, 0.3);
}

/* ==========================
   RATING SYSTEM
   ========================== */

.rating-container {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 15px 0;
}

.rating-display,
.rating-interactive {
    display: flex;
    align-items: center;
    gap: 2px;
}

.rating-star {
    font-size: 20px;
    cursor: default;
    opacity: 0.3;
    transition: all 0.3s ease;
    filter: grayscale(100%);
}

.rating-star.active {
    opacity: 1;
    filter: grayscale(0%);
    color: #e6d3a7;
    text-shadow: 0 0 10px rgba(230, 211, 167, 0.5);
}

.rating-star.half {
    opacity: 0.7;
    filter: grayscale(50%);
}

/* Interactive rating stars */
.rating-interactive .rating-star {
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.rating-interactive .rating-star:hover {
    transform: scale(1.2);
    opacity: 1;
    filter: grayscale(0%);
    text-shadow: 0 0 15px rgba(230, 211, 167, 0.8);
}

.rating-interactive .rating-star:hover::after {
    content: attr(title);
    position: absolute;
    bottom: 120%;
    left: 50%;
    transform: translateX(-50%);
    background-color: var(--text-primary);
    color: var(--background-color);
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 12px;
    white-space: nowrap;
    z-index: 1000;
    opacity: 0.9;
}

/* Rating hover effects */
.rating-interactive:hover .rating-star {
    opacity: 0.2;
    filter: grayscale(80%);
}

.rating-interactive .rating-star:hover {
    opacity: 1 !important;
    filter: grayscale(0%) !important;
}

.rating-interactive .rating-star:nth-child(1):hover ~ .rating-star:nth-child(n+2),
.rating-interactive .rating-star:nth-child(2):hover ~ .rating-star:nth-child(n+3),
.rating-interactive .rating-star:nth-child(3):hover ~ .rating-star:nth-child(n+4),
.rating-interactive .rating-star:nth-child(4):hover ~ .rating-star:nth-child(n+5) {
    opacity: 0.2 !important;
    filter: grayscale(80%) !important;
}

.rating-interactive .rating-star:nth-child(1):hover,
.rating-interactive .rating-star:nth-child(2):hover,
.rating-interactive .rating-star:nth-child(2):hover ~ .rating-star:nth-child(1),
.rating-interactive .rating-star:nth-child(3):hover,
.rating-interactive .rating-star:nth-child(3):hover ~ .rating-star:nth-child(-n+2),
.rating-interactive .rating-star:nth-child(4):hover,
.rating-interactive .rating-star:nth-child(4):hover ~ .rating-star:nth-child(-n+3),
.rating-interactive .rating-star:nth-child(5):hover,
.rating-interactive .rating-star:nth-child(5):hover ~ .rating-star:nth-child(-n+4) {
    opacity: 1 !important;
    filter: grayscale(0%) !important;
}

.rating-info {
    display: flex;
    align-items: center;
    gap: 15px;
    font-size: 14px;
    color: var(--text-secondary);
}

.rating-average {
    font-weight: 500;
    color: var(--text-primary);
}

.rating-votes {
    color: var(--text-secondary);
}

.rating-message {
    padding: 10px 15px;
    border-radius: 8px;
    margin: 10px 0;
    font-size: 14px;
    opacity: 0;
    transform: translateY(-10px);
    transition: all 0.3s ease;
}

.rating-message.show {
    opacity: 1;
    transform: translateY(0);
}

.rating-message.success {
    background-color: rgba(46, 125, 50, 0.1);
    color: #2e7d32;
    border: 1px solid rgba(46, 125, 50, 0.2);
}

.rating-message.error {
    background-color: rgba(211, 47, 47, 0.1);
    color: #d32f2f;
    border: 1px solid rgba(211, 47, 47, 0.2);
}

/* Most voted widget */
.most-voted-post {
    padding: 15px 0;
    border-bottom: 1px solid var(--border-color);
}

.most-voted-post:last-child {
    border-bottom: none;
}

.most-voted-title {
    font-weight: 500;
    line-height: 1.4;
    margin-bottom: 8px;
}

.most-voted-title a {
    color: var(--text-primary);
    text-decoration: none;
}

.most-voted-title a:hover {
    color: var(--primary-color);
}

.most-voted-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 12px;
    color: var(--text-secondary);
}

.most-voted-author {
    font-weight: 500;
}

.most-voted-rating {
    display: flex;
    align-items: center;
    gap: 5px;
}

.most-voted-rating .rating-display {
    gap: 1px;
}

.most-voted-rating .rating-star {
    font-size: 14px;
}

/* Post rating in homepage */
.post-rating {
    padding: 8px 0;
    border-top: 1px solid var(--border-color);
}

.post-rating .rating-display {
    gap: 1px;
}

.post-rating .rating-star {
    font-size: 16px;
}

/* Taxonomy links styling */
.taxonomy-link {
    display: inline-block;
    transition: all 0.3s ease;
    font-weight: 500;
}

.taxonomy-link:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    text-decoration: none !important;
}

.category-link:hover {
    background: rgba(230, 211, 167, 0.4) !important;
    color: var(--primary-color) !important;
}

.tag-link:hover {
    background: rgba(108, 108, 108, 0.2) !important;
    color: var(--text-primary) !important;
}

.post-taxonomy {
    margin: 8px 0;
    padding: 8px 0;
    border-top: 1px solid rgba(230, 211, 167, 0.2);
}

/* Loading state for ratings */
.rating-loading {
    opacity: 0.6;
    pointer-events: none;
    position: relative;
}

.rating-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 16px;
    height: 16px;
    margin: -8px 0 0 -8px;
    border: 2px solid var(--border-color);
    border-top: 2px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

/* 
 CONTACT FORM

*/

/* ============================
   Contact Form 7 – Modern UI
   Usa lo shortcode con html_class="cf7-modern cf7-2col"
   ============================ */

:root{
  --cf7-bg: #ffffff;
  --cf7-border: #e6e8eb;
  --cf7-primary: #3b82f6; /* blu accessibile */
  --cf7-text: #0f172a;
  --cf7-muted: #64748b;
  --cf7-radius: 12px;
  --cf7-shadow: 0 6px 24px rgba(2, 6, 23, .07);
}

/* Card contenitore */
.cf7-modern.wpcf7 form {
  background: var(--cf7-bg);
  border: 1px solid var(--cf7-border);
  border-radius: var(--cf7-radius);
  padding: clamp(16px, 2vw, 28px);
  box-shadow: var(--cf7-shadow);
  color: var(--cf7-text);
}

/* Layout responsive a griglia (2 colonne opzionali) */
.cf7-modern .wpcf7-form {
  display: grid;
  gap: 16px;
}
.cf7-modern.cf7-2col .wpcf7-form {
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}
.cf7-modern .wpcf7-form > p {
  margin: 0; /* CF7 usa <p> come wrapper dei campi */
}

/* Fai occupare tutta la riga a textarea, messaggio, submit, e a chi ha .full */
.cf7-modern .wpcf7-form textarea,
.cf7-modern .wpcf7-form .wpcf7-submit,
.cf7-modern .wpcf7-form .wpcf7-acceptance,
.cf7-modern .wpcf7-form .full {
  grid-column: 1 / -1;
}

/* Label */
.cf7-modern .wpcf7-form label {
  display: block;
  font-weight: 600;
  font-size: 14px;
  margin-bottom: 6px;
  color: var(--cf7-text);
}

/* Campi di input di base */

.wpcf7-form-control input[type="text"],
.cf7-modern .wpcf7-form-control input[type="email"],
.cf7-modern .wpcf7-form-control input[type="url"],
.wpcf7-form-control input[type="tel"],
.wpcf7-form-control input[type="number"],
.wpcf7-form-control input[type="date"],
.wpcf7-form-control input[type="file"],
.wpcf7-form-control select,
.wpcf7-form-control textarea {
  width: 100%;
  border: 1px solid var(--cf7-border);
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 15px;
  line-height: 1.4;
  color: var(--cf7-text);
  background: #fff;
  transition: box-shadow .2s ease, border-color .2s ease, background-color .2s ease;
}


.wpcf7-form-control input[type="text"],
.cf7-modern .wpcf7-form-control input[type="email"],
.cf7-modern .wpcf7-form-control input[type="url"],
.cf7-modern .wpcf7-form-control input[type="tel"],
.cf7-modern .wpcf7-form-control input[type="number"],
.cf7-modern .wpcf7-form-control input[type="date"],
.cf7-modern .wpcf7-form-control input[type="file"],
.cf7-modern .wpcf7-form-control select,
.cf7-modern .wpcf7-form-control textarea {
  width: 100%;
  border: 1px solid var(--cf7-border);
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 15px;
  line-height: 1.4;
  color: var(--cf7-text);
  background: #fff;
  transition: box-shadow .2s ease, border-color .2s ease, background-color .2s ease;
}

/* Placeholder */
.cf7-modern .wpcf7-form ::placeholder {
  color: var(--cf7-muted);
  opacity: 1;
}

/* Focus visibile e accessibile */
.cf7-modern .wpcf7-form input:not([type="submit"]):focus,
.cf7-modern .wpcf7-form select:focus,
.cf7-modern .wpcf7-form textarea:focus {
  outline: none;
  border-color: var(--cf7-primary);
  box-shadow: 0 0 0 4px rgba(59,130,246,.15); /* anello focus */
}

/* Checkboxes & Radios */
.cf7-modern .wpcf7-list-item {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 6px 14px 6px 0;
}
.cf7-modern .wpcf7-list-item label {
  font-weight: 500;
  margin: 0;
}
.cf7-modern .wpcf7-form input[type="checkbox"],
.cf7-modern .wpcf7-form input[type="radio"] {
  width: 18px; height: 18px;
  accent-color: var(--cf7-primary);
}

/* File upload: mostra il nome del file decentemente */
.cf7-modern .wpcf7-form input[type="file"] {
  padding: 10px;
}

/* Bottone invio */
.cf7-modern .wpcf7-submit {
  appearance: none;
  border: 0;
  border-radius: 999px;
  padding: 12px 20px;
  font-weight: 700;
  font-size: 15px;
  background: var(--cf7-primary);
  color: #fff;
  cursor: pointer;
  justify-self: start; /* allinea a sinistra nella griglia */
  transition: transform .05s ease, filter .2s ease, box-shadow .2s ease;
  box-shadow: 0 6px 16px rgba(59,130,246,.25);
}
.cf7-modern .wpcf7-submit:hover { filter: brightness(1.05); }
.cf7-modern .wpcf7-submit:active { transform: translateY(1px); }
.cf7-modern .wpcf7-submit:disabled { opacity: .6; cursor: not-allowed; }

/* Spinner (loading) */
.cf7-modern .wpcf7-spinner {
  margin-left: 10px;
  width: 20px; height: 20px;
  border: 2px solid #dbe3f0;
  border-top-color: var(--cf7-primary);
  border-radius: 50%;
  animation: cf7spin .8s linear infinite;
}
@keyframes cf7spin { to { transform: rotate(360deg); } }

/* Suggerimenti errore campo */
.cf7-modern .wpcf7-not-valid {
  border-color: #ef4444 !important;
  box-shadow: 0 0 0 4px rgba(239,68,68,.1);
}
.cf7-modern .wpcf7-not-valid-tip {
  margin-top: 6px;
  font-size: 13px;
  color: #b91c1c;
}

/* Messaggi di stato globali */
.cf7-modern .wpcf7-response-output {
  grid-column: 1 / -1;
  margin: 6px 0 0 0 !important;
  padding: 12px 14px !important;
  border-radius: 10px;
  border: 1px solid transparent !important;
  font-size: 14px;
}
.cf7-modern .wpcf7 form.sent .wpcf7-response-output {
  background: #ecfdf5;
  border-color: #34d399 !important;
  color: #065f46;
}
.cf7-modern .wpcf7 form.invalid .wpcf7-response-output,
.cf7-modern .wpcf7 form.failed .wpcf7-response-output,
.cf7-modern .wpcf7 form.aborted .wpcf7-response-output,
.cf7-modern .wpcf7 form.spam .wpcf7-response-output {
  background: #fef2f2;
  border-color: #f87171 !important;
  color: #7f1d1d;
}

/* Link di privacy/accettazione */
.cf7-modern .wpcf7-acceptance a { color: var(--cf7-primary); text-decoration: underline; }

/* Help text/sottotitoli */
.cf7-modern .hint,
.cf7-modern .help,
.cf7-modern small {
  color: var(--cf7-muted);
  font-size: 12px;
}

/* Dark mode opzionale */
@media (prefers-color-scheme: dark) {
  :root{
    --cf7-bg: #0b1220;
    --cf7-border: #1e293b;
    --cf7-text: #e5e7eb;
    --cf7-muted: #94a3b8;
    --cf7-shadow: 0 8px 28px rgba(0,0,0,.35);
  }
  .cf7-modern .wpcf7-form input[type="text"],
  .cf7-modern .wpcf7-form input[type="email"],
  .cf7-modern .wpcf7-form input[type="url"],
  .cf7-modern .wpcf7-form input[type="tel"],
  .cf7-modern .wpcf7-form input[type="number"],
  .cf7-modern .wpcf7-form input[type="date"],
  .cf7-modern .wpcf7-form input[type="file"],
  .cf7-modern .wpcf7-form select,
  .cf7-modern .wpcf7-form textarea {
    background: #0f172a;
    border-color: #203049;
    color: var(--cf7-text);
  }
}

/* Riduzione animazioni se preferito dall’utente */
@media (prefers-reduced-motion: reduce) {
  .cf7-modern .wpcf7-submit,
  .cf7-modern .wpcf7-form input,
  .cf7-modern .wpcf7-form select,
  .cf7-modern .wpcf7-form textarea {
    transition: none;
  }
}

/* Utility: forzare un campo a tutta larghezza
   Aggiungi class:full in CF7 (es: [text* your-subject class:full]) */
.cf7-modern .full { grid-column: 1 / -1 !important; }



/* 
END CONTACT FORM
*/


/* Mobile responsive for ratings */
@media (max-width: 768px) {
    .rating-container {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .rating-star {
        font-size: 18px;
    }
    
    .rating-info {
        gap: 10px;
        font-size: 13px;
    }
    
    .most-voted-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.fade-in {
    animation: fadeIn 0.6s ease-out;
}

.slide-in {
    animation: slideIn 0.6s ease-out;
}

/* Loading States */
.loading {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 40px;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--border-color);
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Rating breakdown display */
.rating-breakdown {
    margin: 15px 0;
    font-size: 14px;
}

.rating-breakdown-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 5px 0;
    padding: 4px 0;
}

.rating-breakdown-stars {
    display: flex;
    align-items: center;
    gap: 5px;
}

.rating-breakdown-count {
    color: var(--text-secondary);
    font-weight: 500;
}

.rating-breakdown-bar {
    flex: 1;
    height: 6px;
    background-color: var(--border-color);
    border-radius: 3px;
    margin: 0 10px;
    overflow: hidden;
}

.rating-breakdown-fill {
    height: 100%;
    background-color: var(--primary-color);
    border-radius: 3px;
    transition: width 0.3s ease;
}

/* Utility Classes */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-left { text-align: left; }

.mt-20 { margin-top: 20px; }
.mt-30 { margin-top: 30px; }
.mt-40 { margin-top: 40px; }

.mb-20 { margin-bottom: 20px; }
.mb-30 { margin-bottom: 30px; }
.mb-40 { margin-bottom: 40px; }

.hidden { display: none; }
.visible { display: block; }

.color-primary { color: var(--primary-color); }
.color-secondary { color: var(--secondary-color); }
.color-muted { color: var(--text-secondary); }


/* Per il markup personalizzato: <a class="site-logo"><img ...></a> */
.site-logo {
  width: 64px;
  height: 64px;
  object-fit: contain; /* evita deformazioni se il logo non è quadrato */
  display: block;
}

/* Se usi il logo del Customizer (get_custom_logo): */
.custom-logo {
  width: 64px !important;
  height: 64px !important;
  object-fit: contain;
  display: block;
}


/* ===== Contact Form 7 – Stile moderno e responsive (scoped) ===== */
.cf7-modern {
  --cf7-bg: #ffffff;
  --cf7-text: #0f172a;             /* slate-900 */
  --cf7-muted: #64748b;            /* slate-500 */
  --cf7-border: #e2e8f0;           /* slate-200 */
  --cf7-accent: #3b82f6;           /* blue-500 */
  --cf7-accent-ghost: rgba(59,130,246,.14);
  --cf7-error: #ef4444;            /* red-500 */
  --cf7-success: #16a34a;          /* green-600 */
  color: var(--cf7-text);
  background: var(--cf7-bg);
  max-width: 780px;
  margin: 0 auto;
  padding: clamp(16px, 3vw, 28px);
  border: 1px solid var(--cf7-border);
  border-radius: 16px;
  box-shadow: 0 8px 28px rgba(2,6,23,.06);
}

@media (prefers-color-scheme: dark) {
  .cf7-modern {
    --cf7-bg: #0b1220;             /* quasi navy */
    --cf7-text: #e6eaf2;
    --cf7-muted: #9aa3b2;
    --cf7-border: #1f2937;         /* gray-800 */
    --cf7-accent-ghost: rgba(59,130,246,.25);
  }
}

/* Nascondi hidden fields */
.cf7-modern .hidden-fields-container { display: none !important; }

/* Layout a griglia 2 colonne su schermi medi+ */
.cf7-modern.cf7-2col {
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(12px, 2.5vw, 18px);
}

@media (min-width: 720px) {
  .cf7-modern.cf7-2col {
    grid-template-columns: 1fr 1fr;
  }
}

/* Ogni blocco <p> è un item di griglia */
.cf7-modern p { 
  margin: 0;
  grid-column: 1 / -1; /* default: full width */
}

/* Nome + Email affiancati su desktop */
@media (min-width: 720px) {
  .cf7-modern p:nth-of-type(1),
  .cf7-modern p:nth-of-type(2) { grid-column: auto; }
}

/* Checkbox e Submit in fondo, ben allineati */
@media (min-width: 720px) {
  .cf7-modern p:nth-of-type(6) { /* pulsante submit */
    grid-column: 2;
    justify-self: end;
  }
}

/* Label e testi guida */
.cf7-modern label {
  display: block;
  font-weight: 600;
  font-size: 0.95rem;
  margin-bottom: 6px;
  color: var(--cf7-text);
}

/* Campi base */
.cf7-modern .wpcf7-form-control.wpcf7-text,
.cf7-modern .wpcf7-form-control.wpcf7-email,
.cf7-modern .wpcf7-form-control.wpcf7-textarea {
  width: 100%;
  background: rgba(148,163,184,.06);
  color: var(--cf7-text);
  border: 1px solid var(--cf7-border);
  border-radius: 12px;
  padding: 14px 16px;
  line-height: 1.4;
  transition: border-color .2s ease, box-shadow .2s ease, background-color .2s ease, transform .06s ease;
  outline: none;
}

.cf7-modern .wpcf7-form-control.wpcf7-textarea {
  min-height: 160px;
  resize: vertical;
}

.cf7-modern .wpcf7-form-control:hover {
  background: rgba(148,163,184,.10);
}

.cf7-modern .wpcf7-form-control:focus {
  border-color: var(--cf7-accent);
  box-shadow: 0 0 0 4px var(--cf7-accent-ghost);
}

/* Stato errore CF7 */
.cf7-modern .wpcf7-form-control.wpcf7-not-valid {
  border-color: var(--cf7-error) !important;
  box-shadow: 0 0 0 4px rgba(239,68,68,.18) !important;
}
.cf7-modern .wpcf7-not-valid-tip {
  display: block;
  margin-top: 6px;
  font-size: 0.85rem;
  color: var(--cf7-error);
}

/* Checkbox privacy moderno */
.cf7-modern .wpcf7-list-item label {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  line-height: 1.35;
  font-weight: 500;
  color: var(--cf7-text);
}
.cf7-modern input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin-top: 2px;
  accent-color: var(--cf7-accent);     /* moderno */
  border-radius: 4px;
}

/* Pulsante invio */
.cf7-modern .wpcf7-submit {
  appearance: none;
  border: 0;
  border-radius: 12px;
  background: var(--cf7-accent);
  color: #fff;
  font-weight: 700;
  letter-spacing: .2px;
  padding: 14px 18px;
  cursor: pointer;
  transition: transform .06s ease, filter .15s ease, box-shadow .2s ease, background-color .2s ease;
  width: 100%;
}
@media (min-width: 720px) {
  .cf7-modern .wpcf7-submit { width: auto; }
}
.cf7-modern .wpcf7-submit:hover { filter: brightness(1.05); }
.cf7-modern .wpcf7-submit:active { transform: translateY(1px); }
.cf7-modern .wpcf7-submit:disabled {
  opacity: .6;
  cursor: not-allowed;
}

/* Spinner CF7 vicino al bottone */
.cf7-modern .wpcf7-spinner {
  margin-left: 10px;
  vertical-align: middle;
  opacity: .9;
  filter: drop-shadow(0 2px 6px rgba(2,6,23,.18));
}

/* Messaggi di risposta */
.cf7-modern .wpcf7-response-output {
  margin-top: 8px;
  border: 0 !important;
  background: rgba(148,163,184,.14);
  color: var(--cf7-text);
  padding: 12px 14px;
  border-radius: 10px;
  font-size: .95rem;
}

/* Stati comuni (CF7 aggiunge classi sul form) */
.wpcf7 form.sent     .wpcf7-response-output { background: rgba(22,163,74,.18); color: var(--cf7-text); }
.wpcf7 form.failed   .wpcf7-response-output,
.wpcf7 form.invalid  .wpcf7-response-output { background: rgba(239,68,68,.16); color: var(--cf7-text); }

/* Placeholder elegante */
.cf7-modern ::placeholder { color: var(--cf7-muted); opacity: .9; }

/* Accessibilità focus visibile anche via tastiera */
.cf7-modern .wpcf7-form-control:focus-visible {
  outline: none;
  box-shadow: 0 0 0 4px var(--cf7-accent-ghost), 0 0 0 1px var(--cf7-accent);
}

/* Micro-tuning spazi */
.cf7-modern span.wpcf7-form-control-wrap { display: block; }

.post-more {
  margin-top: 8px;
}
.more-btn {
  display: inline-block;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid #e6e8eb;
  background: var(--primary-color);
  color: #0f172a;
  text-decoration: none;
  font-weight: 600;
  transition: background .15s ease, border-color .15s ease, transform .05s ease;
}
.more-btn:hover { background: #eef2f7; border-color: #d4d8dd; }
.more-btn:active { transform: translateY(1px); }
@media (prefers-color-scheme: dark) {
  .more-btn { background:#0f172a; border-color:#203049; color:#e5e7eb; }
  .more-btn:hover { background:#0b1220; }
}

#live-feed .post{
    margin-bottom: 20px;
}

.post-title{
    font-weight: bold;
    font-size: 1.5em;
    margin-bottom: 8px;
}

/* Badge AI – pill */
.post-badge-ai{
  --ai-bg: linear-gradient(135deg, #eef7ff, #e9f9f1);
  --ai-text: #0b3b2e;
  --ai-border: rgba(11, 59, 46, 0.15);

  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .35rem .7rem;
  border: 1px solid var(--ai-border);
  border-radius: 999px;
  background: var(--ai-bg);
  color: var(--ai-text);
  font-size: .8125rem; /* ~13px */
  line-height: 1;
  font-weight: 600;
  letter-spacing: .2px;
  box-shadow: 0 1px 2px rgba(0,0,0,.04), inset 0 1px 0 rgba(255,255,255,.6);
  user-select: none;
  -webkit-font-smoothing: antialiased;
  transition: transform .15s ease, box-shadow .15s ease, background .2s ease;
}

.post-badge-ai::before{
  content: "🧠";
  font-size: 1rem;
  line-height: 1;
}

/* Hover/focus nei link (se il badge è dentro un <a>) */
a .post-badge-ai,
.post-badge-ai a{
  text-decoration: none;
}
a:hover .post-badge-ai,
a:focus .post-badge-ai{
  transform: translateY(-1px);
  box-shadow: 0 3px 10px rgba(0,0,0,.08);
}

/* Variante compatta (se serve) */
.post-badge-ai.is-compact{
  padding: .25rem .5rem;
  font-size: .75rem;
}

/* Dark mode */
@media (prefers-color-scheme: dark){
  .post-badge-ai{
    --ai-bg: linear-gradient(135deg, #0f1b2a, #10241c);
    --ai-text: #c9f0e1;
    --ai-border: rgba(201, 240, 225, .18);
    box-shadow: 0 1px 2px rgba(0,0,0,.4), inset 0 1px 0 rgba(255,255,255,.03);
  }
}

/* Se vuoi posizionarlo “meta-style” sopra al titolo */
.entry-header .post-badge-ai,
.post .post-badge-ai{
  margin-bottom: .75rem;
}

.post-actions{
    margin-top: 20px;
}


/* Contenitore logo + badge */
.site-logo {
  display: inline-flex;
  align-items: center;   /* allineamento verticale perfetto */
  gap: 8px;              /* spazio tra logo e BETA */
  text-decoration: none; /* niente underline sull'anchor */
}

/* Logo img */
.site-logo__img {
  display: block;
  height: auto;          /* mantiene proporzioni con width fisso */
}

/* Badge BETA */
.logo-badge {
  font-weight: 700;
  font-size: 12px;
  line-height: 1;        /* evita “salti” verticali */
  letter-spacing: .5px;
  padding: 4px 8px;
  border-radius: 999px;  /* pill */
  border: 1px solid rgba(0,0,0,.12);
 background: var(--accent, #ffe14d);
color: var(--text, #333);     /* testo scuro leggibile */
  white-space: nowrap;   /* evita a capo */
}

/* (Opzionale) Adatta la dimensione su schermi molto piccoli */
@media (max-width: 420px) {
  .logo-badge {
    font-size: 11px;
    padding: 3px 6px;
  }
}