/**
 * Shared ebook acquisition card.
 *
 * Framework utilities and tokens remain the base; this file only describes the
 * composition the utility classes cannot express: the padded cover, the compact
 * inline form row and the sticky sidebar rail.
 */

.rx-ebook-cta.card {
    display: block;
    padding: 0;
    gap: 0;
    overflow: hidden;
}

.rx-ebook-cta *,
.rx-ebook-cta *::before,
.rx-ebook-cta *::after {
    box-sizing: border-box;
}

.rx-ebook-cta__inner {
    display: block;
}

/* Cover --------------------------------------------------------------- */

.rx-ebook-cta__frame {
    position: relative;
    display: block;
    margin: 0;
    overflow: hidden;
    aspect-ratio: 3 / 4;
    container-type: inline-size;
    border-radius: var(--radius-s);
    border: 1px solid var(--bg-surface-l-2);
    background: var(--bg-surface-l-1);
    box-shadow: var(--shadow-l);
}

.rx-ebook-cta .rx-ebook-cta__frame > img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.rx-ebook-cta__cover-lockup {
    position: absolute;
    inset: auto 0 0 0;
    z-index: 1;
    display: grid;
    gap: 0.15rem;
    padding: var(--space-xs);
    background: linear-gradient(to top, rgba(0, 0, 0, 0.82) 0%, rgba(0, 0, 0, 0.35) 55%, transparent 100%);
}

.rx-ebook-cta__cover-kicker {
    color: var(--light);
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    line-height: 1.2;
    text-transform: uppercase;
    opacity: 0.72;
}

.rx-ebook-cta__cover-title {
    color: var(--light);
    font-size: clamp(0.85rem, 7.2cqw, 1.6rem);
    font-weight: 800;
    letter-spacing: 0;
    line-height: 1.15;
    text-transform: none;
    text-wrap: balance;
}

.rx-ebook-cta--inline .rx-ebook-cta__cover-lockup {
    padding: var(--space-s);
}

/* Country travel guides: the body card sets the country in Cinzel across roughly
   80% of the cover (10% margins), with the script "Travel Guide" label above it in
   the brand accent. The per-name `--rx-cover-name-size` comes from the template. */
.rx-ebook-cta--inline .rx-ebook-cta__cover-lockup--travel {
    padding: var(--space-l) 10% var(--space-m);
    text-align: center;
    justify-items: center;
}

.rx-ebook-cta--inline .rx-ebook-cta__cover-lockup--travel .rx-ebook-cta__cover-kicker {
    color: var(--primary);
    font-family: var(--pre-heading-font);
    font-size: clamp(1.9rem, 11cqw, 3.4rem);
    font-weight: 400;
    letter-spacing: 0;
    line-height: 1;
    text-transform: none;
    opacity: 1;
}

.rx-ebook-cta--inline .rx-ebook-cta__cover-lockup--travel .rx-ebook-cta__cover-title {
    color: var(--light);
    font-family: 'Cinzel', Georgia, serif;
    font-size: var(--rx-cover-name-size, 14cqw);
    font-weight: 400;
    letter-spacing: 0.01em;
    line-height: 1.1;
    white-space: nowrap;
    text-wrap: nowrap;
}


/* Sidebar: padded product band, centred cover, copy below. */
.rx-ebook-cta--sidebar .rx-ebook-cta__cover {
    display: flex;
    justify-content: center;
    padding: 2.2rem 1.8rem;
    background:
        radial-gradient(120% 120% at 50% 0%, var(--primary-10) 0%, transparent 55%),
        var(--bg-surface-l-1);
    border-bottom: 1px solid var(--bg-surface-l-2);
}

.rx-ebook-cta--sidebar .rx-ebook-cta__frame {
    width: 10.5rem;
}

.rx-ebook-cta--sidebar .rx-ebook-cta__body {
    padding: 2rem 1.8rem;
}

.rx-ebook-cta--sidebar .rx-ebook-cta__title.text-l {
    font-size: var(--text-l);
    line-height: 1.15;
}

.rx-ebook-cta--sidebar .rx-ebook-cta__form {
    margin-top: 1.2rem;
}

/* The fineprint belongs to the button, not to the block. */
.rx-ebook-cta--sidebar .rx-ebook-cta__form .ff-el-group:last-child,
.rx-ebook-cta--sidebar .rx-ebook-cta__form .ff_submit_btn_wrapper {
    margin-bottom: 0;
}

/* Inline: copy and form beside the cover. The column track is the one composition
   decision this file owns; gap and padding come from the framework spacing
   utilities on the markup (`gap-m padding-m`), so the shared fluid tokens set
   the rhythm instead of a second hand-rolled clamp. */
.rx-ebook-cta--inline.card {
    container-type: inline-size;
}

.rx-ebook-cta--inline .rx-ebook-cta__inner {
    display: grid;
    grid-template-columns: minmax(18rem, 25rem) minmax(0, 1fr);
    align-items: stretch;
}

/* The wide poster crop needs room: below 800 px of card the 250 px cover keeps the
   copy column readable, and above it the extra 40 px still leave the form's two
   fields and button on one line. */
