/* =====================================================================
   استایل صفحات «مقالات» دفتر طراحی وب — webdesign-articles.php / webdesign-article.php
   -----------------------------------------------------------------
   کاملاً مستقل از css/articles.css (که مخصوص استودیو عکاسیه)؛ از
   متغیرهای --wd-* که در css/theme-webdesign.php ساخته می‌شن استفاده
   می‌کنه تا با رنگ زنده‌ی دفتر طراحی وب هماهنگ بمونه.
   فاز ۳: بازطراحی بصری — هدر محیطی، گرید بنتو، نوار پیشرفت مطالعه + فهرست خودکار
===================================================================== */

/* ===== هدر با پس‌زمینه‌ی محیطی ===== */
.wda-header {
    position: relative;
    text-align: center;
    padding: calc(var(--wds-nav-h, 74px) + 56px) 20px 70px;
    overflow: hidden;
    isolation: isolate;
}
.wda-header::before {
    content: "";
    position: absolute; inset: -20% -10%;
    background:
        radial-gradient(ellipse 50% 45% at 20% 25%, rgba(var(--wd-accent-rgb), .30), transparent 60%),
        radial-gradient(ellipse 45% 40% at 85% 70%, rgba(var(--wd-accent-light-rgb), .18), transparent 60%);
    filter: blur(45px);
    z-index: -2;
    animation: wdaDriftGlow 20s ease-in-out infinite alternate;
}
.wda-header::after {
    content: "";
    position: absolute; inset: 0;
    background-image:
        linear-gradient(rgba(255, 255, 255, .035) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, .035) 1px, transparent 1px);
    background-size: 42px 42px;
    mask-image: radial-gradient(ellipse 70% 60% at 50% 30%, black, transparent);
    z-index: -1;
}
@keyframes wdaDriftGlow {
    0%   { transform: translate(0, 0) scale(1); }
    100% { transform: translate(-3%, 2%) scale(1.05); }
}
.wda-header .eyebrow {
    display: inline-block;
    font-size: 11.5px;
    letter-spacing: .12em;
    color: var(--wd-accent-light);
    background: rgba(var(--wd-accent-rgb), .12);
    border: 1px solid rgba(var(--wd-accent-rgb), .35);
    padding: 5px 14px;
    border-radius: 999px;
    margin-bottom: 18px;
}
.wda-header h1 {
    font-size: 34px;
    font-weight: 800;
    margin: 0 0 12px;
    background: linear-gradient(180deg, #fff, #f0d9c8 70%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}
.wda-header p {
    color: rgba(var(--wd-text-rgb), .65);
    font-size: 14.5px;
    margin: 0;
}

/* ===== فیلترها ===== */
.wda-filters {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
    max-width: 1160px;
    margin: 0 auto;
    padding: 0 24px 46px;
}
.wda-filter-btn {
    display: inline-block;
    padding: 8px 20px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, .12);
    background: rgba(255, 255, 255, .02);
    color: rgba(var(--wd-text-rgb), .65);
    font-size: 12.5px;
    text-decoration: none;
    transition: .25s;
}
.wda-filter-btn:hover { color: var(--wd-text); border-color: rgba(var(--wd-accent-rgb), .45); }
.wda-filter-btn.is-active {
    background: linear-gradient(135deg, var(--wd-accent), var(--wd-accent-light));
    border-color: transparent;
    color: #1a0d04;
    font-weight: 800;
    box-shadow: 0 8px 24px -8px rgba(var(--wd-accent-rgb), .55);
}

/* ===== گرید بنتو — اولین/جدیدترین مقاله بزرگ‌تر ===== */
.wda-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    max-width: 1160px;
    margin: 0 auto;
    padding: 0 24px 100px;
}
.wda-card {
    position: relative;
    background: linear-gradient(180deg, rgba(255, 255, 255, .035), rgba(255, 255, 255, .01));
    border: 1px solid rgba(255, 255, 255, .1);
    border-radius: 18px;
    overflow: hidden;
    text-decoration: none;
    display: flex;
    flex-direction: column;
    transition: transform .35s cubic-bezier(.2, .8, .2, 1), border-color .3s ease, box-shadow .35s ease;
}
.wda-card:hover {
    transform: translateY(-6px);
    border-color: rgba(var(--wd-accent-rgb), .5);
    box-shadow: 0 24px 55px -20px rgba(var(--wd-accent-rgb), .4);
}
.wda-card.featured { grid-column: span 2; grid-row: span 2; }
.wda-card .img-wrap { position: relative; overflow: hidden; }
.wda-card .img-wrap img {
    width: 100%;
    height: 210px;
    object-fit: cover;
    display: block;
    transition: transform .6s ease;
    background: rgba(255, 255, 255, .05);
}
.wda-card.featured .img-wrap img { height: 340px; }
.wda-card:hover .img-wrap img { transform: scale(1.06); }
.wda-card .img-wrap::after {
    content: "";
    position: absolute; inset: 0;
    background: linear-gradient(180deg, transparent 40%, rgba(var(--wd-bg-rgb, 12, 12, 14), .9));
}
.wda-card-body { padding: 20px 22px 24px; flex: 1; display: flex; flex-direction: column; }
.wda-category {
    align-self: flex-start;
    display: inline-block;
    color: var(--wd-accent-light);
    background: rgba(var(--wd-accent-rgb), .14);
    border: 1px solid rgba(var(--wd-accent-rgb), .35);
    padding: 4px 12px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
}
.wda-card h3 {
    color: var(--wd-text);
    margin: 14px 0 8px;
    line-height: 1.55;
    font-weight: 800;
    font-size: 18px;
}
.wda-card.featured h3 { font-size: 26px; }
.wda-card p {
    color: rgba(var(--wd-text-rgb), .65);
    font-size: 13.5px;
    line-height: 1.85;
    margin: 0;
}
.wda-date {
    color: rgba(var(--wd-text-rgb), .4);
    font-size: 11px;
    margin-top: auto;
    padding-top: 16px;
    display: block;
}

