/* ==========================================================
   Articles / news / weblog
   Component-scoped styles; no broad global card selectors.
   ========================================================== */

.articles-page,
.article-detail-page{
    min-height:70vh;
    padding-block:clamp(32px,5vw,72px) clamp(64px,8vw,112px);
    color:var(--text-primary);
}

.articles-page .app-container,
.article-detail-page .app-container{
    width:min(var(--container-lg),calc(100% - var(--container-padding) - var(--container-padding)));
    margin-inline:auto;
}

.articles-page .sr-only{
    position:absolute;
    width:1px;
    height:1px;
    padding:0;
    margin:-1px;
    overflow:hidden;
    clip:rect(0,0,0,0);
    white-space:nowrap;
    border:0;
}

/* Hero */
.articles-hero{
    position:relative;
    display:flex;
    flex-direction:column;
    align-items:center;
    text-align:center;
    padding:clamp(28px,5vw,64px);
    border:1px solid var(--border-soft);
    border-radius:clamp(24px,4vw,36px);
    background:
        radial-gradient(circle at 84% 10%,color-mix(in srgb,var(--accent) 20%,transparent),transparent 34%),
        radial-gradient(circle at 8% 90%,color-mix(in srgb,var(--secondary) 18%,transparent),transparent 36%),
        var(--bg-surface-strong);
    box-shadow:var(--shadow-card);
    overflow:hidden;
}

.articles-hero::before{
    content:"";
    position:absolute;
    inset:0;
    pointer-events:none;
    opacity:.32;
    background-image:
        linear-gradient(var(--border-soft) 1px,transparent 1px),
        linear-gradient(90deg,var(--border-soft) 1px,transparent 1px);
    background-size:44px 44px;
    mask-image:linear-gradient(to bottom,black,transparent 88%);
}

.articles-hero > *{
    position:relative;
    z-index:1;
}

.articles-hero__badge{
    display:inline-flex;
    align-items:center;
    gap:8px;
    min-height:36px;
    padding-inline:14px;
    border:1px solid color-mix(in srgb,var(--accent) 45%,var(--border-soft));
    border-radius:999px;
    background:var(--accent-soft);
    color:var(--text-primary);
    font-size:var(--text-sm);
    font-weight:700;
}

.articles-hero__badge i{color:var(--accent);}

.articles-hero h1{
    max-width:850px;
    margin:18px 0 0;
    font-size:clamp(30px,4.2vw,58px);
    line-height:1.45;
    font-weight:900;
    text-wrap:balance;
}

.articles-hero > p{
    max-width:720px;
    margin:14px 0 0;
    color:var(--text-secondary);
    font-size:clamp(14px,1.15vw,17px);
    line-height:1.9;
}

.articles-type-tabs{
    justify-content:center;
    margin-top:26px;
    overflow-x:auto;
    max-width:100%;
    padding-block:3px;
}

.articles-type-tabs .tab{
    gap:8px;
    text-decoration:none;
}

.articles-search{
    width:min(720px,100%);
    margin-top:22px;
    display:grid;
    grid-template-columns:minmax(0,1fr) auto;
    gap:10px;
}

.articles-search__field{
    min-width:0;
    min-height:48px;
    display:flex;
    align-items:center;
    gap:10px;
    padding-inline:16px;
    border:1px solid var(--border-soft);
    border-radius:16px;
    background:var(--bg-input);
    box-shadow:0 10px 30px rgba(15,23,42,.06);
}

.articles-search__field:focus-within{
    border-color:var(--accent);
    box-shadow:0 0 0 4px var(--accent-soft);
}

.articles-search__field i{color:var(--text-muted);}

.articles-search__field input{
    width:100%;
    min-width:0;
    border:0;
    outline:0;
    background:transparent;
    color:var(--text-primary);
    font:inherit;
}

.articles-search__field input::placeholder{color:var(--text-muted);}

.articles-search button{
    min-height:48px;
    padding-inline:24px;
    border:0;
    border-radius:16px;
    background:linear-gradient(135deg,var(--accent),var(--secondary));
    color:var(--text-on-accent);
    font:inherit;
    font-weight:800;
    cursor:pointer;
    transition:transform .2s ease,box-shadow .2s ease;
}

.articles-search button:hover{
    transform:translateY(-2px);
    box-shadow:0 14px 30px color-mix(in srgb,var(--accent) 25%,transparent);
}

/* Filters */
.articles-filter-section{
    margin-top:24px;
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:18px;
}

