/* ── DSHM Premium Article — Public Styles ──────────────────── */

:root {
    --dshm-violet:        #7c3aed;
    --dshm-violet-dark:   #5b21b6;
    --dshm-violet-light:  #a78bfa;
    --dshm-violet-bg:     rgba(124, 58, 237, 0.06);
    --dshm-violet-glow:   rgba(124, 58, 237, 0.15);
    --dshm-text:          #111827;
    --dshm-text-muted:    #6b7280;
    --dshm-text-light:    #9ca3af;
    --dshm-surface:       rgba(255, 255, 255, 0.88);
    --dshm-border:        rgba(124, 58, 237, 0.12);
    --dshm-radius:        16px;
    --dshm-radius-sm:     10px;
    --dshm-shadow:        0 8px 32px rgba(124, 58, 237, 0.1);
    --dshm-shadow-lg:     0 20px 60px rgba(0, 0, 0, 0.18);
    --dshm-font:          'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --dshm-reading-width: 720px;
    --dshm-transition:    all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ── Progress Bar ─────────────────────────────────────────── */
#dshm-progress-bar {
    position: sticky;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: rgba(124, 58, 237, 0.12);
    z-index: 100;
}
#dshm-progress-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--dshm-violet), var(--dshm-violet-light));
    transition: width 0.1s linear;
    border-radius: 0 3px 3px 0;
}

/* ── Modal Overlay ────────────────────────────────────────── */
#dshm-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(10, 4, 26, 0.6);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 99998;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}
#dshm-modal-overlay.dshm-open {
    opacity: 1;
    visibility: visible;
}

#dshm-modal-container {
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(24px) saturate(1.8);
    -webkit-backdrop-filter: blur(24px) saturate(1.8);
    border: 1px solid rgba(255, 255, 255, 0.7);
    border-radius: 24px;
    box-shadow: var(--dshm-shadow-lg), 0 0 0 1px rgba(124,58,237,0.08);
    width: 100%;
    max-width: 860px;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transform: translateY(24px) scale(0.97);
    transition: transform 0.35s cubic-bezier(0.34,1.56,0.64,1);
    position: relative;
}
#dshm-modal-overlay.dshm-open #dshm-modal-container {
    transform: translateY(0) scale(1);
}

#dshm-modal-content {
    overflow-y: auto;
    flex: 1;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
}
#dshm-modal-content::-webkit-scrollbar { width: 4px; }
#dshm-modal-content::-webkit-scrollbar-track { background: transparent; }
#dshm-modal-content::-webkit-scrollbar-thumb { background: var(--dshm-violet-light); border-radius: 4px; }

#dshm-modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    z-index: 10;
    background: rgba(255,255,255,0.9);
    border: 1px solid rgba(124,58,237,0.15);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--dshm-text);
    transition: var(--dshm-transition);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}
#dshm-modal-close:hover {
    background: var(--dshm-violet);
    color: #fff;
    border-color: var(--dshm-violet);
    transform: scale(1.08);
}

/* ── Modal Article Layout ─────────────────────────────────── */
.dshm-modal-article {
    font-family: var(--dshm-font);
}

/* Hero 4:5 image */
.dshm-modal-hero {
    position: relative;
    overflow: hidden;
}
.dshm-modal-hero-img {
    aspect-ratio: 4 / 5;
    overflow: hidden;
}
.dshm-modal-hero-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.6s ease;
}
.dshm-modal-hero-img:hover img { transform: scale(1.02); }
.dshm-modal-hero-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 32px 32px 24px;
    background: linear-gradient(transparent, rgba(10,4,26,0.6));
}
.dshm-modal-cat {
    background: var(--dshm-violet);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    padding: 4px 12px;
    border-radius: 20px;
}

/* Header */
.dshm-modal-header {
    padding: 32px 40px 0;
    max-width: var(--dshm-reading-width);
    margin: 0 auto;
}
.dshm-modal-title {
    font-size: clamp(24px, 4vw, 36px);
    font-weight: 800;
    line-height: 1.2;
    color: var(--dshm-text);
    margin: 0 0 16px;
    letter-spacing: -0.5px;
}
.dshm-modal-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
    font-size: 12px;
    color: var(--dshm-text-muted);
    margin-bottom: 20px;
}
.dshm-modal-meta > span {
    display: flex;
    align-items: center;
    gap: 5px;
}
.dshm-modal-excerpt {
    font-size: 17px;
    line-height: 1.7;
    color: var(--dshm-text-muted);
    border-left: 3px solid var(--dshm-violet);
    padding-left: 16px;
    margin: 0;
    font-style: italic;
}

