/* Small additions for real uploaded photos inside the template's
   gradient placeholder boxes. Loaded after styles.css; the original
   design is untouched when no photo is present. */

.has-photo::after { content: none !important; }

.ph.has-photo, .nx-media.has-photo, .lead__media.has-photo,
.story__media.has-photo, .px-media.has-photo { overflow: hidden; }

.ph-img, .nx-img, .media-img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
}

.ph.has-photo, .nx-media.has-photo, .lead__media.has-photo,
.story__media.has-photo { position: relative; }

/* Article body images (blog posts) */
.px-body img { max-width: 100%; border-radius: var(--radius); margin: 8px 0 22px; }

/* ---- Donate calendar: English months / Hebrew months switch ---- */
.cal-mode { display: flex; justify-content: center; gap: 6px; margin-bottom: 14px; }
.cal-mode[hidden] { display: none; }
.cal-mode button { padding: 6px 14px; border-radius: 20px; border: 1.5px solid var(--line);
  background: var(--white); color: var(--navy); font-family: var(--sans); font-weight: 600;
  font-size: 0.78rem; white-space: nowrap; cursor: pointer; }
.cal-mode button:hover, .cal-mode button.active { border-color: var(--gold); background: var(--parchment-deep); }

/* ---- Donate calendar on narrow screens ----
   Long month names and the "Reserved" pill otherwise widen their column
   and push the grid out of the card. Keep the seven columns equal; from
   tablet width down, show the stacked second date (day over month) that
   contributions.js renders beside the one-line form, and on phones use
   the short Hebrew month and give the calendar more of the card's width.
   English dates ("Oct 12") are short, so Hebrew-month pages keep them on
   one line until small phones. */
.cal-grid, .cal-weekdays { grid-template-columns: repeat(7, minmax(0, 1fr)); }
.cal-cell { min-width: 0; }
.cal-cell .h-stack, .cal-cell .hm-s { display: none; }

@media (max-width: 700px) {
  .cal-cell .h { display: none; }
  .cal-cell .h-stack { display: block; }
  .cal-cell .cal-res { display: none; }
  .cal-cell.taken .d { text-decoration: line-through; }
}
@media (min-width: 421px) and (max-width: 700px) {
  .cal-by-heb .cal-cell .h { display: block; }
  .cal-by-heb .cal-cell .h-stack { display: none; }
}
@media (max-width: 600px) {
  .cal-cell .hm { display: none; }
  .cal-cell .hm-s { display: inline; }
}
@media (max-width: 480px) {
  #gift-form { padding-left: 20px; padding-right: 20px; }
  .cal-picker { padding: 10px 8px 12px; }
  .cal-grid, .cal-weekdays { gap: 3px; }
  .cal-cell { padding: 6px 1px; border-radius: 8px; }
  .cal-weekdays span { font-size: 0.6rem; letter-spacing: 0.02em; }
  .cal-mode button { padding: 5px 10px; font-size: 0.72rem; }
}
@media (max-width: 360px) {
  #gift-form { padding-left: 14px; padding-right: 14px; }
  .cal-picker { padding: 10px 5px 12px; }
  .cal-cell .h { font-size: 0.5rem; }
  .cal-mode button { padding: 5px 8px; font-size: 0.68rem; }
}

/* A long dedication on a short phone: scroll inside the modal instead of
   running off the bottom of the screen. */
.modal__box { max-height: calc(100vh - 40px); overflow-y: auto; }

/* Mobile nav: styles.css hides .nav under 900px; the header toggle drops it down as a panel. */
@media (max-width: 900px) {
  .site-header .wrap { position: relative; }
  .site-header.nav-open .nav {
    display: flex; flex-direction: column; align-items: stretch; gap: 2px;
    position: absolute; top: 100%; left: 0; right: 0;
    background: var(--navy); padding: 10px 20px 20px;
    box-shadow: 0 12px 20px -12px rgba(0,0,0,0.6);
  }
  .site-header.nav-open .nav a { padding: 12px 14px; }
  .site-header.nav-open .nav .btn { margin: 8px 0 0; text-align: center; }
}

/* Card photos fill the existing 52px circles. */
.circle-slot { margin-bottom: 18px; }
.circle-slot .card__icon { margin-bottom: 0; }
.circle-slot .card__icon img { display: block; width: 52px; height: 52px; border-radius: 50%; object-fit: cover; }
.circle-slot [hidden] { display: none; }
.section--parchment .circle-slot .card__icon { margin-left: auto; margin-right: auto; }

/* Uploaded header logo (Site Settings): fit the badge's slot, never its own size. */
.brand__logo { display: block; height: auto; width: auto; max-height: 48px; max-width: 200px; object-fit: contain; flex: none; }
@media (max-width: 480px) { .brand__logo { max-height: 40px; max-width: 120px; } }

