
/* ============================================================
   Kindness Tales — warm, emotional, premium storytelling design
   Pure CSS, no frameworks. Mobile-first, fully responsive.
   ============================================================ */

/* ---------- Design tokens ---------- */
:root {
  --bg: #faf5ec;
  --bg-deep: #f4ead6;
  --card: #fffdf8;
  --ink: #2d2620;
  --ink-soft: #4d4437;
  --muted: #8a7c68;
  --faint: #b3a68d;
  --accent: #b4532a;
  --accent-deep: #8f3f1e;
  --accent-soft: #f7e9d2;
  --gold: #d9a441;
  --gold-soft: #f9efdb;
  --line: #e9dcc2;
  --line-soft: #f1e7d0;
  --shadow-sm: 0 1px 2px rgba(120, 84, 40, 0.07), 0 4px 14px rgba(120, 84, 40, 0.07);
  --shadow-md: 0 2px 4px rgba(120, 84, 40, 0.08), 0 12px 32px rgba(120, 84, 40, 0.12);
  --shadow-lg: 0 4px 8px rgba(120, 84, 40, 0.10), 0 24px 56px rgba(120, 84, 40, 0.16);
  --radius: 20px;
  --radius-sm: 12px;
  --font-display: "Playfair Display", Georgia, "Times New Roman", serif;
  --font-body: "Lora", Georgia, "Times New Roman", serif;
  --font-ui: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --max-read: 68ch;
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.8;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

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

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

::selection { background: var(--accent-soft); color: var(--accent-deep); }

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

.wrap {
  max-width: 720px;
  margin: 0 auto;
  padding-left: 1.25rem;
  padding-right: 1.25rem;
  width: 100%;
}

.meta {
  font-family: var(--font-ui);
  font-size: 0.82rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ---------- Header / nav ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(250, 245, 236, 0.88);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line-soft);
}

.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  padding-top: 0.85rem;
  padding-bottom: 0.85rem;
}

.brand {
  font-family: var(--font-display);
  font-size: 1.45rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--ink);
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  white-space: nowrap;
}

.brand::before {
  content: "\2665";
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.9rem;
  height: 1.9rem;
  font-size: 1rem;
  color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent-deep));
  border-radius: 50%;
  box-shadow: var(--shadow-sm);
  flex: none;
}

.brand:hover { text-decoration: none; color: var(--accent-deep); }

.nav {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.25rem 1.4rem;
}

.nav a {
  font-family: var(--font-ui);
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--ink-soft);
  padding: 0.35rem 0.1rem;
  position: relative;
}

.nav a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 100%;
  bottom: 0;
  height: 2px;
  border-radius: 2px;
  background: var(--accent);
  transition: right 0.25s var(--ease);
}

.nav a:hover { color: var(--accent-deep); text-decoration: none; }
.nav a:hover::after { right: 0; }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  overflow: hidden;
  text-align: center;
  padding: clamp(3.5rem, 9vw, 6.5rem) 1.25rem clamp(3rem, 7vw, 5rem);
  background:
    radial-gradient(58rem 30rem at 88% -12%, rgba(217, 164, 65, 0.20), transparent 62%),
    radial-gradient(52rem 28rem at 6% 112%, rgba(180, 83, 42, 0.16), transparent 60%),
    radial-gradient(30rem 18rem at 50% 50%, rgba(255, 255, 255, 0.55), transparent 70%),
    linear-gradient(180deg, #fdf7e9 0%, #f8ecd4 100%);
  border-bottom: 1px solid var(--line);
}

.hero::before {
  content: "\201C";
  position: absolute;
  top: -1.5rem;
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--font-display);
  font-size: clamp(9rem, 22vw, 15rem);
  line-height: 1;
  color: var(--accent);
  opacity: 0.08;
  pointer-events: none;
  user-select: none;
}

.hero h1 {
  position: relative;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(2.6rem, 7vw + 1rem, 4.4rem);
  line-height: 1.08;
  letter-spacing: -0.02em;
  margin: 0 0 1rem;
  color: var(--ink);
}

.hero h1 em {
  font-style: italic;
  font-weight: 600;
  background: linear-gradient(120deg, var(--accent), var(--gold));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: var(--accent);
}

.hero p {
  position: relative;
  font-size: clamp(1.05rem, 2.4vw, 1.3rem);
  font-style: italic;
  color: var(--ink-soft);
  max-width: 600px;
  margin: 0 auto 2rem;
  line-height: 1.7;
}

