/* ============================================================
   CREATIVE OWNERSHIP — style.css

   This file is the single source of truth for all visual
   decisions. Change a value here, it updates everywhere.
   ============================================================ */


/* ------------------------------------------------------------
   1. DESIGN TOKENS (CSS Custom Properties)

   These are your "variables." Every colour, font, and key
   measurement lives here so you never have to hunt through
   the file to change something.
   ------------------------------------------------------------ */
:root {
  /* Colors — from enda.studio palette */
  --color-bg:         #fdf9f9;  /* Near-white with the faintest warmth */
  --color-nav:        #363f42;  /* Studio Highlight — dark slate nav */
  --color-headline:   #151515;  /* Studio Black — near-black headings */
  --color-body:       #2d2d2d;  /* Slightly lighter than headline for body text */
  --color-meta:       #767676;  /* Wignall gray — dates, categories */
  --color-accent:     #4aaaa1;  /* Studio Green — links, highlights */
  --color-cta:        #f1ff85;  /* Studio Yellow — email subscribe button */
  --color-border:     #d9d9d9;  /* Studio Box — dividers, subtle lines */

  /* Typography */
  --font-display: 'Syne', sans-serif;   /* Headlines only */
  --font-body:    'DM Sans', sans-serif; /* Everything else */

  /* Layout */
  --content-width: 680px;  /* Max readable line length */
  --nav-height:    64px;
}


/* ------------------------------------------------------------
   2. RESET & BASE STYLES

   Browsers apply their own default styles (margins, paddings,
   font sizes). This section zeroes them out so we start from
   a predictable baseline.
   ------------------------------------------------------------ */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 18px; /* 1rem = 18px. All other sizes are relative to this. */
}

body {
  background-color: var(--color-bg);
  color: var(--color-body);
  font-family: var(--font-body);
  line-height: 1.75;
  -webkit-font-smoothing: antialiased; /* Crisper text on macOS/iOS */
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: inherit;
}


/* ------------------------------------------------------------
   3. NAVIGATION

   Sticky header — stays at the top as you scroll.
   3-column CSS grid: logo left | links centre | newsletter right.
   Background matches the page so nav feels integrated, not separate.
   A subtle bottom border separates it from the content below.
   ------------------------------------------------------------ */
.site-header {
  background-color: transparent;
  /* Not sticky — scrolls away with the page */
}

.site-nav {
  /* No max-width here — the nav spans the full viewport width.
     The content column below has its own narrower max-width.
     This is the same pattern Wignall uses: wide nav, narrow text. */
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 3rem;
  height: var(--nav-height);
  display: grid;
  grid-template-columns: 1fr auto 1fr; /* Left | Centre | Right */
  align-items: center;
}

.site-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1rem;
  color: var(--color-headline);  /* Dark on light nav */
  text-decoration: none;
  letter-spacing: -0.01em;
  justify-self: start; /* Pin to left edge */
}

.site-name:hover {
  color: var(--color-accent);
}

/* Centre column: About + Contact */
.nav-links {
  list-style: none;
  display: flex;
  gap: 2rem;
  justify-self: center;
}

.nav-links a {
  font-family: var(--font-body);
  font-size: 0.875rem;
  color: var(--color-body);
  text-decoration: none;
  transition: color 0.15s ease;
}

.nav-links a:hover {
  color: var(--color-accent);
}

/* Right column: Newsletter CTA */
.nav-newsletter {
  justify-self: end; /* Pin to right edge */
  font-family: var(--font-body);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--color-body);
  text-decoration: none;
  border: 1px solid var(--color-border);
  padding: 0.35rem 0.9rem;
  border-radius: 3px;
  transition: border-color 0.15s ease, color 0.15s ease;
}

.nav-newsletter:hover {
  border-color: var(--color-accent);
  color: var(--color-accent);
}


/* ------------------------------------------------------------
   4. PAGE WRAPPER

   Centers all page content within the readable column width.
   ------------------------------------------------------------ */
.page-container {
  max-width: calc(var(--content-width) + 4rem);
  margin: 0 auto;
  padding: 4rem 2rem;
}


/* ------------------------------------------------------------
   5. POST PAGE — metadata, title, image
   ------------------------------------------------------------ */

/* Date and category line above the headline */
.post-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
}

.post-date,
.post-category {
  font-size: 0.875rem;
  color: var(--color-meta);
}

.post-category::before {
  content: '·';
  margin-right: 0.5rem;
}

