/**
 * إعلان full-page – عدد منتدى العمرة والزيارة
 * عداد 4 ثوانٍ ثم ظهور زر الإغلاق
 */

.thahlan-announcement-overlay {
  position: fixed;
  inset: 0;
  z-index: 2147483647;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  transition: opacity 0.35s ease, visibility 0.35s ease;
}

.thahlan-announcement-overlay.is-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  z-index: -1;
}

.thahlan-announcement-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(13, 10, 8, 0.88);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}

.thahlan-announcement-box {
  position: relative;
  width: 100%;
  max-width: 560px;
  max-height: calc(100vh - 32px);
  margin: 16px;
  background: linear-gradient(165deg, #2D2419 0%, #362A20 45%, #2a2219 100%);
  border: 1px solid rgba(201, 162, 39, 0.25);
  border-radius: 16px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.04) inset;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.thahlan-announcement-close {
  position: absolute;
  top: 12px;
  inset-inline-start: 12px;
  z-index: 2;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  color: #f5f0e8;
  font-size: 1.75rem;
  line-height: 1;
  cursor: pointer;
  transition: visibility 0.2s ease, opacity 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.thahlan-announcement-close:hover,
.thahlan-announcement-close:focus {
  background: rgba(201, 162, 39, 0.35);
  color: #fff;
  outline: none;
}

.thahlan-announcement-close.is-visible {
  visibility: visible !important;
  opacity: 1 !important;
}

.thahlan-announcement-countdown {
  position: absolute;
  top: 16px;
  inset-inline-end: 16px;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  background: rgba(201, 162, 39, 0.2);
  border: 2px solid rgba(201, 162, 39, 0.5);
  border-radius: 50%;
  color: #f5d758;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.thahlan-announcement-countdown.is-done {
  opacity: 0;
  pointer-events: none;
  transform: scale(0.8);
}

.thahlan-announcement-countdown-num {
  display: block;
  font-family: var(--font-heading, 'Tajawal', sans-serif);
  font-size: 1.5rem;
  font-weight: 800;
  line-height: 1.1;
}

.thahlan-announcement-countdown-label {
  font-size: 0.65rem;
  opacity: 0.9;
  margin-top: 2px;
}

.thahlan-announcement-body {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 24px 20px 28px;
  padding-top: 52px;
}

.thahlan-announcement-title {
  font-family: var(--font-heading, 'Tajawal', sans-serif);
  font-size: 1.35rem;
  font-weight: 800;
  color: #f5f0e8;
  margin: 0 0 1rem;
  line-height: 1.35;
}

.thahlan-announcement-content {
  font-family: var(--font, 'Tajawal', sans-serif);
  font-size: 0.95rem;
  line-height: 1.7;
  color: rgba(245, 240, 232, 0.92);
}

.thahlan-announcement-content p {
  margin: 0 0 0.75rem;
}

.thahlan-announcement-content p:last-of-type {
  margin-bottom: 0;
}

.thahlan-announcement-content h2 {
  font-size: 1.05rem;
  font-weight: 700;
  color: #c9a227;
  margin: 1.25rem 0 0.5rem;
}

.thahlan-announcement-content ul,
.thahlan-announcement-content ol {
  margin: 0.5rem 0 0.75rem 1.25rem;
  padding: 0;
}

.thahlan-announcement-content li {
  margin-bottom: 0.35rem;
}

.thahlan-announcement-content a {
  color: #c9a227;
  text-decoration: underline;
}

.thahlan-announcement-content a:hover {
  color: #f5d758;
}

.thahlan-announcement-signature {
  margin-top: 1.25rem !important;
  font-weight: 700;
  color: #f5f0e8;
}

@media (max-width: 640px) {
  .thahlan-announcement-box {
    max-height: calc(100vh - 20px);
    margin: 10px;
  }
  .thahlan-announcement-body {
    padding: 20px 16px 24px;
    padding-top: 48px;
  }
  .thahlan-announcement-title {
    font-size: 1.2rem;
  }
  .thahlan-announcement-content {
    font-size: 0.9rem;
  }
  .thahlan-announcement-close {
    top: 10px;
    inset-inline-start: 10px;
    width: 36px;
    height: 36px;
    font-size: 1.5rem;
  }
  .thahlan-announcement-countdown {
    top: 12px;
    inset-inline-end: 12px;
    width: 48px;
    height: 48px;
  }
  .thahlan-announcement-countdown-num {
    font-size: 1.25rem;
  }
}
