/* theme-meetin.css - Design System & Global Styles */

:root {
    /* Colors */
    --bg-main: #f0f2f5;
    --bg-surface: #ffffff;
    --bg-hover: #f2f2f2;
    --bg-input: #f0f2f5;

    --primary: #1877f2;
    --primary-hover: #166fe5;

    --text-primary: #1c1e21;
    --text-secondary: #65676b;
    --text-link: #1877f2;

    --border-color: #dadde1;
    --border-soft: #f0f2f5;

    --shadow-main: 0 1px 2px rgba(0, 0, 0, 0.1);
    --shadow-pop: 0 12px 28px rgba(0, 0, 0, 0.2);

    /* Spacing */
    --gap: 16px;
    --radius: 8px;
    --header-height: 56px;
}

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

body {
    background-color: var(--bg-main);
    color: var(--text-primary);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    line-height: 1.34;
    -webkit-font-smoothing: antialiased;
}

a {
    color: var(--text-link);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

button {
    font-family: inherit;
    border: none;
    background: none;
    cursor: pointer;
    transition: background-color 0.2s;
}

/* Layout Utilities */
.app-container {
    width: 100%;
    margin: 0 auto;
    display: flex;
    justify-content: center;
    padding-top: var(--header-height);
    min-height: 100vh;
}

.layout-grid {
    display: flex;
    justify-content: center;
    gap: 20px;
    width: 100%;
    max-width: 980px;
    margin: 0 auto;
    padding: 24px 20px;
    align-items: flex-start;
    box-sizing: border-box;
}

/* Column Sizes & Aesthetics */
.sidebar-left,
.sidebar-right {
    flex: 0 0 300px;
    position: sticky;
    top: calc(var(--header-height) + 24px);
    height: calc(100vh - var(--header-height) - 48px);
    overflow-y: auto;
    background: transparent;
    text-align: left;
    scrollbar-width: none;
    /* Hide scrollbar for sidebar */
}

.sidebar-left::-webkit-scrollbar {
    display: none;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.sidebar-link {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    text-align: left;
    gap: 12px;
    padding: 10px 12px;
    border-radius: var(--radius);
    color: var(--text-primary);
    font-weight: 500;
    transition: background 0.2s;
}

.sidebar-link:hover {
    background: var(--bg-hover);
    text-decoration: none;
}

.sidebar-link.active {
    background: #e7f3ff;
    color: var(--primary);
    font-weight: 700;
}

.sidebar-link .icon {
    font-size: 1.25rem;
    width: 28px;
    text-align: center;
}

.main-feed {
    flex: 0 1 680px;
    max-width: 680px;
    width: 100%;
    margin: 0;
    min-width: 0;
    text-align: left;
}

/* Visibility Utilities */
.show-mobile {
    display: none !important;
}

.hide-mobile {
    display: block !important;
}

@media (max-width: 1100px) {
    .sidebar-right {
        display: none !important;
    }
}

@media (max-width: 992px) {
    .sidebar-left {
        display: none !important;
    }

    .main-feed {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        margin: 0 !important;
        flex: 1 1 100% !important;
    }

    .show-mobile {
        display: block !important;
    }

    .hide-mobile {
        display: none !important;
    }

    .layout-grid {
        flex-direction: column !important;
        gap: 16px !important;
        padding: 16px 8px !important;
    }
}

@media (max-width: 768px) {
    .app-container {
        padding-top: var(--header-height);
        padding-bottom: 60px;
    }
}

/* Components: Card */
.content-card {
    background: var(--bg-surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow-main);
    margin-bottom: var(--gap);
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
}

.card-header {
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border-color);
}

.card-header.border-bottom {
    border-bottom: 1px solid var(--border-color);
}

.card-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

.card-subtitle {
    font-size: 0.95rem;
    color: var(--text-secondary);
    margin-top: 4px;
}

.card-content {
    padding: 20px;
}

.card-content.p-0 {
    padding: 0;
}

/* Page Header Card (Specialized) */
.page-header-card {
    background: linear-gradient(135deg, var(--bg-surface) 0%, #f8f9fa 100%);
    border-left: 5px solid var(--primary);
}

.header-flex {
    display: flex;
    align-items: center;
    gap: 20px;
}

.header-icon {
    width: 60px;
    height: 60px;
    background: var(--primary);
    color: white;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    box-shadow: 0 4px 12px rgba(24, 119, 242, 0.3);
}

.page-title {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--text-primary);
    margin: 0;
    letter-spacing: -0.5px;
}

.page-subtitle {
    color: var(--text-secondary);
    font-size: 1rem;
    margin-top: 4px;
    max-width: 600px;
}

/* Components: Buttons */
.btn {
    padding: 8px 16px;
    border-radius: 6px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

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

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

.btn-secondary {
    background: #e4e6eb;
    color: #050505;
}

.btn-secondary:hover {
    background: #d8dadf;
}

/* Header App-Bar */
.app-header {
    background: var(--bg-surface);
    height: auto !important;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
    /* Più pulito */
    display: flex;
    flex-direction: column;
    align-items: stretch;
}

.header-content {
    height: var(--header-height);
    width: 100%;
    margin: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.header-search-container {
    background: var(--bg-input);
    border-radius: 20px;
    padding: 0 12px;
    display: flex;
    align-items: center;
    width: 280px;
}

.header-search-container .search-input {
    background: transparent;
    border: none;
    height: 36px;
    width: 100%;
}

/* Sub-Header Styles */
.sub-header {
    width: 100%;
    height: 42px;
    background: var(--bg-surface);
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: center;
    align-items: center;
}

.sub-header-container {
    max-width: 980px;
    /* Aligns with layout-grid */
    width: 100%;
    height: 100%;
    padding: 0 20px;
    display: flex;
    justify-content: flex-start;
}

.sub-header-box {
    display: flex;
    align-items: stretch;
    height: 100%;
    border-left: 1px solid var(--border-color);
    border-right: 1px solid var(--border-color);
    background: var(--bg-surface);
}

.sub-header-dropdowns-group {
    display: flex;
    align-items: center;
    height: 100%;
    border-right: 1px solid var(--border-color);
}

.sub-header-dropdown {
    position: relative;
    height: 100%;
    display: flex;
    align-items: center;
}

.dropdown-trigger {
    background: none;
    border: none;
    height: 100%;
    font-family: inherit;
    font-size: 12px;
    font-weight: 700;
    color: var(--text-secondary);
    padding: 0 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
    text-transform: uppercase;
    transition: background-color 0.2s, color 0.2s;
}

.dropdown-trigger:hover,
.sub-header-dropdown:hover .dropdown-trigger {
    background-color: var(--bg-hover);
    color: var(--primary);
}

.sub-header-dropdown:hover .dropdown-content {
    display: block;
}

.dropdown-content {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background-color: var(--bg-surface);
    min-width: 180px;
    box-shadow: var(--shadow-pop);
    border: 1px solid var(--border-color);
    border-bottom-left-radius: 8px;
    border-bottom-right-radius: 8px;
    z-index: 1001;
    padding: 6px 0;
}

.dropdown-content a {
    color: var(--text-primary);
    padding: 10px 16px;
    text-decoration: none;
    display: block;
    font-size: 13.5px;
    font-weight: 500;
    transition: background-color 0.2s, color 0.2s;
}

.dropdown-content a:hover {
    background-color: var(--bg-hover);
    color: var(--primary);
    text-decoration: none;
}

.sub-header-links {
    display: flex;
    align-items: center;
    height: 100%;
}

.sub-nav-link {
    height: 100%;
    display: flex;
    align-items: center;
    padding: 0 20px;
    font-size: 13.5px;
    font-weight: 600;
    color: var(--text-secondary);
    text-decoration: none;
    transition: background-color 0.2s, color 0.2s;
    border-right: 1px solid var(--border-color);
}

.sub-nav-link:last-child {
    border-right: none;
}

.sub-nav-link:hover {
    background-color: var(--bg-hover);
    color: var(--primary);
    text-decoration: none;
}

.sub-nav-link.active {
    color: var(--primary);
    background-color: #e7f3ff;
    font-weight: 700;
}

.header-nav {
    display: flex;
    align-items: center;
    gap: 4px;
}

.nav-icon-btn {
    width: 48px;
    height: 48px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    color: var(--text-secondary);
    vertical-align: middle;
    position: relative;
    transition: background 0.2s;
}

.nav-icon-btn:hover {
    background: var(--bg-hover);
    text-decoration: none;
}

.nav-icon-btn.active {
    color: var(--primary);
}

.nav-friends-icon {
    transform: translateY(2px);
}

.nav-icon-btn .badge {
    position: absolute;
    top: 6px;
    right: 4px;
    background: #fa3e3e;
    color: white;
    font-size: 11px;
    padding: 1px 5px;
    border-radius: 10px;
    font-weight: 700;
}

.user-pill {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 12px 4px 4px;
    border-radius: 20px;
    color: var(--text-primary);
    font-weight: 600;
}

.user-pill:hover {
    background: var(--bg-hover);
    text-decoration: none;
}

.avatar-xs {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
}

.avatar-sm {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

.header-avatar {
    width: 28px !important;
    height: 28px !important;
    border-radius: 50% !important;
    object-fit: cover !important;
}

/* Composer Form */
.app-composer .form-textarea {
    width: 100%;
    border: none;
    background: var(--bg-input);
    border-radius: 20px;
    padding: 12px 16px;
    resize: none;
    font-size: 1rem;
    min-height: 44px;
}

.create-post-actions-bar {
    display: flex;
    align-items: center;
    border-top: 1px solid var(--border-color);
    margin-top: 12px;
    padding-top: 8px;
    gap: 8px;
}

.create-post-action-button {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: var(--radius);
    color: var(--text-secondary);
    font-weight: 600;
    cursor: pointer;
}

.create-post-action-button:hover {
    background: var(--bg-hover);
}

/* Post Card Styles */
.app-post-card {
    padding-bottom: 8px;
}

.post-header {
    padding: 12px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
}

.post-header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.post-avatar {
    border-radius: 50%;
    object-fit: cover;
}

.post-username {
    font-weight: 700;
    color: var(--text-primary);
}

.post-meta-row {
    font-size: 0.85rem;
    color: var(--text-secondary);
    display: flex;
    gap: 6px;
    align-items: center;
}

.post-body {
    padding: 12px 16px;
}

.post-text {
    font-size: 0.95rem;
    line-height: 1.5;
    white-space: pre-wrap;
    margin-bottom: 8px;
    text-align: left;
}

.post-media-container {
    margin: 8px -16px;
}

.post-image {
    width: 100%;
    height: auto;
    display: block;
}

.post-footer {
    padding: 0 16px;
}

.post-stats {
    display: flex;
    justify-content: space-between;
    padding: 10px 16px;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.post-actions {
    display: flex;
    border-top: 1px solid var(--border-color);
    padding: 4px 0;
}

.post-action-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 8px;
    border-radius: 4px;
    color: var(--text-secondary);
    font-weight: 600;
}

.post-action-btn:hover {
    background: var(--bg-hover);
}

.post-action-btn.active {
    color: var(--primary);
}

/* Dropdown Menu Post */
.post-actions-dropdown {
    position: relative;
}

.post-menu {
    position: absolute;
    top: 100%;
    right: 0;
    width: 200px;
    background: var(--bg-surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow-pop);
    border: 1px solid var(--border-color);
    display: none;
    flex-direction: column;
    padding: 8px 0;
    z-index: 100;
}

.post-menu.show {
    display: flex;
}

.post-menu-item {
    padding: 10px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--text-primary);
    font-size: 0.9rem;
    font-weight: 500;
}

.post-menu-item:hover {
    background: var(--bg-hover);
    text-decoration: none;
}

.post-menu-item.text-danger {
    color: #e41e3f;
}

.post-menu-item .icon {
    width: 20px;
    text-align: center;
}

/* Read More Toggle */
.read-more-toggle {
    color: var(--primary);
    font-weight: 600;
    cursor: pointer;
    margin-top: 4px;
    display: inline-block;
}

.read-more-toggle:hover {
    text-decoration: underline;
}

/* Form Elements */
.form-input {
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 8px 12px;
    font-size: 0.9rem;
}

.file-input-hidden {
    display: none;
}

/* Special Utilities */
/* Notification Items */
.notification-item {
    display: flex;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-soft);
    transition: background 0.2s;
    cursor: pointer;
    position: relative;
    text-decoration: none !important;
}

.notification-item:hover {
    background: var(--bg-hover);
}

.notification-item.unread {
    background: #f0f7ff;
}

.notification-item.unread::after {
    content: '';
    position: absolute;
    right: 20px;
    width: 10px;
    height: 10px;
    background: var(--primary);
    border-radius: 50%;
}

.notification-icon-wrapper {
    width: 48px;
    height: 48px;
    min-width: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    margin-right: 16px;
    background: var(--bg-hover);
    color: var(--text-secondary);
}

.unread .notification-icon-wrapper {
    background: var(--primary);
    color: white;
}

.notification-body {
    flex: 1;
}

.notification-title {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.unread .notification-title {
    font-weight: 700;
}

.notification-text {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.4;
}

.notification-time {
    font-size: 0.8rem;
    color: var(--text-link);
    margin-top: 4px;
    font-weight: 500;
}

/* Utility Classes */
.mb-1 {
    margin-bottom: 4px !important;
}

.mb-2 {
    margin-bottom: 8px !important;
}

.mb-3 {
    margin-bottom: 16px !important;
}

.mb-4 {
    margin-bottom: 24px !important;
}

.mb-5 {
    margin-bottom: 32px !important;
}

.mt-1 {
    margin-top: 4px !important;
}

.mt-2 {
    margin-top: 8px !important;
}

.mt-3 {
    margin-top: 16px !important;
}

.mt-4 {
    margin-top: 24px !important;
}

.mt-5 {
    margin-top: 32px !important;
}

.p-0 {
    padding: 0 !important;
}

.p-1 {
    padding: 4px !important;
}

.p-2 {
    padding: 8px !important;
}

.p-3 {
    padding: 16px !important;
}

.p-4 {
    padding: 24px !important;
}

.py-4 {
    padding-top: 24px !important;
    padding-bottom: 24px !important;
}

.py-5 {
    padding-top: 40px !important;
    padding-bottom: 40px !important;
}

.text-center {
    text-align: center !important;
}

.text-right {
    text-align: right !important;
}

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

.text-link {
    color: var(--text-link) !important;
    font-weight: 600;
}

.font-weight-bold {
    font-weight: 700 !important;
}

.w-100 {
    width: 100% !important;
}

.d-flex {
    display: flex !important;
}

.align-items-center {
    align-items: center !important;
}

.justify-content-center {
    justify-content: center !important;
}

.flex-column {
    flex-direction: column !important;
}

.gap-2 {
    gap: 8px !important;
}

.gap-3 {
    gap: 16px !important;
}

.sidebar-section {
    background: var(--bg-surface);
    border-radius: var(--radius);
    padding: 16px;
    margin-bottom: var(--gap);
    box-shadow: var(--shadow-main);
}

.section-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-secondary);
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.sidebar-placeholder {
    color: var(--text-secondary);
    font-size: 0.9rem;
    text-align: center;
    padding: 12px 0;
}

/* Footer Styling */
.footer {
    background: var(--bg-surface);
    padding: 40px 16px;
    margin-top: 40px;
    border-top: 1px solid var(--border-color);
}

.footer-container {
    width: 100%;
    margin: 0;
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 24px;
}

.footer-left {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.footer-right {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.footer-link {
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.footer-link:hover {
    color: var(--primary);
    text-decoration: underline;
}

.separator {
    color: var(--border-color);
}

@media (max-width: 768px) {
    .footer-container {
        flex-direction: column;
        text-align: center;
    }

    .footer-right {
        justify-content: center;
    }
}

/* Mobile Menu & Overlays */
.mobile-bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 56px;
    background: var(--bg-surface);
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: space-around;
    align-items: center;
    z-index: 999;
    padding-bottom: env(safe-area-inset-bottom);
}

.mobile-nav-item {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    text-decoration: none;
    flex: 1;
    height: 100%;
}

.mobile-nav-item.active {
    color: var(--primary-color);
}

.mobile-nav-item .notification-badge {
    position: absolute;
    top: 8px;
    right: 25%;
    background: #e41e3f;
    color: white;
    border-radius: 50%;
    padding: 2px 6px;
    font-size: 10px;
    font-weight: bold;
    border: 2px solid var(--bg-surface);
}

/* Mobile Menu Sidebar & Overlay */
.mobile-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 2000;
    display: none;
    opacity: 0;
    transition: opacity 0.3s;
}

.mobile-menu-overlay.active {
    display: block;
    opacity: 1;
}

.mobile-menu-sidebar {
    position: fixed;
    top: 0;
    left: -280px;
    width: 280px;
    height: 100vh;
    background: var(--bg-surface);
    z-index: 2100;
    transition: left 0.3s ease;
    box-shadow: 2px 0 12px rgba(0, 0, 0, 0.15);
    display: flex;
    flex-direction: column;
}

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

.mobile-menu-header {
    padding: 16px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.mobile-menu-header h3 {
    margin: 0;
    font-size: 1.1rem;
}

.mobile-menu-close {
    font-size: 1.5rem;
    color: var(--text-secondary);
}

.mobile-menu-items {
    flex: 1;
    overflow-y: auto;
    padding: 12px 0;
}

.mobile-menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    color: var(--text-primary);
    font-weight: 500;
    transition: background 0.2s;
}

.mobile-menu-item:hover {
    background: var(--bg-hover);
    text-decoration: none;
}

.mobile-menu-item .icon {
    font-size: 1.2rem;
    min-width: 24px;
    text-align: center;
}

.mobile-menu-divider {
    height: 1px;
    background: var(--border-color);
    margin: 8px 0;
}

/* Mobile Bottom Nav Tweaks */
.mobile-bottom-nav a {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    width: 100%;
}

/* --- COMPOSER FORM (STILE FACEBOOK) --- */

/* Trigger Card */
.composer-trigger-card {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    gap: 12px;
    margin-bottom: 20px;
    cursor: pointer;
    border-radius: 8px;
}

.composer-trigger-input {
    flex: 1;
    background-color: #f0f2f5;
    border-radius: 20px;
    padding: 10px 16px;
    color: var(--text-secondary);
    font-size: 15px;
    cursor: text;
}

.composer-trigger-input:hover {
    background-color: #e4e6e9;
}

.composer-trigger-icons {
    display: flex;
    align-items: center;
    gap: 8px;
}

.composer-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px;
    border-radius: 8px;
    transition: background 0.2s;
    cursor: pointer;
}

.composer-icon:hover {
    background: var(--bg-hover);
}

/* Modal Overlay */
.composer-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(2px);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
}

.composer-modal-content {
    background: var(--bg-surface);
    width: 100%;
    max-width: 500px;
    border-radius: 12px;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.2), 0 2px 4px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    animation: modalPopIn 0.2s ease-out;
    margin: 16px;
}