/* Main post headline */
.post-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 2.75rem;
  color: var(--color-headline);
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin-bottom: 2.5rem;
}

/* Header image — constrained width, subtle shadow */
.post-image {
  margin-bottom: 3rem;
}

.post-image img {
  width: 100%;
  max-width: 100%;
  max-height: 400px;
  object-fit: cover;     /* Crops to fill — never squashes or warps */
  object-position: center; /* Crops from the centre of the image */
  border-radius: 3px;
  box-shadow: 0 4px 20px rgba(21, 21, 21, 0.14);
}


/* ------------------------------------------------------------
   6. POST BODY CONTENT

   Typography for everything inside a blog post.
   ------------------------------------------------------------ */
.post-content {
  font-size: 1rem;
  line-height: 1.8;
  color: var(--color-body);
}

.post-content p {
  margin-bottom: 1.5em;
}

.post-content h2 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.65rem;
  color: var(--color-headline);
  line-height: 1.15;
  letter-spacing: -0.015em;
  margin: 2.5em 0 0.6em;
}

.post-content h3 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--color-headline);
  letter-spacing: -0.01em;
  margin: 2em 0 0.5em;
}

.post-content a {
  color: var(--color-accent);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  transition: text-decoration-thickness 0.1s ease;
}

.post-content a:hover {
  text-decoration-thickness: 2px;
}

.post-content ul,
.post-content ol {
  padding-left: 1.5em;
  margin-bottom: 1.5em;
}

.post-content li {
  margin-bottom: 0.4em;
}

.post-content blockquote {
  border-left: 3px solid var(--color-accent);
  padding-left: 1.25rem;
  margin: 2.5rem 0;
  color: var(--color-meta);
  font-style: italic;
}

.post-content hr {
  border: none;
  margin: 3rem 0;
}

.post-content strong {
  font-weight: 600;
  color: var(--color-headline);
}


/* ------------------------------------------------------------
   7. POST NAVIGATION (Previous / Next links)
   ------------------------------------------------------------ */
.post-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 4rem;
  padding-top: 2rem;
}

.post-nav a {
  font-size: 0.875rem;
  color: var(--color-accent);
  text-decoration: none;
}

.post-nav a:hover {
  text-decoration: underline;
}

.post-nav .next-post {
  margin-left: auto; /* Pushes "Next" to the right edge */
}


/* ------------------------------------------------------------
   8. EMAIL CAPTURE

   Dark box at the end of a post or page — the yellow
   button is the only strong colour on the page.
   ------------------------------------------------------------ */
.email-capture {
  margin-top: 5rem;
  padding: 2.75rem 2.5rem;
  background-color: var(--color-nav);
  border-radius: 4px;
  text-align: center;
}

.email-capture h3 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.4rem;
  color: var(--color-bg);
  margin-bottom: 0.5rem;
}

.email-capture p {
  font-size: 0.9rem;
  color: rgba(244, 234, 234, 0.65);
  margin-bottom: 1.75rem;
}

.email-form {
  display: flex;
  gap: 0.75rem;
  max-width: 420px;
  margin: 0 auto;
}

.email-form input[type="email"] {
  flex: 1;
  padding: 0.75rem 1rem;
  font-family: var(--font-body);
  font-size: 0.9rem;
  background: rgba(244, 234, 234, 0.08);
  border: 1px solid rgba(244, 234, 234, 0.2);
  border-radius: 3px;
  color: var(--color-bg);
  outline: none;
  transition: border-color 0.15s ease;
}

.email-form input[type="email"]::placeholder {
  color: rgba(244, 234, 234, 0.35);
}

.email-form input[type="email"]:focus {
  border-color: var(--color-cta);
}

.email-form button {
  padding: 0.75rem 1.5rem;
  background-color: var(--color-cta);
  color: var(--color-headline);
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 600;
  border: none;
  border-radius: 3px;
  cursor: pointer;
  white-space: nowrap;
  transition: opacity 0.15s ease;
}

.email-form button:hover {
  opacity: 0.88;
}


/* ------------------------------------------------------------
   9. INDEX PAGE — post list

   Single column, stacked entries. Date, then title, then
   a short excerpt. Clean and easy to scan.
   ------------------------------------------------------------ */
.post-list {
  list-style: none;
}

.post-list-item {
  padding: 2.25rem 0;
}

.post-list-item .post-date {
  display: block;
  font-size: 0.8rem;
  color: var(--color-meta);
  margin-bottom: 0.4rem;
}

