/*
 Theme Name:   Astra Child — Aputure UA
 Template:     astra
 Version:      2.0.0
 Description:  Дочірня тема Astra для aputure.ua — кінематографічний блог як aputure.com
 Author:       Aputure UA
 Text Domain:  astra-child-aputure
*/

/* ═══════════════════════════════════════════════
   ASTRA OVERRIDES — force full-width for articles
   ═══════════════════════════════════════════════ */

.single-article .site-content > .ast-container,
.post-type-archive-article .site-content > .ast-container,
.tax-article_tag .site-content > .ast-container {
    display: block !important;
    max-width: 100% !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
}

.single-article .site-content .ast-container,
.post-type-archive-article .site-content .ast-container,
.tax-article_tag .site-content .ast-container {
    display: block !important;
}

.single-article #primary,
.post-type-archive-article #primary,
.tax-article_tag #primary {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    float: none !important;
}

.single-article #secondary,
.post-type-archive-article #secondary {
    display: none !important;
}

/* Remove Astra's default title area for articles */
.single-article .entry-header,
.single-article .ast-single-post-order {
    display: none !important;
}

/* Remove Astra default post meta */
.single-article .entry-meta {
    display: none !important;
}


/* ═══════════════════════════════════════════════
   VARIABLES
   ═══════════════════════════════════════════════ */

:root {
    --apt-black:      #0a0a0a;
    --apt-dark:       #111111;
    --apt-dark-card:  #1a1a1a;
    --apt-white:      #ffffff;
    --apt-gray-50:    #f8f8f8;
    --apt-gray-100:   #f0f0f0;
    --apt-gray-200:   #e0e0e0;
    --apt-gray-300:   #cccccc;
    --apt-gray-400:   #999999;
    --apt-gray-500:   #777777;
    --apt-gray-600:   #666666;
    --apt-gray-700:   #444444;
    --apt-gray-800:   #333333;
    --apt-accent:     #ff4d00;
    --apt-font:       'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --apt-max-width:  1280px;
    --apt-content-w:  780px;
    --apt-gap:        24px;
    --apt-radius:     12px;
    --apt-transition: 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}


/* ═══════════════════════════════════════════════
   SINGLE ARTICLE — HERO (dark, full-bleed)
   ═══════════════════════════════════════════════ */

.apt-hero {
    position: relative;
    width: 100%;
    min-height: 75vh;
    display: flex;
    align-items: flex-end;
    overflow: hidden;
    background: var(--apt-black);
}

.apt-hero__bg {
    position: absolute;
    inset: 0;
    z-index: 0;
}

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

.apt-hero__overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to top,
        rgba(0, 0, 0, 0.85) 0%,
        rgba(0, 0, 0, 0.4) 40%,
        rgba(0, 0, 0, 0.15) 100%
    );
}

.apt-hero__content {
    position: relative;
    z-index: 1;
    max-width: var(--apt-max-width);
    width: 100%;
    margin: 0 auto;
    padding: 60px 40px 56px;
}

.apt-hero__tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 20px;
}

.apt-hero__tags .article-tag {
    background: rgba(255, 255, 255, 0.12);
    color: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.apt-hero__tags .article-tag:hover {
    background: var(--apt-white);
    color: var(--apt-black);
}

.apt-hero__title {
    font-family: var(--apt-font);
    font-size: clamp(36px, 5.5vw, 64px);
    font-weight: 800;
    line-height: 1.05;
    color: var(--apt-white);
    letter-spacing: -0.03em;
    margin: 0 0 24px;
    max-width: 800px;
}

.apt-hero__video-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 12px 24px;
    border: 1.5px solid rgba(255, 255, 255, 0.5);
    border-radius: 100px;
    color: var(--apt-white);
    font-family: var(--apt-font);
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    text-decoration: none;
    transition: all var(--apt-transition);
    backdrop-filter: blur(8px);
    background: rgba(255, 255, 255, 0.08);
}

.apt-hero__video-btn:hover {
    background: var(--apt-white);
    color: var(--apt-black);
    border-color: var(--apt-white);
}


/* ═══════════════════════════════════════════════
   SINGLE ARTICLE — INTRO (Production + Lead)
   ═══════════════════════════════════════════════ */

.apt-intro {
    background: var(--apt-dark);
    color: var(--apt-white);
    padding: 60px 40px;
}

