/* ---------------------------------------------------------------
   Neelima's site.

   Every colour, font, corner and gap below comes from a variable that
   src/lib/theme.js sets on page load from the Appearance settings. That
   is why changing a setting in the editor repaints the whole site at
   once. The values in :root are only what shows for the split second
   before the chosen theme is applied.
   --------------------------------------------------------------- */

:root {
  --bg: #f6f8f4;
  --surface: #ffffff;
  --sunk: #eef2ea;
  --ink: #1d2620;
  --muted: #5f6f63;
  --line: #dde5d8;
  --accent: #3f6b45;
  --accent2: #b4762a;
  --accent-soft: #e6efe5;

  --radius: 18px;
  --space: 1;
  --display: 'Segoe UI', system-ui, sans-serif;
  --body: 'Segoe UI', system-ui, sans-serif;

  --shadow:
    0 1px 2px rgba(20, 30, 22, 0.05), 0 10px 26px rgba(20, 30, 22, 0.06);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--body);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

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

h1,
h2,
h3 {
  font-family: var(--display);
  font-weight: 700;
  line-height: 1.15;
  margin: 0 0 0.4em;
  text-wrap: balance;
}

h1 {
  font-size: clamp(2rem, 5vw, 2.9rem);
}

h2 {
  font-size: clamp(1.4rem, 3vw, 1.85rem);
}

h3 {
  font-size: 1.15rem;
}

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

.wrap {
  width: min(1060px, 100% - 2.5rem);
  margin-inline: auto;
}

.narrow {
  width: min(680px, 100% - 2.5rem);
  margin-inline: auto;
}

/* ---------- header ---------- */

.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 20;
}

.site-header .wrap {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  flex-wrap: wrap;
  padding: calc(0.85rem * var(--space)) 0;
}

.brand {
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.2rem;
  color: var(--ink);
  text-decoration: none;
  white-space: nowrap;
}

.nav {
  display: flex;
  gap: 0.25rem;
  flex-wrap: wrap;
  margin-left: auto;
}

.nav a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.93rem;
  font-weight: 600;
  padding: 0.35rem 0.8rem;
  border-radius: 999px;
}

.nav a:hover {
  background: var(--accent-soft);
  color: var(--ink);
}

.nav a[aria-current='page'] {
  background: var(--accent);
  color: var(--surface);
}

.nav a.edit-link {
  border: 1px solid var(--accent);
  color: var(--accent);
}

/* ---------- page furniture ---------- */

.page-head {
  padding: calc(2.75rem * var(--space)) 0 calc(1.4rem * var(--space));
}

.page-head p.lede {
  color: var(--muted);
  font-size: 1.05rem;
  max-width: 60ch;
  margin: 0;
}

main {
  padding-bottom: calc(4.5rem * var(--space));
}

.section {
  padding-top: calc(2.4rem * var(--space));
}

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.section-head a {
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
}

/* ---------- front page ---------- */

.hero {
  display: grid;
  grid-template-columns: 1fr 260px;
  gap: 2.5rem;
  align-items: center;
  padding: calc(3rem * var(--space)) 0 calc(1rem * var(--space));
}

.hero .tagline {
  color: var(--accent2);
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 0.02em;
  margin: 0 0 0.5rem;
}

.hero p {
  color: var(--muted);
  font-size: 1.06rem;
  max-width: 52ch;
}

.hero-photo {
  border-radius: 50%;
  overflow: hidden;
  aspect-ratio: 1;
  box-shadow: var(--shadow);
  border: 5px solid var(--surface);
}

@media (max-width: 760px) {
  .hero {
    grid-template-columns: 1fr;
  }

  .hero-photo {
    max-width: 200px;
  }
}

/* ---------- cards and posts ---------- */

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

.post-list {
  display: grid;
  gap: calc(1rem * var(--space));
}

.post-link {
  display: block;
  padding: calc(1.3rem * var(--space)) 1.4rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  text-decoration: none;
  color: inherit;
}

.post-link:hover {
  border-color: var(--accent);
}

