/* ═══════════════════════════════════════════════
   NEWS DETAILS / ARTICLE PAGE
═══════════════════════════════════════════════ */

main.news-details {
    width: 100%;
    min-height: 100vh;
    background-color: var(--DefaultBackgroundColor);
    display: flex;
    justify-content: center;
    padding-top: 24px;
    padding-bottom: 60px;
}

main.news-details .main-content {
    width: 72%;
    max-width: 1200px;
    display: flex;
    flex-direction: column;
}

main.news-details .side-ads-bar {
    position: fixed;
    width: 160px;
    height: 600px;
    left: clamp(30px, 3vw, 90px);
    top: 14vh;
    background: transparent;
}
main.news-details .side-ads-bar.right {
    left: auto;
    right: clamp(30px, 3vw, 90px);
}
main.news-details .main-content .top-ads-bar {
    width: 100%;
    height: 90px;
    margin-bottom: 20px;
    background: #e5e7eb;
    border-radius: 8px;
}

/* ── Breadcrumb ── */
.breadcrumb-nav {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    font-size: .82rem;
    color: #aaa;
    margin-bottom: 20px;
}
.breadcrumb-nav a {
    color: #888;
    text-decoration: none;
    font-size: .82rem;
    transition: color .15s;
}
.breadcrumb-nav a:hover { color: #22c55e; }
.breadcrumb-nav .sep { font-size: .65rem; color: #ccc; }
.breadcrumb-nav span { color: #555; font-weight: 500; }

/* ── Wrapper ── */
.article-wrapper {
    display: flex;
    flex-direction: column;
}

/* ── Two-column layout ── */
.article-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 32px;
    align-items: start;
}

/* ── Main article ── */
.news-article {
    background: var(--CardBackgroundColor);
    border-radius: 16px;
    padding: 36px;
    border: 1px solid var(--border-color);
    box-shadow: 0 2px 16px rgba(0,0,0,.05);
}

/* Top tags */
.article-top-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 14px;
}

/* Tag pills (reused from news.css if loaded together, defined here for standalone) */
.tag-pill {
    display: inline-block;
    font-size: .72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .04em;
    padding: 3px 10px;
    border-radius: 20px;
    background: rgba(34, 197, 94, .1);
    color: #16a34a;
    text-decoration: none;
    transition: background .15s;
    white-space: nowrap;
}
.tag-pill:hover { background: rgba(34, 197, 94, .22); color: #15803d; }
.tag-pill.small { font-size: .68rem; padding: 2px 8px; }

/* Article title */
.article-title {
    font-size: 2rem;
    font-weight: 800;
    line-height: 1.25;
    color: var(--TextDefaultColor);
    margin-bottom: 10px;
}

/* Subtitle */
.article-subtitle {
    font-size: 1.1rem;
    font-weight: 500;
    color: #666;
    line-height: 1.55;
    margin-bottom: 18px;
    padding-bottom: 18px;
    border-bottom: 1px solid var(--border-color);
}

/* Meta row */
.article-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 4px;
    margin-bottom: 24px;
    font-size: .83rem;
    color: #888;
}
.meta-item {
    display: flex;
    align-items: center;
    gap: 5px;
}
.meta-sep { color: #ccc; }

/* Hero image — blurred backdrop handles any aspect ratio gracefully.
   A 16:9 frame is enforced; the real img is contained (no crop) and
   the same image blurred fills the space around it. */
.article-hero-img {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    border-radius: 12px;
    margin-bottom: 28px;
    background: #111827; /* dark base shown during load */
    isolation: isolate;
}

/* Blurred copy of the image fills the letterbox bars */
.hero-img-backdrop {
    position: absolute;
    inset: -12px; /* extend past edges to hide blur fringe */
    background-size: cover;
    background-position: center;
    filter: blur(28px) brightness(0.5) saturate(1.4);
    z-index: 0;
}

/* Shimmer sweeps across while image loads, disappears on .loaded */
.article-hero-img::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(255,255,255,.07) 40%,
        rgba(255,255,255,.13) 50%,
        rgba(255,255,255,.07) 60%,
        transparent 100%
    );
    background-size: 250% 100%;
    animation: heroShimmer 1.8s ease-in-out infinite;
    z-index: 3;
    opacity: 1;
    transition: opacity .35s;
    pointer-events: none;
}
.article-hero-img.img-loaded::after { opacity: 0; }

