/* =====================================================
   WS04 – Page Layout
   CSS Grid (page structure) + Flexbox (navbar)
   All WS03 styles are preserved below.
   ===================================================== */


/* ── 1. RESET & BASE ─────────────────────────────── */
*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    background-color: #f0f4f8;
    font-family: Georgia, serif;
    margin: 0;
    padding: 0;
}

/* ── 2. PAGE WRAPPER ─────────────────────────────── */
/* Centers all top-level blocks to max 1000px */
header,
nav,
.layout-grid,
footer {
    max-width: 1000px;
    margin-left: auto;
    margin-right: auto;
    padding-left: 24px;
    padding-right: 24px;
}


/* ── 3. HEADER ───────────────────────────────────── */
header {
    padding-top: 32px;
    padding-bottom: 12;
}


/* ── 4. PROFESSIONAL HEADER ──────────────────────── */
@keyframes slideInDown {
    from { transform: translateY(-40px); opacity: 0; }
    to   { transform: translateY(0);     opacity: 1; }
}

.site-header__content {
    background: linear-gradient(120deg, #1a3a5c 0%, #2f5f89 65%, #4682b4 100%);
    color: #ffffff;
    padding: 18px 24px 20px;
    border-radius: 10px 10px 0 0;
    margin-bottom: 0;
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.16);
    animation: slideInDown 0.8s ease-out forwards;
}

.site-header__kicker {
    display: inline-block;
    font-size: 0.8rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #cfe4f6;
    margin-bottom: 6px;
}

.site-header__title {
    margin: 0;
    font-size: 1.7rem;
    line-height: 1.2;
    color: #ffffff;
}

.site-header__subtitle {
    margin-top: 8px;
    font-size: 0.98rem;
    color: #e6f1fa;
    max-width: 65ch;
}


/* ── 5. NAV – FLEXBOX ────────────────────────────── */
/*
 * Flexbox is used here for a horizontal navbar.
 * display: flex  → puts all child <a> tags in a row
 * gap            → even spacing between links
 * align-items    → vertically centres them
 */
nav {
    display: flex;
    gap: 1.5rem;
    align-items: center;
    background-color: #1a3a5c;
    padding-top: 12px;
    padding-bottom: 12px;
    border-radius: 0 0 8px 8px;
    margin-bottom: 28px;
}

nav a {
    color: #ffffff;
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: bold;
    letter-spacing: 0.04em;
    padding: 4px 8px;
    border-radius: 4px;
    transition: background-color 0.2s ease;
}

nav a:hover {
    background-color: steelblue;
}

nav a.active {
    background-color: steelblue;
    pointer-events: none;   /* current page link is not clickable */
}


/* ── 6. LAYOUT GRID – CSS GRID ───────────────────── */
/*
 * CSS Grid is used here for the two-column page layout.
 * grid-template-columns: 260px 1fr
 *   → fixed 260px sidebar on the left, remaining space for main
 * gap → space between sidebar and main
 */
.layout-grid {
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: 28px;
    align-items: start;
    margin-bottom: 40px;
}


/* ── 7. ASIDE (SIDEBAR) ──────────────────────────── */
aside {
    background-color: #ffffff;
    border: 2px solid steelblue;
    border-radius: 10px;
    padding: 20px 18px;
    box-shadow: 3px 3px 10px rgba(0, 0, 0, 0.08);
    /* Sidebar sticks to the top when scrolling */
    position: sticky;
    top: 16px;
}

aside h2 {
    margin-top: 0;
}

aside h3 {
    color: #1a3a5c;
    margin-top: 16px;
    margin-bottom: 6px;
}

aside code {
    background-color: #e8f4fd;
    color: #1a3a5c;
    font-family: monospace;
    font-size: 0.9rem;
    padding: 1px 5px;
    border-radius: 3px;
    border: 1px solid #b8d8f0;
}

aside a {
    display: inline-block;
    color: steelblue;
    font-weight: bold;
    font-size: 0.9rem;
    text-decoration: none;
    margin-top: 4px;
    transition: color 0.2s ease;
}

aside a:hover {
    color: #1a3a5c;
    text-decoration: underline;
}


/* ── 8. MAIN CONTENT ─────────────────────────────── */
main section {
    margin-bottom: 32px;
}


