/* =========================================================================
   Talal Awad Media — article (single post) styles
   ========================================================================= */

/* ---------- Hero ---------- */
.article-hero {
    padding-block: clamp(40px, 7vw, 80px);
    background: linear-gradient(180deg, var(--bg-soft) 0%, var(--bg) 100%);
    border-bottom: 1px solid var(--border);
}
.article-hero .container { max-width: 880px; }
.article-hero__badge {
    display: inline-block;
    padding: 6px 14px;
    border-radius: 999px;
    background: var(--primary-soft);
    color: var(--primary);
    font-weight: 800;
    font-size: .78rem;
    letter-spacing: .2em;
    margin-bottom: 16px;
}
.article-hero__title {
    font-size: clamp(1.8rem, 4.4vw, 3rem);
    line-height: 1.25;
    margin: 0 0 18px;
    color: var(--text);
}
.article-hero__meta {
    display: flex; flex-wrap: wrap; gap: 8px 14px;
    color: var(--text-muted);
    font-size: .92rem;
    margin-bottom: 22px;
}
.article-hero__meta > * { display: inline-flex; align-items: center; }
.article-hero__author { color: var(--primary); font-weight: 700; }
.article-hero__sep { opacity: .5; }
.article-hero__cover {
    margin-top: 28px;
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    aspect-ratio: 16 / 9;
    background: var(--surface-2);
}
.article-hero__cover img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* ---------- Share row ---------- */
.share-row {
    display: flex; flex-wrap: wrap; gap: 10px;
    list-style: none; margin: 0; padding: 0;
    align-items: center;
}
.share-row--inline {
    margin-top: 36px; padding: 18px 22px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}