/* Banner photos and blue tints sit behind the existing text and buttons. */
.hero__photo, .hero__photo .page-image, .hero__overlay { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.hero__photo .page-image { object-fit: cover; object-position: center; }
.hero__overlay { display: none; background: #0e192e; opacity: var(--hero-overlay-opacity, 75%); }
.hero--photo .hero__overlay { display: block; }
.hero--photo::after { display: none; }
.page-banner--editable { position: relative; }
.page-banner--editable > .wrap { position: relative; z-index: 2; }
.about-mission-media { display: grid; gap: 24px; min-width: 0; }
.about-mission-media > [hidden] { display: none; }
.about-photo__image .page-image { display: block; width: 100%; height: auto; border-radius: var(--radius); }

/* Balance leadership rows and center any shorter final row. */
.about-staff {
  --staff-columns: var(--staff-desktop-columns);
  --staff-gap: 30px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--staff-gap);
}
.about-staff > .card {
  flex: 0 0 calc((100% - (var(--staff-columns) - 1) * var(--staff-gap)) / var(--staff-columns));
  min-width: 0;
  overflow-wrap: anywhere;
}
@media (max-width: 900px) {
  .about-staff { --staff-columns: min(2, var(--staff-desktop-columns)); }
}
@media (max-width: 560px) {
  .about-staff { --staff-columns: 1; }
}

.hero--parallax .hero__photo { overflow: hidden; }
@media (prefers-reduced-motion: no-preference) {
  .hero--parallax .hero__photo .page-image { top: -80px; height: calc(100% + 160px); transform: translate3d(0, var(--hero-parallax-shift, 0px), 0); }
}

/* =====================================================================
   Campaign — donate page side panel (design 3) and the homepage
   "Partner With Us" countdown spotlight. Shown only while a campaign is
   displayed; without one both pages render exactly as before.
   ===================================================================== */
.camp-bar { position: relative; height: 12px; border-radius: 20px; overflow: hidden;
  background: var(--white); border: 1px solid var(--line); }
.camp-bar--dark { height: 14px; background: rgba(255,255,255,0.12); border: 0; }
.camp-bar__fill { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 20px;
  background: linear-gradient(90deg, var(--gold), var(--gold-bright)); }
.camp-bar__proj { position: absolute; top: 0; bottom: 0; width: 0; transition: all .3s ease;
  background: repeating-linear-gradient(45deg, var(--gold-light) 0 6px, rgba(216,191,122,0.55) 6px 12px); }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: #4caf72; display: inline-block; flex: none;
  box-shadow: 0 0 0 0 rgba(76,175,114,0.6); animation: camp-pulse 1.8s infinite; }
@keyframes camp-pulse { 0% { box-shadow: 0 0 0 0 rgba(76,175,114,0.6); }
  70% { box-shadow: 0 0 0 7px rgba(76,175,114,0); } 100% { box-shadow: 0 0 0 0 rgba(76,175,114,0); } }
@media (prefers-reduced-motion: reduce) { .live-dot { animation: none; } }

/* ---- Donate page: form + side panel ---- */
.give-layout--campaign { max-width: 1040px; display: grid; grid-template-columns: 1.25fr 1fr;
  gap: 28px; align-items: start; }