.apt-intro__inner {
    max-width: var(--apt-max-width);
    margin: 0 auto;
    display: grid;
    grid-template-columns: 420px 1fr;
    gap: 48px;
    align-items: start;
}

/* Left — production card */
.apt-intro__production {
    display: flex;
    gap: 20px;
    align-items: flex-start;
}

.apt-intro__poster {
    flex-shrink: 0;
    width: 120px;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

.apt-intro__poster img {
    width: 100%;
    height: auto;
    display: block;
}

.apt-intro__meta-block {
    min-width: 0;
}

.apt-intro__label {
    font-family: var(--apt-font);
    font-size: 15px;
    font-weight: 700;
    color: var(--apt-white);
    margin: 0 0 4px;
    letter-spacing: 0.01em;
}

.apt-intro__prod-title {
    font-size: 14px;
    color: var(--apt-gray-400);
    margin: 0 0 20px;
}

.apt-intro__prod-info {
    font-size: 13px;
    line-height: 1.85;
    color: var(--apt-gray-400);
}

.apt-intro__prod-info p {
    margin: 0 0 2px;
    color: inherit;
    font-size: inherit;
    line-height: inherit;
}

/* Right — lead text */
.apt-intro__lead {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 100%;
}

.apt-intro__lead-text {
    font-family: var(--apt-font);
    font-size: clamp(22px, 2.8vw, 30px);
    font-weight: 400;
    line-height: 1.4;
    color: var(--apt-white);
    margin: 0;
    letter-spacing: -0.01em;
}

.apt-intro__byline {
    display: none; /* byline is already visible in article content context */
}


/* ═══════════════════════════════════════════════
   SINGLE ARTICLE — BYLINE (between intro and content)
   ═══════════════════════════════════════════════ */

.apt-byline {
    max-width: var(--apt-content-w);
    margin: 32px auto 0;
    padding: 0 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: var(--apt-font);
    font-size: 13px;
    color: var(--apt-gray-400);
}

.apt-byline__sep {
    color: var(--apt-gray-300);
}


/* ═══════════════════════════════════════════════
   SINGLE ARTICLE — TABLE OF CONTENTS
   ═══════════════════════════════════════════════ */

.apt-toc-wrap {
    max-width: var(--apt-content-w);
    margin: 48px auto;
    padding: 0 20px;
}

.apt-toc-wrap .aputure-toc {
    background: var(--apt-gray-50);
    border-radius: var(--apt-radius);
    padding: 28px 32px;
}

.aputure-toc h3 {
    font-family: var(--apt-font);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--apt-gray-400);
    margin: 0 0 16px;
}

.aputure-toc ol {
    list-style: none;
    counter-reset: toc;
    margin: 0;
    padding: 0;
}

.aputure-toc ol li {
    counter-increment: toc;
    margin-bottom: 8px;
}

.aputure-toc ol li a {
    color: var(--apt-gray-800);
    text-decoration: none;
    font-size: 15px;
    font-weight: 500;
    display: flex;
    align-items: baseline;
    gap: 12px;
    transition: color var(--apt-transition);
}

.aputure-toc ol li a::before {
    content: counter(toc, decimal-leading-zero);
    font-size: 12px;
    font-weight: 700;
    color: var(--apt-gray-400);
    min-width: 20px;
}

.aputure-toc ol li a:hover {
    color: var(--apt-accent);
}


/* ═══════════════════════════════════════════════
   SINGLE ARTICLE — CONTENT
   ═══════════════════════════════════════════════ */

.apt-content {
    max-width: var(--apt-content-w);
    margin: 0 auto;
    padding: 0 20px 60px;
}

.apt-content h2 {
    font-family: var(--apt-font);
    font-size: clamp(24px, 3vw, 32px);
    font-weight: 700;
    color: var(--apt-black);
    margin: 56px 0 20px;
    letter-spacing: -0.02em;
}

.apt-content h3 {
    font-family: var(--apt-font);
    font-size: 22px;
    font-weight: 700;
    color: var(--apt-black);
    margin: 40px 0 12px;
}

.apt-content p {
    font-family: var(--apt-font);
    font-size: 17px;
    line-height: 1.75;
    color: var(--apt-gray-800);
    margin: 0 0 24px;
}

