/**
 * legacy-content.css
 *
 * Extracted from style.css for article content rendered from database HTML.
 * Used in app-v2.blade.php to style legacy content (tables, banners, headings)
 * without loading the full 8,692-line style.css.
 *
 * TEMPORARY: To be replaced when article content is migrated to new CSS system.
 * Created: 2026-04-06 (Sprint 2 Phase A)
 */

/* ══════════════════════════════════════════════
   ARTICLE CONTENT — Headings inside DB content
   ══════════════════════════════════════════════ */

.section-article-content h2 {
    font-size: 1.75rem;
    position: relative;
    padding: 10px 10px 15px;
    margin: 10px 0 15px;
    background: #edf6f0;
    border-inline-start: 5px solid #9fd3a8;
    border-radius: 14px;
}

.section-article-content h3 {
    font-size: 1.5rem;
    position: relative;
}

.section-article-content h3::after {
    content: "";
    position: absolute;
    inset-inline-start: 0;
    bottom: 20%;
    background-color: #48d660;
    border-radius: 2px;
    width: 80px;
    height: 3px;
}

.section-article-content h4 {
    font-size: 1.25rem;
    position: relative;
    padding-inline: 20px;
}

.section-article-content h4::before {
    content: "";
    position: absolute;
    inset-inline-start: 0;
    top: 10%;
    bottom: 10%;
    width: 4px;
    background-color: #ff8452;
    border-radius: 2px;
    height: 30px;
}

.section-article-content p,
.section-article-content div {
    color: var(--text);
    font-size: 1.125rem;
    margin-bottom: 0.5rem;
    line-height: 1.7;
    text-indent: 0;
    orphans: 3;
    widows: 3;
}

.section-article-content div {
    padding: 0 0 20px;
}

section.section-article-content p a,
.section-article-content a {
    color: var(--teal);
    text-decoration: underline;
}

.section-article-content .table-responsive a {
    color: var(--bg-card);
}

/* ══════════════════════════════════════════════
   TABLES — moved to design-system/components/article-content.css
   under the .article-table class. Helper::cleanHTMLCode now tags
   every CMS table with .article-table (was: .table-content +
   .table-vertical-heading, which fought the new rules via
   !important). See docs/daily-logs/2026-04-18.md table-rework
   section. The .table-responsive wrapper rule survives below —
   horizontal-scroll behaviour is orthogonal to table theming.
   ══════════════════════════════════════════════ */

.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* ══════════════════════════════════════════════
   BANNER CARDS — Affiliate broker banners in articles
   ══════════════════════════════════════════════ */

.banner-card {
    border: 0;
    border-radius: 16px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.15);
    overflow: hidden;
    margin-bottom: 20px;
    background: var(--bg-card);
}

.banner-card .card-header {
    border: 0;
    border-radius: 16px 16px 0 0;
    padding: 20px;
    background: none;
    text-align: center;
}

.banner-card .card-img {
    width: auto;
    height: 60px;
}

.banner-card .card-body {
    padding: 0 20px 20px;
    text-align: center;
}

.banner-card .card-title {
    font-size: 22px;
    line-height: 28px;
    padding: 0;
    margin-bottom: 10px;
    font-weight: 500;
}

.banner-card .card-text {
    font-size: 18px;
    line-height: 24px;
    padding: 0;
    margin-bottom: 10px;
}

.banner-card small {
    font-size: 12px;
    line-height: 14px;
    font-weight: 500;
}

.banner-card .star-rating {
    display: flex;
    align-items: center;
    margin-inline-end: 10px;
}

.banner-card .card-footer {
    padding: 0 20px 20px;
    background: none;
    border: 0;
}

.banner-card .card-footer .btn {
    font-size: 18px;
    line-height: 22px;
    font-weight: 500;
    min-height: 50px;
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    border-radius: 8px;
    color: var(--bg-card);
    background: var(--teal);
    border: none;
    text-decoration: none;
}

.banner-card .card-footer .btn:hover {
    background: var(--teal-light);
}

/* Article banner rules moved to assets/design-system/components/banner-slot.css
   (component-layer CSS with design-system tokens + IAB-aware per-device sizing). */

/* ══════════════════════════════════════════════
   LEGACY STOCK-PAGE BROKER CARDS — .best-companies-row / .best-company-card
   .best-companies-table canonical rules live in
   assets/design-system/components/shortcode-broker-table.css (bundled).
   Rules below remain ONLY for stock_company_info_table.blade.php
   which still emits the older card-based markup.
   ══════════════════════════════════════════════ */

