/* ══════════════════════════════════════════════════════════════
   National memory — "On this day" (home block, timeline, details)
   Uses the theme tokens from style-fidaa.css; logical properties
   (inline-start/end) so the layout mirrors itself in RTL and LTR.
   ══════════════════════════════════════════════════════════════ */

/* ── Calendar tile (shared) ── */
.otd-calendar {
  width: 100%;
  max-width: 260px;
  margin-inline: auto;
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  text-align: center;
  position: relative;
}
.otd-calendar::before,
.otd-calendar::after {
  /* binder rings */
  content: '';
  position: absolute;
  top: 10px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--blue-dark);
  box-shadow: inset 0 2px 3px rgba(0,0,0,.35);
}
.otd-calendar::before { inset-inline-start: 28%; }
.otd-calendar::after { inset-inline-end: 28%; }
.otd-calendar .cal-month {
  background: var(--yellow);
  color: var(--blue-dark);
  font-weight: 800;
  font-size: 18px;
  padding: 30px 12px 12px;
}
.otd-calendar .cal-day {
  font-size: 96px;
  font-weight: 800;
  line-height: 1;
  color: var(--blue);
  padding: 18px 0 6px;
}
[data-theme="dark"] .otd-calendar .cal-day { color: var(--yellow); }
.otd-calendar .cal-weekday { color: var(--text-muted); font-size: 15px; padding-bottom: 8px; }
.otd-calendar .cal-caption {
  border-top: 1px dashed var(--card-border);
  padding: 12px;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-color);
}

/* ── Home block ── */
.otd-section {
  background: linear-gradient(135deg, var(--blue-dark), var(--blue));
  color: var(--white);
  position: relative;
  overflow: hidden;
}
.otd-section::after {
  /* faint oversized year watermark */
  content: attr(data-watermark);
  position: absolute;
  inset-inline-end: -20px;
  bottom: -60px;
  font-size: 220px;
  font-weight: 800;
  line-height: 1;
  color: rgba(255,255,255,.05);
  pointer-events: none;
}
.otd-section .section-title span { background: rgba(255,255,255,.12); color: var(--yellow); }
.otd-section .section-title h2 { color: var(--white); }
.otd-section .section-title p { color: rgba(255,255,255,.75); }
.otd-card {
  display: flex;
  gap: 18px;
  align-items: stretch;
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.15);
  border-radius: var(--radius);
  padding: 16px;
  color: var(--white);
  text-decoration: none;
  transition: var(--transition);
  height: 100%;
}
.otd-card:hover { background: rgba(255,255,255,.14); color: var(--white); transform: translateY(-4px); }
.otd-card .otd-thumb {
  flex: 0 0 110px;
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.otd-card .otd-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.otd-thumb-date {
  /* shown when the event has no image */
  height: 100%;
  min-height: 110px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,.1);
  border: 1px dashed rgba(255,255,255,.3);
  border-radius: var(--radius-sm);
}
.otd-thumb-date strong { font-size: 40px; font-weight: 800; line-height: 1; color: var(--yellow); }
.otd-thumb-date span { font-size: 14px; margin-top: 6px; color: rgba(255,255,255,.85); }

/* ── Martyr placeholder (no avatar) ── */
.martyr-placeholder {
  width: 100%;
  height: 100%;
  min-height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(160deg, var(--blue-light), var(--card-bg));
  color: var(--blue);
  font-size: 72px;
}
[data-theme="dark"] .martyr-placeholder { color: var(--yellow); }
.otd-card .otd-year {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 700;
  color: var(--blue-dark);
  background: var(--yellow);
  border-radius: 50px;
  padding: 3px 14px;
  margin-bottom: 8px;
}
.otd-card h4 { font-size: 16px; font-weight: 700; margin-bottom: 6px; color: var(--white); }
.otd-card p { font-size: 13px; line-height: 1.7; margin: 0; color: rgba(255,255,255,.75); }
.otd-ago { font-size: 12px; color: rgba(255,255,255,.7); margin-bottom: 6px; display: block; }

/* ── Timeline page: filter bar ── */
.mt-filters {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px;
  margin-bottom: 26px;
}
.mt-filters .form-control,
.mt-filters .form-select {
  background-color: var(--input-bg);
  border-color: var(--input-border);
  color: var(--text-color);
  border-radius: 50px;
  height: 46px;
}
.mt-filters .btn-fidaa { height: 46px; padding: 0 22px; }
.mt-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  padding: 7px 16px;
  border-radius: 50px;
  border: 1px solid var(--card-border);
  background: var(--card-bg);
  color: var(--text-color);
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
}
.mt-chip:hover { border-color: var(--blue); color: var(--blue); }
.mt-chip.active { background: var(--blue); border-color: var(--blue); color: var(--white); }
.mt-chip.today { background: var(--yellow-light); border-color: var(--yellow); color: var(--blue-dark); }
[data-theme="dark"] .mt-chip.today { color: var(--yellow); }
.mt-chip.today.active { background: var(--yellow); color: var(--blue-dark); }
.mt-years {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 6px;
  margin-bottom: 40px;
  scrollbar-width: thin;
}
.mt-summary { color: var(--text-muted); font-size: 14px; margin-bottom: 30px; text-align: center; }

