/* STATIC PAGES (pages/about, terms, eula, news)
   Layers over main.css and style-page.css (and dashboard.css for the EULA's tabs and panel).
   Text set for reading: a white card, lines kept near 70 characters, a narrow column beside
   it for what the page needs (contents, dates, stores). The article HTML comes from the
   admin's editor, so the rules here style plain elements and tolerate its leftovers. */


.pageAside {
    grid-column: span 3;
    align-self: start;
    display: flex;
    flex-direction: column;
    gap: 20px;
    min-width: 0;
}

.pageAside .specsLabel {
    margin-bottom: 0;
}

.pageCard {
    grid-column: span 7;
    background-color: #FFF;
    padding: 20px;
    min-width: 0;
}

/* ---------- prose ---------- */

.prose {
    max-width: 42em;
    line-height: 1.5;
    overflow-wrap: break-word;
}

.prose > :first-child {
    margin-top: 0;
}

.prose p, .prose ul, .prose ol {
    margin: 0 0 1em;
}

.prose h3 {
    font-size: 1.5em;
    font-weight: 700;
    line-height: 1.2;
    margin: 40px 0 12px;
    text-wrap: balance;
}

.prose h4 {
    font-size: 0.875em;
    font-weight: 700;
    color: #154734;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin: 28px 0 8px;
}

.prose ul, .prose ol {
    padding-left: 1.25em;
}

.prose li + li {
    margin-top: 4px;
}

.prose b, .prose strong {
    font-weight: 700;
}

.prose a, .prose a:link, .prose a:visited {
    text-decoration: underline;
    overflow-wrap: anywhere;
}

.prose a:hover {
    color: #154734;
}

.prose hr {
    margin: 40px 0;
    border-top-color: rgba(21, 71, 52, 0.35);
}

.prose img {
    max-width: 100%;
    height: auto;
}

/* the editor's leftovers: empty paragraphs, line breaks on their own, clearing blocks */
.prose p:empty, .prose p:has(> br:only-child) {
    display: none;
}

.prose::after {
    content: "";
    display: block;
    clear: both;
}

/* ---------- custom fonts: a collage under each project ---------- */

.prose .customCollage {
    margin: 24px 0 16px;
}

.prose .customCollage img {
    display: block;
    width: 100%;
    height: auto;
}

/* ---------- about: people, stores ---------- */

.prose img[style*="float"] {
    width: 120px;
    margin: 6px 20px 8px 0;
}

/* text beside a portrait stays beside it instead of running underneath */
.prose p, .prose h4 {
    display: flow-root;
}

.storeList {
    display: flex;
    flex-direction: column;
}

.storeList > div {
    padding: 12px 0;
    border-top: 1px solid rgba(21, 71, 52, 0.35);
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.storeList p {
    font-size: 0.875em;
}

/* ---------- terms: contents beside the text ---------- */

.pageContents {
    position: sticky;
    top: 20px;
    max-height: calc(100vh - 40px);
    overflow-y: auto;
}

.pageContents summary {
    list-style: none;
    cursor: pointer;
    padding-bottom: 12px;
}

.pageContents summary::-webkit-details-marker {
    display: none;
}

.pageContents summary i {
    margin-right: 8px;
    transition: transform 200ms;
}

.pageContents details:not([open]) summary i {
    transform: rotate(-90deg);
}

.pageContents ol {
    list-style: none;
    font-size: 0.875em;
}

.pageContents li {
    border-top: 1px solid rgba(21, 71, 52, 0.35);
}

.pageContents a {
    display: block;
    padding: 6px 0;
    transition: 200ms;
}

.pageContents a:hover {
    color: #154734;
    text-decoration: underline;
}

/* ---------- news ---------- */

.storyDate {
    grid-column: span 3;
    align-self: start;
    padding-top: 20px;
}

.storyDate .specsLabel {
    margin-bottom: 0;
}

.storyImages {
    display: flex;
    gap: 4px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    margin: 20px -20px -20px;
    background-color: #F4F6F2;
}

.storyImages img {
    flex: none;
    width: 100%;
    aspect-ratio: 2 / 1;
    object-fit: cover;
    scroll-snap-align: start;
}

/* will_paginate's own markup */
.pagination {
    grid-column: 4 / span 7;
    display: flex;
    gap: 20px;
    align-items: baseline;
    font-size: 0.875em;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.pagination .disabled {
    opacity: 0.5;
}

.pagination .current {
    font-style: normal;
    font-weight: 700;
}

.pagination a:hover {
    text-decoration: underline;
}

/* ---------- eula: one agreement per tab ---------- */

.eulaDoc {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: subgrid;
    row-gap: 20px;
}

.eulaDoc + .eulaDoc {
    padding-top: 20px;
    border-top: 1px solid #000;
}

.eulaDoc .accountPanel {
    margin-top: 0;
}

/* with the script running, one agreement shows at a time, its panel hanging from the bar */
.eulaTabs-on .eulaDoc + .eulaDoc {
    padding-top: 0;
    border-top: 0;
}

.eulaTabs-on .eulaDoc .accountPanel {
    margin-top: -20px;
}

.eulaDoc[hidden] {
    display: none;
}

/* the tabs are links here; main.css resets link colour, so the active label is set again */
a.tab-active, a.tab-active:link, a.tab-active:visited, a.tab-active:hover {
    color: #FFF;
}

/* ---------- widths ---------- */

@media only screen and (max-width: 1410px) {
    .pageCard {
        grid-column: span 5;
    }
    .pagination {
        grid-column: 4 / span 5;
    }
}

@media only screen and (max-width: 1150px) {
    .pageAside, .pageCard, .storyDate, .pagination {
        grid-column: 1 / -1;
    }
    .pageContents {
        position: static;
        max-height: none;
    }
    .storyDate {
        padding-top: 0;
        margin-bottom: -8px;
    }
}