@keyframes modalPopIn {
    0% {
        opacity: 0;
        transform: scale(0.95);
    }

    100% {
        opacity: 1;
        transform: scale(1);
    }
}

.composer-modal-header {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 16px;
    position: relative;
}

.composer-modal-title {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 700;
}

.composer-modal-close {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    background: #e4e6eb;
    border: none;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    cursor: pointer;
}

.composer-modal-close:hover {
    background: #d8dadf;
}

.composer-modal-body {
    padding: 16px;
}

/* User Banner */
.composer-user-banner {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.composer-user-info {
    display: flex;
    flex-direction: column;
}

.composer-user-name {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 15px;
}

.composer-visibility-select {
    appearance: none;
    background: #e4e6eb;
    border: none;
    border-radius: 6px;
    padding: 4px 24px 4px 8px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    margin-top: 2px;
    cursor: pointer;
}

/* Textarea Overlay */
.composer-textarea-container {
    position: relative;
    margin-bottom: 16px;
}

.composer-form-textarea {
    width: 100%;
    min-height: 120px;
    border: none;
    resize: none;
    font-size: 24px;
    color: var(--text-primary);
    outline: none;
    background: transparent;
    padding: 0;
}

.composer-form-textarea::placeholder {
    color: var(--text-secondary);
    font-size: 24px;
}

/* Addons Box */
.composer-addons-box {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 12px 16px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.addons-label {
    font-weight: 600;
    color: var(--text-primary);
}

.addons-icons {
    display: flex;
    gap: 8px;
}

.addon-icon-btn {
    display: flex;
    cursor: pointer;
    padding: 4px;
    border-radius: 50%;
    transition: background 0.2s;
}

.addon-icon-btn:hover {
    background: var(--bg-hover);
}

/* Submit Button Override */
.composer-submit-btn {
    width: 100%;
    font-weight: 600;
    padding: 10px;
    font-size: 16px;
    transition: background 0.2s, color 0.2s;
}

.composer-submit-btn:disabled {
    background: #E4E6EB;
    color: #BCC0C4;
    cursor: not-allowed;
    border: none;
}

/* ===================================================
   SHARE MENU (menu condivisione post)
   =================================================== */
.share-menu {
    position: absolute;
    z-index: 1000;
    min-width: 260px;
    margin-top: 6px;
}

.share-menu-content {
    background: #ffffff !important;
    border: 1px solid var(--border-color, #ddd);
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.18);
    padding: 8px 0;
    color: #050505 !important;
}

.share-menu-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 16px;
    font-weight: 600;
    border-bottom: 1px solid var(--border-color, #eee);
    margin-bottom: 4px;
    color: #050505 !important;
}

.share-menu-close {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
    color: #65676b !important;
    line-height: 1;
    padding: 2px 6px;
    border-radius: 50%;
}

.share-menu-close:hover {
    background: #f0f2f5 !important;
}

.share-menu-options {
    display: flex;
    flex-direction: column;
    padding: 4px 0;
}

.share-option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    background: none;
    border: none;
    cursor: pointer;
    width: 100%;
    text-align: left;
    font-size: 15px;
    color: #050505 !important;
    border-radius: 8px;
    margin: 0 4px;
    width: calc(100% - 8px);
}

.share-option:hover {
    background: #f0f2f5 !important;
}

.share-option.facebook-share svg {
    color: #1877f2;
}

.share-option.twitter-share svg {
    color: #1da1f2;
}

.share-option.copy-link svg {
    color: #65676b;
}

/* ===================================================
   STAR RATING - Fix colore e layout inline
   =================================================== */
.post-rating-section {
    padding: 4px 16px 12px;
    border-top: 1px solid #f0f2f5;
}

.post-rating-section .star-rating {
    display: inline-flex !important;
    align-items: center;
    gap: 4px;
}

.post-rating-section .star {
    font-size: 20px !important;
    color: #ccd0d5 !important;
    cursor: pointer;
    transition: color 0.15s ease;
    line-height: 1;
}

.post-rating-section .star-rating span.star.filled,
.post-rating-section .star-rating span.star.filled:hover,
div.post-rating-section div.star-rating .star.filled {
    color: #ffc107 !important;
    text-shadow: 0 0 1px rgba(0, 0, 0, 0.1);
}

.nav-friends-icon {
    transform: translateY(2px);
}

/* Like button - stato attivo */
.post-action.action-like.liked svg,
.post-action.action-like.liked {
    color: #e41e3f !important;
    fill: #e41e3f !important;
}

/* ===================================================
   BREADCRUMB - Fix layout inline e separatori
   =================================================== */
.post-breadcrumbs {
    padding: 10px 16px !important;
    margin-bottom: 12px !important;
}

.breadcrumb-list {
    display: flex !important;
    flex-wrap: wrap;
    list-style: none !important;
    padding: 0 !important;
    margin: 0 !important;
    font-size: 0.9rem;
    color: var(--text-secondary);
    align-items: center;
}

.breadcrumb-item {
    display: flex;
    align-items: center;
}

.breadcrumb-item+.breadcrumb-item::before {
    content: ">";
    margin: 0 8px;
    color: var(--text-secondary);
    font-size: 0.8rem;
    opacity: 0.6;
}

.breadcrumb-item a {
    color: var(--primary);
    font-weight: 500;
}

.breadcrumb-item span {
    color: var(--text-primary);
    font-weight: 600;
    display: inline-block;
    max-width: 300px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    vertical-align: middle;
}

/* Sidebar Expandable Section "Altro..." */
.sidebar-more-toggle {
    cursor: pointer;
    user-select: none;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: var(--radius);
    color: var(--text-primary);
    font-weight: 500;
    transition: background 0.2s;
}

.sidebar-more-toggle:hover {
    background: var(--bg-hover);
}

.more-icon-circle {
    width: 28px;
    height: 28px;
    background: #e4e6eb;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s ease;
}

.more-icon-circle svg {
    width: 16px;
    height: 16px;
    color: #050505;
}

.sidebar-more-toggle.active .more-icon-circle {
    transform: rotate(180deg);
}

.extra-links-container {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 0;
}

.extra-links-container.show {
    max-height: 500px;
    /* Altezza massima per contenere i link */
    opacity: 1;
}

/* Fix spacing for post content */
.post-text {
    text-align: left !important;
    line-height: 1.5;
    font-size: 1rem;
}

.post-body {
    padding: 12px 16px 4px !important;
}

.post-content-header {
    margin-bottom: 0 !important;
    display: none;
}

.post-article {
    margin-top: 0 !important;
}

/* --- SIDEBAR RIGHT (MINIMALIST) --- */
.sidebar-right {
    display: flex;
    flex-direction: column;
}

.sidebar-section {
    background: transparent !important;
    border-radius: 0 !important;
    padding: 0 !important;
    box-shadow: none !important;
    border: none !important;
    margin-bottom: 30px;
    border-top: 1px solid #e0e0e0;
    padding-top: 15px !important;
}

.section-title {
    font-size: 16px;
    font-weight: 600;
    color: #050505;
    margin-bottom: 15px;
    padding-bottom: 0;
    border-bottom: none !important;
    text-transform: none !important;
    letter-spacing: normal;
}

.suggested-item {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
    padding: 4px;
}

.mini-avatar-modern {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
}

.widget-user-name {
    font-size: 0.9rem;
    font-weight: 600;
    color: #050505;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-decoration: none;
}

.btn-icon-minimal {
    background: none;
    border: none;
    padding: 4px;
    cursor: pointer;
    color: var(--primary);
    transition: transform 0.2s;
}

.btn-icon-minimal:hover {
    transform: scale(1.1);
}

.banner-sidebar-container {
    width: 100%;
}

.banner-sidebar-img {
    width: 100%;
    height: auto;
    border-radius: 8px;
    display: block;
}

.trending-hashtags {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.trending-hashtag-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.trending-hashtag-link {
    font-size: 1rem;
    font-weight: 700;
    color: #1877f2;
    text-decoration: none;
}

.trending-hashtag-count {
    font-size: 0.8rem;
    color: #65676b;
    white-space: nowrap;
}

.sidebar-right i,
.sidebar-right i::before {
    visibility: visible !important;
    display: inline-block !important;
    font-family: "Font Awesome 6 Free" !important;
    font-weight: 900 !important;
}

/* --- POST VIEW PAGE & RELATED POSTS --- */
.post-video-container {
    width: 100%;
    max-width: 600px;
    margin: 12px auto;
    border-radius: 8px;
    overflow: hidden;
    background: #000;
    text-align: center;
    display: flex;
    justify-content: center;
    align-items: center;
}

.post-video {
    width: 100%;
    max-width: 600px;
    max-height: 500px;
    display: block;
    margin: 0 auto;
    border-radius: 8px;
}

.post-video-embed {
    width: 100%;
    max-width: 680px;
    margin: 0 auto;
}

.post-view-page {
    width: 100%;
    max-width: 680px;
    margin: 0 auto;
}

.post-related-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin-top: 16px;
}

.post-related-card {
    background: var(--bg-surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow-main);
    overflow: hidden;
    transition: transform 0.2s;
}

.post-related-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.post-related-link {
    text-decoration: none !important;
    color: inherit;
    display: block;
}

.post-related-img {
    aspect-ratio: 16/9;
    overflow: hidden;
}

.post-related-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.post-related-body {
    padding: 12px;
}

.post-related-text {
    font-size: 0.9rem;
    font-weight: 600;
    line-height: 1.4;
    color: var(--text-primary);
    margin-bottom: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.post-related-meta {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

@media (max-width: 480px) {
    .post-related-grid {
        grid-template-columns: 1fr;
    }
}

/* --- USER PROFILE DROPDOWN --- */
.user-profile-dropdown {
    position: relative;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    width: 220px;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    display: none;
    z-index: 3000;
    margin-top: 10px;
    padding: 8px 0;
    animation: dropdownFade 0.2s ease;
}

@keyframes dropdownFade {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.dropdown-menu.show {
    display: block;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    color: var(--text-primary);
    font-weight: 500;
    transition: all 0.2s;
    font-size: 14px;
}

.dropdown-item i {
    width: 20px;
    text-align: center;
    color: var(--text-secondary);
    font-size: 16px;
}

.dropdown-item:hover {
    background: var(--bg-hover);
    text-decoration: none;
    color: var(--primary);
}

.dropdown-item:hover i {
    color: var(--primary);
}

.dropdown-divider {
    height: 1px;
    background: var(--border-color);
    margin: 8px 0;
}

.dropdown-item.logout:hover {
    background: #fff1f3;
}

/* Editorial Layout Styles */
.editorial-featured-box {
    margin-bottom: 24px;
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--bg-surface);
    box-shadow: var(--shadow-main);
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    transition: transform 0.2s, box-shadow 0.2s;
    border: 1px solid var(--border-color);
}

.editorial-featured-box:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.featured-img-container {
    height: 320px;
    background: #e4e6eb;
    overflow: hidden;
    position: relative;
}

.featured-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.featured-badge {
    position: absolute;
    top: 16px;
    left: 16px;
    background: #fa3e3e;
    color: white;
    font-size: 11px;
    font-weight: bold;
    text-transform: uppercase;
    padding: 4px 8px;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.featured-content-container {
    padding: 24px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.featured-meta {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 12px;
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
}

.featured-category {
    background: #e7f3ff;
    color: var(--primary);
    padding: 2px 8px;
    border-radius: 4px;
    font-weight: 600;
}

.featured-title {
    font-size: 22px;
    font-weight: 800;
    line-height: 1.3;
    margin-bottom: 12px;
}

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

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

.featured-excerpt {
    grid-column: 1 / -1;
    font-size: 14.5px;
    color: var(--text-secondary);
    line-height: 1.6;
    padding: 16px 24px 24px 24px;
    margin: 0;
    border-top: 1px solid var(--border-color);
}

.featured-subtitle {
    font-weight: 500;
    margin-top: -8px;
    margin-bottom: 12px;
    color: var(--text-secondary);
}

.featured-author-info {
    font-size: 13px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
}

.featured-author-avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    object-fit: cover;
}

/* Grid Layout */
.editorial-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-bottom: 24px;
}

.editorial-card {
    background: var(--bg-surface);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-main);
    display: flex;
    flex-direction: column;
    transition: transform 0.2s, box-shadow 0.2s;
    border: 1px solid var(--border-color);
}

.editorial-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.card-img-container {
    height: 180px;
    background: #e4e6eb;
    overflow: hidden;
    flex-shrink: 0;
}

.card-img-container a,
.featured-img-container a {
    display: block;
    width: 100%;
    height: 100%;
}

.card-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.card-body {
    padding: 16px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.card-meta {
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 8px;
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

.card-category {
    background: #e7f3ff;
    color: var(--primary);
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 600;
}

.card-title-editorial {
    font-size: 16px;
    font-weight: 700;
    line-height: 1.4;
    margin-bottom: 8px;
}

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

.card-title-editorial a:hover {
    color: var(--primary);
}

.card-excerpt-editorial {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.4;
    margin-bottom: 12px;
    flex-grow: 1;
}

.card-author-info {
    font-size: 12px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: auto;
    width: 100%;
}

.card-actions-wrapper {
    margin-left: auto;
    display: flex;
    gap: 8px;
    align-items: center;
}

.card-action-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    color: #65676b;
    font-size: 14px;
    padding: 4px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s, transform 0.2s;
}

.card-action-btn:hover {
    transform: scale(1.1);
}

.card-action-btn.saved {
    color: var(--primary) !important;
}

.card-action-btn.saved svg {
    fill: var(--primary) !important;
}

.card-action-btn .save-icon {
    transition: fill 0.2s;
}

.banner-slot {
    grid-column: span 2;
    margin: 10px 0;
    width: 100%;
}

.banner-slot .banner-img {
    max-height: 150px;
    width: 100%;
    object-fit: contain;
    border-radius: 8px;
}

@media (max-width: 768px) {
    .editorial-featured-box {
        grid-template-columns: 1fr !important;
    }

    .featured-img-container {
        height: 200px !important;
    }

    .featured-img-container a {
        display: block !important;
        width: 100% !important;
        height: 100% !important;
    }

    .featured-img {
        width: 100% !important;
        height: 100% !important;
        object-fit: cover !important;
        display: block !important;
    }

    .editorial-grid {
        grid-template-columns: 1fr !important;
    }

    .editorial-card {
        flex-direction: column !important;
        height: auto !important;
    }

    .card-img-container {
        height: 180px !important;
        flex-shrink: 0 !important;
        display: block !important;
    }

    .card-img-container a {
        display: block !important;
        width: 100% !important;
        height: 100% !important;
    }

    .card-img {
        width: 100% !important;
        height: 100% !important;
        object-fit: cover !important;
        display: block !important;
    }
}

/* ═══════════════════════════════════════════════════════════════════════════
   PAGINA ARTICOLO — Layout editoriale
   (precedentemente inline in articolo.php)
   ═══════════════════════════════════════════════════════════════════════════ */

/* Font Editoriali — Playfair Display + Inter (caricati tramite Google Fonts in articolo.php) */

.post-view-page {
    max-width: 100%;
    margin: 0 auto;
    padding: 0;
}

.post-view-page .post-breadcrumbs {
    max-width: 720px;
    margin: 20px auto 10px;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
}

.content-card.app-post-card.post {
    max-width: 100%;
    margin: 0 auto;
    background: transparent !important;
    box-shadow: none !important;
    border: none !important;
    border-radius: 0 !important;
}

.post-header-content {
    max-width: 720px;
    margin: 40px auto 20px;
    padding: 0 20px;
}

.post-title {
    font-family: "Playfair Display", Georgia, serif !important;
    font-size: clamp(2rem, 5vw, 3.2rem) !important;
    line-height: 1.1 !important;
    font-weight: 800 !important;
    color: #1a1a1a !important;
    margin-bottom: 20px !important;
    letter-spacing: -0.02em !important;
}

.post-meta {
    font-family: "Inter", sans-serif !important;
    font-size: 0.9rem !important;
    color: #65676b !important;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    padding-bottom: 20px;
    border-bottom: 1px solid #e0e0e0;
}

.post-meta a {
    color: #1a1a1a !important;
    font-weight: 600 !important;
    text-decoration: none;
}

.post-meta a:hover {
    text-decoration: underline;
}

.post-excerpt {
    max-width: 720px;
    margin: 30px auto !important;
    padding: 0 20px 0 24px !important;
    font-family: "Playfair Display", Georgia, serif !important;
    font-style: italic !important;
    font-size: 1.45rem !important;
    line-height: 1.5 !important;
    color: #2c2c2c !important;
    font-weight: 500 !important;
    border-left: 4px solid #1877f2 !important;
}

.post-cover {
    max-width: 900px;
    margin: 40px auto !important;
    padding: 0 !important;
}

.post-cover img {
    width: 100% !important;
    height: auto !important;
    border-radius: 4px !important;
    display: block;
}

.post-body {
    max-width: 720px;
    margin: 0 auto !important;
    padding: 20px 20px 0 !important;
    font-family: "Inter", -apple-system, sans-serif !important;
    font-size: 19px !important;
    line-height: 1.8 !important;
    color: #2c2c2c !important;
}

.post-body p {
    margin-bottom: 1.8rem !important;
}

.post-body h2.editorial-subtitle {
    font-family: "Playfair Display", serif !important;
    font-size: 1.8rem !important;
    margin: 3rem 0 1.2rem !important;
    line-height: 1.3 !important;
    font-weight: 700 !important;
    color: #111 !important;
}

.post-body a {
    color: #1877f2 !important;
    text-decoration: underline !important;
    text-underline-offset: 3px !important;
}

.post-body blockquote {
    font-style: italic !important;
    font-size: 1.5rem !important;
    padding-left: 30px !important;
    margin: 40px 0 !important;
    border-left: 5px solid #eee !important;
    color: #555 !important;
}

.post-footer {
    max-width: 720px;
    margin: 15px auto 0 !important;
    padding: 20px !important;
    border-top: 1px solid #eee !important;
    background: #fcfcfc !important;
    border-radius: 8px !important;
}

.post-related {
    max-width: 900px;
    margin: 80px auto 40px !important;
    padding: 40px 20px !important;
    border-top: 2px solid #1a1a1a !important;
}

.post-related-title {
    font-family: "Playfair Display", serif !important;
    font-size: 2rem !important;
    margin-bottom: 30px !important;
    text-align: center;
}

/* ─── Box1 dinamico nella pagina articolo ──────────────────────────────────── */

.articolo-box1-wrapper {
    max-width: 760px;
    margin: 32px auto 0;
    padding: 0 20px;
}

.articolo-box1-inner .sidebar-section.dynamic-box {
    background: linear-gradient(135deg, #f8f9ff 0%, #eef2ff 100%);
    border: 1px solid #dce3ff;
    border-radius: 16px;
    padding: 24px 28px;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 16px;
    box-shadow: 0 2px 16px rgba(102, 126, 234, 0.08);
    transition: box-shadow 0.2s, transform 0.2s;
}

.articolo-box1-inner .sidebar-section.dynamic-box:hover {
    box-shadow: 0 6px 24px rgba(102, 126, 234, 0.15);
    transform: translateY(-2px);
}

.articolo-box1-inner .sidebar-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: #2c3e50;
    margin: 0 0 8px 0;
}

.articolo-box1-inner .dynamic-box-content {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 16px;
    width: 100%;
}

.articolo-box1-inner .dynamic-box-content a {
    display: flex !important;
    flex-direction: column;
    align-items: stretch;
    gap: 16px;
    width: 100%;
    text-decoration: none;
    color: inherit;
}

.articolo-box1-inner .dynamic-box-image {
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
    max-height: 250px;
    object-fit: contain;
    border-radius: 12px;
    flex-shrink: 0;
}

.articolo-box1-inner .dynamic-box-text {
    color: #555;
    font-size: 0.95rem;
    line-height: 1.6;
    margin: 0;
}

/* ─── Responsive articolo ─────────────────────────────────────────────────── */

@media (max-width: 768px) {
    .post-title {
        font-size: 1.8rem !important;
    }

    .post-body {
        font-size: 17px !important;
        padding: 15px !important;
    }

    .post-excerpt {
        font-size: 1.15rem !important;
    }

    .post-header-content {
        margin-top: 20px;
    }
}

@media (max-width: 600px) {
    .articolo-box1-inner .sidebar-section.dynamic-box {
        flex-direction: column;
        text-align: center;
        padding: 18px;
    }
}

/* ==========================================================================
   STILI PER ARTICOLO.PHP (Spostamento CSS inline)
   ========================================================================== */

/* Bottone di salvataggio attivo/salvato */
.post-action-btn.action-save.saved {
    color: var(--primary) !important;
}

.post-action-btn.action-save.saved svg {
    fill: var(--primary) !important;
}

.post-action-btn.action-save svg {
    transition: fill 0.2s;
}

/* Sezione di valutazione (rating) */
.post-rating-container {
    display: flex;
    align-items: center;
    flex-wrap: nowrap;
    gap: 8px;
    padding: 12px 16px;
}

.post-rating-section .rating-label {
    white-space: nowrap;
    color: #65676b;
    font-size: 14px;
}

.post-rating-section .rating-value {
    color: #65676b;
    font-size: 13px;
    white-space: nowrap;
}

/* ==========================================================================
   GESTIONE BOX PERSONALIZZABILI (Customizable Boxes)
   ========================================================================== */

.articolo-box1-wrapper {
    margin: 30px 0;
    padding: 0;
    width: 100%;
}

.articolo-box1-inner {
    max-width: 100%;
    margin: 0 auto;
}

.dynamic-box {
    background: var(--bg-surface, #ffffff);
    border: 1px solid var(--border-color, #e0e0e0);
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 24px;
}

.dynamic-box:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.08);
}

.dynamic-box .sidebar-title {
    font-family: 'Playfair Display', serif;
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text-primary, #2c3e50);
    margin: 0;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--primary, #1877f2);
}

.dynamic-box-content {
    display: flex;
    flex-direction: row;
    gap: 20px;
    align-items: center;
}

.dynamic-box-image {
    max-width: 150px;
    height: auto;
    border-radius: 8px;
    object-fit: cover;
    flex-shrink: 0;
}

.dynamic-box-text {
    font-family: 'Inter', sans-serif;
    font-size: 1rem;
    line-height: 1.6;
    color: var(--text-secondary, #555555);
    flex-grow: 1;
}

@media (max-width: 768px) {
    .dynamic-box-content {
        flex-direction: column;
        text-align: center;
    }

    .dynamic-box-image {
        max-width: 100%;
        width: 200px;
    }
}

/* Wrapper generico per i Box Dinamici integrati nelle pagine (Home, Info, Articoli, ecc.) */
.dynamic-box-page-wrapper {
    width: 100%;
    margin: 20px auto 24px;
    padding: 0;
}

.dynamic-box-page-inner {
    width: 100%;
}

.dynamic-box-page-wrapper .dynamic-box {
    margin-bottom: 0;
}

@media (min-width: 992px) {

    /* Padding per accomodare la doppia header fissa */
    .app-container {
        padding-top: 98px !important;
        /* 56px main header + 42px sub-header */
    }

    /* Contenitore principale centrato */
    .layout-grid {
        justify-content: center !important;
        gap: 20px !important;
        max-width: 980px !important;
        /* 680px feed + 240px sidebar + 20px gap + 40px padding */
        margin: 0 auto !important;
        width: 100% !important;
    }

    /* Nasconde la sidebar sinistra per allineamento */
    .sidebar-left {
        display: none !important;
    }

    /* Feed principale a 680px */
    .main-feed {
        flex: 0 1 680px !important;
        max-width: 680px !important;
        width: 100% !important;
        margin: 0 !important;
    }

    /* Sidebar destra ridotta a 240px */
    .sidebar-right {
        flex: 0 0 240px !important;
        width: 240px !important;
        display: block !important;
    }
}

/* ==========================================================================
   Cookie Consent Banner
   ========================================================================== */
.cookie-consent-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.cookie-consent-overlay.active {
    opacity: 1;
    visibility: visible;
}

.cookie-consent-banner {
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.2);
    width: 100%;
    max-width: 850px;
    max-height: 90vh;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    padding: 24px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    color: #1c1e21;
    transform: translateY(30px);
    transition: transform 0.3s ease;
}

.cookie-consent-overlay.active .cookie-consent-banner {
    transform: translateY(0);
}

.cookie-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.cookie-logo {
    height: 36px;
    width: auto;
}

.cookie-btn-rifiuta {
    background: #ffffff;
    border: 1px solid #dadde1;
    color: #1c1e21;
    padding: 8px 24px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.cookie-btn-rifiuta:hover {
    background: #f2f2f2;
    border-color: #ccd0d5;
}

.cookie-body {
    display: flex;
    flex-direction: column;
    gap: 12px;
    line-height: 1.5;
    font-size: 13.5px;
    color: #65676b;
    margin-bottom: 24px;
    text-align: left;
}

.cookie-title {
    font-size: 18px;
    font-weight: 700;
    color: #1c1e21;
    margin-bottom: 4px;
}

.cookie-text {
    margin: 0;
}

.cookie-text em {
    font-style: italic;
    color: #1c1e21;
}

.cookie-link-highlight {
    color: #e41e3f !important;
    text-decoration: underline !important;
    font-weight: 600;
}

.cookie-link-highlight:hover {
    color: #c31732 !important;
}

.cookie-subtext {
    font-size: 12px;
    margin-top: 8px;
    color: #65676b;
}

/* Preferences Area */
.cookie-preferences {
    margin-top: 16px;
    border-top: 1px solid #dadde1;
    padding-top: 16px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    animation: cookieFadeIn 0.3s ease;
}

@keyframes cookieFadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.cookie-divider {
    border: 0;
    border-top: 1px solid #dadde1;
    margin: 0 0 8px 0;
}

.preferences-title {
    font-size: 15px;
    font-weight: 700;
    color: #1c1e21;
    margin: 0;
}

.preferences-desc {
    font-size: 12.5px;
    margin: 0 0 4px 0;
}

.preference-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f7f8fa;
    padding: 12px 16px;
    border-radius: 8px;
    gap: 16px;
}

.preference-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
    text-align: left;
}

.preference-label {
    font-size: 13.5px;
    font-weight: 700;
    color: #1c1e21;
}

.preference-details {
    font-size: 12px;
    color: #65676b;
}

/* Custom CSS Switch Toggle */
.cookie-switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
    flex-shrink: 0;
}

.cookie-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.cookie-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccd0d5;
    transition: .3s;
    border-radius: 24px;
}

