/* ================================================================
   ARTICLE PAGE - Full Layout & Content Styling (LIGHT THEME)
   ================================================================ */

/* ---- Layout: light background, no horizontal scroll ---- */
.article-detail-section {
    background: #f8f9fa;
    color: #212529;
    padding: 30px 0 60px;
    min-height: 100vh;
    overflow-x: hidden;
}

.article-detail-section .container {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

/* ---- Header (title + meta) ---- */
.article-header {
    width: 75%;
    text-align: right;
    margin-bottom: 30px;
    margin-top: 10px;
    order: 1;
}

.article-title {
    font-size: 1.8rem;
    font-weight: 900;
    color: #1a1a2e;
    line-height: 1.3;
    margin: 0 0 10px;
    letter-spacing: -0.5px;
}

.article-meta {
    display: flex;
    gap: 20px;
    color: #6c757d;
    font-size: 0.95rem;
}

/* ---- Cover image ---- */
.article-cover {
    width: 75%;
    overflow: hidden;
    border-radius: 16px;
    background: transparent;
    margin-bottom: 40px;
    order: 2;
}

.article-cover img {
    width: 80%;
    height: auto;
    display: block;
    margin: 0 auto;
    border-radius: 16px;
}

/* ---- Content box ---- */
.article-content-box {
    width: 75%;
    order: 3;
}

/* ================================================================
   CONTENT STYLES (Light theme applied)
   ================================================================ */

.article-content {
    font-size: 1rem;
    line-height: 1.9;
    color: #212529;
    max-width: 100%;
    direction: rtl;
    text-align: right;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* ----- Headings with thin separator line ABOVE the text ----- */
.article-heading-2,
.article-content h2 {
    font-size: 1.6rem;
    font-weight: 700;
    color: #1a1a2e;
    margin-top: 72px;
    margin-bottom: 16px;
    padding-right: 18px;
    border-right: 5px solid #ff6b6b;
    line-height: 1.3;
    display: inline-block;
    border-top: 1px solid rgba(0, 0, 0, 0.08);
    padding-top: 10px;
    box-shadow: 0 -2px 4px -2px rgba(255, 107, 107, 0.1);
}

.article-heading-3,
.article-content h3 {
    font-size: 1.3rem;
    font-weight: 600;
    color: #1a1a2e;
    margin-top: 63px;
    margin-bottom: 12px;
    padding-right: 14px;
    border-right: 4px solid #feca57;
    line-height: 1.3;
    display: inline-block;
    border-top: 1px solid rgba(0, 0, 0, 0.07);
    padding-top: 8px;
    box-shadow: 0 -2px 4px -2px rgba(254, 202, 87, 0.08);
}

.article-heading-4,
.article-content h4 {
    font-size: 1.15rem;
    font-weight: 600;
    color: #212529;
    margin-top: 52px;
    margin-bottom: 10px;
    line-height: 1.4;
    display: inline-block;
    border-top: 1px solid rgba(0, 0, 0, 0.06);
    padding-top: 8px;
}

.article-heading-5,
.article-content h5 {
    font-size: 1rem;
    font-weight: 600;
    color: #495057;
    margin-top: 46px;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: inline-block;
    border-top: 1px solid rgba(0, 0, 0, 0.06);
    padding-top: 6px;
}

/* ----- Paragraphs ----- */
.article-paragraph {
    margin: 0 0 22px;
    color: #212529;
}
.article-paragraph:last-child {
    margin-bottom: 0;
}
.article-paragraph-spaced {
    margin: 0 0 32px;
}
.article-paragraph-small {
    font-size: 0.9rem;
    color: #6c757d;
    margin: 6px 0 16px;
}

/* ----- Images (inside content) ----- */
.article-image {
    width: 80%;
    height: auto;
    border-radius: 16px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    border: 1px solid #dee2e6;
    display: block;
    margin: 24px auto;
}

.article-image-left {
    float: left;
    margin: 8px 20px 16px 0;
    width: 45%;
    max-width: 45%;
    border-radius: 16px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    border: 1px solid #dee2e6;
}

.article-image-right {
    float: right;
    margin: 8px 0 16px 20px;
    width: 45%;
    max-width: 45%;
    border-radius: 16px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    border: 1px solid #dee2e6;
}

.article-image-bordered {
    border: 3px solid #ff6b6b;
    border-radius: 16px;
    padding: 4px;
}

.article-figure {
    margin: 30px 0;
    text-align: center;
}
.article-figure .article-image {
    margin: 0 auto 8px;
}
.article-figcaption {
    font-size: 0.9rem;
    color: #6c757d;
    font-style: italic;
    padding: 0 10px;
}

/* ----- Tables ----- */
.article-table-wrapper {
    overflow-x: auto;
    margin: 30px auto;
    border-radius: 16px;
    border: 1px solid #dee2e6;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.05);
}

/* Desktop: table with auto width, centered */
@media (min-width: 769px) {
    .article-table-wrapper {
        display: table;
        width: auto;
        max-width: 100%;
        margin: 30px auto;
    }

    .article-table {
        width: auto;
        min-width: 0;
        table-layout: auto;
    }

    .article-table th,
    .article-table td {
        white-space: normal;
        word-break: break-word;
    }
}

/* Mobile: table full width with horizontal scroll */
@media (max-width: 768px) {
    .article-table-wrapper {
        display: block;
        width: 100%;
        margin: 30px 0;
    }

    .article-table {
        width: 100%;
        table-layout: auto;
    }

    .article-table th,
    .article-table td {
        white-space: nowrap;
    }
}

.article-table {
    border-collapse: collapse;
    font-size: 0.95rem;
    text-align: right;
    background: #ffffff;
    color: #212529;
    direction: rtl;
}

.article-table thead {
    background: #e9ecef;
    color: #1a1a2e;
}
.article-table th {
    padding: 14px 18px;
    font-weight: 600;
    border-bottom: 2px solid #ced4da;
}
.article-table td {
    padding: 12px 18px;
    border-bottom: 1px solid #dee2e6;
}
.article-table tbody tr:last-child td {
    border-bottom: none;
}
.article-table tbody tr:hover {
    background: #f1f3f5;
}

.article-table-striped tbody tr:nth-child(even) {
    background: #f8f9fa;
}
.article-table-bordered th,
.article-table-bordered td {
    border: 1px solid #dee2e6;
}
.article-table-sm th,
.article-table-sm td {
    padding: 8px 12px;
    font-size: 0.85rem;
}

/* ----- Lists ----- */
.article-list {
    margin: 16px 0 22px 0;
    padding-right: 24px;
    list-style-type: none;
}
.article-list li {
    position: relative;
    padding-right: 28px;
    margin-bottom: 8px;
    line-height: 1.8;
}
.article-list li::before {
    content: '▸';
    position: absolute;
    right: 0;
    top: 0;
    color: #ff6b6b;
    font-size: 1.2rem;
    font-weight: bold;
}

.article-list-ordered {
    margin: 16px 0 22px 0;
    padding-right: 24px;
    list-style-type: none;
    counter-reset: item;
}
.article-list-ordered li {
    position: relative;
    padding-right: 32px;
    margin-bottom: 8px;
    line-height: 1.8;
    counter-increment: item;
}
.article-list-ordered li::before {
    content: counter(item) ".";
    position: absolute;
    right: 0;
    top: 0;
    color: #ff6b6b;
    font-weight: 700;
    font-size: 0.95rem;
    min-width: 22px;
}

.article-list ul,
.article-list-ordered ul,
.article-list ol,
.article-list-ordered ol {
    margin: 6px 20px 6px 0;
    padding-right: 20px;
}

/* ----- Blockquotes ----- */
.article-blockquote {
    margin: 30px 0;
    padding: 20px 28px 20px 20px;
    background: #f1f3f5;
    border-right: 5px solid #ff6b6b;
    border-radius: 16px 0 0 16px;
    color: #212529;
    font-size: 1.05rem;
    font-style: italic;
    line-height: 1.9;
    position: relative;
}
.article-blockquote::before {
    content: '"';
    font-size: 4rem;
    color: #ff6b6b;
    opacity: 0.2;
    position: absolute;
    top: -4px;
    right: 12px;
    font-family: Georgia, serif;
}
.article-blockquote cite {
    display: block;
    margin-top: 10px;
    font-style: normal;
    font-weight: 600;
    color: #1a1a2e;
    font-size: 0.95rem;
}

.article-blockquote-blue {
    border-right-color: #48dbfb;
}
.article-blockquote-blue::before {
    color: #48dbfb;
}
.article-blockquote-gold {
    border-right-color: #feca57;
}
.article-blockquote-gold::before {
    color: #feca57;
}

/* ================================================================
   CODE STYLES - Modern & sleek (Light)
   ================================================================ */

.article-code-block {
    margin: 24px 0 28px;
    padding: 20px 24px;
    background: linear-gradient(145deg, #f8f9fa, #e9ecef);
    color: #212529;
    border-radius: 20px;
    overflow-x: auto;
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.8rem;
    line-height: 1.7;
    direction: ltr;
    text-align: left;
    white-space: pre-wrap;
    word-break: break-word;
    border: 1px solid #dee2e6;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.05), inset 0 1px 0 rgba(255, 255, 255, 0.8);
    transition: all 0.3s ease;
    position: relative;
}
.article-code-block:hover {
    border-color: #ff6b6b;
    box-shadow: 0 8px 40px rgba(255, 107, 107, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.9);
}
.article-code-block code {
    font-family: inherit;
    background: transparent;
    color: #212529;
    padding: 0;
}

.article-code-inline {
    font-family: 'Courier New', Courier, monospace;
    background: #e9ecef;
    color: #c0392b;
    padding: 2px 10px;
    border-radius: 10px;
    font-size: 0.8rem;
    border: 1px solid #dee2e6;
    direction: ltr;
    box-shadow: inset 0 1px 4px rgba(0, 0, 0, 0.05);
    transition: all 0.2s;
}
.article-code-inline:hover {
    background: #dee2e6;
    border-color: #ff6b6b;
    color: #c0392b;
}

/* ----- Highlights & inline text ----- */
.article-highlight {
    background: linear-gradient(120deg, rgba(255, 107, 107, 0.15) 0%, rgba(255, 107, 107, 0.03) 100%);
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 500;
}
.article-strong {
    color: #1a1a2e;
    font-weight: 700;
}
.article-em {
    font-style: italic;
    color: #495057;
}
.article-underline {
    text-decoration: underline;
    text-underline-offset: 3px;
    text-decoration-color: #ff6b6b;
    text-decoration-thickness: 2px;
}

/* ----- Links (red) ----- */
.article-link {
    color: #ff6b6b;
    text-decoration: underline;
    text-underline-offset: 3px;
    text-decoration-thickness: 2px;
    text-decoration-color: rgba(255, 107, 107, 0.3);
    transition: all 0.3s ease;
    font-weight: 500;
}
.article-link:hover {
    color: #ee5a24;
    text-decoration-color: #ee5a24;
}
.article-link-external::after {
    content: ' ↗';
    font-size: 0.8em;
    display: inline-block;
    transition: transform 0.3s;
}
.article-link-external:hover::after {
    transform: translate(2px, -2px);
}

/* ----- Buttons inside article ----- */
.article-btn {
    display: inline-block;
    padding: 10px 28px;
    border-radius: 40px;
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 600;
    color: #ffffff;
    background: linear-gradient(135deg, #ff6b6b, #ee5a24);
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    box-shadow: 0 4px 15px rgba(255, 107, 107, 0.2);
}
.article-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 30px rgba(255, 107, 107, 0.3);
}
.article-btn-outline {
    background: transparent;
    color: #1a1a2e;
    border: 2px solid #ced4da;
    box-shadow: none;
}
.article-btn-outline:hover {
    border-color: #ff6b6b;
    color: #ff6b6b;
    background: rgba(255, 107, 107, 0.05);
}

/* ----- Numbered sections ----- */
.article-content .numbered-section {
    counter-reset: section;
}
.article-content .numbered-section .article-heading-2 {
    counter-increment: section;
}
.article-content .numbered-section .article-heading-2::before {
    content: counter(section) ". ";
    color: #ff6b6b;
    font-weight: 700;
}

/* ----- Tip / Warning / Success boxes (Light) ----- */
.article-tip-box {
    margin: 30px 0;
    padding: 20px 28px;
    border-radius: 16px;
    border-right: 5px solid #48dbfb;
    background: #eef8fc;
    color: #1a2b38;
}
.article-tip-box-title {
    font-weight: 700;
    font-size: 1.05rem;
    color: #0c7b93;
    margin: 0 0 6px;
}
.article-tip-box p {
    margin: 0;
}

.article-warning-box {
    border-right-color: #ff6b6b;
    background: #fde8e8;
    color: #4a1a1a;
}
.article-warning-box .article-tip-box-title {
    color: #b33c3c;
}

.article-success-box {
    border-right-color: #2ecc71;
    background: #e6f7ed;
    color: #0f2b1a;
}
.article-success-box .article-tip-box-title {
    color: #1a7a3a;
}

/* ----- Dividers ----- */
.article-divider {
    margin: 40px 0;
    border: none;
    height: 2px;
    background: linear-gradient(90deg, transparent, #ced4da, #adb5bd, #ced4da, transparent);
    border-radius: 4px;
}
.article-divider-dotted {
    height: 0;
    border-top: 2px dotted #ced4da;
    background: none;
}

/* ----- Meta info ----- */
.article-meta-info {
    display: flex;
    flex-wrap: wrap;
    gap: 20px 30px;
    margin: 0 0 30px;
    padding: 16px 0;
    border-top: 1px solid #dee2e6;
    border-bottom: 1px solid #dee2e6;
    font-size: 0.9rem;
    color: #6c757d;
}
.article-meta-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.article-meta-item-icon {
    font-size: 1.1rem;
}
.article-meta-item a {
    color: #ff6b6b;
    text-decoration: none;
    transition: color 0.3s;
}
.article-meta-item a:hover {
    color: #ee5a24;
    text-decoration: underline;
}

.article-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 20px 0 0;
}
.article-tag {
    display: inline-block;
    padding: 4px 14px;
    background: #e9ecef;
    color: #495057;
    border-radius: 20px;
    font-size: 0.8rem;
    border: 1px solid #dee2e6;
    transition: all 0.3s ease;
    text-decoration: none;
}
.article-tag:hover {
    background: #ff6b6b;
    color: #ffffff;
    border-color: #ff6b6b;
}

/* ================================================================
   RESPONSIVE ADJUSTMENTS
   ================================================================ */

@media (max-width: 992px) {
    .article-title {
        font-size: 1.6rem;
    }
    .article-heading-2,
    .article-content h2 {
        font-size: 1.5rem;
    }
    .article-heading-3,
    .article-content h3 {
        font-size: 1.2rem;
    }
    .article-image-left,
    .article-image-right {
        float: none;
        width: 80%;
        max-width: 80%;
        margin: 16px auto;
    }
    .article-cover img {
        width: 80%;
    }
}

@media (max-width: 768px) {
    .article-detail-section .container {
        align-items: stretch;
        padding: 0 10px;
    }

    .article-header {
        width: 100%;
        order: 2;
        margin-top: 10px;
    }
    .article-cover {
        width: 100%;
        max-height: 300px;
        order: 1;
        margin-bottom: 20px;
    }
    .article-cover img {
        width: 80%;
        max-height: 300px;
    }
    .article-content-box {
        width: 100%;
        order: 3;
    }

    .article-title {
        font-size: 1.5rem;
    }
    .article-heading-2,
    .article-content h2 {
        font-size: 1.3rem;
        padding-right: 12px;
        border-right-width: 4px;
        margin-top: 60px;
    }
    .article-heading-3,
    .article-content h3 {
        font-size: 1.1rem;
        padding-right: 10px;
        border-right-width: 3px;
        margin-top: 52px;
    }
    .article-heading-4,
    .article-content h4 {
        margin-top: 44px;
    }
    .article-heading-5,
    .article-content h5 {
        margin-top: 38px;
    }
    .article-content {
        font-size: 0.95rem;
        line-height: 1.8;
    }
    .article-blockquote {
        padding: 16px 20px 16px 16px;
        font-size: 0.95rem;
    }
    .article-code-block {
        padding: 14px 16px;
        font-size: 0.75rem;
    }
    .article-code-inline {
        font-size: 0.75rem;
    }
    .article-table th,
    .article-table td {
        padding: 10px 12px;
        font-size: 0.85rem;
    }
    .article-meta-info {
        gap: 12px 20px;
        font-size: 0.85rem;
        padding: 12px 0;
    }
    .article-cover {
        max-height: 300px;
    }
    .article-image {
        width: 80%;
    }
    .article-image-left,
    .article-image-right {
        float: none;
        width: 80%;
        max-width: 80%;
        margin: 16px auto;
    }
}

@media (max-width: 480px) {
    .article-title {
        font-size: 1.3rem;
    }
    .article-heading-2,
    .article-content h2 {
        font-size: 1.1rem;
        padding-right: 10px;
        margin-top: 50px;
    }
    .article-heading-3,
    .article-content h3 {
        font-size: 1rem;
        padding-right: 8px;
        margin-top: 44px;
    }
    .article-heading-4,
    .article-content h4 {
        margin-top: 38px;
    }
    .article-heading-5,
    .article-content h5 {
        margin-top: 32px;
    }
    .article-content {
        font-size: 0.9rem;
    }
    .article-blockquote {
        padding: 12px 16px 12px 12px;
        font-size: 0.9rem;
    }
    .article-code-block {
        padding: 12px 14px;
        font-size: 0.7rem;
        border-radius: 12px;
    }
    .article-code-inline {
        font-size: 0.7rem;
    }
    .article-table th,
    .article-table td {
        padding: 8px 10px;
        font-size: 0.8rem;
    }
    .article-meta-info {
        flex-direction: column;
        gap: 6px;
        padding: 10px 0;
    }
    .article-tip-box {
        padding: 14px 18px;
    }
    .article-figure {
        margin: 20px 0;
    }
    .article-cover {
        max-height: 200px;
    }
    .article-cover img {
        max-height: 200px;
        width: 80%;
    }
    .article-image {
        width: 80%;
    }
    .article-image-left,
    .article-image-right {
        float: none;
        width: 80%;
        max-width: 80%;
        margin: 16px auto;
    }
}

/* ================================================================
   PREVENT HORIZONTAL SCROLL ON MOBILE
   ================================================================ */
.article-content img,
.article-content table,
.article-content pre,
.article-content iframe {
    max-width: 100% !important;
    height: auto !important;
}

.article-content table {
    display: block;
    overflow-x: auto;
    white-space: nowrap;
}