.post-link h3 {
  margin: 0.25rem 0 0.4rem;
}

.post-link p {
  margin: 0;
  color: var(--muted);
  font-size: 0.96rem;
}

.meta {
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 600;
}

.meta .dot {
  opacity: 0.5;
  padding: 0 0.4rem;
}

.pinned-flag {
  color: var(--accent2);
  font-weight: 700;
}

.article {
  max-width: 68ch;
}

.article p {
  margin: 0 0 1.1em;
}

.cover {
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 1.5rem;
}

/* chips: categories, tags, filters */

.chips {
  display: flex;
  gap: 0.45rem;
  flex-wrap: wrap;
}

.chip,
.filter {
  font: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  background: var(--sunk);
  color: var(--muted);
  border: 1px solid transparent;
  padding: 0.2rem 0.75rem;
  border-radius: 999px;
}

.filter {
  cursor: pointer;
}

.filter:hover {
  border-color: var(--accent);
  color: var(--ink);
}

.filter.on {
  background: var(--accent);
  color: var(--surface);
}

/* ---------- photos ---------- */

.photo {
  position: relative;
  background: linear-gradient(135deg, var(--accent-soft), var(--sunk));
  aspect-ratio: 4 / 3;
  display: grid;
  place-items: center;
  overflow: hidden;
}

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

.photo.is-missing::after {
  content: attr(data-label);
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 1rem;
  text-align: center;
  font-size: 0.82rem;
  color: var(--muted);
}

.photo.is-missing img {
  display: none;
}

.photo.round {
  aspect-ratio: 1;
  border-radius: 50%;
}

.gallery-grid {
  display: grid;
  gap: calc(1.1rem * var(--space));
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
}

.gallery-item {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}

.gallery-item .caption {
  padding: 0.7rem 0.9rem 0.2rem;
  font-size: 0.92rem;
  font-weight: 600;
}

/* ---------- journal ---------- */

.entries {
  display: grid;
  gap: calc(1.1rem * var(--space));
}

.entry {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: calc(1.3rem * var(--space)) 1.5rem;
}

.entry-head {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  flex-wrap: wrap;
  margin-bottom: 0.5rem;
}

.entry .mood {
  font-size: 1.5rem;
  line-height: 1;
}

.entry .photo {
  margin-top: 1rem;
  border-radius: calc(var(--radius) * 0.6);
  max-width: 420px;
}

.highlight {
  font-family: var(--display);
  font-size: 1.1rem;
  font-weight: 700;
  margin: 0 0 0.5rem;
}

.energy {
  display: inline-flex;
  gap: 0.15rem;
  vertical-align: middle;
}

.energy i {
  width: 0.5rem;
  height: 0.9rem;
  border-radius: 2px;
  background: var(--line);
  display: block;
}

.energy i.on {
  background: var(--accent);
}

.gratitude {
  margin: 0.6rem 0 0;
  padding: 0.7rem 1rem;
  background: var(--sunk);
  border-radius: calc(var(--radius) * 0.5);
  list-style: none;
}

.gratitude li {
  font-size: 0.95rem;
  padding-left: 1.2rem;
  position: relative;
}

.gratitude li::before {
  content: '·';
  position: absolute;
  left: 0.35rem;
  color: var(--accent2);
  font-weight: 700;
}

.prompt {
  border-left: 3px solid var(--accent2);
  background: var(--surface);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 1rem 1.2rem;
  margin-bottom: 1.2rem;
}

.prompt .label {
  display: block;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent2);
  margin-bottom: 0.2rem;
}

.prompt p {
  margin: 0;
  font-family: var(--display);
  font-size: 1.15rem;
  font-weight: 700;
}

/* the streak strip */

.streak-box {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: calc(1.2rem * var(--space)) 1.4rem;
}

.streak-count {
  font-family: var(--display);
  font-size: 2.2rem;
  font-weight: 700;
  line-height: 1;
  color: var(--accent);
}

