/* ==========================================================================
   BLOG POST — Premium Article Layout
   ========================================================================== */

/* ==========================================================================
   ARTICLE HERO — immersive full-bleed, single source of truth for title
   ========================================================================== */
.article-hero {
    position: relative;
    width: 100%;
    min-height: 62vh;
    display: flex;
    align-items: flex-end;
    overflow: hidden;
    isolation: isolate;
}

/* Featured image as background (via inline CSS var) */
.article-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: -2;
    background-image: var(--hero-bg);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

/* Dark gradient overlay — readability */
.article-hero__overlay {
    position: absolute;
    inset: 0;
    z-index: -1;
    background:
        linear-gradient(180deg,
            rgba(0, 25, 55, 0.85) 0%,
            rgba(0, 25, 55, 0.78) 25%,
            rgba(0, 25, 55, 0.82) 50%,
            rgba(0, 22, 48, 0.90) 75%,
            rgba(0, 15, 38, 0.98) 100%);
}

/* Subtle tech grid texture for depth */
.article-hero__grid {
    position: absolute;
    inset: 0;
    z-index: -1;
    background-image:
        linear-gradient(rgba(255,255,255,0.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.04) 1px, transparent 1px);
    background-size: 48px 48px;
    mask-image: radial-gradient(ellipse at center, black 30%, transparent 75%);
    -webkit-mask-image: radial-gradient(ellipse at center, black 30%, transparent 75%);
}

.article-hero__content {
    position: relative;
    z-index: 2;
    padding: 8rem 2rem 5rem;
    width: 100%;
    max-width: var(--container-width);
    margin: 0 auto;
    color: #fff;
}

/* Meta row — category · date · author */
.article-hero__meta {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-bottom: 1.75rem;
    font-size: 0.82rem;
}

.article-hero__cat {
    padding: 0.35rem 1rem;
    background: rgba(174, 218, 31, 0.15);
    border: 1px solid rgba(174, 218, 31, 0.4);
    border-radius: 999px;
    font-family: var(--font-heading);
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--color-accent);
    font-size: 0.7rem;
}

.article-hero__dot {
    color: rgba(255, 255, 255, 0.35);
    font-size: 1rem;
    line-height: 1;
}

.article-hero__date,
.article-hero__author {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    color: rgba(255, 255, 255, 0.72);
    font-weight: 500;
}

.article-hero__date svg {
    width: 15px; height: 15px;
    opacity: 0.55;
}

.article-hero__avatar {
    width: 26px; height: 26px;
    border-radius: 50%;
    background: var(--color-primary);
    border: 1.5px solid rgba(174, 218, 31, 0.5);
    color: var(--color-accent);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 0.7rem;
}

/* H1 — single source of truth, large editorial */
.article-hero__title {
    font-family: var(--font-heading);
    font-size: clamp(2.2rem, 4.8vw, 4rem);
    font-weight: 800;
    line-height: 1.08;
    letter-spacing: -0.025em;
    color: #fff;
    max-width: 900px;
    margin-bottom: 1.25rem;
    text-shadow: 0 4px 28px rgba(0, 0, 0, 0.35);
}

/* Excerpt */
.article-hero__excerpt {
    max-width: 680px;
    font-size: 1.08rem;
    line-height: 1.75;
    color: rgba(255, 255, 255, 0.78);
    margin: 0 0 1.75rem 0;
}

/* Breadcrumb */
.article-hero__crumbs {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    font-size: 0.78rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.5);
    letter-spacing: 0.02em;
}

.article-hero__crumbs a {
    color: rgba(255, 255, 255, 0.6);
    text-decoration: none;
    transition: color 0.2s ease;
}

.article-hero__crumbs a:hover {
    color: var(--color-accent);
}

.article-hero__crumbs > span[aria-hidden] {
    opacity: 0.4;
}

.article-hero__crumbs-current {
    color: rgba(255, 255, 255, 0.85);
}