.articles-category-list{
    min-width:0;
    flex:1;
    overflow-x:auto;
    padding-block:4px;
}

.articles-category-list .category-chip{
    gap:8px;
    text-decoration:none;
}

.articles-category-count{
    min-width:22px;
    height:22px;
    padding-inline:6px;
    display:inline-flex;
    align-items:center;
    justify-content:center;
    border-radius:999px;
    background:color-mix(in srgb,currentColor 13%,transparent);
    font-size:11px;
    line-height:1;
}

.articles-result-summary{
    flex:0 0 auto;
    margin:0;
    color:var(--text-secondary);
    font-size:var(--text-sm);
}

/* Headings */
.articles-featured,
.articles-catalog,
.related-articles{
    margin-top:clamp(42px,6vw,72px);
}

.articles-section-heading{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:16px;
    margin-bottom:20px;
}

.articles-section-heading > div{min-width:0;}

.articles-section-heading span{
    display:block;
    margin-bottom:5px;
    color:var(--accent);
    font-size:13px;
    font-weight:800;
}

.articles-section-heading h2{
    margin:0;
    color:var(--text-primary);
    font-size:clamp(24px,2.5vw,36px);
    line-height:1.45;
}

.articles-section-heading > i{
    width:46px;
    height:46px;
    display:grid;
    place-items:center;
    flex:0 0 46px;
    border:1px solid var(--border-soft);
    border-radius:16px;
    background:var(--bg-card);
    color:var(--accent);
    box-shadow:var(--shadow-card);
}

/* Featured */
.articles-featured-grid{
    display:grid;
    grid-template-columns:repeat(2,minmax(0,1fr));
    grid-template-rows:repeat(2,minmax(170px,1fr));
    gap:18px;
}

.featured-article-card{
    min-width:0;
    min-height:170px;
}

.featured-article-card--primary{
    grid-row:span 2;
}

.featured-article-card__media{
    position:relative;
    width:100%;
    height:100%;
    min-height:170px;
    display:block;
    overflow:hidden;
    border:1px solid var(--border-soft);
    border-radius:24px;
    background:var(--bg-card-media);
    color:#fff;
    box-shadow:var(--shadow-card);
    text-decoration:none;
    isolation:isolate;
}

.featured-article-card--primary .featured-article-card__media{min-height:358px;}

.featured-article-card__media img{
    width:100%;
    height:100%;
    object-fit:cover;
    transition:transform .45s ease;
}

.featured-article-card__media:hover img{transform:scale(1.045);}

.featured-article-card__placeholder{
    width:100%;
    height:100%;
    min-height:inherit;
    display:grid;
    place-items:center;
    color:rgba(255,255,255,.82);
    font-size:clamp(38px,6vw,76px);
    background:linear-gradient(135deg,var(--primary),var(--secondary));
}

.featured-article-card__overlay{
    position:absolute;
    inset:0;
    z-index:1;
    background:linear-gradient(to top,rgba(2,6,23,.92),rgba(2,6,23,.12) 75%);
}

.featured-article-card .article-type-badge{
    position:absolute;
    inset-block-start:14px;
    inset-inline-start:14px;
    z-index:2;
}

.featured-article-card__content{
    position:absolute;
    inset-inline:18px;
    inset-block-end:18px;
    z-index:2;
}

.featured-article-card__category{
    color:#cbd5e1;
    font-size:12px;
    font-weight:700;
}

.featured-article-card__title{
    margin:7px 0 0;
    color:#fff;
    font-size:clamp(18px,2.2vw,30px);
    line-height:1.55;
    font-weight:900;
}

.featured-article-card:not(.featured-article-card--primary) .featured-article-card__title{
    font-size:clamp(16px,1.6vw,22px);
}

.featured-article-card__meta{
    margin-top:9px;
    display:flex;
    align-items:center;
    flex-wrap:wrap;
    gap:10px;
    color:#cbd5e1;
    font-size:12px;
}

/* Cards */
.articles-grid{
    display:grid;
    grid-template-columns:repeat(3,minmax(0,1fr));
    align-items:stretch;
    gap:22px;
}

.article-card{
    min-width:0;
    height:100%;
    display:flex;
    flex-direction:column;
    overflow:hidden;
    border:1px solid var(--border-soft);
    border-radius:24px;
    background:var(--bg-card);
    box-shadow:var(--shadow-card);
    transition:transform .22s ease,border-color .22s ease,box-shadow .22s ease;
}

