/**
 * Platform article post detail — DoctorBookly
 */
:root {
    --med-primary: #0d9488;
    --med-primary-dark: #0f766e;
    --med-bg: #f1f5f9;
    --med-card: #ffffff;
    --med-border: #e2e8f0;
    --med-text: #0f172a;
    --med-body: #334155;
    --med-muted: #64748b;
}

.med-post {
    font-family: 'Source Sans Pro', system-ui, sans-serif;
    background: linear-gradient(165deg, #f8fafc 0%, #ecfdf5 45%, #f0f9ff 100%);
    color: var(--med-body);
    padding: 0 0 56px;
    line-height: 1.7;
}

.med-post h1,
.med-post h2,
.med-post h3 {
    font-family: 'Poppins', sans-serif;
    font-weight: 700;
    color: var(--med-text);
}

.med-post-breadcrumb {
    max-width: 920px;
    margin: 0 auto;
    padding: 14px 20px 0;
    font-size: 13px;
    color: var(--med-muted);
}

.med-post-breadcrumb a {
    color: var(--med-primary);
    text-decoration: none;
    font-weight: 600;
}

.med-post-breadcrumb a:hover {
    text-decoration: underline;
}

.med-post-breadcrumb span[aria-hidden="true"] {
    margin: 0 6px;
    opacity: 0.5;
}

.med-post__shell {
    max-width: 920px;
    margin: 0 auto;
    padding: 16px 20px 0;
}

/* Hero card */
.med-post__hero-card {
    background: var(--med-card);
    border-radius: 20px;
    border: 1px solid var(--med-border);
    box-shadow: 0 16px 48px rgba(15, 23, 42, 0.08);
    overflow: hidden;
    margin-bottom: 24px;
}

.med-post__hero {
    margin: 0;
    position: relative;
    aspect-ratio: 16 / 8;
    max-height: 440px;
    background: linear-gradient(135deg, #ccfbf1, #bae6fd);
}

.med-post__hero img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.med-post__hero-badge {
    position: absolute;
    top: 16px;
    left: 16px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.95);
    color: var(--med-primary-dark);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.12);
}

.med-post__hero-body {
    padding: 24px 28px 28px;
}

.med-post__icon {
    width: 64px;
    height: 64px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 26px;
    margin-bottom: 16px;
    background: linear-gradient(135deg, var(--med-primary), var(--med-primary-dark));
    box-shadow: 0 8px 20px rgba(13, 148, 136, 0.35);
}

.med-post__title {
    font-size: clamp(1.55rem, 4.2vw, 2.15rem);
    line-height: 1.22;
    margin: 0 0 14px;
    letter-spacing: -0.02em;
}

.med-post__meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 18px;
    margin-bottom: 16px;
    font-size: 14px;
    color: var(--med-muted);
}

.med-post__meta-item {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    white-space: nowrap;
}

.med-post__meta-item i {
    color: var(--med-primary);
    font-size: 13px;
}

.med-post__tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
}

.med-post__tag {
    display: inline-flex;
    align-items: center;
    padding: 5px 12px;
    border-radius: 999px;
    background: #f0fdfa;
    border: 1px solid #99f6e4;
    color: var(--med-primary-dark);
    font-size: 12px;
    font-weight: 600;
}

.med-post__lead {
    font-size: clamp(1.05rem, 2.5vw, 1.2rem);
    line-height: 1.65;
    color: #475569;
    margin: 0;
    padding: 16px 18px;
    background: linear-gradient(135deg, #f8fafc, #f0fdfa);
    border-left: 4px solid var(--med-primary);
    border-radius: 0 12px 12px 0;
}

.med-post__share {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin-top: 18px;
    padding-top: 18px;
    border-top: 1px solid var(--med-border);
    position: relative;
}

.med-post__share-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    flex: 1;
    min-width: 0;
}

.med-post__share-label {
    font-size: 13px;
    font-weight: 700;
    color: var(--med-muted);
    margin-right: 4px;
}

.med-post__share-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    border: 1px solid var(--med-border);
    background: #fff;
    color: var(--med-muted);
    text-decoration: none;
    transition: background 0.2s, color 0.2s, border-color 0.2s, transform 0.15s;
}

