/*
 * Terms of Service (page-templates/terms_of_service.php, page 363) and Privacy Policy (privacy_policy_page.php, page 365)
 * restyled after the new home page (MILESTONES #20, 20.17). The templates are twins: the same intro band and the same
 * section.terms-of-service-container with the page content printed by wpautop(), so they share this stylesheet. The
 * intro band, the counter, the college logos carousel, the registration and the headquarters are shared blocks
 * (site-components.css); here the long text as a card with a readable line length, its headings and lists, and the room
 * the band needs for a long description (the Terms print a 539-character excerpt).
 * The text is the page content from the database and stays as it is (legal text, TranslatePress): only its look changes.
 * The two documents are marked up differently: the Terms have no heading tags, only <strong class="s-title"> (23 sections)
 * and <strong class="si-title"> (4 sub-sections) and lettered clauses; the Privacy Policy has real h1 / h2 / h3 and bullet
 * lists. The old rules of both pages (the "TERMS OF SERVICE" block of style-divi-child.css, "Terms of service" of
 * style_tymek.css) were removed from the Divi copies.
 */

/* ---------- Intro band: room for a long description. style-divi-child.css caps the band (#collage-sports-info and
   #collage-sports-desc-container 715px with overflow hidden): the excerpt of the Terms was cut off below ~1100px. The cap
   stays on the photo, as in page-trips.css. The description had no room under it (the band ended at its last line);
   the padding is on the band, because style_tymek.css sets the margins of the description with !important on phones. */

body.amg-skin #page-container .terms-of-service-page #collage-sports,
body.amg-skin #page-container .terms-of-service-page #collage-sports-info,
body.amg-skin #page-container .terms-of-service-page #collage-sports-desc-container {
    max-height: none;
}

body.amg-skin #page-container .terms-of-service-page #collage-sports {
    padding-bottom: clamp(36px, 4vw, 60px);
}

body.amg-skin #page-container .terms-of-service-page #collage-sports-desc-container {
    overflow: visible;
    margin-left: 120px;
}

body.amg-skin #page-container .terms-of-service-page #collage-sports-image {
    max-height: 715px;
    overflow: hidden;
}

/* Tablets in portrait: with the photo beside it the 539-character description of the Terms was a 220–340px column and
   the band 760–1030px tall between 600 and 900px. The photo is decoration (the shared rules hide it below 500px); up to
   900px the description gets the width. */
@media (max-width: 900px) {
    body.amg-skin #page-container .terms-of-service-page #collage-sports-image {
        display: none;
    }
}

/* ---------- The text: a card on the soft background of the other long-text pages, about 80 characters per line. */

body.amg-skin #page-container .terms-of-service-container {
    display: block;
    width: 100%;
    padding: clamp(36px, 4.6vw, 72px) 16px clamp(48px, 5.2vw, 84px);
    background: linear-gradient(180deg, var(--amg-soft-blue) 0%, var(--amg-soft) 55%, #fff 100%);
}

body.amg-skin #page-container .terms-of-service-container > .wrapper {
    display: block;
    width: min(100%, 880px);
    max-width: none;
    height: auto;
    margin: 0 auto;
    padding: clamp(26px, 4.2vw, 60px) clamp(20px, 4.8vw, 68px) clamp(30px, 4.4vw, 60px);
    border: 1px solid var(--amg-line);
    border-radius: var(--amg-radius-lg);
    background: #fff;
    box-shadow: var(--amg-shadow);
    color: var(--amg-text);
    font-family: var(--amg-font);
}

body.amg-skin #page-container .terms-of-service-container .wrapper p,
body.amg-skin #page-container .terms-of-service-container .wrapper li {
    color: var(--amg-text);
    font-family: var(--amg-font);
    font-size: 16px;
    letter-spacing: 0;
    line-height: 1.75;
    overflow-wrap: break-word;
}

body.amg-skin #page-container .terms-of-service-container .wrapper p {
    width: auto;
    margin: 0 0 1.1em;
}

body.amg-skin #page-container .terms-of-service-container .wrapper > :last-child {
    margin-bottom: 0;
}

body.amg-skin #page-container .terms-of-service-container .wrapper strong,
body.amg-skin #page-container .terms-of-service-container .wrapper b {
    color: var(--amg-navy);
    font-weight: 700;
}

/* Links: blue with an underline (the old rule drew a border only on hover); long addresses wrap instead of widening the card. */
body.amg-skin #page-container .terms-of-service-container .wrapper a {
    padding-bottom: 0;
    border-bottom: 0;
    color: var(--amg-blue-dark);
    overflow-wrap: anywhere;
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
}

body.amg-skin #page-container .terms-of-service-container .wrapper a:hover,
body.amg-skin #page-container .terms-of-service-container .wrapper a:focus-visible {
    color: var(--amg-pink-dark);
}

/* ---------- Headings. A pink dash on a thin line separates the sections of both documents. */

body.amg-skin #page-container .terms-of-service-container .wrapper .s-title,
body.amg-skin #page-container .terms-of-service-container .wrapper h1 {
    position: relative;
    display: block;
    margin: clamp(34px, 3.6vw, 52px) 0 0;
    padding: 24px 0 0;
    border-top: 1px solid var(--amg-line);
    color: var(--amg-navy);
    font-family: var(--amg-font);
    font-style: normal;
    font-weight: 800;
    text-decoration: none;
    text-transform: none;
}

