/* ==========================================================================
   BLOG ARCHIVE — BlogsAll.php (editorial / premium dark UI)
   ========================================================================== */

.blog-archive-body {
    margin: 0;
    min-height: 100vh;
    background: #07060d;
    color: #e8e4f0;
    font-family: Mainfarsi, system-ui, sans-serif;
}

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

.archive {
    position: relative;
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 1.5rem 5rem;
}

.archive__bg {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background:
        radial-gradient(ellipse 120% 80% at 50% -20%, rgba(99, 102, 241, 0.28), transparent 55%),
        radial-gradient(ellipse 80% 50% at 100% 40%, rgba(168, 85, 247, 0.12), transparent 50%),
        radial-gradient(ellipse 60% 40% at 0% 80%, rgba(201, 169, 98, 0.08), transparent 45%),
        linear-gradient(180deg, #0c0a14 0%, #07060d 45%, #05040a 100%);
}

.archive__hero,
.archive__toolbar,
.archive__grid,
.archive__empty {
    position: relative;
    z-index: 1;
}

/* — Hero — */
.archive__hero {
    padding: 5.5rem 0 2.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.archive__hero-inner {
    max-width: 52rem;
}

.archive__crumb {
    font-size: 0.8125rem;
    letter-spacing: 0.02em;
    margin-bottom: 1.25rem;
}

.archive__crumb a {
    color: rgba(201, 169, 98, 0.9);
    text-decoration: none;
}

.archive__crumb a:hover {
    text-decoration: underline;
}

.archive__crumb-sep {
    margin: 0 0.35rem;
    opacity: 0.35;
}

.archive__crumb-current {
    color: rgba(232, 228, 240, 0.55);
}

.archive__title {
    margin: 0 0 0.75rem;
    font-size: clamp(2rem, 5vw, 3.25rem);
    font-weight: 700;
    line-height: 1.15;
    letter-spacing: -0.02em;
    background: linear-gradient(135deg, #faf8ff 0%, #c9a962 45%, #a78bfa 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.archive__lead {
    margin: 0;
    font-size: 1.05rem;
    line-height: 1.75;
    color: rgba(232, 228, 240, 0.72);
    max-width: 40rem;
}

/* — Toolbar — */
.archive__toolbar {
    margin: 2rem 0 2.5rem;
    padding: 1rem 1.125rem;
    border-radius: 1.125rem;
    background:
        linear-gradient(145deg, rgba(255, 255, 255, 0.045) 0%, rgba(255, 255, 255, 0.015) 100%),
        rgba(12, 10, 20, 0.72);
    border: 1px solid rgba(255, 255, 255, 0.07);
    box-shadow:
        0 1px 0 rgba(255, 255, 255, 0.04) inset,
        0 20px 44px rgba(0, 0, 0, 0.38);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
}

.archive__form {
    margin: 0;
}

.archive__form-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 0.875rem 1rem;
}

.archive__search {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-height: 2.625rem;
    height: 2.625rem;
    padding: 0 0.875rem;
    border-radius: 0.6875rem;
    background: rgba(0, 0, 0, 0.42);
    border: 1px solid rgba(255, 255, 255, 0.09);
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.03) inset;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.archive__search:focus-within {
    border-color: rgba(201, 169, 98, 0.45);
    box-shadow:
        0 0 0 3px rgba(201, 169, 98, 0.12),
        0 1px 0 rgba(255, 255, 255, 0.04) inset;
}

.archive__search-icon {
    flex-shrink: 0;
    opacity: 0.4;
    display: flex;
    color: #c9b8e8;
}

.archive__search input {
    flex: 1;
    min-width: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
    border: none;
    background: transparent;
    color: #f4f0ff;
    font: inherit;
    font-size: 0.9375rem;
    line-height: 1.35;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
}

.archive__search input::-webkit-search-decoration,
.archive__search input::-webkit-search-cancel-button {
    -webkit-appearance: none;
    appearance: none;
}

.archive__search input::placeholder {
    color: rgba(232, 228, 240, 0.32);
}

.archive__form-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-shrink: 0;
}

.archive__sort {
    display: flex;
    align-items: center;
    gap: 0.625rem;
}

.archive__sort-label {
    font-size: 0.6875rem;
    color: rgba(232, 228, 240, 0.4);
    letter-spacing: 0.1em;
    white-space: nowrap;
}

.archive__segment {
    display: inline-flex;
    padding: 2px;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.45);
    border: 1px solid rgba(255, 255, 255, 0.07);
}

.archive__segment-item {
    position: relative;
    cursor: pointer;
    border-radius: 999px;
    padding: 0.4rem 0.95rem;
    font-size: 0.8125rem;
    line-height: 1.3;
    color: rgba(232, 228, 240, 0.6);
    white-space: nowrap;
    transition: color 0.2s ease, background 0.2s ease;
}

.archive__segment-item input {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
}

.archive__segment-item.is-active {
    background: linear-gradient(135deg, rgba(201, 169, 98, 0.38), rgba(139, 92, 246, 0.22));
    color: #fff;
    box-shadow: 0 0 0 1px rgba(201, 169, 98, 0.32);
}

.archive__submit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    min-height: 2.625rem;
    padding: 0 1.125rem;
    border-radius: 0.6875rem;
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.05) 100%);
    color: #fff;
    font: inherit;
    font-size: 0.8125rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.2s ease, border-color 0.2s ease, transform 0.15s ease;
}

.archive__submit:hover {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.16) 0%, rgba(255, 255, 255, 0.08) 100%);
    border-color: rgba(201, 169, 98, 0.35);
}

.archive__submit:active {
    transform: scale(0.98);
}

.archive__count {
    margin: 0.75rem 0 0;
    padding-top: 0.75rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    font-size: 0.8125rem;
    color: rgba(232, 228, 240, 0.42);
    letter-spacing: 0.02em;
}

/* — Empty — */
.archive__empty {
    text-align: center;
    padding: 4rem 1rem;
    color: rgba(232, 228, 240, 0.55);
}

.archive__empty a {
    color: #c9a962;
}

/* — Grid — */
.archive__grid {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr));
    gap: 1.5rem;
}

.archive-card {
    display: flex;
    flex-direction: column;
    height: 100%;
    border-radius: 1.05rem;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.07);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.35);
}

.archive-card:hover {
    border-color: rgba(201, 169, 98, 0.45);
    box-shadow: 0 24px 56px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(201, 169, 98, 0.15);
}

.archive-card__media {
    position: relative;
    aspect-ratio: 16 / 10;
    overflow: hidden;
    background: #12101a;
}

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

.archive-card__shine {
    position: absolute;
    inset: 0;
    background: linear-gradient(125deg, transparent 40%, rgba(255, 255, 255, 0.06) 50%, transparent 60%);
    opacity: 0;
    pointer-events: none;
}

.archive-card:hover .archive-card__shine {
    opacity: 1;
}

.archive-card__body {
    padding: 1.15rem 1.25rem 1.35rem;
    display: flex;
    flex-direction: column;
    flex: 1;
    gap: 0.4rem;
}

.archive-card__en {
    margin: 0;
    font-size: 0.68rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: rgba(201, 169, 98, 0.85);
    font-family: Mainenglish, system-ui, sans-serif;
}

.archive-card__title {
    margin: 0;
    font-size: 1.15rem;
    font-weight: 700;
    line-height: 1.45;
    color: #f6f3ff;
}

.archive-card__excerpt {
    margin: 0.25rem 0 0;
    font-size: 0.875rem;
    line-height: 1.65;
    color: rgba(232, 228, 240, 0.62);
    flex: 1;
}

.archive-card__meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-top: 0.75rem;
    padding-top: 0.85rem;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    font-size: 0.78rem;
}

.archive-card__views {
    color: rgba(232, 228, 240, 0.45);
}

.archive-card__cta {
    color: #c9a962;
    font-weight: 600;
}

@media screen and (max-width: 900px) {
    .archive__form-row {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }

    .archive__form-actions {
        justify-content: space-between;
        width: 100%;
    }

    .archive__sort {
        flex: 1;
        min-width: 0;
        flex-direction: column;
        align-items: stretch;
        gap: 0.4rem;
    }

    .archive__segment {
        display: flex;
        width: 100%;
    }

    .archive__segment-item {
        flex: 1;
        text-align: center;
        padding: 0.45rem 0.5rem;
        font-size: 0.75rem;
    }
}

@media screen and (max-width: 640px) {
    .archive {
        padding: 0 1rem 3.5rem;
    }

    .archive__hero {
        padding-top: 4.25rem;
    }

    .archive__toolbar {
        margin: 1.5rem 0 2rem;
        padding: 0.875rem;
        border-radius: 1rem;
    }

    .archive__search {
        min-height: 2.5rem;
        height: 2.5rem;
        padding: 0 0.75rem;
        gap: 0.45rem;
    }

    .archive__search input {
        font-size: 1rem;
    }

    .archive__form-actions {
        flex-wrap: wrap;
        gap: 0.625rem;
    }

    .archive__submit {
        flex: 1 1 100%;
        min-height: 2.375rem;
        height: 2.375rem;
        padding: 0;
        font-size: 0.8125rem;
    }

    .archive__count {
        margin-top: 0.625rem;
        padding-top: 0.625rem;
    }
}

@media screen and (max-width: 380px) {
    .archive__segment-item {
        font-size: 0.6875rem;
        padding: 0.4rem 0.35rem;
    }
}

@media screen and (min-width: 901px) {
    .archive__toolbar {
        padding: 1.125rem 1.25rem;
    }
}
