/**
 * مكتبة ليبيا الطيبة — Prayer header widget
 *
 * Self-contained styling for the small floating pill that other pages
 * include via js/prayer-widget.js. All selectors are namespaced under
 * `.pw-` to avoid collisions with page styles.
 */

.pw-root {
  position: fixed;
  top: 88px;
  inset-inline-start: 16px;
  z-index: 60;
  font-family: 'Aref Ruqaa', 'Amiri', serif;
  pointer-events: none;
  opacity: 0;
  transform: translateY(-8px);
  transition: opacity 320ms cubic-bezier(.25,.8,.25,1), transform 320ms cubic-bezier(.25,.8,.25,1);
}

.pw-root.is-mounted-inline {
  position: static;
  display: inline-flex;
}

.pw-root.is-visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.pw-pill {
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  padding: .5rem .95rem;
  background: linear-gradient(180deg, #FFFEFA 0%, #FAF6EE 100%);
  border: 1px solid #B89968;
  border-radius: 999px;
  box-shadow: 0 4px 14px rgba(15, 27, 45, .10), 0 0 0 1px rgba(184, 153, 104, .12);
  color: #2C2418;
  text-decoration: none;
  font-size: .92rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 240ms cubic-bezier(.25,.8,.25,1), box-shadow 240ms cubic-bezier(.25,.8,.25,1), border-color 240ms cubic-bezier(.25,.8,.25,1);
  font-family: inherit;
  direction: rtl;
  white-space: nowrap;
  max-width: 92vw;
}

.pw-pill:hover {
  transform: translateY(-1px);
  border-color: #9D7B4E;
  box-shadow: 0 8px 22px rgba(15, 27, 45, .14), 0 0 0 1px rgba(184, 153, 104, .25);
}

.pw-pill:active {
  transform: translateY(0);
}

.pw-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #B89968;
  color: #fff;
  font-size: .82rem;
  line-height: 1;
}

.pw-name {
  font-family: 'Aref Ruqaa', 'Amiri', serif;
  color: #2C2418;
}

.pw-time {
  font-family: 'Amiri', serif;
  font-style: italic;
  color: #6B5635;
  font-weight: 400;
  font-size: .88rem;
}

.pw-time::before {
  content: "·";
  margin: 0 .35rem;
  color: #B89968;
  opacity: .55;
}

.pw-pill.is-imminent {
  background: linear-gradient(180deg, #FFF8E8 0%, #F5E8C7 100%);
  border-color: #9D7B4E;
  animation: pw-pulse 2.2s ease-in-out infinite;
}

@keyframes pw-pulse {
  0%, 100% { box-shadow: 0 4px 14px rgba(15, 27, 45, .10), 0 0 0 0 rgba(184, 153, 104, .35); }
  50%      { box-shadow: 0 4px 14px rgba(15, 27, 45, .10), 0 0 0 6px rgba(184, 153, 104, 0); }
}

.pw-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  margin-inline-start: .25rem;
  border-radius: 50%;
  border: 0;
  background: transparent;
  color: #8B7349;
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
  padding: 0;
  opacity: .65;
  transition: opacity 200ms ease, color 200ms ease;
}

.pw-close:hover {
  opacity: 1;
  color: #B1373F;
}

/* Dark mode */
[data-theme="dark"] .pw-pill {
  background: linear-gradient(180deg, #2A2418 0%, #1F1A12 100%);
  color: #FAF6EE;
  border-color: #B89968;
}

[data-theme="dark"] .pw-name { color: #FAF6EE; }
[data-theme="dark"] .pw-time { color: #D4B888; }
[data-theme="dark"] .pw-close { color: #D4B888; }

/* Responsive: hide on tiny screens */
@media (max-width: 380px) {
  .pw-root { display: none !important; }
}

@media (max-width: 640px) {
  .pw-root {
    top: 76px;
    inset-inline-start: 8px;
  }
  .pw-pill { font-size: .85rem; padding: .45rem .8rem; }
  .pw-time { font-size: .82rem; }
}

@media (prefers-reduced-motion: reduce) {
  .pw-root, .pw-pill { transition: none; }
  .pw-pill.is-imminent { animation: none; }
}
