/* ================================================================
   IQRAA — MOBILE STYLES
   Chargé sur tous les écrans, règles actives selon breakpoint.
   ================================================================ */

/* ── Éléments mobiles — cachés sur desktop ────────────────────── */
.mob-nav         { display: none; }
.hero__chips     { display: none; }
.mob-daily-sheet { display: none; }
.mob-lang-sheet  { display: none; }

/* ── Chips + daily sheets — hamburger mode (≤ 860px) ─────────── */
@media (max-width: 860px) {

/* Remplace le bloc hadith/verset desktop par les deux boutons */
.hero__daily  { display: none; }
.hero__chips  {
  display: flex;
  gap: .9rem;
  justify-content: center;
  padding: 0 1.25rem;
  margin-top: auto;
  margin-bottom: 3rem;
}

.hero__chip {
  display: flex;
  align-items: center;
  gap: .55rem;
  padding: .65rem 1.4rem;
  font-size: .85rem;
  background: rgba(12,14,19,.55);
  border: 1px solid rgba(200,168,75,.45);
  border-radius: 999px;
  color: #fff;
  font-size: .78rem;
  font-weight: 600;
  letter-spacing: .03em;
  cursor: pointer;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  -webkit-tap-highlight-color: transparent;
  transition: background .15s, border-color .15s;
}
.hero__chip i {
  color: var(--gold);
  font-size: .85rem;
  animation: chip-icon-bounce 4s ease-in-out infinite;
}
.hero__chip:nth-child(2) i { animation-delay: .6s; }
.hero__chip { animation: chip-glow-pulse 4s ease-in-out infinite; }
.hero__chip:nth-child(2) { animation-delay: .6s; }
.hero__chip:active { background: rgba(200,168,75,.2); border-color: var(--gold); animation: none; }

@keyframes chip-glow-pulse {
  0%, 60%, 100% { box-shadow: none; border-color: rgba(200,168,75,.45); }
  30%            { box-shadow: 0 0 12px rgba(200,168,75,.45); border-color: rgba(200,168,75,.9); }
}
@keyframes chip-icon-bounce {
  0%, 55%, 100% { transform: translateY(0); }
  30%           { transform: translateY(-3px); }
  40%           { transform: translateY(0); }
  47%           { transform: translateY(-2px); }
}

/* Daily bottom sheets — panel à ras du bas (pas de bottom nav à ce breakpoint) */
.mob-daily-sheet {
  position: fixed;
  inset: 0;
  z-index: 500;
}
.mob-daily-sheet.is-open { display: block; }

.mob-daily-sheet__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.55);
  backdrop-filter: blur(3px);
  animation: mob-fade-in .2s ease;
}

.mob-daily-sheet__panel {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  max-height: 72vh;
  background: var(--hero-bg);
  border-top: 2px solid var(--gold);
  border-radius: var(--r-sm) var(--r-sm) 0 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 -8px 40px rgba(0,0,0,.4);
  animation: mob-slide-up .25s ease;
}

.mob-daily-sheet__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .85rem 1.1rem;
  border-bottom: 1px solid rgba(255,255,255,.08);
  flex-shrink: 0;
}

.mob-daily-sheet__logo { height: 28px; }

.mob-daily-sheet__close {
  background: none;
  border: none;
  color: rgba(255,255,255,.55);
  font-size: 1.1rem;
  cursor: pointer;
  padding: .25rem .4rem;
  line-height: 1;
  -webkit-tap-highlight-color: transparent;
}
.mob-daily-sheet__close:active { color: #fff; }

.mob-daily-sheet__body {
  flex: 1;
  overflow-y: auto;
  padding: 1rem 1.25rem 1.5rem;
  color: var(--hero-soft);
  font-size: .88rem;
  line-height: 1.75;
  white-space: pre-line;
  -webkit-overflow-scrolling: touch;
}
.mob-daily-sheet__body::-webkit-scrollbar { display: none; }

/* Même formatage que .hero__daily-body ── */
.mob-daily-sheet__body .text-warning {
  color: var(--gold) !important;
  font-weight: 600;
  display: block;
  margin-top: .6rem;
  margin-bottom: 2em;
}
.mob-daily-sheet__body span.fw-bold {
  color: var(--gold);
  font-weight: 700;
  display: inline-block;
  margin-bottom: 2em;
}
.mob-daily-sheet__body span.fw-light {
  display: block;
  white-space: pre-line;
  margin-bottom: 2em;
  letter-spacing: .025em;
}
.mob-daily-sheet__body span.fw-light + span.fw-light { margin-top: 1.75rem; }
.mob-daily-sheet__body p { margin: 0; }
.mob-daily-sheet__body span { display: inline-block; margin-bottom: .55rem; letter-spacing: .025em; }

@keyframes mob-fade-in  { from { opacity: 0; } to { opacity: 1; } }
@keyframes mob-slide-up { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }

} /* end @media 860px */


