/* ==========================================================
   Sarah Musa — Author landing page
   Converted from Canva design "Author book marketing page"
   ========================================================== */

:root {
  --cream: #faf5ec;
  --cream-deep: #f3ead9;
  --teal: #23615c;
  --teal-dark: #173f3b;
  --maroon: #8c3226;
  --maroon-dark: #6e2419;
  --gold: #d9a441;
  --ink: #3b3a33;
  --white: #ffffff;
  --bg: #f5ead8;
  --card: #f9f4ed;

  --font-display: "Baloo 2", system-ui, sans-serif;
  --font-script: "Caveat", cursive;
  --font-body: "Nunito", system-ui, sans-serif;

  --container: 1120px;
  --radius: 18px;
  --shadow: 0 10px 30px rgba(35, 97, 92, 0.12);
}

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

html {
  scroll-behavior: smooth;
  font-size: clamp(100%, 98% + 1.1vw, 120%);
}

body {
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.6;
  font-size: 1rem;
}

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

.container {
  width: min(var(--container), 92%);
  margin-inline: auto;
}

/* ---------- Typography helpers ---------- */

.eyebrow {
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.8rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--maroon);
  margin-bottom: 0.4rem;
}

.eyebrow--light {
  color: var(--gold);
}

.section-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.6rem, 3.2vw, 2.3rem);
  color: var(--teal);
  line-height: 1.2;
  margin-bottom: 1.4rem;
  text-wrap: balance;
}

.section {
  padding: 4.5rem 0;
}
.section--tint {
  background: var(--bg);
}

/* ---------- Header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(245, 234, 216, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(35, 97, 92, 0.12);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 64px;
}

.logo {
  font-family: var(--font-script);
  font-weight: 700;
  font-size: 1.8rem;
  color: var(--teal-dark);
  text-decoration: none;
}

.site-nav {
  display: flex;
  gap: 1.6rem;
}

.site-nav a {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--teal-dark);
  text-decoration: none;
  padding: 0.3rem 0;
  border-bottom: 2px solid transparent;
  transition:
    border-color 0.2s ease,
    color 0.2s ease;
}

.site-nav a:hover,
.site-nav a:focus-visible {
  color: var(--maroon);
  border-bottom-color: var(--maroon);
}

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  background: none;
  border: 0;
  cursor: pointer;
}

.nav-toggle span {
  display: block;
  width: 24px;
  height: 3px;
  margin-inline: auto;
  border-radius: 3px;
  background: var(--teal-dark);
  transition:
    transform 0.25s ease,
    opacity 0.25s ease;
}

.nav-toggle[aria-expanded="true"] span:nth-child(1) {
  transform: translateY(8px) rotate(45deg);
}
.nav-toggle[aria-expanded="true"] span:nth-child(2) {
  opacity: 0;
}
.nav-toggle[aria-expanded="true"] span:nth-child(3) {
  transform: translateY(-8px) rotate(-45deg);
}

/* ---------- Hero ---------- */

.hero {
  position: relative;
  overflow: hidden;
  aspect-ratio: 1 / 1.06; /* matches the tall Canva hero canvas */
}

.hero-bg {
  position: absolute;
  inset: 0;
  background: url("../images/AhmedTeapotColor.webp") center top / cover
    no-repeat;
}

.hero-content {
  position: relative;
  z-index: 1;
  height: 100%;
  width: min(52rem, 84%);
  margin: 0 auto 0 4%;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 2rem 0 5rem;
}

.hero-greeting {
  font-family: "Gaegu", cursive;
  font-weight: 700;
  font-size: clamp(2.8rem, 6.5vw, 4.6rem);
  letter-spacing: 0.08em;
  color: #2e2c26;
  margin-bottom: 0.8rem;
}

.hero-lead {
  font-family: "Gaegu", cursive;
  font-weight: 400;
  font-size: clamp(1.3rem, 2.4vw, 1.5rem);
  line-height: 1.3;
  max-width: 44rem;
  color: #2e2c26;
  margin-bottom: 0.3rem;
}

.hero-name {
  font-family: "Birthstone Bounce", cursive;
  font-weight: 500;
  font-size: clamp(4.5rem, 10vw, 7.5rem);
  color: #2e2c26;
  line-height: 1;
  margin-top: 2.2rem;
}

/* ---------- Books ---------- */

.book-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2.4rem 2rem;
  margin-top: 2rem;
}

.book-card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--card);
  border-radius: 28px;
  padding: 1.4rem;
  box-shadow: var(--shadow);
}

/* Stretched link: the title anchor makes the whole card clickable */
.book-link {
  color: inherit;
  text-decoration: none;
}

.book-link::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 28px;
}

.book-card:has(.book-link:hover) h3,
.book-link:focus-visible {
  color: var(--maroon);
}

