/* =====================================================================
   Design layer v2: Chabad English Hadera
   Loaded last on every page. Same palette, grid, pill nav, pill buttons
   and blue-white panels; this file only adds depth, motion and detail.
   Remove the <link> to design.css (and design.js) to return to v1.
   ===================================================================== */

:root {
  --ink: #114f7d;
  --ink-deep: #0a3960;
  --accent: #59bdcc;
  --accent-soft: #9ddde8;
  --line: #c7dee8;
  --paper: #f8fcff;
  --teal: #237b92;
  --teal-2: #28788f;
  --panel-border: linear-gradient(135deg, rgba(89, 189, 204, 0.75), rgba(199, 222, 232, 0.6) 40%, rgba(17, 79, 125, 0.18) 70%, rgba(89, 189, 204, 0.55));
  --lift: 0 1px 0 rgba(255, 255, 255, 0.9) inset, 0 24px 48px -22px rgba(10, 57, 96, 0.28), 0 8px 18px -10px rgba(10, 57, 96, 0.12);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  /* the brand star (two triangles), as an outline, for decoration */
  --star: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Cg fill='none' stroke='%2359bdcc' stroke-width='1.4' stroke-linejoin='round'%3E%3Cpath d='M50 8 86.4 71H13.6Z'/%3E%3Cpath d='M50 92 13.6 29h72.8Z'/%3E%3C/g%3E%3C/svg%3E");
  --star-solid: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Cg fill='%2359bdcc'%3E%3Cpath d='M50 8 86.4 71H13.6Z'/%3E%3Cpath d='M50 92 13.6 29h72.8Z'/%3E%3C/g%3E%3C/svg%3E");
}

::selection { background: rgba(89, 189, 204, 0.32); color: var(--ink-deep); }
html { scrollbar-color: #9ddde8 transparent; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 4px; border-radius: 12px; }

/* Smooth page-to-page fades in browsers that support it */
@view-transition { navigation: auto; }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: 260ms; }

/* ---------------------------------------------------------------- type */
h1, h2, h3 { text-wrap: balance; }
main p, main li { text-wrap: pretty; }
.welcome-copy h1 { font-size: clamp(3.4rem, 6.2vw, 5.6rem); letter-spacing: -0.035em; }
.inner-page h1 { font-size: clamp(2.7rem, 5vw, 4.4rem); letter-spacing: -0.03em; }
.inner-page h2, .home-page h2 { letter-spacing: -0.025em; }
.inner-page h2 { font-size: clamp(2.1rem, 3.6vw, 3.1rem); }

/* Eyebrows get the brand star as a bullet */
.eyebrow { display: inline-flex; align-items: center; gap: 0.6rem; }
.eyebrow::before { content: ""; flex: none; width: 0.95em; height: 0.95em; background: var(--star-solid) center / contain no-repeat; opacity: 0.9; }
.cluster-label.eyebrow::before, .hub-card .eyebrow::before { display: none; }

