/* Reading routes (Hipertexto_Seo, template category/route.phtml).
   Sizes in px: Magento sets html to 62.5%, so 1rem is 10px here.
   Colours from the theme tokens; brick and gold are the accents the theme uses
   on the buy buttons and section titles. Fraunces only for display type. */

.hpt-route {
    --hpt-brick: #a5351d;
    --hpt-gold: #d5a400;
    --hpt-gold-soft: #f3d36b;
    --hpt-blue: var(--promolibro-blue, #03437c);
    --hpt-deep: var(--promolibro-blue-deep, #022d53);
    --hpt-text: var(--promolibro-text, #1f2933);
    --hpt-soft: var(--promolibro-text-soft, #5f6b76);
    --hpt-line: var(--promolibro-line, #d7e1ea);
    --hpt-display: 'Fraunces', Georgia, 'Times New Roman', serif;
    --hpt-ease: cubic-bezier(.2, .7, .2, 1);
    margin: 0 0 40px;
    color: var(--hpt-text);
}

/* ── Hero ─────────────────────────────────────────────────────────────── */

.hpt-route-hero {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr);
    align-items: center;
    gap: 32px;
    min-height: 420px;
    margin: 0 0 56px;
    padding: 56px 56px 60px;
    overflow: hidden;
    background:
        radial-gradient(120% 90% at 100% 0%, rgba(77, 109, 141, .55) 0%, transparent 55%),
        linear-gradient(135deg, var(--hpt-deep) 0%, var(--hpt-blue) 62%, #0a5596 100%);
    color: #fff;
    isolation: isolate;
}

/* Fine paper grain over the gradient. */
.hpt-route-hero::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background-image: repeating-linear-gradient(115deg, rgba(255, 255, 255, .035) 0 1px, transparent 1px 7px);
}

.hpt-route-hero__glow {
    position: absolute;
    z-index: -1;
    top: -30%;
    right: -10%;
    width: 60%;
    aspect-ratio: 1;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(213, 164, 0, .32) 0%, rgba(213, 164, 0, 0) 65%);
    animation: hpt-route-glow 14s ease-in-out infinite alternate;
}

@keyframes hpt-route-glow {
    from { transform: translate(0, 0) scale(1); }
    to   { transform: translate(-8%, 12%) scale(1.15); }
}

.hpt-route-hero__eyebrow {
    margin: 0 0 14px;
    color: var(--hpt-gold-soft);
    font-size: 13px;
    font-weight: 800;
    letter-spacing: .14em;
    text-transform: uppercase;
}

.hpt-route-hero__title {
    margin: 0 0 18px;
    color: #fff;
    font-family: var(--hpt-display);
    font-size: 54px;
    font-weight: 700;
    letter-spacing: -.01em;
    line-height: 1.04;
    text-wrap: balance;
}

.hpt-route-hero__lead {
    max-width: 56ch;
    margin: 0 0 24px;
    color: rgba(255, 255, 255, .86);
    font-size: 17px;
    line-height: 1.65;
}

.hpt-route-hero__facts {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 0 0 30px;
    padding: 0;
    list-style: none;
}

.hpt-route-hero__facts li {
    margin: 0;
    padding: 7px 14px;
    border: 1px solid rgba(255, 255, 255, .28);
    border-radius: 999px;
    background: rgba(255, 255, 255, .06);
    color: rgba(255, 255, 255, .9);
    font-size: 14px;
    backdrop-filter: blur(4px);
}

.hpt-route-hero__facts strong {
    color: #fff;
    font-weight: 800;
}

.hpt-route-hero__cta {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    padding: 14px 24px;
    background: var(--hpt-gold);
    color: var(--hpt-deep);
    font-size: 15px;
    font-weight: 800;
    letter-spacing: .02em;
    text-decoration: none;
    box-shadow: 0 10px 24px rgba(0, 0, 0, .22);
    transition: transform .2s var(--hpt-ease), box-shadow .2s var(--hpt-ease), background-color .2s;
}

.hpt-route-hero__cta:hover,
.hpt-route-hero__cta:focus-visible {
    background: var(--hpt-gold-soft);
    color: var(--hpt-deep);
    text-decoration: none;
    transform: translateY(-2px);
    box-shadow: 0 14px 30px rgba(0, 0, 0, .28);
}

.hpt-route-hero__cta-arrow {
    width: 9px;
    height: 9px;
    margin-top: -4px;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(45deg);
}

.hpt-route-hero__cta:hover .hpt-route-hero__cta-arrow {
    animation: hpt-route-nudge .8s ease-in-out infinite;
}

@keyframes hpt-route-nudge {
    50% { transform: translateY(4px) rotate(45deg); }
}

/* Fanned stack of the first covers. */
.hpt-route-hero__stack {
    --spread: 44px;
    --tilt: 8deg;
    position: relative;
    height: 330px;
}

.hpt-route-hero__book {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 150px;
    aspect-ratio: 2 / 3;
    object-fit: cover;
    background: #fff;
    box-shadow: 0 18px 40px rgba(0, 0, 0, .38), 0 2px 0 rgba(255, 255, 255, .25) inset;
    transform:
        translate(-50%, -50%)
        translateX(calc((var(--i) - (var(--count) - 1) / 2) * var(--spread)))
        translateY(calc(var(--i) * -2px))
        rotate(calc((var(--i) - (var(--count) - 1) / 2) * var(--tilt)));
    transform-origin: 50% 120%;
    transition: transform .6s var(--hpt-ease);
    animation: hpt-route-fan 1.1s var(--hpt-ease) both;
    animation-delay: calc(var(--i) * 90ms + 150ms);
}

.hpt-route-hero__stack:hover {
    --spread: 62px;
    --tilt: 11deg;
}

@keyframes hpt-route-fan {
    from {
        opacity: 0;
        transform: translate(-50%, -40%) rotate(0deg);
    }
}

/* ── Timeline ─────────────────────────────────────────────────────────── */

.hpt-route-timeline {
    --line-x: 50%;
    position: relative;
    margin: 0 0 64px;
    padding: 8px 0 0;
}

.hpt-route-timeline__line {
    position: absolute;
    top: 0;
    bottom: 34px;
    left: var(--line-x);
    width: 3px;
    margin-left: -1.5px;
    background: var(--hpt-line);
}

.hpt-route-timeline__fill {
    display: block;
    width: 100%;
    height: calc(var(--progress, 0) * 100%);
    background: linear-gradient(180deg, var(--hpt-gold-soft), var(--hpt-gold));
    box-shadow: 0 0 12px rgba(213, 164, 0, .55);
}

.hpt-route-chapter {
    position: relative;
}

.hpt-route-chapter__head {
    position: relative;
    z-index: 1;
    max-width: 560px;
    margin: 0 auto 36px;
    padding: 22px 28px 20px;
    background: #fff;
    border: 1px solid var(--hpt-line);
    border-top: 3px solid var(--hpt-gold);
    text-align: center;
    box-shadow: var(--promolibro-shadow, 0 8px 24px rgba(3, 67, 124, .06));
}

.hpt-route-chapter + .hpt-route-chapter .hpt-route-chapter__head {
    margin-top: 24px;
}

.hpt-route-chapter__title {
    margin: 0 0 6px;
    color: var(--hpt-blue);
    font-family: var(--hpt-display);
    font-size: 28px;
    font-weight: 700;
    line-height: 1.2;
}

.hpt-route-chapter__text {
    margin: 0;
    color: var(--hpt-soft);
    font-size: 15px;
    line-height: 1.55;
}

.hpt-route-steps {
    margin: 0;
    padding: 0;
    list-style: none;
}

.hpt-route-step {
    position: relative;
    display: flex;
    margin: 0 0 40px;
}

.hpt-route-step--even {
    justify-content: flex-end;
}

/* Number on the line. */
.hpt-route-step__node {
    position: absolute;
    z-index: 2;
    top: 34px;
    left: var(--line-x);
    display: grid;
    place-items: center;
    width: 46px;
    height: 46px;
    margin-left: -23px;
    border: 3px solid var(--hpt-line);
    border-radius: 50%;
    background: #fff;
    color: var(--hpt-blue);
    font-family: var(--hpt-display);
    font-size: 19px;
    font-weight: 700;
    transition: background-color .35s, border-color .35s, color .35s, transform .35s var(--hpt-ease), box-shadow .35s;
}

.hpt-route-step.is-reached .hpt-route-step__node {
    border-color: var(--hpt-gold);
    background: var(--hpt-gold);
    color: var(--hpt-deep);
    box-shadow: 0 0 0 6px rgba(213, 164, 0, .18);
    transform: scale(1.06);
}

.hpt-route-step__card {
    position: relative;
    display: grid;
    grid-template-columns: 116px minmax(0, 1fr);
    gap: 22px;
    width: calc(50% - 52px);
    padding: 20px 22px 20px 20px;
    background: #fff;
    border: 1px solid var(--hpt-line);
    box-shadow: var(--promolibro-shadow, 0 8px 24px rgba(3, 67, 124, .06));
    transition: transform .3s var(--hpt-ease), box-shadow .3s var(--hpt-ease), border-color .3s;
}

/* Little arrow from the card to the line. */
.hpt-route-step__card::after {
    content: "";
    position: absolute;
    top: 48px;
    right: -8px;
    width: 14px;
    height: 14px;
    background: #fff;
    border-top: 1px solid var(--hpt-line);
    border-right: 1px solid var(--hpt-line);
    transform: rotate(45deg);
}

.hpt-route-step--even .hpt-route-step__card::after {
    right: auto;
    left: -8px;
    transform: rotate(-135deg);
}

.hpt-route-step__card:hover {
    border-color: var(--promolibro-line-strong, #b8c9d8);
    box-shadow: 0 18px 40px rgba(3, 67, 124, .14);
    transform: translateY(-4px);
}

.hpt-route-step__cover {
    display: block;
    align-self: start;
    perspective: 600px;
}

.hpt-route-step__cover img,
.hpt-route-step__nocover {
    display: block;
    width: 100%;
    aspect-ratio: 2 / 3;
    object-fit: cover;
    background: var(--promolibro-subtle, #f6f9fc);
    box-shadow: 0 10px 22px rgba(2, 45, 83, .22);
    transform-origin: 0 50%;
    transition: transform .45s var(--hpt-ease), box-shadow .45s var(--hpt-ease);
}

.hpt-route-step__nocover {
    display: grid;
    place-items: center;
    padding: 10px;
    color: var(--hpt-blue);
    font-family: var(--hpt-display);
    font-size: 14px;
    text-align: center;
}

.hpt-route-step__card:hover .hpt-route-step__cover img {
    box-shadow: 14px 16px 28px rgba(2, 45, 83, .28);
    transform: rotateY(-14deg) translateX(-2px);
}

.hpt-route-step__meta {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 0 8px;
}

.hpt-route-step__num {
    color: var(--hpt-brick);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .1em;
    text-transform: uppercase;
}

.hpt-route-step__year {
    padding: 2px 9px;
    border-radius: 999px;
    background: rgba(213, 164, 0, .14);
    color: #7a5d00;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .04em;
}

.hpt-route .hpt-route-step__title,
.hpt-route .hpt-route-step__title a,
.hpt-route .hpt-route-chapter__title,
.hpt-route .hpt-route-about__title,
.hpt-route .hpt-route-more__title,
.hpt-route .hpt-route-more__name,
.hpt-route .hpt-route-hero__title {
    font-family: var(--hpt-display);
}

.hpt-route-step__title {
    margin: 0 0 4px;
    font-family: var(--hpt-display);
    font-size: 22px;
    font-weight: 700;
    line-height: 1.2;
}

.hpt-route-step__title a {
    color: var(--hpt-deep);
    text-decoration: none;
}

.hpt-route-step__title a:hover,
.hpt-route-step__title a:focus-visible {
    color: var(--hpt-blue);
    text-decoration: underline;
    text-decoration-color: var(--hpt-gold);
    text-underline-offset: 3px;
}

.hpt-route-step__author {
    margin: 0 0 10px;
    color: var(--hpt-soft);
    font-size: 14px;
    font-style: italic;
}

.hpt-route-step__note {
    margin: 0 0 16px;
    color: var(--hpt-text);
    font-size: 15px;
    line-height: 1.6;
}

.hpt-route-step__foot {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding-top: 14px;
    border-top: 1px dashed var(--hpt-line);
}

.hpt-route-step__price {
    color: var(--hpt-blue);
    font-size: 18px;
    font-weight: 800;
}

.hpt-route-step__cta {
    display: inline-block;
    padding: 9px 18px;
    background: var(--hpt-brick);
    color: #fff;
    font-size: 13px;
    font-weight: 800;
    letter-spacing: .08em;
    text-decoration: none;
    text-transform: uppercase;
    transition: background-color .2s, transform .2s var(--hpt-ease);
}

.hpt-route-step__cta:hover,
.hpt-route-step__cta:focus-visible {
    background: #8a2a15;
    color: #fff;
    text-decoration: none;
    transform: translateY(-1px);
}

.hpt-route-step__cta--ask {
    background: var(--hpt-soft);
}

.hpt-route-timeline__end {
    position: relative;
    z-index: 1;
    margin: 8px 0 0;
    text-align: center;
}

.hpt-route-timeline__end span {
    display: inline-block;
    padding: 8px 18px;
    border: 2px solid var(--hpt-gold);
    border-radius: 999px;
    background: #fff;
    color: var(--hpt-deep);
    font-family: var(--hpt-display);
    font-size: 16px;
    font-style: italic;
}

/* Reveal: only once the script has confirmed it can show them again. */
.hpt-route.is-animated .hpt-route-step .hpt-route-step__card {
    opacity: 0;
    transform: translateX(-36px);
    transition: opacity .7s var(--hpt-ease), transform .7s var(--hpt-ease), box-shadow .3s, border-color .3s;
}

.hpt-route.is-animated .hpt-route-step--even .hpt-route-step__card {
    transform: translateX(36px);
}

.hpt-route.is-animated .hpt-route-step .hpt-route-step__node {
    opacity: 0;
    transform: scale(.4);
}

.hpt-route.is-animated .hpt-route-step.is-in .hpt-route-step__card {
    opacity: 1;
    transform: none;
}

.hpt-route.is-animated .hpt-route-step.is-in .hpt-route-step__card:hover {
    transform: translateY(-4px);
}

.hpt-route.is-animated .hpt-route-step.is-in .hpt-route-step__node {
    opacity: 1;
    transform: scale(1);
    transition-delay: .15s;
}

.hpt-route.is-animated .hpt-route-step.is-in.is-reached .hpt-route-step__node {
    transform: scale(1.06);
}

.hpt-route.is-animated .hpt-route-chapter__head {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity .7s var(--hpt-ease), transform .7s var(--hpt-ease);
}

.hpt-route.is-animated .hpt-route-chapter__head.is-in {
    opacity: 1;
    transform: none;
}

/* ── About + FAQ ─────────────────────────────────────────────────────── */

.hpt-route-about {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr);
    gap: 48px;
    margin: 0 0 48px;
    padding: 44px 48px;
    background: var(--promolibro-subtle, #f6f9fc);
    border: 1px solid var(--hpt-line);
}

.hpt-route-about__eyebrow {
    margin: 0 0 8px;
    color: var(--hpt-brick);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .1em;
    line-height: 1.4;
    text-transform: uppercase;
}

.hpt-route-about__faq .hpt-route-about__eyebrow {
    margin-bottom: 18px;
}

.hpt-route-about__title {
    margin: 0 0 18px;
    color: var(--hpt-blue);
    font-family: var(--hpt-display);
    font-size: 30px;
    font-weight: 700;
    line-height: 1.2;
}

.hpt-route-about__body {
    font-size: 16px;
    line-height: 1.75;
}

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

.hpt-route-about__body a {
    color: var(--hpt-blue);
    text-decoration: underline;
    text-underline-offset: 2px;
}

/* ── Other routes ────────────────────────────────────────────────────── */

.hpt-route-more__title {
    margin: 0 0 18px;
    color: var(--hpt-blue);
    font-family: var(--hpt-display);
    font-size: 28px;
    font-weight: 700;
}

.hpt-route-more__grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 14px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.hpt-route-more__grid li {
    margin: 0;
}

.hpt-route-more__card {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 8px;
    height: 100%;
    min-height: 160px;
    padding: 22px 22px 20px;
    overflow: hidden;
    background: linear-gradient(150deg, var(--hpt-deep), var(--hpt-blue));
    color: #fff;
    text-decoration: none;
    transition: transform .3s var(--hpt-ease), box-shadow .3s var(--hpt-ease);
}

.hpt-route-more__card::after {
    content: "";
    position: absolute;
    right: -40px;
    bottom: -40px;
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(213, 164, 0, .35), transparent 70%);
    transition: transform .5s var(--hpt-ease);
}

.hpt-route-more__card:hover,
.hpt-route-more__card:focus-visible {
    color: #fff;
    text-decoration: none;
    transform: translateY(-4px);
    box-shadow: 0 16px 34px rgba(2, 45, 83, .3);
}

.hpt-route-more__card:hover::after {
    transform: scale(1.6);
}

.hpt-route-more__name {
    font-family: var(--hpt-display);
    font-size: 21px;
    font-weight: 700;
    line-height: 1.2;
}

.hpt-route-more__teaser {
    color: rgba(255, 255, 255, .78);
    font-size: 14px;
    line-height: 1.5;
}

.hpt-route-more__count {
    margin-top: auto;
    color: var(--hpt-gold-soft);
    font-size: 13px;
    font-weight: 800;
    letter-spacing: .06em;
    text-transform: uppercase;
}

/* ── Floating step counter ───────────────────────────────────────────── */

.hpt-route-progress {
    position: fixed;
    z-index: 60;
    left: 50%;
    bottom: 22px;
    margin: 0;
    padding: 9px 18px;
    border-radius: 999px;
    background: rgba(2, 45, 83, .92);
    color: #fff;
    font-size: 14px;
    box-shadow: 0 10px 26px rgba(0, 0, 0, .25);
    opacity: 0;
    pointer-events: none;
    transform: translate(-50%, 16px);
    transition: opacity .3s, transform .3s var(--hpt-ease);
    backdrop-filter: blur(6px);
}

.hpt-route-progress strong {
    color: var(--hpt-gold-soft);
}

.hpt-route-progress.is-visible {
    opacity: 1;
    transform: translate(-50%, 0);
}

/* ── Responsive ──────────────────────────────────────────────────────── */

@media (max-width: 1023px) {
    .hpt-route-hero {
        grid-template-columns: 1fr;
        padding: 40px 32px 44px;
    }

    .hpt-route-hero__stack {
        height: 260px;
        order: -1;
    }

    .hpt-route-hero__book {
        width: 120px;
    }

    .hpt-route-hero__title {
        font-size: 44px;
    }

    .hpt-route-about {
        grid-template-columns: 1fr;
        gap: 32px;
        padding: 36px 32px;
    }
}

@media (max-width: 899px) {
    .hpt-route-timeline {
        --line-x: 22px;
    }

    .hpt-route-step,
    .hpt-route-step--even {
        justify-content: flex-start;
    }

    .hpt-route-step__card {
        width: auto;
        flex: 1;
        margin-left: 60px;
    }

    .hpt-route-step__card::after,
    .hpt-route-step--even .hpt-route-step__card::after {
        right: auto;
        left: -8px;
        transform: rotate(-135deg);
    }

    .hpt-route.is-animated .hpt-route-step .hpt-route-step__card,
    .hpt-route.is-animated .hpt-route-step--even .hpt-route-step__card {
        transform: translateY(26px);
    }

    .hpt-route-chapter__head {
        margin-left: 60px;
        text-align: left;
    }
}

@media (max-width: 767px) {
    .hpt-route-hero {
        min-height: 0;
        margin-bottom: 36px;
        padding: 30px 20px 34px;
    }

    .hpt-route-hero__stack {
        height: 210px;
        --spread: 34px;
    }

    .hpt-route-hero__book {
        width: 96px;
    }

    .hpt-route-hero__title {
        font-size: 34px;
    }

    .hpt-route-hero__lead {
        font-size: 15px;
    }

    .hpt-route-step__node {
        top: 22px;
        width: 38px;
        height: 38px;
        margin-left: -19px;
        font-size: 16px;
    }

    .hpt-route-step__card {
        grid-template-columns: 78px minmax(0, 1fr);
        gap: 14px;
        margin-left: 50px;
        padding: 16px 14px 16px 14px;
    }

    .hpt-route-step__card::after {
        top: 32px;
    }

    .hpt-route-step__title {
        font-size: 18px;
    }

    .hpt-route-step__note {
        font-size: 14px;
    }

    .hpt-route-chapter__head {
        margin-left: 50px;
        padding: 18px 18px 16px;
    }

    .hpt-route-chapter__title {
        font-size: 22px;
    }

    .hpt-route-about {
        padding: 28px 20px;
    }

    .hpt-route-about__title,
    .hpt-route-more__title {
        font-size: 24px;
    }

    .hpt-route-progress {
        bottom: 16px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .hpt-route *,
    .hpt-route *::before,
    .hpt-route *::after {
        animation: none !important;
        transition: none !important;
    }
}