.eyebrow {
  display: inline-block;
  font-family: var(--font-ui);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent-deep);
  background: rgba(255, 255, 255, 0.65);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.45rem 1.1rem;
  margin-bottom: 1.4rem;
  box-shadow: var(--shadow-sm);
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-block;
  font-family: var(--font-ui);
  font-weight: 600;
  font-size: 1rem;
  letter-spacing: 0.01em;
  color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent-deep));
  padding: 0.85rem 2.1rem;
  border-radius: 999px;
  box-shadow: 0 6px 18px rgba(143, 63, 30, 0.32), inset 0 1px 0 rgba(255, 255, 255, 0.22);
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease);
}

.btn:hover {
  color: #fff;
  text-decoration: none;
  transform: translateY(-2px);
  box-shadow: 0 10px 26px rgba(143, 63, 30, 0.38), inset 0 1px 0 rgba(255, 255, 255, 0.22);
}

.btn:active { transform: translateY(0); }

/* ---------- Section titles ---------- */
.section-head { margin: 3rem 0 1.6rem; }

.section-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.5rem, 3.4vw, 2rem);
  letter-spacing: -0.01em;
  margin: 0 0 0.35rem;
}

.section-sub {
  color: var(--muted);
  font-style: italic;
  margin: 0;
  font-size: 1.02rem;
}

/* ---------- Story cards ---------- */
.grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  padding-bottom: 4rem;
}

.card {
  position: relative;
  background: var(--card);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  padding: 1.9rem 1.7rem 1.6rem;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease), border-color 0.3s var(--ease);
}

.card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 5px;
  background: linear-gradient(90deg, var(--accent), var(--gold));
  opacity: 0.85;
}

.card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-md);
  border-color: var(--line);
}

.card h3 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.42rem;
  line-height: 1.32;
  letter-spacing: -0.01em;
  margin: 0.4rem 0 0.65rem;
}

.card h3 a { color: var(--ink); }
.card h3 a:hover { color: var(--accent-deep); text-decoration: none; }
.card h3 a::after {
  content: " \2192";
  color: var(--accent);
  opacity: 0;
  transform: translateX(-4px);
  display: inline-block;
  transition: opacity 0.25s var(--ease), transform 0.25s var(--ease);
}
.card:hover h3 a::after { opacity: 1; transform: translateX(0); }

.card p.excerpt {
  color: var(--ink-soft);
  font-size: 1rem;
  line-height: 1.7;
  margin: 0 0 1.2rem;
  flex-grow: 1;
}

.card .meta {
  padding-top: 1rem;
  border-top: 1px dashed var(--line);
}

/* ---------- Story page ---------- */
.story-header {
  text-align: center;
  padding: clamp(2.5rem, 6vw, 4rem) 0 1.5rem;
  max-width: var(--max-read);
  margin: 0 auto;
}

.story-header h1 {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(1.95rem, 4.6vw + 0.8rem, 3rem);
  line-height: 1.18;
  letter-spacing: -0.015em;
  margin: 0 0 1rem;
  text-wrap: balance;
}

.story-header .meta { margin-top: 0.4rem; }

.story-body {
  max-width: var(--max-read);
  margin: 0 auto;
  padding-bottom: 0.5rem;
  font-size: 1.1rem;
  line-height: 1.95;
  color: var(--ink-soft);
}

.story-body p { margin: 0 0 1.5em; }

/* Lede + drop cap on the opening paragraph */
.story-body > p:first-of-type {
  font-size: 1.16em;
  color: var(--ink);
}

.story-body > p:first-of-type::first-letter {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 3.5em;
  float: left;
  line-height: 0.82;
  padding: 0.08em 0.14em 0 0;
  color: var(--accent);
}

.story-body strong { color: var(--ink); }
.story-body em { color: var(--accent-deep); }

.story-body figure.story-image { margin: 0 0 1.8em; }
.story-body figure.story-image img {
  width: 100%;
  border-radius: 14px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12);
}

/* ---------- Moral box ---------- */
.moral {
  position: relative;
  max-width: var(--max-read);
  margin: 3rem auto;
  background: linear-gradient(135deg, #fffdf4 0%, var(--gold-soft) 100%);
  border: 1px solid var(--line);
  border-left: 5px solid var(--accent);
  border-radius: 4px var(--radius-sm) var(--radius-sm) 4px;
  padding: 1.7rem 1.8rem 1.5rem 4.6rem;
  box-shadow: var(--shadow-sm);
  font-style: italic;
  font-size: 1.08rem;
  line-height: 1.75;
  color: var(--ink-soft);
}

.moral::before {
  content: "\201C";
  position: absolute;
  left: 1.15rem;
  top: 0.55rem;
  font-family: var(--font-display);
  font-size: 3.6rem;
  line-height: 1;
  color: var(--accent);
  opacity: 0.32;
}

.moral strong {
  font-family: var(--font-ui);
  font-style: normal;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  display: block;
  margin-bottom: 0.55rem;
  color: var(--accent-deep);
}

/* ---------- Prev / next story nav ---------- */
.story-nav {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  max-width: var(--max-read);
  margin: 2.5rem auto 4rem;
  padding-top: 2rem;
  border-top: 1px solid var(--line-soft);
}

.story-nav .prev,
.story-nav .next {
  display: block;
  background: var(--card);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm);
  padding: 1.1rem 1.3rem;
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 600;
  line-height: 1.45;
  box-shadow: var(--shadow-sm);
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease);
}

