/* Article Page Specific Styles */

/* Layout */
.article-container {
    padding-top: 120px;
    /* Space for fixed header */
    padding-bottom: 64px;
    display: grid;
    grid-template-columns: 1fr;
    gap: 48px;
}

@media (min-width: 900px) {
    .article-container {
        grid-template-columns: minmax(0, 1fr) 320px;
        gap: 64px;
        align-items: start;
    }
}

/* Article Content */
.article-content {
    min-width: 0;
    /* Prevent grid blowout */
}

.article-header {
    margin-bottom: 40px;
}

.article-title {
    font-size: 36px;
    font-weight: 700;
    line-height: 1.2;
    color: var(--off-black);
    margin-bottom: 12px;
    letter-spacing: -1.2px;
}

@media (min-width: 768px) {
    .article-title {
        font-size: 48px;
    }
}

.article-meta {
    margin-bottom: 24px;
}

.read-time {
    font-size: 15px;
    color: var(--gray-text);
}

.author-image {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
}

.meta-text {
    display: flex;
    flex-direction: column;
}

.author-name {
    font-weight: 600;
    font-size: 15px;
    color: var(--off-black);
}

.publish-date {
    font-size: 14px;
    color: var(--gray-small-text);
}

/* Table of Contents - Horizontal Layout */
.table-of-contents {
    margin-bottom: 24px;
}

.toc-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0;
}

.toc-list li {
    display: flex;
    align-items: center;
}

.toc-list li:not(:last-child)::after {
    content: "|";
    color: var(--dark-green);
    opacity: 0.5;
    margin: 0 12px;
    font-weight: 300;
}

@media (min-width: 768px) {
    .toc-list li:not(:last-child)::after {
        margin: 0 15px;
    }
}

.toc-list a {
    color: var(--dark-green);
    font-weight: 600;
    text-decoration: none;
    font-size: 15px;
    transition: opacity 0.2s;
    white-space: nowrap;
    padding: 8px 0;
}

.toc-list a:hover {
    opacity: 0.7;
    text-decoration: underline;
}

/* Hero Image under TOC */
.toc-hero-image {
    width: 100%;
    height: auto;
    aspect-ratio: 750 / 420;
    object-fit: cover;
    border-radius: 16px;
    margin-bottom: 40px;
    background-color: var(--white);
}

/* Typography for Body Content */
.article-body h2 {
    font-size: 28px;
    font-weight: 700;
    color: var(--off-black);
    margin-top: 48px;
    margin-bottom: 16px;
    letter-spacing: -0.5px;
}

.article-body p {
    font-size: 18px;
    line-height: 1.7;
    color: var(--gray-text);
    margin-bottom: 24px;
}

.article-body ul {
    list-style: disc;
    padding-left: 24px;
    margin-bottom: 24px;
}

.article-body h3 {
    font-size: 24px;
    font-weight: 700;
    color: var(--off-black);
    margin-top: 40px;
    margin-bottom: 16px;
    letter-spacing: -0.5px;
}

.article-body img {
    border-radius: 8px;
    width: 100%;
    height: auto;
    margin-bottom: 32px;
}

.article-body li {
    font-size: 18px;
    line-height: 1.7;
    color: var(--gray-text);
    margin-bottom: 16px;
    /* Increased from 12px */
}

/* Sidebar */
.article-sidebar {
    display: none;
}

@media (min-width: 900px) {
    .article-sidebar {
        display: block;
        position: sticky;
        top: 100px;
        /* Offset for fixed header */
        height: auto;
    }
}

/* Sidebar Hero Widget */
.sidebar-hero-widget {
    background: #f3f3f3;
    border: 1px solid rgba(0, 0, 0, 0.3);
    border-radius: 40px;
    padding: 48px 24px 0;
    text-align: center;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    height: 700px;
}

.sidebar-hero-title {
    font-size: 34px;
    font-weight: 700;
    line-height: 1.15;
    color: var(--off-black);
    margin-bottom: 16px;
    letter-spacing: -1.5px;
}

.sidebar-hero-subtitle {
    font-size: 17px;
    color: var(--gray-text);
    line-height: 1.6;
    max-width: 250px;
    font-weight: 500;
    letter-spacing: -0.01em;
    z-index: 1;
}