.give-layout--campaign > .form-card { min-width: 0; }
.camp-note { display: flex; gap: 10px; align-items: center; font-size: 0.85rem; padding: 10px 14px;
  margin: 0 0 20px; border-radius: var(--radius); background: rgba(184,145,47,0.10);
  border: 1px solid var(--gold-light); color: #6f5714; }
.camp-note b { color: var(--navy); }
.camp-panel { position: sticky; top: calc(var(--site-header-height) + 24px);
  background: linear-gradient(160deg, var(--navy), var(--navy-deep)); color: #dfe4ee;
  border-radius: var(--radius); box-shadow: var(--shadow); padding: 30px 28px; }
.camp-panel .eyebrow { color: var(--gold-bright); margin-bottom: 8px; display: flex; align-items: center; gap: 8px; }
.camp-panel h3 { color: var(--white); font-size: 1.35rem; margin-bottom: 16px; }
.camp-panel__raised { font-family: var(--serif); font-size: 2.5rem; color: var(--gold-bright); line-height: 1; }
.camp-panel__of { font-size: 0.88rem; color: #b9c2d4; margin: 6px 0 14px; }
.camp-panel__row3 { display: grid; grid-template-columns: repeat(3, 1fr); text-align: center; margin: 18px 0 6px;
  border-top: 1px solid rgba(255,255,255,0.1); border-bottom: 1px solid rgba(255,255,255,0.1); padding: 14px 0; }
.camp-panel__row3 b { display: block; font-family: var(--serif); font-size: 1.35rem; color: var(--white); font-weight: 600; }
.camp-panel__row3 span { font-size: 0.66rem; letter-spacing: 0.14em; text-transform: uppercase; color: #9aa6bf; }
.camp-panel__final { margin: 16px 0 4px; padding: 12px 14px; border: 1px solid rgba(207,169,74,0.4);
  border-radius: var(--radius); font-size: 0.85rem; color: var(--gold-light); text-align: center; }
.camp-panel h4 { color: var(--white); font-size: 0.95rem; margin: 20px 0 4px; }
.camp-clock { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin: 16px 0 4px; }
.camp-clock > div { border-radius: var(--radius); text-align: center; padding: 8px 0 6px; }
.camp-clock b { display: block; font-family: var(--serif); font-size: 1.4rem; font-weight: 600; line-height: 1.1; }
.camp-clock span { font-size: 0.6rem; letter-spacing: 0.14em; text-transform: uppercase; }
.camp-clock--dark > div { background: rgba(255,255,255,0.07); border: 1px solid rgba(255,255,255,0.1); }
.camp-clock--dark b { color: var(--white); }
.camp-clock--dark span { color: #9aa6bf; }
.camp-gift { display: flex; align-items: center; gap: 11px; padding: 9px 0; border-bottom: 1px dotted rgba(255,255,255,0.12); }
.camp-gift:last-child { border-bottom: none; }
.camp-gift__ava { width: 32px; height: 32px; border-radius: 50%; flex: none; display: grid; place-items: center;
  font-family: var(--serif); font-size: 0.8rem; background: var(--gold); color: var(--navy-deep); }
.camp-gift__ava.anon { background: rgba(255,255,255,0.14); color: var(--gold-bright); }
.camp-gift__name { color: var(--white); font-weight: 600; font-size: 0.86rem; }
.camp-gift__meta { color: #9aa6bf; font-size: 0.72rem; }
.camp-gift__amt { margin-left: auto; color: var(--gold-bright); font-family: var(--serif); white-space: nowrap; }
@media (max-width: 860px) {
  .give-layout--campaign { grid-template-columns: 1fr; max-width: 780px; }
  .camp-panel { position: static; order: -1; }
}

/* ---- Homepage: countdown spotlight (light) ---- */
.camp-spot { text-align: center; max-width: 760px; }
.camp-spot__clock { display: flex; justify-content: center; align-items: flex-start; gap: 6px; margin: 26px 0 6px; }
.camp-spot__clock > div { min-width: 92px; }
.camp-spot__clock b { display: block; font-family: var(--serif); font-size: clamp(2.6rem, 7vw, 4.2rem);
  color: var(--navy); font-weight: 600; line-height: 1; font-variant-numeric: tabular-nums; }
.camp-spot__clock span { font-size: 0.66rem; letter-spacing: 0.2em; text-transform: uppercase; color: var(--gold); font-weight: 700; }
.camp-spot__clock > .sep { min-width: 0; font-family: var(--serif); font-size: clamp(2.2rem, 6vw, 3.6rem);
  color: var(--gold-light); line-height: 1; }
.camp-spot__total { font-family: var(--serif); font-size: clamp(2.6rem, 7vw, 4.2rem); color: var(--gold); line-height: 1; margin: 26px 0 10px; }
.camp-pill { display: inline-block; font-size: 0.74rem; letter-spacing: 0.14em; text-transform: uppercase; font-weight: 700;
  padding: 8px 16px; border-radius: 20px; border: 1.5px solid var(--gold-light); color: var(--gold); background: var(--white); }
.camp-spot__line { font-size: 0.9rem; color: var(--ink-soft); margin: 14px 0 8px; }
.camp-spot__line b { color: var(--navy); }
.camp-spot .camp-bar { max-width: 460px; margin: 0 auto; height: 8px; }
@media (max-width: 560px) {
  .camp-spot__clock > div { min-width: 56px; }
  .camp-spot__clock span { letter-spacing: 0.08em; }
}

/* ---- Embedded Stripe payment page (/donate/pay/…) and Manage my gifts ---- */
.pay-layout { max-width: 760px; display: grid; gap: 22px; }
.pay-layout > .form-card { min-width: 0; }
.pay-summary__row { display: flex; gap: 18px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.pay-summary__amount { font-family: var(--serif); font-size: 2.1rem; color: var(--navy); line-height: 1.1; margin: 0; }
.pay-summary__amount small { font-size: 1rem; color: var(--ink-soft); }
.pay-summary__change { padding: 10px 18px; }
.pay-checkout { padding: 18px; }
.pay-checkout__status { text-align: center; margin: 18px 0; }
.pay-checkout__status--error { color: #a33; border: 1px solid #a33; padding: 10px 14px; border-radius: 4px; text-align: left; }
#checkout { min-height: 120px; }
.gift-list { list-style: none; padding: 0; margin: 18px 0 0; display: grid; gap: 12px; }
.gift-list li { border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px;
  display: flex; gap: 14px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.gift-list b { color: var(--navy); }
.gift-list .form-note { margin: 2px 0 0; }
.gift-list form { margin: 0; }
.gift-list .btn { padding: 9px 16px; }
.manage-note { color: #a33; border: 1px solid #a33; padding: 10px 14px; border-radius: 4px; }
@media (max-width: 560px) {
  .pay-summary__amount { font-size: 1.7rem; }
  .pay-summary__change, .gift-list .btn { width: 100%; }
  .gift-list form { width: 100%; }
}

/* Donate page: small "Manage my gifts" link under the secure-giving note */
.manage-gifts-link { margin: 6px 0 0; text-align: center; }
.manage-gifts-link a { color: var(--navy); font-weight: 600; text-decoration: underline; text-underline-offset: 2px; }
