/* "Today's learning" at /today/ (homepage/templates/today.html), in the brand
   kit's design: green #0E4D3F, mint #BFE3CF, white; Manrope, and Frank Ruhl
   Libre for Hebrew. */
:root {
  --td-green: #0E4D3F;
  --td-green-2: #1D6B58;
  --td-mint: #BFE3CF;
  --td-mint-soft: #E5F2EB;
  --td-ink: #10201B;
  --td-muted: #4F5A54;
  --td-line: #E6E2DA;
  --td-page: #F6F8F6;
}

.td { margin: 0; background: var(--td-page); color: var(--td-ink); font: 16px/1.5 Manrope, system-ui, -apple-system, sans-serif; overflow-x: clip; }
.td *, .td *::before, .td *::after { box-sizing: border-box; }
.td a { color: inherit; }
.td :focus-visible { outline: 3px solid var(--td-green); outline-offset: 3px; }
.td-wrap { max-width: 1304px; margin: 0 auto; padding: 0 32px; }
.td-he { font-family: 'Frank Ruhl Libre', serif; font-weight: 500; }
.td-kicker { font-size: 13px; font-weight: 800; letter-spacing: .18em; text-transform: uppercase; }
.td-h2 { margin: 0; font-size: clamp(26px, 3vw, 32px); font-weight: 800; letter-spacing: -.03em; line-height: 1.1; }
.td-h3 { margin: 0; font-size: 22px; font-weight: 800; letter-spacing: -.02em; line-height: 1.2; }
.td-sub { margin: 6px 0 0; color: var(--td-muted); }
.td-empty { color: var(--td-muted); margin: 0; }

.td-btn {
  display: inline-flex; align-items: center; gap: 8px; align-self: flex-start;
  background: var(--td-green); color: #FFFFFF !important; text-decoration: none;
  font-weight: 800; font-size: 15px; padding: 13px 22px; border-radius: 999px;
}
.td-btn:hover { background: var(--td-green-2); }

