/* ---- Daf Yomi listening site — shared styles ---- */
@import url('https://fonts.googleapis.com/css2?family=Frank+Ruhl+Libre:wght@500;700;900&family=Inter:wght@400;500;600;700&display=swap');

:root{
  --ink:#2a2520; --muted:#7a7065; --bg:#f3ecdd; --bg2:#ece2cd;
  --surface:#fffdf8; --line:#e2d7bf;
  --gold:#a9791b; --gold-soft:#c79a3a; --gold-bg:rgba(169,121,27,.12);
  --blue:#3f74c0; --blue-bg:rgba(63,116,192,.12);
  --shadow:0 6px 24px rgba(60,45,20,.10); --shadow-sm:0 2px 8px rgba(60,45,20,.08);
  --radius:14px;
}
*{box-sizing:border-box}
html,body{margin:0}
body{
  font-family:Inter,-apple-system,Segoe UI,Roboto,sans-serif;
  color:var(--ink); background:
    radial-gradient(1200px 500px at 50% -200px, #fbf6ea 0%, var(--bg) 60%) fixed;
  -webkit-font-smoothing:antialiased;
}
.he{font-family:"Frank Ruhl Libre",serif; direction:rtl}
a{color:inherit}

/* ---- top bar ---- */
.topbar{
  position:sticky; top:0; z-index:30; background:rgba(255,253,248,.88);
  backdrop-filter:saturate(1.4) blur(8px); border-bottom:1px solid var(--line);
}
.topbar .in{max-width:1080px; margin:0 auto; padding:12px 20px; display:flex; align-items:center; gap:14px}
.brand{display:flex; align-items:center; gap:10px; text-decoration:none; font-weight:700; letter-spacing:.2px}
.brand .mark{width:30px;height:30px;border-radius:8px;display:grid;place-items:center;
  background:linear-gradient(145deg,var(--gold),#8a5f12); color:#fff; font-family:"Frank Ruhl Libre",serif; font-weight:900}
.brand small{display:block;font-weight:500;color:var(--muted);font-size:11px;letter-spacing:.3px}
.spacer{flex:1}
.crumb{color:var(--muted); font-size:14px; display:flex; align-items:center; gap:8px}
.crumb a{text-decoration:none}
.crumb a:hover{color:var(--gold)}
.crumb .sep{opacity:.5}

/* ---- home ---- */
.wrap{max-width:1080px; margin:0 auto; padding:24px 20px 60px}
.hero{text-align:center; padding:46px 16px 30px}
.hero h1{font-family:"Frank Ruhl Libre",serif; font-weight:900; font-size:44px; margin:0 0 6px; letter-spacing:.5px}
.hero p{color:var(--muted); font-size:17px; max-width:560px; margin:8px auto 0; line-height:1.6}
.section-h{display:flex; align-items:baseline; gap:12px; margin:30px 4px 14px}
.section-h h2{font-size:14px; text-transform:uppercase; letter-spacing:.14em; color:var(--muted); margin:0; font-weight:600}
.section-h .rule{flex:1; height:1px; background:var(--line)}

.mcards{display:grid; grid-template-columns:repeat(auto-fill,minmax(260px,1fr)); gap:18px}
.mcard{background:var(--surface); border:1px solid var(--line); border-radius:var(--radius);
  box-shadow:var(--shadow-sm); overflow:hidden; transition:.18s; cursor:pointer}
.mcard:hover{transform:translateY(-2px); box-shadow:var(--shadow); border-color:var(--gold-soft)}
.mcard .top{padding:20px 22px; background:linear-gradient(135deg,#fffdf8,#f6eedd); border-bottom:1px solid var(--line)}
.mcard .hename{font-family:"Frank Ruhl Libre",serif; font-weight:900; font-size:34px; direction:rtl; line-height:1.1}
.mcard .enname{font-weight:700; font-size:18px; margin-top:2px}
.mcard .seder{color:var(--muted); font-size:13px; margin-top:2px}
.mcard .meta{padding:12px 22px; display:flex; justify-content:space-between; align-items:center; color:var(--muted); font-size:13px}
.mcard .go{color:var(--gold); font-weight:600}

.dafgrid{display:grid; grid-template-columns:repeat(auto-fill,minmax(64px,1fr)); gap:10px; margin-top:6px}
.daftile{background:var(--surface); border:1px solid var(--line); border-radius:10px; text-decoration:none;
  padding:14px 0; text-align:center; transition:.15s; box-shadow:var(--shadow-sm)}
.daftile:hover{border-color:var(--gold); transform:translateY(-2px); box-shadow:var(--shadow)}
.daftile .n{font-family:"Frank Ruhl Libre",serif; font-weight:700; font-size:22px}
.daftile .l{display:block; font-size:11px; color:var(--muted); margin-top:2px}
.muted{color:var(--muted)} .center{text-align:center}
.foot{color:var(--muted); font-size:12.5px; text-align:center; padding:40px 0 0; line-height:1.7}

/* ---- viewer ---- */
.player-bar{position:sticky; top:55px; z-index:20; background:var(--surface); border-bottom:1px solid var(--line); box-shadow:var(--shadow-sm)}
.player-bar .in{max-width:880px; margin:0 auto; padding:12px 18px}
.titleline{display:flex; align-items:center; gap:10px; flex-wrap:wrap; margin-bottom:9px}
.titleline .he{font-weight:700; font-size:20px}
.titleline .en{color:var(--muted); font-size:14px}
.tabs{margin-inline-start:auto; display:flex; gap:6px}
.tabs button, .navbtn{font:inherit; font-weight:600; padding:6px 13px; border:1px solid var(--line); background:#fff; cursor:pointer; border-radius:8px; color:var(--ink)}
.tabs button.active{background:var(--gold); border-color:var(--gold); color:#fff}
.tabs button:hover:not(.active), .navbtn:hover{border-color:var(--gold)}
.row{display:flex; align-items:center; gap:12px; flex-wrap:wrap}
audio{height:38px; flex:1; min-width:240px}
#sumBtn{font:inherit; font-weight:600; padding:7px 14px; border:1px solid var(--gold); background:#fff; color:var(--gold); border-radius:8px; cursor:pointer; white-space:nowrap}
#sumBtn:hover{background:var(--gold-bg)}
#src{font-size:12.5px; color:var(--blue); font-weight:600; min-height:16px; margin-top:7px}
.now{font-size:13px; color:var(--gold); font-weight:600; direction:rtl; min-height:17px; margin-top:3px}

.zoombar{display:flex; gap:8px; align-items:center; justify-content:center; max-width:880px; margin:10px auto 0; padding:0 16px; color:var(--muted); font-size:13px}
.zoombar button{font:inherit; font-weight:700; width:34px; height:34px; border:1px solid var(--line); background:#fff; border-radius:8px; cursor:pointer; line-height:1}
.zoombar button:hover{border-color:var(--gold)}
.stage{max-width:880px; margin:14px auto; padding:0 14px; overflow:auto; -webkit-overflow-scrolling:touch}
.daf{position:relative; line-height:0; border-radius:8px; overflow:hidden; box-shadow:var(--shadow); background:#fff; width:100%; transition:width .12s}
.daf img{width:100%; display:block}
.zone{position:absolute; cursor:pointer; border-radius:4px; background:transparent; transition:background .12s}
.zone:hover{background:var(--gold-bg); outline:1.5px solid var(--gold-soft)}
.zone.playing{background:rgba(169,121,27,.28); outline:2px solid var(--gold)}
.zone.cross:hover{background:var(--blue-bg); outline:1.5px solid var(--blue)}
.zone.cross.playing{background:rgba(63,116,192,.26); outline:2px solid var(--blue)}
.zone.noaudio{cursor:default}
.legend{max-width:880px; margin:6px auto 0; padding:0 16px; color:var(--muted); font-size:12.5px; display:flex; gap:18px; flex-wrap:wrap}
.legend i{display:inline-block; width:11px; height:11px; border-radius:3px; margin-inline-end:5px; vertical-align:-1px}
.legend .g{background:var(--gold-bg); outline:1px solid var(--gold-soft)}
.legend .b{background:var(--blue-bg); outline:1px solid var(--blue)}

.tip{position:fixed; z-index:50; background:#2a2520; color:#fff; padding:8px 11px; border-radius:8px; font-family:"Frank Ruhl Libre",serif;
  font-size:16px; direction:rtl; max-width:340px; pointer-events:none; display:none; box-shadow:0 6px 18px rgba(0,0,0,.3)}
.tip .x{display:block; direction:ltr; font-family:Inter,sans-serif; font-size:11px; color:var(--blue-bg); color:#9cc0ff; margin-top:3px}

/* drawer */
.drawer{position:fixed; top:0; right:0; height:100%; width:min(460px,94vw); background:var(--surface);
  box-shadow:-6px 0 30px rgba(0,0,0,.25); z-index:60; transform:translateX(100%); transition:transform .25s; overflow-y:auto}
.drawer.open{transform:translateX(0)}
.drawer h2{font-size:16px; margin:0; padding:16px 18px; border-bottom:1px solid var(--line); position:sticky; top:0; background:var(--surface); display:flex; justify-content:space-between; align-items:center}
.drawer h2 button{border:none; background:none; font-size:24px; cursor:pointer; color:var(--muted); line-height:1}
.sec{padding:14px 18px; border-bottom:1px solid var(--line); cursor:pointer}
.sec:hover{background:var(--gold-bg)}
.sec .st{display:flex; align-items:baseline; gap:9px; margin-bottom:5px}
.sec .stt{color:var(--gold); font-weight:700; font-size:12px; font-variant-numeric:tabular-nums; border:1px solid var(--gold-soft); border-radius:10px; padding:1px 8px; white-space:nowrap}
.sec .sh{font-weight:600; font-size:14px}
.sec .sb{font-size:13px; color:#5a5043; line-height:1.55}
.sec.playing{background:var(--gold-bg); box-shadow:inset 3px 0 0 var(--gold)}
.scrim{position:fixed; inset:0; background:rgba(40,30,15,.3); z-index:55; display:none}
.scrim.open{display:block}
@media(max-width:560px){ .hero h1{font-size:34px} }
@media(max-width:700px){
  .player-bar{top:0}
  .player-bar .in{padding:9px 12px}
  .titleline{gap:8px; margin-bottom:7px}
  .titleline .he{font-size:18px} .titleline .en{display:none}
  .tabs button,.navbtn,#sumBtn{padding:6px 10px; font-size:13px}
  audio{min-width:0; width:100%; order:-1}        /* audio on its own full-width row */
  .row{gap:8px}
  .stage{padding:0; margin:10px 0; border-radius:0}
  .daf{border-radius:0}
  .legend{padding:0 12px; gap:12px; font-size:12px}
  .crumb{display:none}
}
