/* =========================================
   VARIABLES & THEMING
   ========================================= */
:root {
    --background-color: #FAFAFA;
    --text-color: #191919;
    --link-color: gray;
    --link-hover-color: #212A37;
    --body-font: sans-serif;
    --code-bg: #eee;
    --container-bg: #f0f0f0;
}

@media (prefers-color-scheme: dark) {
    :root {
        --background-color: #141414;
        --text-color: #c0c0c0;
        --link-color: #60a5fa;
        --link-hover-color: #4ade80;
        --code-bg: #333333;
        --container-bg: #191919; 
    }
}

/* =========================================
   BASE LAYOUT & TYPOGRAPHY
   ========================================= */
body {
    background-color: var(--background-color);
    color: var(--text-color);
    font-family: var(--body-font);
    margin: 0;
    padding: 0;
}

#container {
    max-width: 900px;
    margin: 0 auto;
    padding: 2.5em;
    background-color: var(--container-bg);
    font-family: Lato-light, sans-serif;
}

/* The "Book" Look */
p {
    line-height: 2.0;
    text-align: justify;
    text-indent: 2.5em; 
    margin-top: 0;
    margin-bottom: 0.5em; 
}

/* The "Regular" Look */
p2 {
    line-height: 2.0;
    text-align: left;
    text-indent: 2.5em; 
    margin-top: 0;
    margin-bottom: 0.5em; 
}

/* Links */
a {
    color: var(--link-color);
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: var(--link-hover-color);
    text-decoration: underline;
    text-underline-offset: 4px;
}

/* Images (Small rounded corners added) */
img {
    max-width: 100%;
    height: auto;
    border-radius: 8px; /* Rounded corners */
    display: block; 
}

/* =========================================
   COLUMN LAYOUT OPTIONS
   ========================================= */
/* Wrap text in <div class="two-column"> for double columns. It will automatically collapse back to a single column on phones. */
.two-column {
    column-count: 2;
    column-gap: 2em;
    text-align: justify;
}

/* =========================================
   EXPLICIT SIDE-BY-SIDE LAYOUT
   ========================================= */
.side-by-side {
    display: grid;
    grid-template-columns: 1fr 1fr; /* Two equal columns */
    gap: 2em;
    align-items: start; /* Keeps content aligned to the top */
    margin-bottom: 1.5em;
}

/* Ensure images inside this grid behave nicely */
.side-by-side img {
    width: 100%;
    height: auto;
}

/* =========================================
   LETTER FORMATTING (Salutations & Signatures)
   ========================================= */
.letter-signoff p {
    text-align: right;
    text-indent: 0; /* Removes the book indent */
    line-height: 1.5; /* Tighter line height for signatures */
    margin: 0;
}

.letter-signoff {
    margin-top: 2em; /* Space between letter body and sign off */
}

.letter-salutation p {
    text-align: left;
    text-indent: 0; /* Removes the book indent */
    line-height: 1.5; /* Tighter line height for signatures */
    margin: 0;
}

.letter-salutation {
    margin-bottom: 1.5em; /* Space between letter body and sign off */
}

/* =========================================
   HEADER & SIMPLE NAV
   ========================================= */
#title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: normal;
}

hr {
  border-top: 1px solid var(--text-color); /* Matches other dividers */
  border-bottom: none;
  opacity: 0.6; /* 60% transparent */
  margin: 1em 0;
}

.simple-nav {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin: 2rem 0;
    flex-wrap: wrap;
}
   
/* =========================================
   FOOTER
   ========================================= */
.footer-nav {
    display: grid;
    grid-template-columns: 1fr auto 1fr; 
    align-items: center;
    padding-top: 2rem;
    margin-top: 3rem; 
    margin-bottom: 2rem;
    border-top: 1px solid rgba(128, 128, 128, 0.3);
}

.nav-item.left { text-align: left; }
.nav-item.center { text-align: center; }
.nav-item.right { text-align: right; }

.footer-nav a { font-weight: 500; }

.footer-info {
    text-align: center;
    margin-top: 2rem;
    padding-bottom: 2rem;
    font-size: 0.9rem;
    line-height: 1.6;
}

/* Prevents footer paragraphs from indenting like book text */
.footer-info p {
    margin: 0.5rem 0;
    opacity: 0.8;
    text-indent: 0;
    text-align: center; 
}

/* =========================================
   MOBILE RESPONSIVENESS
   ========================================= */
@media (max-width: 700px) {
    /* Collapse double columns to single column on mobile */
    .two-column {
        column-count: 1;
    }
    @media (max-width: 700px) {
    .side-by-side {
        grid-template-columns: 1fr; /* Stacks on top of each other on mobile */
    }
}

@media (max-width: 450px) {
    .footer-nav, .footer-info p {
        font-size: 0.9rem;
    }
    .simple-nav {
        gap: 1rem; 
        font-size: 0.95rem; 
    }
}