/* Focused learning labs for Arabic Music Intro subpages. Does not touch global nav/logo layout. */

.learn-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
  margin: 20px 0 26px;
}

.learn-tab-btn {
  min-height: 42px;
  padding: 9px 16px;
  border-radius: 999px;
  border: 1px solid rgba(200,164,90,.2);
  background: rgba(255,255,255,.03);
  color: rgba(255,255,255,.78);
  font-family: inherit;
  font-weight: 900;
  transition: all .2s var(--ease);
}

.learn-tab-btn:hover,
.learn-tab-btn.is-active {
  color: var(--gold-light);
  border-color: rgba(200,164,90,.42);
  background: rgba(200,164,90,.12);
}

.learn-tab-panel {
  display: none;
}

.learn-tab-panel.is-active {
  display: grid;
  gap: 18px;
}

.learn-lab-card,
.learn-lab-practice,
.learn-lab-terms {
  border: 1px solid rgba(200,164,90,.14);
  border-radius: 24px;
  background: linear-gradient(180deg, rgba(15,15,18,.98), rgba(9,9,12,.985));
  box-shadow: 0 18px 42px rgba(0,0,0,.22), inset 0 1px 0 rgba(255,255,255,.03);
  padding: 22px;
}

.learn-lab-head {
  text-align: center;
  max-width: 760px;
  margin: 0 auto 18px;
}

.learn-lab-head h2,
.learn-lab-head h3 {
  margin: 0 0 8px;
  color: var(--text);
  line-height: 1.35;
}

.learn-lab-head p {
  margin: 0;
  color: rgba(255,255,255,.68);
  line-height: 1.85;
  font-size: .95rem;
}

.learn-term-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.learn-term-card {
  min-width: 0;
  padding: 16px;
  border-radius: 18px;
  border: 1px solid rgba(255,255,255,.07);
  background: rgba(255,255,255,.025);
}

.learn-term-symbol {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 46px;
  height: 38px;
  margin-bottom: 10px;
  padding: 0 10px;
  border-radius: 12px;
  border: 1px solid rgba(200,164,90,.22);
  background: rgba(200,164,90,.085);
  color: var(--gold-light);
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 1.15rem;
  font-weight: 900;
}

.learn-term-card strong {
  display: block;
  margin-bottom: 7px;
  color: var(--gold-light);
  font-size: .98rem;
}

.learn-term-card p {
  margin: 0;
  color: rgba(255,255,255,.68);
  line-height: 1.75;
  font-size: .86rem;
}

.learn-lab-svg {
  overflow-x: auto;
  padding-bottom: 4px;
}

.learn-lab-svg svg {
  display: block;
  width: 100%;
  min-width: 690px;
  height: auto;
}

.learn-lab-bg {
  fill: rgba(255,255,255,.025);
  stroke: rgba(200,164,90,.24);
  stroke-width: 2;
}

.learn-staff-lines line,
.learn-bars line,
.learn-ledger {
  stroke: rgba(226,192,122,.7);
  stroke-width: 2;
}

.learn-bars line {
  stroke-width: 3;
}

.learn-clef,
.learn-meter,
.learn-rest-symbol {
  fill: var(--gold-light);
  font-family: Georgia, 'Times New Roman', serif;
  font-weight: 800;
}

.learn-clef {
  font-size: 88px;
}

.learn-meter {
  font-size: 42px;
}

.learn-click-note,
.learn-click-rhythm,
.learn-meter-click,
.learn-cycle-click {
  cursor: pointer;
  outline: none;
}

.learn-click-hitbox {
  fill: transparent;
  stroke: transparent;
  pointer-events: all;
}

.learn-click-note ellipse,
.learn-click-rhythm ellipse,
.learn-measure-written-symbol ellipse {
  fill: var(--gold-light);
  transition: filter .2s ease, stroke .2s ease, stroke-width .2s ease;
}

.learn-click-note line:not(.learn-ledger),
.learn-click-rhythm line,
.learn-measure-written-symbol line,
.learn-note-flag {
  stroke: var(--gold-light);
  stroke-width: 4;
  fill: none;
  stroke-linecap: round;
}

.learn-click-rhythm[data-rhythm="tak"] .learn-note-flag {
  transform-box: fill-box;
  transform-origin: 50% 0%;
  transform: scaleY(-1);
}

.learn-click-note text,
.learn-rhythm-label,
.learn-rhythm-short {
  fill: rgba(255,255,255,.82);
  font-family: Cairo, sans-serif;
  font-weight: 900;
  text-anchor: middle;
  pointer-events: none;
}

.learn-click-note text {
  font-size: 15px;
}

