/* 
  styles.css
  Project: Typesetting Literature – "How and Why" by Frank Chimero
  Student: Viola Cherchi

  Goal here: the same Near/Far concept,
  but with more air, more white space, calmer rhythm.
*/

/* =========================================
   COLOUR TOKENS
   ========================================= */

:root {
  --colour-bg: #FAF9F6;   /* main background: soft ivory */
  --colour-text: #2E2E2E; /* body text */
  --colour-accent: #C89B3C; /* warm ochre accent */
  --colour-muted: #E6E4DE; /* subtle borders */
  --colour-ink: #1A2A40;   /* headings / quote */
}

/* =========================================
   RESET AND BASE TYPOGRAPHY
   ========================================= */

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

html {
  scroll-behavior: smooth;
}

/* Main body styles */
body {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI",
    Roboto, Arial, sans-serif;
  background-color: var(--colour-bg);
  color: var(--colour-text);
  font-size: 16px;
  line-height: 1.7; /* a bit looser for long reading */
  min-height: 100vh;
}

/* Page wrapper so footer sits at the bottom even with short content */
body > div {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* =========================================
   HEADER AND NAVIGATION
   ========================================= */

header {
  border-bottom: 1px solid var(--colour-muted);
  background-color: rgba(250, 249, 246, 0.96);
  backdrop-filter: blur(3px);
}

/* Header inner bar: title on the left, nav on the right */
header > div {
  max-width: 72rem;
  margin: 0 auto;
  padding: 1.5rem 1.75rem;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1.75rem;
}

/* Site title */
header > div > div:first-child > div:first-child {
  font-family: "Playfair Display", "Times New Roman", Georgia,
    "Palatino Linotype", serif;
  font-size: 1.3rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--colour-ink);
}

/* Site subtitle */
header > div > div:first-child > div:last-child {
  font-size: 0.85rem;
  color: var(--colour-text);
  opacity: 0.8;
  margin-top: 0.3rem;
}

/* Navigation links wrapper */
header nav > div {
  display: flex;
  gap: 1.1rem;
  font-size: 0.9rem;
}

/* Base nav link styles */
header nav a {
  text-decoration: none;
  color: var(--colour-text);
  padding-bottom: 0.15rem;
  border-bottom: 1px solid transparent;
}

/* Hover, focus and current page state */
header nav a:hover,
header nav a:focus-visible,
header nav a[aria-current="page"] {
  border-bottom-color: var(--colour-accent);
  color: var(--colour-ink);
}

/* =========================================
   MAIN CONTENT LAYOUT
   ========================================= */

main {
  flex: 1;
}

/* Main content wrapper */
main > div {
  max-width: 60rem;
  margin: 0 auto;
  padding: 3rem 1.75rem 4rem; /* more breathing room */
}

/* Meta block at the top of each page */
main > div > div:first-child {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--colour-ink);
  margin-bottom: 1.25rem;
}

main > div > div:first-child span {
  display: inline-block;
  margin-right: 0.75rem;
}

/* =========================================
   PAGE TITLES AND INTRO TEXT
   ========================================= */

main > div > h1 {
  font-family: "Playfair Display", "Times New Roman", Georgia,
    "Palatino Linotype", serif;
  font-size: 2.2rem;
  line-height: 1.25;
  color: var(--colour-ink);
  margin-bottom: 0.75rem;
}

/* First paragraph after the h1 is the intro */
main > div > h1 + p {
  max-width: 36rem;
  margin-bottom: 2rem;
  font-size: 1rem;
  color: #4a4a4a;
}

/* =========================================
   KEY QUOTE BLOCK (HOMEPAGE)
   ========================================= */

aside {
  margin: 2.25rem 0 2.75rem;
  padding: 1.75rem 2rem;
  border-left: 3px solid var(--colour-accent);
  background-color: #f4f2ec;
  font-family: "Playfair Display", "Times New Roman", Georgia,
    "Palatino Linotype", serif;
  font-size: 1.1rem;
  line-height: 1.8;
  color: var(--colour-ink);
}

/* =========================================
   ARTICLE STYLES
   ========================================= */

article {
  max-width: 38rem; /* slightly narrower column for more white space */
}

/* Section headings inside articles */
article h2 {
  font-family: "Playfair Display", "Times New Roman", Georgia,
    "Palatino Linotype", serif;
  font-size: 1.35rem;
  margin: 2.25rem 0 0.85rem;
  color: var(--colour-ink);
}

article h3 {
  font-size: 1.02rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  font-weight: 500;
  margin: 2rem 0 0.6rem;
  color: var(--colour-text);
}

/* Paragraphs inside articles */
article p {
  margin-bottom: 1.1rem;
  color: #555555;
  font-weight: 300;
  line-height: 1.8; /* airy paragraphs */
}

/* Reference paragraph at the end of the article */
article > p:last-of-type {
  font-size: 0.8rem;
  color: #666666;
  margin-top: 2.5rem;
}

/* Lists inside articles */
article ul {
  padding-left: 1.25rem;
  margin-bottom: 1.5rem;
}

article li {
  margin-bottom: 0.35rem;
}

/* Links inside article text */
article a {
  color: var(--colour-ink);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.15em;
}

article a:hover,
article a:focus-visible {
  color: var(--colour-accent);
}

/* =========================================
   NEAR / FAR READING SECTIONS
   ========================================= */

/* Base spacing for both sections */
article > section {
  margin-bottom: 2.5rem;
}

/* NEAR: first section, still defined, but softer and looser */
article > section:first-of-type {
  padding: 1.5rem 1.75rem;
  background-color: #f8f6f1;
  line-height: 1.65;
}

/* FAR: second section, very open and calm */
article > section:last-of-type {
  padding: 2rem 1.75rem 2.25rem;
  background-color: transparent;
  line-height: 1.9;
}

/* Inner wrapper inside sections (homepage text) */
article > section > div {
  max-width: 34rem;
}

/* =========================================
   FOOTER
   ========================================= */

footer {
  border-top: 1px solid var(--colour-muted);
  padding: 1.2rem 1.5rem 1.4rem;
  font-size: 0.8rem;
  color: #777777;
  text-align: centre;
}

/* =========================================
   RESPONSIVE ADJUSTMENTS
   ========================================= */

@media (max-width: 720px) {
  header > div {
    flex-direction: column;
    align-items: flex-start;
  }

  main > div {
    padding: 2.25rem 1.5rem 3rem;
  }

  article {
    max-width: 100%;
  }

  main > div > h1 {
    font-size: 1.9rem;
  }

  aside {
    margin: 1.75rem 0 2.25rem;
    padding-inline: 1.5rem;
  }

  article > section:first-of-type,
  article > section:last-of-type {
    padding-inline: 1.5rem;
  }
}