.apt-content img {
    width: 100%;
    height: auto;
    border-radius: var(--apt-radius);
    margin: 36px 0;
}

.apt-content figure {
    margin: 36px 0;
}

.apt-content figcaption {
    text-align: center;
    font-size: 13px;
    color: var(--apt-gray-400);
    margin-top: 10px;
    font-style: italic;
}

/* Blockquotes — cinematic style like aputure.com */
.apt-content blockquote {
    margin: 48px 0;
    padding: 0;
    border: none;
    background: none;
    position: relative;
}

.apt-content blockquote p {
    font-family: var(--apt-font);
    font-size: clamp(20px, 2.5vw, 26px);
    font-weight: 400;
    font-style: italic;
    line-height: 1.45;
    color: var(--apt-black);
    margin: 0;
    padding-left: 32px;
    border-left: 3px solid var(--apt-accent);
}

.apt-content blockquote cite,
.apt-content blockquote footer {
    display: block;
    font-size: 14px;
    font-style: normal;
    font-weight: 600;
    color: var(--apt-gray-600);
    margin-top: 16px;
    padding-left: 32px;
}


/* ═══════════════════════════════════════════════
   SINGLE ARTICLE — ORIGINAL LINK
   ═══════════════════════════════════════════════ */

.apt-original-link {
    max-width: var(--apt-content-w);
    margin: 0 auto 40px;
    padding: 16px 24px;
    background: var(--apt-gray-50);
    border-radius: var(--apt-radius);
    font-size: 14px;
    color: var(--apt-gray-600);
    display: flex;
    align-items: center;
    gap: 8px;
}

.apt-original-link a {
    color: var(--apt-accent);
    font-weight: 600;
    text-decoration: none;
}

.apt-original-link a:hover {
    text-decoration: underline;
}


/* ═══════════════════════════════════════════════
   SINGLE ARTICLE — AUTHOR
   ═══════════════════════════════════════════════ */

.apt-author {
    max-width: var(--apt-content-w);
    margin: 0 auto 60px;
    padding: 0 20px;
}

.apt-author__inner {
    display: flex;
    gap: 20px;
    align-items: flex-start;
    padding: 28px 32px;
    background: var(--apt-gray-50);
    border-radius: var(--apt-radius);
}

.apt-author__avatar {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    flex-shrink: 0;
}

.apt-author__name {
    font-family: var(--apt-font);
    font-size: 16px;
    font-weight: 700;
    color: var(--apt-black);
    margin: 0 0 4px;
}

.apt-author__bio {
    font-size: 14px;
    line-height: 1.6;
    color: var(--apt-gray-600);
    margin: 0;
}


/* ═══════════════════════════════════════════════
   SINGLE ARTICLE — RELATED
   ═══════════════════════════════════════════════ */

.apt-related {
    border-top: 1px solid var(--apt-gray-200);
    padding: 60px 0 80px;
}

.apt-related__inner {
    max-width: var(--apt-max-width);
    margin: 0 auto;
    padding: 0 20px;
}

.apt-related__inner h2 {
    font-family: var(--apt-font);
    font-size: 24px;
    font-weight: 700;
    color: var(--apt-black);
    margin: 0 0 32px;
}


/* ═══════════════════════════════════════════════
   HOMEPAGE — APUTURE ON SET BLOCK
   Horizontal scroll card carousel like aputure.com
   ═══════════════════════════════════════════════ */

.apt-onset {
    background: var(--apt-gray-50);
    padding: 64px 0;
    overflow: hidden;
}

.apt-onset__inner {
    max-width: var(--apt-max-width);
    margin: 0 auto;
    padding: 0 40px;
}

.apt-onset__header {
    margin-bottom: 36px;
}

.apt-onset__title {
    font-family: var(--apt-font);
    font-size: clamp(24px, 3vw, 32px);
    font-weight: 700;
    color: var(--apt-black);
    letter-spacing: -0.02em;
    margin: 0 0 8px;
}

.apt-onset__subtitle {
    font-family: var(--apt-font);
    font-size: 15px;
    line-height: 1.5;
    color: var(--apt-gray-600);
    margin: 0;
    max-width: 460px;
}

/* Horizontal scroll track */
.apt-onset__track {
    display: flex;
    gap: 20px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 16px;
    margin: 0 -40px;
    padding-left: 40px;
    padding-right: 40px;
}