.learn-click-note:hover ellipse,
.learn-click-note:focus-visible ellipse,
.learn-click-note.is-active ellipse,
.learn-click-rhythm:hover ellipse,
.learn-click-rhythm:focus-visible ellipse,
.learn-click-rhythm.is-active ellipse,
.learn-click-rhythm:hover .learn-rest-symbol,
.learn-click-rhythm:focus-visible .learn-rest-symbol,
.learn-click-rhythm.is-active .learn-rest-symbol {
  filter: drop-shadow(0 0 12px rgba(226,192,122,.55));
  stroke: rgba(255,255,255,.42);
  stroke-width: 2;
}

.learn-click-note:hover .learn-click-hitbox,
.learn-click-note:focus-visible .learn-click-hitbox,
.learn-click-note.is-active .learn-click-hitbox,
.learn-click-rhythm:hover .learn-click-hitbox,
.learn-click-rhythm:focus-visible .learn-click-hitbox,
.learn-click-rhythm.is-active .learn-click-hitbox {
  fill: rgba(200,164,90,.055);
  stroke: rgba(200,164,90,.18);
}

.learn-click-note.is-active text,
.learn-click-note:hover text,
.learn-click-note:focus-visible text,
.learn-click-rhythm.is-active .learn-rhythm-label,
.learn-click-rhythm:hover .learn-rhythm-label,
.learn-click-rhythm:focus-visible .learn-rhythm-label {
  fill: var(--gold-light);
}

.learn-rhythm-label {
  font-size: 18px;
}

.learn-rhythm-short {
  fill: rgba(226,192,122,.76);
  font-size: 16px;
}

.learn-rest-symbol {
  font-size: 56px;
  text-anchor: middle;
  pointer-events: none;
}

.learn-cycle-outline {
  fill: transparent;
  stroke: rgba(226,192,122,.18);
  stroke-width: 2;
  stroke-dasharray: 8 8;
}

.learn-cycle-click:hover .learn-cycle-outline,
.learn-cycle-click:focus-visible .learn-cycle-outline,
.learn-cycle-click.is-active .learn-cycle-outline {
  stroke: rgba(226,192,122,.65);
  filter: drop-shadow(0 0 10px rgba(226,192,122,.25));
}

.learn-info-box {
  min-height: 120px;
  padding: 15px 16px;
  border-radius: 18px;
  border: 1px solid rgba(200,164,90,.18);
  background: rgba(200,164,90,.065);
  margin-top: 12px;
}

.learn-info-box strong {
  display: block;
  margin-bottom: 8px;
  color: var(--gold-light);
  font-size: .98rem;
  line-height: 1.5;
}

.learn-info-box p {
  margin: 0;
  color: rgba(255,255,255,.74);
  line-height: 1.85;
  font-size: .9rem;
}

.learn-builder-slots,
.learn-measure-slots {
  display: grid;
  gap: 8px;
}

.learn-builder-slots {
  grid-template-columns: repeat(8, minmax(0, 1fr));
}

.learn-measure-slots {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.learn-builder-slot,
.learn-measure-slot {
  min-height: 62px;
  border-radius: 14px;
  border: 1px dashed rgba(200,164,90,.24);
  background: rgba(255,255,255,.025);
  color: rgba(255,255,255,.62);
  font-family: inherit;
  font-weight: 900;
  display: grid;
  place-items: center;
  gap: 1px;
  transition: all .2s var(--ease);
}

.learn-builder-slot.is-filled,
.learn-measure-slot.is-filled {
  border-style: solid;
  background: rgba(200,164,90,.105);
  color: var(--gold-light);
}

.learn-slot-symbol,
.learn-tool-symbol {
  display: inline-block;
  margin-inline-end: 6px;
  color: var(--gold-light);
  font-family: Georgia, 'Times New Roman', serif;
  font-weight: 900;
}

.learn-tool-symbol {
  font-size: 1.45em;
  line-height: 0;
  vertical-align: -0.08em;
}

.learn-tool-row,
.learn-action-row,
.learn-quiz-options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.learn-tool-row button,
.learn-action-row button,
.learn-quiz-options button {
  min-height: 42px;
  padding: 8px 15px;
  border-radius: 999px;
  border: 1px solid rgba(200,164,90,.2);
  background: rgba(200,164,90,.075);
  color: var(--gold-light);
  font-family: inherit;
  font-weight: 900;
  transition: all .2s var(--ease);
}

.learn-tool-row button:hover,
.learn-action-row button:hover,
.learn-quiz-options button:hover,
.learn-quiz-options button.is-selected {
  background: rgba(200,164,90,.16);
  border-color: rgba(200,164,90,.38);
  transform: translateY(-1px);
}

.learn-rhythm-select-label {
  width: min(100%, 520px);
  margin: 0 auto 16px;
  padding: 10px 12px;
  border-radius: 18px;
  border: 1px solid rgba(200,164,90,.22);
  background: linear-gradient(180deg, rgba(200,164,90,.10), rgba(255,255,255,.025));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.035), 0 10px 24px rgba(0,0,0,.14);
  display: grid;
  grid-template-columns: auto minmax(190px, 1fr);
  align-items: center;
  gap: 12px;
  color: var(--text);
  font-weight: 900;
  font-size: 1.02rem;
}