.wda-empty {
    text-align: center;
    color: rgba(var(--wd-text-rgb), 0.55);
    padding: 80px 20px 120px;
    font-size: 15px;
}

@media (max-width: 860px) {
    .wda-grid { grid-template-columns: repeat(2, 1fr); }
    .wda-card.featured { grid-column: span 2; grid-row: span 1; }
    .wda-card.featured .img-wrap img { height: 210px; }
    .wda-card.featured h3 { font-size: 18px; }
}
@media (max-width: 560px) {
    .wda-header { padding: calc(var(--wds-nav-h, 66px) + 40px) 20px 50px; }
    .wda-grid { grid-template-columns: 1fr; }
    .wda-card.featured { grid-column: span 1; }
}

/* ===== صفحه‌ی جزئیات یک مقاله ===== */
.wda-detail {
    max-width: 980px;
    margin: 0 auto;
    padding: calc(var(--wds-nav-h, 74px) + 46px) 24px 110px;
}
.wda-detail h1 {
    color: var(--wd-text);
    font-size: 30px;
    margin: 16px 0 16px;
    line-height: 1.6;
    font-weight: 800;
}
.wda-meta {
    color: rgba(var(--wd-text-rgb), 0.45);
    font-size: 12px;
    margin-bottom: 26px;
}
.wda-cover {
    width: 100%;
    border-radius: 16px;
    margin-bottom: 34px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* نوار پیشرفت مطالعه — درست زیر نوار بالای سایت می‌چسبه */
.wda-progress-track {
    position: sticky;
    top: var(--wds-nav-h, 74px);
    height: 3px;
    background: rgba(255, 255, 255, .06);
    border-radius: 3px;
    margin-bottom: 30px;
    z-index: 15;
}
.wda-progress-fill {
    height: 100%;
    width: 0%;
    border-radius: 3px;
    background: linear-gradient(90deg, var(--wd-accent), var(--wd-accent-light));
    transition: width .1s linear;
}

/* چیدمان: فهرست مطالب + متن مقاله */
.wda-layout {
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: 40px;
    align-items: start;
}
.wda-toc {
    position: sticky;
    top: calc(var(--wds-nav-h, 74px) + 30px);
    align-self: start;
}
.wda-toc-label {
    font-size: 11px;
    color: rgba(var(--wd-text-rgb), .5);
    letter-spacing: .08em;
    margin-bottom: 12px;
}
.wda-toc a {
    display: block;
    padding: 7px 0 7px 14px;
    border-right: 2px solid rgba(255, 255, 255, .12);
    color: rgba(var(--wd-text-rgb), .55);
    text-decoration: none;
    font-size: 13px;
    transition: .2s;
}
.wda-toc a.is-active { color: var(--wd-accent-light); border-color: var(--wd-accent-light); font-weight: 700; }
.wda-toc a:hover { color: var(--wd-text); }

@media (max-width: 860px) {
    .wda-layout { grid-template-columns: 1fr; }
    .wda-toc { display: none; }
}

.wda-body {
    color: rgba(var(--wd-text-rgb), 0.85);
    font-size: 15.5px;
    line-height: 2.1;
}
.wda-body h1, .wda-body h2, .wda-body h3 { color: var(--wd-text); margin: 28px 0 14px; scroll-margin-top: calc(var(--wds-nav-h, 74px) + 20px); }
.wda-body img { max-width: 100%; border-radius: 12px; margin: 16px 0; }
.wda-body a { color: var(--wd-accent-light); }
.wda-body blockquote {
    border-right: 3px solid var(--wd-accent);
    padding: 6px 18px;
    color: rgba(var(--wd-text-rgb), 0.6);
    margin: 20px 0;
}
.wda-back {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 30px;
    color: rgba(var(--wd-text-rgb), 0.7);
    text-decoration: none;
    font-size: 13px;
    transition: color .2s ease;
}
.wda-back:hover { color: var(--wd-accent-light); }

/* ===== CTA پایان مقاله ===== */
.wda-cta {
    margin-top: 48px;
    padding: 32px 24px;
    border-radius: 16px;
    text-align: center;
    background: rgba(var(--wd-accent-rgb), 0.08);
    border: 1px solid rgba(var(--wd-accent-rgb), 0.25);
}
.wda-cta p {
    margin: 0 0 20px;
    color: rgba(var(--wd-text-rgb), 0.8);
    font-size: 15px;
    line-height: 1.8;
}
.wda-cta-actions {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 14px;
}
.wda-cta-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 12px 28px;
    border-radius: 999px;
    font-size: 14px;
    text-decoration: none;
    transition: transform .3s ease, background .3s ease, box-shadow .3s ease, color .3s ease;
}
.wda-cta-btn--fill {
    background: var(--wd-accent);
    color: #1a0c00;
}
.wda-cta-btn--fill:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 24px rgba(var(--wd-accent-rgb), 0.35);
}
.wda-cta-btn--ghost {
    background: transparent;
    color: var(--wd-accent-light);
    border: 1px solid rgba(var(--wd-accent-rgb), 0.5);
}
.wda-cta-btn--ghost:hover {
    background: rgba(var(--wd-accent-rgb), 0.15);
    transform: translateY(-2px);
}
