/* ============================================================
   ShulProfileDesktop layout — Wave 8 desktop redesign.
   Applies at ≥900px. Mobile keeps the cover + identity + actions
   layout from the existing card design.
   ============================================================ */

@media (min-width: 900px) {
  body { background: var(--gray-50); }

  /* Override the mobile-first #app { max-width: 720px } cap inside the
     shul page's inline <style> block. Without this every section is
     squeezed into a 720px column on desktop even though its own rule
     sets max-width: 1200px (the parent's cap wins). */
  #app {
    max-width: 100% !important;
    padding-bottom: 0 !important;
  }

  /* JGive-style layout — drop the cover hero entirely and let the
     aside card own the shul branding. The main column gets straight to
     the tabs + content. */
  .cover { display: none !important; }
  .identity { display: none !important; }
  .shul-stats { display: none !important; }
  .bottom-bar { display: none !important; }

  /* Top padding for the main content so it doesn't butt against the
     site topbar */
  .shul-body { padding-top: 24px !important; }

  /* ── (Legacy .cover hero — hidden above; rules retained below
     because they're still inside the @media block. They paint nothing
     since display:none wins on the same element.) ──────────────── */
  .cover {
    height: 320px !important;
    border-radius: 0 !important;
    background:
      radial-gradient(120% 80% at 80% 0%, rgba(255,255,255,0.15), transparent 50%),
      linear-gradient(135deg, var(--blue-700), var(--brand-navy));
    position: relative;
  }
  .cover::after {
    content: '';
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(45deg, rgba(255,255,255,0.04) 0 2px, transparent 2px 18px);
    pointer-events: none;
  }
  .cover-actions {
    max-width: 1200px;
    margin-inline: auto;
    padding: 20px 32px 0;
    display: flex;
    justify-content: space-between;
    position: relative;
    z-index: 2;
  }
  .cover-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.18);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: var(--white);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    cursor: pointer;
    text-decoration: none;
    transition: background 120ms ease;
  }
  .cover-btn:hover { background: rgba(255, 255, 255, 0.28); }

  /* ── Identity row: pulled up over the cover ────────────────── */
  .identity {
    max-width: 1200px !important;
    margin-inline: auto !important;
    padding: 0 32px !important;
    margin-top: -60px !important;
    position: relative;
    display: flex;
    align-items: flex-end;
    gap: 24px;
    flex-wrap: nowrap;
  }
  .crest {
    width: 124px !important;
    height: 124px !important;
    border-radius: 28px !important;
    border: 6px solid var(--white) !important;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.12) !important;
    background: var(--white);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--blue-700);
  }
  .crest i { width: 56px !important; height: 56px !important; }
  .identity-text {
    flex: 1;
    padding-bottom: 14px;
    color: var(--white);
    text-shadow: 0 2px 16px rgba(0, 0, 0, 0.4);
  }
  .identity h1 {
    font-size: 38px !important;
    font-weight: 900 !important;
    letter-spacing: -1.2px !important;
    margin: 0 !important;
    line-height: 1.05;
  }
  .identity .meta {
    font-size: 14px !important;
    gap: 18px !important;
    margin-top: 6px;
    opacity: 0.92;
  }
  .identity .meta i { color: var(--white); }

  /* Action group floats inside the identity row, bottom-aligned */
  .identity .actions {
    padding: 0 0 14px !important;
    gap: 10px;
    flex-shrink: 0;
  }
  .btn-donate {
    padding: 13px 24px !important;
    flex: 0 0 auto !important;
    background: var(--brand-gold, #D4A843) !important;
    color: var(--gray-900) !important;
    font-weight: 700 !important;
    box-shadow: 0 8px 24px rgba(212, 168, 67, 0.35) !important;
  }
  .btn-donate:hover { transform: translateY(-1px); }
  .btn-follow {
    padding: 12px 16px !important;
    background: rgba(255, 255, 255, 0.18) !important;
    color: var(--white) !important;
    border: 1px solid rgba(255, 255, 255, 0.3) !important;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
  }
  .btn-follow:hover { background: rgba(255, 255, 255, 0.28) !important; }

  /* ── KPI strip — 4 white cards on a light surface ──────────── */
  .shul-stats {
    max-width: 1200px;
    margin: 32px auto 0;
    padding-inline: 32px;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
  }
  .shul-stat {
    background: var(--white);
    border-radius: 16px;
    padding: 22px;
    border: 1px solid var(--gray-100);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
    transition: transform 160ms ease, box-shadow 160ms ease;
  }
  .shul-stat:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.06);
  }
  .shul-stat-icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: var(--blue-50);
    color: var(--blue-700);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 12px;
  }
  .shul-stat-v {
    font-size: 26px;
    font-weight: 900;
    color: var(--gray-900);
    font-feature-settings: 'tnum';
    letter-spacing: -0.5px;
    line-height: 1;
  }
  .shul-stat-l {
    font-size: 12px;
    color: var(--gray-500);
    margin-top: 6px;
    font-weight: 500;
  }

  /* ── Tabs row ───────────────────────────────────────────────── */
  .shul-tabs {
    max-width: 1200px;
    margin: 36px auto 0;
    padding-inline: 32px;
    display: flex;
    gap: 28px;
    border-bottom: 1px solid var(--gray-200);
  }
  .shul-tab {
    background: none;
    border: 0;
    padding: 16px 0;
    cursor: pointer;
    font-size: 14px;
    font-weight: 700;
    font-family: inherit;
    color: var(--gray-500);
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    transition: color 120ms ease, border-color 120ms ease;
  }
  .shul-tab:hover { color: var(--gray-700); }
  .shul-tab[aria-selected="true"] {
    color: var(--blue-700);
    border-bottom-color: var(--blue-700);
  }

  /* ── Content grid: main + sticky right rail ────────────────── */
  .shul-body {
    max-width: 1200px;
    margin: 28px auto 80px;
    padding-inline: 32px;
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 36px;
    align-items: start;
  }
  .shul-body > div:first-child { min-width: 0; }
  .shul-body > aside {
    position: sticky;
    top: 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
  }

  /* Right-rail cards */
  .about-card,
  .contact-card {
    background: var(--white);
    border: 1px solid var(--gray-100);
    border-radius: 16px;
    padding: 22px;
    margin: 0 !important;
  }
  .about-card .eyebrow,
  .contact-card .eyebrow {
    font-size: 11px;
    font-weight: 700;
    color: var(--blue-600);
    text-transform: uppercase;
    letter-spacing: 1.4px;
    margin-bottom: 14px;
  }
  .contact-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 0;
    font-size: 13px;
    color: var(--gray-700);
    border-top: 1px solid var(--gray-100);
  }
  .contact-row:first-of-type { border-top: 0; padding-top: 0; }
  .contact-row i { color: var(--gray-500); flex-shrink: 0; }

  /* "About rows" inside the card */
  #about-rows > * {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    padding: 8px 0;
    font-size: 13px;
    border-top: 1px solid var(--gray-100);
  }
  #about-rows > *:first-child { border-top: 0; padding-top: 0; }

  /* JGive-style shul card — replaces the cover hero on desktop */
  .shul-aside-card {
    background: #fff;
    border: 1px solid var(--gray-100);
    border-radius: 20px;
    padding: 28px 24px 22px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
  }
  .sac-crest {
    width: 116px;
    height: 116px;
    border-radius: 999px;
    background: linear-gradient(135deg, #FEF3C7, #FBF6EE);
    color: var(--blue-700);
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--gray-100);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.04);
    overflow: hidden;
    margin-bottom: 18px;
  }
  .sac-crest img { width: 100%; height: 100%; object-fit: cover; }
  .sac-name {
    font-size: 22px;
    font-weight: 900;
    color: var(--gray-900);
    letter-spacing: -0.5px;
    line-height: 1.2;
    margin: 0 0 8px;
  }
  .sac-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-size: 13px;
    color: var(--gray-600);
    margin-bottom: 10px;
  }
  .sac-meta i { color: var(--gray-400); }
  .sac-meta .dot { width: 3px; height: 3px; border-radius: 999px; background: var(--gray-300); }
  .sac-amuta,
  .sac-donors {
    font-size: 13px;
    color: var(--gray-600);
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
  }
  .sac-amuta i,
  .sac-donors i { color: var(--gray-400); width: 13px; height: 13px; }
  .sac-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: center;
    margin: 14px 0 18px;
  }
  .sac-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 5px 11px;
    background: #ECFDF5;
    color: #047857;
    border-radius: 999px;
    font-size: 11.5px;
    font-weight: 700;
  }
  .sac-tag i { width: 11px; height: 11px; }
  .sac-bit {
    width: 100%;
    padding: 10px;
    background: #033540;
    border: 0;
    border-radius: 999px;
    cursor: pointer;
    font-family: inherit;
    margin-bottom: 10px;
    transition: filter 160ms ease, transform 160ms ease;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
  }
  .sac-bit img {
    height: 32px;
    width: auto;
    display: block;
    border-radius: 4px;
  }
  .sac-bit:hover { transform: translateY(-1px); filter: brightness(1.05); }
  .sac-donate {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 13px;
    background: linear-gradient(135deg, #D4A843, #92400E);
    color: #fff;
    border-radius: 999px;
    font-size: 15px;
    font-weight: 800;
    text-decoration: none;
    cursor: pointer;
    transition: transform 160ms ease, box-shadow 160ms ease;
    box-shadow: 0 6px 16px rgba(212, 168, 67, 0.3);
    box-sizing: border-box;
  }
  .sac-donate:hover { transform: translateY(-1px); box-shadow: 0 10px 22px rgba(212, 168, 67, 0.4); }
  .sac-socials {
    display: flex;
    gap: 8px;
    justify-content: center;
    margin-top: 16px;
  }
  .sac-soc {
    width: 36px;
    height: 36px;
    border-radius: 999px;
    background: #F8FAFC;
    color: var(--gray-600);
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    border: 0;
    cursor: pointer;
    font-family: inherit;
    transition: background 160ms ease, color 160ms ease;
  }
  .sac-soc:hover { background: var(--blue-50); color: var(--blue-700); }
  .shul-aside-card .rd-secondary {
    display: block;
    text-align: center;
    margin-top: 14px;
    font-size: 12.5px;
    color: var(--gray-500);
    text-decoration: underline;
    text-underline-offset: 3px;
  }
  .shul-aside-card .rd-secondary:hover { color: var(--gray-900); }

  /* Campaign cards: roomier on desktop */
  .section-block { padding: 0 !important; }
  .section-block .eyebrow {
    font-size: 11px;
    font-weight: 700;
    color: var(--blue-600);
    text-transform: uppercase;
    letter-spacing: 1.4px;
    margin-bottom: 16px;
  }
  .campaign-card {
    display: grid !important;
    grid-template-columns: 200px 1fr;
    gap: 22px;
    padding: 22px !important;
    background: var(--white);
    border-radius: 16px;
    border: 1px solid var(--gray-100);
    margin-bottom: 14px;
    transition: transform 160ms ease, box-shadow 160ms ease;
  }
  .campaign-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.06);
  }
  .campaign-banner {
    height: 130px !important;
    border-radius: 12px;
  }
  .campaign-body { padding: 0 !important; }
  .campaign-stats {
    grid-template-columns: 1fr 1fr;
  }

  /* ── Donor-wall preview band (after content) ────────────────── */
  .shul-donor-wall {
    background: linear-gradient(180deg, var(--white) 0%, #FFFBF0 100%);
    border-top: 1px solid var(--gray-100);
    padding: 56px 0;
  }
  .shul-donor-wall-inner {
    max-width: 1200px;
    margin-inline: auto;
    padding-inline: 32px;
    text-align: center;
  }
  .shul-donor-wall-eyebrow {
    font-size: 11px;
    font-weight: 700;
    color: #B45309;
    text-transform: uppercase;
    letter-spacing: 1.6px;
    margin-bottom: 10px;
  }
  .shul-donor-wall-title {
    font-size: 28px;
    font-weight: 900;
    color: var(--gray-900);
    letter-spacing: -0.8px;
    margin: 0 0 8px;
  }
  .shul-donor-wall-sub {
    font-size: 14px;
    color: var(--gray-500);
    margin-bottom: 32px;
  }
  .shul-donor-wall-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 10px;
    margin-bottom: 24px;
  }
  .shul-donor-wall-name {
    padding: 14px 16px;
    background: var(--white);
    border: 1px solid rgba(212, 168, 67, 0.2);
    border-radius: 12px;
    font-size: 13px;
    font-weight: 700;
    color: var(--gray-900);
  }
  .shul-donor-wall-cta {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 18px;
    background: var(--white);
    color: var(--gray-900);
    border: 1px solid var(--gray-200);
    border-radius: 999px;
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
  }
  .shul-donor-wall-cta:hover { border-color: var(--gray-900); }

  /* Sticky bottom-bar belongs to mobile only */
  .bottom-bar { display: none !important; }
}

/* Wider desktop (≥1200px): more breathing room on the rail */
@media (min-width: 1200px) {
  .shul-body { grid-template-columns: 1fr 380px; gap: 48px; }
}

/* Mobile-only: hide desktop stat strip + tabs + sidebar */
@media (max-width: 899px) {
  .shul-stats, .shul-tabs, .contact-card, .shul-donor-wall { display: none !important; }
  /* The aside is a desktop-only rail — it "replaces the cover+identity hero on
     desktop". On mobile the hero + donate chips + sticky bar already cover all
     of this, and the rail's bit logo / layout is unstyled below 900px (its
     sizing rules live inside the min-width:900px block), so it renders a giant
     240px bit image and overflows the viewport. Hide the whole rail on mobile. */
  .shul-body > aside, .shul-aside-card { display: none !important; }
}

/* Defense-in-depth: the bit logo must never exceed its button, at any width. */
.sac-bit img { max-width: 100%; height: auto; }
