/* ═══ Saudi League — Custom Fixes v1.3 ═══ */

/* ══════════════════════════════════════════
   DIRECTION : RTL pour AR uniquement
   EN et FR = LTR (par defaut navigateur)
   ══════════════════════════════════════════ */

/* AR : RTL (html[dir="rtl"] est mis par Polylang) */
html[dir="rtl"] .elementor-widget-theme-post-content .elementor-widget-container,
html[dir="rtl"] .entry-content,
html[dir="rtl"] .post-content,
html[dir="rtl"] article {
    direction: rtl;
    text-align: right;
}

/* EN/FR : forcer LTR */
html:not([dir="rtl"]) body {
    direction: ltr;
}

html:not([dir="rtl"]) .elementor-widget-theme-post-content .elementor-widget-container,
html:not([dir="rtl"]) .entry-content,
html:not([dir="rtl"]) .post-content,
html:not([dir="rtl"]) article {
    direction: ltr;
    text-align: left;
}

html:not([dir="rtl"]) .elementor-nav-menu {
    direction: ltr;
    text-align: left;
}

/* ── Typographie ── */
html[dir="rtl"] .elementor-widget-theme-post-content .elementor-widget-container,
html[dir="rtl"] .entry-content,
html[dir="rtl"] .post-content {
    font-family: 'Cairo', 'Tajawal', 'Noto Sans Arabic', Arial, sans-serif;
    font-size: 18px;
    line-height: 1.8;
    color: #333;
}

html:not([dir="rtl"]) .elementor-widget-theme-post-content .elementor-widget-container,
html:not([dir="rtl"]) .entry-content,
html:not([dir="rtl"]) .post-content {
    font-family: 'Inter', 'Segoe UI', Arial, sans-serif;
    font-size: 17px;
    line-height: 1.7;
    color: #333;
}

/* ── Conteneur article ── */
.elementor-widget-theme-post-content .elementor-widget-container {
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
    padding: 0 20px;
}

/* ── Correction espaces entre paragraphes ── */
.elementor-widget-theme-post-content p {
    margin-bottom: 1em !important;
    margin-top: 0 !important;
}

/* ── Titres ── */
.elementor-widget-theme-post-content h2 {
    margin-top: 1.5em !important;
    margin-bottom: 0.75em !important;
    font-size: 1.75em;
    font-weight: 700;
    color: #1a5f2a;
    border-bottom: 2px solid #1a5f2a;
    padding-bottom: 10px;
}

.elementor-widget-theme-post-content h3,
.elementor-widget-theme-post-content h4 {
    margin-top: 1.5em !important;
    margin-bottom: 0.75em !important;
}

/* ── Supprimer espaces vides ── */
.elementor-widget-theme-post-content p:empty,
.elementor-widget-theme-post-content div:empty:not([class]),
.elementor-widget-theme-post-content br + br {
    display: none !important;
}

/* ── Reduire le block-gap WP ── */
.elementor-widget-theme-post-content .is-layout-flex {
    gap: 12px !important;
}

.elementor-widget-theme-post-content .is-layout-flow > * + * {
    margin-block-start: 0.5em !important;
}

/* ── wp-block-columns ── */
.elementor-widget-theme-post-content .wp-block-columns {
    gap: 16px !important;
    margin-top: 1.5em !important;
    margin-bottom: 1em !important;
    padding: 0 !important;
}

.elementor-widget-theme-post-content .wp-block-column {
    padding: 0 !important;
    margin: 0 !important;
}

.elementor-widget-theme-post-content .wp-block-column p {
    margin-bottom: 0.5em !important;
    font-size: 0.9em;
    line-height: 1.5;
}

/* ── Sections Elementor : reduire padding vertical ── */
.single-post .elementor-section {
    padding-top: 20px !important;
    padding-bottom: 20px !important;
}

.single-post .elementor-section .elementor-section {
    padding-top: 10px !important;
    padding-bottom: 10px !important;
}

/* ── Elementor column gaps ── */
.single-post .elementor-column-gap-default > .elementor-column > .elementor-element-populated {
    padding: 10px !important;
}

/* ── Images ── */
.elementor-widget-theme-post-content img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 1.5em auto;
    border-radius: 8px;
}

/* ── Widget spacing ── */
.single-post .elementor-widget:not(:last-child) {
    margin-bottom: 15px !important;
}

/* ── Elementor section inner ── */
.single-post .elementor-section > .elementor-container {
    max-width: 900px !important;
}

/* ── Post title/meta spacing ── */
.single-post .elementor-widget-theme-post-title {
    margin-bottom: 10px !important;
}

.single-post .elementor-widget-post-info,
.single-post .elementor-widget-theme-post-excerpt {
    margin-bottom: 10px !important;
}

/* ── Featured image ── */
.single-post .elementor-widget-theme-post-featured-image {
    margin-bottom: 20px !important;
}

.single-post .elementor-widget-theme-post-featured-image img {
    border-radius: 8px;
}

/* ═══ Articles connexes ═══ */
.related-posts-section {
    margin-top: 40px;
    padding-top: 30px;
    border-top: 2px solid #1a5f2a;
}

html[dir="rtl"] .related-title {
    text-align: right;
}

html:not([dir="rtl"]) .related-title {
    text-align: left;
}

.related-title {
    color: #1a5f2a;
    font-size: 1.5em;
    margin-bottom: 20px;
}

.related-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
}

.related-item {
    background: #f9f9f9;
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.2s;
}

.related-item:hover {
    transform: translateY(-3px);
}

.related-thumb img {
    width: 100%;
    height: 120px;
    object-fit: cover;
}

.related-item h4 {
    padding: 12px;
    margin: 0;
    font-size: 0.95em;
    line-height: 1.4;
}

.related-item h4 a {
    color: #333;
    text-decoration: none;
}

.related-item h4 a:hover {
    color: #1a5f2a;
}

.related-date {
    display: block;
    padding: 0 12px 12px;
    font-size: 0.8em;
    color: #888;
}

/* ═══ Pages clubs - tableaux stats ═══ */
.club-header {
    text-align: center;
    margin-bottom: 30px;
}

html:not([dir="rtl"]) .club-header,
html:not([dir="rtl"]) .club-header p {
    text-align: center;
    direction: ltr;
}
