/* ==========================================================================
   முதுமொழிக்காஞ்சி · Mutumoḻikkāñci — The Ancient Sayings Kāñci
   400 kāñci verses · c. 1st–5th century CE
   Author: Maturai Kumaraṉār · Patiṉeṇkīḻkaṇakku collection

   Title: முதுமொழி (mutumoḻi) = ancient saying, proverb, old word.
   கா ஞ்சி (kāñci) = a classical Tamil poetic mode meditating on the
   transience of all things — the kāñci is the poetry of impermanence,
   the acknowledgment that nothing lasts, spoken not with despair but
   with the clear-eyed acceptance of one who has seen much.

   Together: "The Kāñci of Ancient Sayings" — four hundred verses that
   take the form of the kāñci poem, each one a mutumoḻi, an old truth
   drawn from nature, society, or human experience and offered as a
   steady light in the face of passing time.

   Unlike the crisp triplet-lists of Tirikkaṭukam and Ēlāti, or the
   fourfold gems of Nāṉmaṇikkaṭikai, Mutumoḻikkāñci works through
   imagery and analogy: an observation from the natural world leads to
   a moral insight. It is the most lyrical of the Patiṉeṇkīḻkaṇakku
   ethical works — closer to the Sangam nature-poetry tradition than
   to the didactic list-literature that surrounds it.

   Visual identity: The twilight hour — the blue of the sky just after
   sunset, when things are still visible but already receding. Indigo
   (the kāñci mode's colour: deep, contemplative, neither night nor day).
   Silver for the mutumoḻi — old truths like moonlight, cool and enduring.
   The mark: a waning crescent with a small dot beside it — the moon
   as it passes, the ancient saying that remains.
   ========================================================================== */

:root {
  /* ── Indigo (primary) ───────────────────────────────── */
  --mm-indigo:        #1e2258;
  --mm-indigo-mid:    #2e3278;
  --mm-indigo-bright: #4a50a8;
  --mm-indigo-pale:   rgba(30, 34, 88, 0.10);
  --mm-indigo-pale2:  rgba(30, 34, 88, 0.05);

  /* ── Silver (secondary) ─────────────────────────────── */
  --mm-silver:        #8090a8;
  --mm-silver-mid:    #607088;
  --mm-silver-bright: #a0b4c8;
  --mm-silver-pale:   rgba(128, 144, 168, 0.16);
  --mm-silver-pale2:  rgba(128, 144, 168, 0.07);

  /* ── Dusk (accent) ──────────────────────────────────── */
  --mm-dusk:          #6858a0;
  --mm-dusk-mid:      #503f80;
  --mm-dusk-pale:     rgba(104, 88, 160, 0.12);

  /* ── Night parchment ────────────────────────────────── */
  --mm-parchment:     #e8eaf4;
  --mm-parchment-mid: #d8daea;

  /* ── Deep ink ───────────────────────────────────────── */
  --mm-ink:           #0e1030;
  --mm-ink-mid:       #1e2248;
  --mm-ink-pale:      rgba(14, 16, 48, 0.55);

  /* ── Site overrides ─────────────────────────────────── */
  --accent-vermillion: var(--mm-indigo);
  --accent-kumkum:     var(--mm-indigo-mid);
  --accent-ochre:      var(--mm-silver-mid);
  --accent-gold:       var(--mm-silver-bright);
}