.section-article-content .best-companies {
    padding: 10px 0;
}

.section-article-content .best-companies .best-companies-row .best-company-card {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    border-radius: 8px;
    margin-bottom: 15px;
    background: var(--bg-card);
    overflow: hidden;
}

.best-companies .best-companies-row .best-company-card .company-table {
    border-collapse: collapse;
    min-width: 100%;
}

.best-companies .best-companies-row .best-company-card .company-table tr {
    border-bottom: 3px solid var(--border);
    padding: 10px;
}

.best-companies .best-companies-row .best-company-card .company-table tr:last-child {
    border-bottom: none;
}

.best-companies .best-companies-row .best-company-card .company-table td {
    padding: 10px;
}

.best-companies .best-companies-row .best-company-card .company-table .left {
    text-align: left;
    display: block;
}

.best-company-card .company-table .left a {
    font-weight: 700;
    text-decoration: underline;
    color: var(--teal);
}

.best-companies .best-companies-row .best-company-card .company-table .right {
    text-align: right;
    font-size: 18px;
    line-height: 26px;
    font-weight: 500;
}

.best-companies-row {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
}

.stock-company-info {
    flex: 1 1 100%;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
    border-radius: 10px;
    padding: 15px;
    background: var(--bg-card);
}

@media (min-width: 768px) {
    .stock-company-info {
        flex: 1 1 calc(50% - 20px);
    }
}

/* ══════════════════════════════════════════════
   MOBILE — Banner cards only. Table-responsive mobile behavior
   is now inside article-content.css with the .article-table rules.
   ══════════════════════════════════════════════ */

@media (max-width: 768px) {
    .banner-card .card-title {
        font-size: 18px;
    }

    .banner-card .card-text {
        font-size: 15px;
    }

    .banner-card .card-footer .btn {
        font-size: 16px;
        min-height: 44px;
    }
}

/* Article banner rules moved to assets/design-system/components/banner-slot.css
   — single source of truth to avoid the duplicate-selector cascade bug. */

.fixed-variant {
    max-height: 80px;
    width: auto;
}

.best-companies-table .fixed-variant, .company-deposit-table .fixed-variant, .trading-company-details-card .fixed-variant {
    width: 65px;
}

/* ══════════════════════════════════════════════
   COMMENTS — Post comments section
   ══════════════════════════════════════════════ */

.post-comments {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
}

.post-comments-row {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.clients-comments .title {
    margin-bottom: 16px;
}

.clients-comments .title span {
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--navy);
}

.comment-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 10px;
}

.comment-card-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.comment-card-header .header-client {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
}

.comment-card-header .client-name b {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--navy);
}

.comment-date p {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin: 0;
}

.comment-text {
    font-size: 0.95rem;
    line-height: 1.7;
    color: var(--text-mid);
}

.comment-text p {
    margin: 0;
}

.comment-controls {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid var(--border-soft);
    display: flex;
    gap: 10px;
}

/* Add new comment form */
.add-new-comment {
    margin-top: 20px;
}

.add-new-comment-box {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 20px;
}

.add-new-comment-box .form-control,
.add-new-comment-box textarea,
.add-new-comment-box input[type="text"],
.add-new-comment-box input[type="email"] {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 0.9rem;
    font-family: 'Almarai', sans-serif;
    margin-bottom: 10px;
    outline: none;
}

.add-new-comment-box textarea {
    min-height: 100px;
    resize: vertical;
}

.add-new-comment-box .form-control:focus,
.add-new-comment-box textarea:focus,
.add-new-comment-box input:focus {
    border-color: var(--teal);
}

/* ══════════════════════════════════════════════
   MOBILE RESPONSIVE — Comments + Banners
   ══════════════════════════════════════════════ */

@media (max-width: 768px) {
    .comment-card {
        padding: 12px;
    }

    .comment-card-header .client-name b {
        font-size: 0.88rem;
    }

    /* .article-banner .row / .col rules removed — the new banner wrapper no
       longer uses Bootstrap .row/.col inside. Responsive behavior lives in
       assets/design-system/components/banner-slot.css. */
}

/* ══════════════════════════════════════════════
   LIGHT BLUE BLOCK — Article start/end summary
   ══════════════════════════════════════════════ */

