.rental-terms-page main { overflow: visible; }

.terms-hero {
    position: relative;
    overflow: hidden;
    padding: 94px 0 104px;
    background: linear-gradient(120deg, var(--home-sky), #fff 58%, var(--home-cream));
    text-align: center;
}

.terms-hero::before,
.terms-hero::after {
    content: "";
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
}

.terms-hero::before {
    width: 300px;
    height: 300px;
    top: -170px;
    right: 7%;
    background: var(--home-yellow);
    opacity: .32;
}

.terms-hero::after {
    width: 190px;
    height: 190px;
    bottom: -125px;
    left: 7%;
    background: var(--home-coral);
    opacity: .14;
}

.terms-hero__content { position: relative; z-index: 1; }
.terms-hero h1 { font-size: clamp(3.25rem, 7vw, 6rem); }
.terms-hero__content > p:not(.home-kicker, .terms-hero__update) {
    max-width: 680px;
    margin: 24px auto 0;
    font-size: 1.1rem;
    line-height: 1.7;
}

.terms-hero__update {
    display: inline-flex;
    gap: 5px;
    margin-top: 28px;
    padding: 9px 16px;
    border: 1px solid var(--home-border);
    border-radius: 99px;
    background: rgba(255, 255, 255, .78);
    font-size: .78rem;
}

.terms-hero__update strong { color: var(--home-blue-dark); }
.terms-intro { position: relative; z-index: 2; background: #f6f9f9; }
.terms-intro__box {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 24px;
    padding: 32px 38px;
    border-radius: 22px;
    background: var(--home-blue-dark);
    transform: translateY(-32px);
    box-shadow: var(--home-shadow);
}

.terms-intro__box > span {
    align-self: start;
    padding: 7px 11px;
    border-radius: 99px;
    background: var(--home-yellow);
    color: var(--home-ink);
    font-size: .7rem;
    font-weight: 800;
    letter-spacing: .1em;
    text-transform: uppercase;
}

.terms-intro__box p { color: rgba(255, 255, 255, .82); line-height: 1.75; }
.terms-intro__box p + p { margin-top: 10px; }
.terms-intro__box strong { color: #fff; }

.terms-content { padding: 58px 0 110px; background: #f6f9f9; }
.terms-layout { display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: 52px; align-items: start; }
.terms-aside {
    position: static;
    width: 280px;
    display: grid;
    gap: 16px;
}
.terms-summary {
    max-height: none;
    overflow: visible;
    padding: 25px 24px;
    border: 1px solid var(--home-border);
    border-radius: 22px;
    background: #fff;
    box-shadow: 0 16px 45px rgba(20, 63, 76, .07);
}

.terms-summary > p { margin-bottom: 14px; color: var(--home-ink); font-weight: 800; }
.terms-summary ol { display: grid; gap: 3px; list-style: none; counter-reset: terms-summary; }
.terms-summary li { counter-increment: terms-summary; }
.terms-summary a {
    display: grid;
    grid-template-columns: 26px 1fr;
    gap: 7px;
    padding: 6px 0;
    color: var(--home-muted);
    font-size: .79rem;
    line-height: 1.35;
    text-decoration: none;
    transition: color .2s ease, transform .2s ease;
}

.terms-summary a::before { content: counter(terms-summary, decimal-leading-zero); color: var(--home-coral); font-weight: 800; }
.terms-summary a:hover, .terms-summary a:focus-visible { color: var(--home-blue-dark); transform: translateX(3px); }
.terms-contact { padding: 17px 20px; border-radius: 16px; background: var(--home-blue); color: #fff; font-size: .84rem; text-decoration: none; }
.terms-contact strong { display: block; margin-top: 3px; color: var(--home-yellow); }

.terms-articles { grid-column: 2; display: grid; gap: 22px; }
.terms-card {
    position: relative;
    scroll-margin-top: 125px;
    overflow: hidden;
    padding: 38px 42px;
    border: 1px solid var(--home-border);
    border-radius: 24px;
    background: #fff;
    box-shadow: 0 14px 42px rgba(20, 63, 76, .055);
}

.terms-card__number {
    position: absolute;
    top: 17px;
    right: 25px;
    color: rgba(8, 127, 156, .1);
    font-family: "Cormorant Garamond", Georgia, serif;
    font-size: 5rem;
    font-weight: 700;
    line-height: 1;
}

.terms-card h2 {
    position: relative;
    max-width: calc(100% - 70px);
    margin-bottom: 23px;
    padding-bottom: 14px;
    font-size: clamp(1.8rem, 3.5vw, 2.45rem);
}

.terms-card h2::after { content: ""; position: absolute; bottom: 0; left: 0; width: 52px; height: 4px; border-radius: 9px; background: var(--home-coral); }
.terms-card__body { position: relative; }
.terms-card__body p, .terms-card__body li { color: var(--home-muted); line-height: 1.78; }
.terms-card__body p + p, .terms-card__body ul + p, .terms-card__body p + ul { margin-top: 15px; }
.terms-card__body ul { display: grid; gap: 7px; margin-left: 3px; list-style: none; }
.terms-card__body li { position: relative; padding-left: 24px; }
.terms-card__body li::before { content: "✓"; position: absolute; left: 0; color: var(--home-coral); font-weight: 800; }
.terms-card__body strong { color: var(--home-ink); }
.terms-card__body a { color: var(--home-blue-dark); font-weight: 700; }
.terms-endnote { padding-top: 12px; color: var(--home-muted); font-size: .8rem; text-align: right; }

@media screen and (max-width: 900px) {
    .terms-layout { grid-template-columns: 1fr; gap: 32px; }
    .terms-aside { position: static; width: auto; }
    .terms-articles { grid-column: auto; }
    .terms-summary { max-height: none; }
    .terms-summary ol { grid-template-columns: repeat(2, 1fr); gap: 2px 22px; }
    .terms-contact { display: none; }
}

/* Tablet portrait: keep the summary in the normal document flow. */
@media screen and (min-width: 901px) and (max-width: 1199px) and (orientation: portrait) {
    .terms-layout { grid-template-columns: 1fr; gap: 32px; }
    .terms-aside { position: static; width: auto; }
    .terms-articles { grid-column: auto; }
    .terms-summary { max-height: none; }
    .terms-summary ol { grid-template-columns: repeat(2, 1fr); gap: 2px 22px; }
    .terms-contact { display: none; }
}

/* Keep the summary visible while scrolling on landscape tablets. */
@media screen and (min-width: 641px) and (max-width: 900px) and (orientation: landscape) {
    .terms-layout { grid-template-columns: 220px minmax(0, 1fr); gap: 28px; }
    .terms-aside { width: 220px; }
    .terms-articles { grid-column: 2; }
    .terms-summary { max-height: none; }
    .terms-summary ol { grid-template-columns: 1fr; }
}

@media screen and (max-width: 640px) {
    .terms-hero { padding: 68px 0 82px; }
    .terms-hero h1 { font-size: clamp(3rem, 15vw, 4.4rem); }
    .terms-intro__box { grid-template-columns: 1fr; gap: 15px; padding: 26px 22px; }
    .terms-intro__box > span { justify-self: start; }
    .terms-content { padding: 30px 0 72px; }
    .terms-summary { padding: 22px; }
    .terms-summary ol { grid-template-columns: 1fr; }
    .terms-card { padding: 30px 22px; }
    .terms-card__number { top: 18px; right: 17px; font-size: 3.8rem; }
    .terms-card h2 { max-width: calc(100% - 48px); }
}

@media (prefers-reduced-motion: reduce) {
    .terms-summary a { transition: none; }
}