/* Hero: the date and the search, on green */
.td-watermark {
  position: absolute; inset: -6% -2%; z-index: -1; pointer-events: none;
  font-family: 'Frank Ruhl Libre', serif; font-weight: 500; font-size: 44px; line-height: 1.4;
  color: #FFFFFF; opacity: .06; text-align: justify; overflow: hidden;
}
.td-hero { position: relative; z-index: 0; overflow: hidden; background: var(--td-green); color: #FFFFFF; padding: 32px 0 30px; }
.td-hero__grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: 48px; align-items: end; }
.td-hero .td-kicker { color: var(--td-mint); }
.td-hero h1 { margin: 6px 0 4px; font-size: clamp(34px, 4vw, 48px); font-weight: 800; letter-spacing: -.04em; line-height: 1.05; }
.td-hero__he { font-family: 'Frank Ruhl Libre', serif; font-size: 26px; text-align: left; unicode-bidi: plaintext; }
.td-hero__greg { font-size: 17px; opacity: .92; margin-top: 2px; }
.td-hero__sun { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; margin-top: 18px; min-height: 44px; }
.td-sunset {
  display: inline-flex; align-items: center; gap: 10px; padding: 10px 16px; border-radius: 10px;
  background: rgba(255, 255, 255, .08); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .28); font-size: 15px;
}
.td-sunset[hidden], .td-hero__loc[hidden] { display: none; }
.td-sunset svg { color: var(--td-mint); flex: none; }
.td-hero__loc { color: #FFFFFF !important; font-size: 14px; text-decoration: underline; text-underline-offset: 3px; }

.td-find { position: relative; }
.td-find__label { display: block; font-weight: 800; font-size: 19px; margin-bottom: 12px; }
.td-find__wrap { position: relative; }
.td-find__icon { position: absolute; left: 18px; top: 50%; transform: translateY(-50%); color: var(--td-muted); pointer-events: none; }
.td-find__input {
  width: 100%; height: 58px; padding: 0 20px 0 52px; border: 0; border-radius: 12px;
  background: #FFFFFF; color: var(--td-ink); font: 500 17px Manrope, system-ui, sans-serif;
}
.td-find__input::placeholder { color: #7A847F; }
.td-find__dropdown {
  position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: 20; max-height: 60vh; overflow: auto;
  background: #FFFFFF; color: var(--td-ink); border-radius: 12px; box-shadow: 0 16px 40px rgba(16, 32, 27, .22);
}
.td-find__item { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; text-decoration: none; border-bottom: 1px solid var(--td-line); }
.td-find__item:hover, .td-find__item:focus { background: var(--td-mint-soft); }
.td-find__item-main { display: flex; flex-direction: column; min-width: 0; }
.td-find__item-title { font-weight: 700; }
.td-find__item-sub { font-size: 13px; color: var(--td-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.td-find__badge { flex: none; font-size: 12px; font-weight: 800; color: var(--td-green); background: var(--td-mint-soft); padding: 3px 9px; border-radius: 999px; }
.td-find__footer { display: block; padding: 12px 16px; font-weight: 700; color: var(--td-green) !important; text-decoration: none; }

/* Filter buttons (tabs) */
.td-filters { display: flex; flex-wrap: wrap; gap: 8px; margin: 18px 0 26px; }
.td-filter {
  min-height: 42px; padding: 0 20px; border-radius: 999px; border: 1.5px solid var(--td-green);
  background: #FFFFFF; color: var(--td-green); font: 700 15px Manrope, system-ui, sans-serif; cursor: pointer;
}
.td-filter:hover { background: var(--td-mint-soft); }
.td-filter[aria-selected="true"] { background: var(--td-green); color: #FFFFFF; }

.td-panel__head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.td-count { font-size: 14px; color: var(--td-muted); }
.td-panel[hidden] { display: none; }

/* Today's learning cards */
.td-cards { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 13px; }
.td-card {
  position: relative; display: flex; flex-direction: column; gap: 12px; min-height: 124px;
  background: #FFFFFF; border-radius: 14px; padding: 16px; box-shadow: inset 0 0 0 1px var(--td-line);
}
.td-card:hover { box-shadow: inset 0 0 0 1.5px var(--td-green); }
.td-card__top { display: flex; justify-content: space-between; align-items: center; }
.td-card__letter {
  display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 50%;
  background: var(--td-mint-soft); color: var(--td-green); font-family: 'Frank Ruhl Libre', serif; font-weight: 700; font-size: 20px;
}
.td-play {
  position: relative; z-index: 2; display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border-radius: 50%; border: 0; background: var(--td-green); color: #FFFFFF !important; cursor: pointer;
}
.td-play svg { margin-left: 2px; }
.td-play__off { display: none; }
.td-play.is-playing .td-play__on { display: none; }
.td-play.is-playing .td-play__off { display: block; margin-left: 0; }
.td-card__link { display: flex; flex-direction: column; text-decoration: none; }
.td-card__link::after { content: ""; position: absolute; inset: 0; border-radius: 14px; }   /* the whole card opens the shiur */
.td-card__name { font-weight: 800; font-size: 19px; letter-spacing: -.01em; }
.td-card__sub { font-size: 15px; color: var(--td-muted); }

/* Chips in the other tabs */
.td-chips { display: flex; flex-wrap: wrap; gap: 10px; }
.td-chip {
  background: #FFFFFF; box-shadow: inset 0 0 0 1px var(--td-line); text-decoration: none;
  font-weight: 700; font-size: 15px; padding: 10px 16px; border-radius: 999px;
}
.td-chip:hover { box-shadow: inset 0 0 0 1.5px var(--td-green); }
.td-chip .td-he { color: var(--td-muted); margin-left: 4px; }

/* This week's study booklets */
.td-booklets { position: relative; z-index: 0; overflow: hidden; margin-top: 28px; background: var(--td-green); color: #FFFFFF; border-radius: 22px; padding: 28px 26px 22px; }
.td-booklets .td-kicker { color: var(--td-mint); }
.td-booklets__title { margin: 8px 0 18px; font-size: clamp(28px, 3vw, 36px); font-weight: 800; letter-spacing: -.03em; line-height: 1.1; }
.td-booklets__title .td-he { font-size: .72em; font-weight: 500; opacity: .9; margin-left: 10px; letter-spacing: 0; }
.td-booklets__list { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); column-gap: 32px; }
.td-booklets__list a {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 13px 0;
  border-top: 1px solid rgba(255, 255, 255, .22); text-decoration: none; font-weight: 700; font-size: 16px; color: #FFFFFF !important;
}
.td-booklets__list a:hover span { text-decoration: underline; text-underline-offset: 3px; }
.td-booklets__list svg { flex: none; opacity: .85; }

.td-announcement:not(:empty) { margin-top: 28px; }

/* Advice + sponsors */
.td-pair { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 18px; margin-top: 18px; align-items: stretch; }
.td-pair > :only-child { grid-column: 1 / -1; }
.td-advice { display: flex; flex-direction: column; gap: 8px; background: #FFFFFF; border-radius: 22px; padding: 26px 22px; box-shadow: inset 0 0 0 1px var(--td-line); }
.td-advice__he { align-self: flex-end; font-size: 30px; font-weight: 700; color: var(--td-green); }
.td-advice .td-btn { margin-top: 10px; }
.td-sponsors { display: flex; flex-direction: column; gap: 14px; background: var(--td-mint-soft); border-radius: 22px; padding: 22px; }
.td-sponsors__row { display: grid; grid-template-columns: 44px minmax(0, 1fr) 44px; align-items: center; gap: 8px; }
.td-arrow {
  width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--td-line); background: #FFFFFF;
  color: var(--td-ink); display: inline-flex; align-items: center; justify-content: center; cursor: pointer;
}
.td-arrow:hover { border-color: var(--td-green); }
.td-sponsor { background: #FFFFFF; border-radius: 14px; padding: 14px 16px; text-align: center; }
.td-sponsor[hidden] { display: none; }
.td-sponsor__title { font-weight: 800; font-size: 17px; }
.td-sponsor__label { font-weight: 700; color: var(--td-green); font-size: 14px; }
.td-sponsor__text { font-size: 14px; color: var(--td-muted); }
.td-donate { display: flex; flex-direction: column; gap: 12px; }
.td-donate__text { font-weight: 700; }

/* Listen anywhere */
.td-listen { margin: 40px 0 36px; }
.td-listen__grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 13px; margin-top: 18px; }
.td-way { display: flex; align-items: center; gap: 14px; background: #FFFFFF; border-radius: 14px; padding: 16px; box-shadow: inset 0 0 0 1px var(--td-line); }
.td-way img, .td-way__phone { width: 46px; height: 46px; flex: none; object-fit: contain; }
.td-way__phone { display: inline-flex; align-items: center; justify-content: center; border-radius: 10px; background: var(--td-green); }
.td-way__text { display: flex; flex-direction: column; flex: 1; min-width: 0; line-height: 1.3; }
.td-way__text strong { font-size: 16px; }
.td-way__text span { font-size: 14px; color: var(--td-muted); }
.td-pill {
  flex: none; padding: 9px 14px; border-radius: 999px; border: 1.5px solid var(--td-green);
  color: var(--td-green) !important; text-decoration: none; font-weight: 800; font-size: 14px; white-space: nowrap;
}
.td-pill:hover { background: var(--td-mint-soft); }

/* Footer. The bottom padding lets the dedication scroll clear of the
   floating Ask Chavrusa button (kit note). */
.td-footer { background: var(--td-green); color: #FFFFFF; }
.td-footer a { color: #FFFFFF; text-decoration: none; }
.td-footer a:hover { text-decoration: underline; text-underline-offset: 3px; }
.td-footer__row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); gap: 32px; padding-top: 30px; padding-bottom: 24px; }
.td-footer__name { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; font-size: 20px; }
.td-footer__logo svg { display: block; }
.td-footer__dedication { margin-top: 12px; font-size: 14px; }
.td-footer__links { display: grid; grid-template-columns: repeat(4, minmax(0, max-content)); column-gap: 64px; row-gap: 10px; align-content: start; }
.td-footer__donate { font-weight: 800; }
.td-footer__base { border-top: 1px solid rgba(255, 255, 255, .16); padding: 16px 0 90px; font-size: 13px; opacity: .9; }

/* Ask Chavrusa (daily_guide.js injects .dg-btn): it floats, pinned to the
   corner while the page scrolls. 32px in from the edges on desktop. */
.td .dg-btn { right: 32px; bottom: 32px; padding: 9px 20px 9px 9px; background: var(--td-green); border: 2px solid #FFFFFF;
  box-shadow: 0 8px 24px rgba(16, 32, 27, .28); font-family: Manrope, system-ui, sans-serif; font-size: 16px; font-weight: 800;
  transition: padding .2s, gap .2s; }
.td .dg-btn:hover { background: var(--td-green-2); }
.td .dg-btn-c { width: 32px; height: 32px; color: var(--td-green); }

@media (max-width: 1100px) {
  .td-cards, .td-booklets__list, .td-listen__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 820px) {
  .td-hero__grid { grid-template-columns: 1fr; gap: 0; }
  .td-pair { grid-template-columns: 1fr; }
  .td-footer__row { grid-template-columns: 1fr; }
  .td-footer__links { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 24px; }
  .td-booklets__list { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .td-wrap { padding: 0 16px; }
  /* On phones the search sits under the green band, on the page. */
  .td-hero { background: none; color: var(--td-ink); padding: 0; overflow: visible; }
  .td-hero > .td-watermark { display: none; }
  .td-hero__date { position: relative; z-index: 0; overflow: hidden; margin: 0 -16px; padding: 20px 16px 18px; background: var(--td-green); color: #FFFFFF; }
  .td-hero__date::before {
    content: "יסוד היסודות ועמוד החכמות לידע שיש שם מצוי ראשון והוא ממציא כל נמצא וכל הנמצאים משמים וארץ ומה ביניהם לא נמצאו אלא מאמתת המצאו ואם יעלה על הדעת שהוא אינו מצוי אין דבר אחר יכול להמצאות ואם יעלה על הדעת שאין כל הנמצאים מלבדו מצויים";
    position: absolute; inset: -4%; z-index: -1; direction: rtl; pointer-events: none;
    font-family: 'Frank Ruhl Libre', serif; font-size: 40px; line-height: 1.4; color: #FFFFFF; opacity: .06; text-align: justify;
  }
  .td-find { padding-top: 20px; }
  .td-hero__sun { flex-direction: column; align-items: stretch; gap: 10px; margin-top: 14px; }
  .td-hero__loc { align-self: flex-start; }
  .td-find__input { box-shadow: inset 0 0 0 1px var(--td-line); }
  .td-filters { display: grid; grid-template-columns: 1fr 1fr; margin: 12px 0 22px; }
  .td-filter { padding: 0 6px; font-size: 14px; white-space: nowrap; }
  #tab-holidays { font-size: 13px; letter-spacing: -.01em; }
  .td-cards { gap: 10px; }
  .td-card { padding: 12px; min-height: 0; }
  .td-card__name { font-size: 17px; }
  .td-card__sub { font-size: 13px; }
  .td-booklets { padding: 20px 18px 8px; }
  .td-booklets__title .td-he { display: block; margin: 4px 0 0; text-align: left; }
  .td-listen__grid { grid-template-columns: 1fr; }
  .td-footer__base { padding-bottom: 96px; }
  /* 16px from the right, above the browser's bottom bar. */
  .td .dg-btn { right: 16px; bottom: calc(env(safe-area-inset-bottom, 0px) + 16px); }
  /* Scrolling down shrinks it to the round chat icon (today.js). */
  .td .dg-btn.td-dg-mini { padding: 7px; gap: 0; font-size: 0; }
}