@container (min-width: 800px) {
    .rx-ebook-cta--inline .rx-ebook-cta__inner {
        grid-template-columns: minmax(18rem, 29rem) minmax(0, 1fr);
    }
}

.rx-ebook-cta--inline .rx-ebook-cta__cover {
    display: flex;
}

.rx-ebook-cta--inline .rx-ebook-cta__frame {
    width: 100%;
    height: 100%;
    min-height: 24rem;
    aspect-ratio: auto;
}

.rx-ebook-cta--inline .rx-ebook-cta__body {
    display: flex;
    flex-direction: column;
    justify-content: center;
    /* The copy column, not the viewport, decides when the form can still fit
       two fields beside the button. */
    container-type: inline-size;
}

/* A landing slot renders the same card as an article: the cover fills the
   taller of the two columns, so the poster keeps the article crop instead of
   being squashed into a wider landscape crop by an aspect-ratio cap. */

/* Copy ---------------------------------------------------------------- */

.rx-ebook-cta .pill-primary {
    margin: 0 0 1rem;
}

/* One step down for the sidebar, where the cover already carries the weight. */
.rx-ebook-cta .pill-primary.small {
    padding: var(--space-4xs) var(--space-s);
    padding-inline-start: calc(var(--space-s) + 0.45em + var(--space-4xs));
    font-size: 1rem;
    letter-spacing: 0.09em;
    background-size: 0.45em 0.45em;
}

.rx-ebook-cta__title {
    margin: 0.4rem 0 0;
    color: var(--text-title);
    line-height: 1.2;
}

.rx-ebook-cta__promise {
    margin: 0.6rem 0 0;
    color: var(--text-body);
    font-size: 1.28rem;
    line-height: 1.45;
}

ul.rx-ebook-cta__facts {
    display: grid;
    gap: 0.5rem;
    margin: 2rem 0 1.6rem;
    padding: 0;
    list-style: none;
    color: var(--text-title);
    font-size: 1.22rem;
    line-height: 1.45;
}

ul.rx-ebook-cta__facts li {
    position: relative;
    padding-left: 2rem;
}

.rx-ebook-cta.card ul.rx-ebook-cta__facts li::before,
.rx-exit-intent__inner.card ul.rx-ebook-cta__facts li::before {
    content: "" !important;
    display: block !important;
    position: absolute;
    left: 0;
    top: 0.15em;
    width: 1.15em;
    height: 1.15em;
    background-color: var(--primary);
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 256 256'%3E%3Cpath d='M229.66,77.66l-128,128a8,8,0,0,1-11.32,0l-56-56a8,8,0,0,1,11.32-11.32L96,188.69,218.34,66.34a8,8,0,0,1,11.32,11.32Z'/%3E%3C/svg%3E") center / contain no-repeat !important;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 256 256'%3E%3Cpath d='M229.66,77.66l-128,128a8,8,0,0,1-11.32,0l-56-56a8,8,0,0,1,11.32-11.32L96,188.69,218.34,66.34a8,8,0,0,1,11.32,11.32Z'/%3E%3C/svg%3E") center / contain no-repeat !important;
}

/* Form ---------------------------------------------------------------- */

.rx-ebook-cta__form {
    margin-top: 0.4rem;
}

.rx-ebook-cta--inline .rx-ebook-cta__form {
    margin-top: 0.8rem;
}

.rx-ebook-cta .ff-el-input--label,
.rx-exit-intent__form .ff-el-input--label {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
}

.rx-ebook-cta .ff-el-group,
.rx-exit-intent__form .ff-el-group {
    margin-bottom: 0.7rem;
}

.rx-ebook-cta .ff-el-form-control,
.rx-exit-intent__form .ff-el-form-control {
    width: 100%;
    padding: 0.85rem 1rem;
    color: var(--text-title);
    font-size: 1.3rem;
    line-height: 1.4;
    background: var(--bg-surface-l-1) !important;
    border: 1px solid var(--bg-surface-l-2) !important;
    border-radius: var(--radius-s) !important;
    box-shadow: none;
}

.rx-ebook-cta .ff-el-form-control::placeholder,
.rx-exit-intent__form .ff-el-form-control::placeholder {
    color: var(--text-subtle);
}

.rx-ebook-cta .ff-el-form-control:focus,
.rx-exit-intent__form .ff-el-form-control:focus {
    background: var(--primary-10) !important;
    border-color: var(--primary) !important;
    outline: 0;
}

.rx-ebook-cta .ff_submit_btn_wrapper .ff-btn.ff-btn-submit,
.rx-exit-intent__form .ff_submit_btn_wrapper .ff-btn.ff-btn-submit {
    width: 100%;
    padding: 0.95rem 1.4rem;
    color: var(--dark);
    font-size: 1.4rem;
    font-weight: 700;
    line-height: 1.2;
    background: var(--primary);
    border: 0;
    border-radius: var(--radius-s);
    box-shadow: var(--shadow-m);
    cursor: pointer;
}

