/* article.css - Premium Apple-Style Blog Post */

@import url('/static/css/apple.css');

:root {
    --text-primary: #1d1d1f;
    --text-secondary: #86868b;
    --accent-color: #0071E3;
    --bg-color: #ffffff;
    --code-bg: #f5f5f7;
    --font-heading: "SF Pro Display", -apple-system, BlinkMacSystemFont, sans-serif;
    --font-body: "SF Pro Text", -apple-system, BlinkMacSystemFont, sans-serif;
}

/* 1. HERO SECTION */
.article-hero {
    position: relative;
    width: 100%;
    height: 60vh;
    min-height: 500px;
    max-height: 800px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: white;
    overflow: hidden;
    background-color: #000;
}

.article-hero__bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 1;
    opacity: 0.9;
    filter: brightness(0.85);
    /* Slightly darker for better text contrast */
}

.article-hero__overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0.6) 100%);
    z-index: 2;
}

.article-hero__content {
    position: relative;
    z-index: 3;
    max-width: 900px;
    padding: 0 20px;
    margin-top: 60px;
    /* Offset for header */
}

.article-hero__title {
    font-family: var(--font-heading);
    font-size: clamp(32px, 5vw, 64px);
    font-weight: 600;
    line-height: 1.08;
    letter-spacing: -0.01em;
    margin-bottom: 28px;
    text-shadow: 0 4px 30px rgba(0, 0, 0, 0.3);
}

.article-meta {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    flex-wrap: wrap;
}

.article-meta__tag {
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    padding: 6px 16px;
    border-radius: 99px;
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: white;
}

.article-meta__info {
    font-size: 15px;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 500;
}

/* 2. CONTENT CONTAINER */
.article-container {
    max-width: 740px;
    /* Optimal reading width for premium feel */
    margin: 0 auto;
    padding: 80px 24px;
    background-color: var(--bg-color);
}

/* 3. TYPOGRAPHY */
.article-body {
    font-family: var(--font-body);
    font-size: 19px;
    line-height: 1.65;
    color: var(--text-primary);
    letter-spacing: -0.003em;
}

.article-body p {
    margin-bottom: 28px;
}

/* Headings */
.article-body h2 {
    font-family: var(--font-heading);
    font-size: 34px;
    font-weight: 600;
    margin-top: 64px;
    margin-bottom: 20px;
    letter-spacing: -0.015em;
    color: #000;
}

.article-body h3 {
    font-family: var(--font-heading);
    font-size: 26px;
    font-weight: 600;
    margin-top: 48px;
    margin-bottom: 16px;
    color: #000;
}

.article-body h4 {
    font-size: 21px;
    font-weight: 600;
    margin-top: 36px;
    margin-bottom: 12px;
}

/* Lists */
.article-body ul,
.article-body ol {
    margin-bottom: 32px;
    padding-left: 0;
    list-style-position: inside;
}

.article-body li {
    margin-bottom: 12px;
    padding-left: 28px;
    position: relative;
    list-style: none;
}

.article-body ul li::before {
    content: "✓";
    /* Checkmark style */
    color: var(--accent-color);
    font-weight: 900;
    position: absolute;
    left: 0;
    top: 0;
}

.article-body ol li {
    counter-increment: list-counter;
}

.article-body ol {
    counter-reset: list-counter;
}

.article-body ol li::before {
    content: counter(list-counter) ".";
    color: var(--accent-color);
    font-weight: 600;
    position: absolute;
    left: 0;
}

/* Blockquotes & Callouts */
.article-quote,
.article-callout {
    background: var(--code-bg);
    border-left: 4px solid var(--accent-color);
    padding: 32px;
    margin: 48px 0;
    border-radius: 0 20px 20px 0;
    font-size: 20px;
    font-style: normal;
    color: #1d1d1f;
}

.article-callout {
    border-color: #34C759;
    /* Green for tips */
}

/* Images */
.article-figure {
    margin: 56px -40px;
    /* Breakout of container slightly on large screens */
}

@media (max-width: 820px) {
    .article-figure {
        margin: 40px 0;
    }
}

.article-figure img {
    width: 100%;
    height: auto;
    border-radius: 20px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.08);
}

.img-caption {
    text-align: center;
    font-size: 14px;
    color: var(--text-secondary);
    margin-top: 16px;
    font-weight: 500;
}