.article-card:hover{
    transform:translateY(-5px);
    border-color:color-mix(in srgb,var(--accent) 48%,var(--border-soft));
    box-shadow:var(--shadow-card-hover);
}

.article-card__media{
    position:relative;
    height:clamp(160px,16vw,210px);
    flex:0 0 auto;
    display:block;
    overflow:hidden;
    background:var(--bg-card-media);
}

.article-card__media img{
    width:100%;
    height:100%;
    object-fit:cover;
    transition:transform .4s ease;
}

.article-card:hover .article-card__media img{transform:scale(1.04);}

.article-card__placeholder{
    width:100%;
    height:100%;
    display:grid;
    place-items:center;
    color:var(--text-on-accent);
    font-size:46px;
    background:linear-gradient(135deg,var(--primary),var(--secondary));
}

.article-type-badge{
    display:inline-flex;
    align-items:center;
    justify-content:center;
    min-height:30px;
    padding-inline:11px;
    border:1px solid rgba(255,255,255,.24);
    border-radius:999px;
    color:#fff;
    font-size:12px;
    font-weight:800;
    backdrop-filter:blur(10px);
    -webkit-backdrop-filter:blur(10px);
}

.article-card__media .article-type-badge{
    position:absolute;
    inset-block-start:12px;
    inset-inline-start:12px;
}

.article-type-badge--blog{background:rgba(79,124,255,.86);}
.article-type-badge--news{background:rgba(124,58,237,.88);}

.article-card__body{
    flex:1;
    min-width:0;
    padding:19px 20px 14px;
}

.article-card__meta{
    min-height:22px;
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:10px;
    color:var(--text-muted);
    font-size:12px;
}

.article-card__meta span{
    min-width:0;
    display:inline-flex;
    align-items:center;
    gap:5px;
}

.article-card__title{
    min-height:62px;
    margin:10px 0 0;
    font-size:clamp(18px,1.55vw,23px);
    line-height:1.55;
    font-weight:900;
}

.article-card__title a{
    color:var(--text-primary);
    text-decoration:none;
}

.article-card__excerpt{
    min-height:76px;
    margin:8px 0 0;
    color:var(--text-secondary);
    font-size:14px;
    line-height:1.85;
}

.article-card__footer{
    min-height:58px;
    padding:12px 20px 16px;
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:12px;
    border-top:1px solid var(--border-soft);
}

.article-card__date{
    color:var(--text-muted);
    font-size:12px;
    white-space:nowrap;
}

.article-card__date i{margin-inline-end:4px;}

.article-card__link{
    display:inline-flex;
    align-items:center;
    gap:7px;
    color:var(--accent);
    font-size:13px;
    font-weight:800;
    text-decoration:none;
    white-space:nowrap;
}

.article-card__link i{transition:transform .2s ease;}
.article-card__link:hover i{transform:translateX(-3px);}

/* Empty state */
.articles-empty-state{
    min-height:250px;
    display:flex;
    flex-direction:column;
    align-items:center;
    justify-content:center;
    gap:10px;
    padding:32px;
    text-align:center;
    border:1px dashed var(--border-strong);
    border-radius:24px;
    background:var(--bg-card);
}

.articles-empty-state > i{
    font-size:42px;
    color:var(--accent);
}

.articles-empty-state h2{margin:4px 0 0;font-size:24px;}
.articles-empty-state p{margin:0;color:var(--text-secondary);}
.articles-empty-state a{
    margin-top:6px;
    min-height:42px;
    padding-inline:18px;
    display:inline-flex;
    align-items:center;
    border-radius:14px;
    background:var(--accent-soft);
    color:var(--accent);
    font-weight:800;
    text-decoration:none;
}

.articles-empty-state--compact{min-height:120px;}

/* Pagination */
.articles-pagination{
    margin-top:28px;
    display:flex;
    align-items:center;
    justify-content:center;
    gap:12px;
}

.articles-pagination__link,
.articles-pagination__status{
    min-height:42px;
    padding-inline:15px;
    display:inline-flex;
    align-items:center;
    justify-content:center;
    gap:7px;
    border:1px solid var(--border-soft);
    border-radius:14px;
    background:var(--bg-card);
    color:var(--text-primary);
    font-size:13px;
    text-decoration:none;
}

.articles-pagination__link:not(.is-disabled):hover{
    border-color:var(--accent);
    color:var(--accent);
}

.articles-pagination__link.is-disabled{opacity:.48;cursor:not-allowed;}
.articles-pagination__status{color:var(--text-secondary);}