.cookie-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .3s;
    border-radius: 50%;
}

.cookie-switch input:checked+.cookie-slider {
    background-color: #e41e3f;
}

.cookie-switch input:checked+.cookie-slider:before {
    transform: translateX(20px);
}

.cookie-slider.disabled {
    background-color: #e4e6eb;
    cursor: not-allowed;
}

.cookie-slider.disabled:before {
    background-color: #bcc0c4;
}

.preferences-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 8px;
}

.cookie-btn-save {
    background: #e4e6eb;
    color: #050505;
    padding: 10px 20px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 13.5px;
    cursor: pointer;
    transition: background 0.2s;
}

.cookie-btn-save:hover {
    background: #d8dadf;
}

.cookie-btn-accept-all {
    background: #e41e3f;
    color: #ffffff;
    padding: 10px 20px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 13.5px;
    cursor: pointer;
    transition: background 0.2s;
}

.cookie-btn-accept-all:hover {
    background: #c31732;
}

/* Main Footer Buttons */
.cookie-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-top: 8px;
}

.cookie-btn-customize {
    background: #e41e3f;
    color: #ffffff;
    padding: 10px 24px;
    border-radius: 24px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.2s;
}

.cookie-btn-customize:hover {
    background: #c31732;
}

.cookie-btn-accept {
    background: #e41e3f;
    color: #ffffff;
    padding: 10px 36px;
    border-radius: 24px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.2s;
}

