/* Design layer for the moshav site. Loaded after the page's own styles, so it only restyles; content and scripts are untouched.
   To go back to the old look, remove the one <link> to this file from default.htm. */

:root {
  --sage: #2f6fa3;
  --sage-light: #7fb2da;
  --sage-pale: #e6f1fa;
  --sage-dark: #14406b;
  --clay: #d98a3d;            /* warm field-gold accent against the blue */
  --clay-light: #f0b878;
  --clay-pale: #fdf1e2;
  --clay-dark: #a8621f;
  --stone: #f4f7fb;
  --stone-mid: #e1e9f1;
  --ink: #12202f;
  --ink-mid: #34495c;
  --ink-light: #667c8e;
  --radius-md: 14px;
  --radius-lg: 22px;
  --shadow-sm: 0 1px 2px rgba(18, 32, 47, .05), 0 4px 12px rgba(18, 32, 47, .06);
  --shadow-md: 0 2px 4px rgba(18, 32, 47, .05), 0 12px 28px rgba(18, 32, 47, .10);
  --lift: 0 4px 8px rgba(18, 32, 47, .06), 0 22px 44px rgba(20, 64, 107, .16);
}

body {
  background:
    radial-gradient(900px 500px at 8% 420px, rgba(47, 111, 163, .10), transparent 70%),
    radial-gradient(800px 480px at 95% 900px, rgba(217, 138, 61, .10), transparent 70%),
    var(--stone);
}

/* ── HERO: the photo stays; a curved edge, a glass title plate and a golden glow give it depth ── */
.hero {
  height: clamp(340px, 52vh, 520px);
  justify-content: center;
  padding-bottom: 70px;
  clip-path: ellipse(120% 100% at 50% 0%);
  border-radius: 0 0 48px 48px;
}
.hero-grad {
  background:
    radial-gradient(60% 70% at 50% 100%, rgba(217, 138, 61, .35), transparent 70%),
    linear-gradient(to bottom, rgba(10, 32, 58, .25) 0%, rgba(10, 32, 58, .72) 100%);
}
.hero-body {
  padding: 22px clamp(24px, 6vw, 56px) 20px;
  background: rgba(255, 255, 255, .10);
  border: 1px solid rgba(255, 255, 255, .28);
  border-radius: 28px;
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  box-shadow: 0 20px 50px rgba(0, 0, 0, .25), inset 0 1px 0 rgba(255, 255, 255, .35);
  animation: rise .9s cubic-bezier(.2, .7, .2, 1) both;
}
.hero-title { font-size: clamp(2.2rem, 6vw, 3.8rem); letter-spacing: -.02em; }
.hero-badge {
  background: linear-gradient(135deg, var(--clay), var(--clay-light));
  border: 0;
  color: #3a2208;
  font-weight: 700;
  box-shadow: 0 6px 18px rgba(217, 138, 61, .45);
  order: -1;
}
.hero-sub { opacity: .95; font-weight: 400; letter-spacing: .12em; }

/* ── NAV: a floating glass bar that overlaps the hero; the active tab is a filled pill ── */
.nav-wrap {
  background: rgba(255, 255, 255, .82);
  backdrop-filter: blur(16px) saturate(160%);
  -webkit-backdrop-filter: blur(16px) saturate(160%);
  border: 1px solid rgba(255, 255, 255, .9);
  border-radius: 999px;
  width: min(1100px, calc(100% - 24px));
  margin: -34px auto 0;
  top: 10px;
  box-shadow: var(--shadow-md);
}
.nav-inner { justify-content: center; padding: 6px 10px; gap: 2px; }
.nav-btn {
  height: 42px;
  border-radius: 999px;
  border-bottom: 0;
  padding: 0 16px;
}
.nav-btn:hover, .nav-item.open > .nav-btn { background: var(--sage-pale); }
.nav-btn.active {
  background: linear-gradient(135deg, var(--sage-dark), var(--sage));
  color: #fff;
  box-shadow: 0 6px 16px rgba(20, 64, 107, .35);
}
.dropdown { border-radius: 18px; box-shadow: var(--lift); border: 1px solid var(--stone-mid); overflow: hidden; }

