/* ============================================================
   Teacher Confessions India — warm, calm, rounded.
   Inspiration: soft cream/peach cards, bold serif headings +
   clean sans labels, line-art signature, generous radii.
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&family=Newsreader:ital,opsz,wght@0,6..72,400;0,6..72,500;0,6..72,600;0,6..72,700;1,6..72,400;1,6..72,500&display=swap');

:root {
  --bg:      #FBF6EE;   /* soft warm white page */
  --cream:   #F3E6D2;   /* peach hero card */
  --cream-2: #F7ECDA;
  --blush:   #F8E6E1;   /* accent card */
  --sky:     #E7EEF2;   /* accent card */
  --card:    #FFFFFF;
  --ink:     #201E1B;   /* near-black */
  --ink-2:   #5B554D;
  --ink-3:   #948D82;
  --rose:    #B67C6E;   /* muted meta accent (from the screenshots) */
  --lav:     #A99BD4;   /* tab underline accent */
  --line:    #ECE3D5;   /* hairline */
  --good:    #4C7A63;
  --good-bg: #E7F0EA;
  --bad:     #B15F4E;
  --bad-bg:  #F4E6E1;

  /* soft, desaturated nods to the logo (wine #70203D + green #5A8A6F) */
  --sage:    #547E67;
  --sage-bg: #DCE6DF;
  --wine:    #7C3F52;
  --wine-bg: #ECDCE1;

  --serif: 'Newsreader', Georgia, 'Times New Roman', serif;
  --sans:  'Inter', system-ui, -apple-system, sans-serif;

  --measure: 40rem;
  --r-lg: 26px;
  --r-md: 16px;
  --r-sm: 12px;
  --ease: cubic-bezier(.2,.7,.2,1);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

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

::selection { background: #F0D9C2; }
a { color: inherit; }

.wrap {
  width: 100%;
  max-width: var(--measure);
  margin: 0 auto;
  padding: 1.5rem 1.25rem 0;
}

/* ---------- shared small type ---------- */
.eyebrow {
  font-family: var(--sans);
  font-size: .68rem;
  font-weight: 600;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--rose);
  margin: 0 0 1rem;
}
.label {
  font-family: var(--sans);
  font-size: .7rem;
  font-weight: 600;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.pill {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  font-family: var(--sans);
  font-size: .62rem;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--ink-2);
  background: rgba(255,255,255,.7);
  border-radius: 999px;
  padding: .3rem .65rem;
}

/* ---------- Hero card ---------- */
.hero {
  position: relative;
  overflow: hidden;
  background: var(--cream);
  border-radius: var(--r-lg);
  padding: 2.4rem 2rem 2.2rem;
  margin-bottom: 1.1rem;
}
.hero__body { position: relative; z-index: 2; max-width: 72%; }
.hero__title {
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(2rem, 7vw, 3rem);
  line-height: 1.04;
  letter-spacing: -0.01em;
  margin: 0;
}
.hero__title .india {
  display: block;
  font-size: .42em;
  font-weight: 600;
  letter-spacing: .34em;
  text-transform: uppercase;
  color: var(--rose);
  margin-top: .7rem;
}
.hero__sub {
  font-family: var(--sans);
  font-size: .9rem;
  color: var(--ink-2);
  margin: .9rem 0 0;
  max-width: 24rem;
}
.hero__illo {
  position: absolute;
  right: -6px;
  bottom: -6px;
  width: clamp(120px, 34%, 190px);
  height: auto;
  z-index: 1;
  pointer-events: none;
}
.hero--tall { padding-top: 2.8rem; padding-bottom: 2.6rem; }

