/* ============================================================
   CATEGORY — category.php, mockup docs/mockups/category.html.
   On top of cards.css (the lead, the three beside it, the photo
   cards). The category's colour arrives as --card-color on .cat and
   is only ever a dot or a line, never a ground.
   ============================================================ */

.cat {
    padding-bottom: clamp(40px, 6vw, 80px);
}

/* ------------------------------------------------------------
   Head: crumbs, H1, the description, the count
   ------------------------------------------------------------ */
.cat-head {
    padding-top: clamp(20px, 3vw, 32px);
}

.cat-crumbs {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 14px;
    font-size: 0.85rem;
    color: var(--c-ink-faint);
}

.cat-crumbs a {
    color: var(--c-ink);
    font-weight: 600;
    text-decoration: none;
}

.cat-crumbs a:hover {
    color: var(--c-accent);
}

.cat-head__row {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px 40px;
    padding-bottom: 22px;
    border-bottom: 2px solid var(--card-color, var(--c-accent));
}

.cat-title {
    display: flex;
    align-items: center;
    gap: 14px;
    margin: 0;
    font-family: var(--font-display);
    font-size: clamp(2rem, 4vw, 3rem);
    font-weight: 700;
    line-height: 1.05;
    color: var(--c-ink);
}

.cat-title i {
    flex: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--card-color, var(--c-accent));
}

.cat-lede {
    max-width: 72ch;
    margin: 10px 0 0;
    font-size: 1.05rem;
    color: var(--c-ink-soft);
}

.cat-count {
    margin: 0;
    text-align: right;
    font-size: 0.9rem;
    line-height: 1.3;
    color: var(--c-ink-faint);
}

.cat-count b {
    font-family: var(--font-display);
    font-size: 2rem;
    color: var(--c-ink);
}

/* ------------------------------------------------------------
   The lead and the three newest (cards.css draws them)
   ------------------------------------------------------------ */
.cat-top {
    padding-top: 28px;
}

.cat-top--alone {
    grid-template-columns: minmax(0, 1fr);
}

/* ------------------------------------------------------------
   The grid
   ------------------------------------------------------------ */
.cat-item {
    /* The containing block for .save-btn, which sits on the photo. */
    position: relative;
}

.cat-item .home-card__title {
    /* An h3 here, a span on the front page. */
    margin: 0;
}

.cat-card__text {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    font-size: 0.92rem;
    color: var(--c-ink-soft);
}

.cat-more {
    display: flex;
    justify-content: center;
    margin-top: 36px;
}

.cat-more__btn {
    padding: 13px 28px;
    border: 2px solid var(--c-ink);
    border-radius: 999px;
    font-weight: 600;
    color: var(--c-ink);
    text-decoration: none;
    transition: background-color 0.2s, color 0.2s;
}

.cat-more__btn:hover {
    background: var(--c-ink);
    color: var(--c-bg);
}

.cat-all.is-loading .cat-more__btn {
    opacity: 0.6;
    pointer-events: none;
}

.cat-empty {
    margin: 40px 0 0;
    color: var(--c-ink-soft);
}

/* ------------------------------------------------------------
   Quick answers: text cards, no photos — the grid above has them
   ------------------------------------------------------------ */
.cat-qa {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 20px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.cat-qa li {
    display: flex;
}

.cat-qa__card {
    display: flex;
    flex-direction: column;
    width: 100%;
    padding: 22px 24px;
    border: 1px solid var(--c-border);
    border-top: 3px solid var(--card-color, var(--c-accent));
    border-radius: 14px;
    background: var(--c-surface);
    color: var(--c-ink);
    text-decoration: none;
}

.cat-qa__card h3 {
    margin: 0 0 8px;
    font-family: var(--font-display);
    font-size: 1.25rem;
    font-weight: 600;
    line-height: 1.15;
}

.cat-qa__card:hover h3 {
    text-decoration: underline;
    text-decoration-thickness: 2px;
    text-underline-offset: 3px;
}

.cat-qa__card p {
    display: -webkit-box;
    -webkit-line-clamp: 5;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin: 0 0 14px;
    font-size: 0.95rem;
    color: var(--c-ink-soft);
}

.cat-qa__go {
    margin-top: auto;
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--c-accent);
}

/* ------------------------------------------------------------
   Narrow screens
   ------------------------------------------------------------ */
@media (max-width: 1100px) {
    .cat-qa {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 640px) {
    .cat-count {
        text-align: left;
    }

    .cat-qa {
        grid-template-columns: minmax(0, 1fr);
    }
}