.cookie-btn-accept:hover {
    background: #c31732;
}

/* Responsive fixes */
@media (max-width: 768px) {
    .cookie-consent-banner {
        padding: 20px;
        border-radius: 12px;
        max-height: 95vh;
    }

    .cookie-header {
        margin-bottom: 16px;
    }

    .cookie-logo {
        height: 28px;
    }

    .cookie-btn-rifiuta {
        padding: 6px 16px;
        font-size: 13px;
    }

    .cookie-title {
        font-size: 16px;
    }

    .cookie-body {
        gap: 10px;
        font-size: 12.5px;
        margin-bottom: 16px;
    }

    .cookie-footer {
        flex-direction: column;
        gap: 10px;
        width: 100%;
    }

    .cookie-btn-customize,
    .cookie-btn-accept {
        width: 100%;
        text-align: center;
        padding: 12px 16px;
    }

    .preference-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .cookie-switch {
        align-self: flex-end;
    }

    .preferences-actions {
        flex-direction: column;
        gap: 10px;
    }

    .cookie-btn-save,
    .cookie-btn-accept-all {
        width: 100%;
        text-align: center;
    }
}

/* ====================================================================
   ARTICOLO PERSONALIZZATO PER CATEGORIA IN HOMEPAGE (Pareteweb)
   ==================================================================== */
