:root {
    color-scheme: light;
    --background: #f1f4f8;
    --surface: #ffffff;
    --text: #191b20;
    --muted: #6b7280;
    --blue: #087bff;
    --border: #dfe3ea;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    padding: 24px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: linear-gradient(160deg, #f6f8fb, #eaf0f6);
    color: var(--text);
    min-height: 100vh;
}

main {
    max-width: 980px;
    margin: 24px auto 80px;
}

a { color: var(--blue); }

a:focus-visible {
    outline: 3px solid var(--blue);
    outline-offset: 4px;
}

.site-navigation {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    padding: 10px;
    margin-bottom: 48px;
    background: rgba(255, 255, 255, .85);
    border: 1px solid var(--border);
    border-radius: 26px;
}

.site-navigation a {
    padding: 12px 18px;
    border-radius: 18px;
    text-decoration: none;
    font-size: 15px;
    font-weight: 600;
    overflow-wrap: anywhere;
}

.site-navigation a:hover {
    background: #e6f0ff;
}

.site-navigation a[aria-current="page"] {
    background: #dcecff;
    color: #0063d8;
}

h1 {
    margin: 0 0 20px;
    font-size: clamp(34px, 6vw, 60px);
    line-height: 1.12;
    letter-spacing: -.035em;
    overflow-wrap: anywhere;
}

main > p {
    max-width: 650px;
    margin: 10px 0;
    color: var(--muted);
    font-size: 19px;
    line-height: 1.65;
}

section { margin-top: 48px; }

h2 {
    margin: 0 0 14px 20px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 600;
    letter-spacing: .09em;
    text-transform: uppercase;
}

section ul {
    margin: 0;
    padding: 0;
    list-style: none;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 28px;
    overflow: hidden;
}

section li + li { border-top: 1px solid var(--border); }

section li a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 24px;
    color: var(--text);
    font-size: 19px;
    font-weight: 600;
    text-decoration: none;
    overflow-wrap: anywhere;
}

section li a::after {
    content: "›";
    flex-shrink: 0;
    color: var(--blue);
    font-size: 30px;
    font-weight: 400;
}