/* Back link — top-left of hero, floats above content */
.article-hero__back {
    position: absolute;
    top: 2rem;
    left: 2rem;
    z-index: 5;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.55rem 1.1rem;
    font-family: var(--font-heading);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    background: rgba(0, 31, 71, 0.35);
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 999px;
    backdrop-filter: blur(8px);
    transition: all 0.3s ease;
}

.article-hero__back svg {
    width: 14px; height: 14px;
    transition: transform 0.3s ease;
}

.article-hero__back:hover {
    color: var(--color-accent);
    border-color: rgba(174, 218, 31, 0.5);
    background: rgba(174, 218, 31, 0.1);
}

.article-hero__back:hover svg {
    transform: translateX(-3px);
}

/* ==========================================================================
   POST SECTION — below hero
   ========================================================================== */
.post-section {
    padding: 4rem 0 5rem;
    background: var(--color-bg-light);
}

/* ---- Layout ---- */
.post-layout {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 3.5rem;
}

/* ---- Article body ---- */
.post-body {
    font-size: 1.05rem;
    line-height: 1.85;
    color: var(--color-text-dark);
}

.post-body p {
    margin-bottom: 1.4rem;
}

.post-body h2 {
    font-family: var(--font-heading);
    font-size: 1.45rem;
    font-weight: 700;
    color: var(--color-primary);
    margin: 2.75rem 0 1.25rem;
    padding-left: 1rem;
    border-left: 4px solid var(--color-accent);
    letter-spacing: 0.02em;
}

.post-body h3 {
    font-family: var(--font-heading);
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--color-primary);
    margin: 2rem 0 1rem;
}

.post-body ul,
.post-body ol {
    margin-left: 1.5rem;
    margin-bottom: 1.4rem;
}

.post-body li {
    margin-bottom: 0.45rem;
}

.post-body blockquote {
    border-left: 4px solid var(--color-accent);
    padding: 1.5rem 2rem;
    background: #fff;
    border-radius: 0 10px 10px 0;
    margin: 2.25rem 0;
    font-style: italic;
    font-size: 1.08rem;
    color: var(--color-text-muted);
    box-shadow: 0 2px 8px rgba(0,31,71,0.05);
}

.post-body img {
    max-width: 100%;
    border-radius: 10px;
    margin: 1.5rem 0;
}

/* ---- Tags ---- */
.post-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid var(--color-border);
}

.post-tag-link {
    padding: 0.4rem 0.85rem;
    background: #fff;
    color: var(--color-text-dark);
    font-size: 0.8rem;
    font-weight: 600;
    border-radius: 6px;
    border: 1px solid var(--color-border);
    text-decoration: none;
    transition: all 0.2s ease;
}

.post-tag-link:hover {
    background: var(--color-primary);
    color: var(--color-accent);
    border-color: var(--color-primary);
}

/* ---- Share ---- */
.share-bar {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-top: 1.75rem;
    padding-top: 1.75rem;
    border-top: 1px solid var(--color-border);
}

