:root {
  --bg: #f2f4f7;
  --card: #ffffff;
  --ink: #16202e;
  --muted: #5d6675;
  --line: #e1e5eb;
  --navy: #174a7e;
  --navy-dark: #0f355c;
  --orange: #ef7d1a;
  --amber: #f6b02c;
  --hot: #c62828;
}
* { box-sizing: border-box; }
html, body { overflow-x: clip; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.6 Heebo, Arial, sans-serif; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; }
.wrap { max-width: 1240px; margin: 0 auto; padding: 0 16px; }
.skip { position: absolute; right: -999px; top: 8px; background: #fff; padding: 6px 12px; z-index: 50; }
.skip:focus { right: 8px; }
.muted { color: var(--muted); }
.pad { padding: 30px 0; }

/* top bar + header */
.topbar { background: var(--navy-dark); color: #dfe7f1; font-size: 13px; }
.topbar .wrap { display: flex; justify-content: space-between; gap: 12px; padding-top: 6px; padding-bottom: 6px; flex-wrap: wrap; }
.topbar .links { display: flex; gap: 16px; flex-wrap: wrap; }
.topbar a:hover { color: #fff; text-decoration: underline; }
.head { background: #fff; border-bottom: 1px solid var(--line); }
.head .wrap { display: flex; align-items: center; gap: 18px; padding-top: 10px; padding-bottom: 10px; }
.logo img { display: block; height: 92px; width: auto; }
.logo.small img { height: 60px; }
.tagline { color: var(--muted); font-size: 15px; border-right: 3px solid var(--orange); padding-right: 12px; }
.search { margin-right: auto; display: flex; }
.search input { font: inherit; border: 1px solid var(--line); border-left: 0; border-radius: 0 8px 8px 0; padding: 7px 12px; width: 240px; }
.search button { font: inherit; background: var(--navy); color: #fff; border: 0; border-radius: 8px 0 0 8px; padding: 7px 14px; cursor: pointer; }
.search.wide { margin: 10px 0 18px; }
.search.wide input { width: 100%; max-width: 480px; }

/* nav */
.nav { background: var(--navy); box-shadow: 0 2px 8px rgba(0,0,0,.15); }
.nav ul { list-style: none; margin: 0; padding: 0; }
.nav > .wrap > ul { display: flex; flex-wrap: nowrap; flex: 1; min-width: 0; }
.nav > .wrap > ul > li { position: relative; }
.nav > .wrap > ul > li > a { display: block; color: #fff; font-weight: 700; padding: 11px 15px; white-space: nowrap; }
.nav > .wrap > ul > li.on > a, .nav > .wrap > ul > li > a:hover { background: var(--navy-dark); box-shadow: inset 0 -3px 0 var(--orange); }
.nav li ul { display: none; position: absolute; top: 100%; right: 0; background: #fff; min-width: 180px; box-shadow: 0 8px 22px rgba(0,0,0,.15); border-top: 3px solid var(--orange); }
.nav li:hover > ul, .nav li:focus-within > ul { display: block; }
.nav li ul a { display: block; padding: 8px 14px; border-bottom: 1px solid var(--line); }
.nav li ul a:hover { background: #f4f7fb; color: var(--navy); }

/* layout */
main.withside { display: grid; grid-template-columns: minmax(0, 1fr) 310px; gap: 22px; }
.content { min-width: 0; padding-top: 16px; }
.side { align-self: stretch; }
.side .sticky { position: sticky; top: calc(var(--hdr, 110px) + 4px); padding-top: 12px; max-height: calc(100vh - var(--hdr, 110px) - 10px); overflow-y: auto; scrollbar-width: thin; }

/* cards */
.pic { position: relative; display: block; overflow: hidden; background: #dfe5ed; border-radius: 8px; }
.pic img { display: block; width: 100%; height: 100%; object-fit: cover; }
.pic.wide { aspect-ratio: 16 / 9; }
.pic.thumb { width: 132px; min-width: 132px; aspect-ratio: 4 / 3; }
.pic.empty { display: grid; place-items: center; background: #eef2f7; }
.pic.empty img { width: 46%; height: auto; opacity: .55; object-fit: contain; }
.play { position: absolute; inset: 0; margin: auto; width: 46px; height: 46px; border-radius: 50%; background: rgba(0,0,0,.55); border: 2px solid #fff; }
.play::after { content: ''; position: absolute; top: 50%; left: 52%; transform: translate(-50%, -50%); border-style: solid; border-width: 9px 0 9px 15px; border-color: transparent transparent transparent #fff; }
.pic.thumb .play { width: 30px; height: 30px; }
.pic.thumb .play::after { border-width: 6px 0 6px 10px; }
.kicker { display: block; font-size: 13px; font-weight: 700; color: var(--orange); margin-bottom: 2px; }
.hot { display: inline-block; background: var(--hot); color: #fff; font-size: 12px; border-radius: 4px; padding: 0 7px; margin-left: 6px; vertical-align: 2px; }
time { color: var(--muted); font-size: 13px; }
.card { display: block; background: var(--card); border-radius: 10px; }
.card h2, .card h3 { margin: 2px 0 4px; line-height: 1.3; }
.card:hover h2, .card:hover h3 { color: var(--navy); }
.card.big { border: 1px solid var(--line); overflow: hidden; }
.card.big .pic { border-radius: 0; }
.card.big .txt { display: block; padding: 14px 18px 16px; }
.card.big h2 { font: 800 30px/1.25 Heebo, sans-serif; }
.card.big p { margin: 4px 0 6px; color: #333c49; font-size: 17px; }
.card.mid { border: 1px solid var(--line); overflow: hidden; }
.card.mid .pic { border-radius: 0; }
.card.mid .txt { display: block; padding: 9px 12px 11px; }
.card.mid h3 { font-size: 17px; }
.card.row { display: flex; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); border-radius: 0; background: none; }
.card.row h3 { font-size: 16px; }
.card.row .txt { min-width: 0; }

/* stories strip */
.stories { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 12px; margin-bottom: 16px; }
.strip { display: flex; gap: 14px; overflow-x: auto; scrollbar-width: thin; padding-bottom: 4px; }
.story { width: 96px; min-width: 96px; text-align: center; font-size: 12px; line-height: 1.3; }
.story .pic.round { width: 78px; height: 78px; margin: 0 auto 5px; border-radius: 50%; border: 3px solid var(--orange); padding: 2px; background: #fff; }
.story .pic.round img { border-radius: 50%; }
.story .play { display: none; }
.story span:last-child { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

/* top area */
.top { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 14px; margin-bottom: 18px; }
.leads { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; align-content: start; }

/* blocks */
.block { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 14px 18px 18px; margin-bottom: 18px; }
.blockh { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; font: 800 22px/1.2 Heebo, sans-serif; margin: 0 0 12px; padding-bottom: 8px; border-bottom: 3px solid var(--navy); color: var(--navy-dark); }
.blockh .subs { display: flex; gap: 12px; flex-wrap: wrap; font-size: 14px; font-weight: 500; }
.blockh .subs a { color: var(--muted); }
.blockh .subs a:hover, .blockh .all:hover { color: var(--orange); }
.blockh .all { margin-right: auto; font-size: 14px; font-weight: 500; color: var(--navy); }
.grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: 16px; }
.list .card.row:last-child { border-bottom: 0; }
.list.cols { display: grid; grid-template-columns: 1fr 1fr; gap: 0 18px; }
.list.big .pic.thumb { width: 180px; min-width: 180px; }
.list.big .card.row h3 { font-size: 18px; }
.block.dark { background: var(--navy-dark); border-color: var(--navy-dark); color: #fff; }
.block.dark .blockh { color: #fff; border-color: var(--orange); }
.block.dark .blockh .all { color: var(--amber); }
.vgrid, .ggrid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.ggrid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.vcard h3, .gcard h3 { font-size: 15px; line-height: 1.35; margin: 6px 0 0; }
.gcard { position: relative; }
.gcard .count { position: absolute; top: 8px; right: 8px; background: rgba(0,0,0,.65); color: #fff; font-size: 12px; border-radius: 4px; padding: 1px 7px; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chips a { border: 1px solid var(--line); border-radius: 18px; padding: 3px 13px; font-size: 14px; }
.chips a.on, .chips a:hover { background: var(--navy); border-color: var(--navy); color: #fff; }

/* torah */
.torah { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-top: 14px; }
.tcol { background: #f7f9fc; border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; }
.tcol h3 { margin: 0 0 6px; font-size: 16px; color: var(--navy-dark); }
.tcol .big { font: 700 20px/1.3 'Frank Ruhl Libre', serif; margin: 0 0 4px; }
.tcol p { margin: 0 0 6px; }
.tcol ul { list-style: none; margin: 0; padding: 0; font-size: 14px; }
.tcol li { padding: 3px 0; }
.zm li { display: flex; justify-content: space-between; border-bottom: 1px dashed var(--line); }

/* side */
.box { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; margin-bottom: 14px; }
.boxh { display: flex; justify-content: space-between; align-items: center; margin: 0 0 6px; font: 800 19px/1.2 Heebo, sans-serif; color: var(--navy-dark); border-bottom: 3px solid var(--orange); padding-bottom: 6px; }
.live { font-size: 12px; color: var(--hot); display: flex; align-items: center; gap: 5px; }
.live i { width: 8px; height: 8px; border-radius: 50%; background: var(--hot); animation: pulse 2s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(198,40,40,.6); } 70% { box-shadow: 0 0 0 7px rgba(198,40,40,0); } 100% { box-shadow: 0 0 0 0 rgba(198,40,40,0); } }
.flashes ol { list-style: none; margin: 0; padding: 0; }
.flashes li { display: flex; gap: 8px; padding: 7px 0; border-bottom: 1px solid var(--line); font-size: 14px; line-height: 1.4; }
.flashes li time { color: var(--orange); font-weight: 700; min-width: 40px; }
.flashes li a:hover { color: var(--navy); }
.more { display: block; text-align: center; margin-top: 8px; font-size: 14px; font-weight: 700; color: var(--navy); }
.ad .adlabel { display: block; font-size: 11px; color: var(--muted); margin-bottom: 3px; }
.ad a { display: block; border-radius: 10px; overflow: hidden; border: 1px solid var(--line); background: #0c1f45; }
.ad img { display: block; width: 100%; height: auto; }
.side .ad img { width: auto; max-width: 100%; max-height: calc(100vh - 380px); min-height: 200px; margin: 0 auto; object-fit: contain; }
.adhere { margin: 12px 0; background: var(--card); border: 1px dashed var(--orange); border-radius: 10px; padding: 10px 14px; font-size: 14px; }
.adhere b { display: block; color: var(--navy-dark); font-size: 16px; }
.adhere p { margin: 3px 0 5px; color: var(--muted); }
.adhere a { color: var(--navy); font-weight: 700; word-break: break-all; }
.inline-ad { display: none; padding: 12px 0; border-bottom: 1px solid var(--line); }

/* story page */
.storypage { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 18px 26px 22px; margin-bottom: 18px; }
.crumbs { font-size: 14px; color: var(--muted); }
.crumbs a { color: var(--navy); }
.storypage h1 { font: 800 34px/1.25 Heebo, sans-serif; margin: 8px 0 6px; }
.dek { font-size: 20px; line-height: 1.5; color: #333c49; margin: 0 0 6px; }
.meta { margin: 0 0 12px; }
.storypage .body { font-size: 18px; line-height: 1.85; }
.storypage .body p { margin: 0 0 14px; }
.mfig { position: relative; margin: 10px 0 16px; background: #dfe5ed; border-radius: 10px; overflow: hidden; }
.mfig img, .mfig video { display: block; width: 100%; height: auto; max-height: 620px; object-fit: contain; background: #000; }
.mfig figcaption { font-size: 13px; color: var(--muted); background: #f7f9fc; padding: 5px 10px; }
.mfig.warn img, .mfig.warn video { filter: blur(26px); }
.mfig .cover { position: absolute; inset: 0; width: 100%; border: 0; background: rgba(15,25,40,.62); color: #fff; font: 700 16px Heebo, sans-serif; cursor: pointer; }
.mgrid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.mgrid .mfig { margin: 0; }
.timeline ol { list-style: none; margin: 0; padding: 0; border-right: 3px solid var(--orange); }
.timeline li { padding: 6px 14px 8px 0; position: relative; }
.timeline li time { display: block; color: var(--orange); font-weight: 700; }
.storypage h2 { font-size: 20px; color: var(--navy-dark); margin: 20px 0 10px; }
.prose p { font-size: 17px; line-height: 1.8; }
.prose a { color: var(--navy); font-weight: 700; }

/* join band + footer */
.joinband { display: flex; align-items: center; gap: 16px; justify-content: space-between; background: linear-gradient(90deg, var(--navy) 0%, var(--navy-dark) 100%); color: #fff; border-radius: 12px; padding: 18px 22px; margin-bottom: 18px; }
.joinband b { font-size: 19px; }
.joinband p { margin: 4px 0 0; opacity: .85; }
.joinband.small { padding: 12px 18px; margin: 18px 0 0; }
.btn { display: inline-block; background: var(--orange); color: #fff; font-weight: 800; border-radius: 8px; padding: 9px 22px; white-space: nowrap; }
.btn:hover { background: #d96b0c; }
.foot { background: var(--navy-dark); color: #c9d5e3; margin-top: 20px; padding: 22px 0; font-size: 14px; }
.foot .wrap { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
.foot .logo img { background: #fff; border-radius: 8px; padding: 4px; }
.foot nav { display: flex; gap: 16px; flex-wrap: wrap; }
.foot nav a:hover { color: #fff; text-decoration: underline; }
.foot p { width: 100%; margin: 6px 0 0; opacity: .8; }

/* shabbat */
body.holy { display: grid; place-items: center; min-height: 100vh; background: var(--bg); }
.holybox { text-align: center; background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 30px 40px; }
.holybox h1 { font: 900 44px/1.1 'Frank Ruhl Libre', serif; color: var(--navy-dark); margin: 14px 0 6px; }

/* narrow screens */
@media (max-width: 1020px) {
  main.withside { grid-template-columns: minmax(0, 1fr); }
  .side { display: none; }
  .inline-ad { display: block; }
  .inline-ad .ad img { max-height: 520px; width: auto; margin: 0 auto; }
}
@media (max-width: 760px) {
  .head .wrap { flex-wrap: wrap; gap: 8px; }
  .logo img { height: 64px; }
  .tagline { display: none; }
  .search { margin-right: 0; width: 100%; }
  .search input { width: 100%; }
  .top, .grid { grid-template-columns: minmax(0, 1fr); }
  .leads { grid-template-columns: 1fr 1fr; }
  .card.big h2 { font-size: 23px; }
  .vgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ggrid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .torah { grid-template-columns: minmax(0, 1fr); }
  .list.cols { grid-template-columns: minmax(0, 1fr); }
  .list.big .pic.thumb, .pic.thumb { width: 110px; min-width: 110px; }
  .storypage { padding: 14px 14px 18px; }
  .storypage h1 { font-size: 26px; }
  .dek { font-size: 17px; }
  .storypage .body { font-size: 17px; }
  .mgrid { grid-template-columns: minmax(0, 1fr); }
  .joinband { flex-direction: column; align-items: flex-start; }
  .topbar .links { gap: 10px; }
  .nav li ul { display: none !important; }
}

/* the header stays on top; it gets smaller once the page is scrolled */
.sticky-top { position: sticky; top: 0; z-index: 30; }
.head .wrap, .logo img { transition: padding .2s, height .2s; }
body.scrolled .head .wrap { padding-top: 4px; padding-bottom: 4px; }
body.scrolled .logo img { height: 48px; }
body.scrolled .tagline { display: none; }
.navrow { display: flex; align-items: stretch; }
.back { display: flex; align-items: center; gap: 5px; background: var(--orange); color: #fff; font-weight: 800; padding: 0 12px 0 16px; white-space: nowrap; }
.back:hover { background: #d96b0c; }
.back svg { display: block; }
@media (max-width: 760px) {
  .nav > .wrap > ul { overflow-x: auto; scrollbar-width: none; }
  .nav .wrap.navrow { padding: 0; }
  body.scrolled .head .search { display: none; }
  body.scrolled .logo img { height: 38px; }
  .back { padding: 0 10px 0 12px; }
}
