/* कविताएँ — Poems & rhymes (#/poems) */

/* Home */
.pm-songs-link { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin: 4px 0 0; padding: 12px 16px; border-radius: var(--r-md); background: var(--surface); border: 1px dashed var(--line-2); color: var(--ink-2); }
.pm-songs-link .icon { flex: none; color: var(--marigold); }
.pm-songs-link a { font-weight: 700; color: var(--peacock-deep); }
.pm-group { margin-top: 30px; }
.pm-group .sec-title { margin-bottom: 4px; }
.pm-group .sec-sub { margin: 0 0 14px; color: var(--ink-2); display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.pm-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); }
.pm-list > li { display: grid; }
.pm-card { display: flex; gap: 14px; align-items: flex-start; min-height: 44px; padding: 16px; border-radius: var(--r-lg); text-decoration: none; color: var(--ink); background: linear-gradient(160deg, var(--h1), var(--surface) 75%); border: 1px solid var(--line); box-shadow: var(--shadow-1); transition: transform .2s var(--spring), box-shadow .2s; }
.pm-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-2); }
.pm-card-emoji { font-size: 2rem; line-height: 1; flex: none; }
.pm-card-body { display: grid; gap: 2px; min-width: 0; }
.pm-card-ml { font: 800 1.2rem/1.35 var(--f-ml); color: var(--hi); overflow-wrap: anywhere; }
.pm-card-en { font-weight: 700; }
.pm-card-sub { font-size: .82rem; color: var(--ink-2); }
.pm-card-meta { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 6px; }

/* Poem page */
.pm-hero .h-en { margin: 2px 0 0; }
.pm-hero-meta { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 8px 0 0; }
.pm-note { margin: 8px 0 0; font-size: .88rem; color: var(--ink-2); max-width: 60ch; }
.pm-steps .unit-step .icon { width: 16px; height: 16px; }
.pm-tip { display: flex; gap: 10px; align-items: flex-start; margin: 12px 0 16px; padding: 12px 16px; border-radius: var(--r-md); background: var(--surface); border: 1px dashed var(--line-2); color: var(--ink-2); }
.pm-tip .icon { flex: none; color: var(--marigold); }
.pm-tip span { overflow-wrap: anywhere; }
.pm-hint { margin: 0 0 8px; font-size: .88rem; color: var(--ink-3); }

.pm-card { display: grid; gap: 6px; padding: 18px 20px; border-radius: 28px; background: linear-gradient(160deg, var(--kumkum-soft), var(--surface) 70%); border: 1px solid var(--line); margin-bottom: 16px; min-width: 0; }
.pm-line { padding: 8px 12px; border-radius: 16px; border-left: 4px solid transparent; transition: background .2s, border-color .2s; min-width: 0; }
.pm-line.is-now { background: var(--zari-soft); border-left-color: var(--marigold); }
.pm-line.is-you { background: var(--leaf-soft); border-left-color: var(--leaf); }
.pm-line .rt { margin: 0; }
.pm-line .rt-line { margin: 0; overflow-wrap: anywhere; }
.pm-en { margin: 2px 0 0; color: var(--ink-3); font-size: .92rem; }
.pm-ml { margin: 0; font: 700 clamp(1.15rem, 1rem + .8vw, 1.45rem)/1.6 var(--f-ml); overflow-wrap: anywhere; }
.pm-cue { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; min-height: 48px; padding: 10px 16px; border-radius: var(--r-md); background: var(--surface); border: 1px solid var(--line); font-size: 1.05rem; margin: 0 0 12px; }
.pm-cue .icon { color: var(--peacock); }
.pm-words-title { margin-top: 24px; }