/* Detail */
.article-breadcrumb{
    display:flex;
    align-items:center;
    gap:9px;
    min-width:0;
    margin-bottom:24px;
    color:var(--text-muted);
    font-size:13px;
}

.article-breadcrumb a{color:var(--text-secondary);text-decoration:none;}
.article-breadcrumb a:hover{color:var(--accent);}
.article-breadcrumb i{font-size:10px;}
.article-breadcrumb span{min-width:0;}

.article-detail__header{
    max-width:920px;
    margin-inline:auto;
    text-align:center;
}

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

.article-category-badge{
    min-height:30px;
    padding-inline:11px;
    display:inline-flex;
    align-items:center;
    border:1px solid var(--border-soft);
    border-radius:999px;
    background:var(--bg-card);
    color:var(--text-secondary);
    font-size:12px;
    font-weight:700;
}

.article-detail__header h1{
    margin:18px 0 0;
    color:var(--text-primary);
    font-size:clamp(30px,4.5vw,58px);
    line-height:1.48;
    font-weight:900;
    text-wrap:balance;
}

.article-detail__lead{
    max-width:780px;
    margin:15px auto 0;
    color:var(--text-secondary);
    font-size:clamp(15px,1.3vw,18px);
    line-height:1.95;
}

.article-detail__meta{
    margin-top:20px;
    display:flex;
    align-items:center;
    justify-content:center;
    flex-wrap:wrap;
    gap:10px 18px;
    color:var(--text-muted);
    font-size:13px;
}

.article-detail__meta span{display:inline-flex;align-items:center;gap:6px;}
.article-detail__meta i{color:var(--accent);}

.article-detail__cover{
    margin:clamp(28px,5vw,48px) 0 0;
    aspect-ratio:16/7;
    overflow:hidden;
    border:1px solid var(--border-soft);
    border-radius:clamp(22px,4vw,34px);
    background:var(--bg-card-media);
    box-shadow:var(--shadow-card);
}

.article-detail__cover img{width:100%;height:100%;object-fit:cover;}

.article-detail__layout{
    width:min(1080px,100%);
    margin:clamp(28px,5vw,48px) auto 0;
    display:grid;
    grid-template-columns:minmax(0,1fr) 260px;
    align-items:start;
    gap:26px;
}

.article-detail__main{
    min-width:0;
    padding:clamp(20px,3vw,36px);
    border:1px solid var(--border-soft);
    border-radius:26px;
    background:var(--bg-card);
    box-shadow:var(--shadow-card);
}

.article-content{
    color:var(--text-secondary);
    font-size:clamp(15px,1.15vw,17px);
    line-height:2.05;
    overflow-wrap:anywhere;
}

.article-content p{margin:0 0 1.25em;}
.article-content p:last-child{margin-bottom:0;}
.article-content h2,
.article-content h3,
.article-content h4{
    margin:1.7em 0 .65em;
    color:var(--text-primary);
    line-height:1.55;
}
.article-content h2{font-size:clamp(23px,2vw,31px);}
.article-content h3{font-size:clamp(20px,1.7vw,26px);}
.article-content a{color:var(--accent);text-decoration:underline;text-underline-offset:4px;}
.article-content blockquote{
    margin:24px 0;
    padding:16px 18px;
    border-inline-start:4px solid var(--accent);
    border-radius:14px;
    background:var(--accent-soft);
    color:var(--text-primary);
}
.article-content pre,
.article-content code{
    direction:ltr;
    font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;
}
.article-content pre{
    max-width:100%;
    overflow:auto;
    margin:22px 0;
    padding:18px;
    border:1px solid var(--border-soft);
    border-radius:16px;
    background:var(--bg-surface-strong);
    font-size:13px;
    line-height:1.75;
}

.article-source{
    margin-top:28px;
    padding:16px;
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:14px;
    border:1px solid var(--border-soft);
    border-radius:16px;
    background:var(--bg-surface-strong);
}

.article-source > div,
.article-source a{display:flex;align-items:center;gap:8px;}
.article-source > div{color:var(--text-secondary);font-size:13px;}
.article-source a{color:var(--accent);font-size:13px;font-weight:800;text-decoration:none;}

.article-tags{
    margin-top:22px;
    padding-top:18px;
    display:flex;
    align-items:center;
    flex-wrap:wrap;
    gap:8px;
    border-top:1px solid var(--border-soft);
}

.article-tags > i{color:var(--accent);}
.article-tags span{
    min-height:32px;
    padding-inline:11px;
    display:inline-flex;
    align-items:center;
    border:1px solid var(--border-soft);
    border-radius:999px;
    background:var(--bg-surface-strong);
    color:var(--text-secondary);
    font-size:12px;
}