.streak-strip {
  display: grid;
  grid-auto-flow: column;
  grid-template-rows: repeat(7, 1fr);
  gap: 3px;
  margin-top: 1rem;
  overflow-x: auto;
  padding-bottom: 0.3rem;
}

.streak-strip i {
  width: 11px;
  height: 11px;
  border-radius: 3px;
  background: var(--sunk);
  display: block;
}

.streak-strip i.on {
  background: var(--accent);
}

.streak-strip i.today {
  outline: 2px solid var(--accent2);
  outline-offset: 1px;
}

/* ---------- notes from the family ---------- */

.notes {
  margin-top: 1rem;
}

.notes-heading {
  font-size: 1.15rem;
}

.note-list {
  list-style: none;
  margin: 0 0 0.8rem;
  padding: 0;
  display: grid;
  gap: 0.6rem;
}

.note-item {
  background: var(--sunk);
  border-radius: calc(var(--radius) * 0.55);
  padding: 0.7rem 0.95rem;
}

.note-head {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  font-size: 0.9rem;
}

.note-emoji {
  font-size: 1.05rem;
}

.note-when {
  margin-left: auto;
  color: var(--muted);
  font-size: 0.8rem;
}

.note-item p {
  margin: 0.25rem 0 0;
  font-size: 0.96rem;
}

.note-form summary {
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--accent);
  list-style: none;
  display: inline-block;
  padding: 0.3rem 0.85rem;
  border: 1px solid var(--line);
  border-radius: 999px;
}

.note-form summary::-webkit-details-marker {
  display: none;
}

.note-form summary:hover {
  border-color: var(--accent);
}

.note-fields {
  display: grid;
  gap: 0.55rem;
  margin-top: 0.7rem;
  max-width: 34rem;
}

.note-fields input,
.note-fields textarea {
  font: inherit;
  font-size: 0.95rem;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: calc(var(--radius) * 0.5);
  padding: 0.5rem 0.75rem;
  width: 100%;
  resize: vertical;
}

.note-fields input:focus,
.note-fields textarea:focus {
  outline: 2px solid var(--accent);
  outline-offset: -1px;
}

.reaction-row {
  display: flex;
  gap: 0.3rem;
}

.reaction {
  font-size: 1.2rem;
  line-height: 1;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.3rem 0.45rem;
  cursor: pointer;
}

.reaction.on {
  border-color: var(--accent);
  background: var(--accent-soft);
  transform: scale(1.08);
}

.note-actions {
  display: flex;
  align-items: center;
  gap: 0.7rem;
}

.note-send {
  font: inherit;
  font-weight: 700;
  font-size: 0.92rem;
  border: 0;
  border-radius: 999px;
  background: var(--accent);
  color: var(--surface);
  padding: 0.45rem 1.3rem;
  cursor: pointer;
}

.note-status {
  font-size: 0.85rem;
  color: var(--muted);
}

/* ---------- odds and ends ---------- */

.fact-list {
  list-style: none;
  padding: 0;
  margin: 1.2rem 0 0;
  display: grid;
  gap: 0.45rem;
}

.fact-list li {
  display: flex;
  gap: 0.9rem;
  font-size: 0.96rem;
}

.fact-list .k {
  color: var(--muted);
  min-width: 10rem;
}

.archive-list {
  list-style: none;
  padding: 0;
  margin: 0;
  columns: 2;
  gap: 1.5rem;
}

.archive-list li {
  font-size: 0.95rem;
  padding: 0.15rem 0;
}

.empty {
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  padding: 2.2rem;
  text-align: center;
  color: var(--muted);
}

.empty code {
  background: var(--accent-soft);
  color: var(--accent);
  padding: 0.1rem 0.4rem;
  border-radius: 5px;
  font-size: 0.9em;
}

.site-footer {
  border-top: 1px solid var(--line);
  padding: calc(2rem * var(--space)) 0 3rem;
  color: var(--muted);
  font-size: 0.88rem;
}

.site-footer .wrap {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

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

@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
    animation: none !important;
  }
}
