/* Nov 7 2026 (Henry): Question of the Week + the 39 Melachos card. Same paper card, gold headings, brown text. */
.learn .card-h{display:flex;justify-content:space-between;align-items:baseline;gap:.2rem .8rem;flex-wrap:wrap}
.learn .lr-sub{font-size:.95em;letter-spacing:.06em;text-transform:none;font-weight:500;color:var(--muted)}
.learn .lr-sub .he{font-size:1.15em;letter-spacing:0;color:var(--wine)}
.qotw{margin-bottom:1rem}
.qa-win{display:grid;overflow:hidden;position:relative}
.qa-pane{grid-area:1/1}
.qa-tag{margin:0 0 .15rem;font-size:.78rem;font-weight:600;letter-spacing:.16em;text-transform:uppercase;color:var(--wine)}
.qa-a .qa-tag{color:var(--gold)}
.qa-text{margin:0;font-size:1.15rem;line-height:1.38;color:var(--ink)}
.qa-src{margin:.35rem 0 0;font-size:.92rem;font-style:italic;color:var(--muted)}
.qa-a{padding-left:.7rem;border-left:3px solid var(--gold)}
/* One slot for both sides. Fade out before the other side appears; neither changes the card height. */
.qa-rotating{--qa-fade:.35s;--qa-delay:.38s}
.qa-rotating .qa-pane{opacity:0;visibility:hidden;transition:opacity var(--qa-fade) ease,visibility 0s linear var(--qa-fade)}
.qa-rotating:not(.show-a) .qa-q,.qa-rotating.show-a .qa-a{opacity:1;visibility:visible;transition-delay:var(--qa-delay)}
@media (prefers-reduced-motion:reduce){.qa-rotating{--qa-fade:0s;--qa-delay:0s}}