.article-detail__sidebar{
    position:sticky;
    inset-block-start:calc(var(--header-desktop) + 18px);
    display:grid;
    gap:14px;
}

.article-author-card,
.article-share-card{
    padding:18px;
    border:1px solid var(--border-soft);
    border-radius:20px;
    background:var(--bg-card);
    box-shadow:var(--shadow-card);
}

.article-author-card{
    display:flex;
    align-items:center;
    gap:12px;
}

.article-author-card__avatar{
    width:48px;
    height:48px;
    flex:0 0 48px;
    display:grid;
    place-items:center;
    border-radius:16px;
    background:linear-gradient(135deg,var(--primary),var(--secondary));
    color:#fff;
    font-size:20px;
    font-weight:900;
}

.article-author-card span,
.article-share-card > span{display:block;color:var(--text-muted);font-size:12px;}
.article-author-card strong{display:block;margin-top:4px;color:var(--text-primary);font-size:14px;}

.article-share-card > div{
    margin-top:12px;
    display:flex;
    gap:8px;
}

.article-share-card a{
    width:42px;
    height:42px;
    display:grid;
    place-items:center;
    border:1px solid var(--border-soft);
    border-radius:14px;
    background:var(--bg-surface-strong);
    color:var(--text-primary);
    font-size:19px;
    text-decoration:none;
    transition:transform .2s ease,border-color .2s ease,color .2s ease;
}

.article-share-card a:hover{transform:translateY(-2px);border-color:var(--accent);color:var(--accent);}

@media (max-width:1024px){
    .articles-grid{grid-template-columns:repeat(2,minmax(0,1fr));}
    .article-detail__layout{grid-template-columns:minmax(0,1fr) 220px;gap:18px;}
}

@media (max-width:768px){
    .articles-page,
    .article-detail-page{padding-block:24px 84px;}

    .articles-page .app-container,
    .article-detail-page .app-container{
        width:min(calc(100% - 32px),var(--container-lg));
    }

    .articles-hero{padding:26px 18px;border-radius:26px;}
    .articles-hero h1{font-size:clamp(28px,8vw,42px);}

    .articles-filter-section{
        align-items:stretch;
        flex-direction:column;
        gap:10px;
    }

    .articles-result-summary{text-align:center;}

    .articles-featured-grid{
        grid-template-columns:1fr;
        grid-template-rows:none;
    }

    .featured-article-card--primary{grid-row:auto;}
    .featured-article-card__media,
    .featured-article-card--primary .featured-article-card__media{min-height:230px;}

    .article-detail__layout{grid-template-columns:1fr;}
    .article-detail__sidebar{
        position:static;
        grid-template-columns:repeat(2,minmax(0,1fr));
        order:-1;
    }

    .article-detail__cover{aspect-ratio:16/9;}
}

@media (max-width:560px){
    .articles-search{grid-template-columns:1fr;}
    .articles-search button{width:100%;}

    .articles-grid{grid-template-columns:1fr;gap:16px;}
    .article-card__media{height:190px;}
    .article-card__title{min-height:auto;}
    .article-card__excerpt{min-height:auto;}

    .articles-section-heading > i{display:none;}

    .article-detail__sidebar{grid-template-columns:1fr;}
    .article-detail__header h1{font-size:clamp(28px,9vw,39px);}
    .article-detail__meta{justify-content:flex-start;text-align:start;}
    .article-detail__cover{border-radius:22px;}
    .article-detail__main{padding:20px 17px;border-radius:22px;}

    .article-source{align-items:flex-start;flex-direction:column;}
    .articles-pagination{gap:7px;}
    .articles-pagination__link,
    .articles-pagination__status{padding-inline:10px;font-size:12px;}
}

@media (max-width:360px){
    .articles-page .app-container,
    .article-detail-page .app-container{width:calc(100% - 20px);}

    .articles-hero{padding-inline:12px;}
    .articles-hero__badge{font-size:12px;}
    .article-card__body{padding-inline:16px;}
    .article-card__footer{padding-inline:16px;}
    .articles-pagination__status{display:none;}
}

@media (prefers-reduced-motion:reduce){
    .articles-page *,
    .article-detail-page *{
        scroll-behavior:auto !important;
        animation-duration:.01ms !important;
        animation-iteration-count:1 !important;
        transition-duration:.01ms !important;
    }
}