/* Body */
.dshm-modal-body {
    padding: 32px 40px 48px;
    max-width: var(--dshm-reading-width);
    margin: 0 auto;
}
.dshm-modal-body p {
    font-size: 16px;
    line-height: 1.85;
    color: var(--dshm-text);
    margin: 0 0 20px;
}

/* ── Article Body ─────────────────────────────────────────── */
.dshm-article-body {
    font-family: var(--dshm-font);
    max-width: var(--dshm-reading-width);
    margin: 40px auto;
    padding: 0 20px;
}

/* ── Key Takeaways ────────────────────────────────────────── */
.dshm-takeaways {
    background: var(--dshm-violet-bg);
    border: 1px solid var(--dshm-border);
    border-radius: var(--dshm-radius);
    padding: 24px 28px;
    margin-bottom: 40px;
}
.dshm-takeaways-header {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--dshm-violet);
    margin-bottom: 16px;
    font-size: 14px;
}
.dshm-takeaways-list {
    margin: 0;
    padding: 0;
    list-style: none;
}
.dshm-takeaways-list li {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 8px 0;
    font-size: 15px;
    line-height: 1.6;
    color: var(--dshm-text);
    border-bottom: 1px solid rgba(124,58,237,0.08);
}
.dshm-takeaways-list li:last-child { border-bottom: none; }
.dshm-takeaways-list li::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--dshm-violet);
    margin-top: 7px;
    flex-shrink: 0;
}

/* ── Table of Contents ────────────────────────────────────── */
.dshm-toc {
    background: rgba(255,255,255,0.8);
    border: 1px solid var(--dshm-border);
    border-radius: var(--dshm-radius);
    padding: 24px 28px;
    margin-bottom: 40px;
    backdrop-filter: blur(8px);
}
.dshm-toc-title {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--dshm-violet);
    margin-bottom: 12px;
}
.dshm-toc-list {
    margin: 0;
    padding-left: 20px;
}
.dshm-toc-list li { margin-bottom: 8px; }
.dshm-toc-list a {
    color: var(--dshm-text);
    font-size: 14px;
    text-decoration: none;
    transition: color 0.2s;
}
.dshm-toc-list a:hover { color: var(--dshm-violet); }

/* ── Sections ─────────────────────────────────────────────── */
.dshm-section {
    margin-bottom: 48px;
    position: relative;
}
.dshm-sec-label {
    display: inline-block;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--dshm-violet);
    background: var(--dshm-violet-bg);
    padding: 3px 10px;
    border-radius: 20px;
    margin-bottom: 12px;
}
.dshm-sec-title {
    font-size: clamp(20px, 3vw, 26px);
    font-weight: 700;
    color: var(--dshm-text);
    line-height: 1.3;
    margin: 0 0 16px;
    letter-spacing: -0.3px;
}
.dshm-sec-body {
    font-size: 16px;
    line-height: 1.85;
    color: var(--dshm-text);
}
.dshm-sec-body p { margin: 0 0 18px; }

/* Text + Image layout */
.dshm-text-image-wrap {
    display: grid;
    gap: 32px;
    align-items: start;
}
.dshm-text-image-wrap--left  { grid-template-columns: 1fr 1.6fr; }
.dshm-text-image-wrap--right { grid-template-columns: 1.6fr 1fr; }
.dshm-text-image-wrap--left  .dshm-inline-image { order: -1; }
.dshm-text-image-wrap--right .dshm-inline-image { order: 1; }