.med-post__share-btn:hover {
    background: var(--med-primary);
    border-color: var(--med-primary);
    color: #fff;
    transform: translateY(-2px);
}

.med-post__share-btn--wa:hover {
    background: #25d366;
    border-color: #25d366;
}

.med-post__share-btn--copy.is-copied {
    background: #ecfdf5;
    border-color: #6ee7b7;
    color: var(--med-primary-dark);
}

.med-post__copy-toast {
    position: absolute;
    top: 4px;
    right: 0;
    transform: translateY(-100%);
    font-size: 12px;
    font-weight: 700;
    color: var(--med-primary-dark);
    padding: 5px 10px;
    border-radius: 8px;
    background: #ecfdf5;
    border: 1px solid #99f6e4;
    white-space: nowrap;
    z-index: 2;
    pointer-events: none;
}

/* Layout: TOC + main */
.med-post__layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 24px;
    align-items: start;
}

@media (min-width: 900px) {
    .med-post__layout {
        grid-template-columns: 220px minmax(0, 1fr);
        gap: 28px;
    }
}

.med-post__toc {
    display: none;
}

@media (min-width: 900px) {
    .med-post__toc {
        display: block;
        position: sticky;
        top: 88px;
        background: var(--med-card);
        border: 1px solid var(--med-border);
        border-radius: 14px;
        padding: 16px 14px;
        box-shadow: 0 4px 16px rgba(15, 23, 42, 0.05);
    }
}

.med-post__toc-title {
    font-family: 'Poppins', sans-serif;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--med-muted);
    margin: 0 0 10px;
}

.med-post__toc nav {
    display: flex;
    flex-direction: column;
    gap: 4px;
    max-height: calc(100vh - 140px);
    overflow-y: auto;
}

.med-post__toc a {
    display: block;
    padding: 8px 10px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    color: #475569;
    text-decoration: none;
    line-height: 1.35;
    transition: background 0.15s, color 0.15s;
}

.med-post__toc a:hover,
.med-post__toc a.is-active {
    background: #f0fdfa;
    color: var(--med-primary-dark);
}

.med-post__main {
    min-width: 0;
}

.wp-post-video {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%;
    height: 0;
    margin: 0 0 20px;
    border-radius: 16px;
    overflow: hidden;
    background: #0f172a;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
}

.wp-post-video iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

/* Article body */
.med-post__body {
    background: var(--med-card);
    border-radius: 18px;
    padding: 28px 30px;
    border: 1px solid var(--med-border);
    box-shadow: 0 4px 20px rgba(15, 23, 42, 0.05);
}

.med-post__body h2 {
    font-size: clamp(1.15rem, 2.8vw, 1.35rem);
    margin: 32px 0 12px;
    padding: 0 0 10px;
    border-bottom: 2px solid #ecfdf5;
    scroll-margin-top: 96px;
}

.med-post__body h2:first-child {
    margin-top: 0;
}

.med-post__body h3 {
    font-size: 1.05rem;
    margin: 22px 0 8px;
}

.med-post__body p {
    margin: 0 0 14px;
    font-size: 16px;
    line-height: 1.75;
}

.med-post__body ul,
.med-post__body ol {
    margin: 0 0 16px;
    padding-left: 1.35rem;
}

.med-post__body li {
    margin-bottom: 8px;
    font-size: 16px;
    line-height: 1.65;
}

.med-post__body li::marker {
    color: var(--med-primary);
}

