/* ==========================================================================
   Homepage: "What's in my name?" dropdown and the News list
   ========================================================================== */

/* ---- What's in my name? ---- */
.name-line { margin-top: 4px; }

.name-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 12px;
  border: 1px solid #cfc4ef;
  border-radius: 999px;
  background: #f4f0ff;
  color: #4a2fb0;
  font: inherit;
  font-size: 0.9em;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.name-btn:hover,
.name-btn:focus-visible { background: #e9e1ff; border-color: #a996e6; outline: none; }

.name-btn:not(.visitor-btn)[aria-expanded="true"] { background: #4a2fb0; border-color: #4a2fb0; color: #fff; }

.name-caret { font-size: 0.75em; transition: transform 0.3s ease; }
.name-btn[aria-expanded="true"] .name-caret { transform: rotate(180deg); }

.name-box {
  display: grid;
  grid-template-rows: 0fr;
  opacity: 0;
  transform: translateY(-6px);
  transition: grid-template-rows 0.35s ease, opacity 0.25s ease, transform 0.35s ease, margin 0.35s ease;
}

.name-box.is-open {
  grid-template-rows: 1fr;
  opacity: 1;
  transform: none;
  margin: 6px 0 18px;
}

.name-inner { overflow: hidden; min-height: 0; }

.name-box.is-open .name-inner {
  border: 1px solid #ddd3f6;
  border-left: 3px solid #6a4fd6;
  border-radius: 8px;
  background: linear-gradient(180deg, #fdfcff 0%, #faf8ff 100%);
  box-shadow: 0 8px 22px rgba(60, 35, 140, 0.08);
}

.name-list {
  display: grid;
  grid-template-columns: max-content 1fr;
  column-gap: 18px;
  row-gap: 10px;
  align-items: baseline;            /* labels sit on the same line as their text */
  margin: 0;
  padding: 14px 18px;
  text-align: left;
}

.name-list dt {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #6a4fd6;
}

.name-list dd {
  margin: 0;
  font-size: 14.5px;
  line-height: 1.55;
  color: #2b2b33;
}

.name-deva {
  font-family: "Noto Serif Devanagari", "Noto Sans Devanagari", "Kohinoor Devanagari", "Mangal", serif;
  font-size: 1.05em;
}

.name-bengali {
  font-family: "Noto Serif Bengali", serif;
  font-size: 17px !important;
}

/* ---- News ----
   The rounded border and background live on an outer frame; the list scrolls
   inside it. That keeps all four corners cleanly rounded even where the system
   shows a permanent scrollbar (Mac with a mouse, Windows). */
.news-box {
  --news-bg: #fcfbff;
  border: 1px solid #e6e1f4;
  border-radius: 10px;
  background: var(--news-bg);
  overflow: hidden;
  padding-right: 3px;                    /* a little air between the scrollbar and the border */
}
.news-box:has(.news-list:focus-visible) { outline: 2px solid #6a4fd6; outline-offset: 2px; }
.news-list {
  list-style: none;
  margin: 0;
  --news-pad: 14px;
  padding: 2px calc(var(--news-pad) - 3px) 0 var(--news-pad);   /* no bottom padding: the fade must reach the edge */
  text-align: left;
  /* shows ~5 items and scrolls for the rest */
  max-height: 260px;
  overflow-y: auto;
  overscroll-behavior: contain;
  outline: none;
}
/* soft fade at the bottom while there is more to scroll */
.news-list::after {
  content: "";
  position: sticky;
  bottom: 0;
  display: block;
  height: 34px;
  margin: -34px calc(3px - var(--news-pad)) 0 calc(-1 * var(--news-pad));
  background: linear-gradient(to bottom, rgba(252, 251, 255, 0), var(--news-bg, #fcfbff));
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s ease;
}
.news-list.has-more::after { opacity: 1; }
/* a slim pill scrollbar, kept clear of the corners (Chrome, Edge, Safari) */
.news-list::-webkit-scrollbar { width: 6px; }
.news-list::-webkit-scrollbar-track { background: transparent; margin: 7px 0; }
.news-list::-webkit-scrollbar-thumb { background: #cfc4ef; background-clip: padding-box; border: 1.5px solid transparent; border-radius: 6px; }
.news-list::-webkit-scrollbar-thumb:hover { background-color: #a996e6; }
/* Firefox */
@supports not selector(::-webkit-scrollbar) {
  .news-list { scrollbar-width: thin; scrollbar-color: #cfc4ef transparent; }
}

.news-list li {
  display: grid;
  grid-template-columns: 116px 1fr;   /* fits "September 2026" */
  column-gap: 14px;
  align-items: baseline;
  padding: 6px 0;
}

.news-list li[hidden] { display: none; }

.news-list li + li { border-top: 1px dashed #ebe6f7; }

.news-date {
  font-size: 12.5px;
  font-weight: 650;
  color: #5b4a9e;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.news-text {
  font-size: 14.5px;
  line-height: 1.5;
  color: #2b2b33;
}

.text-content .news-text a { font-size: inherit; }



@media (prefers-reduced-motion: reduce) {
  .name-box, .name-caret { transition: none; }
}

@media (max-width: 1000px) {
  .name-list { grid-template-columns: 1fr; row-gap: 2px; padding: 10px 12px; }
  .name-list dd { font-size: 12.5px; margin-bottom: 8px; }
  .name-bengali { font-size: 15px !important; }
  .news-list { max-height: 298px; --news-pad: 10px; }
  .news-list li { grid-template-columns: 1fr; row-gap: 1px; }   /* date above the text on phones */
  .news-date { font-size: 11px; }
  .news-text { font-size: 12.5px; }
}

/* a little more room between the "News" heading and its box */
#news-heading { margin-bottom: 11px; }

/* "How to say it": first name and surname on their own lines; the first name's IPA slides out from a small pill */
.name-say { display: flex; flex-wrap: wrap; align-items: baseline; column-gap: 10px; }
.name-say + .name-say { margin-top: 2px; }
.name-say-part { min-width: 5.6em; font-size: 12.5px; color: #77738a; }
.ipa-btn {
  all: unset;
  align-self: center;
  padding: 0 8px;
  border: 1px solid #d9d0f3;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 600;
  line-height: 1.75;
  letter-spacing: 0.02em;
  color: #4a2fb0;
  cursor: pointer;
  transition: background-color 0.2s ease;
}
.ipa-btn:hover { background: #f4f0ff; }
/* "Listen" pill beside the first name; while it plays, the pill fills and its sound waves pulse */
.say-btn {
  all: unset;
  align-self: center;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  margin-left: -3px;
  padding: 0 9px 0 6px;
  border: 1px solid #d9d0f3;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 600;
  line-height: 1.75;
  letter-spacing: 0.02em;
  color: #4a2fb0;
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}
.say-btn svg { width: 14px; height: 14px; flex: none; }
.say-btn:hover { background: #f4f0ff; }
.say-btn:focus-visible { outline: 2px solid #6a4fd6; outline-offset: 2px; }
.say-btn.is-playing { background: #4a2fb0; border-color: #4a2fb0; color: #fff; }
.say-btn.is-playing .say-w1 { animation: say-wave 0.8s ease-in-out infinite; }
.say-btn.is-playing .say-w2 { animation: say-wave 0.8s ease-in-out 0.16s infinite; }
@keyframes say-wave { 0%, 100% { opacity: 1; } 50% { opacity: 0.2; } }
.ipa-btn:focus-visible { outline: 2px solid #6a4fd6; outline-offset: 2px; }
.ipa-caret { display: inline-block; font-size: 0.9em; transition: transform 0.3s ease; }
.ipa-btn[aria-expanded="true"] .ipa-caret { transform: rotate(180deg); }
.ipa-reveal {
  display: inline-grid;
  grid-template-columns: 0fr;
  opacity: 0;
  transition: grid-template-columns 0.32s ease, opacity 0.25s ease;
}
.ipa-reveal.is-open { grid-template-columns: 1fr; opacity: 1; }
.ipa-inner { min-width: 0; overflow: hidden; white-space: nowrap; }
.name-list .name-ipa {
  font-family: "Charis SIL", "Doulos SIL", "Gentium Plus", "Noto Serif", "Times New Roman", serif;
  font-size: 15px;
  font-weight: 400;
  color: #5f5b6b;
  text-decoration: underline dotted;
  text-decoration-color: #b9b2d6;
  text-underline-offset: 3px;
}
.name-list .name-ipa:hover { color: #4a2fb0; text-decoration-color: currentColor; }
@media (prefers-reduced-motion: reduce) { .ipa-reveal, .ipa-caret { transition: none; } .say-btn .say-w1, .say-btn .say-w2 { animation: none !important; } }
html[data-theme="dark"] .name-say-part { color: #9a96ad; }
html[data-theme="dark"] .ipa-btn { border-color: #3a3456; color: #c9bcff; }
html[data-theme="dark"] .ipa-btn:hover { background: #2a2445; }
html[data-theme="dark"] .say-btn { border-color: #3a3456; color: #c9bcff; }
html[data-theme="dark"] .say-btn:hover { background: #2a2445; }
html[data-theme="dark"] .say-btn.is-playing { background: #c9bcff; border-color: #c9bcff; color: #17151f; }
html[data-theme="dark"] .name-list .name-ipa { color: #c8c4d6; text-decoration-color: #5d5878; }
html[data-theme="dark"] .name-list .name-ipa:hover { color: #d4c9ff; }
