/* theme: manual light/dark (html.theme-light / html.theme-dark) */
/* Homepage "What's new" (public/index.php, src/news.php). Loaded after home.css;
   nothing here affects the list or other pages. */

:root { --news-accent: var(--green-700); --news-amber: #8a5a00; --news-amber-bg: #fdf1d8; }
@media (prefers-color-scheme: dark) {
  html:not(.theme-light) { --news-accent: #7fd1b8; --news-amber: #f3c56b; --news-amber-bg: #3a2e14; }
}
html.theme-dark { --news-accent: #7fd1b8; --news-amber: #f3c56b; --news-amber-bg: #3a2e14; }


/* ---- The small "New: …" link above the hero title -------------------- */
.news-pill {
  display: flex; align-items: center; gap: 8px;
  width: fit-content; max-width: 100%;
  margin: 0 0 14px;
  padding: 6px 14px 6px 8px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  text-decoration: none;
  font-size: .92rem;
  line-height: 1.3;
  box-shadow: 0 2px 10px rgba(18,60,50,.08);
}
.news-pill svg {
  flex: none;
  width: 26px; height: 26px; padding: 4px;
  border-radius: 50%;
  background: var(--green-700); color: #fff;
}
.news-pill strong { color: var(--news-accent); }
.news-pill-arrow { color: var(--news-accent); font-weight: 700; transition: transform .15s; }
.news-pill:hover .news-pill-arrow { transform: translateX(3px); }
.news-pill:focus-visible { outline: 3px solid var(--green-600); outline-offset: 2px; }

/* ---- Section ----------------------------------------------------------- */
.news { padding: 48px 0; scroll-margin-top: 16px; }
.news h2 {
  font-size: clamp(1.5rem, 4vw, 2.1rem);
  letter-spacing: -.01em;
  margin: 0 0 8px;
  text-wrap: balance;
}
.news-group {
  display: flex; align-items: center; gap: 10px;
  margin: 8px 0 14px;
  font-size: 1.15rem;
}
.news-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: .75rem;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
  background: var(--news-amber-bg);
  color: var(--news-amber);
}
.news-badge.is-new { background: var(--green-700); color: #fff; }

.news-icon {
  flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  width: 48px; height: 48px;
  border-radius: 14px;
  background: var(--green-100);
  color: var(--news-accent);
}
.news-icon svg { width: 26px; height: 26px; }

/* ---- New: big cards with "How do I use it?" ----------------------------- */
.news-grid { display: grid; gap: 14px; grid-template-columns: 1fr; margin-bottom: 34px; }
.news-card {
  display: flex; flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-top: 4px solid var(--green-600);
  border-radius: 16px;
  padding: 20px;
}
.news-card .news-icon { margin-bottom: 12px; }
.news-card h4 { margin: 0 0 6px; font-size: 1.15rem; }
.news-card > p { margin: 0; line-height: 1.55; font-size: 1rem; }

.news-how { margin-top: 14px; border-top: 1px solid var(--border); padding-top: 10px; }
.news-how summary {
  cursor: pointer;
  list-style: none;
  display: inline-flex; align-items: center; gap: 6px;
  min-height: 40px;
  font-weight: 700;
  color: var(--news-accent);
}
.news-how summary::-webkit-details-marker { display: none; }
.news-how summary::before {
  content: "+";
  display: inline-flex; align-items: center; justify-content: center;
  width: 22px; height: 22px;
  border-radius: 50%;
  background: var(--green-100);
  font-weight: 800;
}
.news-how[open] summary::before { content: "−"; }
.news-how summary:focus-visible { outline: 3px solid var(--green-600); outline-offset: 2px; border-radius: 6px; }
.news-how ol { margin: 6px 0 0; padding: 0; list-style: none; counter-reset: step; display: grid; gap: 10px; }
.news-how li {
  counter-increment: step;
  position: relative;
  padding-left: 36px;
  line-height: 1.5;
}
.news-how li::before {
  content: counter(step);
  position: absolute; left: 0; top: 0;
  width: 26px; height: 26px;
  border-radius: 50%;
  background: var(--green-700); color: #fff;
  font-weight: 800; font-size: .85rem;
  display: inline-flex; align-items: center; justify-content: center;
}
.news-link { display: inline-block; margin-top: 12px; color: var(--news-accent); font-weight: 600; }

/* ---- Coming soon: a calm list ------------------------------------------ */
.news-soon {
  list-style: none; margin: 0; padding: 0;
  display: grid; gap: 12px; grid-template-columns: 1fr;
}
.news-soon li {
  display: flex; gap: 14px; align-items: flex-start;
  padding: 16px;
  border: 1px dashed var(--border);
  border-radius: 16px;
  background: color-mix(in srgb, var(--surface) 60%, transparent);
}
.news-soon .news-icon { width: 42px; height: 42px; border-radius: 12px; background: var(--news-amber-bg); color: var(--news-amber); }
.news-soon .news-icon svg { width: 22px; height: 22px; }
.news-soon h4 { margin: 2px 0 4px; font-size: 1.02rem; }
.news-soon p { margin: 0; color: var(--muted); line-height: 1.5; font-size: .95rem; }
.news-note { margin: 18px 0 0; line-height: 1.5; }
.news-note a { color: var(--news-accent); font-weight: 600; }

@media (min-width: 640px) {
  .news-grid, .news-soon { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 960px) {
  .news-grid { grid-template-columns: repeat(3, 1fr); align-items: start; }
  .news-soon { grid-template-columns: repeat(3, 1fr); }
}
@media (prefers-reduced-motion: reduce) { .news-pill-arrow { transition: none; } }

/* Right-to-left languages (Arabic) */
[dir="rtl"] .news-pill { padding: 6px 8px 6px 14px; }
[dir="rtl"] .news-pill-arrow { display: inline-block; transform: scaleX(-1); }
[dir="rtl"] .news-pill:hover .news-pill-arrow { transform: scaleX(-1) translateX(3px); }
[dir="rtl"] .news-how li { padding-left: 0; padding-right: 36px; }
[dir="rtl"] .news-how li::before { left: auto; right: 0; }