.light-blue-block {
    background-color: #E9F2FB;
    padding: 16px;
    border-radius: 16px;
}

.light-blue-block .paragraph-text {
    line-height: 30px;
}

.light-blue-block ul {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.light-blue-block ul li {
    font-size: 16px;
    line-height: 30px;
    font-weight: 500;
    position: relative;
    padding-right: 14px;
}

.light-blue-block ul li p,
.light-blue-block ol li p {
    padding: 0;
}

.light-blue-block ul li span {
    font-weight: 400;
}

.light-blue-block ol {
    display: flex;
    flex-direction: column;
    gap: 4px;
    list-style-type: decimal;
    padding-right: 13px;
}

.light-blue-block ol li {
    font-size: 16px;
    line-height: 30px;
    font-weight: 500;
    position: relative;
}

.light-blue-block .fw-medium {
    font-size: 20px;
    font-weight: 700 !important;
}

.light-blue-block p {
    font-size: 17px;
}

/* ══════════════════════════════════════════════
   READ MORE BUTTON — Teal design with lines
   ══════════════════════════════════════════════ */

.read-more-toggle-div {
    text-align: center;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    margin: 30px 0 20px;
}

.read-more-toggle-div::before,
.read-more-toggle-div::after {
    content: '';
    flex: 1;
    height: 2px;
    background: linear-gradient(-90deg, transparent 0%, #d0d0d0 50%, #b0b0b0 100%);
    max-width: 200px;
}

.read-more-toggle-div::after {
    background: linear-gradient(-90deg, #b0b0b0 0%, #d0d0d0 50%, transparent 100%);
}

.read-more-toggle,
.read-more-btn {
    display: inline-flex;
    align-items: center;
    flex-direction: row-reverse;
    gap: 12px;
    padding: 12px 28px 12px 16px;
    background: linear-gradient(135deg, #1fa5a3 0%, #178f8d 50%, #0d7a78 100%);
    color: #ffffff;
    font-size: 16px;
    font-weight: 600;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    transition: all .3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    box-shadow: 0 4px 20px rgba(23, 143, 141, 0.35);
    animation: readMorePulse 2.5s ease-in-out infinite;
    text-decoration: none !important;
    margin: 0;
}

.read-more-toggle::before,
.read-more-btn::before {
    content: '↓';
    display: flex;
    align-items: center;
    justify-content: center;
    width: 35px;
    height: 35px;
    background: #ffffff;
    color: #178f8d;
    font-size: 27px;
    font-weight: 700;
    border-radius: 50%;
    animation: bounceArrow 1.5s ease-in-out infinite;
    flex-shrink: 0;
}

.read-more-toggle::after,
.read-more-btn::after {
    content: none;
}

.read-more-toggle.expanded::before,
.read-more-btn.expanded::before {
    transform: rotate(180deg);
    animation: none;
}

.read-more-toggle.expanded,
.read-more-btn.expanded {
    animation: none;
}

.read-more-toggle:hover,
.read-more-btn:hover {
    background: linear-gradient(135deg, #25b3b1 0%, #1a9997 50%, #118886 100%);
    transform: scale(1.05) translateY(-2px);
    box-shadow: 0 8px 30px rgba(23, 143, 141, 0.45);
    animation: none;
}

.read-more-toggle:hover::before,
.read-more-btn:hover::before {
    animation: bounceArrow 0.5s ease-in-out infinite;
}

.read-more-toggle.expanded:hover::before,
.read-more-btn.expanded:hover::before {
    transform: rotate(180deg);
    animation: none;
}

.read-more-toggle:active,
.read-more-btn:active {
    transform: scale(0.98);
    box-shadow: 0 2px 10px rgba(23, 143, 141, 0.3);
}

.read-more-toggle-desc {
    gap: 23px;
}

@keyframes readMorePulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 4px 20px rgba(23, 143, 141, 0.35);
    }
    50% {
        transform: scale(1.02);
        box-shadow: 0 6px 28px rgba(23, 143, 141, 0.45);
    }
}

@keyframes bounceArrow {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(3px); }
}

/* ══════════════════════════════════════════════
   STOCK DESCRIPTION — Clamp + expand
   ══════════════════════════════════════════════ */

.stock-desc-wrap {
    position: relative;
}

.stock-description.clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    position: relative;
}

.stock-description.clamp-2:after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2.2em;
    background: linear-gradient(to bottom, rgba(255, 255, 255, 0), rgba(255, 255, 255, 1));
    pointer-events: none;
}

