/* styles.css */

:root {
  --bg: #f5f1e8;
  --text: #1f1f1f;
  --accent: #1f5a3a;
  --accent-2: #2a6f4a;

  --overlay: rgba(0, 0, 0, 0.38);
  --card: rgba(255, 255, 255, 0.92);

  --nav-h: 64px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: "Roboto", system-ui, -apple-system, Segoe UI, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
}

/* Accessibility: Skip link */
.skip-link {
  position: absolute;
  left: -999px;
  top: 10px;
  background: #fff;
  color: #000;
  padding: 10px 12px;
  border-radius: 10px;
  z-index: 9999;
}

.skip-link:focus { left: 10px; }

/* Pinned (fixed) nav — rubric-safe because nav stays in <header>, styling stays in CSS */
.site-nav {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 0 18px;
  z-index: 1000;

  background: rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.18);
}

.site-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
}

.site-nav a {
  color: #ffffff;
  text-decoration: none;
  font-weight: 700;
  letter-spacing: 0.2px;
  padding: 8px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: rgba(0, 0, 0, 0.18);
  display: inline-block;
}

.site-nav a:hover,
.site-nav a:focus {
  background: rgba(0, 0, 0, 0.35);
  border-color: rgba(255, 255, 255, 0.6);
  outline: none;
}

/* Active page highlight */
.site-nav a[aria-current="page"] {
  background: rgba(255, 255, 255, 0.22);
  border-color: rgba(255, 255, 255, 0.75);
}

/* Header + hero image (hero.jpg applied in CSS per chapter) */
header {
  min-height: 100vh;
  background: url("hero.jpg") no-repeat center center fixed;
  background-size: cover;
  position: relative;
  overflow: hidden; /* keeps all header content visually contained */
  padding-top: var(--nav-h); /* prevents nav from covering hero text */
  display: grid;
  align-content: start;
}

header::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--overlay);
}

header > * {
  position: relative;
  z-index: 1;
}

/* Hero text block */
.hero-text {
  max-width: 900px;
  padding: 72px 22px 40px;
}

.hero-text h1 {
  margin: 0 0 10px;
  font-family: "Montserrat", system-ui, -apple-system, Segoe UI, Arial, sans-serif;
  font-size: clamp(2.2rem, 4vw, 3.6rem);
  color: #ffffff;
  text-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
}

.hero-text p {
  margin: 0;
  font-size: clamp(1.05rem, 1.6vw, 1.25rem);
  color: rgba(255, 255, 255, 0.95);
  max-width: 70ch;
}

/* CTA button (still just a link) */
.cta {
  display: inline-block;
  margin-top: 16px;
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--accent);
  text-decoration: none;
  font-weight: 800;
}

.cta:hover,
.cta:focus {
  text-decoration: underline;
  outline: none;
}

main {
  max-width: 800px;
  margin: 0 auto;
  padding: 34px 18px 42px;
}

main h2 {
  font-family: "Montserrat", system-ui, -apple-system, Segoe UI, Arial, sans-serif;
  color: var(--accent);
  margin-top: 0;
}

/* Home-page card grid */
.card-grid {
  display: grid;
  gap: 14px;
}

@media (min-width: 780px) {
  .card-grid { grid-template-columns: 1fr 1fr; }
}

/* Cards */
.section-card {
  background: var(--card);
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 16px;
  padding: 18px 18px 16px;
  margin: 0; /* grid handles spacing */
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.08);
}

.section-card h3 {
  margin: 0 0 6px;
  font-family: "Montserrat", system-ui, -apple-system, Segoe UI, Arial, sans-serif;
}

.section-card p { margin: 0 0 10px; }

.section-card a {
  color: var(--accent-2);
  font-weight: 700;
  text-decoration: none;
}

.section-card a:hover,
.section-card a:focus {
  text-decoration: underline;
  outline: none;
}

footer {
  border-top: 1px solid rgba(0, 0, 0, 0.08);
  padding: 18px;
  text-align: center;
  font-size: 0.95rem;
  color: rgba(0, 0, 0, 0.7);
}