/* Editorial content on category pages (Hipertexto_Seo).
   Sizes in px: Magento sets html to 62.5%, so 1rem is 10px here.
   Colours from the theme tokens in promolibro-refresh.css; the brick and gold
   accents are the ones the theme uses on the buy buttons and section titles. */

.hpt-cat-content,
.hpt-cat-intro {
    --hpt-brick: #a5351d;
    --hpt-gold: #d5a400;
}

/* Intro: a subtitle for the centred H1. */
.hpt-cat-intro {
    max-width: 760px;
    margin: -10px auto 32px;
    padding: 0 16px;
    color: var(--promolibro-text-soft, #5f6b76);
    font-size: 16px;
    line-height: 1.6;
    text-align: center;
}

/* Card, same frame as the filter block in the sidebar. */
.hpt-cat-content {
    margin: 48px 0 24px;
    background: var(--promolibro-surface, #fff);
    border: 1px solid var(--promolibro-line, #d7e1ea);
    box-shadow: var(--promolibro-shadow, 0 8px 24px rgba(3, 67, 124, .06));
}

.hpt-cat-content__story {
    padding: 36px 40px 30px;
}

.hpt-cat-content__eyebrow {
    margin: 0 0 6px;
    color: var(--hpt-brick);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .08em;
    line-height: 1.4;
    text-transform: uppercase;
}

.hpt-cat-content__title {
    margin: 0 0 22px;
    padding: 0 0 14px;
    position: relative;
    color: var(--promolibro-blue, #03437c);
    font-size: 26px;
    font-weight: 700;
    line-height: 1.25;
}

.hpt-cat-content__title::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: 0;
    width: 56px;
    height: 3px;
    background: var(--hpt-gold);
}

.hpt-cat-content__body {
    max-width: 80ch;
    color: var(--promolibro-text, #1f2933);
    font-size: 16px;
    line-height: 1.75;
}

.hpt-cat-content__body p {
    margin: 0 0 14px;
    color: inherit;
    font-size: inherit;
    line-height: inherit;
}

/* Expanded, the toggle moves under the text it revealed. Browsers that cannot
   lay out <details> as flex keep it on top, which still works. */
.hpt-cat-content__more[open] {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.hpt-cat-content__more[open] summary {
    order: 2;
}

.hpt-cat-content__body strong,
.hpt-cat-content__body b {
    color: var(--promolibro-blue-deep, #022d53);
}

.hpt-cat-content__body a {
    color: var(--promolibro-blue, #03437c);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.hpt-cat-content__more summary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 2px 0 0;
    padding: 0 0 2px;
    border-bottom: 2px solid var(--hpt-gold);
    color: var(--promolibro-blue, #03437c);
    cursor: pointer;
    font-size: 13px;
    font-weight: 800;
    letter-spacing: .06em;
    list-style: none;
    text-transform: uppercase;
}

.hpt-cat-content__more summary::-webkit-details-marker {
    display: none;
}

.hpt-cat-content__more summary::after {
    content: "";
    width: 7px;
    height: 7px;
    margin-top: -4px;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(45deg);
    transition: transform .2s ease;
}

.hpt-cat-content__more[open] summary::after {
    margin-top: 4px;
    transform: rotate(-135deg);
}

.hpt-cat-content__more summary:hover,
.hpt-cat-content__more summary:focus-visible {
    color: var(--promolibro-blue-deep, #022d53);
}

.hpt-cat-content__more-close,
.hpt-cat-content__more[open] .hpt-cat-content__more-open {
    display: none;
}

.hpt-cat-content__more[open] .hpt-cat-content__more-close {
    display: inline;
}

/* Questions and answers (seo_faq), between the story and the links. */
.hpt-cat-content__faq {
    padding: 28px 40px 30px;
    border-top: 1px solid var(--promolibro-line, #d7e1ea);
}

.hpt-cat-content__faq--first {
    border-top: 0;
}

.hpt-cat-faq {
    display: grid;
    gap: 18px;
    max-width: 80ch;
    margin: 0;
}

.hpt-cat-faq__item {
    padding: 0 0 0 16px;
    border-left: 3px solid var(--hpt-gold);
}

.hpt-cat-faq__q {
    margin: 0 0 4px;
    color: var(--promolibro-blue, #03437c);
    font-size: 16px;
    font-weight: 700;
    line-height: 1.4;
}

.hpt-cat-faq__a {
    margin: 0;
    color: var(--promolibro-text, #1f2933);
    font-size: 15px;
    line-height: 1.65;
}

/* Subcategories. */
.hpt-cat-content__nav {
    padding: 28px 40px 34px;
    background: var(--promolibro-subtle, #f6f9fc);
    border-top: 1px solid var(--promolibro-line, #d7e1ea);
}

.hpt-cat-content--links-only .hpt-cat-content__nav {
    border-top: 0;
}

.hpt-cat-content__nav-title {
    margin: 0 0 16px;
    color: var(--promolibro-text-soft, #5f6b76);
    font-size: 13px;
    font-weight: 800;
    letter-spacing: .06em;
    line-height: 1.4;
    text-transform: uppercase;
}

.hpt-cat-content__grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
    gap: 10px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.hpt-cat-content__grid li {
    margin: 0;
}

.hpt-cat-tile {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 2px;
    height: 100%;
    min-height: 62px;
    padding: 11px 40px 11px 16px;
    background: var(--promolibro-surface, #fff);
    border: 1px solid var(--promolibro-line, #d7e1ea);
    text-decoration: none;
    transition: border-color .15s ease, box-shadow .15s ease;
}

.hpt-cat-tile::after {
    content: "";
    position: absolute;
    top: 50%;
    right: 18px;
    width: 8px;
    height: 8px;
    margin-top: -4px;
    border-top: 2px solid var(--promolibro-blue, #03437c);
    border-right: 2px solid var(--promolibro-blue, #03437c);
    transform: rotate(45deg);
    transition: right .15s ease;
}

.hpt-cat-tile:hover,
.hpt-cat-tile:focus-visible {
    border-color: var(--promolibro-blue, #03437c);
    box-shadow: 0 4px 14px rgba(3, 67, 124, .1);
    text-decoration: none;
}

.hpt-cat-tile:hover::after,
.hpt-cat-tile:focus-visible::after {
    right: 14px;
}

.hpt-cat-tile__name {
    color: var(--promolibro-blue, #03437c);
    font-size: 15px;
    font-weight: 700;
    line-height: 1.3;
}

.hpt-cat-tile__count {
    color: var(--promolibro-text-soft, #5f6b76);
    font-size: 13px;
    line-height: 1.3;
}

@media (max-width: 767px) {
    .hpt-cat-intro {
        margin: 4px auto 22px;
        font-size: 15px;
    }

    .hpt-cat-content {
        margin: 32px 0 16px;
    }

    .hpt-cat-content__story {
        padding: 26px 20px 22px;
    }

    .hpt-cat-content__title {
        font-size: 22px;
    }

    .hpt-cat-content__body {
        font-size: 15px;
        line-height: 1.7;
    }

    .hpt-cat-content__nav,
    .hpt-cat-content__faq {
        padding: 22px 20px 26px;
    }

    .hpt-cat-faq__q {
        font-size: 15px;
    }

    .hpt-cat-faq__a {
        font-size: 14px;
    }

    .hpt-cat-content__grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 8px;
    }

    .hpt-cat-tile {
        min-height: 56px;
        padding: 10px 32px 10px 12px;
    }

    .hpt-cat-tile::after {
        right: 14px;
    }

    .hpt-cat-tile__name {
        font-size: 14px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .hpt-cat-tile,
    .hpt-cat-tile::after,
    .hpt-cat-content__more summary::after {
        transition: none;
    }
}
