/**
 * Homepage Layout Fix - Container & Table
 * Risolve problema container decentrato e tabella obsoleta
 */

/* ===== FIX TABELLA LAYOUT OBSOLETA ===== */

/* Rimuovi stile tabella e usa layout moderno */
.entry-content table {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    border: none !important;
    background: transparent !important;
    box-shadow: none !important;
}

.entry-content table tbody,
.entry-content table tr,
.entry-content table td {
    display: block !important;
    width: 100% !important;
    border: none !important;
    padding: 0 !important;
    background: transparent !important;
}

/* Layout a due colonne con Grid */
.entry-content>table {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr);
    gap: 40px;
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px;
}

.entry-content>table>tbody {
    display: contents !important;
}

.entry-content>table>tbody>tr {
    display: contents !important;
}

.entry-content>table>tbody>tr>td {
    display: block !important;
    background-color: #ffffff;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 24px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

.entry-content>table>tbody>tr>td:hover {
    box-shadow: 0 4px 12px rgba(0, 102, 204, 0.1);
    transform: translateY(-2px);
}

/* ===== CONTAINER CENTRATO ===== */

/* Main content centrato */
.site-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

.entry-content {
    max-width: 100%;
    margin: 0 auto;
}

/* Container interno */
.container,
.container-full {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ===== PULIZIA CONTENUTO TABELLA ===== */

/* Rimuovi spazi nbsp forzati */
.entry-content table br {
    display: none;
}

/* Liste dentro le celle */
.entry-content table ul,
.entry-content table ol {
    list-style: none;
    padding: 0;
    margin: 0;
}

.entry-content table li {
    position: relative;
    padding-left: 24px;
    margin-bottom: 12px;
    line-height: 1.7;
}

.entry-content table li::before {
    content: "▸";
    position: absolute;
    left: 0;
    color: #0066cc;
    font-weight: bold;
}

/* Titoli sezioni dentro celle */
.entry-content table strong,
.entry-content table b {
    display: block;
    color: #0066cc;
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 2px solid #0066cc;
    text-transform: capitalize;
}

/* Link dentro tabella */
.entry-content table a {
    color: #0066cc;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s ease;
    display: inline-block;
}

.entry-content table a:hover {
    color: #004999;
    transform: translateX(4px);
}

/* Paragrafi dentro tabella */
.entry-content table p {
    margin: 0 0 8px 0;
    line-height: 1.7;
}

/* ===== RESPONSIVE MOBILE ===== */

@media (max-width: 1024px) {
    .entry-content>table {
        grid-template-columns: 1fr;
        gap: 24px;
        padding: 24px 15px;
    }
}

@media (max-width: 768px) {
    .site-content {
        padding: 0 15px;
    }

    .entry-content>table {
        gap: 20px;
        padding: 20px 10px;
    }

    .entry-content>table>tbody>tr>td {
        padding: 20px;
    }

    .entry-content table strong,
    .entry-content table b {
        font-size: 18px;
    }
}

@media (max-width: 480px) {
    .entry-content>table {
        gap: 16px;
        padding: 16px 5px;
    }

    .entry-content>table>tbody>tr>td {
        padding: 16px;
    }

    .entry-content table li {
        padding-left: 20px;
        margin-bottom: 10px;
        font-size: 15px;
    }
}

/* ===== TITOLO PAGINA CENTRATO ===== */

/* Hero section */
.hero-section {
    background-color: #0066cc;
    color: #ffffff;
    padding: 40px 20px;
    margin-bottom: 0;
    text-align: center;
}

.hero-section .container {
    max-width: 1400px;
    margin: 0 auto;
}

.hero-section h1 {
    margin: 0;
    font-size: 36px;
    font-weight: 700;
    color: #ffffff;
}

.hero-section p {
    margin: 12px 0 0 0;
    font-size: 18px;
    color: rgba(255, 255, 255, 0.9);
}

/* ===== PAGE HEADER ===== */

.page-header {
    background-color: #f8f9fa;
    padding: 24px;
    margin-bottom: 32px;
    border-left: 4px solid #0066cc;
    border-radius: 4px;
}

.page-title {
    margin: 0;
    color: #0066cc;
    font-size: 32px;
    font-weight: 700;
}

/* ===== SEZIONI HOMEPAGE ===== */

/* Sezione categorie */
.category-section {
    background-color: #ffffff;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 24px;
    margin-bottom: 24px;
}

.category-section h2,
.category-section h3 {
    color: #0066cc;
    margin-top: 0;
    margin-bottom: 16px;
    font-weight: 700;
}

/* ===== OVERRIDE STILI INLINE ===== */

/* Rimuovi stili inline tabella */
.entry-content table[style] {
    width: 100% !important;
    max-width: 100% !important;
}

.entry-content table td[style],
.entry-content table tr[style],
.entry-content table tbody[style] {
    width: auto !important;
    padding: 0 !important;
}

/* Rimuovi allineamenti forzati */
.entry-content table[align],
.entry-content table td[align],
.entry-content table tr[align] {
    text-align: left !important;
}

/* ===== MIGLIORAMENTI TIPOGRAFIA ===== */

/* Font size coerente */
.entry-content {
    font-size: 16px;
    line-height: 1.8;
    color: #333;
}

/* Spaziatura paragrafi */
.entry-content>p,
.entry-content>div {
    margin-bottom: 24px;
}

/* ===== UTILITY CLASSES ===== */

/* Centratura */
.text-center {
    text-align: center !important;
}

.mx-auto {
    margin-left: auto !important;
    margin-right: auto !important;
}

/* Larghezza massima */
.max-w-1200 {
    max-width: 1200px !important;
}

.max-w-1400 {
    max-width: 1400px !important;
}

/* Padding */
.px-20 {
    padding-left: 20px !important;
    padding-right: 20px !important;
}

.py-40 {
    padding-top: 40px !important;
    padding-bottom: 40px !important;
}

/* ===== PRINT STYLES ===== */

@media print {
    .entry-content>table {
        display: table !important;
        grid-template-columns: none !important;
    }

    .entry-content table tbody,
    .entry-content table tr,
    .entry-content table td {
        display: table-row !important;
    }

    .entry-content table td {
        border: 1px solid #000 !important;
        padding: 8px !important;
    }
}