/* ttf-brand-layer 1.0.1: mu-plugins/ttf-nav/assets/cat-hero.css */
/*
 * TTF Nav: the category band and the category guide (ttf-nav/cathero.php), on category pages with a row in
 * uploads/category-heroes/heroes.json. The band is the brand banners' sibling: the same dark ground, art composed
 * the same way, the H1 and the facts in the same type, but low (1200 x 260 art against the banners' 1200 x 453), so
 * the subcategory tiles stay in the first screen. Class prefix ttf-ch; scoped by the body class ttf-ch-on.
 */

/* The band prints the H1 and the facts, the text moves to the foot: the products header is left empty. */
body.ttf-ch-on .woocommerce-products-header { display: none; }

.ttf-ch {
    position: relative;
    overflow: hidden;
    isolation: isolate;
    margin: 0 0 1.4rem;
    border-radius: 12px;
    background: #212121;
    color: #fff;
    container-type: inline-size;
}

/* From 980 px of band: the art fills the band behind the text, as composed (products on the right); the band is
   never lower than the art at its width, so the art shows whole. */
.ttf-ch-art { position: absolute; inset: 0; z-index: -3; }
.ttf-ch-art img {
    display: block;
    width: 100%;
    height: 100%;
    max-width: none;
    object-fit: cover;
    object-position: 100% 50%;
    border-radius: 0;
}
.ttf-ch-scrim {
    position: absolute;
    inset: 0;
    z-index: -2;
    background: linear-gradient(100deg, #0b0b0b 34%, rgba(11, 11, 11, .9) 45%, rgba(11, 11, 11, .4) 58%, rgba(11, 11, 11, 0) 70%);
}
.ttf-ch-in {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
    box-sizing: border-box;
    width: 56%;
    min-height: calc(100cqw * 260 / 1200);
    padding: clamp(18px, 2.4cqw, 30px) clamp(20px, 2.6cqw, 34px);
}
.ttf-ch-eyebrow {
    margin: 0 0 8px;
    color: var(--ch-accent, #FF2A00);
    font-size: .62rem;
    font-weight: 700;
    letter-spacing: .19em;
    line-height: 1.4;
    text-transform: uppercase;
}
/* Its size comes from ttf-page-zoom.php's h1 rule (var(--ttf-h1, 38.5px) !important). */
.ttf-ch .ttf-ch-title {
    --ttf-h1: clamp(1.75rem, 1.2rem + 1.6cqw, 2.4rem);
    margin: 0;
    color: #fff;
    font-weight: 700;
    letter-spacing: -.025em;
    line-height: 1.05;
    text-transform: none;
}
.ttf-ch-lead {
    max-width: 62ch;
    margin: 10px 0 0;
    color: #d3d0cd;
    font-size: clamp(.86rem, .8rem + .25cqw, 1rem);
    line-height: 1.55;
}
.ttf-ch-facts { display: flex; flex-wrap: wrap; gap: 6px; margin: 14px 0 0; padding: 0; list-style: none; }
.ttf-ch-facts li {
    margin: 0;
    padding: 4px 10px;
    border: 1px solid rgba(255, 255, 255, .17);
    border-radius: 100px;
    background: rgba(255, 255, 255, .05);
    color: #e8e6e2;
    font-size: .68rem;
    line-height: 1.5;
    font-variant-numeric: tabular-nums;
}
.ttf-ch-facts .ttf-ch-n { border-color: rgba(255, 255, 255, .32); color: #fff; font-weight: 600; }
.ttf-ch-facts .ttf-ch-guide-link { padding: 0; border: 0; background: none; }
.ttf-ch-facts .ttf-ch-guide-link a {
    display: inline-block;
    padding: 4px 4px;
    color: var(--ch-accent, #FF2A00);
    font-weight: 600;
    text-decoration: none;
}
.ttf-ch-facts .ttf-ch-guide-link a:hover,
.ttf-ch-facts .ttf-ch-guide-link a:focus-visible { text-decoration: underline; }

/* Below 980 px of band: the art on top, the text below it in the same order. */
@container (max-width: 979.98px) {
    .ttf-ch-art { position: relative; inset: auto; z-index: auto; }
    .ttf-ch-art img { height: auto; aspect-ratio: 1200 / 260; }
    .ttf-ch-art::after {
        content: "";
        position: absolute;
        right: 0;
        bottom: 0;
        left: 0;
        height: 24%;
        background: linear-gradient(rgba(33, 33, 33, 0), #212121);
    }
    .ttf-ch-scrim { display: none; }
    .ttf-ch-in { width: auto; min-height: 0; padding: 4px clamp(16px, 4cqw, 28px) clamp(18px, 4.5cqw, 24px); }
}
/* Phone: the art band shows the window of the picture that holds its products, the lead its first sentence. */
@container (max-width: 599.98px) {
    .ttf-ch-art img { aspect-ratio: var(--ch-pa, 1200 / 260); object-position: var(--ch-px, 100%) 50%; }
    .ttf-ch .ttf-ch-title { --ttf-h1: clamp(1.55rem, 1.15rem + 3cqw, 2rem); }
    .ttf-ch-eyebrow { font-size: .58rem; letter-spacing: .15em; }
    .ttf-ch-lead { margin-top: 8px; font-size: .86rem; line-height: 1.5; }
    .ttf-ch-rest { display: none; }
    .ttf-ch-facts { gap: 5px; margin-top: 12px; }
    .ttf-ch-facts li { padding: 3px 9px; font-size: .64rem; }
}
/* Page 2 onward (is-compact): the same band, low. The art stands at the band's height on its right (its products sit
   in its right half), the eyebrow, the H1 "{Category} – Page N" and the facts on the left; no lead. Every rule here
   names .ttf-ch.is-compact, so it outranks the stacked and phone rules above at any width. */
.ttf-ch.is-compact .ttf-ch-art { position: absolute; inset: 0; z-index: -3; }
.ttf-ch.is-compact .ttf-ch-art::after { display: none; }
.ttf-ch.is-compact .ttf-ch-art img { position: absolute; top: 0; right: 0; width: auto; height: 100%; aspect-ratio: auto; object-fit: cover; }
.ttf-ch.is-compact .ttf-ch-scrim {
    display: block;
    background: linear-gradient(90deg, #0b0b0b 40%, rgba(11, 11, 11, .85) 50%, rgba(11, 11, 11, .25) 64%, rgba(11, 11, 11, 0) 76%);
}
.ttf-ch.is-compact .ttf-ch-in { width: 60%; min-height: 0; padding: clamp(16px, 2cqw, 24px) clamp(18px, 2.4cqw, 30px); }
.ttf-ch.is-compact .ttf-ch-title { --ttf-h1: clamp(1.5rem, 1.1rem + 1.2cqw, 2rem); }
.ttf-ch.is-compact .ttf-ch-facts { margin-top: 10px; }
@container (max-width: 979.98px) {
    .ttf-ch.is-compact .ttf-ch-in { width: 72%; padding: 16px clamp(16px, 4cqw, 24px); }
}
/* Phone: the text takes the width, the art stays behind it, dimmed. */
@container (max-width: 599.98px) {
    .ttf-ch.is-compact .ttf-ch-art img { opacity: .45; }
    .ttf-ch.is-compact .ttf-ch-scrim { background: linear-gradient(90deg, #0b0b0b 28%, rgba(11, 11, 11, .55) 70%, rgba(11, 11, 11, .2)); }
    .ttf-ch.is-compact .ttf-ch-in { width: auto; }
}

/* Engines without container queries: the band is about as wide as the viewport less the gutters. */
@supports not (container-type: inline-size) {
    .ttf-ch-in { min-height: 230px; }
    @media (max-width: 1035px) {
        .ttf-ch-art { position: relative; inset: auto; z-index: auto; }
        .ttf-ch-art img { height: auto; }
        .ttf-ch-scrim { display: none; }
        .ttf-ch-in { width: auto; min-height: 0; padding: 6px 20px 22px; }
    }
}

/* The category guide at the foot of the page: the category's text, whole, at a readable width, and beside it (below
   it on narrow screens) "Shop {Category}", the subcategories as links with their counts. */
.ttf-ch-guide {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 1.75rem;
    margin: 2.5rem 0 .5rem;
    padding: clamp(20px, 3vw, 36px);
    border: 1px solid var(--color-info-dark, #DEE2E6);
    border-radius: 12px;
    background: var(--color-info-light, #F8F9FA);
}
@media (min-width: 992px) {
    .ttf-ch-guide.has-nav { grid-template-columns: minmax(0, 1fr) minmax(260px, 320px); gap: 3rem; }
}
.ttf-ch-guide__main { min-width: 0; }
.ttf-ch-guide__nav { min-width: 0; }
.ttf-ch-guide .ttf-ch-guide__navtitle {
    --ttf-h3: 1rem;
    margin: .25rem 0 .7rem;
    color: var(--color-text-primary, #212529);
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.3;
}
.ttf-ch-guide__nav ul { margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--color-info-dark, #DEE2E6); }
.ttf-ch-guide__nav li {
    display: flex;
    justify-content: space-between;
    gap: .75rem;
    margin: 0;
    padding: .5rem 0;
    border-bottom: 1px solid var(--color-info-dark, #DEE2E6);
    font-size: .875rem;
    line-height: 1.35;
}
.ttf-ch-guide__nav a { color: var(--color-text-primary, #212529); font-weight: 600; text-decoration: none; }
.ttf-ch-guide__nav a:hover,
.ttf-ch-guide__nav a:focus-visible { color: var(--color-primary, #FF2A00); }
.ttf-ch-guide__n { flex: none; color: var(--color-text-description, #868E96); font-variant-numeric: tabular-nums; }
.ttf-ch-guide .ttf-ch-guide__title {
    --ttf-h2: 1.375rem; /* ttf-page-zoom.php sizes every h2 through this property, with !important */
    margin: 0 0 .9rem;
    color: var(--color-text-primary, #212529);
    font-size: 1.375rem;
    font-weight: 700;
    line-height: 1.25;
}
.ttf-ch-guide__text {
    max-width: 78ch;
    color: var(--color-text-primary, #212529);
    font-size: .9375rem;
    line-height: 1.7;
}
.ttf-ch-guide__text p { margin: 0 0 .85rem; }
.ttf-ch-guide__text p:last-child { margin-bottom: 0; }
.ttf-ch-guide__text ul { margin: 0 0 .95rem; padding-left: 1.2rem; }
.ttf-ch-guide__text li { margin: 0 0 .45rem; }
.ttf-ch-guide__text strong { font-weight: 700; }
@media (max-width: 767.98px) {
    .ttf-ch-guide { margin-top: 1.75rem; border-radius: 10px; }
    .ttf-ch-guide .ttf-ch-guide__title { --ttf-h2: 1.2rem; font-size: 1.2rem; }
    .ttf-ch-guide__text { font-size: .9rem; line-height: 1.65; }
}