@keyframes heroShimmer {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Actual image — contained so portrait photos are never cropped */
.article-hero-img img {
    position: relative;
    z-index: 1;
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
    display: block;
    opacity: 0;
    transition: opacity .4s ease;
    /* Subtle drop shadow separates photo from the blurred backdrop */
    filter: drop-shadow(0 4px 24px rgba(0,0,0,.45));
}
.article-hero-img.img-loaded img { opacity: 1; }

/* Summary blockquote */
.article-summary {
    font-size: 1rem;
    font-weight: 500;
    color: #555;
    line-height: 1.7;
    border-left: 4px solid #22c55e;
    padding: 12px 18px;
    margin: 0 0 28px;
    background: rgba(34, 197, 94, .05);
    border-radius: 0 8px 8px 0;
    font-style: italic;
}

/* Article body content */
.article-content {
    font-size: 1.05rem;
    line-height: 1.95;
    color: var(--TextDefaultColor);
    text-align: left;
}
.article-content p {
    margin-bottom: 1.5em;
    letter-spacing: .01em;
}
/* Bold lead sentence on first paragraph */
.article-content p:first-child {
    font-size: 1.1rem;
    line-height: 1.85;
}
.article-content h1  { font-size: 1.6rem; font-weight: 800; margin: 1.4em 0 .5em; color: var(--TextDefaultColor); }
.article-content h2  { font-size: 1.3rem; font-weight: 700; margin: 1.3em 0 .4em; color: var(--TextDefaultColor); padding-bottom: 6px; border-bottom: 1px solid var(--border-color); }
.article-content h3  { font-size: 1.1rem; font-weight: 700; margin: 1.1em 0 .35em; color: var(--TextDefaultColor); }
.article-content ul, .article-content ol { padding-left: 1.6em; margin-bottom: 1.3em; }
.article-content li  { margin-bottom: .5em; }
.article-content a   { color: #22c55e; text-decoration: underline; text-underline-offset: 2px; }
.article-content a:hover { color: #16a34a; }
.article-content img { max-width: 100%; border-radius: 8px; margin: 8px 0; }
.article-content figure       { margin: 1.5em 0; text-align: center; }
.article-content figcaption   { font-size: .8rem; color: #999; margin-top: 6px; font-style: italic; }

/* Pull-quote blockquote */
.article-content blockquote {
    position: relative;
    margin: 2.2em 0;
    padding: 22px 24px 20px 60px;
    background: linear-gradient(135deg, rgba(34,197,94,.08) 0%, rgba(34,197,94,.02) 100%);
    border-left: 4px solid #22c55e;
    border-radius: 0 14px 14px 0;
    font-size: 1.08rem;
    font-style: italic;
    color: #374151;
    line-height: 1.75;
    box-shadow: 0 2px 12px rgba(34,197,94,.08);
}
.article-content blockquote::before {
    content: '\201C';
    position: absolute;
    left: 14px;
    top: 4px;
    font-size: 4.5rem;
    line-height: 1;
    color: rgba(34,197,94,.45);
    font-family: Georgia, 'Times New Roman', serif;
    font-style: normal;
    font-weight: 700;
}
/* Attribution line (everything after em dash) */
.article-content blockquote em,
.article-content blockquote i {
    display: block;
    margin-top: 10px;
    font-style: normal;
    font-size: .88rem;
    font-weight: 600;
    color: #22c55e;
    letter-spacing: .02em;
}

.article-content strong { font-weight: 700; }
.article-content em     { font-style: italic; }

/* ── Article footer ── */
.article-footer {
    margin-top: 40px;
    padding-top: 24px;
    border-top: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.footer-tags {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
}
.footer-tags-label {
    font-size: .8rem;
    font-weight: 600;
    color: #888;
    margin-right: 4px;
}

/* ── Share bar ── */
.share-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}
.share-label {
    font-size: .85rem;
    font-weight: 600;
    color: #888;
}
.share-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    font-size: .9rem;
    text-decoration: none;
    transition: transform .15s, opacity .15s;
    border: none;
    cursor: pointer;
}
.share-btn:hover { transform: scale(1.1); }
.share-twitter  { background: #000;   color: #fff; }
.share-facebook { background: #1877f2; color: #fff; }
.share-whatsapp { background: #25d366; color: #fff; }
.share-copy     { background: #f1f5f9; color: #555; }
.share-copy:hover { background: #22c55e; color: #fff; }

/* ── Back link ── */
.back-to-news {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: .85rem;
    font-weight: 600;
    color: #555;
    text-decoration: none;
    margin-top: 28px;
    padding: 8px 16px;
    background: #f1f5f9;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    transition: background .15s, color .15s;
    align-self: flex-start;
}
.back-to-news:hover { background: #22c55e; color: #fff; border-color: #22c55e; }

/* ── Sidebar ── */
.article-sidebar {
    position: sticky;
    top: 24px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.sidebar-widget {
    background: var(--CardBackgroundColor);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,.04);
}

.widget-title {
    font-size: .85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: #555;
    padding: 14px 18px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
}
.widget-title i { color: #22c55e; }

/* Related list */
.related-list { display: flex; flex-direction: column; }
.related-item {
    display: flex;
    gap: 12px;
    padding: 12px 16px;
    text-decoration: none;
    color: inherit;
    border-bottom: 1px solid var(--border-color);
    transition: background .15s;
    align-items: flex-start;
}
.related-item:last-child { border-bottom: none; }
.related-item:hover { background: rgba(34,197,94,.04); }
.related-item img {
    width: 72px;
    height: 54px;
    object-fit: cover;
    object-position: center top; /* bias upward so faces aren't cut off */
    border-radius: 8px;
    flex-shrink: 0;
    background: #f0f2f5;
}
.related-body { flex: 1; min-width: 0; }
.related-title {
    font-size: .84rem;
    font-weight: 600;
    line-height: 1.4;
    color: var(--TextDefaultColor);
    margin: 0 0 5px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.related-time { font-size: .75rem; color: #aaa; display: flex; align-items: center; gap: 4px; }

/* Sidebar share widget */
.sidebar-share-btns {
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.sidebar-share-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 14px;
    border-radius: 8px;
    text-decoration: none;
    font-size: .83rem;
    font-weight: 600;
    transition: opacity .15s, transform .15s;
}
.sidebar-share-btn:hover { opacity: .88; transform: translateX(3px); }
.sidebar-share-btn i { width: 18px; text-align: center; }
.sidebar-share-btn.share-twitter  { background: #000;    color: #fff; }
.sidebar-share-btn.share-facebook { background: #1877f2; color: #fff; }
.sidebar-share-btn.share-whatsapp { background: #25d366; color: #fff; }

/* ── Error/not-found state ── */
.article-not-found {
    text-align: center;
    padding: 80px 20px;
    background: var(--CardBackgroundColor);
    border-radius: 16px;
    border: 1px solid var(--border-color);
}
.article-not-found i {
    font-size: 4rem;
    color: #ccc;
    display: block;
    margin-bottom: 16px;
}
.article-not-found h2 { font-size: 1.4rem; margin-bottom: 8px; }
.article-not-found p  { color: #888; font-size: .9rem; margin-bottom: 24px; }
.btn-back {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 22px;
    background: #22c55e;
    color: #fff;
    border-radius: 8px;
    font-size: .9rem;
    font-weight: 600;
    text-decoration: none;
    transition: background .15s;
}
.btn-back:hover { background: #16a34a; color: #fff; }

/* ── Responsive ── */
@media (max-width: 1200px) {
    main.news-details .side-ads-bar { display: none; }
    main.news-details .main-content { width: 90%; }
    .article-layout { grid-template-columns: 1fr 260px; gap: 24px; }
}

@media (max-width: 900px) {
    .article-layout {
        grid-template-columns: 1fr;
    }
    .article-sidebar {
        position: static;
    }
    .news-article { padding: 24px; }
    .article-title { font-size: 1.5rem; }
}

@media (max-width: 600px) {
    main.news-details .main-content { width: 95%; }
    .news-article { padding: 18px; }
    .article-title { font-size: 1.3rem; }
    .article-meta { gap: 4px; }
    .meta-sep { display: none; }
    .meta-item { width: 100%; }
    .article-content { font-size: .95rem; }
    .article-hero-img { max-height: 220px; }
}