.dshm-inline-image img,
.dshm-full-image img {
    width: 100%;
    height: auto;
    border-radius: var(--dshm-radius);
    display: block;
    cursor: zoom-in;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.dshm-inline-image img:hover,
.dshm-full-image img:hover {
    transform: scale(1.01);
    box-shadow: var(--dshm-shadow);
}
figure { margin: 0; }
figcaption {
    font-size: 12px;
    color: var(--dshm-text-muted);
    text-align: center;
    margin-top: 8px;
    font-style: italic;
}

/* Quote block */
.dshm-quote-block {
    background: linear-gradient(135deg, var(--dshm-violet-bg), rgba(167,139,250,0.08));
    border-left: 4px solid var(--dshm-violet);
    border-radius: 0 var(--dshm-radius) var(--dshm-radius) 0;
    padding: 28px 32px;
    margin: 0 0 24px;
}
.dshm-quote-block p {
    font-size: 20px;
    font-weight: 500;
    line-height: 1.5;
    color: var(--dshm-text);
    font-style: italic;
    margin: 0;
}

/* CTA block */
.dshm-cta-block {
    background: linear-gradient(135deg, var(--dshm-violet), var(--dshm-violet-dark));
    border-radius: var(--dshm-radius);
    padding: 40px;
    text-align: center;
    color: #fff;
}
.dshm-cta-title {
    font-size: 24px;
    font-weight: 700;
    margin: 0 0 12px;
    color: #fff;
}
.dshm-cta-desc {
    font-size: 16px;
    opacity: 0.88;
    margin: 0 0 28px;
    line-height: 1.6;
    color: #fff;
}

/* ── Buttons ──────────────────────────────────────────────── */
.dshm-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 28px;
    border-radius: 50px;
    font-weight: 600;
    font-size: 15px;
    text-decoration: none;
    cursor: pointer;
    transition: var(--dshm-transition);
    border: none;
    font-family: var(--dshm-font);
}
.dshm-btn--primary {
    background: linear-gradient(135deg, var(--dshm-violet-light), var(--dshm-violet));
    color: #fff;
    box-shadow: 0 4px 16px rgba(124,58,237,0.3);
}
.dshm-btn--primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(124,58,237,0.4);
    color: #fff;
    text-decoration: none;
}
.dshm-btn--sticky { border-radius: 50px; }

/* ── FAQ ──────────────────────────────────────────────────── */
.dshm-faq-block { margin-bottom: 48px; }
.dshm-faq-heading {
    font-size: 22px;
    font-weight: 700;
    color: var(--dshm-text);
    margin: 0 0 20px;
}
.dshm-faq-list { display: flex; flex-direction: column; gap: 10px; }
.dshm-faq-item {
    border: 1px solid var(--dshm-border);
    border-radius: var(--dshm-radius-sm);
    overflow: hidden;
    background: rgba(255,255,255,0.7);
    backdrop-filter: blur(4px);
}
.dshm-faq-q {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 20px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 15px;
    font-weight: 600;
    color: var(--dshm-text);
    text-align: left;
    gap: 12px;
    font-family: var(--dshm-font);
    transition: background 0.2s;
}
.dshm-faq-q:hover { background: var(--dshm-violet-bg); }
.dshm-faq-q[aria-expanded="true"] { color: var(--dshm-violet); }
.dshm-faq-chevron {
    flex-shrink: 0;
    transition: transform 0.3s ease;
    color: var(--dshm-violet-light);
}
.dshm-faq-q[aria-expanded="true"] .dshm-faq-chevron { transform: rotate(180deg); }
.dshm-faq-a {
    padding: 0 20px 18px;
    font-size: 15px;
    line-height: 1.7;
    color: var(--dshm-text-muted);
}
.dshm-faq-a[hidden] { display: none; }