/* ── 9. FOOTER ───────────────────────────────────── */
footer {
    background-color: #1a3a5c;
    color: #c8d8e8;
    text-align: center;
    padding-top: 16px;
    padding-bottom: 16px;
    border-radius: 8px 8px 0 0;
    margin-top: 0;
    max-width: 100%;          /* footer spans full width */
}

footer p {
    margin: 0;
    font-size: 0.9rem;
    background: none;
    border: none;
    padding: 0;
    color: #c8d8e8;
}

footer p::first-letter {
    /* reset the WS03 drop-cap so footer text looks normal */
    font-size: inherit;
    font-weight: inherit;
    color: inherit;
    float: none;
    margin-right: 0;
}


/* ── 10. TYPOGRAPHY – ported from WS03 ──────────── */
h2::before {
    content: "▸ ";
    color: steelblue;
}

h2::after {
    content: "";
    display: block;
    width: 40px;
    height: 3px;
    background-color: steelblue;
    margin-top: 4px;
    border-radius: 2px;
}

p {
    color: #2c3e50;
    font-size: 1.1rem;
    line-height: 1.7;
    padding: 12px 16px;
    background-color: #ffffff;
    border-left: 4px solid steelblue;
    border-radius: 4px;
}

p::first-letter {
    font-size: 2rem;
    font-weight: bold;
    color: steelblue;
    float: left;
    line-height: 1;
    margin-right: 4px;
}


/* ── 11. IMAGES – ported from WS03 ──────────────── */
img {
    width: 100%;
    max-width: 300px;
    border-radius: 12px;
    border: 3px solid steelblue;
    box-shadow: 4px 4px 12px rgba(0, 0, 0, 0.2);
    display: block;
    margin: 16px 0;
    filter: grayscale(100%) brightness(80%);
    transition: all 0.5s ease-in-out;
}

img:hover {
    filter: none;
    transform: scale(1.08);
    box-shadow: 8px 8px 20px rgba(0, 0, 0, 0.4);
}


/* ── 12. LISTS – ported from WS03 ───────────────── */
ol {
    background-color: #e8f4fd;
    border: 2px solid steelblue;
    border-radius: 8px;
    padding: 12px 12px 12px 36px;
    max-width: 400px;
    list-style-type: decimal;
    color: #1a3a5c;
    line-height: 2;
}

ul {
    background-color: #fef9e7;
    border: 2px solid goldenrod;
    border-radius: 8px;
    padding: 12px 12px 12px 36px;
    max-width: 400px;
    list-style-type: square;
    color: #5d4037;
    line-height: 2;
}

li {
    font-size: 1.1rem;
    margin-bottom: 4px;
    font-weight: bold;
}

/* Pseudo-classes on list items */
ol li:nth-child(odd)  { background-color: #d0e8f8; border-radius: 4px; padding-left: 4px; }
ol li:nth-child(even) { background-color: #b8d8f0; border-radius: 4px; padding-left: 4px; }
ul li:first-child     { color: goldenrod; text-decoration: underline; }
ul li:last-child      { font-style: italic; opacity: 0.7; }


/* ── 13. FORM – ported from WS03 ────────────────── */
form {
    background-color: #ffffff;
    border: 2px solid steelblue;
    border-radius: 10px;
    padding: 24px 28px;
    max-width: 400px;
    box-shadow: 3px 3px 10px rgba(0, 0, 0, 0.1);
}

form label {
    display: block;
    font-weight: bold;
    color: #1a3a5c;
    margin-bottom: 4px;
}

form input[type="text"],
form input[type="email"] {
    width: 100%;
    padding: 8px 10px;
    margin-bottom: 16px;
    border: 1px solid steelblue;
    border-radius: 6px;
    font-size: 1rem;
    box-sizing: border-box;
    background-color: #f0f4f8;
}

form input[type="text"]:focus,
form input[type="email"]:focus {
    outline: none;
    border: 2px solid #1a3a5c;
    background-color: #ffffff;
    box-shadow: 0 0 6px rgba(70, 130, 180, 0.5);
}

form input[type="submit"] {
    background-color: steelblue;
    color: #ffffff;
    border: none;
    padding: 10px 24px;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

form input[type="submit"]:hover {
    background-color: #1a3a5c;
}