/* Tables */
.table-wrapper {
    overflow-x: auto;
    margin: 48px 0;
    border-radius: 20px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.04);
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.article-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    font-size: 16px;
}

.article-table th {
    background: #fbfbfd;
    text-align: left;
    padding: 18px 24px;
    font-weight: 600;
    border-bottom: 1px solid #eee;
    color: #1d1d1f;
}

.article-table td {
    padding: 18px 24px;
    border-bottom: 1px solid #f5f5f7;
    color: #333;
}

.article-table tr:last-child td {
    border-bottom: none;
}

/* 4. SHARE & NAV */
.article-pre-footer {
    max-width: 740px;
    margin: 0 auto;
    padding: 60px 24px 100px;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
}

.share-block {
    text-align: center;
    margin-bottom: 80px;
}

.share-title {
    font-size: 14px;
    text-transform: uppercase;
    color: var(--text-secondary);
    letter-spacing: 1px;
    font-weight: 600;
    margin-bottom: 24px;
}

.share-icons {
    display: flex;
    justify-content: center;
    gap: 20px;
}

.share-btn {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: #f5f5f7;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
    color: #333;
    text-decoration: none;
}

.share-btn:hover {
    background: var(--accent-color);
    color: white;
    transform: translateY(-4px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.15);
}

.nav-links {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

.nav-card {
    padding: 32px;
    background: #fbfbfd;
    border-radius: 24px;
    text-decoration: none;
    color: inherit;
    transition: all 0.3s ease;
    border: 1px solid rgba(0, 0, 0, 0.03);
    display: flex;
    flex-direction: column;
}

.nav-card:hover {
    background: white;
    box-shadow: 0 16px 32px rgba(0, 0, 0, 0.06);
    transform: translateY(-2px);
}

.nav-label {
    font-size: 12px;
    color: var(--accent-color);
    text-transform: uppercase;
    font-weight: 600;
    margin-bottom: 12px;
    display: block;
    letter-spacing: 0.5px;
}

.nav-title {
    font-size: 18px;
    font-weight: 600;
    line-height: 1.4;
    color: #1d1d1f;
}

/* Mobile */
@media (max-width: 768px) {
    .article-hero {
        height: 50vh;
        min-height: 400px;
    }

    .article-body {
        font-size: 17px;
    }

    .article-container {
        padding: 40px 20px;
    }

    .article-figure {
        margin: 32px 0;
    }

    .nav-links {
        grid-template-columns: 1fr;
    }

    .article-body h2 {
        font-size: 28px;
        margin-top: 48px;
    }
}

/* 5. FAQ & RELATED */
details {
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 20px;
    background: #fbfbfd;
    transition: all 0.3s ease;
}

details[open] {
    background: white;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.06);
    border-color: transparent;
}

summary {
    font-weight: 600;
    cursor: pointer;
    list-style: none;
    font-size: 19px;
    position: relative;
    padding-right: 36px;
    color: var(--text-primary);
    line-height: 1.4;
}

summary::-webkit-details-marker {
    display: none;
}

summary::after {
    content: '+';
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    font-size: 24px;
    font-weight: 300;
    color: var(--accent-color);
    transition: transform 0.2s cubic-bezier(0.2, 0.8, 0.2, 1);
}

details[open] summary::after {
    transform: translateY(-50%) rotate(45deg);
    opacity: 0.5;
}

details p {
    margin: 16px 0 0 0 !important;
    font-size: 17px;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* Related Articles Grid */
.related-section {
    margin-top: 100px;
    border-top: 1px solid rgba(0, 0, 0, 0.08);
    padding-top: 60px;
}

.related-title {
    font-size: 32px;
    font-weight: 600;
    margin-bottom: 40px;
    font-family: var(--font-heading);
    color: #1d1d1f;
}

.related-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 32px;
}

.related-card {
    text-decoration: none;
    color: inherit;
    transition: all 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
    display: flex;
    flex-direction: column;
    background: transparent;
}

.related-card:hover {
    transform: translateY(-8px);
}

.related-card img {
    width: 100%;
    aspect-ratio: 16/10;
    object-fit: cover;
    border-radius: 16px;
    margin-bottom: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    transition: box-shadow 0.3s ease;
}

.related-card:hover img {
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.12);
}

.related-card span {
    font-weight: 600;
    font-size: 19px;
    line-height: 1.35;
    color: var(--text-primary);
    letter-spacing: 0.01em;
}