.rx-ebook-cta .ff_submit_btn_wrapper .ff-btn.ff-btn-submit:hover,
.rx-exit-intent__form .ff_submit_btn_wrapper .ff-btn.ff-btn-submit:hover {
    background: var(--light);
    color: var(--dark);
}

.rx-ebook-cta .ff_submit_btn_wrapper .ff-btn.ff-btn-submit:focus-visible,
.rx-exit-intent__form .ff_submit_btn_wrapper .ff-btn.ff-btn-submit:focus-visible {
    outline: 4px solid var(--primary);
    outline-offset: 2px;
}

.rx-ebook-cta--inline .ff_submit_btn_wrapper {
    display: flex;
    align-self: stretch;
    margin-bottom: 0;
}

.rx-ebook-cta--inline .ff_submit_btn_wrapper .ff-btn.ff-btn-submit {
    height: 100%;
}

.rx-ebook-cta--inline fieldset {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
    gap: 0.8rem;
    align-items: end;
}

.rx-ebook-cta--inline fieldset > legend {
    position: absolute;
}

.rx-ebook-cta--inline .ff-el-group {
    margin-bottom: 0;
}

.rx-ebook-cta--inline .ff-btn.ff-btn-submit {
    width: auto;
    white-space: nowrap;
}

/* Below this width the card's own copy column can no longer hold two fields
   and the button on one line, so the form stacks instead of squeezing the
   placeholders. Declared after the inline form rules so it wins the cascade. */
@container (max-width: 420px) {
    .rx-ebook-cta--inline fieldset {
        grid-template-columns: minmax(0, 1fr);
    }

    .rx-ebook-cta--inline .ff-btn.ff-btn-submit {
        width: 100%;
    }
}

.rx-ebook-cta .rx-ebook-cta__fineprint {
    margin: 0.5rem 0 0;
    color: var(--text-body);
    font-size: 1.05rem;
    line-height: 1.4;
    opacity: 0.7;
}

/* The sidebar keeps the line closer to its button; this has to follow the base
   rule above, or equal specificity lets the larger base margin win. */
.rx-ebook-cta--sidebar .rx-ebook-cta__fineprint {
    margin-top: 0.35rem;
}

.rx-ebook-cta__fineprint a {
    color: inherit;
    text-decoration: underline;
}

.rx-ebook-cta__preview {
    margin: 0.8rem 0 0;
    font-size: 1.15rem;
}

/* Sticky sidebar rail ------------------------------------------------ */

/* The existing sticky tour block follows the same offset when the offer rail
   is present, so the two modules hand over instead of overlapping. */
.rx-cta-sticky {
    position: sticky;
    top: calc(8rem + var(--space-s));
}

@media (max-width: 991px) {
    .rx-ebook-cta-rail,
    .rx-cta-sticky {
        position: static;
    }
}

@media (max-width: 767px) {
    .rx-ebook-cta--inline .rx-ebook-cta__inner {
        grid-template-columns: minmax(0, 1fr);
    }

    .rx-ebook-cta--inline .rx-ebook-cta__cover {
        display: block;
    }

    .rx-ebook-cta--inline .rx-ebook-cta__frame {
        width: 100%;
        height: auto;
        min-height: 0;
        aspect-ratio: 16 / 10;
    }

    .rx-ebook-cta--inline fieldset {
        grid-template-columns: minmax(0, 1fr);
    }

    .rx-ebook-cta--inline .ff-btn.ff-btn-submit {
        width: 100%;
    }
}

@media print {
    .rx-ebook-cta,
    .rx-ebook-cta-rail {
        display: none !important;
    }
}

/* Sticky offers rail: the ebook card plus one compact tour row. */
.rx-offers-rail {
    display: grid;
    gap: var(--space-s);
}

.rx-sidebar-tour {
    display: grid;
    grid-template-columns: 8rem minmax(0, 1fr);
    gap: var(--space-s);
    align-items: center;
    padding: var(--space-s);
    color: inherit;
    text-decoration: none;
    background: var(--bg-surface-l-1);
    border: 1px solid var(--bg-surface-l-2);
    border-radius: var(--radius-m);
}

.rx-sidebar-tour:hover,
.rx-sidebar-tour:focus-visible {
    border-color: var(--primary);
}

.rx-offers-rail .rx-sidebar-tour > img {
    width: 8rem;
    height: 8rem;
    object-fit: cover;
    border-radius: var(--radius-s);
}

.rx-sidebar-tour__body {
    display: grid;
    gap: 0.25rem;
    min-width: 0;
}

.rx-sidebar-tour__label {
    color: var(--primary);
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    line-height: 1.2;
    text-transform: uppercase;
}

.rx-sidebar-tour__title {
    display: -webkit-box;
    overflow: hidden;
    color: var(--text-title);
    font-weight: 700;
    line-height: 1.25;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
}

.rx-sidebar-tour__meta {
    overflow: hidden;
    color: var(--text-body);
    font-size: 1.05rem;
    line-height: 1.3;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Card heading context can override utility sizes; keep them authoritative. */
.rx-ebook-cta__title.text-2xl {
    font-size: var(--text-2xl);
    line-height: 1.15;
}
