/**
 * DrowIQ Academy — Workshop Detail Rich Content Styles
 * Professional typography for TinyMCE long_description output
 * Version: 2.0 | Responsive: ✓ | Dark-theme: ✓
 *
 * Include in <head> on workshop-detail.php:
 *   <link rel="stylesheet" href="/css/workshop-detail.css">
 *
 * Or add this import to your main style.css:
 *   @import url('/css/workshop-detail.css');
 */

/* ════════════════════════════════════════════════════════════════
   CSS CUSTOM PROPERTIES (inherits from site theme)
   Override these per-page if needed
════════════════════════════════════════════════════════════════ */
:root {
    --wd-text:      var(--t, #c8d8a0);
    --wd-heading:   var(--w, #ffffff);
    --wd-accent:    var(--lime, #aaff00);
    --wd-muted:     var(--m, #8a9a70);
    --wd-border:    rgba(170, 255, 0, 0.12);
    --wd-code-bg:   rgba(170, 255, 0, 0.07);
    --wd-block-bg:  rgba(170, 255, 0, 0.04);
    --wd-table-alt: rgba(255, 255, 255, 0.025);
    --wd-pre-bg:    rgba(0, 0, 0, 0.45);
    --wd-radius:    10px;
    --wd-font-body: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Noto Sans', sans-serif;
    --wd-font-mono: 'Fira Code', 'Cascadia Code', 'JetBrains Mono', 'Courier New', monospace;
}

/* ════════════════════════════════════════════════════════════════
   PAGE LAYOUT
════════════════════════════════════════════════════════════════ */
.ws-detail-wrap {
    max-width: 1200px;
    margin: 0 auto;
    padding: clamp(12px, 3vw, 24px) clamp(12px, 4vw, 20px) 80px;
}

.ws-back-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--wd-muted);
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    margin-bottom: 24px;
    padding: 6px 12px;
    border-radius: 8px;
    border: 1px solid transparent;
    transition: color .15s, border-color .15s, background .15s;
}
.ws-back-link:hover {
    color: var(--wd-accent);
    border-color: var(--wd-border);
    background: rgba(170,255,0,0.04);
}

/* Two-column layout: content | sidebar */
.ws-detail-grid {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: clamp(20px, 3vw, 36px);
    align-items: start;
}

/* Sticky purchase card */
.ws-sticky-card {
    position: sticky;
    top: 80px;
}

/* ════════════════════════════════════════════════════════════════
   HERO IMAGE
════════════════════════════════════════════════════════════════ */
.ws-hero-img {
    width: 100%;
    max-height: 380px;
    object-fit: cover;
    border-radius: 14px;
    margin-bottom: 20px;
    display: block;
}

/* ════════════════════════════════════════════════════════════════
   WORKSHOP HEADER ELEMENTS
════════════════════════════════════════════════════════════════ */
.ws-title {
    font-size: clamp(1.4rem, 3vw, 2.1rem);
    font-weight: 900;
    color: var(--wd-heading);
    line-height: 1.25;
    margin: 10px 0 14px;
    letter-spacing: -0.02em;
}

.ws-short-desc {
    font-size: 15.5px;
    color: var(--wd-muted);
    line-height: 1.75;
    margin-bottom: 20px;
}

/* Stats grid */
.ws-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 10px;
    margin-bottom: 24px;
}

.ws-stat-item {
    background: rgba(255,255,255,0.035);
    border: 1px solid var(--wd-border);
    border-radius: var(--wd-radius);
    padding: 12px 14px;
    transition: border-color .2s, background .2s;
}
.ws-stat-item:hover {
    border-color: rgba(170,255,0,0.22);
    background: rgba(170,255,0,0.03);
}

.ws-stat-label {
    font-size: 10px;
    color: var(--wd-muted);
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .06em;
    margin-bottom: 5px;
}
.ws-stat-value {
    font-size: 13.5px;
    font-weight: 700;
    color: var(--wd-heading);
    line-height: 1.3;
}

/* Section title */
.ws-section-title {
    font-size: 1.05rem;
    font-weight: 800;
    color: var(--wd-heading);
    margin: 28px 0 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Topics checklist */
.ws-topic-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 9px 0;
    border-bottom: 1px solid rgba(255,255,255,0.04);
    font-size: 14px;
    color: var(--wd-text);
}
.ws-topic-item:last-child { border-bottom: none; }

.ws-topic-check {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    background: rgba(170,255,0,0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 800;
    color: var(--wd-accent);
    margin-top: 2px;
}

/* Divider between short-desc and rich content */
.ws-content-divider {
    height: 1px;
    background: linear-gradient(90deg, rgba(170,255,0,0.22) 0%, transparent 100%);
    margin: 28px 0;
}

/* ════════════════════════════════════════════════════════════════
   RICH CONTENT — FULL TYPOGRAPHY SYSTEM
   Applied to the div wrapping TinyMCE HTML output
════════════════════════════════════════════════════════════════ */
.ws-rich-content {
    font-family: var(--wd-font-body);
    font-size: 15.5px;
    line-height: 1.82;
    color: var(--wd-text);
    word-break: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
}

/* -- Headings ----------------------------------------------- */
.ws-rich-content h1,
.ws-rich-content h2,
.ws-rich-content h3,
.ws-rich-content h4,
.ws-rich-content h5,
.ws-rich-content h6 {
    color: var(--wd-heading);
    font-weight: 800;
    line-height: 1.32;
    margin: 2.2em 0 0.55em;
    letter-spacing: -0.015em;
}
.ws-rich-content > *:first-child { margin-top: 0 !important; }
.ws-rich-content > *:last-child  { margin-bottom: 0 !important; }

.ws-rich-content h1 { font-size: clamp(1.5rem, 3vw, 1.9rem); }
.ws-rich-content h2 {
    font-size: clamp(1.2rem, 2.5vw, 1.5rem);
    border-bottom: 2px solid rgba(170,255,0,0.14);
    padding-bottom: 10px;
}
.ws-rich-content h3 {
    font-size: clamp(1.05rem, 2vw, 1.22rem);
    color: var(--wd-accent);
}
.ws-rich-content h4 { font-size: 1.05rem; }
.ws-rich-content h5 { font-size: 0.95rem; }
.ws-rich-content h6 {
    font-size: 0.875rem;
    color: var(--wd-muted);
    text-transform: uppercase;
    letter-spacing: .05em;
}

/* -- Paragraphs -------------------------------------------- */
.ws-rich-content p {
    margin: 0 0 1.1em;
}

/* -- Lists ------------------------------------------------- */
.ws-rich-content ul,
.ws-rich-content ol {
    margin: 0.4em 0 1.25em;
    padding-left: 0;
}

/* Custom bullet list */
.ws-rich-content ul { list-style: none; }
.ws-rich-content ul > li {
    position: relative;
    padding-left: 1.65em;
    margin-bottom: 0.45em;
    color: var(--wd-text);
}
.ws-rich-content ul > li::before {
    content: '✓';
    position: absolute;
    left: 0;
    top: 0.18em;
    color: var(--wd-accent);
    font-size: 0.82em;
    font-weight: 900;
    line-height: 1;
}

/* Ordered list */
.ws-rich-content ol {
    list-style: decimal;
    padding-left: 1.5em;
}
.ws-rich-content ol > li { margin-bottom: 0.45em; padding-left: 0.3em; }

/* Nested lists */
.ws-rich-content li > ul,
.ws-rich-content li > ol {
    margin: 0.35em 0 0.2em;
}

/* -- Inline Formatting ------------------------------------- */
.ws-rich-content strong,
.ws-rich-content b {
    color: var(--wd-heading);
    font-weight: 700;
}
.ws-rich-content em,
.ws-rich-content i {
    font-style: italic;
}
.ws-rich-content u {
    text-decoration: underline;
    text-decoration-color: rgba(170,255,0,0.35);
    text-underline-offset: 3px;
}
.ws-rich-content s,
.ws-rich-content del {
    text-decoration: line-through;
    opacity: 0.6;
}
.ws-rich-content mark {
    background: rgba(170,255,0,0.2);
    color: var(--wd-heading);
    padding: 1px 5px;
    border-radius: 3px;
}
.ws-rich-content small { font-size: 0.85em; }
.ws-rich-content sup   { vertical-align: super; font-size: 0.72em; }
.ws-rich-content sub   { vertical-align: sub;   font-size: 0.72em; }

/* -- Links ------------------------------------------------- */
.ws-rich-content a {
    color: var(--wd-accent);
    text-decoration: underline;
    text-decoration-color: rgba(170,255,0,0.3);
    text-underline-offset: 3px;
    transition: text-decoration-color .15s, color .15s;
}
.ws-rich-content a:hover {
    text-decoration-color: var(--wd-accent);
}

/* -- Code -------------------------------------------------- */
.ws-rich-content code {
    font-family: var(--wd-font-mono);
    font-size: 0.875em;
    background: var(--wd-code-bg);
    border: 1px solid rgba(170,255,0,0.13);
    border-radius: 4px;
    padding: 2px 7px;
    color: var(--wd-accent);
    white-space: pre-wrap;
    word-break: break-word;
}
.ws-rich-content pre {
    background: var(--wd-pre-bg);
    border: 1px solid rgba(170,255,0,0.1);
    border-radius: var(--wd-radius);
    padding: 18px 22px;
    overflow-x: auto;
    margin: 1.4em 0;
    line-height: 1.65;
    tab-size: 2;
}
.ws-rich-content pre code {
    background: transparent;
    border: none;
    padding: 0;
    color: #c8d8a0;
    font-size: 0.88em;
    white-space: pre;
}

/* -- Blockquote -------------------------------------------- */
.ws-rich-content blockquote {
    border-left: 4px solid var(--wd-accent);
    margin: 1.5em 0;
    padding: 14px 22px;
    background: var(--wd-block-bg);
    border-radius: 0 var(--wd-radius) var(--wd-radius) 0;
    color: var(--wd-muted);
    font-style: italic;
    position: relative;
}
.ws-rich-content blockquote::before {
    content: '"';
    position: absolute;
    top: -4px;
    left: 14px;
    font-size: 3rem;
    color: var(--wd-accent);
    opacity: 0.2;
    font-style: normal;
    line-height: 1;
}
.ws-rich-content blockquote p { margin-bottom: 0; }
.ws-rich-content blockquote p + p { margin-top: 0.6em; }

/* -- Horizontal Rule --------------------------------------- */
.ws-rich-content hr {
    border: none;
    border-top: 1px solid rgba(170,255,0,0.1);
    margin: 2.2em 0;
    position: relative;
}
.ws-rich-content hr::after {
    content: '◈';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%,-50%);
    background: inherit;
    padding: 0 12px;
    font-size: 12px;
    color: rgba(170,255,0,0.25);
    background-color: var(--bg, #0a1200);
}

/* -- Images ------------------------------------------------ */
.ws-rich-content img {
    max-width: 100%;
    height: auto;
    border-radius: var(--wd-radius);
    display: block;
    margin: 1.2em auto;
    box-shadow: 0 4px 24px rgba(0,0,0,0.35);
}
.ws-rich-content figure {
    margin: 1.6em 0;
}
.ws-rich-content figcaption {
    text-align: center;
    font-size: 0.8em;
    color: var(--wd-muted);
    margin-top: 8px;
    font-style: italic;
}

/* -- Tables ------------------------------------------------ */
.ws-rich-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.4em 0;
    font-size: 0.9em;
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: var(--wd-radius);
    border: 1px solid var(--wd-border);
}
.ws-rich-content th,
.ws-rich-content td {
    padding: 10px 16px;
    border: 1px solid var(--wd-border);
    text-align: left;
    min-width: 100px;
}
.ws-rich-content th {
    background: rgba(170,255,0,0.07);
    color: var(--wd-heading);
    font-weight: 700;
    font-size: 0.85em;
    text-transform: uppercase;
    letter-spacing: .04em;
}
.ws-rich-content tbody tr:nth-child(even) td {
    background: var(--wd-table-alt);
}
.ws-rich-content caption {
    caption-side: bottom;
    font-size: 0.8em;
    color: var(--wd-muted);
    margin-top: 8px;
    text-align: center;
    font-style: italic;
}

/* -- Section / Article wrappers (TinyMCE may generate) ----- */
.ws-rich-content section,
.ws-rich-content article {
    margin: 1.6em 0;
}

/* -- Div / Span neutrals ----------------------------------- */
.ws-rich-content div { max-width: 100%; }
.ws-rich-content > div + div { margin-top: 0.5em; }

/* ════════════════════════════════════════════════════════════════
   PURCHASE CARD (sidebar)
════════════════════════════════════════════════════════════════ */
.purchase-card {
    background: rgba(255,255,255,0.03);
    border: 1px solid var(--wd-border);
    border-radius: 14px;
    padding: 22px;
}

/* ════════════════════════════════════════════════════════════════
   RESPONSIVE BREAKPOINTS
════════════════════════════════════════════════════════════════ */

/* Tablet */
@media (max-width: 900px) {
    .ws-detail-grid {
        grid-template-columns: 1fr;
    }
    .ws-sticky-card {
        position: static;
        order: -1; /* Move purchase card above content on mobile */
    }
    .ws-rich-content {
        font-size: 15px;
    }
    .ws-rich-content h2 { font-size: 1.25rem; }
    .ws-rich-content h3 { font-size: 1.08rem; }
}

/* Mobile */
@media (max-width: 560px) {
    .ws-detail-wrap {
        padding-bottom: 60px;
    }
    .ws-stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .ws-rich-content {
        font-size: 14.5px;
        line-height: 1.75;
    }
    .ws-rich-content pre {
        padding: 12px 14px;
        font-size: 0.82em;
    }
    .ws-rich-content blockquote {
        padding: 10px 14px;
    }
    .ws-rich-content ul > li,
    .ws-rich-content ol > li {
        margin-bottom: 0.35em;
    }
    .ws-hero-img {
        max-height: 220px;
    }
}

/* Very small mobile */
@media (max-width: 360px) {
    .ws-stats-grid {
        grid-template-columns: 1fr;
    }
}

/* ════════════════════════════════════════════════════════════════
   PRINT STYLES
════════════════════════════════════════════════════════════════ */
@media print {
    .ws-sticky-card { display: none; }
    .ws-detail-grid { grid-template-columns: 1fr; }
    .ws-rich-content { color: #000; }
    .ws-rich-content h2,
    .ws-rich-content h3 { color: #111; }
    .ws-rich-content a { color: #000; text-decoration: underline; }
    .ws-rich-content blockquote { border-color: #333; }
}

/* ════════════════════════════════════════════════════════════════
   LOADING SKELETONS
════════════════════════════════════════════════════════════════ */
@keyframes ws-skeleton-pulse {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0.35; }
}
.ws-skeleton {
    background: rgba(255,255,255,0.05);
    border-radius: 8px;
    animation: ws-skeleton-pulse 1.6s ease-in-out infinite;
}