.learn-rhythm-select-label span {
  color: var(--gold-light);
  white-space: nowrap;
}

.learn-rhythm-select-label select {
  width: 100%;
  min-height: 44px;
  padding: 8px 42px 8px 16px;
  border-radius: 14px;
  border: 1px solid rgba(200,164,90,.36);
  background-color: rgba(9,9,11,.88);
  color: var(--gold-light);
  font-family: inherit;
  font-size: .95rem;
  font-weight: 900;
  text-align: center;
  outline: none;
  appearance: none;
  -webkit-appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--gold-light) 50%), linear-gradient(135deg, var(--gold-light) 50%, transparent 50%);
  background-position: calc(100% - 22px) 19px, calc(100% - 15px) 19px;
  background-size: 7px 7px, 7px 7px;
  background-repeat: no-repeat;
}

.learn-rhythm-select-label select:hover {
  border-color: rgba(226,192,122,.62);
  background-color: rgba(20,20,24,.96);
}

.learn-rhythm-select-label select:focus {
  border-color: var(--gold-light);
  box-shadow: 0 0 0 3px rgba(200,164,90,.13);
}

.learn-rhythm-select-label option {
  background: #141418;
  color: var(--text);
  font-weight: 800;
}

.learn-practice-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

.learn-quiz-card {
  padding: 15px;
  border-radius: 18px;
  border: 1px solid rgba(255,255,255,.07);
  background: rgba(255,255,255,.025);
}

.learn-quiz-card strong {
  display: block;
  margin-bottom: 10px;
  color: rgba(255,255,255,.84);
}

.learn-feedback {
  min-height: 24px;
  margin: 10px 0 0;
  color: rgba(255,255,255,.68);
  line-height: 1.65;
  font-size: .86rem;
  font-weight: 800;
}

.learn-feedback.is-correct { color: #7ecfa0; }
.learn-feedback.is-wrong { color: #e58b8b; }
.learn-feedback.is-warn,
.learn-feedback.is-info { color: var(--gold-light); }

/* Rhythm notation view: one rhythm line, notes on the line, rests slightly above it. */
#rhythm-interactive-root .learn-staff-lines line:not(:nth-child(2)),
[data-measure-view] .learn-staff-lines line:not(:nth-child(2)),
[data-maqsum-view] .learn-staff-lines line:not(:nth-child(2)),
[data-rhythm-build-view] .learn-staff-lines line:not(:nth-child(2)) {
  display: none;
}

#rhythm-interactive-root .learn-staff-lines line:nth-child(2),
[data-measure-view] .learn-staff-lines line:nth-child(2),
[data-maqsum-view] .learn-staff-lines line:nth-child(2),
[data-rhythm-build-view] .learn-staff-lines line:nth-child(2) {
  stroke-width: 3;
}

#rhythm-interactive-root .learn-click-rhythm .learn-rest-symbol,
[data-measure-view] .learn-measure-written-symbol .learn-rest-symbol,
[data-maqsum-view] .learn-measure-written-symbol .learn-rest-symbol,
[data-rhythm-build-view] .learn-measure-written-symbol .learn-rest-symbol {
  transform: translateY(-34px);
}

@media (max-width: 980px) {
  .learn-term-grid {
    grid-template-columns: 1fr;
  }

  .learn-builder-slots {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 680px) {
  .learn-lab-card,
  .learn-lab-practice,
  .learn-lab-terms {
    padding: 15px;
    border-radius: 20px;
  }

  .learn-tabs {
    justify-content: stretch;
  }

  .learn-tab-btn {
    flex: 1 1 100%;
  }

  .learn-lab-svg {
    overflow: hidden;
    margin-inline: 0;
    width: 100%;
    max-width: 100%;
  }

  .learn-lab-svg svg {
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }

  .learn-builder-slots,
  .learn-measure-slots {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .learn-rhythm-select-label {
    grid-template-columns: 1fr;
    text-align: center;
  }
}