/* Hide scrollbar on desktop, show on mobile */
.apt-onset__track::-webkit-scrollbar {
    height: 4px;
}
.apt-onset__track::-webkit-scrollbar-track {
    background: var(--apt-gray-200);
    border-radius: 4px;
}
.apt-onset__track::-webkit-scrollbar-thumb {
    background: var(--apt-gray-400);
    border-radius: 4px;
}

/* Individual card */
.apt-onset__card {
    flex: 0 0 300px;
    scroll-snap-align: start;
    position: relative;
    border-radius: var(--apt-radius);
    overflow: hidden;
    aspect-ratio: 4 / 5;
    text-decoration: none;
    color: var(--apt-white);
    display: block;
}

.apt-onset__card-img {
    position: absolute;
    inset: 0;
}

.apt-onset__card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.apt-onset__card:hover .apt-onset__card-img img {
    transform: scale(1.06);
}

.apt-onset__card-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to top,
        rgba(0, 0, 0, 0.75) 0%,
        rgba(0, 0, 0, 0.15) 50%,
        rgba(0, 0, 0, 0.05) 100%
    );
    transition: background var(--apt-transition);
}

.apt-onset__card:hover .apt-onset__card-overlay {
    background: linear-gradient(
        to top,
        rgba(0, 0, 0, 0.85) 0%,
        rgba(0, 0, 0, 0.25) 50%,
        rgba(0, 0, 0, 0.1) 100%
    );
}

.apt-onset__card-placeholder {
    width: 100%;
    height: 100%;
    background: var(--apt-gray-700);
}

.apt-onset__card-content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 24px;
    z-index: 1;
}

.apt-onset__card-content h3 {
    font-family: var(--apt-font);
    font-size: 20px;
    font-weight: 700;
    line-height: 1.25;
    color: var(--apt-white);
    margin: 0;
    letter-spacing: -0.01em;
}

.apt-onset__card-arrow {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--apt-white);
    z-index: 1;
    opacity: 0;
    transform: translateY(4px);
    transition: opacity var(--apt-transition), transform var(--apt-transition);
}

.apt-onset__card:hover .apt-onset__card-arrow {
    opacity: 1;
    transform: translateY(0);
}

/* ── Responsive for onset ── */
@media (max-width: 768px) {
    .apt-onset {
        padding: 48px 0;
    }

    .apt-onset__inner {
        padding: 0 20px;
    }

    .apt-onset__track {
        margin: 0 -20px;
        padding-left: 20px;
        padding-right: 20px;
        gap: 14px;
    }

    .apt-onset__card {
        flex: 0 0 260px;
    }

    .apt-onset__card-content h3 {
        font-size: 17px;
    }

    .apt-onset__card-arrow {
        opacity: 1;
        transform: translateY(0);
    }
}


/* ═══════════════════════════════════════════════
   BLOG ARCHIVE PAGE
   ═══════════════════════════════════════════════ */

.aputure-blog-page {
    max-width: var(--apt-max-width);
    margin: 0 auto;
    padding: 40px 20px 80px;
}

.aputure-blog-page .blog-header {
    margin-bottom: 48px;
}

.aputure-blog-page .blog-header h1 {
    font-family: var(--apt-font);
    font-size: clamp(28px, 4vw, 42px);
    font-weight: 700;
    color: var(--apt-black);
    letter-spacing: -0.02em;
    margin: 0 0 8px;
}

.aputure-blog-page .blog-header p {
    font-size: 16px;
    color: var(--apt-gray-600);
    margin: 0;
}

/* Featured Article (Hero on archive) */
.aputure-featured-article {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    margin-bottom: 64px;
    align-items: center;
}

.aputure-featured-article .featured-image {
    border-radius: var(--apt-radius);
    overflow: hidden;
    aspect-ratio: 16 / 10;
}

.aputure-featured-article .featured-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--apt-transition);
}

.aputure-featured-article:hover .featured-image img {
    transform: scale(1.03);
}