.mel-win{display:grid;cursor:pointer;-webkit-tap-highlight-color:transparent;user-select:none;-webkit-user-select:none;outline:0}
.mel-slide{grid-area:1/1;opacity:0;transform:translateY(.6em);transition:opacity .8s ease,transform .8s ease;visibility:hidden}
.mel-slide.on{opacity:1;transform:none;visibility:visible}
.mel-name{margin:0;font-size:1.35rem;line-height:1.25;font-weight:600;color:var(--wine)}
.mel-name .he{font-weight:500;margin-left:.25em;white-space:nowrap}
.mel-no{display:inline-block;min-width:1.7em;padding:0 .3em;margin-right:.2em;border-radius:.5em;background:var(--gold-soft);color:var(--wine);font-size:.72em;text-align:center;vertical-align:.15em;font-variant-numeric:lining-nums tabular-nums}
.mel-en{margin:.05rem 0 .25rem;font-size:1rem;font-style:italic;color:var(--muted)}
.mel-t{margin:0;font-size:1.1rem;line-height:1.38;color:var(--ink)}
.mel-ctl{display:flex;justify-content:space-between;align-items:center;margin-top:.45rem;padding-top:.35rem;border-top:1px solid #efe7d7}
.mel-state{font-size:.85rem;color:var(--muted);font-style:italic}
.melachos.paused .mel-state{color:var(--wine)}
.mel-btn{appearance:none;-webkit-appearance:none;border:1px solid var(--gold-soft);background:var(--parch);color:var(--wine);border-radius:999px;width:2.1rem;height:2.1rem;font:inherit;font-size:1.3rem;line-height:1;cursor:pointer;padding:0 0 .12em}
.mel-btn:hover{border-color:var(--gold)}
@media (prefers-reduced-motion:reduce){.mel-slide{transition:opacity .4s ease;transform:none !important}}

/* desktop (3 columns): the card takes the spot beside Coming Up */
@media (max-width:1100px){.learn{grid-column:1 / -1}}

/* wall display (iPad): the card sits in the right column under Coming Up, which now shows two dates.
   Nov 7 2026 (Henry: "make sure it all fits in the same size box it was before"): the rest of the board keeps the exact size it had
   before this card; the card takes only the leftover space and js/home.js shrinks the card's own text (--lk) until it fits. */
@media (min-width:701px) and (min-height:560px){
  .home .board{grid-template-rows:auto auto minmax(0,1fr) auto;grid-template-areas:"times daf" "times up" "times learn" "ann ann"}
  .home .learn{grid-area:learn;grid-column:auto;display:flex;flex-direction:column;gap:.35em;font-size:calc(1rem * var(--lk,1));overflow:hidden}
  .home .learn .card-h{font-size:.74em;margin:0 0 .25rem;padding-bottom:.25rem}
  .home .qotw{margin-bottom:.25em}
  .home .qa-tag{font-size:.68em}
  .home .qa-text{font-size:1em;line-height:1.28}
  .home .qa-src{font-size:.82em;margin-top:.2em}
  .home .mel-name{font-size:1.12em}
  .home .mel-en{font-size:.86em;margin:0 0 .12em}
  .home .mel-t{font-size:.98em;line-height:1.28}
  .home .mel-ctl{margin-top:.25em;padding-top:.2em}
  .home .mel-btn{width:1.7em;height:1.7em;font-size:1.1em}
  .home .mel-state{font-size:.76em}
}

/* Nov 8 2026 (Henry): on Shabbos and Yom Tov nothing to touch: no buttons, no "tap to pause"; Yom Tov halachos show their source */
.melachos.holy .mel-ctl{display:none}
.melachos.holy .mel-win{cursor:pointer}
.melachos.holy .mel-win{cursor:default}
/* 8:48 PM (group request): tap pauses; a small word beside the count shows it, no extra space */
.melachos.paused #melCount::after{content:" \00b7  Paused";color:var(--wine);font-style:italic}
.melachos.holy #melCount::after{content:none}
.mel-src{margin:.3rem 0 0;font-size:.9rem;font-style:italic;color:var(--muted)}
#melTitle .he{font-size:1.15em;letter-spacing:0;color:var(--wine);text-transform:none}
@media (min-width:701px) and (min-height:560px){.home .mel-src{font-size:.8em;margin-top:.15em}}

/* Nov 7 2026 8:45 PM (group request): text in this card was too small. On the wall the question and the melacha now take turns
   in the same box (about 20 s each), so each gets the whole card; Coming Up is a little tighter to give this card more height. */
@media (min-width:701px) and (min-height:560px){
  /* 8:51 PM fix: never both at once. Outgoing fades out first, incoming starts only after it is gone. */
  /* 8:55 PM (group request): back to the stacked layout, question on top and the melacha bar below, both visible; bigger text, fitLearn shrinks only this card if needed. */
  .home .learn{font-size:calc(1.12rem * var(--lk,1))}
  .home .learn > .qotw,.home .learn > .melachos{margin:0}
  .home .learn .card-h{font-size:.8em}
  .home .board .upcoming .up{padding:.08rem 0 .08rem .5rem;margin-bottom:.1rem}
  .home .board .upcoming .up-name{font-size:.9rem}
  .home .board .upcoming .up-date{font-size:.8rem}
  .home .board .upcoming .card-h{margin-bottom:.2rem;padding-bottom:.15rem}
}

/* Nov 7 2026 8:45 PM (Henry): arrows and pause removed everywhere; swipe the melacha to move. */
.mel-ctl{display:none !important}
.mel-win{cursor:pointer}
.melachos.holy .mel-win{cursor:default}
/* 8:48 PM (group request): tap pauses; a small word beside the count shows it, no extra space */
.melachos.paused #melCount::after{content:" \00b7  Paused";color:var(--wine);font-style:italic}
.melachos.holy #melCount::after{content:none}

/* When last week's question is unavailable, leave the 39 Melachos centered in the card. */
@media (min-width:701px) and (min-height:560px){.home .learn.no-qotw{justify-content:center}}