.post-list-item h2 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.4rem;
  color: var(--color-headline);
  letter-spacing: -0.015em;
  line-height: 1.2;
  margin-bottom: 0.5rem;
}

.post-list-item h2 a {
  text-decoration: none;
  color: inherit;
  transition: color 0.15s ease;
}

.post-list-item h2 a:hover {
  color: var(--color-accent);
}

.post-list-item .excerpt {
  font-size: 0.9rem;
  color: var(--color-meta);
  line-height: 1.6;
  margin-bottom: 0.75rem;
}

.read-more {
  font-size: 0.8rem;
  color: var(--color-accent);
  text-decoration: none;
  font-weight: 500;
}

.read-more:hover {
  text-decoration: underline;
}


/* ------------------------------------------------------------
   10. PAGE HEADER (used on About and index)

   A simple intro section at the top of non-post pages.
   ------------------------------------------------------------ */
.page-header {
  margin-bottom: 3.5rem;
  padding-bottom: 2.5rem;
}

.page-header h1 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 2.5rem;
  color: var(--color-headline);
  letter-spacing: -0.02em;
  line-height: 1.1;
  margin-bottom: 0.75rem;
}

.page-header p {
  font-size: 1rem;
  color: var(--color-meta);
  line-height: 1.65;
}


/* ------------------------------------------------------------
   11. FOOTER

   Dark background (Studio Highlight) with cream/muted text.
   Creates a clean visual full-stop at the bottom of every page.
   ------------------------------------------------------------ */
.site-footer {
  text-align: center;
  padding: 3rem 2rem;
  margin-top: 4rem;
  background-color: var(--color-nav);  /* Studio Highlight #363f42 */
}

.site-footer .copyright {
  font-size: 0.8rem;
  color: rgba(244, 234, 234, 0.5);  /* Muted warm cream */
  margin-bottom: 0.75rem;
}

.footer-nav {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
}

.footer-nav a {
  font-size: 0.8rem;
  color: rgba(244, 234, 234, 0.65);
  text-decoration: none;
  transition: color 0.15s ease;
}

.footer-nav a:hover {
  color: var(--color-bg);  /* Warm cream on hover */
}


/* ------------------------------------------------------------
   12. RECOMMENDED SECTION

   A lightweight list at the end of a post for sharing quick
   picks — books, films, songs, etc. Each item has an emoji,
   a linked title, a tag in brackets, and a short description.
   ------------------------------------------------------------ */
.recommended {
  margin-top: 3rem;
  padding-top: 2.5rem;
}

.recommended-heading {
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--color-meta);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 1.75rem;
}

.recommended-list {
  list-style: none;
  padding: 0;
}

.rec-item {
  margin-bottom: 1.75rem;
}

.rec-item:last-child {
  margin-bottom: 0;
}

.rec-title {
  display: flex;
  align-items: baseline;
  gap: 0.4rem;
  flex-wrap: wrap;
  margin-bottom: 0.3rem;
}

.rec-title a {
  color: var(--color-accent);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.975rem;
}

.rec-title a:hover {
  text-decoration: underline;
}

.rec-tag {
  font-size: 0.75rem;
  color: var(--color-meta);
  font-weight: 500;
  letter-spacing: 0.04em;
}

.rec-desc {
  font-size: 0.9rem;
  color: var(--color-body);
  line-height: 1.65;
  margin: 0;
}


/* ------------------------------------------------------------
   13. RESPONSIVE — mobile adjustments

   Below 640px (most phones), we adjust font sizes and spacing.
   The layout stays the same — just scales down gracefully.
   ------------------------------------------------------------ */
@media (max-width: 640px) {

  html {
    font-size: 17px; /* Slightly smaller base on mobile */
  }

  /* On mobile, collapse to logo left / newsletter right only,
     hide the centre links to save space */
  .site-nav {
    padding: 0 1.25rem;
    grid-template-columns: auto auto; /* Just two columns on mobile */
  }

  .nav-links {
    display: none; /* Hidden on small screens */
  }

  .nav-newsletter {
    justify-self: end;
  }

  .page-container {
    padding: 2.5rem 1.25rem;
  }

  .post-title {
    font-size: 2.1rem;
  }

  .page-header h1 {
    font-size: 2rem;
  }

  /* Stack the email form vertically on small screens */
  .email-form {
    flex-direction: column;
  }

  .email-capture {
    padding: 2rem 1.25rem;
  }

  .post-nav {
    flex-direction: column;
    gap: 0.75rem;
    align-items: flex-start;
  }

  .post-nav .next-post {
    margin-left: 0;
  }
}