.aputure-featured-article .featured-content {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.aputure-featured-article .featured-content h2 {
    font-family: var(--apt-font);
    font-size: clamp(22px, 3vw, 32px);
    font-weight: 700;
    line-height: 1.2;
    color: var(--apt-black);
    margin: 0;
    letter-spacing: -0.02em;
}

.aputure-featured-article .featured-content h2 a {
    color: inherit;
    text-decoration: none;
}

.aputure-featured-article .featured-content h2 a:hover {
    color: var(--apt-accent);
}

.aputure-featured-article .featured-excerpt {
    font-size: 15px;
    line-height: 1.6;
    color: var(--apt-gray-600);
    margin: 0;
}


/* ═══════════════════════════════════════════════
   SHARED — ARTICLE TAG PILLS
   ═══════════════════════════════════════════════ */

.article-tag {
    display: inline-block;
    padding: 4px 12px;
    background: var(--apt-gray-100);
    color: var(--apt-gray-800);
    font-family: var(--apt-font);
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    border-radius: 100px;
    text-decoration: none;
    transition: background var(--apt-transition), color var(--apt-transition);
}

.article-tag:hover {
    background: var(--apt-black);
    color: var(--apt-white);
}


/* ═══════════════════════════════════════════════
   SHARED — ARTICLE CARDS GRID
   ═══════════════════════════════════════════════ */

.aputure-articles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: var(--apt-gap);
}

.aputure-article-card {
    background: var(--apt-white);
    border-radius: var(--apt-radius);
    overflow: hidden;
    border: 1px solid var(--apt-gray-200);
    transition: box-shadow var(--apt-transition), transform var(--apt-transition);
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
}

.aputure-article-card:hover {
    box-shadow: 0 12px 40px rgba(0,0,0,0.08);
    transform: translateY(-4px);
}

.aputure-article-card .card-image {
    aspect-ratio: 16 / 10;
    overflow: hidden;
}

.aputure-article-card .card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--apt-transition);
}

.aputure-article-card:hover .card-image img {
    transform: scale(1.05);
}

.aputure-article-card .card-body {
    padding: 20px 24px 24px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    flex: 1;
}

.aputure-article-card .card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.aputure-article-card .card-title {
    font-family: var(--apt-font);
    font-size: 18px;
    font-weight: 700;
    line-height: 1.3;
    color: var(--apt-black);
    margin: 0;
}

.aputure-article-card .card-excerpt {
    font-size: 14px;
    line-height: 1.5;
    color: var(--apt-gray-600);
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.aputure-article-card .card-meta {
    font-size: 12px;
    color: var(--apt-gray-400);
    margin-top: auto;
    padding-top: 12px;
    border-top: 1px solid var(--apt-gray-100);
}


/* ═══════════════════════════════════════════════
   SHARED — BREADCRUMB
   ═══════════════════════════════════════════════ */

.aputure-breadcrumb {
    max-width: var(--apt-max-width);
    margin: 0 auto;
    padding: 20px 20px 0;
}

.aputure-breadcrumb a {
    font-family: var(--apt-font);
    font-size: 14px;
    color: var(--apt-gray-400);
    text-decoration: none;
    transition: color var(--apt-transition);
}

.aputure-breadcrumb a:hover {
    color: var(--apt-accent);
}


/* ═══════════════════════════════════════════════
   SHARED — PAGINATION
   ═══════════════════════════════════════════════ */

.aputure-pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 48px;
}

.aputure-pagination a,
.aputure-pagination span {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    transition: all var(--apt-transition);
}

.aputure-pagination a {
    color: var(--apt-gray-600);
    background: var(--apt-gray-100);
}

.aputure-pagination a:hover {
    background: var(--apt-black);
    color: var(--apt-white);
}

.aputure-pagination span.current {
    background: var(--apt-black);
    color: var(--apt-white);
}


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

@media (max-width: 900px) {
    .apt-intro__inner {
        grid-template-columns: 1fr;
        gap: 32px;
    }

    .apt-intro__lead-text {
        font-size: 22px;
    }
}

@media (max-width: 768px) {
    .apt-hero {
        min-height: 60vh;
    }

    .apt-hero__content {
        padding: 40px 20px 40px;
    }

    .apt-intro {
        padding: 40px 20px;
    }

    .apt-intro__production {
        flex-direction: column;
    }

    .apt-intro__poster {
        width: 120px;
    }

    .aputure-featured-article {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    .aputure-articles-grid {
        grid-template-columns: 1fr;
    }

    .apt-content blockquote p {
        font-size: 18px;
        padding-left: 20px;
    }

    .apt-author__inner {
        flex-direction: column;
    }
}
