/*
  The pop-up of an announcement (see assets/announcements.js), and the colours of the kinds of announcement.
  Shared by the Fasting Prayer website (inside its service modal) and the admin (its preview and its kind picker).

  A kind's colour family is a .tone-* class that sets --tone (the icon and accents), --tone-soft (a light background)
  and --tone-light (the end of the top bar). They follow the page's theme: the manual one (a data-theme attribute on
  <html>, which the Fasting Prayer website sets) or, when the page sets none (the admin), the system's.
*/

.tone-green { --tone: #15803d; --tone-soft: #dcfce7; --tone-light: #86efac; }
.tone-blue { --tone: #1d4ed8; --tone-soft: #dbeafe; --tone-light: #93c5fd; }
.tone-sky { --tone: #0369a1; --tone-soft: #e0f2fe; --tone-light: #7dd3fc; }
.tone-indigo { --tone: #4338ca; --tone-soft: #e0e7ff; --tone-light: #a5b4fc; }
.tone-purple { --tone: #7e22ce; --tone-soft: #f3e8ff; --tone-light: #d8b4fe; }
.tone-pink { --tone: #be185d; --tone-soft: #fce7f3; --tone-light: #f9a8d4; }
.tone-rose { --tone: #be123c; --tone-soft: #ffe4e6; --tone-light: #fda4af; }
.tone-red { --tone: #b91c1c; --tone-soft: #fee2e2; --tone-light: #fca5a5; }
.tone-orange { --tone: #c2410c; --tone-soft: #ffedd5; --tone-light: #fdba74; }
.tone-amber { --tone: #a16207; --tone-soft: #fef3c7; --tone-light: #fcd34d; }
.tone-teal { --tone: #0f766e; --tone-soft: #ccfbf1; --tone-light: #5eead4; }
.tone-slate { --tone: #475569; --tone-soft: #e2e8f0; --tone-light: #cbd5e1; }

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .tone-green { --tone: rgb(74,222,128); --tone-soft: rgba(74,222,128, .16); --tone-light: rgba(74,222,128, .35); }
  :root:not([data-theme="light"]) .tone-blue { --tone: rgb(96,165,250); --tone-soft: rgba(96,165,250, .16); --tone-light: rgba(96,165,250, .35); }
  :root:not([data-theme="light"]) .tone-sky { --tone: rgb(56,189,248); --tone-soft: rgba(56,189,248, .16); --tone-light: rgba(56,189,248, .35); }
  :root:not([data-theme="light"]) .tone-indigo { --tone: rgb(129,140,248); --tone-soft: rgba(129,140,248, .16); --tone-light: rgba(129,140,248, .35); }
  :root:not([data-theme="light"]) .tone-purple { --tone: rgb(192,132,252); --tone-soft: rgba(192,132,252, .16); --tone-light: rgba(192,132,252, .35); }
  :root:not([data-theme="light"]) .tone-pink { --tone: rgb(244,114,182); --tone-soft: rgba(244,114,182, .16); --tone-light: rgba(244,114,182, .35); }
  :root:not([data-theme="light"]) .tone-rose { --tone: rgb(251,113,133); --tone-soft: rgba(251,113,133, .16); --tone-light: rgba(251,113,133, .35); }
  :root:not([data-theme="light"]) .tone-red { --tone: rgb(248,113,113); --tone-soft: rgba(248,113,113, .16); --tone-light: rgba(248,113,113, .35); }
  :root:not([data-theme="light"]) .tone-orange { --tone: rgb(251,146,60); --tone-soft: rgba(251,146,60, .16); --tone-light: rgba(251,146,60, .35); }
  :root:not([data-theme="light"]) .tone-amber { --tone: rgb(251,191,36); --tone-soft: rgba(251,191,36, .16); --tone-light: rgba(251,191,36, .35); }
  :root:not([data-theme="light"]) .tone-teal { --tone: rgb(45,212,191); --tone-soft: rgba(45,212,191, .16); --tone-light: rgba(45,212,191, .35); }
  :root:not([data-theme="light"]) .tone-slate { --tone: rgb(148,163,184); --tone-soft: rgba(148,163,184, .16); --tone-light: rgba(148,163,184, .35); }
}
[data-theme="dark"] .tone-green { --tone: rgb(74,222,128); --tone-soft: rgba(74,222,128, .16); --tone-light: rgba(74,222,128, .35); }
[data-theme="dark"] .tone-blue { --tone: rgb(96,165,250); --tone-soft: rgba(96,165,250, .16); --tone-light: rgba(96,165,250, .35); }
[data-theme="dark"] .tone-sky { --tone: rgb(56,189,248); --tone-soft: rgba(56,189,248, .16); --tone-light: rgba(56,189,248, .35); }
[data-theme="dark"] .tone-indigo { --tone: rgb(129,140,248); --tone-soft: rgba(129,140,248, .16); --tone-light: rgba(129,140,248, .35); }
[data-theme="dark"] .tone-purple { --tone: rgb(192,132,252); --tone-soft: rgba(192,132,252, .16); --tone-light: rgba(192,132,252, .35); }
[data-theme="dark"] .tone-pink { --tone: rgb(244,114,182); --tone-soft: rgba(244,114,182, .16); --tone-light: rgba(244,114,182, .35); }
[data-theme="dark"] .tone-rose { --tone: rgb(251,113,133); --tone-soft: rgba(251,113,133, .16); --tone-light: rgba(251,113,133, .35); }
[data-theme="dark"] .tone-red { --tone: rgb(248,113,113); --tone-soft: rgba(248,113,113, .16); --tone-light: rgba(248,113,113, .35); }
[data-theme="dark"] .tone-orange { --tone: rgb(251,146,60); --tone-soft: rgba(251,146,60, .16); --tone-light: rgba(251,146,60, .35); }
[data-theme="dark"] .tone-amber { --tone: rgb(251,191,36); --tone-soft: rgba(251,191,36, .16); --tone-light: rgba(251,191,36, .35); }
[data-theme="dark"] .tone-teal { --tone: rgb(45,212,191); --tone-soft: rgba(45,212,191, .16); --tone-light: rgba(45,212,191, .35); }
[data-theme="dark"] .tone-slate { --tone: rgb(148,163,184); --tone-soft: rgba(148,163,184, .16); --tone-light: rgba(148,163,184, .35); }

.ann-pop {
  --ann-surface: #ffffff;
  --ann-text: #111827;
  --ann-muted: #4b5563;
  --ann-on-tone: #ffffff;
  position: relative;
  padding: 2.25rem 1.5rem 1.5rem;
  text-align: center;
  background: var(--ann-surface);
  color: var(--ann-text);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .ann-pop { --ann-surface: #111827; --ann-text: #ffffff; --ann-muted: #d1d5db; --ann-on-tone: #0b1120; }
}
[data-theme="dark"] .ann-pop { --ann-surface: #111827; --ann-text: #ffffff; --ann-muted: #d1d5db; --ann-on-tone: #0b1120; }
.ann-pop::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 6px;
  background: linear-gradient(90deg, var(--tone), var(--tone-light));
}
.ann-pop-icon {
  display: grid;
  place-items: center;
  width: 3.5rem;
  height: 3.5rem;
  margin: 0 auto 1.25rem;
  border-radius: 50%;
  background: var(--tone-soft);
  color: var(--tone);
  box-shadow: 0 0 0 8px color-mix(in srgb, var(--tone-soft) 60%, transparent);
}
.ann-pop-eyebrow {
  margin: 0 0 .5rem;
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--tone);
}
.ann-pop-eyebrow:empty { display: none; }
.ann-pop-title {
  margin: 0;
  padding: 0;
  font-family: Merriweather, Georgia, serif;
  font-size: 1.35rem;
  font-weight: 700;
  line-height: 1.35;
  color: var(--ann-text);
  overflow-wrap: anywhere;
}
.ann-pop-message {
  margin: 1rem 0 0;
  font-size: .95rem;
  line-height: 1.6;
  color: var(--ann-muted);
  white-space: pre-line;
  overflow-wrap: anywhere;
}
.ann-pop-actions {
  display: grid;
  gap: .6rem;
  margin-top: 1.75rem;
}
.ann-pop-link,
.ann-pop-ok {
  display: block;
  padding: .75rem 1.25rem;
  border: 1px solid var(--tone);
  border-radius: .75rem;
  font: inherit;
  font-size: .9rem;
  font-weight: 600;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
}
.ann-pop-link { background: transparent; color: var(--tone); }
.ann-pop-link:hover { background: var(--tone-soft); }
.ann-pop-ok { background: var(--tone); color: var(--ann-on-tone); }
.ann-pop-ok:hover { filter: brightness(.93); }
.ann-pop a:focus-visible,
.ann-pop button:focus-visible { outline: 3px solid var(--tone); outline-offset: 2px; }