.share-row__label { font-weight: 700; color: var(--text); margin-inline-end: 6px; }
.share-btn {
    display: inline-flex; align-items: center; justify-content: center;
    gap: 6px;
    padding: 9px 18px; border-radius: 999px;
    font-size: .88rem; font-weight: 700;
    border: 1px solid var(--border-strong);
    background: var(--surface);
    color: var(--text);
    cursor: pointer;
    transition: transform var(--t-fast) var(--ease), background var(--t-fast) var(--ease), color var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease);
    font: inherit;
}
.share-btn:hover { transform: translateY(-2px); }
.share-btn--wa:hover    { background: #25D366; color: #fff; border-color: #25D366; }
.share-btn--x:hover     { background: #000;    color: #fff; border-color: #000; }
.share-btn--tg:hover    { background: #229ED9; color: #fff; border-color: #229ED9; }
.share-btn--fb:hover    { background: #1877F2; color: #fff; border-color: #1877F2; }
.share-btn--copy:hover  { background: var(--primary); color: var(--on-primary); border-color: var(--primary); }
.share-btn.is-copied { background: var(--primary); color: var(--on-primary); border-color: var(--primary); }

/* ---------- Layout (TOC sidebar + body) ---------- */
.article-section { padding-block: clamp(40px, 6vw, 72px); }
.article__layout {
    display: grid;
    gap: 36px;
    grid-template-columns: 1fr;
    align-items: start;
    max-width: 1100px;
    margin-inline: auto;
}
@media (min-width: 1024px) {
    .article__layout { grid-template-columns: 280px 1fr; }
}

/* ---------- TOC ---------- */
.article-toc-wrap { position: relative; }
@media (min-width: 1024px) {
    .article-toc-wrap {
        position: sticky;
        top: calc(var(--header-h) + 20px);
    }
}
.article-toc__toggle {
    display: inline-flex; align-items: center; gap: 8px;
    width: 100%;
    padding: 14px 18px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font: inherit; font-weight: 700;
    color: var(--text);
    cursor: pointer;
    justify-content: space-between;
}
.article-toc__toggle::after {
    content: "+";
    color: var(--primary);
    font-size: 1.4rem;
    transition: transform var(--t-fast) var(--ease);
}
.article-toc__toggle[aria-expanded="true"]::after { transform: rotate(45deg); }
@media (min-width: 1024px) {
    .article-toc__toggle { display: none; }
}
.article-toc {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 22px;
    box-shadow: var(--shadow-sm);
}
@media (max-width: 1023px) {
    .article-toc { display: none; margin-top: 12px; }
    .article-toc.is-open { display: block; }
}
.article-toc__title {
    font-size: 1rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: .2em;
    margin: 0 0 14px;
    font-weight: 800;
}
.article-toc__list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 6px; }
.article-toc__item a {
    display: block;
    padding: 8px 10px;
    color: var(--text);
    border-radius: var(--radius-sm);
    font-size: .95rem;
    line-height: 1.5;
    transition: background var(--t-fast) var(--ease), color var(--t-fast) var(--ease);
    border-inline-start: 2px solid transparent;
}
.article-toc__item a:hover { background: var(--primary-soft); color: var(--primary); }
.article-toc__item.is-active a { background: var(--primary-soft); color: var(--primary); border-inline-start-color: var(--primary); font-weight: 700; }
.article-toc__item--h3 a { font-size: .88rem; padding-inline-start: 22px; color: var(--text-muted); }
.article-toc__empty { color: var(--text-muted); margin: 0; }

/* ---------- Article body (typography) ---------- */
.article__body {
    color: var(--text);
    font-size: 1.08rem;
    line-height: 1.95;
    word-wrap: break-word;
    max-width: 100%;
}
.article__body > * + * { margin-top: 1.2em; }
.article__body h2, .article__body h3, .article__body h4 {
    color: var(--text);
    line-height: 1.3;
    scroll-margin-top: calc(var(--header-h) + 20px);
    margin: 1.8em 0 .6em;
}
.article__body h2 { font-size: clamp(1.4rem, 2.8vw, 1.8rem); }
.article__body h3 { font-size: clamp(1.15rem, 2.2vw, 1.35rem); }
.article__body h4 { font-size: 1.08rem; }
.article__body h2::before {
    content: "";
    display: block;
    width: 44px; height: 3px;
    background: var(--primary);
    margin-bottom: 14px;
    border-radius: 3px;
}
.article__body p { margin: 0 0 1.2em; color: var(--text); }
.article__body p:last-child { margin-bottom: 0; }
.article__body a { color: var(--primary); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
.article__body a:hover { color: var(--primary-hover); }
.article__body strong { color: var(--text); font-weight: 800; }
.article__body em { color: var(--text-muted); font-style: italic; }
.article__body ul, .article__body ol { padding-inline-start: 22px; margin: 0 0 1.2em; }
.article__body li { margin-bottom: .4em; }
.article__body ul { list-style: disc; }
.article__body ol { list-style: decimal; }
.article__body blockquote {
    margin: 1.6em 0;
    padding: 18px 24px;
    border-inline-start: 4px solid var(--primary);
    background: var(--surface-2);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-size: 1.1rem;
    font-style: italic;
}
.article__body blockquote p:last-child { margin-bottom: 0; }
.article__body img {
    max-width: 100%; height: auto;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    margin: 1.4em 0;
}
.article__body figure { margin: 1.4em 0; }
.article__body figcaption { color: var(--text-muted); font-size: .9rem; text-align: center; margin-top: 8px; }
.article__body code {
    background: var(--surface-2);
    border: 1px solid var(--border);
    padding: 2px 8px;
    border-radius: 6px;
    font-size: .92em;
}
.article__body pre {
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 16px 18px;
    overflow-x: auto;
    direction: ltr;
}
.article__body pre code { background: none; border: 0; padding: 0; }
.article__body hr { margin: 2em 0; border: 0; border-top: 1px solid var(--border); }
.article__body table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.4em 0;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    overflow: hidden;
}
.article__body th, .article__body td { padding: 12px 14px; border-bottom: 1px solid var(--border); text-align: start; }
.article__body th { background: var(--surface-2); font-weight: 800; }
.article__body iframe, .article__body video {
    max-width: 100%;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    margin: 1.4em 0;
}

/* ---------- Author box ---------- */
.author-box {
    display: flex;
    gap: 22px;
    align-items: center;
    padding: 28px;
    flex-wrap: wrap;
}
.author-box__avatar {
    flex-shrink: 0;
    width: 88px; height: 88px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), #8a9a1e);
    color: var(--on-primary);
    display: inline-flex; align-items: center; justify-content: center;
    font-weight: 800; font-size: 1.5rem;
    overflow: hidden;
}
.author-box__avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.author-box__body { flex: 1; min-width: 0; }
.author-box__name { font-size: 1.25rem; margin: 6px 0 8px; }
.author-box__bio { color: var(--text-muted); margin: 0 0 14px; }