.sidebar-hero-image-wrapper {
    width: 155%;
    flex: 1;
    display: flex;
    justify-content: center;
    position: relative;
    margin-left: -20%;
    margin-top: -20%;
    /* Center the 140% width */
}

.sidebar-hero-image {
    width: 100%;
    height: auto;
    object-fit: cover;
    object-position: top center;
}

.sidebar-hero-buttons {
    position: absolute;
    bottom: 32px;
    left: 0;
    width: 100%;
    display: flex;
    gap: 12px;
    justify-content: center;
    z-index: 10;
    padding: 0 24px;
}

.store-button {
    flex: 1;
    max-width: 135px;
    transition: transform 0.2s, opacity 0.2s;
    display: block;
}

.store-button img {
    width: 100%;
    height: 40px;
    object-fit: contain;
}

.store-button:hover {
    transform: translateY(-2px);
    opacity: 0.9;
}

/* Read Next Section Details (Bottom of Page & Directory) */
.read-next-section {
    margin-top: 64px;
    margin-bottom: 64px;
    border-top: 1px solid var(--gray-border);
    padding-top: 48px;
}

.read-next-header {
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--off-black);
    margin-bottom: 32px;
    letter-spacing: 0.5px;
}

.article-list {
    display: flex;
    flex-direction: column;
    gap: 48px;
}

.article-card-horizontal {
    display: flex;
    flex-direction: column;
    gap: 24px;
    text-decoration: none;
    border-bottom: 1px solid #f0f0f0;
    padding-bottom: 48px;
}

.article-card-horizontal:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

@media (min-width: 600px) {
    .article-card-horizontal {
        flex-direction: row;
        align-items: start;
        gap: 32px;
    }
}

.article-card-img {
    width: 100%;
    aspect-ratio: 16/9;
    object-fit: cover;
    border-radius: 8px;
    flex-shrink: 0;
}

@media (min-width: 600px) {
    .article-card-img {
        width: 240px;
        height: 160px;
        /* Fixed height for consistency */
    }
}

/* Override generic article body image styles for article cards */
.article-body .article-card-img {
    width: 100%;
    margin-bottom: 0;
    height: auto;
}

@media (min-width: 600px) {
    .article-body .article-card-img {
        width: 240px;
        height: 160px;
    }
}

/* Reset article body overrides for card content */
.article-body .article-card-title {
    margin-top: 0;
    margin-bottom: 0;
}

.article-body .article-card-description {
    margin-bottom: 0;
}

.article-card-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.article-card-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--off-black);
    line-height: 1.3;
    transition: color 0.2s;
    margin: 0;
}

.article-card-horizontal:hover .article-card-title {
    color: var(--dark-green);
}

.article-card-description {
    font-size: 16px;
    color: var(--gray-text);
    line-height: 1.6;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.read-more-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 700;
    color: var(--dark-green);
    /* CadetBlue-ish to specific similar color */
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 8px;
}

.read-more-link svg {
    width: 16px;
    height: 16px;
    transition: transform 0.2s;
}

.article-card-horizontal:hover .read-more-link svg {
    transform: translateX(4px);
}

/* Mobile/Tablet Article Ad */
.mobile-article-ad {
    display: block;
    /* Visible by default (mobile/tablet) */
    background: #f3f3f3;
    border: 1px solid rgba(0, 0, 0, 0.3);
    border-radius: 40px;
    padding: 48px 24px 0;
    /* Padding top and sides */
    margin: 48px 0;
    text-align: center;
    overflow: hidden;
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 32px;
    align-items: center;
    max-height: 640px;
    /* No fixed height, naturally shorter than 700px desktop version */
}

@media (min-width: 900px) {
    .mobile-article-ad {
        display: none;
        /* Hide on desktop where sidebar appears */
    }
}