/* ---------------------------------------------------------------- background */
.site-bg::before {
  content: "";
  position: absolute;
  inset: -20%;
  background:
    radial-gradient(38% 32% at 18% 22%, rgba(89, 189, 204, 0.26), transparent 70%),
    radial-gradient(34% 30% at 82% 18%, rgba(17, 79, 125, 0.14), transparent 70%),
    radial-gradient(40% 36% at 60% 88%, rgba(157, 221, 232, 0.32), transparent 70%);
  filter: blur(10px);
  animation: aurora 26s var(--ease) infinite alternate;
  pointer-events: none;
}
.site-bg::after { mask-image: linear-gradient(180deg, #000 0%, rgba(0, 0, 0, 0.55) 70%, rgba(0, 0, 0, 0.35) 100%); }
@keyframes aurora {
  0% { transform: translate3d(0, 0, 0) scale(1); }
  50% { transform: translate3d(3%, -2%, 0) scale(1.06); }
  100% { transform: translate3d(-3%, 2%, 0) scale(1.02); }
}

/* scroll progress (long pages) */
.scroll-progress { position: fixed; left: 0; top: 0; z-index: 60; height: 3px; width: 100%; transform-origin: 0 50%; transform: scaleX(var(--progress, 0)); background: linear-gradient(90deg, var(--accent), var(--ink)); pointer-events: none; }

/* ---------------------------------------------------------------- top bar */
.topbar { transition: padding 0.35s var(--ease), box-shadow 0.35s var(--ease), background 0.35s var(--ease), top 0.35s var(--ease); }
.topbar.is-scrolled { box-shadow: 0 18px 40px -24px rgba(10, 57, 96, 0.45); background: rgba(248, 252, 255, 0.95); border-color: rgba(89, 189, 204, 0.45); }
@media (min-width: 901px) {
  .topbar.is-scrolled { padding-top: 0.55rem; padding-bottom: 0.55rem; top: 0.5rem; }
  .topbar.is-scrolled .brand-text { font-size: 1.9rem; }
}
.brand-text { transition: font-size 0.35s var(--ease); }
.brand-mark { transition: transform 0.6s var(--ease); }
.brand:hover .brand-mark { transform: rotate(60deg); }
.dropdown-menu { box-shadow: var(--lift); }
.dropdown-menu a { transition: background 0.2s ease, transform 0.2s var(--ease), color 0.2s ease; }
.dropdown-menu a:hover { transform: translateX(3px); }

/* ---------------------------------------------------------------- buttons (still pills) */
.btn { position: relative; overflow: hidden; isolation: isolate; transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease), background 0.3s ease; }
.btn::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(110deg, transparent 30%, rgba(255, 255, 255, 0.28) 50%, transparent 70%);
  transform: translateX(-120%);
  transition: transform 0.7s var(--ease);
}
.btn:hover::after { transform: translateX(120%); }
.btn:hover { transform: translateY(-2px); box-shadow: 0 14px 26px -12px rgba(10, 57, 96, 0.45); }
.btn span[aria-hidden], .home-link span[aria-hidden], .hub-link span[aria-hidden] { display: inline-block; transition: transform 0.35s var(--ease); }
.btn:hover span[aria-hidden], .home-link:hover span[aria-hidden], .hub-card:hover .hub-link span[aria-hidden] { transform: translate(3px, -3px); }
.support-pill { background: linear-gradient(#fff, #fff) padding-box, var(--panel-border) border-box; border: 1px solid transparent !important; }

/* ---------------------------------------------------------------- panels: gradient hairline border + depth */
.welcome-hero,
.page-hero,
.home-hospitality,
.card,
.welcome-path,
.hub-card,
.related-card,
.photo-frame,
.welcome-main-photo,
.welcome-small-photo,
.story-photo,
.home-hospitality figure,
.cluster-nav,
.steps li,
.note-panel,
.times-table-wrap {
  border: 1px solid transparent;
  background-origin: border-box;
  box-shadow: var(--lift);
}
.welcome-hero, .page-hero {
  background:
    radial-gradient(60% 80% at 0% 0%, rgba(89, 189, 204, 0.26), transparent 60%) padding-box,
    radial-gradient(50% 70% at 100% 100%, rgba(157, 221, 232, 0.35), transparent 60%) padding-box,
    linear-gradient(140deg, #fbfeff 0%, #eef8fb 55%, #e6f2f7 100%) padding-box,
    var(--panel-border) border-box;
  position: relative;
  overflow: hidden;
  isolation: isolate;
}
/* oversized brand star drifting in the hero corner */
.welcome-hero::before, .page-hero.has-photo::before, .page-hero:not(.has-photo)::before {
  content: "";
  position: absolute;
  z-index: -1;
  width: clamp(240px, 32vw, 460px);
  aspect-ratio: 1;
  left: -7%;
  bottom: -22%;
  background: var(--star) center / contain no-repeat;
  opacity: 0.35;
  animation: star-turn 90s linear infinite;
  pointer-events: none;
}
@keyframes star-turn { to { transform: rotate(360deg); } }

.card, .welcome-path, .hub-card, .related-card, .steps li, .times-table-wrap, .note-panel, .cluster-nav {
  background:
    radial-gradient(420px circle at var(--mx, 50%) var(--my, -40%), rgba(89, 189, 204, 0.16), transparent 45%) padding-box,
    linear-gradient(var(--paper), var(--paper)) padding-box,
    var(--panel-border) border-box;
}
.note-panel { background: radial-gradient(420px circle at var(--mx, 0%) var(--my, 0%), rgba(89, 189, 204, 0.18), transparent 50%) padding-box, linear-gradient(135deg, #e2f5f9, #f8fcff) padding-box, var(--panel-border) border-box; border-left: 1px solid transparent; }
.card, .welcome-path, .hub-card, .related-card { transition: transform 0.45s var(--ease), box-shadow 0.45s var(--ease); }
.card:hover, .welcome-path:hover, .hub-card:hover, .related-card:hover { transform: translateY(-5px); box-shadow: 0 1px 0 rgba(255, 255, 255, 0.9) inset, 0 34px 60px -26px rgba(10, 57, 96, 0.36), 0 10px 22px -12px rgba(10, 57, 96, 0.16); border-color: transparent; }
.details-card:hover { transform: none; }

/* card icons: a soft glowing tile */
.card-icon { background: radial-gradient(circle at 30% 25%, #ffffff, #e2f5f9 70%); box-shadow: inset 0 0 0 1px rgba(89, 189, 204, 0.35), 0 8px 16px -10px rgba(17, 79, 125, 0.4); }

/* ---------------------------------------------------------------- photos: scrapbook frames */
.photo-frame, .welcome-main-photo, .welcome-small-photo, .story-photo, .home-hospitality figure {
  background: linear-gradient(#fdfeff, #f6fbfd) padding-box, var(--panel-border) border-box;
  overflow: hidden;
  transition: transform 0.6s var(--ease), box-shadow 0.6s var(--ease);
}
.photo-frame img, .welcome-main-photo img, .welcome-small-photo img, .story-photo img, .home-hospitality figure img, .life-grid img, .hub-card img, .home-hadera > img {
  transition: transform 1.1s var(--ease), filter 0.6s ease;
}
.photo-frame:hover img, .welcome-main-photo:hover img, .welcome-small-photo:hover img, .story-photo:hover img, .home-hospitality figure:hover img, .hub-card:hover img { transform: scale(1.04); }
.photo-band .photo-frame, .page-hero.has-photo .photo-frame { transform: rotate(var(--tilt, 1.4deg)); }
.photo-band.is-reversed .photo-frame { --tilt: -1.4deg; }
.photo-band .photo-frame:hover, .page-hero.has-photo .photo-frame:hover { transform: rotate(0deg) translateY(-4px); }
.photo-strip .photo-frame:nth-child(3n + 1) { --tilt: -1deg; }
.photo-strip .photo-frame:nth-child(3n + 2) { --tilt: 0.8deg; }
.photo-strip .photo-frame:nth-child(3n) { --tilt: -0.4deg; }
.photo-strip .photo-frame { transform: rotate(var(--tilt)); }
.photo-strip .photo-frame:hover { transform: rotate(0) translateY(-4px); }
/* little tape strip on hero photos */
.page-hero.has-photo .photo-frame::before, .welcome-main-photo::before {
  content: "";
  position: absolute;
  z-index: 2;
  top: -9px;
  left: 50%;
  width: 92px;
  height: 22px;
  transform: translateX(-50%) rotate(-3deg);
  background: linear-gradient(90deg, rgba(157, 221, 232, 0.75), rgba(199, 222, 232, 0.85));
  border-radius: 3px;
  box-shadow: 0 2px 6px rgba(10, 57, 96, 0.12);
}
.page-hero.has-photo .photo-frame, .welcome-main-photo { position: relative; overflow: visible; }
.page-hero.has-photo .photo-frame img, .welcome-main-photo img { position: relative; z-index: 1; }
.welcome-main-photo { transform: rotate(-1.2deg); }
.welcome-small-photo { transform: rotate(3deg); transition: transform 0.6s var(--ease); }
.welcome-small-photo:hover { transform: rotate(0) translateY(-6px); }
.photo-note { transform: rotate(-4deg); }
figcaption { letter-spacing: 0.01em; }

/* ---------------------------------------------------------------- deep-blue bands */
.donate, .home-giving, .times-card {
  background:
    radial-gradient(520px circle at var(--mx, 85%) var(--my, 0%), rgba(157, 221, 232, 0.28), transparent 50%),
    radial-gradient(60% 90% at 0% 100%, rgba(89, 189, 204, 0.28), transparent 60%),
    linear-gradient(125deg, #0d4470 0%, #114f7d 45%, #106d8e 100%) !important;
  box-shadow: 0 40px 70px -40px rgba(10, 57, 96, 0.7);
}
.home-giving::after, .inner-page .donate::after { border-color: rgba(255, 255, 255, 0.14); }
.home-giving .btn, .donate .btn-light { box-shadow: 0 12px 26px -12px rgba(0, 0, 0, 0.45); }

/* ---------------------------------------------------------------- homepage details */
.welcome-strip { position: relative; overflow: hidden; border-bottom: 0; padding: 1.2rem 0; margin: 1.6rem 0 0; border-radius: 999px; background: linear-gradient(rgba(248, 252, 255, 0.75), rgba(248, 252, 255, 0.75)) padding-box, var(--panel-border) border-box; border: 1px solid transparent; box-shadow: var(--lift); mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); }
.welcome-strip.is-marquee { justify-content: flex-start; }
.welcome-strip .marquee-track { display: flex; flex: none; align-items: center; gap: 3rem; padding-right: 3rem; animation: marquee 38s linear infinite; }
.welcome-strip:hover .marquee-track { animation-play-state: paused; }
@keyframes marquee { to { transform: translateX(-100%); } }
.story-copy .story-signature { position: relative; display: inline-block; }
.story-copy .story-signature::after { content: ""; position: absolute; left: 0; right: -6px; bottom: -2px; height: 8px; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 10' preserveAspectRatio='none'%3E%3Cpath d='M2 7 C50 1 110 1 198 6' fill='none' stroke='%2359bdcc' stroke-width='2.4' stroke-linecap='round'/%3E%3C/svg%3E") center / 100% 100% no-repeat; }
.path-number { display: inline-flex; align-self: flex-start; padding: 0.35rem 0.8rem; border-radius: 999px; background: rgba(89, 189, 204, 0.13); }
.life-grid img, .home-hadera > img { border-radius: 22px !important; }
.life-feature, .life-small { position: relative; }
.home-section-heading h2 em, .welcome-copy h1 em { background: linear-gradient(100deg, var(--teal), #3aa6b8 60%, var(--teal)); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* ---------------------------------------------------------------- inner page details */
.breadcrumbs { display: inline-flex; padding: 0.35rem 1rem; border-radius: 999px; background: rgba(248, 252, 255, 0.7); border: 1px solid var(--line); backdrop-filter: blur(6px); }
.inner-page .page-hero h1 em { background: linear-gradient(100deg, var(--teal), #3aa6b8 60%, var(--teal)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.inner-page .donate h2 em, .home-giving h2 em { background: none; color: #9ddde8; -webkit-text-fill-color: #9ddde8; }

@media (min-width: 901px) {
  .cluster-nav { position: sticky; top: 6.4rem; z-index: 15; backdrop-filter: blur(10px); background: rgba(248, 252, 255, 0.9) padding-box, var(--panel-border) border-box; }
}
.cluster-nav a { transition: background 0.25s ease, color 0.25s ease, transform 0.25s var(--ease); }
.cluster-nav a:hover { transform: translateY(-1px); }
.cluster-nav a[aria-current="page"] { background: linear-gradient(120deg, var(--ink), #106d8e) !important; box-shadow: 0 8px 18px -10px rgba(10, 57, 96, 0.6); }

/* section heads: a short accent rule under the eyebrow line */
.section-head h2::after { content: ""; display: block; width: 56px; height: 3px; margin-top: 0.9rem; border-radius: 3px; background: linear-gradient(90deg, var(--accent), transparent); }
.stay-strip h2::after, .donate h2::after, .times-card h2::after, .related-links .section-head h2::after { display: none; }

/* steps: a connecting line between the numbers */
.steps { position: relative; }
.steps::before { content: ""; position: absolute; left: calc(1.4rem + 1.1rem - 1px); top: 2.4rem; bottom: 2.4rem; width: 2px; background: linear-gradient(var(--accent), rgba(89, 189, 204, 0.1)); z-index: 0; }
.steps li { z-index: 1; }
.steps li::before { background: linear-gradient(140deg, var(--ink), #106d8e); box-shadow: 0 0 0 5px #fff, 0 8px 18px -8px rgba(10, 57, 96, 0.6); }

/* related + hub cards: arrow badge */
.related-arrow, .hub-link span[aria-hidden] { transition: transform 0.35s var(--ease); }
.related-card:hover .related-arrow { transform: translate(3px, -3px); }
.related-arrow { width: 2rem; height: 2rem; display: grid; place-items: center; top: 1.1rem; border-radius: 50%; background: rgba(89, 189, 204, 0.14); }

/* stay strip as a soft pill panel */
.stay-strip { border-top: 0; padding: 2.6rem 2.8rem; border-radius: 32px; background: radial-gradient(60% 120% at 100% 0%, rgba(157, 221, 232, 0.4), transparent 60%) padding-box, linear-gradient(#f8fcff, #eef8fb) padding-box, var(--panel-border) border-box; border: 1px solid transparent; box-shadow: var(--lift); }
.home-stay { padding: 2.6rem 2.8rem; margin: 2.2rem 0 1rem; border-radius: 32px; background: radial-gradient(60% 120% at 100% 0%, rgba(157, 221, 232, 0.4), transparent 60%) padding-box, linear-gradient(#f8fcff, #eef8fb) padding-box, var(--panel-border) border-box; border: 1px solid transparent; box-shadow: var(--lift); }

/* times widget polish */
.times-cell { backdrop-filter: blur(4px); transition: transform 0.4s var(--ease), background 0.4s ease; }
.times-cell:hover { transform: translateY(-3px); background: rgba(248, 252, 255, 0.16); }
.times-table tbody tr { transition: background 0.2s ease; }
.times-table tbody tr:hover { background: rgba(89, 189, 204, 0.08); }

/* footer: a rounded blue-white panel with a big quiet wordmark */
.footer { position: relative; margin-top: 4rem !important; margin-bottom: 1.2rem; padding: 3.2rem 2.6rem 1.6rem !important; border-top: 0 !important; border-radius: 34px; overflow: hidden; isolation: isolate; width: calc(100% - 2rem); background: radial-gradient(50% 80% at 0% 0%, rgba(89, 189, 204, 0.18), transparent 60%) padding-box, linear-gradient(160deg, #f8fcff, #e9f4f8) padding-box, var(--panel-border) border-box; border: 1px solid transparent !important; box-shadow: var(--lift); }
.footer::before { content: ""; position: absolute; z-index: -1; right: -90px; bottom: -130px; width: 300px; aspect-ratio: 1; background: var(--star) center / contain no-repeat; opacity: 0.22; }
.footer-bottom { border-top-color: rgba(89, 189, 204, 0.3) !important; }

/* ---------------------------------------------------------------- reveal: blur-in with stagger */
.js-enhanced .reveal { opacity: 0; transform: translateY(22px) scale(0.985); filter: blur(6px); transition: opacity 0.9s var(--ease), transform 0.9s var(--ease), filter 0.9s var(--ease); transition-delay: var(--delay, 0ms); }
.js-enhanced .reveal.show { opacity: 1; transform: none; filter: none; }
.js-enhanced .stagger > * { opacity: 0; transform: translateY(18px); transition: opacity 0.8s var(--ease), transform 0.8s var(--ease); transition-delay: calc(var(--i, 0) * 80ms + 120ms); }
.js-enhanced .reveal.show .stagger > *, .js-enhanced .stagger.show > * { opacity: 1; transform: none; }
/* card hovers keep working once revealed */
.js-enhanced .reveal.show .stagger > .card:hover,
.js-enhanced .reveal.show .stagger > .hub-card:hover,
.js-enhanced .reveal.show .stagger > .related-card:hover,
.js-enhanced .reveal.show .stagger > .welcome-path:hover { transform: translateY(-5px); transition-delay: 0ms; }

/* ---------------------------------------------------------------- small screens */
@media (max-width: 900px) {
  .welcome-hero::before, .page-hero::before { width: 260px; left: -18%; bottom: -12%; opacity: 0.25; }
  .footer { width: calc(100% - 1.2rem); padding: 2.4rem 1.4rem 1.4rem !important; border-radius: 26px; }
  .stay-strip, .home-stay { padding: 2rem 1.5rem; border-radius: 26px; }
  .welcome-strip .marquee-track { gap: 1.6rem; padding-right: 1.6rem; animation-duration: 28s; }
  .photo-band .photo-frame, .page-hero.has-photo .photo-frame { --tilt: 0.8deg; }
  .photo-band.is-reversed .photo-frame { --tilt: -0.8deg; }
}

/* ---------------------------------------------------------------- reduced motion: everything calm */
@media (prefers-reduced-motion: reduce) {
  .site-bg::before, .welcome-hero::before, .page-hero::before, .welcome-strip .marquee-track { animation: none !important; }
  .js-enhanced .reveal, .js-enhanced .stagger > * { opacity: 1 !important; transform: none !important; filter: none !important; }
  .btn::after { display: none; }
  @view-transition { navigation: none; }
}