/* ── Timeline page: the timeline ── */
.mt-timeline { position: relative; padding: 10px 0; }
.mt-timeline::before {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  inset-inline-start: 50%;
  width: 3px;
  margin-inline-start: -1.5px;
  background: linear-gradient(var(--yellow), var(--blue) 15%, var(--blue) 85%, var(--yellow));
  border-radius: 3px;
}
.mt-year {
  position: relative;
  z-index: 2;
  text-align: center;
  margin: 10px 0 34px;
}
.mt-year span {
  display: inline-block;
  min-width: 110px;
  padding: 10px 24px;
  border-radius: 50px;
  background: var(--blue-dark);
  color: var(--yellow);
  font-size: 22px;
  font-weight: 800;
  box-shadow: 0 0 0 6px var(--bg-body), var(--shadow);
}
.mt-item {
  position: relative;
  width: 50%;
  padding-inline-end: 44px;
  margin-bottom: 34px;
}
.mt-item.mt-end {
  margin-inline-start: 50%;
  padding-inline-end: 0;
  padding-inline-start: 44px;
}
.mt-item .mt-dot {
  position: absolute;
  top: 26px;
  inset-inline-end: -11px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--yellow);
  border: 4px solid var(--blue);
  z-index: 2;
}
.mt-item.mt-end .mt-dot { inset-inline-end: auto; inset-inline-start: -11px; }
.mt-card {
  position: relative;
  display: block;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  color: var(--text-color);
  text-decoration: none;
  transition: var(--transition);
}
.mt-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); color: var(--text-color); }
.mt-card::before {
  /* little arrow pointing to the line */
  content: '';
  position: absolute;
  top: 28px;
  inset-inline-end: -8px;
  width: 16px;
  height: 16px;
  background: var(--card-bg);
  border-top: 1px solid var(--card-border);
  border-inline-end: 1px solid var(--card-border);
  transform: rotate(45deg);
}
[dir="rtl"] .mt-card::before { transform: rotate(-45deg); }
.mt-end .mt-card::before {
  inset-inline-end: auto;
  inset-inline-start: -8px;
  border-inline-end: 0;
  border-inline-start: 1px solid var(--card-border);
}
.mt-card-img { height: 170px; overflow: hidden; }
.mt-card-img img { width: 100%; height: 100%; object-fit: cover; transition: var(--transition); }
.mt-card:hover .mt-card-img img { transform: scale(1.06); }
.mt-card-body { padding: 18px 20px 20px; }
.mt-date {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 700;
  color: var(--blue);
  background: var(--blue-light);
  padding: 4px 14px;
  border-radius: 50px;
  margin-bottom: 10px;
}
[data-theme="dark"] .mt-date { color: var(--yellow); }
.mt-card h4 { font-size: 17px; font-weight: 700; margin-bottom: 8px; }
.mt-card p { color: var(--text-muted); font-size: 14px; line-height: 1.7; margin: 0; }
.mt-meta { display: flex; justify-content: space-between; gap: 10px; margin-top: 12px; font-size: 12px; color: var(--text-muted); }
.mt-meta .mt-more { color: var(--blue); font-weight: 700; }
[data-theme="dark"] .mt-meta .mt-more { color: var(--yellow); }
.mt-item.is-today .mt-card { border-color: var(--yellow); box-shadow: 0 0 0 3px var(--yellow-light), var(--shadow-lg); }
.mt-item.is-today .mt-dot { animation: mt-pulse 1.8s infinite; }
.mt-today-badge {
  position: absolute;
  top: 12px;
  inset-inline-start: 12px;
  z-index: 2;
  background: var(--yellow);
  color: var(--blue-dark);
  font-size: 12px;
  font-weight: 800;
  padding: 3px 12px;
  border-radius: 50px;
}
@keyframes mt-pulse {
  0% { box-shadow: 0 0 0 0 rgba(245,166,35,.6); }
  70% { box-shadow: 0 0 0 14px rgba(245,166,35,0); }
  100% { box-shadow: 0 0 0 0 rgba(245,166,35,0); }
}

/* Reveal on scroll — only when JS is running, so content never stays hidden. */
.mt-js .mt-item { opacity: 0; transform: translateY(24px); transition: opacity .6s ease, transform .6s ease; }
.mt-js .mt-item.in-view { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .mt-js .mt-item { opacity: 1; transform: none; transition: none; }
  .mt-item.is-today .mt-dot { animation: none; }
}

/* ── Details page ── */
.mt-detail-side { position: sticky; top: 110px; }
.mt-detail-side .otd-calendar { margin-bottom: 18px; }
.mt-facts {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 16px 18px;
  font-size: 14px;
}
.mt-facts div { display: flex; justify-content: space-between; gap: 10px; padding: 8px 0; }
.mt-facts div + div { border-top: 1px dashed var(--card-border); }
.mt-facts span { color: var(--text-muted); }
.mt-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 40px; }
.mt-nav a {
  display: block;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 16px 18px;
  text-decoration: none;
  color: var(--text-color);
  transition: var(--transition);
}
.mt-nav a:hover { border-color: var(--blue); transform: translateY(-3px); }
.mt-nav small { display: block; color: var(--text-muted); margin-bottom: 4px; }
.mt-nav strong { font-size: 15px; }
.mt-nav .mt-nav-next { text-align: end; grid-column: 2; }

/* ── Responsive ── */
@media (max-width: 991px) {
  .mt-timeline::before { inset-inline-start: 20px; }
  .mt-year { text-align: start; }
  .mt-item,
  .mt-item.mt-end { width: auto; margin-inline-start: 0; padding-inline-end: 0; padding-inline-start: 52px; }
  .mt-item .mt-dot,
  .mt-item.mt-end .mt-dot { inset-inline-end: auto; inset-inline-start: 9px; }
  .mt-card::before,
  .mt-end .mt-card::before { display: none; }
  .mt-detail-side { position: static; }
}
@media (max-width: 575px) {
  .otd-card { flex-direction: column; }
  .otd-card .otd-thumb { flex-basis: auto; height: 150px; }
  .otd-section::after { font-size: 140px; }
  .mt-nav { grid-template-columns: 1fr; }
  .mt-nav .mt-nav-next { grid-column: auto; }
}
