/**
 * Article Content Styles
 * Stili per il contenuto degli articoli (post/pages)
 *
 * @package TeenSerie
 */

/* ===== Container principale del contenuto ===== */
.entry-content,
.post-content,
article .content {
    line-height: 1.8;
    color: #334155;
}

.dark .entry-content,
.dark .post-content,
.dark article .content {
    color: #cbd5e1;
}

/* ===== Headings (H2, H3, H4) ===== */
.entry-content h2,
.post-content h2,
article .content h2 {
    font-size: 1.875rem;
    font-weight: 800;
    color: #0f172a;
    margin-top: 3rem;
    margin-bottom: 1.25rem;
    padding-left: 1rem;
    border-left: 4px solid #EC4899;
    line-height: 1.3;
}

.dark .entry-content h2,
.dark .post-content h2,
.dark article .content h2 {
    color: #f1f5f9;
    border-left-color: #A3E635;
}

/* Fix per h2 centrato - rimuove bordo sinistro e padding */
.entry-content h2[style*="text-align: center"],
.entry-content h2[style*="text-align:center"],
.entry-content h2.has-text-align-center,
.post-content h2[style*="text-align: center"],
.post-content h2[style*="text-align:center"],
.post-content h2.has-text-align-center,
article .content h2[style*="text-align: center"],
article .content h2[style*="text-align:center"],
article .content h2.has-text-align-center {
    border-left: none;
    padding-left: 0;
}

/* Fix per h2 allineato a destra - bordo a destra invece che a sinistra */
.entry-content h2[style*="text-align: right"],
.entry-content h2[style*="text-align:right"],
.entry-content h2.has-text-align-right,
.post-content h2[style*="text-align: right"],
.post-content h2[style*="text-align:right"],
.post-content h2.has-text-align-right,
article .content h2[style*="text-align: right"],
article .content h2[style*="text-align:right"],
article .content h2.has-text-align-right {
    border-left: none;
    border-right: 4px solid #EC4899;
    padding-left: 0;
    padding-right: 1rem;
}

.dark .entry-content h2[style*="text-align: right"],
.dark .entry-content h2[style*="text-align:right"],
.dark .entry-content h2.has-text-align-right,
.dark .post-content h2[style*="text-align: right"],
.dark .post-content h2[style*="text-align:right"],
.dark .post-content h2.has-text-align-right,
.dark article .content h2[style*="text-align: right"],
.dark article .content h2[style*="text-align:right"],
.dark article .content h2.has-text-align-right {
    border-right-color: #A3E635;
}

.entry-content h3,
.post-content h3,
article .content h3 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1e293b;
    margin-top: 2.5rem;
    margin-bottom: 1rem;
    position: relative;
    padding-bottom: 0.5rem;
}

.entry-content h3::after,
.post-content h3::after,
article .content h3::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 3rem;
    height: 3px;
    background: linear-gradient(to right, #8B5CF6, #EC4899);
    border-radius: 2px;
}

/* Fix per h3 centrato - la striscia si centra anch'essa */
.entry-content h3[style*="text-align: center"]::after,
.entry-content h3[style*="text-align:center"]::after,
.entry-content h3.has-text-align-center::after,
.post-content h3[style*="text-align: center"]::after,
.post-content h3[style*="text-align:center"]::after,
.post-content h3.has-text-align-center::after,
article .content h3[style*="text-align: center"]::after,
article .content h3[style*="text-align:center"]::after,
article .content h3.has-text-align-center::after {
    left: 50%;
    transform: translateX(-50%);
}

/* Fix per h3 allineato a destra - la striscia va a destra */
.entry-content h3[style*="text-align: right"]::after,
.entry-content h3[style*="text-align:right"]::after,
.entry-content h3.has-text-align-right::after,
.post-content h3[style*="text-align: right"]::after,
.post-content h3[style*="text-align:right"]::after,
.post-content h3.has-text-align-right::after,
article .content h3[style*="text-align: right"]::after,
article .content h3[style*="text-align:right"]::after,
article .content h3.has-text-align-right::after {
    left: auto;
    right: 0;
}

