:root {
    --tenki-blue:  #005A9C;
    --tenki-green: #008C45;
    --tenki-black: #1A1A1A;
    --tenki-white: #FFFFFF;
    /* White-theme accents — matches deepdive-page.html's theme-white palette
       so the SOS pillar card on the homepage visually rhymes with the
       deep-dive page it links to.  Dark glyph + dashed cream-stroke accents
       (white-on-white would be invisible). */
    --tenki-white-dark:   #2A2A2A;
    --tenki-white-cream:  #FAF6EE;
    --tenki-white-stroke: #C0C5CC;
    --bg-light:    #F8F9FA;
    --text-dark:   #222222;
    --text-light:  #555555;
  }

  body { font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
         background-color: var(--tenki-white); margin: 0; padding: 20px; box-sizing: border-box; }
  *, *::before, *::after { box-sizing: inherit; }

  .infographic-container { max-width: 1200px; margin: 0 auto;
                           background-color: var(--bg-light); border-radius: 16px;
                           padding: 40px; box-shadow: 0 10px 30px rgba(0,0,0,.05); }

  .infographic-header { text-align: center; margin-bottom: 50px; }
  .infographic-header h2 { color: var(--tenki-black); font-size: 2.5rem;
                           margin: 0 0 15px; text-transform: uppercase;
                           letter-spacing: 1px; line-height: 1.2; }
  .infographic-header p { color: var(--text-light); font-size: 1.2rem;
                          max-width: 800px; margin: 0 auto; line-height: 1.6; }

  /* Loader / error */
  #loading-spinner { text-align: center; padding: 50px;
                     color: var(--tenki-blue); font-weight: bold; font-size: 1.2rem; }
  #loading-spinner.error { color: #b91c1c; }

  .pillars-wrapper { display: none;
                     grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr));
                     gap: 30px; align-items: start; }

  .pillar-card { background-color: var(--tenki-white); border-radius: 12px;
                 padding: 30px; border-top: 6px solid;
                 display: flex; flex-direction: column;
                 position: relative; cursor: pointer;  /* whole card is clickable */
                 transition: transform .4s cubic-bezier(0.175, 0.885, 0.32, 1.275),
                             box-shadow .4s ease, outline-color .2s ease; }
  .pillar-card:hover { transform: translateY(-4px);
                       box-shadow: 0 12px 30px rgba(0,0,0,.08); }
  .pillar-card:focus-visible { outline: 3px solid var(--tenki-blue); outline-offset: 4px; }
  /* Subtle chevron in the top-right indicates the card expands */
  .pillar-chevron { position: absolute; top: 18px; right: 18px;
                    width: 28px; height: 28px; border-radius: 50%;
                    display: flex; align-items: center; justify-content: center;
                    font-size: 14px; color: #888; background: rgba(0,0,0,.04);
                    transition: transform .35s ease, background .2s ease, color .2s ease;
                    pointer-events: none; /* clicks pass through to the card */ }
  .pillar-card:hover .pillar-chevron { background: rgba(0,0,0,.08); color: #444; }
  .pillar-card.is-expanded .pillar-chevron { transform: rotate(180deg); color: #444; }
  /* Subtle "click to expand" hint that fades out on hover */
  .pillar-click-hint { font-size: 10px; color: #999; text-align: center;
                       margin: 10px 0 -6px; letter-spacing: .5px;
                       text-transform: uppercase; font-weight: 600;
                       transition: opacity .2s ease; }
  .pillar-card.is-expanded .pillar-click-hint { opacity: 0; }
  .pillar-card:hover .pillar-click-hint { color: #555; }

  /* ── Smooth drawer using grid-template-rows: 0fr→1fr (no display:none hacks) ── */
  .pillar-expanded-drawer { display: grid; grid-template-rows: 0fr;
                            transition: grid-template-rows .4s ease, opacity .35s ease;
                            opacity: 0; margin-top: 0; }
  .pillar-expanded-drawer > .drawer-inner { overflow: hidden; min-height: 0; }
  .pillar-card.is-expanded .pillar-expanded-drawer {
    grid-template-rows: 1fr; opacity: 1;
    margin-top: 15px; border-top: 1px dashed #EAEAEA; padding-top: 20px;
  }

  /* Pillar themes */
  .card-blue  { border-top-color: var(--tenki-blue);
                background: linear-gradient(180deg, rgba(0,90,156,.04) 0%, rgba(255,255,255,1) 220px); }
  .card-blue .icon-wrapper       { background-color: var(--tenki-blue); }
  .card-blue .section-title      { color: var(--tenki-blue); }
  .card-blue .program-list li::before { color: var(--tenki-blue); }
  .card-blue .learn-more-btn     { background-color: var(--tenki-blue); color: var(--tenki-white); }
  .card-blue .learn-more-btn:hover { background-color: #004578; }
  .card-blue .explore-toggle-btn { background-color: #F0F4F8; color: var(--tenki-blue); }
  .card-blue .explore-toggle-btn:hover { background-color: #E1EBF5; }

  .card-green { border-top-color: var(--tenki-green);
                background: linear-gradient(180deg, rgba(0,140,69,.04) 0%, rgba(255,255,255,1) 220px); }
  .card-green .icon-wrapper       { background-color: var(--tenki-green); }
  .card-green .section-title      { color: var(--tenki-green); }
  .card-green .program-list li::before { color: var(--tenki-green); }
  .card-green .learn-more-btn     { background-color: var(--tenki-green); color: var(--tenki-white); }
  .card-green .learn-more-btn:hover { background-color: #006B34; }
  .card-green .explore-toggle-btn { background-color: #E8F5E9; color: var(--tenki-green); }
  .card-green .explore-toggle-btn:hover { background-color: #C8E6C9; }

  /* White theme — mirrors deepdive-page.html's theme-white palette so
     the SOS pillar card visually rhymes with its deep-dive landing page.
     Dashed cream-stroke top border, dark glyph on dark icon-wrapper
     (white-on-white would be invisible), dark button bg with white text. */
  .card-white { border-top: 6px dashed var(--tenki-white-stroke);
                background-color: #FDFCF8; }
  .card-white .icon-wrapper       { background-color: var(--tenki-white-dark); }
  .card-white .section-title      { color: var(--tenki-white-dark); }
  .card-white .program-list li::before { color: var(--tenki-white-dark); }
  .card-white .learn-more-btn     { background-color: var(--tenki-white-dark); color: var(--tenki-white); }
  .card-white .learn-more-btn:hover { background-color: #111; }
  .card-white .explore-toggle-btn { background-color: var(--tenki-white-cream); color: var(--tenki-white-dark); }
  .card-white .explore-toggle-btn:hover { background-color: #EFEAD8; }

  .card-black { border-top: 6px dashed var(--tenki-black);
                background: linear-gradient(180deg, rgba(26,26,26,.03) 0%, rgba(255,255,255,1) 220px); }
  .card-black .icon-wrapper       { background-color: var(--tenki-black); }
  .card-black .section-title      { color: var(--tenki-black); }
  .card-black .program-list li::before { color: var(--tenki-black); }
  .card-black .learn-more-btn     { background-color: var(--tenki-black); color: var(--tenki-white); }
  .card-black .learn-more-btn:hover { background-color: #333; }
  .card-black .explore-toggle-btn { background-color: #EEEEEE; color: var(--tenki-black); }
  .card-black .explore-toggle-btn:hover { background-color: #DDDDDD; }

  .card-header-flex { display: flex; justify-content: space-between;
                      align-items: center; min-height: 80px;
                      margin-bottom: 25px; gap: 15px; }
  .icon-wrapper { width: 80px; height: 80px; border-radius: 50%;
                  display: flex; align-items: center; justify-content: center;
                  font-size: 38px; color: var(--tenki-white); flex-shrink: 0;
                  box-shadow: 0 4px 10px rgba(0,0,0,.1);
                  transition: transform .4s cubic-bezier(0.175, 0.885, 0.32, 1.275); }
  .pillar-card:hover .icon-wrapper { transform: scale(1.08); }

  .status-badge { padding: 6px 12px; border-radius: 20px;
                  font-size: .72rem; font-weight: 700; text-transform: uppercase;
                  letter-spacing: .5px; text-align: center; display: inline-block;
                  max-width: 65%; line-height: 1.3; }
  .badge-active { background-color: #e8f5e9; color: var(--tenki-green); border: 1px solid #c8e6c9; }
  .badge-future { background-color: #eeeeee; color: var(--tenki-black); border: 1px solid #ccc; }

  .pillar-title { font-size: 1.4rem; color: var(--tenki-black);
                  margin: 0 0 15px; font-weight: 700; line-height: 1.3; }
  .pillar-subtitle { margin: -10px 0 15px; font-style: italic;
                     font-size: .95rem; color: var(--text-light); }

  .pillar-section { margin-bottom: 20px; width: 100%; }
  .section-title { font-weight: 700; text-transform: uppercase;
                   font-size: .9rem; letter-spacing: .5px; margin-bottom: 8px; }
  .pillar-text { font-size: .95rem; color: var(--text-light);
                 line-height: 1.6; margin: 0 0 10px; }

  .media-wrapper { width: 100%; height: 180px; margin: 10px 0 15px;
                   border-radius: 8px; overflow: hidden;
                   box-shadow: 0 2px 8px rgba(0,0,0,.05); background-color: #eaeaea; }
  .pillar-image, .pillar-video { width: 100%; height: 100%; object-fit: cover; }

  .program-list { list-style: none; padding: 0; margin: 0 0 15px; width: 100%; }
  .program-list li { font-size: .95rem; color: var(--text-light); line-height: 1.5;
                     margin-bottom: 12px; padding-left: 20px; position: relative; }
  .program-list li::before { content: '•'; position: absolute; left: 0;
                             font-size: 1.2rem; font-weight: bold; }
  .split-list { display: grid; grid-template-columns: 1fr 1fr; gap: 5px; margin-bottom: 15px; }

  .learn-more-btn { align-self: center; display: flex;
                    justify-content: center; align-items: center; gap: 8px;
                    margin: 25px auto 15px; padding: 14px 28px;
                    border-radius: 8px; text-decoration: none;
                    font-weight: 700; text-transform: uppercase;
                    font-size: .85rem; letter-spacing: .5px;
                    width: auto; min-width: 200px; max-width: 100%;
                    transition: background-color .2s ease, transform .2s ease; }
  .learn-more-btn::after { content: '→'; font-size: 1.1rem;
                           transition: transform .2s ease; margin-left: 4px; }
  .learn-more-btn:hover { transform: translateY(-2px); }
  .learn-more-btn:hover::after { transform: translateX(4px); }

  .explore-toggle-btn { align-self: center; width: auto;
                        min-width: 200px; max-width: 100%;
                        display: flex; justify-content: center; align-items: center;
                        margin-top: auto; padding: 14px 24px;
                        border-radius: 8px; border: none;
                        font-weight: 700; text-transform: uppercase;
                        font-size: .85rem; letter-spacing: .5px;
                        cursor: pointer;
                        transition: background-color .2s ease, transform .2s ease; }
  .explore-toggle-btn:hover { transform: translateY(-1px); }

  /* Funding boxes */
  .funding-container { display: none; gap: 20px; margin-top: 40px; }
  .funding-box { flex: 1; padding: 25px; border-radius: 12px;
                 display: flex; align-items: center; gap: 20px;
                 box-shadow: 0 4px 10px rgba(0,0,0,.03);
                 transition: transform .3s ease, box-shadow .3s ease;
                 text-decoration: none; }
  .funding-box:hover { transform: translateY(-3px); box-shadow: 0 8px 20px rgba(0,0,0,.06); }
  .funding-icon { font-size: 2.5rem; flex-shrink: 0; transition: transform .3s ease; }
  .funding-box:hover .funding-icon { transform: scale(1.1); }
  .funding-text h4 { margin: 0 0 5px; font-size: 1.1rem;
                     text-transform: uppercase; letter-spacing: .5px; }
  .funding-text p { margin: 0; font-size: .95rem; line-height: 1.5; }
  .funding-current { background-color: #eef5fb; border: 2px solid #b3d4f0; }
  .funding-current h4 { color: var(--tenki-blue); }
  .funding-current p { color: #2C4A68; }
  .funding-future  { background-color: #f5f5f5; border: 2px dashed #ccc; }
  .funding-future h4 { color: var(--tenki-black); }
  .funding-future p { color: var(--text-light); }

  /* ── Card extras ────────────────────────────────────────────────────────── */
  /* Subtle "recent activity" tag — same gentle styling for any pillar that has it. */
  .recent-activity-tag { display: inline-flex; align-items: center; gap: 4px;
                         font-size: .65rem; font-weight: 700; text-transform: uppercase;
                         letter-spacing: .5px; color: #166534;
                         background: #f0fdf4; border: 1px solid #bbf7d0;
                         padding: 2px 8px; border-radius: 10px;
                         margin: 4px 0 0; align-self: flex-start; }
  .recent-activity-dot { width: 6px; height: 6px; border-radius: 50%;
                         background: var(--tenki-green); animation: gentlePulse 2s ease-in-out infinite; }
  @keyframes gentlePulse { 0%, 100% { opacity: 1; } 50% { opacity: .4; } }

  .reading-time { font-size: .68rem; color: #888; margin: -4px 0 12px;
                  font-style: italic; padding-top: 12px;
                  border-top: 1px dashed rgba(0,0,0,.05); }

  /* ── Optional element-level links (Icon, Title, Section Title, Media …) ──
     When an editor sets an "X Link URL" field on the sheet, the matching
     element wraps in an <a>.  These styles keep the visual exactly the same
     as the non-linked version — no default underline, native colors — but
     reveal a small ↗ glyph on hover so users know it leads somewhere. */
  .pillar-elem-link { display: inline-block; color: inherit; text-decoration: none;
                      position: relative; transition: opacity .15s; }
  .pillar-elem-link:hover { opacity: .85; }
  .pillar-elem-link.link-heading::after,
  .pillar-elem-link.link-title::after { content: ' ↗'; font-size: .7em;
                                        opacity: 0; transition: opacity .15s;
                                        color: var(--tenki-blue); }
  .pillar-elem-link.link-heading:hover::after,
  .pillar-elem-link.link-title:hover::after { opacity: 1; }
  .pillar-elem-link.link-media { display: block; position: relative; cursor: pointer; }
  .pillar-elem-link.link-media::after {
    content: '↗'; position: absolute; top: 12px; right: 12px;
    width: 26px; height: 26px; border-radius: 50%;
    background: rgba(0,0,0,.55); color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-size: 13px; opacity: 0; transition: opacity .2s;
  }
  .pillar-elem-link.link-media:hover::after { opacity: 1; }
  .pillar-elem-link.link-icon { display: inline-block; border-radius: 50%; }
  .pillar-elem-link.link-icon:hover .icon-wrapper { transform: scale(1.12); }

  /* Share button in the top-right of each card (next to the chevron) */
  .share-btn { position: absolute; top: 18px; right: 54px;
               width: 28px; height: 28px; border-radius: 50%;
               background: rgba(0,0,0,.04); color: #666;
               border: none; cursor: pointer; padding: 0;
               display: flex; align-items: center; justify-content: center;
               transition: background .2s, color .2s, opacity .2s;
               opacity: .35; /* always faintly visible; brightens on hover */ }
  .pillar-card:hover .share-btn,
  .share-btn:focus-visible { opacity: 1; }
  .share-btn:hover { background: rgba(0,0,0,.08); color: var(--tenki-blue); }
  .share-btn.copied { background: var(--tenki-green); color: #fff; }
  .share-btn.copied svg { display: none; }
  .share-btn.copied::after { content: '✓'; font-size: 14px; font-weight: bold; }

  /* First-visit chevron pulse — auto-disables after first interaction */
  @keyframes chevronAttention {
    0%, 100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(0,90,156,0); }
    50%      { transform: scale(1.18); box-shadow: 0 0 0 6px rgba(0,90,156,.15); }
  }
  .pillar-card.first-visit-pulse .pillar-chevron { animation: chevronAttention 1.5s ease-in-out 2; }

  /* ── Image skeleton placeholder ─────────────────────────────────────────── */
  .pillar-image, .pillar-video { transition: opacity .4s ease; }
  .pillar-image:not(.loaded), .pillar-video:not(.loaded) { opacity: 0; }
  .media-wrapper { position: relative; }
  .media-wrapper.loading::before {
    content: ''; position: absolute; inset: 0;
    background: linear-gradient(90deg, #eaeaea 0%, #f3f4f6 50%, #eaeaea 100%);
    background-size: 200% 100%; animation: skeleton 1.4s ease-in-out infinite;
  }
  @keyframes skeleton { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

  /* ── Funding progress bar ───────────────────────────────────────────────── */
  .funding-progress { width: 100%; margin-top: 10px; }
  .funding-progress-bar { width: 100%; height: 8px; background: rgba(0,0,0,.06);
                          border-radius: 4px; overflow: hidden; }
  .funding-progress-fill { height: 100%; border-radius: 4px;
                           transition: width .6s ease; }
  .funding-current .funding-progress-fill { background: var(--tenki-blue); }
  .funding-future  .funding-progress-fill { background: #999; }
  .funding-progress-labels { display: flex; justify-content: space-between;
                             font-size: .7rem; margin-top: 4px;
                             font-weight: 600; }
  .funding-current .funding-progress-labels { color: #2C4A68; }
  .funding-future  .funding-progress-labels { color: var(--text-light); }

  /* ── Inline donation/embed iframe ───────────────────────────────────────── */
  .funding-embed { width: 100%; margin-top: 14px; border: none;
                   border-radius: 8px; background: #fff;
                   min-height: 240px; }

  /* ── Newsletter banner (after engagement threshold) ─────────────────────── */
  #newsletter-banner { display: none; max-width: 1200px; margin: 30px auto 0;
                       background: #fff; border-radius: 12px; padding: 28px;
                       box-shadow: 0 4px 20px rgba(0,0,0,.08);
                       border-top: 4px solid var(--tenki-blue);
                       position: relative; }
  #newsletter-banner.show { display: block; animation: bannerSlide .5s ease-out; }
  @keyframes bannerSlide { from { opacity: 0; transform: translateY(20px); }
                            to   { opacity: 1; transform: translateY(0); } }
  #newsletter-banner h3 { margin: 0 0 8px; font-size: 1.2rem; color: var(--tenki-black);
                          text-transform: uppercase; letter-spacing: .5px; }
  #newsletter-banner p { margin: 0 0 14px; color: var(--text-light);
                         font-size: .95rem; line-height: 1.5; }
  #newsletter-close { position: absolute; top: 10px; right: 14px;
                      background: none; border: none; cursor: pointer;
                      font-size: 18px; color: #999; line-height: 1; padding: 4px 8px; }
  #newsletter-close:hover { color: var(--tenki-black); }

  /* Honor user system setting — turn off the bouncy/parallax transitions */
  @media (prefers-reduced-motion: reduce) {
    .pillar-card, .pillar-card:hover, .icon-wrapper, .funding-box,
    .pillar-chevron, .pillar-expanded-drawer, .funding-icon {
      transition: none !important; transform: none !important; animation: none !important;
    }
    html { scroll-behavior: auto !important; }
  }
  html { scroll-behavior: smooth; } /* used by deep-link + scroll-into-view */

  @media (max-width: 900px) { .funding-container { flex-direction: column; } }
  @media (max-width: 768px) {
    body { padding: 10px; }
    .infographic-container { padding: 25px 15px; }
    .infographic-header { margin-bottom: 35px; }
    .infographic-header h2 { font-size: 1.8rem; }
    .infographic-header p  { font-size: 1rem; }
    .pillar-card  { padding: 20px; }
    .pillar-title { font-size: 1.25rem; }
    .card-header-flex { height: auto; flex-direction: row;
                        justify-content: space-between; margin-bottom: 15px; }
    .status-badge { max-width: 100%; }
    .icon-wrapper { width: 65px; height: 65px; font-size: 30px; }
    .funding-box  { flex-direction: column; text-align: center; padding: 20px; gap: 10px; }
    .split-list   { grid-template-columns: 1fr; }
  }