.book-cover {
  aspect-ratio: 3 / 4;
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 1.2rem;
  background: var(--bg);
}

.book-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.35s ease;
}

.book-cover-img--contain {
  object-fit: contain;
}

.book-card:hover .book-cover img {
  transform: scale(1.04);
}

.book-card h3 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.35rem;
  color: var(--ink);
  margin-bottom: 0.4rem;
}

.book-card p {
  flex: 1;
  font-size: 0.95rem;
  margin-bottom: 0;
}

.pill {
  align-self: flex-start;
  background: var(--bg);
  color: var(--maroon);
  font-weight: 600;
  font-size: 0.85rem;
  letter-spacing: 0.02em;
  padding: 0.35rem 0.9rem;
  border-radius: 999px;
  margin-bottom: 0.6rem;
}

/* ---------- Coming next ---------- */

.coming-next {
  position: relative;
  overflow: hidden;
  padding: 2.5rem 0;
  aspect-ratio: 816 / 309;
  display: flex;
  align-items: center;
}

.coming-next::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: min(var(--container), 92%);
  aspect-ratio: 816 / 309;
  border-radius: 1rem;
  background-image: url("../images/letters.webp");
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
  z-index: 0;
  opacity: 0.3;
}

.coming-next-content {
  position: relative;
  z-index: 1;
  padding: 1.5rem;
  text-align: center;
}

.coming-next-content h2 {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(1.8rem, 3.6vw, 2.6rem);
  color: var(--white);
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.4);
  margin-bottom: 0.4rem;
}

.coming-next-content p {
  font-weight: 700;
  font-size: clamp(1rem, 2.2vw, 1.3rem);
  color: var(--teal);
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.4);
}

/* ---------- About ---------- */

.about-grid {
  display: grid;
  grid-template-columns: minmax(0, 340px) 1fr;
  gap: 3rem;
  align-items: start;
}

.about-photo img {
  width: 100%;
  border-radius: 50%;
  border: 8px solid var(--white);
  box-shadow: var(--shadow);
}

.about-text p:not(.eyebrow) {
  margin-bottom: 1rem;
  max-width: 40rem;
}

/* ---------- Reviews ---------- */

.review-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
  margin-top: 2rem;
}

.review-card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.8rem;
  padding-bottom: 11rem; /* room for the corner thumbnail */
}

.review-card h3 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--maroon);
  margin-bottom: 0.8rem;
}

.review-card blockquote {
  flex: 1;
  display: flex;
  flex-direction: column;
}
.review-card blockquote p {
  font-size: 0.97rem;
  flex: 1;
}

.review-card cite {
  display: block;
  font-style: normal;
  font-weight: 700;
  color: var(--teal-dark);
  margin-top: 0.9rem;
}

.review-thumb {
  position: absolute;
  right: -28px;
  bottom: -28px;
  width: 184px;
  height: 184px;
  border-radius: 50%;
  overflow: hidden;
  border: 4px solid var(--cream-deep);
  box-shadow: var(--shadow);
}

.review-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ---------- Services ---------- */

#services .section-title {
  margin-bottom: 0.6rem;
}

.services-intro {
  display: grid;
  grid-template-columns: 1fr minmax(0, 460px);
  gap: 2.5rem;
  align-items: center;
  margin-bottom: 2.5rem;
}

.services-intro p {
  max-width: 34rem;
}

.services-art img {
  border-radius: var(--radius);
  width: 460px;
}

.service-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
}

.service {
  background: var(--card);
  border-radius: var(--radius);
  padding: 1.6rem 1.8rem;
  box-shadow: var(--shadow);
}

.service h3 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.2rem;
  color: var(--teal);
  margin-bottom: 0.3rem;
}

.service p {
  font-size: 0.95rem;
}

/* ---------- Contact ---------- */

.contact-panel {
  background: var(--card);
  border-radius: 28px;
  padding: 2.5rem 3rem;
  box-shadow: var(--shadow);
}

.contact-grid {
  display: grid;
  grid-template-columns: minmax(0, 420px) 1fr;
  gap: 3rem;
  align-items: start;
}

.contact-copy p {
  max-width: 28rem;
}

.contact-form .form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.2rem;
}

.field {
  margin-bottom: 1.2rem;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.field input,
.field textarea {
  width: 100%;
  font: inherit;
  color: var(--ink);
  background: var(--cream-deep);
  border: 2px solid transparent;
  border-radius: 12px;
  padding: 0.7rem 1rem;
  transition: border-color 0.2s ease;
}

.field textarea {
  border-radius: 18px;
}

.field input::placeholder,
.field textarea::placeholder {
  color: rgba(59, 58, 51, 0.55);
}

.field input:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--teal);
}

.field input.invalid,
.field textarea.invalid {
  border-color: var(--maroon);
}