/* Buttons and the speed picker under the poem */
.pm-controls { display: grid; gap: 12px; justify-items: center; margin-bottom: 8px; }
.pm-controls .rhyme-actions { flex-wrap: wrap; gap: 10px; align-items: center; }
.pm-speeds { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }
.pm-speed { min-height: 44px; min-width: 64px; display: inline-flex; align-items: center; justify-content: center; gap: 4px; flex-direction: column; padding: 4px 10px; border-radius: 14px; border: 2px solid var(--line); background: var(--surface); color: var(--ink-2); cursor: pointer; font: 700 .85rem/1.2 var(--f-ui); }
.pm-speed .ml { font-size: .85rem; }
.pm-speed .en { font-size: .7rem; font-weight: 600; }
.pm-speed .icon { width: 16px; height: 16px; }
.pm-speed[aria-checked="true"] { border-color: var(--peacock); background: var(--peacock-soft); color: var(--peacock-deep); }
.pm-where { margin: 0; min-height: 1.4em; color: var(--ink-2); font-weight: 700; }

/* Sing along: the lamp flame hops over the word being sung */
.pm-sing .rt-line { padding-top: 14px; }
.pm-sing .rt-word.is-sing { position: relative; background: var(--zari-soft); box-shadow: 0 0 0 2px var(--marigold); }
.pm-sing .rt-word.is-sing::before { content: ""; position: absolute; left: 50%; top: -16px; width: 12px; height: 16px; margin-left: -6px; border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%; background: radial-gradient(circle at 50% 70%, #FFE9A0, #F29A2E 70%); animation: pm-hop .45s ease-in-out infinite alternate; pointer-events: none; }
@keyframes pm-hop { from { transform: translateY(0) scale(1); } to { transform: translateY(-5px) scale(1.12); } }

/* Learn by heart: hidden words fade away, leaving a tappable gap */
.pm-heart-line { padding: 6px 0; }
.pm-blank { position: relative; display: inline-grid; place-items: center; vertical-align: baseline; font: inherit; min-width: 3em; min-height: 44px; padding: 0 .4em; border: 0; border-bottom: 3px dashed var(--marigold); background: var(--zari-soft); color: var(--zari-deep); border-radius: 8px 8px 0 0; cursor: pointer; letter-spacing: .1em; }
.pm-blank > span { grid-area: 1 / 1; }
.pm-ghost { letter-spacing: normal; color: var(--ink); animation: pm-fade 1.4s ease-in forwards; }
.pm-dots { opacity: 0; animation: pm-show .6s ease-out .9s forwards; }
@keyframes pm-fade { 0%, 35% { opacity: 1; } 100% { opacity: 0; visibility: hidden; } }
@keyframes pm-show { to { opacity: 1; } }
.pm-peek { color: var(--peacock-deep); background: var(--peacock-soft); border-radius: 8px; padding: 0 .2em; }

@media (prefers-reduced-motion: reduce) {
  .pm-card:hover { transform: none; }
  .pm-sing .rt-word.is-sing::before { animation: none; }
  .pm-ghost { animation: none; opacity: 0; visibility: hidden; }
  .pm-dots { animation: none; opacity: 1; }
}
:root[data-contrast="high"] .pm-card, :root[data-contrast="high"] .pm-line.is-now, :root[data-contrast="high"] .pm-line.is-you { border-color: var(--line-2); }
:root[data-contrast="high"] .pm-line.is-now { outline: 2px solid var(--marigold); }
:root[data-contrast="high"] .pm-line.is-you { outline: 2px solid var(--leaf); }
:root[data-contrast="high"] .pm-blank { outline: 2px solid var(--marigold); color: var(--ink); }
@media (max-width: 560px) {
  .pm-card { padding: 14px 10px; border-radius: 20px; }
  .pm-line { padding: 6px 8px; }
}
@media print {
  .pm-controls, .unit-steps, .unit-next, .letter-nav, .pm-songs-link { display: none !important; }
}
@media (max-width: 560px) {
  .pm-steps { grid-auto-flow: row; grid-template-columns: 1fr 1fr; }
  .pm-steps .unit-step { min-height: 56px; }
  .pm-steps .unit-step .ml { overflow-wrap: normal; }
}
