:root {
    --bg: aliceblue;
    --surface: #ffffff;
    --text: #202426;
    --muted: #687073;

    --brand-dark: hotpink;
    --brand: powderblue;
    --accent: cyan;

    --border: #dedbd4;
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.08);

    --max-width: 1100px;
    --radius: 18px;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: Arial, Helvetica, sans-serif;
    line-height: 1.6;
}

a {
    color: var(--accent);
    text-decoration: none;
}

img {
    max-width: 100%;
}

main {
    width: min(var(--max-width), calc(100% - 40px));
    margin: 0 auto;
}

section {
    padding: 70px 0;
}

h1,
h2,
h3,
p {
    margin-top: 0;
}

h1 {
    font-size: clamp(2.5rem, 6vw, 5rem);
    line-height: 1;
    margin-bottom: 20px;
}

h2 {
    font-size: clamp(2rem, 4vw, 3rem);
    line-height: 1.1;
}

h3 {
    line-height: 1.2;
}

.eyebrow {
    margin-bottom: 8px;
    color: var(--accent);
    font-size: 0.8rem;
    font-weight: bold;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

/* HERO */
.hero {
    background:
        linear-gradient(
            135deg,
            var(--brand),
            var(--brand-dark)
        );
    color: var(--bg);
    padding: 80px 20px;
}
.hero .eyebrow {color: var(--accent);}

.hero-inner {
    width: min(var(--max-width), 100%);
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1.4fr 0.6fr;
    gap: 60px;
    align-items: center;
}

.hero-tagline {
    max-width: 550px;
    font-size: 1.2rem;
}

.button {
    display: inline-block;
    margin-top: 15px;
    padding: 12px 22px;
    background: var(--accent);
    color: var(--bg);
    border-radius: 999px;
    text-decoration: none;
    font-weight: bold;
}

/* Container grid that naturally fits up to 4 items across */
.read-free-grid {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 1.5rem;
  margin-top: 1.25rem;
  align-items: flex-start;
}

/* Individual graphic link card */
.read-free-card {
  display: block;
  flex: 0 0 calc(25% - (1.5rem * 3 / 4));
  /* Cap height to keep it proportional to the Books section */
  max-height: 450px;
  width: auto;
  
  /* Match the visual styling of your existing book cards */
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid rgba(220, 210, 195, 0.7); /* soft, warm border tone */
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05); /* gentle card depth */
  
  /* Smooth hover feel */
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  line-height: 0; /* removes unwanted bottom inline gap */
}

.read-free-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
}

/* Ensure the image scales neatly within the card's height cap */
.read-free-card img {
  display: block;
  height: 450px;
  width: 100%;
  object-fit: contain;
}

/* Responsive adjustment for small phone screens */
@media (max-width: 600px) {
  .read-free-card {
    max-height: 380px;
  }
  .read-free-card img {
    max-height: 380px;
  }
}

/* Books grid - 2 across */
.books-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 28px;
}

/* Automatically center the last card when a row has only one */
.books-grid .book-card:last-child:nth-child(odd) {
  grid-column: 1 / -1;
  max-width: 520px;
  margin-inline: auto;
}

/* Book card */
.book-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  display: flex;
  overflow: hidden;
}
.cover {
  width: 200px;
  min-width: 200px;
  object-fit: cover;
  height: 300px;
}
.book-info {
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.book-info h3 {
  font-size: 1.15rem;
  line-height: 1.3;
}
.author a {
  font-weight: 600;
  font-size: 0.95rem;
}
.blurb {
  color: var(--muted);
  font-size: 0.92rem;
  flex-grow: 1;
}
.date {
  font-size: 0.85rem;
  font-weight: bold;
  color: var(--muted);
}
.btn {
  display: inline-block;
  margin-top: 8px;
  padding: 7px 14px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text);
  background: var(--brand);
  align-self: flex-start;
}
.btn:hover {
  border-color: var(--accent);
  text-decoration: none;
}

/* About */
#about {
  padding: 50px 0 70px;
}
#about h2 {
  margin-bottom: 16px;
}
#about p {
  max-width: 580px;
  color: var(--muted);
}

/* AUTHOR */
.author-section {
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: 40px;
    align-items: center;
}

.author-photo {
    width: 220px;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    border-radius: 50%;
    box-shadow: var(--shadow);
}

/* SECTION HEADINGS */
.section-heading {
    margin-bottom: 35px;
}

.collection-title {
    margin-top: 55px;
    margin-bottom: 20px;
    font-size: 1.5rem;
}

/* CARDS */
.card-grid {
    display: grid;
    grid-template-columns:
        repeat(auto-fit, minmax(240px, 1fr));
    gap: 24px;
}

.card {
    overflow: hidden;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.card-art {
    aspect-ratio: 16 / 9;
}

.placeholder-art {
    display: grid;
    place-items: center;
    background:
        linear-gradient(
            135deg,
            var(--brand-dark),
            var(--brand)
        );
    color: var(--muted);
}

.card-body {
    padding: 24px;
}

.card-body h3 {
    margin-bottom: 10px;
}

.card-body p {
    color: var(--muted);
}

.card-body a {
    font-weight: bold;
    text-decoration: none;
}

.card-kicker {
    margin-bottom: 5px;
    color: var(--brand);
    font-size: 0.8rem;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

/* SUBSCRIBE */
.subscribe-card {
    max-width: 720px;
    margin: 50px auto 0;
    padding: 30px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    text-align: center;
    box-shadow: var(--shadow);
}

/* FOOTER */
footer {
    padding: 35px 20px;
    background:
        linear-gradient(
            135deg,
            var(--brand-dark),
            var(--brand)
        );
    color: var(--bg);
    text-align: center;
}

footer p {
    margin: 0;
}

footer a {
    color: var(--accent);
}

/* MOBILE */
@media (max-width: 700px) {
    .hero-inner {
        grid-template-columns: 1fr;
    }
    .hero-cover {
        max-width: 260px;
    }
    .author-section {
        grid-template-columns: 1fr;
        text-align: center;
    }
    .author-photo {
        margin: 0 auto;
    }
    section {
        padding: 50px 0;
    }
}
