*,
*::before,
*::after {
    box-sizing: border-box;
}

:root {
    /* Color scheme (light mode default) */
    --main-color: hsl(228, 28%, 37%);
    --bg-color: hsl(49, 28%, 96%);
    --text-color: hsl(228, 28%, 17%);
    --accent-dark-color: hsl(228, 28%, 23%);
    --accent-light-color: hsl(228, 28%, 60%);
    --internal-link-color: hsl(228, 50%, 42%);
    --external-link-color: hsl(349, 45%, 42%);

    /* Base font scaling */
    font-size: clamp(15px, 1vw + 0.5rem, 18px);
}

html {
    min-height: 100%;
    background-color: var(--bg-color);
    scrollbar-gutter: stable;
}

body {
    min-height: 100%;
    margin: 0;
    color: var(--text-color);
    background-color: transparent;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

#content {
    display: none;
}

/* =========================
   General containers
========================= */
.main-container {
    max-width: max(100%,960px);
    margin: 0 auto;
    padding-left: 1rem;
    padding-right: 1rem;
    font-family: Georgia, serif;
    font-size: 1rem;
    line-height: clamp(1.3, 1.2 + 0.5vw, 1.5);
    color: var(--text-color);
    container-type: inline-size;
}

.content-container {
    padding: 0.625rem;
}

/* Links */
.main-container a {
    color: var(--external-link-color);
    text-decoration: none;
}

.main-container a:hover {
    text-decoration: underline dotted;
}

.main-container a:active {
    text-decoration: underline;
}

a.external {
    color: var(--external-link-color)
}

a.internal {
    color: var(--internal-link-color)
}

/* =========================
   Collapsibles
========================= */
.mainDetails,
.secondaryDetails {
    margin: 0 auto -5px;
}

.mainDetails[open] {
    margin-bottom: 0;
}

.mainDetails > summary,
.secondaryDetails > summary {
    display: block;
    cursor: pointer;
    text-decoration: underline;
    touch-action: manipulation;
}

.mainDetails > summary {
    font-weight: bold;
    margin: 0.625rem auto;
}

.mainDetails[open] > summary {
    margin-bottom: 0.5rem;
}

.mainDetails ul {
    margin: 0 auto 0.625rem;
}

.secondaryDetails > summary {
    font-weight: normal;
    font-style: italic;
    margin: 0.4375rem auto;
}

.secondaryDetails[open] > summary {
    margin-bottom: 0.375rem;
}

.secondaryDetails ul {
    list-style-type: "-  ";
}

/* =========================
   Header & navigation
========================= */
.header {
    position: relative; 
    z-index: 1;         
    background-color: var(--bg-color); 
    overflow: hidden;

    display: flex;
    justify-content: space-between;
    align-items: center;           
    padding: 0.5rem 1rem;          
}

.header::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    
    background-image: var(--banner-url);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    
    /* Change this value to adjust the image "alpha" level */
    opacity: 0.3; 
    
    z-index: -1; /* Puts the image behind the text */
}

.leftheader {
    text-align: left;
    text-shadow:
        0.03125rem  0.03125rem 0.125rem var(--bg-color),
       -0.03125rem  0.03125rem 0.125rem var(--bg-color),
        0.03125rem -0.03125rem 0.125rem var(--bg-color),
       -0.03125rem -0.03125rem 0.125rem var(--bg-color);
}

.leftheader a {
    color: var(--main-color);
    text-decoration: none;
}

/* Navigation */
.rightheader {
    text-align: right;
}

.rightheader nav ul {
    display: flex;
    flex-wrap: nowrap;
    margin: 0;
    padding: 0;
    list-style: none;
}

.rightheader nav ul li a {
    display: block;
    padding: 0.875rem 0.875rem;
    min-width: 5rem;
    white-space: nowrap;
    text-align: center;
    background-color: var(--main-color);
    color: var(--bg-color);
    text-decoration: none;
}

.rightheader nav ul li:first-child a {
    border-radius: 0.1875rem 0 0 0.1875rem;
}

.rightheader nav ul li:last-child a {
    border-radius: 0 0.1875rem 0.1875rem 0;
}

.rightheader nav ul li:not(:first-child) a {
    border-left: 0.0625rem solid var(--accent-dark-color);
}

.rightheader nav ul li:not(:last-child) a {
    border-right: 0.0625rem solid var(--accent-dark-color);
}

.rightheader nav ul li a:hover,
.rightheader nav ul li a:active {
    background-color: var(--accent-dark-color);
}

/* =========================
   Footer
========================= */
.footer {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: baseline;
    gap: 0.5rem;
    margin: 0 0.625rem;
}

.leftfooter,
.rightfooter {
    padding: 0.625rem 0;
}

.leftfooter {
    text-align: left;
}

.rightfooter {
    text-align: right;
}

/* =========================
   Typography
========================= */
h1,
h2,
h3 {
    color: var(--main-color);
}

h1 {
    margin: 0.3125rem auto 0.625rem;
}

h2 {
    margin: 0.3125rem auto;
}

h3 {
    margin: 0;
    line-height: 1.1;
}

.name-subtitle {
    margin: 0.3125rem auto;
}

.subtitle {
    font-style: italic;
    margin: 0 auto 0.3125rem;
}

.footer-p {
    margin: 0.3125rem auto 0;
}

br {
    display: block;
    margin: 1.25rem 0;
}

/* =========================
   Date lines
========================= */
.flexspan {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 0.5rem;
    align-items: flex-start;
}

.flexspan .title {
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.date {
    min-width: 8.3em;
    font-size: 0.9em;
    font-style: italic;
    text-align: right;
}

/* =========================
   Horizontal lines
========================= */
.hline {
    width: 100%;
    background-color: var(--main-color);
}

.wline {
    width: 100%;
    height: 0.2em;
    margin: 0;
    background-color: var(--bg-color);
}

/* =========================
   Mobile-first breakpoints
========================= */
@media (min-width: 40rem) { /* tablets / desktops */
    .main-container {
        max-width: 60rem;
        font-size: 1.125rem;
        padding-left: 1.25rem;
        padding-right: 1.25rem;
    }

    .header,
    .footer {
        flex-wrap: nowrap;
    }

    .rightheader {
        text-align: right;
    }
}

/* =========================
   Accessibility: reduced motion
========================= */
@media (prefers-reduced-motion: reduce) {
    * {
        animation: none !important;
        transition: none !important;
    }
}

/* =========================
   Container queries (optional future enhancement)
========================= */
@container (max-width: 40rem) {
    .header,
    .footer {
        flex-direction: column;
        align-items: flex-start;
    }

    .rightheader {
        text-align: left;
    }
}