/* ── Full mobile (≤ 768px) — top nav masquée, bottom nav présente ─────── */
@media (max-width: 768px) {

/* ── Top navbar masquée ──────────────────────────────────────── */
.hn { display: none !important; }

/* Espace réservé en bas pour ne pas cacher le contenu ─────────── */
body {
  padding-bottom: calc(62px + env(safe-area-inset-bottom, 0px));
}

/* ── Bottom nav bar ─────────────────────────────────────────── */
.mob-nav {
  display: flex;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 400;
  height: calc(62px + env(safe-area-inset-bottom, 0px));
  padding-bottom: env(safe-area-inset-bottom, 0px);
  background: var(--surface);
  border-top: 1px solid var(--border);
  box-shadow: 0 -6px 24px rgba(0,0,0,.14);
}

.mob-nav__item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  text-decoration: none;
  color: var(--muted);
  font-size: .52rem;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
  padding: 8px 2px 6px;
  position: relative;
  -webkit-tap-highlight-color: transparent;
  transition: color .15s;
}

.mob-nav__item i {
  font-size: 1.2rem;
  transition: transform .15s, color .15s;
}

/* Indicateur actif — barre dorée en haut de l'item */
.mob-nav__item.is-active::before {
  content: '';
  position: absolute;
  top: 0;
  left: 20%;
  right: 20%;
  height: 2px;
  border-radius: 0 0 2px 2px;
  background: var(--gold);
}

.mob-nav__item.is-active {
  color: var(--gold);
}

.mob-nav__item:active i {
  transform: scale(.85);
}

/* ── Hero : hauteur réduite pour laisser place à la bottom nav ── */
.hero          { height: calc(100dvh - 62px - env(safe-area-inset-bottom, 0px)); min-height: 320px; }
.hero__content { padding-top: 2rem; padding-bottom: 1rem; }

/* Chips : taille réduite sur mobile (plus petits qu'en mode tablette) */
.hero__chips  { gap: .75rem; }
.hero__chip   { padding: .55rem 1.1rem; font-size: .78rem; gap: .5rem; }

/* Override : panel décalé au-dessus de la bottom nav ─────────── */
.mob-daily-sheet__panel {
  bottom: calc(62px + env(safe-area-inset-bottom, 0px));
}

/* ── Language button dans la barre ──────────────────────────── */
.mob-nav__lang {
  background: none;
  border: none;
  cursor: pointer;
  font-family: var(--font);
}

/* ── Language sheet (slide-up) ───────────────────────────────── */
.mob-lang-sheet {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 500;
}
.mob-lang-sheet.is-open { display: block; }

.mob-lang-sheet__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.45);
  backdrop-filter: blur(2px);
  animation: mob-fade-in .2s ease;
}

.mob-lang-sheet__panel {
  position: absolute;
  bottom: calc(62px + env(safe-area-inset-bottom, 0px));
  left: 1rem;
  right: 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  overflow: hidden;
  box-shadow: 0 -8px 32px rgba(0,0,0,.18);
  animation: mob-slide-up .22s ease;
}

.mob-lang-sheet__title {
  margin: 0;
  padding: .75rem 1.1rem;
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted);
  border-bottom: 1px solid var(--border);
}

.mob-lang-sheet__opt {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .9rem 1.1rem;
  font-size: .95rem;
  color: var(--text);
  text-decoration: none;
  border-bottom: 1px solid var(--card-h);
  transition: background .12s;
}
.mob-lang-sheet__opt:last-child { border-bottom: none; }
.mob-lang-sheet__opt:active { background: var(--card-h); }
.mob-lang-sheet__opt.is-active { color: var(--gold); font-weight: 600; }
.mob-lang-sheet__opt i { color: var(--gold); font-size: .85rem; }

/* ── Contenu : empêche tout débordement horizontal ───────────── */
#content { overflow-x: hidden; }