body.amg-skin #page-container .terms-of-service-container .wrapper .s-title::before,
body.amg-skin #page-container .terms-of-service-container .wrapper h1::before {
    position: absolute;
    top: -2px;
    left: 0;
    width: 48px;
    height: 3px;
    border-radius: 2px;
    background: var(--amg-pink);
    content: '';
}

/* The first section of the Terms opens the text: no line above it. */
body.amg-skin #page-container .terms-of-service-container .wrapper > p:first-child > .s-title {
    margin-top: 0;
    padding-top: 0;
    border-top: 0;
}

body.amg-skin #page-container .terms-of-service-container .wrapper > p:first-child > .s-title::before {
    display: none;
}

/* The Terms' titles are in capitals: a smaller size than the Privacy Policy's sentence case titles. */
body.amg-skin #page-container .terms-of-service-container .wrapper .s-title {
    font-size: clamp(17px, 1.5vw, 20px);
    letter-spacing: .03em;
    line-height: 1.35;
}

body.amg-skin #page-container .terms-of-service-container .wrapper h1 {
    font-size: clamp(22px, 2vw, 28px);
    letter-spacing: -.005em;
    line-height: 1.25;
}

body.amg-skin #page-container .terms-of-service-container .wrapper .si-title {
    display: block;
    margin-top: .6em;
    color: var(--amg-blue-dark);
    font-family: var(--amg-font);
    font-size: 15px;
    font-style: normal;
    font-weight: 800;
    letter-spacing: .04em;
    line-height: 1.4;
    text-decoration: none;
}

body.amg-skin #page-container .terms-of-service-container .wrapper h2,
body.amg-skin #page-container .terms-of-service-container .wrapper h3,
body.amg-skin #page-container .terms-of-service-container .wrapper h4 {
    margin: 1.7em 0 .55em;
    padding: 0;
    color: var(--amg-navy);
    font-family: var(--amg-font);
    font-weight: 700;
    letter-spacing: 0;
    text-transform: none;
}

body.amg-skin #page-container .terms-of-service-container .wrapper h2 {
    font-size: clamp(19px, 1.6vw, 22px);
    line-height: 1.3;
}

body.amg-skin #page-container .terms-of-service-container .wrapper h3,
body.amg-skin #page-container .terms-of-service-container .wrapper h4 {
    margin-top: 1.5em;
    color: var(--amg-blue-dark);
    font-size: 17px;
    line-height: 1.35;
}

/* A heading straight after a heading needs no extra room. */
body.amg-skin #page-container .terms-of-service-container .wrapper h1 + h2,
body.amg-skin #page-container .terms-of-service-container .wrapper h2 + h3 {
    margin-top: 1.1em;
}

/* ---------- Lists. The Terms' lists are lettered clauses ("you state and pledge that you: (a) … (b) …"), as the old
   rule made them; the Privacy Policy's are bullet lists of definitions and data types. */

body.amg-skin #page-container .terms-of-service-container .wrapper ul,
body.amg-skin #page-container .terms-of-service-container .wrapper ol {
    margin: 0 0 1.2em;
    padding-left: 2em;
}

body.amg-skin #page-container .terms-of-service-container .wrapper ul {
    list-style-type: disc;
}

body.amg-skin #page-container .terms-of-service-container .wrapper ol {
    list-style-type: decimal;
}

body.amg-skin.page-template-terms_of_service #page-container .terms-of-service-container .wrapper ul,
body.amg-skin.page-template-terms_of_service #page-container .terms-of-service-container .wrapper ol {
    list-style-type: lower-alpha;
}

body.amg-skin #page-container .terms-of-service-container .wrapper li {
    margin: 0 0 .7em;
    padding-left: .25em;
}

body.amg-skin #page-container .terms-of-service-container .wrapper li:last-child {
    margin-bottom: 0;
}

body.amg-skin #page-container .terms-of-service-container .wrapper li::marker {
    color: var(--amg-blue-dark);
    font-weight: 700;
}

body.amg-skin #page-container .terms-of-service-container .wrapper li p:last-child {
    margin-bottom: 0;
}

/* The cookie icon inside a list item of the Privacy Policy. */
body.amg-skin #page-container .terms-of-service-container .wrapper img {
    max-width: 100%;
    height: auto;
    vertical-align: middle;
}

/* ---------- Phones: the text uses the whole width (a card with side margins would leave ~320px for the line). */

@media (max-width: 560px) {
    /* style_tymek.css (≤500px, shared with the technical page vp, which keeps its old look) sets the padding of the
       section and the first padding of every Terms title with !important. */
    body.amg-skin #page-container .terms-of-service-container {
        padding: 0 0 36px !important;
        background: #fff;
    }

    body.amg-skin #page-container .terms-of-service-container .wrapper .s-title {
        padding-top: 22px !important;
    }

    body.amg-skin #page-container .terms-of-service-container .wrapper > p:first-child > .s-title {
        padding-top: 0 !important;
    }

    body.amg-skin #page-container .terms-of-service-container > .wrapper {
        width: 100%;
        padding: 28px 18px 30px;
        border-width: 1px 0;
        border-radius: 0;
        box-shadow: none;
    }

    body.amg-skin #page-container .terms-of-service-container .wrapper ul,
    body.amg-skin #page-container .terms-of-service-container .wrapper ol {
        padding-left: 1.6em;
    }
}
