/* =========================
   Base / Type Selectors
   ========================= */

*,
*::before,
*::after {
  box-sizing: border-box; /* makes width/padding/border predictable */
}

html {
  font-size: 100%;
}

body {
  background-color: #f4f4f4;     /* light gray background */
  color: #222222;                /* dark readable text */
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1rem;               /* relative unit */
  margin: 0;                     /* deliberate reset */
  line-height: 1.6;
  text-align: left;
}

h1,
h2,
h3,
.nav-links a {
  font-family: Arial, Helvetica, sans-serif;
}

h1 {
  color: #990000;                /* deep red for main heading */
  font-size: 2.2rem;
  font-weight: 700;
  line-height: 1.2;
  margin: 0 0 0.75rem 0;
}

h2 {
  color: #003366;                /* dark blue section headings */
  font-size: 1.6rem;
  font-weight: 700;
  line-height: 1.3;
  margin: 0 0 1rem 0;
}

h3 {
  color: #222222;
  font-size: 1.2rem;
  font-weight: 600;
  line-height: 1.3;
  margin: 0 0 0.75rem 0;
}

/* =========================
   Nav (Class selector)
   ========================= */

.nav-links {
  list-style: none;
  padding: 0;                    /* box-model choice */
  margin: 1rem 0 0 0;            /* box-model choice */
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.nav-links li {
  margin-right: 0;
}

.nav-links a {
  color: #0066cc;                /* blue navigation links */
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.25rem 0;            /* padding increases clickable box */
  border-bottom: 2px solid transparent;
}

.nav-links a:hover,
.nav-links a:focus {
  border-bottom-color: #0066cc;
  text-decoration: underline;
}

/* =========================
   ID Selector
   ========================= */

#intro {
  color: #660000;                /* slightly darker red on homepage title */
  font-weight: 600;
}

/* =========================
   Box Model Layout (REQUIRED)
   ========================= */

/* Header is a box too */
header {
  padding: 1.5rem;               /* uses rem */
  border-bottom: 2px solid #222222;
}

/* (C) Center main with width + margin:auto */
main {
  width: min(1200px, 92%);
  margin: 2rem auto;             /* centers horizontally */
  padding: 1.5rem;               /* uses rem */
  border: 2px solid #222222;
  background-color: #ffffff;
}

/* (B) Style sections as intentional boxes */
section {
  margin: 1.25rem 0;             /* outside spacing between sections */
  padding: 1rem;                 /* inside spacing for content */
  border: 2px dashed #555555;
}

/* (B) Style paragraphs as boxes */
p {
  margin: 0 0 1rem 0;
  padding: 0.5rem;
  border-left: 4px solid #999999;
  max-width: 70ch;
}

/* Your existing descendant selector idea (kept) */
article p {
  font-size: 1.05em;             /* relative to parent font size */
}

/* Lists */
ul,
ol {
  margin: 0 0 1rem 0;
  padding-left: 1.5rem;
}

li {
  margin-bottom: 0.4rem;
}

/* General links */
a {
  color: #0066cc;
}

a:hover,
a:focus {
  text-decoration: none;
}

/* Semantic text elements */
strong {
  font-weight: 700;
}

em {
  font-style: italic;
}

i {
  font-style: italic;
}

cite {
  font-style: italic;
}

/* Picture/img box (about page) */
picture img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 1rem 0;
  padding: 0.25rem;
  border: 2px solid #222222;
}

/* Quote box (index page) */
blockquote {
  margin: 1rem 0;
  padding: 1rem;
  border: 2px solid #222222;
  background-color: #ffffff;
  line-height: 1.6;
}

/* Code styling if applicable */
code,
pre {
  font-family: "Courier New", Courier, monospace;
  font-size: 0.95rem;
}

pre {
  overflow-x: auto;
  line-height: 1.5;
}

/* Footer box */
footer {
  padding: 1rem 1.5rem;
  border-top: 2px solid #222222;
  font-size: 0.9rem;
}

/* =========================
   (D) Nested box-sizing Demo
   ========================= */

.nested-demo {
  margin-top: 1.5rem;
  padding: 1rem;
  border: 2px solid #222222;
  background-color: #ffffff;
}

.nested-demo .child-default {
  width: 100%;
  padding: 1rem;
  border: 2px solid #222222;
  margin-bottom: 1rem;
  box-sizing: content-box;
}

.nested-demo .child-borderbox {
  width: 100%;
  padding: 1rem;
  border: 2px solid #222222;
  box-sizing: border-box;
}

/* =========================
   Image Styling (CSS3 Demo)
   ========================= */

img {
  max-width: 100%;
  height: auto;
  border-radius: 10px;
  margin: 1rem 0;
  box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}

/* Optional hover effect */
img:hover {
  transform: scale(1.02);
  transition: transform 0.2s ease;
}

/* =========================
   FLEXBOX ADDITIONS
   ========================= */

.flex-layout {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  align-items: flex-start;
}

.main-column {
  flex: 2 1 600px;
  min-width: 0;
}

.sidebar {
  flex: 1 1 280px;
  min-width: 0;
}