.med-post__body a {
    color: var(--med-primary-dark);
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.med-post__body a:hover {
    color: var(--med-primary);
}

.med-post__body img {
    max-width: 100%;
    height: auto;
    border-radius: 12px;
    margin: 16px 0;
    box-shadow: 0 4px 16px rgba(15, 23, 42, 0.08);
}

.med-post__body blockquote {
    margin: 18px 0;
    padding: 14px 18px;
    border-left: 4px solid var(--med-primary);
    background: #f8fafc;
    border-radius: 0 10px 10px 0;
    color: #475569;
    font-style: italic;
}

.med-post__body strong {
    color: var(--med-text);
}

/* FAQ */
.med-post__faq {
    margin-top: 28px;
    background: var(--med-card);
    border: 1px solid var(--med-border);
    border-radius: 18px;
    padding: 24px 26px;
    box-shadow: 0 4px 20px rgba(15, 23, 42, 0.05);
}

.med-post__faq-head {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    margin-bottom: 18px;
}

.med-post__faq-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: linear-gradient(135deg, #dbeafe, #ccfbf1);
    color: var(--med-primary-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
}

.med-post__faq-head h2 {
    margin: 0 0 4px;
    font-size: 1.25rem;
    border: none;
    padding: 0;
}

.med-post__faq-head p {
    margin: 0;
    font-size: 14px;
    color: var(--med-muted);
}

.med-post__faq-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.med-post__faq-item {
    border: 1px solid var(--med-border);
    border-radius: 12px;
    overflow: hidden;
    background: #fafafa;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.med-post__faq-item.is-open {
    border-color: #99f6e4;
    box-shadow: 0 4px 14px rgba(13, 148, 136, 0.1);
    background: #fff;
}

.med-post__faq-q {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 16px;
    border: none;
    background: none;
    cursor: pointer;
    text-align: left;
    font-family: 'Poppins', sans-serif;
    font-size: 15px;
    font-weight: 600;
    color: var(--med-text);
    line-height: 1.4;
    min-height: 48px;
}

.med-post__faq-q i {
    flex-shrink: 0;
    color: var(--med-primary);
    transition: transform 0.25s ease;
    font-size: 12px;
}

.med-post__faq-item.is-open .med-post__faq-q i {
    transform: rotate(180deg);
}

.med-post__faq-a {
    display: none;
    padding: 0 16px 16px;
    font-size: 15px;
    line-height: 1.7;
    color: #475569;
}

.med-post__faq-item.is-open .med-post__faq-a {
    display: block;
}

/* Disclaimer + CTA */
.med-post__disclaimer {
    display: flex;
    gap: 12px;
    margin-top: 24px;
    padding: 16px 18px;
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-radius: 14px;
    color: #92400e;
    font-size: 14px;
    line-height: 1.65;
}

.med-post__disclaimer i {
    margin-top: 2px;
    flex-shrink: 0;
}

.med-post__disclaimer p {
    margin: 0;
}

.med-post__cta {
    margin-top: 24px;
    padding: 22px 24px;
    border-radius: 16px;
    background: linear-gradient(135deg, #0d9488 0%, #0f766e 50%, #115e59 100%);
    color: #fff;
    text-align: center;
}

.med-post__cta h2 {
    color: #fff;
    font-size: 1.2rem;
    margin: 0 0 8px;
    border: none;
    padding: 0;
}

.med-post__cta p {
    margin: 0 0 16px;
    opacity: 0.92;
    font-size: 15px;
}

.med-post__cta-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
}

.med-post__cta-links a {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 11px 18px;
    min-height: 44px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.35);
    color: #fff;
    font-weight: 700;
    font-size: 14px;
    text-decoration: none;
    transition: background 0.2s, transform 0.15s;
}

.med-post__cta-links a:hover {
    background: #fff;
    color: var(--med-primary-dark);
    transform: translateY(-2px);
}

/* Related articles */
.med-post__related {
    margin: 28px 0 0;
    padding: 24px;
    border-radius: 16px;
    background: var(--med-card);
    border: 1px solid var(--med-border);
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.05);
}

.med-post__related-head h2 {
    margin: 0 0 6px;
    font-size: 1.25rem;
}

.med-post__related-head p {
    margin: 0 0 18px;
    font-size: 14px;
    color: var(--med-muted);
}

.med-post__related-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.med-post__related-card {
    display: flex;
    flex-direction: column;
    border: 1px solid var(--med-border);
    border-radius: 12px;
    overflow: hidden;
    background: #fafbfc;
    transition: border-color 0.2s, box-shadow 0.2s, transform 0.15s;
}

.med-post__related-card:hover {
    border-color: #99f6e4;
    box-shadow: 0 8px 20px rgba(13, 148, 136, 0.12);
    transform: translateY(-2px);
}