/* ── Section labels and page headings ── */
.section-label {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--sage-dark);
  font-weight: 700;
  letter-spacing: .04em;
}
.section-label::before {
  content: "";
  width: 28px; height: 4px; border-radius: 4px;
  background: linear-gradient(90deg, var(--clay), var(--clay-light));
}
.page-title { font-family: 'Noto Serif Hebrew', serif; color: var(--sage-dark); }
.page-hd { border-bottom: 0; position: relative; }
.page-hd::after {
  content: ""; display: block; width: 64px; height: 4px; border-radius: 4px; margin-top: 12px;
  background: linear-gradient(90deg, var(--sage), var(--clay));
}

/* ── Cards: more air, softer layered shadows, a gentle lift on hover ── */
.card, .notice, .phone-card, .contact-card, .rental-card, .report-item, .doc-item, .member, .acc-item,
.memorial-list-card, .memorial-card, .info-box, .ql-card {
  border: 1px solid rgba(255, 255, 255, .8);
  box-shadow: var(--shadow-sm);
  transition: transform .25s cubic-bezier(.2, .7, .2, 1), box-shadow .25s, background .25s;
}
.card:hover, .notice:hover, .phone-card:hover, .contact-card:hover, .report-item:hover, .doc-item:hover,
.member:hover, .memorial-list-card:hover, .ql-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--lift);
}
.notice { border-radius: var(--radius-lg); position: relative; overflow: hidden; }
.notice::before {
  content: ""; position: absolute; inset-block: 0; inset-inline-start: 0; width: 5px;
  background: linear-gradient(to bottom, var(--clay), var(--sage));
}
.notice-dot { box-shadow: 0 0 0 0 rgba(217, 138, 61, .55); animation: pulse 2.4s infinite; }