.share-label {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.share-btn {
    width: 42px; height: 42px;
    border-radius: 10px;
    background: #fff;
    border: 1px solid var(--color-border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--color-text-muted);
    text-decoration: none;
    transition: all 0.2s ease;
}

.share-btn:hover {
    background: var(--color-primary);
    color: var(--color-accent);
    border-color: var(--color-primary);
    transform: translateY(-2px);
}

/* ---- Sidebar ---- */
.post-sidebar {
    position: sticky;
    top: 150px;
    height: fit-content;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.sidebar-block {
    background: #fff;
    border-radius: 12px;
    padding: 1.65rem;
    box-shadow: 0 1px 4px rgba(0,31,71,0.05);
    border: 1px solid var(--color-border);
}

.sidebar-block-title {
    font-family: var(--font-heading);
    font-size: 1rem;
    font-weight: 700;
    color: var(--color-primary);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

.sidebar-block-title::before {
    content: '';
    width: 4px; height: 18px;
    background: var(--color-accent);
    border-radius: 2px;
}

/* Recent posts in sidebar */
.sb-recent-list {
    list-style: none;
    padding: 0; margin: 0;
}

.sb-recent-item {
    display: flex;
    gap: 0.85rem;
    padding: 0.7rem 0;
    border-bottom: 1px solid var(--color-border);
    cursor: pointer;
    transition: opacity 0.2s ease;
}

.sb-recent-item:last-child { border-bottom: none; }

.sb-recent-item:hover { opacity: 0.75; }

.sb-recent-thumb {
    width: 56px; height: 56px;
    border-radius: 6px;
    object-fit: cover;
    flex-shrink: 0;
}

.sb-recent-info {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.sb-recent-info-title {
    font-size: 0.84rem;
    font-weight: 600;
    color: var(--color-primary);
    margin-bottom: 0.2rem;
    line-height: 1.25;
}

.sb-recent-info-date {
    font-size: 0.75rem;
    color: var(--color-text-muted);
}

/* ---- Newsletter form ---- */
.nl-form {
    display: flex;
    flex-direction: column;
    gap: 0.7rem;
}

.nl-form input {
    padding: 0.7rem 1rem;
    border: 1.5px solid var(--color-border);
    border-radius: 8px;
    font-size: 0.88rem;
    font-family: var(--font-body);
    transition: border-color 0.2s ease;
    background: var(--color-bg-light);
}

.nl-form input:focus {
    outline: none;
    border-color: var(--color-accent);
    background: #fff;
}

.nl-form .btn-submit {
    padding: 0.7rem 1rem;
    background: var(--color-primary);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-family: var(--font-heading);
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    cursor: pointer;
    transition: background 0.2s ease;
}

.nl-form .btn-submit:hover {
    background: var(--color-accent-hover);
}

.nl-form .nl-note {
    font-size: 0.78rem;
    color: var(--color-text-muted);
    margin: 0;
}

/* ---- Related posts ---- */
.related-section {
    margin-top: 4rem;
    padding-top: 3rem;
    border-top: 1px solid var(--color-border);
}

.related-heading {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--color-primary);
    margin-bottom: 2rem;
    display: flex;
    align-items: center;
    gap: 0.7rem;
}

.related-heading::before {
    content: '';
    width: 4px; height: 24px;
    background: var(--color-accent);
    border-radius: 2px;
}

.related-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}

.related-card {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,31,71,0.07);
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.related-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 36px rgba(0,31,71,0.13);
}

.related-card-img {
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: contain;
    background: #f5f7f3;
    padding: 0.5rem;
    transition: transform 0.5s ease;
}

.related-card:hover .related-card-img {
    transform: scale(1.03);
}

.related-card-body {
    padding: 1.25rem;
}

.related-card-cat {
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--color-accent-hover);
    margin-bottom: 0.45rem;
}

.related-card-title {
    font-family: var(--font-heading);
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--color-primary);
    line-height: 1.25;
    margin-bottom: 0.4rem;
}

.related-card-date {
    font-size: 0.8rem;
    color: var(--color-text-muted);
}

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */
@media (max-width: 1024px) {
    .article-hero {
        min-height: 52vh;
    }
    .article-hero__content {
        padding: 7rem 2rem 4rem;
    }
    .article-hero__title {
        font-size: clamp(2rem, 4vw, 3.2rem);
    }
    .post-layout {
        grid-template-columns: 1fr;
    }
    .post-sidebar {
        position: static;
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }
    .related-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .article-hero {
        min-height: auto;
    }
    .article-hero__content {
        padding: 6rem 1.25rem 3rem;
    }
    .article-hero__back {
        top: 1rem;
        left: 1rem;
        padding: 0.45rem 0.9rem;
        font-size: 0.68rem;
    }
    .article-hero__meta {
        gap: 0.5rem;
        font-size: 0.75rem;
        margin-bottom: 1.25rem;
    }
    .article-hero__dot { display: none; }
    .article-hero__excerpt {
        font-size: 0.95rem;
    }
    .article-hero__grid { display: none; }

    .post-section {
        padding: 3rem 0 4rem;
    }
    .post-sidebar {
        grid-template-columns: 1fr;
    }
    .related-grid {
        grid-template-columns: 1fr;
    }
    .post-body h2 {
        font-size: 1.25rem;
    }
}