.mobile-ad-content {
    flex: 0 0 auto;
    z-index: 2;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.mobile-ad-title {
    font-size: 34px;
    /* Match desktop sidebar */
    font-weight: 700;
    /* Match desktop sidebar */
    line-height: 1.15;
    /* Match desktop sidebar */
    color: var(--off-black);
    margin-bottom: 16px;
    /* Match desktop sidebar (was 12px) */
    letter-spacing: -1.5px;
    /* Match desktop sidebar */
}

.mobile-ad-subtitle {
    font-size: 17px;
    /* Match desktop sidebar */
    color: var(--gray-text);
    line-height: 1.6;
    /* Match desktop sidebar */
    margin-bottom: 24px;
    font-weight: 500;
    /* Match desktop sidebar */
    letter-spacing: -0.01em;
    /* Match desktop sidebar */
    max-width: 100%;
    /* Match desktop sidebar max-width */
}

.mobile-ad-buttons {
    display: flex;
    gap: 16px;
    justify-content: center;
    width: 100%;
}

.mobile-ad-buttons .store-button {
    max-width: none;
    flex: 0 1 auto;
    /* Allow shrinking */
    min-width: 0;
    /* Enable shrinking past content size if needed */
}

.mobile-ad-buttons .store-button img {
    height: auto;
    width: 100%;
    max-height: 55px;
    /* Base height */
    object-fit: contain;
}

.mobile-ad-image-wrapper {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: flex-end;
    /* Align to bottom */
    width: 175%;
    max-width: 600px;
    position: relative;
    margin-top: -150px;
    margin-right: 180px;
    margin-left: 5%;
}

.mobile-ad-image {
    width: 100%;
    /* Ensure this remains "same" (large) as per previous context */
    max-width: none;
    height: auto;
    object-fit: contain;
    margin: 0;
    transform: translateX(5%);
}
/* ===== Article components (key takeaways, figures, tables, FAQ, sources) ===== */
.article-body a:not(.store-button):not(.article-card-horizontal) {
    color: var(--dark-green);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.key-takeaways {
    background: var(--light-green);
    border-radius: 12px;
    padding: 24px 28px;
    margin-bottom: 40px;
}

.article-body .key-takeaways h2 {
    font-size: 20px;
    margin-top: 0;
    margin-bottom: 12px;
}

.article-body .key-takeaways ul {
    margin-bottom: 0;
}

.article-body .key-takeaways li {
    font-size: 17px;
    margin-bottom: 8px;
    color: var(--off-black);
}

.app-figure {
    margin: 32px 0 40px;
    background: #f8f8f8;
    border-radius: 16px;
    padding: 24px 24px 16px;
    text-align: center;
}

.article-body .app-figure img {
    max-width: 360px;
    margin: 0 auto 12px;
    display: block;
}

.app-figure figcaption {
    font-size: 15px;
    line-height: 1.5;
    color: var(--gray-small-text);
}

.table-wrapper {
    overflow-x: auto;
    margin-bottom: 32px;
    -webkit-overflow-scrolling: touch;
}

.article-body table {
    width: 100%;
    border-collapse: collapse;
    font-size: 16px;
    line-height: 1.5;
    color: var(--gray-text);
    min-width: 480px;
}

.article-body th,
.article-body td {
    text-align: left;
    padding: 12px 14px;
    border-bottom: 1px solid var(--gray-border);
    vertical-align: top;
}

.article-body th {
    color: var(--off-black);
    font-weight: 700;
    background: #f8f8f8;
}

.article-body ol {
    padding-left: 24px;
    margin-bottom: 24px;
}

.article-body ol li {
    padding-left: 4px;
}

.faq-item {
    border-bottom: 1px solid var(--gray-border);
    padding: 4px 0 8px;
}

.article-body .faq-item h3 {
    font-size: 20px;
    margin-top: 24px;
    margin-bottom: 8px;
}

.sources-list {
    font-size: 15px;
}

.article-body .sources-list li {
    font-size: 15px;
    line-height: 1.6;
    margin-bottom: 8px;
}

.article-body .medical-note {
    font-size: 15px;
    color: var(--gray-small-text);
    border-top: 1px solid var(--gray-border);
    padding-top: 16px;
    margin-top: 32px;
}

.disclosure-note {
    font-size: 15px;
    line-height: 1.6;
    color: var(--gray-text);
    background: #f8f8f8;
    border-left: 3px solid var(--dark-green);
    border-radius: 8px;
    padding: 14px 18px;
    margin-bottom: 24px;
}

.article-body .app-figure img.app-screen {
    border-radius: 28px;
    border: 1px solid var(--gray-border);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.06);
}