/* ── Share ────────────────────────────────────────────────── */
.dshm-share {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 40px;
    padding: 20px 24px;
    border: 1px solid var(--dshm-border);
    border-radius: var(--dshm-radius);
    background: var(--dshm-violet-bg);
}
.dshm-share-label {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--dshm-text-muted);
    margin-right: 4px;
}
.dshm-share-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: 50px;
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: var(--dshm-transition);
    font-family: var(--dshm-font);
}
.dshm-share-btn--fb { background: #1877f2; color: #fff; }
.dshm-share-btn--fb:hover { background: #1558b0; color: #fff; }
.dshm-share-btn--wa { background: #25d366; color: #fff; }
.dshm-share-btn--wa:hover { background: #128c7e; color: #fff; }
.dshm-share-btn--li { background: #0a66c2; color: #fff; }
.dshm-share-btn--li:hover { background: #004471; color: #fff; }
.dshm-copy-link { background: rgba(124,58,237,0.1); color: var(--dshm-violet); border: 1px solid var(--dshm-border); }
.dshm-copy-link:hover { background: var(--dshm-violet); color: #fff; }
.dshm-copy-link.copied { background: #10b981; color: #fff; }

/* ── Author Box ───────────────────────────────────────────── */
.dshm-author-box {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 28px;
    border: 1px solid var(--dshm-border);
    border-radius: var(--dshm-radius);
    background: rgba(255,255,255,0.7);
    backdrop-filter: blur(4px);
    margin-bottom: 40px;
}
.dshm-author-avatar {
    width: 72px !important;
    height: 72px !important;
    border-radius: 50% !important;
    border: 3px solid var(--dshm-violet-bg);
    flex-shrink: 0;
}
.dshm-author-name {
    font-size: 16px;
    font-weight: 700;
    color: var(--dshm-text);
    text-decoration: none;
    display: block;
    margin-bottom: 6px;
}
.dshm-author-name:hover { color: var(--dshm-violet); }
.dshm-author-bio {
    font-size: 14px;
    line-height: 1.6;
    color: var(--dshm-text-muted);
    margin: 0;
}

/* ── Related Posts ────────────────────────────────────────── */
.dshm-related { margin-bottom: 48px; }
.dshm-related-heading {
    font-size: 20px;
    font-weight: 700;
    color: var(--dshm-text);
    margin: 0 0 20px;
}
.dshm-related-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}
.dshm-related-card {
    border: 1px solid var(--dshm-border);
    border-radius: var(--dshm-radius);
    overflow: hidden;
    background: rgba(255,255,255,0.85);
    backdrop-filter: blur(4px);
    cursor: pointer;
    transition: var(--dshm-transition);
    text-decoration: none;
    display: block;
}
.dshm-related-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--dshm-shadow);
    border-color: var(--dshm-violet-light);
}
.dshm-related-img {
    aspect-ratio: 16 / 10;
    overflow: hidden;
}
.dshm-related-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}
.dshm-related-card:hover .dshm-related-img img { transform: scale(1.05); }
.dshm-related-meta { padding: 16px; }
.dshm-related-cat {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--dshm-violet);
    display: block;
    margin-bottom: 6px;
}
.dshm-related-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--dshm-text);
    line-height: 1.4;
    margin: 0 0 8px;
}
.dshm-related-time {
    font-size: 11px;
    color: var(--dshm-text-light);
}

/* ── Sticky CTA ───────────────────────────────────────────── */
.dshm-sticky-cta {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(80px);
    z-index: 9999;
    transition: transform 0.4s cubic-bezier(0.34,1.56,0.64,1);
}
.dshm-sticky-cta.visible {
    transform: translateX(-50%) translateY(0);
}

/* ── Lightbox ─────────────────────────────────────────────── */
#dshm-lightbox {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.92);
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}
#dshm-lightbox.open { opacity: 1; visibility: visible; }
#dshm-lightbox-inner { max-width: 90vw; max-height: 90vh; }
#dshm-lightbox-img {
    max-width: 90vw;
    max-height: 90vh;
    object-fit: contain;
    border-radius: 8px;
    display: block;
}
#dshm-lightbox-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 50%;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #fff;
    transition: background 0.2s;
}
#dshm-lightbox-close:hover { background: rgba(255,255,255,0.2); }

/* ── Reveal animations ────────────────────────────────────── */
.dshm-reveal {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}
.dshm-reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ── Loading spinner ──────────────────────────────────────── */
.dshm-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 80px 40px;
}
.dshm-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--dshm-border);
    border-top-color: var(--dshm-violet);
    border-radius: 50%;
    animation: dshm-spin 0.8s linear infinite;
}
@keyframes dshm-spin { to { transform: rotate(360deg); } }

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 768px) {
    #dshm-modal-overlay { padding: 0; align-items: flex-end; }
    #dshm-modal-container {
        border-radius: 20px 20px 0 0;
        max-height: 95vh;
        max-width: 100%;
    }
    .dshm-modal-header { padding: 24px 20px 0; }
    .dshm-modal-body { padding: 24px 20px 40px; }
    .dshm-modal-title { font-size: 22px; }
    .dshm-modal-hero-img { aspect-ratio: 4 / 5; max-height: 60vw; }

    .dshm-text-image-wrap--left,
    .dshm-text-image-wrap--right {
        grid-template-columns: 1fr;
    }
    .dshm-text-image-wrap--left  .dshm-inline-image { order: 0; }
    .dshm-text-image-wrap--right .dshm-inline-image { order: 0; }

    .dshm-related-grid { grid-template-columns: 1fr; }
    .dshm-cta-block { padding: 28px 20px; }
    .dshm-quote-block p { font-size: 17px; }
    .dshm-author-box { flex-direction: column; text-align: center; }
    .dshm-share { justify-content: center; }
    .dshm-sticky-cta { width: calc(100% - 32px); }
    .dshm-sticky-cta .dshm-btn { width: 100%; }
    .dshm-article-body { padding: 0 16px; }
}

@media (max-width: 480px) {
    .dshm-related-grid { grid-template-columns: 1fr; }
    .dshm-modal-title { font-size: 20px; }
}

/* ── Modal trigger on post cards ─────────────────────────── */
.dshm-modal-trigger { cursor: pointer; }

/* ── Scrollbar hide in iOS ────────────────────────────────── */
#dshm-modal-content { scrollbar-width: thin; scrollbar-color: var(--dshm-violet-light) transparent; }
