/* =========================================================
   CouponsArena – Blog detail (blog-detail.css)
   ========================================================= */
:root {
    --brand-primary: #7e22ce;
    --brand-primary-dark: #4c1d95;
    --brand-primary-light: #a855f7;
    --brand-accent: #ec4899;
    --brand-deep-purple: #3b0764;

    --bg-body: #f9fafb;
    --bg-surface: #ffffff;
    --bg-dark: #0a0a0a;
    --bg-dark-accent: #1a0b2e;

    --text-main: #111827;
    --text-body: #4b5563;
    --text-muted: #9ca3af;
    --text-light: #ffffff;
    --text-light-muted: #d1d5db;

    --border-light: #e5e7eb;
    --border-dark: #2d2d2d;

    --gradient-brand: linear-gradient(135deg, #9333ea 0%, #ec4899 100%);
    --gradient-dark-bg: linear-gradient(180deg, #0a0a0a 0%, #3b0764 100%);

    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-brand: 0 4px 14px 0 rgba(126, 34, 206, 0.3);

    --radius: 20px;
    --radius-sm: 12px;
}

.blog-detail-page { background: var(--bg-body); color: var(--text-body); }
.blog-detail-page [hidden] { display: none !important; }

/* ---------- Reading progress ---------- */
.read-progress {
    position: fixed; top: 0; left: 0; z-index: 2100;
    width: 100%; height: 3px; background: transparent; pointer-events: none;
}
.read-progress span {
    display: block; width: 0; height: 100%;
    background: var(--gradient-brand);
    box-shadow: 0 0 10px rgba(236, 72, 153, .6);
}

/* ---------- Hero ---------- */
.blog-hero {
    position: relative; display: flex; flex-direction: column; justify-content: center;
    min-height: 64vh; padding: 3rem 0 7.5rem;
    color: #fff; text-align: center; overflow: hidden;
    background-color: var(--bg-dark-accent);
    background-size: cover; background-position: center;
}
.blog-hero::before {
    content: ''; position: absolute; inset: 0;
    background:
        radial-gradient(60% 70% at 85% 0%, rgba(236,72,153,.3) 0%, transparent 60%),
        linear-gradient(180deg, rgba(10,10,10,.55) 0%, rgba(59,7,100,.88) 100%);
}
.blog-hero > * { position: relative; z-index: 2; }

.hero-breadcrumb { margin-bottom: 2rem; }
.hero-breadcrumb .breadcrumb {
    display: inline-flex; flex-wrap: wrap; justify-content: center; margin: 0;
    padding: .5rem 1.2rem;
    background: rgba(255,255,255,.1);
    border: 1px solid rgba(255,255,255,.18);
    border-radius: 999px; backdrop-filter: blur(10px); font-size: .86rem;
}
.hero-breadcrumb .breadcrumb-item a { color: var(--text-light-muted); text-decoration: none; font-weight: 600; }
.hero-breadcrumb .breadcrumb-item a:hover { color: #fff; }
.hero-breadcrumb .breadcrumb-item.active { color: #fff; font-weight: 600; }
.hero-breadcrumb .breadcrumb-item + .breadcrumb-item::before { color: rgba(255,255,255,.45); }

.hero-category {
    display: inline-flex; align-items: center; gap: .5rem;
    margin-bottom: 1.1rem; padding: .4rem 1.1rem;
    color: #fff; font-size: .8rem; font-weight: 700; letter-spacing: .04em; text-decoration: none;
    background: var(--gradient-brand); border-radius: 999px; box-shadow: var(--shadow-brand);
}
.hero-category:hover { color: #fff; filter: brightness(1.1); }

.blog-title {
    max-width: 860px; margin: 0 auto 1.5rem;
    font-size: clamp(1.9rem, 4.6vw, 3.3rem);
    font-weight: 800; letter-spacing: -.03em; line-height: 1.18; color: #fff;
}
.blog-meta { display: flex; flex-wrap: wrap; justify-content: center; gap: .6rem; }
.meta-chip {
    display: inline-flex; align-items: center; gap: .5rem;
    padding: .42rem .95rem; color: #fff; font-size: .84rem; font-weight: 500;
    background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.16);
    border-radius: 999px; backdrop-filter: blur(8px);
}
.meta-chip i { color: var(--brand-accent); }

.scroll-indicator {
    position: absolute; bottom: 5.5rem; left: 50%; transform: translateX(-50%);
    width: 42px; height: 42px; display: grid; place-items: center;
    color: #fff; text-decoration: none;
    background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.22);
    border-radius: 50%; backdrop-filter: blur(6px);
    animation: bounce 2s infinite; transition: background .3s ease;
}
.scroll-indicator:hover { color: #fff; background: var(--gradient-brand); }

/* ---------- Main layout ---------- */
.blog-main { position: relative; z-index: 3; margin-top: -4.5rem; padding-bottom: 5rem; }

.article-card {
    padding: 2.8rem 3rem;
    background: var(--bg-surface);
    border: 1px solid var(--border-light);
    border-radius: 28px;
    box-shadow: var(--shadow-lg), 0 30px 60px rgba(59, 7, 100, .12);
    position: relative; overflow: hidden;
}
.article-card::before { content: ''; position: absolute; left: 0; right: 0; top: 0; height: 5px; background: var(--gradient-brand); }

/* ---------- Article typography ---------- */
.blog-content { color: var(--text-body); font-size: 1.06rem; line-height: 1.9; overflow-wrap: anywhere; }
.blog-content > *:first-child { margin-top: 0; }
.blog-content h1, .blog-content h2, .blog-content h3, .blog-content h4 {
    color: var(--text-main); font-weight: 800; letter-spacing: -.015em; line-height: 1.3;
    scroll-margin-top: 110px;
}
.blog-content h2 {
    position: relative; margin: 2.6rem 0 1rem; padding-left: 1rem; font-size: 1.75rem;
}
.blog-content h2::before {
    content: ''; position: absolute; left: 0; top: .2em; bottom: .2em; width: 5px;
    border-radius: 5px; background: var(--gradient-brand);
}
.blog-content h3 { margin: 2rem 0 .8rem; font-size: 1.4rem; }
.blog-content h4 { margin: 1.6rem 0 .6rem; font-size: 1.15rem; }
.blog-content p { margin: 0 0 1.3rem; }
.blog-content a {
    color: var(--brand-primary); font-weight: 600; text-decoration: none;
    border-bottom: 1.5px solid rgba(126,34,206,.3); transition: all .2s ease;
}
.blog-content a:hover { color: var(--brand-primary-dark); border-bottom-color: var(--brand-primary-dark); }
.blog-content img {
    display: block; max-width: 100%; height: auto; margin: 1.8rem auto;
    border-radius: var(--radius-sm); box-shadow: var(--shadow-md);
}
.blog-content ul, .blog-content ol { margin: 0 0 1.4rem; padding-left: 1.4rem; }
.blog-content li { margin-bottom: .5rem; }
.blog-content li::marker { color: var(--brand-primary); font-weight: 700; }
.blog-content blockquote {
    margin: 1.8rem 0; padding: 1.3rem 1.5rem;
    color: var(--text-main); font-style: italic;
    background: rgba(126,34,206,.06); border-left: 5px solid var(--brand-primary);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}
.blog-content blockquote p:last-child { margin-bottom: 0; }
.blog-content table {
    display: block; width: 100%; overflow-x: auto; margin: 1.8rem 0;
    border-collapse: collapse; border: 1px solid var(--border-light); border-radius: var(--radius-sm);
}
.blog-content th { padding: .8rem 1rem; color: #fff; text-align: left; background: var(--brand-deep-purple); }
.blog-content td { padding: .75rem 1rem; border-top: 1px solid var(--border-light); }
.blog-content tr:nth-child(even) td { background: var(--bg-body); }
.blog-content pre {
    margin: 1.6rem 0; padding: 1.2rem; overflow-x: auto; color: #e9d5ff;
    background: var(--bg-dark-accent); border-radius: var(--radius-sm);
}
.blog-content hr { margin: 2.4rem 0; border: 0; height: 2px; background: linear-gradient(90deg, var(--brand-primary-light), transparent); opacity: .5; }
.blog-content iframe, .blog-content video { max-width: 100%; border-radius: var(--radius-sm); }

/* ---------- Tags ---------- */
.article-section { margin-top: 2.6rem; padding-top: 1.8rem; border-top: 1px solid var(--border-light); }
.article-section h6 {
    display: flex; align-items: center; gap: .6rem; margin: 0 0 1rem;
    color: var(--text-main); font-size: .82rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase;
}
.article-section h6 i { color: var(--brand-primary); }
.tag-list { display: flex; flex-wrap: wrap; gap: .5rem; }
.tag-pill {
    padding: .4rem 1rem; color: var(--brand-primary-dark); font-size: .84rem; font-weight: 600;
    background: rgba(126,34,206,.08); border: 1px solid rgba(126,34,206,.18); border-radius: 999px;
}

/* ---------- Share ---------- */
.share-list { display: flex; flex-wrap: wrap; gap: .6rem; }
.share-btn {
    width: 46px; height: 46px; display: grid; place-items: center;
    color: var(--text-body); font-size: 1.05rem; cursor: pointer;
    background: var(--bg-body); border: 1px solid var(--border-light); border-radius: 14px;
    transition: transform .2s ease, color .2s ease, background .2s ease, border-color .2s ease, box-shadow .2s ease;
}
.share-btn:hover { color: #fff; transform: translateY(-3px); border-color: transparent; box-shadow: var(--shadow-md); }
.share-btn.facebook:hover { background: #1877f2; }
.share-btn.twitter:hover  { background: #0f1419; }
.share-btn.linkedin:hover { background: #0a66c2; }
.share-btn.whatsapp:hover { background: #25d366; }
.share-btn.telegram:hover { background: #229ed9; }
.share-btn.email:hover    { background: var(--brand-accent); }
.share-btn.copy-link:hover { background: var(--gradient-brand); }
.share-btn.copied { color: #fff; background: #16a34a; border-color: transparent; }

/* ---------- Sidebar ---------- */
.side-card {
    margin-bottom: 1.5rem; overflow: hidden;
    background: var(--bg-surface); border: 1px solid var(--border-light);
    border-radius: var(--radius); box-shadow: var(--shadow-md);
}
.side-head { padding: 1.2rem 1.5rem 0; }
.side-title { display: flex; align-items: center; gap: .6rem; margin: 0 0 .5rem; color: var(--text-main); font-size: 1.15rem; font-weight: 800; }
.side-title i { color: var(--brand-primary); }
.header-accent { width: 44px; height: 4px; margin-bottom: .6rem; border-radius: 4px; background: var(--gradient-brand); }

.recent-list { padding: .4rem .8rem 1rem; }
.recent-item {
    display: flex; gap: .9rem; align-items: center;
    padding: .7rem; margin-bottom: .2rem; color: inherit; text-decoration: none;
    border-radius: var(--radius-sm); transition: background .2s ease;
}
.recent-item:hover { background: rgba(126,34,206,.06); }
.recent-thumb { flex: 0 0 68px; width: 68px; height: 68px; overflow: hidden; border-radius: 12px; background: var(--border-light); }
.recent-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s ease; }
.recent-item:hover .recent-thumb img { transform: scale(1.1); }
.recent-info { min-width: 0; }
.recent-info h6 {
    margin: 0 0 .3rem; color: var(--text-main); font-size: .92rem; font-weight: 700; line-height: 1.4;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
    transition: color .2s ease;
}
.recent-item:hover .recent-info h6 { color: var(--brand-primary); }
.recent-info small { display: inline-flex; align-items: center; gap: .4rem; color: var(--text-muted); font-size: .76rem; }
.recent-info small i { color: var(--brand-primary-light); }

.toc-card { position: sticky; top: 110px; }
.toc-list { padding: .4rem .8rem 1rem; max-height: calc(100vh - 230px); overflow-y: auto; }
.toc-list a {
    display: block; padding: .5rem .8rem; margin-bottom: .1rem;
    color: var(--text-body); font-size: .87rem; font-weight: 500; line-height: 1.4; text-decoration: none;
    border-left: 3px solid transparent; border-radius: 0 10px 10px 0;
    transition: all .2s ease;
}
.toc-list a.sub { padding-left: 1.5rem; font-size: .82rem; }
.toc-list a:hover { color: var(--brand-primary); background: rgba(126,34,206,.05); }
.toc-list a.active { color: var(--brand-primary); font-weight: 700; background: rgba(126,34,206,.08); border-left-color: var(--brand-primary); }

/* ---------- Animations ---------- */
@keyframes bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateX(-50%) translateY(0); }
    40% { transform: translateX(-50%) translateY(-10px); }
    60% { transform: translateX(-50%) translateY(-5px); }
}
@keyframes fadeInUp { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: translateY(0); } }
.article-card, .side-card { animation: fadeInUp .55s ease both; }

/* ---------- Responsive ---------- */
@media (max-width: 991px) {
    .toc-card { position: static; }
    .blog-hero { min-height: 52vh; }
}
@media (max-width: 767px) {
    .blog-hero { padding: 2.5rem 0 6.5rem; }
    .blog-main { margin-top: -3.8rem; }
    .article-card { padding: 1.8rem 1.3rem; border-radius: 22px; }
    .blog-content { font-size: 1rem; line-height: 1.8; }
    .blog-content h2 { font-size: 1.45rem; }
    .scroll-indicator { display: none; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }