/* ==========================================================================
   Archive, detail, search and 404 templates
   Loaded after main.css; reuses the design tokens defined there.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Archive scaffolding
   -------------------------------------------------------------------------- */
.page-hero__desc {
    max-width: 62ch;
    margin-top: 22px;
    color: var(--text-muted);
    font-size: clamp(15px, 1.4vw, 18px);
    line-height: 1.8;
}

.archive-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 20px 32px;
    margin: 0 0 40px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--line-light);
}

/* Keep a clear gap between the page hero and the archive toolbar. */
.archive-news > section:nth-of-type(2),
.archive-product > section:nth-of-type(2),
.archive-solution > section:nth-of-type(2),
.search-results > section:nth-of-type(2) {
    padding-top: 32px;
}

.archive-toolbar__count {
    color: var(--text-on-light-muted);
    font-size: 13px;
    letter-spacing: .04em;
}

.archive-toolbar__count strong {
    color: var(--red);
    font-family: var(--font-latin);
    font-size: 16px;
    font-weight: 600;
}

.section--dark .archive-toolbar {
    border-color: var(--line-dark);
}

.section--dark .archive-toolbar__count {
    color: var(--text-muted);
}

.section--dark .breadcrumbs,
.section--dark .breadcrumbs a {
    color: var(--text-muted);
}

.filter-tabs {
    min-width: 0;
}

.filter-tabs__list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.filter-tabs__link {
    white-space: nowrap;
}

.filter-tabs__link.is-active {
    cursor: default;
}

.archive-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 32px;
    align-items: stretch;
}

.archive-grid--cases {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 40px;
}

.archive-grid--products {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.archive-grid > .card {
    height: 100%;
}

/* --------------------------------------------------------------------------
   2. Card variants
   -------------------------------------------------------------------------- */
.card__media-link {
    display: block;
    height: 100%;
}

.card__img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.card__img--cover {
    object-fit: cover;
}

.card__img--contain {
    object-fit: contain;
    background: var(--paper-warm);
}

.card--case .card__media {
    aspect-ratio: 16 / 9;
}

.card--case .card__body {
    padding: 32px;
}

.card--case .card__title {
    font-size: clamp(20px, 2vw, 26px);
}

.case-card__industry {
    position: absolute;
    top: 16px;
    left: 16px;
    border-color: transparent;
    background: rgba(255, 255, 255, .94);
    color: var(--ink-900);
    backdrop-filter: blur(4px);
}

.case-card__industry.tag--red {
    border-color: var(--red);
    background: var(--red);
    color: var(--paper);
}

/* Products */
.product-card__media {
    position: relative;
    display: block;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: var(--paper-warm);
}

.product-card__index {
    position: absolute;
    top: 18px;
    left: 20px;
    z-index: 1;
    color: var(--text-dark-bg);
    font-family: var(--font-latin);
    font-size: 13px;
    font-weight: 600;
    letter-spacing: .16em;
    opacity: .72;
}

.product-card__index::after {
    content: "";
    display: block;
    width: 24px;
    height: 2px;
    margin-top: 8px;
    background: var(--red);
}

.card--product .card__title {
    font-size: 22px;
}


.archive-solution .card--solution .card__title {
    font-size: clamp(22px, 2vw, 26px);
}

/* Solutions use generated icon illustrations on a warm panel. */
.solution-card__media {
    display: grid;
    place-items: center;
    aspect-ratio: 16 / 9;
    background:
        linear-gradient(135deg, rgba(47, 107, 255, .06), transparent 52%),
        var(--paper-warm);
}

.solution-card__media .card__media-link {
    display: grid;
    place-items: center;
    width: 100%;
    height: 100%;
    padding: 40px;
}

.solution-card__media .card__img {
    width: 118px;
    height: 118px;
    object-fit: contain;
    transition: transform .6s var(--ease);
}

.solution-card__media .card__img--icon {
    width: 118px;
    height: 118px;
    object-fit: contain;
}

.solution-card__media--photo .card__media-link {
    padding: 0;
}

.solution-card__media--photo .card__img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.card--solution:hover .solution-card__media .card__img {
    transform: scale(1.06);
}

/* --------------------------------------------------------------------------
   3. Detail pages
   -------------------------------------------------------------------------- */
.single-hero {
    padding: calc(var(--header-height) + 48px) 0 48px;
    border-bottom: 1px solid rgba(16, 26, 44, .06);
    background-color: #EDF4FE;
    background-image:
        linear-gradient(rgba(47, 107, 255, .05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(47, 107, 255, .05) 1px, transparent 1px),
        radial-gradient(1100px 480px at 84% -20%, rgba(47, 107, 255, .16), transparent 62%),
        linear-gradient(180deg, #F3F8FF 0%, #E6EFFC 100%);
    background-size: 52px 52px, 52px 52px, auto, auto;
    color: var(--ink-900);
}

.single-hero .breadcrumbs {
    margin-bottom: 40px;
    color: var(--text-muted);
}

.single-hero .breadcrumbs a:hover {
    color: var(--red);
}

.single-hero .eyebrow {
    color: var(--text-muted);
}

.single-hero__title {
    max-width: 26ch;
    margin-top: 18px;
    font-size: clamp(30px, 4.2vw, 56px);
    line-height: 1.18;
}

.single-hero__meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 14px;
    margin-top: 26px;
    color: var(--text-muted);
    font-size: 13px;
}

.single-hero__meta time {
    font-family: var(--font-latin);
    letter-spacing: .06em;
}

.single-hero .tag {
    border-color: var(--line-dark);
    color: var(--ink-900);
}

.single-hero .tag--red {
    border-color: rgba(47, 107, 255, .55);
    color: var(--red);
}

.single-hero__lede {
    max-width: 64ch;
    margin-top: 24px;
    color: var(--text-muted);
    font-size: 17px;
    line-height: 1.85;
}

.single-hero__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    margin-top: 32px;
}

.single-media {
    margin-top: -48px;
    margin-bottom: 0;
    position: relative;
    z-index: 1;
}

.single-media img {
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    border: 1px solid var(--line-light);
    background: var(--paper-warm);
}

.single-media--solution {
    display: grid;
    place-items: center;
    padding: 72px 24px;
    border: 1px solid var(--line-light);
    background:
        linear-gradient(135deg, rgba(47, 107, 255, .06), transparent 52%),
        var(--paper-warm);
}

.single-media--solution .single-media__img {
    width: min(220px, 42vw);
    aspect-ratio: 1;
    border: 0;
    object-fit: contain;
    background: transparent;
}

.single-footer {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-top: 64px;
    padding-top: 32px;
    border-top: 1px solid var(--line-light);
}

.single-footer .btn--ghost {
    padding-left: 0;
}

/* Two-column body: sticky consult aside + readable prose. */
.single-body__layout {
    display: grid;
    grid-template-columns: 280px minmax(0, 1fr);
    gap: clamp(40px, 5vw, 80px);
    align-items: start;
    max-width: none;
    margin-inline: 0;
}

.single-body__aside {
    position: sticky;
    top: calc(var(--header-height) + 32px);
    display: flex;
    flex-direction: column;
    gap: 26px;
}

.single-body__card {
    padding: 28px;
    border: 1px solid var(--line-light);
    background: linear-gradient(160deg, #F5F9FF 0%, #E9F1FF 100%);
}

.single-body__eyebrow {
    color: var(--red);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .18em;
}

.single-body__title {
    margin: 12px 0 22px;
    color: var(--ink-900);
    font-size: 20px;
    font-weight: 600;
    line-height: 1.5;
}

.single-body__card .btn {
    width: 100%;
}

.single-body__phone {
    margin-top: 18px;
    color: var(--text-muted);
    font-size: 12px;
    letter-spacing: .04em;
}

.single-body__phone strong {
    display: block;
    margin-top: 6px;
    color: var(--ink-900);
    font-family: var(--font-latin);
    font-size: 18px;
    font-weight: 600;
    letter-spacing: .02em;
}

.single-body__links {
    display: flex;
    flex-direction: column;
    border-top: 1px solid var(--line-light);
}

.single-body__links a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 13px 2px;
    border-bottom: 1px solid var(--line-light);
    color: var(--ink-900);
    font-size: 14px;
    transition: color var(--transition), padding-left var(--transition);
}

.single-body__links a:hover {
    padding-left: 8px;
    color: var(--red);
}

.single-body__main {
    min-width: 0;
}

.single-body__prose {
    max-width: 900px;
}

/* Product detail split hero */
.single-hero--product {
    padding-bottom: 48px;
    background-image:
        linear-gradient(rgba(47, 107, 255, .05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(47, 107, 255, .05) 1px, transparent 1px),
        radial-gradient(900px 460px at 78% -20%, rgba(47, 107, 255, .18), transparent 64%),
        linear-gradient(180deg, #F0F6FF 0%, #E2ECFB 100%);
}

.single-product__intro {
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr);
    gap: 64px;
    align-items: center;
}

.single-product__copy .single-hero__title {
    max-width: 16ch;
}

.single-product__visual {
    border: 1px solid rgba(16, 26, 44, .10);
    background: var(--paper);
    box-shadow: 0 20px 44px rgba(16, 26, 44, .10);
    overflow: hidden;
}

.single-product__visual img {
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
}

.single-hero--product .btn--outline {
    border-color: var(--line-dark);
    color: var(--ink-900);
}

.single-hero--product .btn--outline:hover {
    border-color: var(--red);
    background: transparent;
    color: var(--red);
}

/* Related sections */
.related .card-grid {
    margin-top: 8px;
}

/* --------------------------------------------------------------------------
   4. Search
   -------------------------------------------------------------------------- */
.search-results__form {
    max-width: 720px;
    margin: 40px 0 16px;
}

.search-results .search-form {
    gap: 0;
}

.search-results .search-form input[type="search"] {
    border-color: var(--line-light);
    border-right: 0;
}

.search-results__suggest {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
    margin-top: 32px;
}

/* --------------------------------------------------------------------------
   5. 404
   -------------------------------------------------------------------------- */
.error-404__hero {
    display: flex;
    align-items: center;
    min-height: 88vh;
    padding: calc(var(--header-height) + 48px) 0 48px;
    background:
        radial-gradient(900px 520px at 82% 6%, rgba(47, 107, 255, .12), transparent 60%),
        linear-gradient(135deg, var(--paper) 0%, var(--paper-warm) 60%, #FAFAFA 100%);
    color: var(--ink-900);
}

.error-404__hero .breadcrumbs {
    margin-bottom: 40px;
    color: var(--text-muted);
}

.error-404__code {
    margin-top: 8px;
    color: var(--red);
    font-family: var(--font-latin);
    font-size: clamp(96px, 18vw, 220px);
    font-weight: 700;
    line-height: .9;
    letter-spacing: -.02em;
}

.error-404__title {
    margin-top: 20px;
    font-size: clamp(30px, 4vw, 52px);
}

.error-404__desc {
    max-width: 56ch;
    margin-top: 18px;
    color: var(--text-muted);
    font-size: 16px;
    line-height: 1.8;
}

.error-404__search {
    max-width: 620px;
    margin-top: 32px;
}

.error-404__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    margin-top: 32px;
}

.error-404 .btn--outline {
    border-color: var(--line-dark);
    color: var(--ink-900);
}

.error-404 .btn--outline:hover {
    border-color: var(--red);
    background: transparent;
    color: var(--red);
}

/* Search form icon sizing across dark and light contexts. */
.search-form button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 56px;
}

.search-form button svg {
    width: 20px;
    height: 20px;
}

/* --------------------------------------------------------------------------
   6. Responsive
   -------------------------------------------------------------------------- */
@media (max-width: 1199px) {
    .single-product__intro {
        gap: 40px;
    }
}

@media (max-width: 1023px) {
    .single-body__layout {
        grid-template-columns: minmax(0, 1fr);
        gap: 40px;
    }

    .single-body__aside {
        position: static;
        order: 2;
    }

    .single-body__prose {
        max-width: none;
    }

    .archive-grid,
    .archive-grid--products {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 24px;
    }

    .archive-grid--cases {
        gap: 28px;
    }

    .single-product__intro {
        grid-template-columns: minmax(0, 1fr);
        gap: 32px;
    }

    .single-product__visual {
        order: -1;
    }
}

@media (max-width: 767px) {
    .archive-grid,
    .archive-grid--products,
    .archive-grid--cases {
        grid-template-columns: minmax(0, 1fr);
    }

    .archive-toolbar {
        align-items: flex-start;
        margin: 28px 0 32px;
    }

    .filter-tabs__list {
        gap: 8px;
    }

    .filter-tabs__link {
        padding: 6px 14px;
        font-size: 13px;
    }

    .single-hero {
        padding: calc(var(--header-height) + 48px) 0 48px;
    }

    .single-hero .breadcrumbs {
        margin-bottom: 28px;
    }

    .single-media {
        margin-top: -24px;
    }

    .single-media--solution {
        padding: 48px 20px;
    }

    .single-footer {
        align-items: flex-start;
        flex-direction: column;
    }

    .error-404__hero {
        min-height: 76vh;
        padding: calc(var(--header-height) + 48px) 0 48px;
    }

    .error-404__actions .btn {
        flex: 1 1 auto;
    }
}

/* Product archive: the page hero already provides breathing room. */
.archive-product .section {
    padding-top: 64px;
}

/* Solution hero media: cap the title image so it does not dominate the page. */
.single-solution .single-media img {
    width: 100%;
    max-width: 960px;
    margin-inline: auto;
    aspect-ratio: 12 / 5;
    object-fit: cover;
}

/* Solution detail: split hero with integrated title image. */
.single-solution__intro {
    display: grid;
    grid-template-columns: minmax(0, 1.02fr) minmax(0, .98fr);
    gap: clamp(40px, 5vw, 72px);
    align-items: center;
}

.single-solution__visual {
    margin: 0;
    overflow: hidden;
    border: 1px solid var(--line-light);
    background: var(--paper);
    box-shadow: 0 22px 48px rgba(16, 26, 44, .10);
}

.single-solution__visual img {
    display: block;
    width: 100%;
    aspect-ratio: 21 / 9;
    object-fit: cover;
}

.single-solution__visual--icon {
    display: grid;
    place-items: center;
    min-height: 280px;
    padding: 32px;
    background:
        radial-gradient(360px 260px at 78% 12%, rgba(47, 107, 255, .12), transparent 70%),
        linear-gradient(160deg, #F7FAFF 0%, #EAF2FE 100%);
}

.single-solution__visual--icon img {
    width: 180px;
    height: 180px;
    aspect-ratio: 1;
    object-fit: contain;
}

@media (max-width: 1023px) {
    .single-solution__intro {
        grid-template-columns: minmax(0, 1fr);
        gap: 32px;
    }
}

/* Solution body typography: clear section hierarchy and tighter lists. */
.single-solution .prose > p:first-of-type {
    color: var(--ink-900);
    font-size: 18px;
    line-height: 1.9;
}

.single-solution .prose h2 {
    margin: 2.1em 0 .75em;
    padding-left: 14px;
    border-left: 3px solid var(--red);
    color: var(--ink-900);
    font-size: clamp(21px, 2vw, 26px);
    font-weight: 600;
    line-height: 1.45;
}

.single-solution .prose h2:first-of-type {
    margin-top: 1.5em;
}

.single-solution .prose p {
    margin: 0 0 1.05em;
    line-height: 1.85;
}

.single-solution .prose strong {
    color: var(--ink-900);
}

.single-solution .prose ul {
    display: flex;
    flex-direction: column;
    gap: 3px;
    margin: .4em 0 1.1em;
    padding: 0;
    list-style: none;
}

.single-solution .prose li {
    position: relative;
    padding-left: 20px;
    line-height: 1.6;
}

.single-solution .prose li::before {
    content: "";
    position: absolute;
    top: .62em;
    left: 0;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--red);
}

.single-solution .prose li p {
    margin: 0;
}

.single-solution .prose img {
    border: 1px solid var(--line-light);
}

.single-solution .prose h3 {
    margin: 1.6em 0 .55em;
    color: var(--ink-900);
    font-size: 18px;
    font-weight: 600;
    line-height: 1.5;
}

/* News and product title images stay compact. */
.single-news .single-media img {
    width: 100%;
    height: clamp(260px, 30vw, 440px);
    object-fit: cover;
}

.single-product__visual img {
    aspect-ratio: 21 / 9;
}