.dark .entry-content h3,
.dark .post-content h3,
.dark article .content h3 {
    color: #e2e8f0;
}

.entry-content h4,
.post-content h4,
article .content h4 {
    font-size: 1.25rem;
    font-weight: 600;
    color: #334155;
    margin-top: 2rem;
    margin-bottom: 0.75rem;
}

.dark .entry-content h4,
.dark .post-content h4,
.dark article .content h4 {
    color: #cbd5e1;
}

/* ===== Paragrafi ===== */
.entry-content p,
.post-content p,
article .content p {
    margin-bottom: 1.5rem;
    font-size: 1.0625rem;
}

/* ===== Links ===== */
.entry-content a,
.post-content a,
article .content a {
    color: #F59E0B;
    text-decoration: underline;
    text-decoration-color: rgba(245, 158, 11, 0.3);
    text-underline-offset: 3px;
    transition: all 0.2s;
    font-weight: 500;
}

.entry-content a:hover,
.post-content a:hover,
article .content a:hover {
    color: #A3E635;
    text-decoration-color: rgba(163, 230, 53, 0.5);
}

.dark .entry-content a,
.dark .post-content a,
.dark article .content a {
    color: #A3E635;
    text-decoration-color: rgba(163, 230, 53, 0.3);
}

.dark .entry-content a:hover,
.dark .post-content a:hover,
.dark article .content a:hover {
    color: #14B8A6;
    text-decoration-color: rgba(20, 184, 166, 0.5);
}

/* ===== Liste Non Ordinate ===== */
.entry-content ul,
.post-content ul,
article .content ul {
    margin-bottom: 1.5rem;
    padding-left: 0;
    list-style: none;
}

.entry-content ul li,
.post-content ul li,
article .content ul li {
    position: relative;
    padding-left: 2rem;
    margin-bottom: 0.75rem;
    line-height: 1.7;
}

