/* BaraaKids — Alif Madd lesson. All selectors are namespaced to this lesson. */
.nz-unit-lesson {
  display: inline-flex; align-items: center; margin-inline-start: .35rem; padding: .12rem .7rem;
  border-radius: 999px; background: #fff2c7; border: 1.5px solid #edc65a; color: #5b3a12;
  text-decoration: none; font-size: .94rem; font-weight: 800; line-height: 1.6;
}
.nz-unit-lesson:hover { background: #ffe7a0; }

.nz-ma-root { direction: rtl; }
.nz-ma-head { position: relative; flex-direction: column; gap: .3rem; padding: .7rem 1rem 1rem; margin-bottom: .5rem; }
.nz-ma-head h1 { display: flex; flex-direction: column; align-items: center; gap: .15rem; line-height: 1.35; }
.nz-ma-main-title { color: #d3202f; font-family: var(--font-head); font-size: clamp(2.25rem, 6vw, 3.15rem); }
.nz-ma-title-play {
  display: inline-flex; align-items: center; justify-content: center; gap: .35rem; min-height: 2.45rem; padding: .3rem .85rem;
  border: 2px solid #79c99d; border-radius: 999px; background: linear-gradient(#f1fff6, #dcf8e8); color: #11663d;
  font: inherit; font-size: .98rem; font-weight: 800; cursor: pointer; box-shadow: 0 3px 0 rgba(17, 102, 61, .12);
}
.nz-ma-title-play:hover { transform: translateY(-1px); }
.nz-ma-title-play:active { transform: translateY(2px); box-shadow: none; }
.nz-ma-title-play:focus-visible { outline: 3px solid var(--sun, #ffc83d); outline-offset: 3px; }
.nz-ma-title-play span { font-size: .91rem; }

.nz-ma-tabs {
  position: sticky; top: 76px; z-index: 38; display: flex; gap: .45rem; overflow-x: auto; padding: .5rem .25rem;
  margin: .25rem 0 .55rem; border-radius: 17px; background: rgba(255, 253, 240, .95); backdrop-filter: blur(6px);
  scrollbar-width: none;
}
.nz-ma-tabs::-webkit-scrollbar { display: none; }
.nz-ma-tabs button {
  flex: 1 0 auto; min-width: max-content; padding: .42rem .9rem; border: 2px solid #d8d1f4; border-radius: 999px;
  background: #fff; color: #51448e; font: inherit; font-weight: 800; text-align: center; cursor: pointer;
}
.nz-ma-tabs button:hover { background: #fff3ce; border-color: #f0c34a; }
.nz-ma-tabs button:focus-visible { outline: 3px solid var(--sun, #ffc83d); outline-offset: 3px; }

.nz-ma-page { scroll-margin-top: 9rem; padding-top: 1.15rem; }
.nz-ma-pagehead { display: flex; align-items: center; justify-content: space-between; gap: .8rem; flex-wrap: wrap; margin-bottom: 1.1rem; }
.nz-ma-pagehead h2 { margin: .12rem 0 0; color: #c72a40; font-family: var(--font-head); font-size: clamp(1.85rem, 4.6vw, 2.55rem); line-height: 1.35; }
.nz-ma-page-no { display: inline-block; padding: .12rem .7rem; border-radius: 999px; background: #fff3d3; color: #80571c; font-weight: 800; font-size: .95rem; }
.nz-ma-group { margin-top: 1.2rem; }
.nz-ma-group-head { display: flex; align-items: center; justify-content: center; gap: .7rem; flex-wrap: wrap; margin: 0 auto .8rem; text-align: center; }
.nz-ma-group-head h3 { margin: 0; color: #4b388f; font-family: var(--font-head); font-size: clamp(1.4rem, 3.7vw, 1.82rem); line-height: 1.4; }
.nz-ma-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 9.2rem), 1fr)); gap: .72rem; }
.nz-ma-card {
  display: flex; flex-direction: column; justify-content: center; align-items: center; gap: .25rem; min-width: 0; min-height: 5.55rem;
  padding: .55rem .4rem .45rem; border: 2.5px solid #aaa0e7; border-radius: 19px;
  background: linear-gradient(180deg, #fff, #f1efff); color: #25243a; cursor: pointer;
  box-shadow: 0 4px 0 rgba(106, 44, 145, .12); transition: transform .12s, box-shadow .12s, border-color .12s;
  -webkit-tap-highlight-color: transparent;
}
.nz-ma-card.c1 { border-color: #e29aae; background: linear-gradient(180deg, #fff, #fff0f3); }
.nz-ma-card:hover { transform: translateY(-2px); box-shadow: 0 6px 13px rgba(60, 50, 130, .13); }
.nz-ma-card:active { transform: translateY(2px); box-shadow: 0 1px 0 rgba(106, 44, 145, .12); }
.nz-ma-card:focus-visible { outline: 3px solid var(--sun, #ffc83d); outline-offset: 3px; }
.nz-ma-cardtext { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: .12rem; width: 100%; font-family: var(--font-head); font-size: clamp(1.75rem, 3.9vw, 2.35rem); line-height: 1.55; text-align: center; overflow-wrap: anywhere; }
.nz-ma-arrow { padding-inline: .14rem; color: #d83258; font-size: .9em; white-space: nowrap; }
.nz-ma-cardhint { color: #77738e; font-size: .76rem; font-weight: 700; line-height: 1.2; }
.nz-ma-group:last-child .nz-ma-card:only-child { grid-column: 1 / -1; min-height: 6rem; border-color: #e6a0a8; background: linear-gradient(180deg, #fff9ed, #fff0df); }
.nz-ma-group:last-child .nz-ma-card:only-child .nz-ma-cardtext { font-size: clamp(1.8rem, 5vw, 2.65rem); }
.nz-ma-teacher { margin-top: 1.2rem; }
.nz-ma-teacher p { font-size: 1.2rem; line-height: 1.9; }
.nz-ma-feedback { position: fixed; z-index: 480; bottom: 1.2rem; inset-inline: 1rem; width: max-content; max-width: calc(100% - 2rem); margin-inline: auto; padding: .65rem 1rem; border-radius: 14px; background: #22223d; color: #fff; font-weight: 800; box-shadow: 0 8px 25px rgba(0,0,0,.22); }

.nz-ma-pop { position: fixed; inset: 0; z-index: 430; display: grid; place-items: center; padding: 1rem; background: rgba(14, 20, 48, .68); backdrop-filter: blur(4px); }
.nz-ma-box {
  position: relative; width: min(42rem, 100%); max-height: calc(100vh - 2rem); overflow: auto; padding: 4rem 1.2rem 1.1rem;
  border: 3px solid #fff; border-radius: 28px; background: linear-gradient(180deg, #fffef9, #fff8e9 68%, #f8f5ff);
  box-shadow: 0 18px 55px rgba(0, 0, 0, .38); text-align: center; overscroll-behavior: contain;
}
.nz-ma-close { position: absolute; top: .65rem; inset-inline-start: .65rem; display: grid; place-items: center; width: 2.65rem; height: 2.65rem; padding: 0; border: 0; border-radius: 50%; background: #ececf6; color: #25243a; font-size: 1.5rem; cursor: pointer; }
.nz-ma-sound { position: absolute; top: .68rem; inset-inline-end: .7rem; padding: .4rem .75rem; border: 2px solid #79c99d; border-radius: 999px; background: #e7f8ee; color: #11663d; font: inherit; font-weight: 800; cursor: pointer; }
.nz-ma-sound.off { border-color: #e5a3a8; background: #fff0f0; color: #a52335; }
.nz-ma-modal-label { color: #8877c4; font-weight: 900; font-size: .95rem; }
.nz-ma-mode { display: flex; align-items: center; justify-content: center; gap: .6rem; flex-wrap: wrap; margin: .4rem 0 .65rem; color: #56516f; font-weight: 800; }
.nz-ma-select { min-width: 9rem; padding: .4rem .8rem; border: 2px solid #d8d1f4; border-radius: 12px; background: #fff; color: #312d50; font: inherit; font-weight: 700; }
.nz-ma-reading {
  display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: .1rem .22rem; min-height: 7.7rem; margin: .4rem 0 .35rem; padding: .55rem .5rem;
  border: 3px dashed #d9dcef; border-radius: 22px; background: #fff; color: #22223d;
  font-family: var(--font-head); font-size: clamp(2.75rem, 9vw, 5.15rem); line-height: 1.75; cursor: pointer; direction: rtl; overflow-wrap: anywhere;
}
.nz-ma-reading.done { border-style: solid; border-color: #7fd3a4; }
.nz-ma-unit.hid { visibility: hidden; }
.nz-ma-reading-sep { color: #d83258; font-size: .72em; white-space: pre; }
.nz-ma-tip { min-height: 1.7em; margin: .3rem 0 .25rem; color: #696783; font-size: 1rem; font-weight: 800; }
.nz-ma-dots { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: .35rem; min-height: .8rem; margin: .25rem 0 .75rem; }
.nz-ma-dots i { display: block; width: .58rem; height: .58rem; border-radius: 50%; background: #dfe2f0; }
.nz-ma-dots i.on { background: #ffc83d; }
.nz-ma-actions { display: flex; justify-content: center; flex-wrap: wrap; gap: .55rem; }
.nz-ma-actions .btn, .nz-ma-nav .btn { font-size: 1rem; padding: .55rem .9rem; }
.nz-ma-play.on { box-shadow: 0 0 0 3px #ffc83d inset; }
.nz-ma-play:disabled { opacity: .45; cursor: not-allowed; }
.nz-ma-actions [hidden] { display: none; }
.nz-ma-nav { display: flex; align-items: center; justify-content: space-between; gap: .5rem; flex-wrap: wrap; margin-top: .85rem; padding-top: .7rem; border-top: 2px dashed #e5e0f2; }
.nz-ma-nav .btn { background: #fff; color: var(--ink, #22223d); box-shadow: 0 3px 0 #ddd8f0; }
.nz-ma-nav .btn:disabled { opacity: .35; cursor: default; }
.nz-ma-count { min-width: 3.2rem; color: #77738e; font-size: .9rem; font-weight: 900; direction: ltr; }

@media (max-width: 900px) { .nz-ma-tabs { top: 64px; } }
@media (max-width: 640px) {
  .nz-unit-lesson { display: inline-flex; white-space: normal; text-align: center; }
  .nz-ma-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .55rem; }
  .nz-ma-card { min-height: 5rem; border-radius: 16px; }
  .nz-ma-cardtext { font-size: clamp(1.7rem, 7vw, 2.25rem); }
  .nz-ma-pagehead { justify-content: center; text-align: center; }
  .nz-ma-box { padding: 4rem .7rem .85rem; border-radius: 22px; }
  .nz-ma-reading { min-height: 6.2rem; font-size: clamp(2.4rem, 11vw, 4rem); }
  .nz-ma-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .nz-ma-actions .btn { min-height: 2.8rem; }
  .nz-ma-nav { display: grid; grid-template-columns: 1fr 1fr; }
  .nz-ma-count { grid-column: 1 / -1; grid-row: 1; }
  .nz-ma-nav .nz-ma-prev { grid-column: 1; grid-row: 2; }
  .nz-ma-nav .nz-ma-next { grid-column: 2; grid-row: 2; }
}
@media (prefers-reduced-motion: reduce) { .nz-ma-card, .nz-ma-title-play { transition: none; } }

/* update 152 (BaraaKids): joined letters, one-line cards */
.nz-ma-reading { display: block; text-align: center; white-space: normal; }
.nz-ma-reading .nz-ma-unit { display: inline; padding: 0; margin: 0; }
.nz-ma-reading-sep { display: inline-block; margin-inline: .15em; }
.nz-ma-grid.wide { grid-template-columns: repeat(auto-fill, minmax(min(100%, 15rem), 1fr)); }
@media (max-width: 640px) {
  .nz-ma-grid.wide { grid-template-columns: 1fr; }
}

/* update 153: the whole lesson in the Mushaf's own (Uthmani) script — the King Fahd Complex Hafs font,
   and a card is as wide as its words (a long sentence wraps between its words, never inside one) */
@font-face { font-family: 'KFGQPC Hafs'; font-weight: 400; font-display: swap;
  src: url(../fonts/uthmanic-hafs-v22.woff2) format('woff2');
  unicode-range: U+0600-06FF,U+0750-077F,U+08A0-08FF,U+FB50-FDFF,U+FE70-FEFF,U+200C-200F; }
.nz-ma-cardtext, .nz-ma-reading { font-family: 'KFGQPC Hafs', var(--font-quran); font-weight: 400; }
.nz-ma-cardtext { font-size: clamp(2.1rem, 4.6vw, 2.75rem); line-height: 1.9; }
.nz-ma-reading { font-size: clamp(3rem, 10vw, 5.6rem); line-height: 2; }
.nz-ma-arrow, .nz-ma-reading-sep { font-family: var(--font-body); }
.nz-ma-grid.wide .nz-ma-cardtext { flex-wrap: wrap; white-space: normal; overflow-wrap: normal; column-gap: .35em; }
.nz-ma-grid.wide .nz-ma-cardtext .nz-ma-w { white-space: nowrap; }
.nz-ma-card.full { grid-column: 1 / -1; }
.nz-ma-card { min-width: 0; max-width: 100%; }
@media (max-width: 640px) {
  .nz-ma-cardtext { font-size: clamp(1.9rem, 7.6vw, 2.4rem); }
  .nz-ma-reading { font-size: clamp(2.5rem, 11vw, 3.9rem); }
}

/* update 159: Madd-Yaa — Tajawal keeps the two dots of a final yaa (the Hafs font drops them) */
.nz-ma-card.tj .nz-ma-cardtext, .nz-ma-reading.tj { font-family: 'Tajawal', var(--font-body); }

/* update 160: bold text; the madd letter in red, as in the book */
.nz-ma-cardtext, .nz-ma-reading { font-weight: 700; }
.nz-ma-card.tj .nz-ma-cardtext, .nz-ma-reading.tj { font-weight: 700; }
.mm { color: #d3202f; font-weight: inherit; }
.nz-ma-reading.done .mm, .nz-ma-reading .mm { color: #d3202f; }

/* update 162: cards that hold a whole phrase are wider, so a phrase sits on one or two lines instead of a tall narrow box */
.nz-ma-grid.wide { grid-template-columns: repeat(auto-fill, minmax(min(100%, 26rem), 1fr)); }
.nz-ma-grid.wide .nz-ma-cardtext { font-size: clamp(1.55rem, 3.4vw, 2.15rem); line-height: 1.7; }
@media (max-width: 560px) { .nz-ma-grid.wide { grid-template-columns: 1fr; } }

/* update 164: the button that leads to the next lesson */
.nz-ma-next { display: flex; justify-content: center; margin: 1.4rem 0 .6rem; }
.nz-ma-nextbtn { display: inline-block; padding: .85rem 1.6rem; border-radius: 999px; background: linear-gradient(180deg, #7b5cf0, #5a3fd0); color: #fff; font-weight: 800; font-size: 1.05rem; text-decoration: none; box-shadow: 0 4px 0 #3e2aa3, 0 8px 16px rgba(60, 40, 160, .25); }
.nz-ma-nextbtn:hover { transform: translateY(-2px); }
.nz-ma-nextbtn:active { transform: translateY(2px); box-shadow: 0 1px 0 #3e2aa3; }
.nz-ma-nextbtn:focus-visible { outline: 3px solid var(--sun, #ffc83d); outline-offset: 3px; }

/* sukun shapes shown under the lesson title */
.nz-sk-legend { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .75rem; margin: .2rem 0 .8rem; }
.nz-sk-shape { display: flex; align-items: center; gap: .85rem; padding: .7rem 1rem; background: #fff; border: 2px solid #e6dcf7; border-radius: 18px; box-shadow: 0 3px 0 #e6dcf7; }
.nz-sk-glyph { flex: none; display: grid; place-items: center; min-width: 3.4rem; font-family: 'KFGQPC Hafs', var(--font-quran); font-size: 3.2rem; line-height: 1.5; color: #d3202f; font-weight: 400; }
.nz-sk-cap { display: flex; flex-direction: column; gap: .15rem; font-size: .95rem; color: #5b4b8a; line-height: 1.5; }
.nz-sk-cap b { color: #4b388f; font-size: 1.05rem; }
.nz-sk-legend.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.nz-sk-legend.three .nz-sk-glyph { font-size: 2.6rem; min-width: 3rem; }
@media (max-width: 640px) { .nz-sk-legend, .nz-sk-legend.three { grid-template-columns: 1fr; } }

/* tanween: one tab for each kind (update 175) */
.nz-ma-tabs button.on { background: #ffc83d; border-color: #e0a800; color: #3b2a00; font-weight: 800; }
.nz-tw-sec[hidden] { display: none; }
.nz-tw-ic { font-family: 'KFGQPC Hafs', var(--font-quran); font-size: 1.25em; color: #d3202f; vertical-align: -.1em; }

.nz-sk-legend.one { grid-template-columns: minmax(0, 28rem); justify-content: center; }

/* update 177: the silent alif mark (U+06DF) is drawn by the Amiri Quran face, the Hafs font draws it as a big ring */
.nz-sz { font-family: 'Amiri Quran', 'KFGQPC Hafs', serif; }
.nz-ma-reading.long { font-size: clamp(1.7rem, 4.6vw, 2.9rem); line-height: 2.1; }
.nz-ma-card.full .nz-ma-cardtext { font-size: clamp(1.5rem, 3.4vw, 2.2rem); line-height: 2.1; text-align: right; }

/* update 186: the card found by the site search */
.nz-ma-card.bk-found { outline: 4px solid var(--sun, #ffc83d); outline-offset: 3px; animation: bkFound 1.1s ease-in-out 3; }
@keyframes bkFound { 50% { transform: scale(1.06); } }

/* update 191: the Shadda legend (بْ + بَ = بَّ) and the page index of the lesson */
.nz-sh-demo { margin: .2rem auto .9rem; max-width: 38rem; padding: 1rem 1.1rem .9rem; background: #fff; border: 2px solid #e6dcf7; border-radius: 22px; box-shadow: 0 4px 0 #e6dcf7; text-align: center; }
.nz-sh-eq { display: flex; align-items: stretch; justify-content: center; gap: .55rem; flex-wrap: nowrap; direction: rtl; }
.nz-sh-tile { flex: 1 1 0; max-width: 8.5rem; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .15rem; padding: .35rem .4rem .45rem; border-radius: 18px; border: 2px solid; }
.nz-sh-tile.a { background: #eef6ff; border-color: #b9d6f7; color: #1d4f8c; }
.nz-sh-tile.b { background: #effaf1; border-color: #b6e2c0; color: #1c6b36; }
.nz-sh-tile.c { background: #fff0f1; border-color: #f4b6bb; color: #b0182a; }
.nz-sh-g { font-family: 'Amiri Quran', 'Scheherazade New', 'Noto Naskh Arabic', serif; font-size: 3.6rem; line-height: 1.5; }
.nz-sh-g i { font-style: normal; font-weight: 700; }
.nz-sh-tile small { font-size: .82rem; font-weight: 800; }
.nz-sh-op { align-self: center; font-size: 2rem; font-weight: 900; color: #7a6a9a; }
.nz-sh-cap { margin: .65rem 0 0; font-size: 1rem; line-height: 1.7; color: #3d3257; }
.nz-sh-cap b { color: #b0182a; }
.nz-sh-index { display: flex; flex-wrap: wrap; gap: .5rem; justify-content: center; margin: 0 auto 1rem; max-width: 60rem; }
.nz-sh-jump { display: inline-flex; align-items: center; gap: .45rem; padding: .4rem .85rem; border: 2px solid #d9cdf2; border-radius: 999px; background: #faf7ff; color: #3d2a7a; font: inherit; font-size: .9rem; font-weight: 700; cursor: pointer; }
.nz-sh-jump b { background: #7b3fc4; color: #fff; border-radius: 999px; padding: .05rem .5rem; font-size: .8rem; }
.nz-sh-jump:hover { background: #efe6ff; }
.nz-sh-jump:focus-visible { outline: 3px solid var(--sun, #ffc83d); outline-offset: 2px; }
@media (max-width: 520px) { .nz-sh-g { font-size: 2.8rem; } .nz-sh-eq { gap: .3rem; } .nz-sh-op { font-size: 1.5rem; } }