/* quick links: the icon becomes a glowing tile */
.ql-card { border-radius: 18px; background: rgba(255, 255, 255, .9); }
.ql-icon {
  border-radius: 14px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .7), 0 6px 14px rgba(20, 64, 107, .14);
}
.ql-icon.sage { background: linear-gradient(135deg, #d6e9f8, #f1f8fe); }
.ql-icon.clay { background: linear-gradient(135deg, #fbe4c6, #fff6ea); }
.ql-card-moked {
  background: linear-gradient(135deg, var(--sage-dark), var(--sage));
  color: #fff;
  border: 0;
  border-radius: 18px;
  box-shadow: 0 12px 28px rgba(20, 64, 107, .35);
}
.ql-card-moked .ql-text-main { color: #fff; }
.ql-card-moked .ql-text-sub { color: rgba(255, 255, 255, .8); }
.ql-card-moked .ql-icon { background: rgba(255, 255, 255, .18); box-shadow: none; }

/* buttons and tabs */
.btn { border-radius: 999px; font-weight: 600; transition: transform .2s, box-shadow .2s; }
.btn:hover { transform: translateY(-2px); box-shadow: 0 10px 20px rgba(20, 64, 107, .22); }
.btn-sage { background: linear-gradient(135deg, var(--sage-dark), var(--sage)); }
.sub-tabs { gap: 6px; }
.sub-tab { border-radius: 999px; border-bottom: 0; }
.sub-tab.active { background: var(--sage-dark); color: #fff; }

/* ── Motion: content rises in once; skipped for people who ask for less motion ── */
@keyframes rise { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
@keyframes pulse { 70% { box-shadow: 0 0 0 9px rgba(217, 138, 61, 0); } 100% { box-shadow: 0 0 0 0 rgba(217, 138, 61, 0); } }
.page.active .container > * { animation: rise .7s cubic-bezier(.2, .7, .2, 1) both; }
.page.active .container > *:nth-child(2) { animation-delay: .08s; }
.page.active .container > *:nth-child(3) { animation-delay: .16s; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .hero-bg { transform: none; }
}

/* phones: the nav bar becomes a rounded panel instead of a pill so wrapped rows keep their shape */
@media (max-width: 720px) {
  .hero { border-radius: 0 0 32px 32px; padding-bottom: 60px; }
  .nav-wrap { border-radius: 24px; margin-top: -28px; }
  .nav-inner { justify-content: flex-start; }
}

/* ── Home layout: the notices and the quick links sit side by side, so both are visible without scrolling.
   (The quick-links block is the unclassed sibling of .home-layout inside the page's .container.) ── */
#page-home > .container {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 8px 32px;
  align-items: start;
}
#page-home .home-layout { display: block; }
#page-home > .container > div:not(.home-layout) {
  position: sticky;
  top: 84px;
  padding: 18px 16px 10px;
  background: rgba(255, 255, 255, .55);
  border: 1px solid rgba(255, 255, 255, .9);
  border-radius: 26px;
  box-shadow: var(--shadow-sm);
}
#page-home a:has(> .ql-card-moked) { display: block; text-decoration: none; color: inherit; }

/* phones: the quick links come first as a three-column grid of tiles, then the notices */
@media (max-width: 860px) {
  #page-home > .container { grid-template-columns: minmax(0, 1fr); }
  #page-home > .container > div:not(.home-layout) {
    order: -1;
    position: static;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    padding: 14px 12px 6px;
  }
  #page-home > .container > div:not(.home-layout) > .section-label,
  #page-home > .container > div:not(.home-layout) > a:has(> .ql-card-moked) { grid-column: 1 / -1; }
  #page-home .ql-card { margin-bottom: 0; flex-direction: column; text-align: center; gap: 4px; padding: 10px 4px; font-size: .85rem; }
  #page-home .ql-text-sub { display: none; }
}

/* The newsletter card starts as a placeholder ("current month's newsletter" pointing at the empty PDF) and the page script fills in the real one after it loads newslet-config.json.
   Keep the card hidden while it still points at the empty PDF, so the placeholder never flashes before the notices load (or shows when there is no newsletter). */
div:has(> a#newslet-link[href$="empty-news-letter.pdf"]) { display: none !important; }

/* Four sub-pages (building list, committee, garbage, essential phones) sit next to the page's .container instead of inside it in the page markup,
   so their content ran edge to edge. Give those the same width and side padding as the container. */
.page > .sub-page {
  max-width: 1120px;
  margin-inline: auto;
  padding: 0 clamp(16px, 4vw, 32px) clamp(24px, 4vw, 48px);
  width: 100%;
}
/* the plain link above the emergency numbers */
#info-phones > a {
  display: inline-block;
  margin: 0 0 18px;
  padding: 8px 16px;
  border-radius: 999px;
  background: var(--sage-pale);
  color: var(--sage-dark);
  font-weight: 600;
  text-decoration: none;
}
#info-phones > a:hover { background: var(--sage-light); }

/* ── Phones: tables and tab rows that were cut off at the screen edge ── */
@media (max-width: 640px) {
  /* tables shrink to the screen instead of scrolling sideways inside a clipped card */
  table.styled { min-width: 0; }
  table.styled th, table.styled td { padding: 10px 8px; font-size: .82rem; vertical-align: top; }
  table.styled td:first-child { min-width: 88px; }
  table.styled td a[href^="tel"] { white-space: nowrap; }
  /* sub-page tab rows wrap instead of hiding the active tab beyond the edge */
  .sub-tabs { flex-wrap: wrap; overflow-x: visible; }
}
/* phone numbers and e-mail addresses never break in the middle */
.phone-num, a[href^="tel"], a[href^="mailto"] { white-space: nowrap; }
@media (max-width: 380px) { .phone-card { flex-wrap: wrap; } }