.stock-description.expanded {
    display: block;
    -webkit-line-clamp: initial;
    -webkit-box-orient: initial;
    overflow: visible;
}

.stock-description.expanded:after {
    display: none;
}

/* ══════════════════════════════════════════════
   READMORE BY HEADINGS — Article content collapse
   ══════════════════════════════════════════════ */

.readmore-by-headings .article-content-toggle-wrap {
    position: relative;
}

.readmore-by-headings .content-inner {
    position: relative;
}

.readmore-by-headings .content-inner.collapsed:after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 80px;
    background: linear-gradient(to bottom, rgba(255, 255, 255, 0), rgba(255, 255, 255, 1));
    pointer-events: none;
}

.readmore-by-headings .content-inner.collapsed .article-rest {
    display: none;
}

.readmore-by-headings .content-inner.expanded:after {
    display: none;
}

/* ═══════════════════════════════════════
   STOCK SHORTCODE TABLES
   Used by stock-movers-chart-short-code.blade.php
   Originally in style.css — migrated for app-v2
   ═══════════════════════════════════════ */

.home-top-gainers-table {
    width: 100%;
    font-size: 12px;
    background: var(--bg-card, #fff);
    border-collapse: collapse;
    border-radius: var(--radius-md, 8px);
    overflow: hidden;
    box-shadow: var(--shadow-sm, 0 0 10px rgba(0,0,0,0.08));
}

.home-top-gainers-table thead tr {
    background: var(--teal, #0E7C7B);
    color: #fff;
    text-align: center;
}

.home-top-gainers-table th,
.home-top-gainers-table td {
    text-align: center;
    padding: 8px 10px;
}

.home-top-gainers-table tbody tr {
    border-bottom: 1px solid var(--border, #ddd);
}

.home-top-gainers-table tbody tr:nth-of-type(even) {
    background: var(--bg-subtle, #f3f3f3);
}

.home-top-gainers-table tbody tr:last-of-type {
    border-bottom: 2px solid var(--teal, #0E7C7B);
}

.stock-table-last-updated {
    padding: 10px 0;
    font-size: var(--text-xs, 12px);
    color: var(--text-muted, #7A95B0);
}

/* ═══════════════════════════════════════
   IN-CONTENT TABLE OF CONTENTS
   Used by topic.blade.php — numbered list with counters
   ═══════════════════════════════════════ */

.toc-list {
    list-style: none;
    padding: 0;
    margin: 0;
    counter-reset: toc-counter;
}

.toc-item {
    margin-bottom: 16px;
    counter-increment: toc-counter;
    position: relative;
    background: var(--bg-subtle, #f8f9ff);
    border-radius: var(--radius-lg, 12px);
    border: 1px solid var(--border-light, #e6f0ff);
    transition: all 0.3s;
    cursor: pointer;
}

.toc-item::before {
    content: counter(toc-counter);
    position: absolute;
    right: 7px;
    top: 50%;
    transform: translateY(-50%);
    background: var(--teal, #0E7C7B);
    color: #fff;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 700;
    line-height: 1;
}

.toc-item.active::before {
    background: var(--gold, #C08A2E);
}

.toc-link {
    display: block;
    padding: 16px 45px 16px 6px;
    color: var(--text, #1a1a1a);
    text-decoration: none;
    font-size: 14px;
    line-height: 1.5;
    border-radius: var(--radius-lg, 12px);
    font-weight: 500;
}

.toc-link:hover {
    background: var(--teal-bg, #EBF7F7);
    color: var(--teal, #0E7C7B);
}

.toc-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    border-bottom: 3px solid var(--teal, #0E7C7B);
    position: relative;
}

.toc-header h3 {
    font-size: 20px;
    font-weight: 500;
    color: var(--text, #1a1a1a);
    padding: 0;
    margin-bottom: 0;
    text-align: center;
    flex: 1;
}

/* See More Button */
.see-more-btn-block {
    text-align: center;
    padding-top: 20px;
}

@media (max-width: 768px) {
    .toc-list { padding: 0 1rem; }
    .toc-item { margin-bottom: 0.5rem; }
    .toc-link { font-size: 14px; padding: 0.5rem 40px 0.5rem 6px; }
}