.form-status {
  min-height: 1.4rem;
  font-weight: 700;
  margin-bottom: 0.6rem;
}

.form-status.ok {
  color: var(--teal);
}
.form-status.error {
  color: var(--maroon);
}

.form-actions {
  display: flex;
  justify-content: flex-end;
}

.btn {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1rem;
  color: var(--cream);
  background: var(--maroon);
  border: 0;
  border-radius: 999px;
  padding: 0.8rem 2.4rem;
  cursor: pointer;
  transition:
    background 0.2s ease,
    transform 0.15s ease;
}

.btn:hover,
.btn:focus-visible {
  background: var(--maroon-dark);
}
.btn:active {
  transform: scale(0.97);
}

/* ---------- Community ---------- */

#community.section {
  padding-bottom: 5.5rem; /* room for the circle bleeding past the panel */
}

.community-panel {
  position: relative;
  background: var(--card);
  border-radius: 28px;
  padding: 2.5rem 3rem;
  box-shadow: var(--shadow);
}

/* Stretched link: the program name anchor makes the whole panel clickable */
.community-link {
  color: inherit;
  text-decoration: none;
}

.community-link::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 28px;
}

.community-panel:has(.community-link:hover) .section-title,
.community-link:focus-visible {
  color: var(--maroon);
}

.community-panel:has(.community-link:hover) .community-art img {
  transform: translateY(3.5rem) scale(1.04);
}

.community-grid {
  display: grid;
  grid-template-columns: 1fr minmax(0, 280px);
  gap: 3rem;
  align-items: center;
}

.community-text p:not(.eyebrow) {
  max-width: 34rem;
}

.community-art img {
  border-radius: 50%;
  aspect-ratio: 1;
  object-fit: cover;
  border: 8px solid var(--cream-deep);
  box-shadow: var(--shadow);
  transform: translateY(3.5rem); /* bleed past the panel's bottom edge */
  transition: transform 0.35s ease;
}

/* ---------- Footer ---------- */

.footer-image {
  max-height: 700px;
  overflow: hidden;
  border-radius: 32px 32px 0 0;
}

.footer-image img {
  width: 100%;
  height: 700px;
  object-fit: cover;
  object-position: center 40%;
}

.copyright {
  text-align: center;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--teal-dark);
  padding: 1.4rem 1rem;
  background: var(--bg);
}

/* ---------- Scroll reveal ---------- */

.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition:
    opacity 0.6s ease,
    transform 0.6s ease;
}

.reveal.visible {
  opacity: 1;
  transform: none;
}

:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
  .book-cover img {
    transition: none;
  }
}

/* ==========================================================
   Responsive
   ========================================================== */

@media (max-width: 900px) {
  .book-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .review-grid {
    grid-template-columns: 1fr;
  }
  .about-grid {
    grid-template-columns: 1fr;
  }
  .about-photo {
    max-width: 260px;
    margin-inline: auto;
  }
  .contact-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
  .contact-panel,
  .community-panel {
    padding: 2rem 1.8rem;
  }
  .community-grid {
    grid-template-columns: 1fr;
    text-align: left;
  }
  .community-art {
    max-width: 220px;
  }
}

@media (max-width: 720px) {
  .section {
    padding: 3.2rem 0;
  }

  .nav-toggle {
    display: flex;
  }

  .site-nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    gap: 0;
    background: var(--bg);
    border-bottom: 1px solid rgba(35, 97, 92, 0.15);
    box-shadow: var(--shadow);
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
  }

  .site-nav.open {
    max-height: 320px;
  }

  .site-nav a {
    padding: 0.9rem 5%;
    border-bottom: 1px solid rgba(35, 97, 92, 0.08);
  }

  .hero {
    aspect-ratio: auto;
  }
  .hero-content {
    padding: 88vw 0 2.5rem;
  }

  .hero-art {
    max-width: 300px;
    margin-inline: auto;
  }

  .review-card {
    padding-bottom: 10.5rem;
  }
  .review-thumb {
    right: 10px;
    bottom: 10px;
    width: 150px;
    height: 150px;
  }
  .footer-image {
    border-radius: 20px 20px 0 0;
  }

  .book-grid {
    grid-template-columns: 1fr;
    max-width: 380px;
    margin-inline: auto;
  }
  .service-grid {
    grid-template-columns: 1fr;
  }
  .services-intro {
    grid-template-columns: 1fr;
  }
  .services-art {
    max-width: 360px;
    margin-inline: auto;
  }
  .contact-form .form-row {
    grid-template-columns: 1fr;
    gap: 0;
  }
  .community-art {
    margin-inline: auto;
  }
  .community-art img {
    transform: none;
  }
  #community.section {
    padding-bottom: 3.2rem;
  }
  .footer-image img {
    height: 300px;
  }
}