section li a:hover { background: #f5f9ff; }
section li:only-child:not(:has(a)) { padding: 24px; }

.content {
    padding: 28px;
    margin-top: 28px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 28px;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    font-size: 18px;
    line-height: 1.8;
}

@media (max-width: 600px) {
    body { padding: 16px; }
    main { margin-top: 8px; }
    .site-navigation { margin-bottom: 36px; border-radius: 22px; }
    .site-navigation a { padding: 10px 12px; font-size: 14px; }
    main > p { font-size: 17px; }
    section { margin-top: 36px; }
    section li a { padding: 20px; font-size: 17px; }
    .content { padding: 22px; font-size: 17px; }
}

/* Mobile navigation */
.mobile-navigation { display: none; }

@media (max-width: 600px) {
    body { padding-bottom: calc(120px + env(safe-area-inset-bottom)); }
    #pages-heading { scroll-margin-top: 24px; }

    .mobile-navigation {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        position: fixed;
        z-index: 20;
        bottom: calc(16px + env(safe-area-inset-bottom));
        left: 50%;
        transform: translateX(-50%);
        width: calc(100% - 32px);
        max-width: 420px;
        padding: 6px;
        border: 1px solid #dfe3ea;
        border-radius: 40px;
        background: rgba(248, 250, 253, .94);
        backdrop-filter: blur(16px);
        -webkit-backdrop-filter: blur(16px);
        box-shadow: 0 8px 28px rgba(30, 50, 80, .08);
    }

    .mobile-navigation a {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 5px;
        min-height: 66px;
        padding: 9px 4px;
        border-radius: 32px;
        color: #626872;
        font-size: 12px;
        font-weight: 600;
        text-decoration: none;
    }

    .mobile-navigation a[aria-current="page"] {
        background: #d2e7ff;
        color: #0068df;
        box-shadow: inset 0 0 0 1px #acd1ff;
    }

    .mobile-navigation svg {
        width: 25px;
        height: 25px;
        fill: none;
        stroke: currentColor;
        stroke-width: 1.8;
        stroke-linecap: round;
        stroke-linejoin: round;
    }
}

/* Compact bottom navigation */
@media (max-width: 600px) {
    .mobile-navigation {
        padding: 5px;
        border-radius: 34px;
    }
    .mobile-navigation a {
        min-height: 54px;
        padding: 6px 4px;
        gap: 3px;
        border-radius: 28px;
    }
    .mobile-navigation svg {
        width: 22px;
        height: 22px;
    }
}

/* Translucent bottom navigation */
@media (max-width: 600px) {
    .mobile-navigation {
        background: rgba(248, 250, 253, .25);
        border-color: rgba(180, 190, 205, .45);
        backdrop-filter: blur(6px);
        -webkit-backdrop-filter: blur(6px);
    }
    .mobile-navigation a[aria-current="page"] {
        background: rgba(150, 200, 255, .18);
        box-shadow: inset 0 0 0 1px rgba(80, 160, 255, .3);
    }
}

/* News photographs */
section li a.news-preview {
    justify-content: flex-start;
    gap: 18px;
}
.news-preview > span {
    flex: 1;
    min-width: 0;
}
.news-thumbnail {
    display: block;
    flex-shrink: 0;
    width: 112px;
    height: 84px;
    object-fit: cover;
    border-radius: 16px;
}
.news-photo {
    display: block;
    width: 100%;
    height: auto;
    max-height: 560px;
    object-fit: contain;
    margin: 28px 0;
    border-radius: 24px;
}
@media (max-width: 600px) {
    .news-thumbnail {
        width: 80px;
        height: 80px;
        border-radius: 14px;
    }
    section li a.news-preview { gap: 12px; }
}

/* Edge-to-edge news thumbnails */
section li a.news-preview.has-photo {
    position: relative;
    min-height: 120px;
    padding: 20px 24px 20px 164px;
    overflow: hidden;
}
.news-preview.has-photo .news-thumbnail {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    width: 144px;
    height: 100%;
    border-radius: 0;
    object-fit: cover;
}
@media (max-width: 600px) {
    section li a.news-preview.has-photo {
        min-height: 104px;
        padding: 16px 16px 16px 120px;
    }
    .news-preview.has-photo .news-thumbnail {
        width: 104px;
    }
}

/* Rounded right corners of news photos */
.news-preview.has-photo .news-thumbnail {
    border-top-right-radius: 24px;
    border-bottom-right-radius: 24px;
}

/* Consistent 4:3 news previews */
section li a.news-preview {
    font-size: 17px;
}
section li a.news-preview.has-photo {
    height: 108px;
    min-height: 108px;
    padding: 12px 20px 12px 164px;
}
.news-preview.has-photo .news-thumbnail {
    top: 0;
    bottom: auto;
    width: 144px;
    height: 108px;
    aspect-ratio: 4 / 3;
    object-fit: cover;
}
.news-title {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
    line-height: 1.35;
}
.news-date {
    display: block;
    margin-top: 6px;
    color: #6b7280;
    font-size: 13px;
    font-weight: 400;
    line-height: 1.3;
}
@media (max-width: 600px) {
    section li a.news-preview {
        font-size: 15px;
        gap: 8px;
    }
    section li a.news-preview.has-photo {
        height: 84px;
        min-height: 84px;
        padding: 8px 12px 8px 124px;
    }
    .news-preview.has-photo .news-thumbnail {
        width: 112px;
        height: 84px;
    }
    .news-date {
        margin-top: 4px;
        font-size: 12px;
    }
}

/* Soft photo halo */
.news-preview.has-photo .news-thumbnail {
    box-shadow: 4px 0 12px rgba(35, 65, 100, .16);
}

/* Article photo inside card */
.news-article {
    display: flow-root;
    margin-top: 28px;
    background: #fff;
    border: 1px solid #dfe3ea;
    border-radius: 28px;
    overflow: hidden;
}
.news-article-photo {
    display: block;
    float: left;
    width: 50%;
    height: auto;
    margin: 0 24px 16px 0;
    border-radius: 0 24px 24px 0;
    box-shadow: 3px 3px 12px rgba(35, 65, 100, .12);
}
.news-article-text {
    padding: 28px;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    font-size: 18px;
    line-height: 1.8;
}
@media (max-width: 600px) {
    .news-article-photo {
        float: none;
        width: 100%;
        margin: 0;
        border-radius: 0;
    }
    .news-article-text {
        padding: 22px;
        font-size: 17px;
    }
}

/* Article heading beside photograph */
.news-article {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    align-items: start;
}
.news-article .news-article-photo {
    float: none;
    width: 100%;
    height: auto;
    margin: 0;
    grid-column: 1;
}
.news-article-heading {
    grid-column: 2;
    min-width: 0;
    padding: 28px;
}
.news-article-heading h1 {
    margin: 0 0 12px;
    font-size: clamp(26px, 3vw, 36px);
    line-height: 1.2;
    letter-spacing: -.025em;
}
.news-article-heading time {
    color: #6b7280;
    font-size: 14px;
}
.news-article.without-photo .news-article-heading {
    grid-column: 1 / -1;
}
.news-article .news-article-text {
    grid-column: 1 / -1;
    min-width: 0;
}
@media (max-width: 600px) {
    .news-article {
        grid-template-columns: minmax(0, 1fr);
    }
    .news-article .news-article-photo {
        border-radius: 0 0 24px 24px;
    }
    .news-article-heading {
        grid-column: 1;
        padding: 22px 22px 0;
    }
    .news-article-heading h1 {
        font-size: 26px;
    }
    .news-article .news-article-text {
        padding-top: 18px;
    }
}

/* Article photograph halo */
.news-article .news-article-photo {
    position: relative;
    z-index: 1;
    box-shadow: 4px 2px 12px rgba(35, 65, 100, .16);
}
@media (max-width: 600px) {
    .news-article .news-article-photo {
        box-shadow: 0 4px 12px rgba(35, 65, 100, .16);
    }
}

/* Separate news preview cards */
section ul:has(a.news-preview) {
    display: flex;
    flex-direction: column;
    gap: 7px;
    background: transparent;
    border: 0;
    border-radius: 0;
    overflow: visible;
}

section ul:has(a.news-preview) > li {
    background: #fff;
    border: 1px solid #dfe3ea;
    border-radius: 24px;
    overflow: hidden;
}

section ul:has(a.news-preview) > li + li {
    border-top: 1px solid #dfe3ea;
}

.news-preview.has-photo .news-thumbnail {
    border-radius: 24px;
}