.story-nav .prev:hover,
.story-nav .next:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

.story-nav .prev::before,
.story-nav .next::before {
  display: block;
  font-family: var(--font-ui);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.3rem;
}

.story-nav .prev::before { content: "\2190  Previous story"; }
.story-nav .next::before { content: "Next story  \2192"; }
.story-nav .next { text-align: left; }

/* ---------- Generic pages (stories list, about) ---------- */
.page-title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(2rem, 5vw + 0.6rem, 3rem);
  letter-spacing: -0.015em;
  line-height: 1.15;
  margin: clamp(2.2rem, 5vw, 3.5rem) 0 0.6rem;
  text-wrap: balance;
}

.page-sub {
  color: var(--muted);
  font-style: italic;
  font-size: 1.08rem;
  margin: 0 0 2.2rem;
}

.story-list {
  list-style: none;
  padding: 0 0 4rem;
  margin: 0;
}

.story-list li {
  background: var(--card);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm);
  padding: 1.5rem 1.6rem;
  margin-bottom: 1.1rem;
  box-shadow: var(--shadow-sm);
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease), border-color 0.25s var(--ease);
}

.story-list li:hover {
  transform: translateX(4px);
  border-color: var(--accent);
  box-shadow: var(--shadow-md);
}

.story-list h3 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.32rem;
  line-height: 1.35;
  margin: 0 0 0.45rem;
}

.story-list h3 a { color: var(--ink); }
.story-list h3 a:hover { color: var(--accent-deep); text-decoration: none; }

.story-list p {
  margin: 0.35rem 0 0.7rem;
  color: var(--ink-soft);
  font-size: 1rem;
  line-height: 1.7;
}

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--line);
  background: linear-gradient(180deg, var(--bg) 0%, var(--bg-deep) 100%);
  padding: 3rem 0 2.4rem;
  text-align: center;
}

.footer-brand {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.3rem;
  color: var(--ink);
  margin: 0 0 0.5rem;
}

.footer-tag {
  color: var(--muted);
  font-style: italic;
  font-size: 0.98rem;
  margin: 0 0 1.4rem;
}

.footer-nav {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.4rem 1.6rem;
  margin-bottom: 1.6rem;
}

.footer-nav a {
  font-family: var(--font-ui);
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--ink-soft);
}

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

.footer-copy {
  font-family: var(--font-ui);
  font-size: 0.82rem;
  color: var(--faint);
  margin: 0;
}

/* ---------- Tablet (640px+) ---------- */
@media (min-width: 640px) {
  body { font-size: 1.0625rem; }

  .grid { grid-template-columns: repeat(2, 1fr); }

  .story-nav { flex-direction: row; }
  .story-nav .prev,
  .story-nav .next { flex: 1 1 0; }
  .story-nav .next { text-align: right; }

  .moral { padding-right: 2.2rem; }
}

/* ---------- Desktop (1024px+) ---------- */
@media (min-width: 1024px) {
  .wrap.wide { max-width: 1120px; }

  .grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 1.75rem;
  }

  .hero { padding-left: 2rem; padding-right: 2rem; }

  .story-body { font-size: 1.14rem; }
}

/* ---------- Large desktop refinements ---------- */
@media (min-width: 1280px) {
  .wrap.wide { max-width: 1180px; }
}

/* ---------- Small phones ---------- */
@media (max-width: 480px) {
  .site-header .wrap { padding-top: 0.7rem; padding-bottom: 0.7rem; }
  .brand { font-size: 1.25rem; }
  .nav a { font-size: 0.88rem; }

  .card { padding: 1.6rem 1.35rem 1.4rem; }
  .card h3 { font-size: 1.28rem; }

  .moral { padding: 1.4rem 1.25rem 1.25rem 3.6rem; }
  .moral::before { font-size: 2.8rem; left: 0.9rem; top: 0.5rem; }

  .story-list li { padding: 1.25rem 1.2rem; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    transition: none !important;
    animation: none !important;
  }
  .card:hover, .btn:hover,
  .story-nav .prev:hover, .story-nav .next:hover,
  .story-list li:hover { transform: none; }
}
