/* Reference typography and colors, retaining Bootstrap 5. */
:root {
    --bs-body-font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
        "Helvetica Neue", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji",
        "Segoe UI Symbol";
    --bs-body-font-size: 1rem;
    --bs-body-line-height: 1.5;
    --bs-body-color: #212529;
    --bs-link-color: #017369;
    --bs-link-color-rgb: 1, 115, 105;
    --bs-link-hover-color: #68b8af;
    --bs-link-hover-color-rgb: 104, 184, 175;
}

/* Keep content and anchor targets below the fixed navigation. */
html {
    scroll-padding-top: 4.5rem;
}

body {
    padding-top: 3.5rem;
    background: #fff;
    color: var(--bs-body-color);
    font-family: var(--bs-body-font-family);
    font-size: var(--bs-body-font-size);
    font-weight: 400;
    line-height: var(--bs-body-line-height);
}

main {
    min-height: 70vh;
}

h1,
h2,
h3,
h4,
h5,
h6,
.h1,
.h2,
.h3,
.h4,
.h5,
.h6 {
    margin-top: 0;
    margin-bottom: 0.5rem;
    color: inherit;
    font-family: inherit;
    font-weight: 500;
    line-height: 1.2;
}

h1,
.h1 {
    font-size: 2.5rem;
}

h1 {
    padding-top: 10px;
}

h2,
.h2 {
    font-size: 2rem;
}

h3,
.h3 {
    font-size: 1.75rem;
}

h4,
.h4 {
    font-size: 1.5rem;
}

h5,
.h5 {
    font-size: 1.25rem;
}

h6,
.h6 {
    font-size: 1rem;
}

small,
.small {
    font-size: 80%;
}

a {
    color: var(--bs-link-color);
    text-decoration: none;
}

a:hover {
    color: var(--bs-link-hover-color);
    text-decoration: underline;
}

a:focus-visible {
    outline: 2px solid #017369;
    outline-offset: 3px;
}

/* Bootstrap 5 button states use the reference palette, including focus. */
.btn {
    --bs-btn-border-radius: 0.25rem;
}

.btn-primary {
    --bs-btn-color: #fff;
    --bs-btn-bg: #017369;
    --bs-btn-border-color: #529f99;
    --bs-btn-hover-color: #fff;
    --bs-btn-hover-bg: #68b8af;
    --bs-btn-hover-border-color: #529f99;
    --bs-btn-focus-shadow-rgb: 82, 159, 153;
    --bs-btn-active-color: #fff;
    --bs-btn-active-bg: #017369;
    --bs-btn-active-border-color: #529f99;
    --bs-btn-disabled-color: #fff;
    --bs-btn-disabled-bg: #017369;
    --bs-btn-disabled-border-color: #529f99;
}

.btn-lg {
    --bs-btn-border-radius: 0.3rem;
    --bs-btn-font-size: 1.25rem;
}

/* Fixed navigation, matching the reference's 56px desktop header. */
.navbar {
    --bs-dark-rgb: 52, 58, 64;
    --bs-navbar-color: rgba(255, 255, 255, 0.5);
    --bs-navbar-hover-color: rgba(255, 255, 255, 0.75);
    min-height: 3.5rem;
    margin-bottom: 0;
}

.navbar-brand {
    font-size: 1.25rem;
    font-weight: 400;
}

/* Keep every menu entry reachable on short mobile screens. */
@media (max-width: 991.98px) {
    .navbar .navbar-collapse.show {
        max-height: calc(100vh - 3.5rem);
        max-height: calc(100dvh - 3.5rem);
        overflow-y: auto;
    }
}

/* Match the reference's container widths and horizontal gutters. */
.container,
.row {
    --bs-gutter-x: 30px;
}

.container {
    max-width: none;
}

@media (min-width: 576px) {
    .container {
        max-width: 540px;
    }
}

@media (min-width: 768px) {
    .container {
        max-width: 720px;
    }
}

@media (min-width: 992px) {
    .container {
        max-width: 960px;
    }
}

@media (min-width: 1200px) {
    .container {
        max-width: 1140px;
    }
}

.lead {
    line-height: 1.5;
}

/* Cards */
.card {
    --bs-card-border-color: rgba(0, 0, 0, 0.125);
    --bs-card-border-radius: 0.25rem;
    --bs-card-inner-border-radius: calc(0.25rem - 1px);
    --bs-card-spacer-x: 1.25rem;
    --bs-card-spacer-y: 1.25rem;
    --bs-card-cap-padding-x: 1.25rem;
    --bs-card-cap-padding-y: 0.75rem;
    --bs-card-cap-bg: rgba(0, 0, 0, 0.03);
    box-shadow: none;
}

.card-title {
    margin-bottom: 0.75rem;
    font-weight: 500;
}

.home-article-list .list-group-item {
    padding: 5px;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: var(--bs-link-color);
}

.home-article-list .list-group-item:hover {
    color: var(--bs-link-hover-color);
}

/* Article archive */
.table th {
    white-space: nowrap;
}

.table td {
    vertical-align: middle;
}

/* Magazine archive */
.card-img-top {
    object-fit: contain;
    padding: 10px;
    max-height: 230px;
}

/* Article */
article,
section {
    max-width: 900px;
}

section p {
    margin-bottom: 1rem;
}

/* Footer: reference background, text size, spacing and link colors. */
.site-footer {
    background: #343a40;
    color: #fff;
    font-size: 1rem;
}

.site-footer a {
    display: inline-block;
    padding: 5px;
    color: var(--bs-link-color);
}

.site-footer a:hover,
.site-footer a:focus-visible {
    color: var(--bs-link-hover-color);
}

.site-footer a:focus-visible {
    outline-color: #68b8af;
}

/* Mobile */
@media (max-width: 767.98px) {
    main {
        padding-top: 1rem !important;
    }
}