/* ── News : date en timestamp bas-droite ─────────────────────── */
.hn-article { display: flex; flex-direction: column; }
.hn-article__time {
  order: 10;
  margin-bottom: 0;
  margin-top: .6rem;
  text-align: right;
  font-size: .65rem;
  opacity: .6;
}

/* ── Calendrier des prières — app style ──────────────────────── */

.cal-print-btn { display: none; }

/* Reset complet : plus de grille, que des séparateurs horizontaux */
.cal-table { border-collapse: collapse; margin: 0 !important; width: 100%; }
.cal-table * { border: none !important; box-shadow: none !important; }
.cal-table.table-hover > tbody > tr:hover > * { background: none; }

/* Header */
.cal-table thead th {
  background: var(--card);
  font-size: .56rem;
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--muted);
  text-align: center;
  padding: .5rem .2rem;
  border-bottom: 2px solid var(--gold) !important;
}
.cal-table thead th:first-child { text-align: left; padding-left: .75rem; }

/* Séparateur uniquement entre les lignes */
.cal-table tbody tr { border-bottom: 1px solid var(--card-h) !important; }
.cal-table tbody tr:last-child { border-bottom: none !important; }

/* Colonne date */
.cal-table tbody th[scope="row"] {
  font-size: .78rem;
  font-weight: 700;
  color: var(--text);
  padding: .6rem .4rem .6rem .75rem;
  white-space: nowrap;
  text-align: left;
}

/* Cellules heures */
.cal-table tbody td {
  font-size: .7rem;
  font-weight: 500;
  padding: .6rem .15rem;
  text-align: center;
  white-space: nowrap;
  color: var(--soft);
}

/* Vendredi */
.cal-table tr.is-friday th[scope="row"] { color: var(--cal-friday); }

/* Aujourd'hui */
.cal-table tr.is-today th[scope="row"],
.cal-table tr.is-today td { background: rgba(200,168,75,.08) !important; }
.cal-table tr.is-today th[scope="row"] {
  color: var(--gold) !important;
  font-weight: 800;
  border-left: 3px solid var(--gold) !important;
  padding-left: calc(.75rem - 3px);
}
.cal-table tr.is-today td { color: var(--text); font-weight: 600; }

/* ── Quran reader ────────────────────────────────────────────── */
.quran-reader {
  flex-direction: column;
  height: auto;
  max-height: none;
  overflow: visible;
}
.quran-sidebar {
  width: 100% !important;
  max-height: 200px;
}
.quran-panel {
  min-height: 420px;
  max-height: 55vh;
  overflow-y: auto;
}

/* Fullscreen : colonne pleine largeur, panel jusqu'en bas ────── */
.quran-reader--fullscreen {
  flex-direction: column;
  inset: 0 !important;
  height: 100dvh !important;
  padding: .5rem !important;
  display: flex;
}
.quran-reader--fullscreen .quran-sidebar {
  width: 100% !important;
  max-height: 200px;
  flex-shrink: 0;
}
.quran-reader--fullscreen .quran-panel-wrapper {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.quran-reader--fullscreen .quran-panel {
  flex: 1;
  min-height: 0;
  max-height: none;
}

/* ── Boutons flottants au-dessus de la bottom nav ────────────── */
.fb-float {
  bottom: calc(62px + env(safe-area-inset-bottom, 0px) + .75rem);
  z-index: 401;
}
.scroll-top-btn {
  bottom: calc(62px + env(safe-area-inset-bottom, 0px) + .75rem + 44px + .5rem);
  z-index: 401;
}

} /* end @media 768px */

@media (prefers-color-scheme: dark) {
  .cal-table {
    --bs-table-bg:           transparent;
    --bs-table-hover-bg:     rgba(255,255,255,.04);
    --bs-table-border-color: var(--border);
    color: var(--text);
  }
  .cal-table > :not(caption) > * > * {
    background-color: var(--surface) !important;
    color: var(--text) !important;
    border-bottom-color: var(--border) !important;
  }
  .cal-table thead > tr > * {
    background-color: var(--card-h) !important;
    color: var(--muted) !important;
  }
  .cal-table tr.is-friday > *       { background-color: rgba(74,222,128,.06) !important; }
  .cal-table tr.is-friday th[scope="row"] { color: var(--cal-friday) !important; }
  .cal-table tr.is-today > *        { background-color: rgba(200,168,75,.12) !important; }
  .cal-table tr.is-today th[scope="row"] { color: var(--gold) !important; }
}