.hero__back {
  position: absolute;
  top: 1.3rem; left: 1.3rem;
  z-index: 3;
  width: 2.1rem; height: 2.1rem;
  display: grid; place-items: center;
  border-radius: 999px;
  background: rgba(255,255,255,.7);
  color: var(--ink);
  text-decoration: none;
  font-size: 1.1rem;
}
.hero__back:hover { background: #fff; }
.hero--withback .hero__body { padding-top: 1.6rem; }

/* ---------- Letter ---------- */
.letter {
  font-family: var(--serif);
  font-size: 1.12rem;
  line-height: 1.62;
  color: var(--ink);
  padding: .4rem .25rem 0;
  margin: 0 0 1.6rem;
}
.letter p { margin: 0 0 1.05rem; }
.letter p:first-child { font-weight: 500; }
.letter__sign { margin-top: 1.6rem; color: var(--ink-2); }
.letter__name {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 500;
  font-size: 1.5rem;
  color: var(--ink);
  display: inline-block;
  margin-top: .15rem;
}

/* ---------- House rules card ---------- */
.rules {
  background: var(--sage-bg);
  border-radius: var(--r-md);
  padding: 1.4rem 1.4rem 1.5rem;
  margin: 0 0 1.6rem;
}
.rules__title { margin: 0 0 1.05rem; }
.rules ol { margin: 0; padding: 0; list-style: none; counter-reset: r; }
.rules li {
  counter-increment: r;
  position: relative;
  padding-left: 2.6rem;
  min-height: 1.8rem;
  margin-bottom: .95rem;
  color: var(--ink-2);
  font-size: .95rem;
  line-height: 1.5;
  display: flex;
  align-items: center;
}
.rules li:last-child { margin-bottom: 0; }
.rules li::before {
  content: counter(r);
  position: absolute;
  left: 0; top: 50%;
  transform: translateY(-50%);
  width: 1.8rem; height: 1.8rem;
  display: grid; place-items: center;
  background: #fff;
  color: var(--ink);
  font-family: var(--sans);
  font-size: .82rem;
  font-weight: 600;
  border-radius: 999px;
}

/* ---------- Compose ---------- */
.compose { margin: 0 0 1rem; }
.compose__label { display: block; margin: 0 0 .7rem; }
textarea#body {
  width: 100%;
  min-height: 12rem;
  resize: vertical;
  font-family: var(--serif);
  font-size: 1.08rem;
  line-height: 1.6;
  color: var(--ink);
  background: var(--card);
  border: 1.5px solid var(--line);
  border-radius: var(--r-md);
  padding: 1.1rem 1.2rem;
}
textarea#body::placeholder { color: var(--ink-3); font-style: italic; }
textarea#body:focus {
  outline: none;
  border-color: var(--rose);
  box-shadow: 0 0 0 4px rgba(182,124,110,.14);
}
.compose__foot {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; margin-top: 1rem;
}
.compose__count { font-family: var(--sans); font-size: .78rem; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.compose__err { font-family: var(--sans); font-size: .85rem; color: var(--bad); margin: .85rem 0 0; }

/* honeypot */
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* ---------- Buttons ---------- */
.btn {
  font-family: var(--sans);
  font-size: .92rem;
  font-weight: 500;
  border: 1.5px solid var(--ink);
  background: transparent;
  color: var(--ink);
  padding: .72rem 1.4rem;
  border-radius: var(--r-sm);
  cursor: pointer;
  transition: background .18s var(--ease), color .18s var(--ease), border-color .18s var(--ease), opacity .18s, transform .1s;
}
.btn:active { transform: translateY(1px); }
.btn:hover { background: var(--ink); color: var(--bg); }
.btn:disabled { opacity: .45; cursor: default; }
.btn:disabled:hover { background: transparent; color: var(--ink); }
.btn--primary { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.btn--primary:hover { background: #000; }
.btn--small { padding: .5rem 1rem; font-size: .84rem; border-radius: 999px; }
.btn--good { border-color: var(--good); color: var(--good); }
.btn--good:hover { background: var(--good); color: #fff; }
.btn--bad { border-color: var(--bad); color: var(--bad); }
.btn--bad:hover { background: var(--bad); color: #fff; }
.btn--ghost { border-color: var(--line); color: var(--ink-2); background: var(--card); }
.btn--ghost:hover { background: var(--ink); color: var(--bg); border-color: var(--ink); }

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

/* ---------- Thank you ---------- */
.thanks { text-align: center; padding: 2rem 1rem 1rem; }
.thanks__mark {
  width: 3rem; height: 3rem; margin: 0 auto 1.4rem;
  border-radius: 999px; background: var(--cream);
  display: grid; place-items: center; color: var(--rose); font-size: 1.4rem;
}
.thanks h2 { font-family: var(--serif); font-weight: 600; font-size: 1.55rem; margin: 0 0 .8rem; }
.thanks p { color: var(--ink-2); margin: 0 auto; max-width: 27rem; font-size: .98rem; }
.thanks__actions { margin-top: 1.9rem; }

/* ---------- alt link / footer ---------- */
.alt { text-align: center; font-family: var(--sans); font-size: .9rem; margin: 1.4rem 0 0; }
.alt a { color: var(--ink-2); text-decoration: none; font-weight: 500; border-bottom: 1.5px solid var(--rose); padding-bottom: 1px; }
.alt a:hover { color: var(--ink); }

.foot {
  text-align: center; font-family: var(--sans); font-size: .74rem;
  letter-spacing: .04em; color: var(--ink-3);
  padding: 2.5rem 1.5rem 3rem; margin-top: 2rem;
}

/* ============================================================
   Confessions (read) page
   ============================================================ */
.count-line {
  text-align: center; font-family: var(--sans);
  font-size: .72rem; letter-spacing: .16em; text-transform: uppercase;
  color: var(--rose); font-weight: 600; margin: 0 0 1.4rem;
}
.entries { margin: 0; padding: 0; list-style: none; }
.entry {
  background: var(--card);
  border: 1.5px solid var(--line);
  border-radius: var(--r-md);
  padding: 1.3rem 1.4rem 1.4rem;
  margin-bottom: .9rem;
}
.entry__head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; margin-bottom: .7rem;
}
.entry__no {
  font-family: var(--sans);
  font-size: .68rem; font-weight: 600; letter-spacing: .06em;
  color: var(--wine);
  background: var(--wine-bg);
  border-radius: 999px;
  padding: .28rem .7rem;
}
.entry__date { font-family: var(--sans); font-size: .74rem; color: var(--ink-3); }
.entry__body {
  margin: 0; white-space: pre-wrap; overflow-wrap: break-word;
  font-family: var(--serif); font-size: 1.08rem; line-height: 1.6; color: var(--ink);
}

/* pagination */
.pager {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; margin: 1.4rem 0 0;
}
.pager__status { font-family: var(--sans); font-size: .8rem; color: var(--ink-3); font-variant-numeric: tabular-nums; }

.empty, .loading { text-align: center; color: var(--ink-2); padding: 2.5rem 1rem; font-family: var(--sans); font-size: .95rem; }
.empty a { color: var(--ink); border-bottom: 1.5px solid var(--rose); text-decoration: none; }

/* ============================================================
   Admin
   ============================================================ */
.admin-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; margin: .4rem 0 .3rem; flex-wrap: wrap;
}
.admin-head h1 { font-family: var(--serif); font-weight: 600; font-size: 1.5rem; margin: 0; }

.login { max-width: 24rem; margin: 1.2rem auto 0; }
.login .hero { text-align: left; }
.login__card {
  background: var(--card); border: 1.5px solid var(--line);
  border-radius: var(--r-md); padding: 1.6rem 1.4rem;
}
.field { margin-bottom: 1rem; }
.field label { display: block; font-family: var(--sans); font-size: .7rem; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-3); margin-bottom: .45rem; }
.field input {
  width: 100%; font-family: var(--sans); font-size: .95rem;
  padding: .7rem .85rem; border: 1.5px solid var(--line);
  border-radius: var(--r-sm); background: #fff; color: var(--ink);
}
.field input:focus { outline: none; border-color: var(--rose); box-shadow: 0 0 0 4px rgba(182,124,110,.14); }

.tabs { display: flex; gap: 1.4rem; margin: 1.3rem 0 1rem; border-bottom: 1.5px solid var(--line); }
.tab {
  border: 0; background: transparent; font-family: var(--sans);
  font-size: .88rem; font-weight: 500; color: var(--ink-3);
  padding: .6rem 0 .8rem; cursor: pointer;
  border-bottom: 2.5px solid transparent; margin-bottom: -1.5px;
}
.tab[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--sage); }
.tab .pill {
  min-width: 1.2rem; justify-content: center; font-size: .64rem;
  background: var(--sage); color: #fff; padding: .12rem .45rem; margin-left: .4rem;
}

.card {
  border: 1.5px solid var(--line); border-radius: var(--r-md);
  background: var(--card); padding: 1.2rem 1.2rem 1rem; margin-bottom: 1rem;
}
.card__meta { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: .75rem; font-family: var(--sans); font-size: .72rem; color: var(--ink-3); }
.card__meta .status { text-transform: uppercase; letter-spacing: .12em; font-weight: 600; padding: .18rem .55rem; border-radius: 999px; }
.status--pending  { color: var(--rose); background: var(--blush); }
.status--approved { color: var(--good); background: var(--good-bg); }
.status--rejected { color: var(--bad); background: var(--bad-bg); }
.card textarea {
  width: 100%; min-height: 6rem; resize: vertical;
  font-family: var(--serif); font-size: 1rem; line-height: 1.55; color: var(--ink);
  background: #fff; border: 1.5px solid var(--line); border-radius: var(--r-sm);
  padding: .85rem .95rem; white-space: pre-wrap;
}
.card textarea:focus { outline: none; border-color: var(--rose); box-shadow: 0 0 0 4px rgba(182,124,110,.12); }
.card textarea[readonly] { background: var(--bg); color: var(--ink-2); }
.card__actions { display: flex; gap: .5rem; margin-top: .85rem; flex-wrap: wrap; align-items: center; }
.card__note { font-family: var(--sans); font-size: .76rem; color: var(--ink-3); margin-left: auto; }

.toast {
  position: fixed; left: 50%; bottom: 1.5rem;
  transform: translateX(-50%) translateY(1rem);
  background: var(--ink); color: var(--bg);
  font-family: var(--sans); font-size: .85rem;
  padding: .7rem 1.2rem; border-radius: 999px;
  opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; z-index: 20;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------- motion ---------- */
.fade-up { opacity: 0; transform: translateY(12px); animation: fadeUp .7s var(--ease) forwards; }
.fade-in { opacity: 0; animation: fadeIn .45s var(--ease) forwards; }
@keyframes fadeUp { to { opacity: 1; transform: none; } }
@keyframes fadeIn { to { opacity: 1; } }

@media (max-width: 480px) {
  .hero__body { max-width: 100%; }
  .hero__illo { opacity: .5; width: 120px; }
}
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
  .fade-up, .fade-in { opacity: 1; transform: none; }
}

/* ---------- content links + top nav (added) ---------- */
.clink { color: var(--rose); text-decoration: underline; text-underline-offset: 2px; }
.clink:hover { color: var(--ink); }
.eyebrow a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
.eyebrow a:hover { color: var(--ink); }
.foot a.clink { color: var(--rose); }
.letter__org { display: block; margin-top: .5rem; font-family: var(--sans); font-size: .82rem; }
.topnav { display: flex; justify-content: center; margin: .2rem 0 1.2rem; }

/* Ensure the [hidden] attribute always wins over display rules (pager, etc.) */
[hidden] { display: none !important; }