/* Body background: deep twilight indigo */
body { background: #7880a8; }
body::before {
  background-image:
    radial-gradient(circle at 25% 20%, rgba(30,34,88,0.10) 0%, transparent 55%),
    radial-gradient(circle at 75% 80%, rgba(104,88,160,0.07) 0%, transparent 50%),
    repeating-linear-gradient(
      110deg,
      transparent 0px, transparent 14px,
      rgba(30,34,88,0.012) 14px, rgba(30,34,88,0.012) 15px
    );
}

/* Header */
.site-header { border-bottom-color: rgba(30,34,88,0.22); }
.site-logo .mark { color: var(--mm-silver-bright); }
.wordmark-tamil { color: var(--mm-indigo); }
.site-nav a { color: var(--mm-indigo-mid); }
.site-nav a:hover { color: var(--mm-dusk); }
a { color: var(--mm-indigo-mid); }
a:hover { color: var(--mm-indigo-bright); }

/* ---------------------------------------------------------------------------
   Hero
   ------------------------------------------------------------------------- */
.mm-hero {
  background: linear-gradient(160deg, #1e2258 0%, #2a2e6e 40%, #1a1e4a 100%);
  color: var(--mm-parchment);
  padding: 3.5rem 2rem 3rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.mm-hero::before {
  content: "";
  position: absolute; inset: 0;
  background-image:
    radial-gradient(ellipse at 15% 75%, rgba(104,88,160,0.15) 0%, transparent 50%),
    radial-gradient(ellipse at 85% 20%, rgba(74,80,168,0.10) 0%, transparent 50%),
    radial-gradient(ellipse at 50% 50%, rgba(128,144,168,0.05) 0%, transparent 70%);
  pointer-events: none;
}
.mm-hero > * { position: relative; }

.mm-hero-mark {
  margin: 0 auto 1.4rem;
  width: 72px; height: 72px;
  display: flex; align-items: center; justify-content: center;
}
.mm-hero h1 {
  font-family: var(--font-tamil, serif);
  font-size: clamp(1.6rem, 4vw, 2.2rem);
  color: #fff;
  margin: 0 0 0.3rem;
  text-shadow: 0 2px 16px rgba(0,0,0,0.40);

  word-break: break-word;
  overflow-wrap: break-word;
}
.mm-hero-roman {
  font-size: 1.2rem;
  color: rgba(232,234,244,0.82);
  font-style: italic;
  margin: 0 0 0.4rem;
}
.mm-hero-meaning {
  font-size: 1rem;
  color: var(--mm-silver-bright);
  font-weight: 600;
  letter-spacing: 0.03em;
  margin: 0 0 1.2rem;
}
.mm-hero p {
  max-width: 640px;
  margin: 0 auto 0.8rem;
  font-size: 0.97rem;
  color: rgba(232,234,244,0.80);
  line-height: 1.65;
}

/* Stat row */
.mm-stat-row {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.6rem 2rem;
  margin-top: 1.8rem;
}
.mm-stat { text-align: center; }
.mm-stat-num {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--mm-silver-bright);
}
.mm-stat-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(232,234,244,0.50);
  margin-top: 0.15rem;
}

/* ---------------------------------------------------------------------------
   Context banner
   ------------------------------------------------------------------------- */
.mm-context-banner {
  background: var(--mm-indigo-pale);
  border-left: 3px solid var(--mm-indigo-bright);
  color: var(--mm-ink-mid);
  padding: 1rem 1.4rem;
  font-size: 0.92rem;
  line-height: 1.65;
  max-width: 820px;
  margin: 1.6rem auto 0;
}
.mm-context-banner strong { color: var(--mm-indigo); }
.mm-context-banner em { color: var(--mm-dusk-mid); font-style: italic; }

/* ---------------------------------------------------------------------------
   Verses section header
   ------------------------------------------------------------------------- */
.mm-verses-header {
  max-width: 820px;
  margin: 2rem auto 0.8rem;
  padding: 0 1rem;
}
.mm-verses-header h2 {
  font-size: 1.3rem;
  color: var(--mm-indigo);
  margin: 0 0 0.3rem;
}
.mm-verses-header p {
  font-size: 0.85rem;
  color: var(--mm-ink-pale);
  margin: 0;
}

/* ---------------------------------------------------------------------------
   Verse cards
   ------------------------------------------------------------------------- */
.mm-verses-main {
  max-width: 820px;
  margin: 0 auto 3rem;
  padding: 0 1rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.mm-verse {
  background: var(--mm-parchment);
  border: 1px solid rgba(30,34,88,0.14);
  border-radius: 6px;
  overflow: hidden;
  box-shadow: 0 1px 4px rgba(14,16,48,0.07);
  transition: box-shadow 0.2s;
}
.mm-verse:hover { box-shadow: 0 3px 10px rgba(14,16,48,0.12); }

/* Verse header */
.mm-verse-header {
  display: flex;
  align-items: baseline;
  gap: 0.8rem;
  padding: 0.65rem 1rem 0.5rem;
  background: linear-gradient(90deg, rgba(30,34,88,0.07) 0%, rgba(30,34,88,0.02) 100%);
  border-bottom: 1px solid rgba(30,34,88,0.09);
}
.mm-verse-num {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--mm-silver-mid);
  min-width: 1.8rem;
  text-align: right;
  opacity: 0.85;
}
.mm-verse-theme {
  font-size: 0.85rem;
  color: var(--mm-indigo-mid);
  font-style: italic;
  flex: 1;
}

/* Saying label — the mutumoḻi tag */
.mm-saying-label {
  padding: 0.55rem 1rem 0.35rem;
  border-bottom: 1px solid rgba(30,34,88,0.08);
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
}
.mm-saying-tag {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.10em;
  color: var(--mm-silver-mid);
  white-space: nowrap;
}
.mm-saying-text {
  font-size: 0.88rem;
  color: var(--mm-indigo);
  font-style: italic;
  line-height: 1.45;
}

/* Verse body */
.mm-verse-body { padding: 0.4rem 0; }

/* Layer (details/summary) */
.mm-layer { border-top: 1px solid rgba(30,34,88,0.07); }
.mm-layer:first-child { border-top: none; }

.mm-layer-toggle {
  display: block;
  padding: 0.45rem 1rem;
  font-size: 0.76rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--mm-indigo-mid);
  cursor: pointer;
  user-select: none;
  list-style: none;
  background: transparent;
  transition: background 0.15s, color 0.15s;
}
.mm-layer-toggle::-webkit-details-marker { display: none; }
.mm-layer-toggle::before {
  content: "▸ ";
  font-size: 0.65rem;
  opacity: 0.5;
  transition: transform 0.15s;
  display: inline-block;
}
details[open] > .mm-layer-toggle::before { transform: rotate(90deg); }
.mm-layer-toggle:hover {
  background: var(--mm-indigo-pale);
  color: var(--mm-indigo);
}
details[open] > .mm-layer-toggle {
  color: var(--mm-indigo);
  background: var(--mm-indigo-pale);
}