.entry-content ul li::before,
.post-content ul li::before,
article .content ul li::before {
    content: '';
    position: absolute;
    left: 0.5rem;
    top: 0.7rem;
    width: 0.5rem;
    height: 0.5rem;
    background: linear-gradient(135deg, #F59E0B, #A3E635);
    border-radius: 50%;
}

.dark .entry-content ul li::before,
.dark .post-content ul li::before,
.dark article .content ul li::before {
    background: linear-gradient(135deg, #A3E635, #F59E0B);
}

/* ===== Liste Ordinate ===== */
.entry-content ol,
.post-content ol,
article .content ol {
    margin-bottom: 1.5rem;
    padding-left: 0;
    counter-reset: custom-counter;
    list-style: none;
}

.entry-content ol li,
.post-content ol li,
article .content ol li {
    position: relative;
    padding-left: 2.5rem;
    margin-bottom: 0.75rem;
    line-height: 1.7;
    counter-increment: custom-counter;
}

.entry-content ol li::before,
.post-content ol li::before,
article .content ol li::before {
    content: counter(custom-counter);
    position: absolute;
    left: 0;
    top: 0;
    width: 1.75rem;
    height: 1.75rem;
    background: #A3E635;
    color: #0f172a;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.875rem;
}

.dark .entry-content ol li::before,
.dark .post-content ol li::before,
.dark article .content ol li::before {
    background: #A3E635;
    color: #0f172a;
}

/* ===== Liste Annidate ===== */
/* UL dentro OL - usa bullet invece di numeri */
.entry-content ol ul,
.post-content ol ul,
article .content ol ul {
    margin-top: 0.75rem;
    margin-bottom: 0.75rem;
    counter-reset: none;
}

.entry-content ol ul li,
.post-content ol ul li,
article .content ol ul li {
    counter-increment: none;
    padding-left: 2rem;
}

.entry-content ol ul li::before,
.post-content ol ul li::before,
article .content ol ul li::before {
    content: '';
    left: 0.5rem;
    top: 0.7rem;
    width: 0.5rem;
    height: 0.5rem;
    background: linear-gradient(135deg, #F59E0B, #A3E635);
    border-radius: 50%;
    display: block;
}

.dark .entry-content ol ul li::before,
.dark .post-content ol ul li::before,
.dark article .content ol ul li::before {
    background: linear-gradient(135deg, #A3E635, #F59E0B);
}

/* OL dentro UL - reset counter per lista ordinata annidata */
.entry-content ul ol,
.post-content ul ol,
article .content ul ol {
    margin-top: 0.75rem;
    margin-bottom: 0.75rem;
    counter-reset: custom-counter;
}

/* ===== Blockquote ===== */
.entry-content blockquote,
.post-content blockquote,
article .content blockquote {
    position: relative;
    margin: 2rem 0;
    padding: 1.5rem 2rem 1.5rem 4rem;
    background: linear-gradient(135deg, rgba(236, 72, 153, 0.05), rgba(139, 92, 246, 0.05));
    border-left: 4px solid #EC4899;
    border-radius: 0.75rem;
    font-style: italic;
}

.entry-content blockquote::before,
.post-content blockquote::before,
article .content blockquote::before {
    content: '\201C';
    position: absolute;
    left: 1rem;
    top: 1rem;
    font-size: 3rem;
    font-weight: 900;
    color: #EC4899;
    opacity: 0.3;
    line-height: 1;
}

.dark .entry-content blockquote,
.dark .post-content blockquote,
.dark article .content blockquote {
    background: linear-gradient(135deg, rgba(163, 230, 53, 0.08), rgba(20, 184, 166, 0.08));
    border-left-color: #A3E635;
}

.dark .entry-content blockquote::before,
.dark .post-content blockquote::before,
.dark article .content blockquote::before {
    color: #A3E635;
}

.entry-content blockquote p,
.post-content blockquote p,
article .content blockquote p {
    margin-bottom: 0;
    color: #475569;
    font-size: 1.125rem;
}

.dark .entry-content blockquote p,
.dark .post-content blockquote p,
.dark article .content blockquote p {
    color: #94a3b8;
}

/* ===== Tabelle ===== */
.entry-content table,
.post-content table,
article .content table {
    width: 100%;
    margin: 2rem 0;
    border-collapse: separate;
    border-spacing: 0;
    border-radius: 0.75rem;
    overflow: hidden;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    border: 1px solid #e2e8f0;
}

.dark .entry-content table,
.dark .post-content table,
.dark article .content table {
    border-color: #334155;
}

.entry-content table thead,
.post-content table thead,
article .content table thead {
    background: linear-gradient(135deg, #EC4899, #8B5CF6);
}

.dark .entry-content table thead,
.dark .post-content table thead,
.dark article .content table thead {
    background: linear-gradient(135deg, #A3E635, #14B8A6);
}

.entry-content table th,
.post-content table th,
article .content table th {
    padding: 1rem;
    text-align: left;
    font-weight: 700;
    color: #ffffff;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border: none;
}

.dark .entry-content table th,
.dark .post-content table th,
.dark article .content table th {
    color: #0f172a;
}

.entry-content table td,
.post-content table td,
article .content table td {
    padding: 1rem;
    border-bottom: 1px solid #e2e8f0;
    border-right: 1px solid #e2e8f0;
}

.entry-content table td:last-child,
.post-content table td:last-child,
article .content table td:last-child {
    border-right: none;
}

.entry-content table tbody tr:last-child td,
.post-content table tbody tr:last-child td,
article .content table tbody tr:last-child td {
    border-bottom: none;
}

.dark .entry-content table td,
.dark .post-content table td,
.dark article .content table td {
    border-bottom-color: #334155;
    border-right-color: #334155;
}

.entry-content table tbody tr,
.post-content table tbody tr,
article .content table tbody tr {
    background-color: #ffffff;
    transition: background-color 0.2s;
}

.dark .entry-content table tbody tr,
.dark .post-content table tbody tr,
.dark article .content table tbody tr {
    background-color: #1e293b;
}

.entry-content table tbody tr:nth-child(even),
.post-content table tbody tr:nth-child(even),
article .content table tbody tr:nth-child(even) {
    background-color: #f8fafc;
}

.dark .entry-content table tbody tr:nth-child(even),
.dark .post-content table tbody tr:nth-child(even),
.dark article .content table tbody tr:nth-child(even) {
    background-color: #0f172a;
}

.entry-content table tbody tr:hover,
.post-content table tbody tr:hover,
article .content table tbody tr:hover {
    background-color: rgba(236, 72, 153, 0.05);
}

.dark .entry-content table tbody tr:hover,
.dark .post-content table tbody tr:hover,
.dark article .content table tbody tr:hover {
    background-color: rgba(163, 230, 53, 0.05);
}

/* ===== Immagini e Figure ===== */
.entry-content figure,
.post-content figure,
article .content figure,
.entry-content .wp-block-image,
.post-content .wp-block-image,
article .content .wp-block-image {
    margin: 2rem 0;
    border-radius: 1rem;
    overflow: hidden;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

.entry-content figure img,
.post-content figure img,
article .content figure img,
.entry-content .wp-block-image img,
.post-content .wp-block-image img,
article .content .wp-block-image img {
    width: 100%;
    height: auto;
    display: block;
}

.entry-content figcaption,
.post-content figcaption,
article .content figcaption {
    padding: 1rem;
    background-color: #f1f5f9;
    color: #475569;
    font-size: 0.875rem;
    text-align: center;
    font-style: italic;
}

.dark .entry-content figcaption,
.dark .post-content figcaption,
.dark article .content figcaption {
    background-color: #1e293b;
    color: #94a3b8;
}

/* ===== Code ===== */
.entry-content code,
.post-content code,
article .content code {
    background-color: #f1f5f9;
    color: #EC4899;
    padding: 0.25rem 0.5rem;
    border-radius: 0.375rem;
    font-size: 0.875em;
    font-family: 'Courier New', monospace;
    font-weight: 600;
}

.dark .entry-content code,
.dark .post-content code,
.dark article .content code {
    background-color: #1e293b;
    color: #A3E635;
}

.entry-content pre,
.post-content pre,
article .content pre {
    margin: 2rem 0;
    padding: 1.5rem;
    background-color: #0f172a;
    border-radius: 0.75rem;
    overflow-x: auto;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.2);
    border: 1px solid #334155;
}

.entry-content pre code,
.post-content pre code,
article .content pre code {
    background: none;
    color: #A3E635;
    padding: 0;
    font-size: 0.875rem;
    font-weight: 400;
}

/* ===== Altri elementi di formattazione ===== */
.entry-content strong,
.post-content strong,
article .content strong {
    font-weight: 700;
    color: #0f172a;
}

.dark .entry-content strong,
.dark .post-content strong,
.dark article .content strong {
    color: #f1f5f9;
}

.entry-content em,
.post-content em,
article .content em {
    font-style: italic;
}

.entry-content mark,
.post-content mark,
article .content mark {
    background-color: rgba(163, 230, 53, 0.3);
    color: #0f172a;
    padding: 0.125rem 0.375rem;
    border-radius: 0.25rem;
}

.dark .entry-content mark,
.dark .post-content mark,
.dark article .content mark {
    background-color: rgba(163, 230, 53, 0.2);
    color: #f1f5f9;
}

.entry-content del,
.post-content del,
article .content del {
    text-decoration: line-through;
    opacity: 0.7;
}

.entry-content ins,
.post-content ins,
article .content ins {
    text-decoration: underline;
    text-decoration-color: #14B8A6;
    text-decoration-thickness: 2px;
    text-underline-offset: 3px;
}

.entry-content small,
.post-content small,
article .content small {
    font-size: 0.875em;
    opacity: 0.8;
}

.entry-content abbr,
.post-content abbr,
article .content abbr {
    text-decoration: underline dotted;
    text-decoration-color: #8B5CF6;
    cursor: help;
}

/* ===== Separatore orizzontale ===== */
.entry-content hr,
.post-content hr,
article .content hr {
    margin: 3rem 0;
    border: none;
    height: 3px;
    background: linear-gradient(to right, transparent, #EC4899, #8B5CF6, transparent);
    border-radius: 2px;
}

.dark .entry-content hr,
.dark .post-content hr,
.dark article .content hr {
    background: linear-gradient(to right, transparent, #A3E635, #14B8A6, transparent);
}

/* ===== WordPress Embed Blocks (YouTube, Vimeo, etc.) ===== */
.entry-content iframe,
.post-content iframe,
article .content iframe,
.entry-content .wp-block-embed iframe,
.post-content .wp-block-embed iframe,
article .content .wp-block-embed iframe {
    max-width: 100%;
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
}

.entry-content .wp-block-embed,
.post-content .wp-block-embed,
article .content .wp-block-embed,
.entry-content .wp-embed-responsive,
.post-content .wp-embed-responsive,
article .content .wp-embed-responsive {
    max-width: 100%;
    margin: 2rem 0;
}

/* ===== WordPress Gallery Block ===== */
.entry-content .wp-block-gallery,
.post-content .wp-block-gallery,
article .content .wp-block-gallery {
    max-width: 100%;
    margin: 2rem 0;
}

.entry-content .wp-block-gallery .wp-block-image,
.post-content .wp-block-gallery .wp-block-image,
article .content .wp-block-gallery .wp-block-image {
    max-width: 100%;
}

.entry-content .wp-block-gallery img,
.post-content .wp-block-gallery img,
article .content .wp-block-gallery img {
    max-width: 100%;
    height: auto;
}

/* ===== WordPress Caption ===== */
.entry-content .wp-caption,
.post-content .wp-caption,
article .content .wp-caption {
    max-width: 100% !important;
    height: auto !important;
}

.entry-content .wp-caption img,
.post-content .wp-caption img,
article .content .wp-caption img {
    max-width: 100%;
    height: auto;
}

.entry-content .wp-caption-text,
.post-content .wp-caption-text,
article .content .wp-caption-text {
    padding: 0.75rem;
    background-color: #f1f5f9;
    color: #475569;
    font-size: 0.875rem;
    text-align: center;
    font-style: italic;
}

.dark .entry-content .wp-caption-text,
.dark .post-content .wp-caption-text,
.dark article .content .wp-caption-text {
    background-color: #1e293b;
    color: #94a3b8;
}

/* ===== WordPress Video Block ===== */
.entry-content .wp-block-video,
.post-content .wp-block-video,
article .content .wp-block-video {
    max-width: 100%;
    margin: 2rem 0;
}

.entry-content .wp-block-video video,
.post-content .wp-block-video video,
article .content .wp-block-video video {
    max-width: 100%;
    height: auto;
}

/* ===== Generic Media Elements ===== */
.entry-content img,
.post-content img,
article .content img {
    max-width: 100%;
    height: auto;
}

.entry-content video,
.post-content video,
article .content video {
    max-width: 100%;
    height: auto;
}

/* ===== Prevent horizontal overflow ===== */
.entry-content,
.post-content,
article .content {
    overflow-wrap: break-word;
    word-wrap: break-word;
    word-break: break-word;
}

/* ===== Fix per bottoni e elementi centrati ===== */
.entry-content p,
.post-content p,
article .content p {
    max-width: 100%;
}

/* Shortcode buttons (Shortcodes Ultimate, ecc.) */
.entry-content .su-button,
.post-content .su-button,
article .content .su-button,
.entry-content a[class*="button"],
.post-content a[class*="button"],
article .content a[class*="button"] {
    max-width: 100% !important;
    width: auto !important;
    display: inline-block !important;
    box-sizing: border-box !important;
    word-wrap: break-word !important;
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
    .entry-content h2,
    .post-content h2,
    article .content h2 {
        font-size: 1.5rem;
        margin-top: 2rem;
    }

    .entry-content h3,
    .post-content h3,
    article .content h3 {
        font-size: 1.25rem;
    }

    .entry-content blockquote,
    .post-content blockquote,
    article .content blockquote {
        padding: 1rem 1.5rem 1rem 3rem;
    }

    .entry-content table,
    .post-content table,
    article .content table {
        font-size: 0.875rem;
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .entry-content table th,
    .post-content table th,
    article .content table th,
    .entry-content table td,
    .post-content table td,
    article .content table td {
        padding: 0.75rem;
    }
}