.med-post__related-media {
    display: block;
    aspect-ratio: 16 / 9;
    background: linear-gradient(135deg, #ccfbf1, #bae6fd);
    overflow: hidden;
}

.med-post__related-media img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.med-post__related-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    min-height: 90px;
    color: var(--med-primary-dark);
    font-size: 28px;
}

.med-post__related-body {
    display: flex;
    flex-direction: column;
    flex: 1;
    padding: 14px;
    gap: 8px;
}

.med-post__related-title {
    margin: 0;
    font-size: 15px;
    line-height: 1.35;
}

.med-post__related-title a {
    color: var(--med-text);
    text-decoration: none;
}

.med-post__related-title a:hover {
    color: var(--med-primary-dark);
}

.med-post__related-excerpt {
    margin: 0;
    font-size: 13px;
    line-height: 1.5;
    color: var(--med-muted);
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.med-post__related-link {
    margin-top: auto;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 700;
    color: var(--med-primary);
    text-decoration: none;
}

.med-post__related-link:hover {
    color: var(--med-primary-dark);
    text-decoration: underline;
}

.med-post__footer-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: space-between;
    align-items: center;
    margin-top: 24px;
}

.med-post__back {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    min-height: 44px;
    border-radius: 10px;
    background: var(--med-card);
    border: 1px solid var(--med-border);
    color: var(--med-primary-dark);
    font-weight: 700;
    font-size: 14px;
    text-decoration: none;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
    transition: background 0.2s, border-color 0.2s, transform 0.15s;
}

.med-post__back:hover {
    background: #f0fdfa;
    border-color: #99f6e4;
    transform: translateX(-2px);
}

/* Mobile TOC toggle */
.med-post__toc-mobile {
    display: block;
    margin-bottom: 16px;
}

@media (min-width: 900px) {
    .med-post__toc-mobile {
        display: none;
    }
}

.med-post__toc-mobile summary {
    list-style: none;
    cursor: pointer;
    padding: 12px 16px;
    border-radius: 12px;
    background: var(--med-card);
    border: 1px solid var(--med-border);
    font-weight: 700;
    font-size: 14px;
    color: var(--med-primary-dark);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.med-post__toc-mobile summary::-webkit-details-marker {
    display: none;
}

.med-post__toc-mobile nav {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-top: 10px;
    padding: 12px;
    background: var(--med-card);
    border: 1px solid var(--med-border);
    border-radius: 12px;
}

.med-post__toc-mobile a {
    padding: 10px 12px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    color: #475569;
    text-decoration: none;
}

.med-post__toc-mobile a:hover {
    background: #f0fdfa;
    color: var(--med-primary-dark);
}

@media (max-width: 640px) {
    .med-post__hero-body {
        padding: 18px 16px 20px;
    }

    .med-post__body {
        padding: 20px 16px;
    }

    .med-post__faq {
        padding: 18px 16px;
    }

    .med-post__share {
        flex-wrap: nowrap;
        gap: 6px;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        padding-bottom: 2px;
    }

    .med-post__share::-webkit-scrollbar {
        display: none;
    }

    .med-post__share-actions {
        flex-wrap: nowrap;
        gap: 6px;
        flex: 1 1 auto;
    }

    .med-post__share-label {
        flex-shrink: 0;
        font-size: 12px;
        margin-right: 0;
    }

    .med-post__share-btn {
        flex-shrink: 0;
        width: 34px;
        height: 34px;
        min-width: 34px;
        border-radius: 8px;
        font-size: 14px;
    }

    .med-post__cta-links {
        flex-direction: column;
    }

    .med-post__cta-links a {
        width: 100%;
        justify-content: center;
    }

    .med-post__related {
        padding: 18px 16px;
    }

    .med-post__related-grid {
        grid-template-columns: 1fr;
    }

    .med-post__footer-nav {
        flex-direction: column;
        align-items: stretch;
    }

    .med-post__back {
        justify-content: center;
    }
}

@media (min-width: 641px) and (max-width: 899px) {
    .med-post__related-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (prefers-reduced-motion: reduce) {
    .med-post__share-btn,
    .med-post__cta-links a,
    .med-post__back,
    .med-post__related-card,
    .med-post__faq-q i {
        transition: none;
    }
}