.mm-layer-content {
  padding: 0.5rem 1rem 0.8rem;
  font-size: 0.94rem;
  line-height: 1.75;
  color: var(--mm-ink);
}

.mm-tamil-verse {
  font-family: var(--font-tamil, serif);
  font-size: 1.05rem;
  color: var(--mm-ink);
  line-height: 1.9;
}
.mm-translit-verse {
  font-style: italic;
  color: var(--mm-ink-mid);
  font-size: 0.96rem;
}
.mm-english-prose { color: var(--mm-ink-mid); }
.mm-note {
  font-size: 0.88rem;
  color: var(--mm-silver-mid);
  line-height: 1.7;
  border-left: 2px solid var(--mm-silver-pale);
  padding-left: 0.8rem;
}

/* ---------------------------------------------------------------------------
   About page
   ------------------------------------------------------------------------- */
.mm-about-main {
  max-width: 720px;
  margin: 0 auto 3rem;
  padding: 1.5rem 1rem;
  color: var(--mm-ink);
  line-height: 1.75;
}
.mm-about-main h2 {
  color: var(--mm-indigo);
  font-size: 1.2rem;
  margin: 1.8rem 0 0.5rem;
  border-bottom: 1px solid var(--mm-indigo-pale);
  padding-bottom: 0.3rem;
}
.mm-about-main h2:first-child { margin-top: 0; }
.mm-about-main p { margin: 0 0 0.9rem; }
.mm-about-main table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
  margin: 1rem 0;
}
.mm-about-main th {
  background: var(--mm-indigo-pale);
  color: var(--mm-indigo);
  padding: 0.5rem 0.7rem;
  text-align: left;
  font-weight: 600;
}
.mm-about-main td {
  padding: 0.45rem 0.7rem;
  border-bottom: 1px solid rgba(30,34,88,0.08);
  vertical-align: top;
}
.mm-about-main tr:last-child td { border-bottom: none; }
.mm-about-main [lang="ta"] { font-family: var(--font-tamil, serif); }

@media (max-width: 480px) {
  .mm-hero h1 { font-size: clamp(1.3rem, 5.5vw, 1.8rem); }
}