.editorial-featured-box.custom-editorial-box {
    display: flex !important;
    flex-direction: column !important;
    grid-column: span 2;
    padding: 0 !important;
    margin-bottom: 24px;
}

.custom-editorial-box .custom-box-header {
    padding: 24px 24px 12px 24px;
}

.custom-editorial-box .featured-title {
    margin: 0 0 8px 0;
    font-size: 24px;
}

.custom-editorial-box .featured-title a {
    color: var(--text-main, #2c3e50);
    text-decoration: none;
}

.custom-editorial-box .featured-title a:hover {
    color: var(--primary, #3498db);
}

.custom-editorial-box .featured-meta {
    margin-bottom: 0;
    display: flex;
    gap: 12px;
    align-items: center;
}

.custom-editorial-box .featured-img-container {
    height: 380px !important;
    width: 100%;
    margin-bottom: 0;
}

.custom-editorial-box .featured-excerpt {
    border-top: 1px solid var(--border-color);
    padding: 16px 24px 24px 24px;
    margin: 0;
}

@media (max-width: 768px) {
    .editorial-featured-box.custom-editorial-box {
        grid-column: span 1;
    }
    .custom-editorial-box .featured-img-container {
        height: 220px !important;
    }
    .custom-editorial-box .featured-title {
        font-size: 20px;
    }
}
