/* WICHF V3-R4 layered visual authority finalization.
 * Static museum/space atmosphere is procedural design; object and Earth pixels remain governed/live.
 */

@media (min-width: 1100px) {
  html[data-v3-r4] .ex-page .ex-hero:where(:not([data-wichf-shell], [data-wichf-shell] *))::after {
    background:
      radial-gradient(ellipse 26% 48% at 25% 14%, rgba(229, 207, 166, .045), transparent 76%),
      linear-gradient(90deg, #161e1a 0%, #141d19 31%, rgba(13, 25, 21, .88) 46%, rgba(5, 17, 12, .28) 66%, rgba(5, 17, 12, .12));
  }

  html[data-v3-r4] .ex-page .ex-hero__portal:where(:not([data-wichf-shell], [data-wichf-shell] *)) {
    isolation: isolate;
    background:
      radial-gradient(ellipse 28% 42% at 48% 4%, rgba(239, 218, 176, .27), transparent 72%),
      radial-gradient(ellipse 20% 35% at 78% 11%, rgba(216, 184, 124, .14), transparent 76%),
      radial-gradient(ellipse 30% 30% at 49% 82%, rgba(212, 174, 107, .12), transparent 70%),
      linear-gradient(90deg, rgba(0,0,0,.24), transparent 18%, transparent 83%, rgba(0,0,0,.25)),
      linear-gradient(180deg, #17241f 0%, #101d18 57%, #07110e 76%, #020807 100%);
  }

  html[data-v3-r4] .ex-page .ex-hero__portal:where(:not([data-wichf-shell], [data-wichf-shell] *))::after {
    position: absolute;
    z-index: 0;
    inset: 0;
    background:
      repeating-linear-gradient(93deg, rgba(255,255,255,.008) 0 1px, transparent 1px 8px),
      repeating-linear-gradient(2deg, rgba(0,0,0,.016) 0 1px, transparent 1px 7px),
      radial-gradient(ellipse 19% 48% at 47% 0%, rgba(236,214,174,.12), transparent 75%);
    mix-blend-mode: screen;
    opacity: .72;
    content: "";
    pointer-events: none;
  }

  html[data-v3-r4] .ex-page .ex-hero__portal:where(:not([data-wichf-shell], [data-wichf-shell] *))::before {
    z-index: 0;
    right: -3%;
    bottom: 0;
    left: -3%;
    height: 146px;
    background:
      linear-gradient(176deg, transparent 0 19%, rgba(219,183,117,.12) 20%, rgba(28,36,30,.72) 28%, rgba(5,10,8,.96) 100%),
      repeating-linear-gradient(93deg, transparent 0 120px, rgba(224,190,129,.04) 121px, transparent 123px);
    box-shadow: inset 0 22px 32px rgba(0,0,0,.38);
    transform: perspective(360px) rotateX(4deg);
    transform-origin: bottom;
  }

  html[data-v3-r4] .ex-page .ex-portal-work:where(:not([data-wichf-shell], [data-wichf-shell] *)) { filter: drop-shadow(0 22px 18px rgba(0,0,0,.42)); }
  html[data-v3-r4] .ex-page .ex-portal-work img:where(:not([data-wichf-shell], [data-wichf-shell] *)) {
    box-sizing: border-box;
    border: 7px solid #263129;
    outline: 1px solid rgba(221,190,133,.42);
    outline-offset: -4px;
    background: #101713;
    box-shadow: 0 22px 42px rgba(0,0,0,.58), 0 0 34px rgba(214,181,120,.08);
  }
  html[data-v3-r4] .ex-page .ex-portal-work--1 img:where(:not([data-wichf-shell], [data-wichf-shell] *)) { padding: 5px; object-fit: contain; }
  html[data-v3-r4] .ex-page .ex-portal-work--2 > span:where(:not([data-wichf-shell], [data-wichf-shell] *)),
  html[data-v3-r4] .ex-page .ex-portal-work--4 > span:where(:not([data-wichf-shell], [data-wichf-shell] *)),
  html[data-v3-r4] .ex-page .ex-portal-work--5 > span:where(:not([data-wichf-shell], [data-wichf-shell] *)) {
    background: linear-gradient(145deg, rgba(20,38,31,.98), rgba(7,20,16,.98));
    border-color: rgba(217,181,115,.34);
    box-shadow: 0 18px 28px rgba(0,0,0,.42), inset 0 1px rgba(255,255,255,.025);
  }

  html[data-v3-r4] .ex-page .ex-curatorial:where(:not([data-wichf-shell], [data-wichf-shell] *)) {
    background-color: #d8c9b1;
    background-image:
      radial-gradient(circle at 18% 34%, rgba(255,255,255,.06), transparent 28%),
      radial-gradient(circle at 78% 66%, rgba(112,82,45,.055), transparent 35%),
      repeating-linear-gradient(0deg, rgba(74,54,33,.022) 0 1px, transparent 1px 5px);
  }

  html[data-v3-r4] .ex-page .ex-browser:where(:not([data-wichf-shell], [data-wichf-shell] *)),
  html[data-v3-r4] .ex-page .ex-filter:where(:not([data-wichf-shell], [data-wichf-shell] *)) {
    background-color: #131c18;
    background-image: radial-gradient(ellipse at 50% 0%, rgba(207,169,102,.035), transparent 42%);
  }
  html[data-v3-r4] .ex-page .ex-work:where(:not([data-wichf-shell], [data-wichf-shell] *)) {
    border-color: rgba(207,169,102,.62);
    background: linear-gradient(180deg, #0b1915, #0d1d18);
    box-shadow: inset 0 0 24px rgba(0,0,0,.16);
  }
  html[data-v3-r4] .ex-page .ex-work__media:where(:not([data-wichf-shell], [data-wichf-shell] *)) {
    background: radial-gradient(ellipse at 50% 42%, #192620, #091713 72%);
  }
  html[data-v3-r4] .ex-page .ex-work__label:where(:not([data-wichf-shell], [data-wichf-shell] *)) { background: linear-gradient(180deg, #14201b, #101a16); }
  html[data-v3-r4] .ex-page .ex-sequence > .ex-shell:where(:not([data-wichf-shell], [data-wichf-shell] *)) {
    grid-template-columns: repeat(4, 248px);
    column-gap: 11px;
    row-gap: 13px;
    transform: translateX(-3px);
  }
  html[data-v3-r4] .ex-page .ex-work:where(:not([data-wichf-shell], [data-wichf-shell] *)) {
    min-height: 199px;
    height: 199px;
  }

  html[lang="zh-CN"][data-v3-r4] .ex-page .ex-hero__copy h1:where(:not([data-wichf-shell], [data-wichf-shell] *)) {
    width: 127%;
    font-size: 6.4rem;
    transform: translate(-3px, 2px) scaleX(.71);
    transform-origin: left center;
  }

  html[data-page-id="global-heritage-map"][data-v3-r4] .global-heritage-hero h1:where(:not([data-wichf-shell], [data-wichf-shell] *)) {
    width: 150%;
    font-size: 6.2rem;
    transform: scaleX(.81);
    transform-origin: left center;
  }
  html[data-page-id="global-heritage-map"][data-v3-r4] .global-heritage-hero__network:where(:not([data-wichf-shell], [data-wichf-shell] *)) {
    opacity: .22;
    filter: sepia(.5) saturate(.9) brightness(.52) hue-rotate(351deg);
  }
  html[data-page-id="global-heritage-map"][data-v3-r4] .heritage-map-stage:where(:not([data-wichf-shell], [data-wichf-shell] *)) {
    isolation: isolate;
    background:
      radial-gradient(circle at 11% 18%, rgba(132,196,203,.09), transparent 22%),
      radial-gradient(circle at 86% 19%, rgba(215,164,87,.08), transparent 18%),
      linear-gradient(#010b0e, #020f12);
  }
  html[data-page-id="global-heritage-map"][data-v3-r4] .heritage-map-stage:where(:not([data-wichf-shell], [data-wichf-shell] *))::before {
    opacity: .3;
    background:
      radial-gradient(circle at 18% 17%, rgba(255,255,255,.32) 0 1px, transparent 1.5px),
      radial-gradient(circle at 82% 29%, rgba(212,168,96,.34) 0 1px, transparent 1.7px),
      radial-gradient(circle at 69% 8%, rgba(255,255,255,.22) 0 1px, transparent 1.4px),
      linear-gradient(rgba(1,12,14,.32), rgba(1,12,14,.48)),
      url("/assets/media/about/about_global_network_v1.png") center / cover no-repeat;
  }
  html[data-page-id="global-heritage-map"][data-v3-r4] .heritage-map-stage:where(:not([data-wichf-shell], [data-wichf-shell] *))::after {
    position: absolute;
    z-index: 2;
    inset: 0;
    background:
      radial-gradient(circle at 78% 16%, rgba(255,239,195,.52) 0 2px, rgba(236,170,83,.22) 3px, transparent 34px),
      radial-gradient(ellipse 39% 54% at 50% 54%, transparent 75%, rgba(117,220,222,.12) 84%, transparent 91%);
    mix-blend-mode: screen;
    content: "";
    pointer-events: none;
  }
  html[data-page-id="global-heritage-map"][data-v3-r4] .heritage-map-fallback:where(:not([data-wichf-shell], [data-wichf-shell] *)),
  html[data-page-id="global-heritage-map"][data-v3-r4] .heritage-map-canvas:where(:not([data-wichf-shell], [data-wichf-shell] *)) { z-index: 1; }
  html[data-page-id="global-heritage-map"][data-v3-r4] .heritage-map-tools:where(:not([data-wichf-shell], [data-wichf-shell] *)),
  html[data-page-id="global-heritage-map"][data-v3-r4] .heritage-map-status:where(:not([data-wichf-shell], [data-wichf-shell] *)),
  html[data-page-id="global-heritage-map"][data-v3-r4] .heritage-map-instructions:where(:not([data-wichf-shell], [data-wichf-shell] *)) { z-index: 4; }
}

@media (max-width: 1099px) {
  html[data-v3-r4] .ex-page .ex-hero__portal:where(:not([data-wichf-shell], [data-wichf-shell] *)),
  html[data-page-id="global-heritage-map"][data-v3-r4] .heritage-map-stage:where(:not([data-wichf-shell], [data-wichf-shell] *)) {
    background-color: #061713;
  }
}

/* PCF accessibility: retain the approved presentation while meeting WCAG AA contrast. */
html[data-page-id="home"][data-v3-r4] [data-i18n-key="discovery_eyebrow"]:where(:not([data-wichf-shell], [data-wichf-shell] *)),
html[data-page-id="home"][data-v3-r4] [data-i18n-key="activity_eyebrow"]:where(:not([data-wichf-shell], [data-wichf-shell] *)),
html[data-page-id="home"][data-v3-r4] [data-i18n-key="trace_eyebrow"]:where(:not([data-wichf-shell], [data-wichf-shell] *)),
html[data-page-id="home"][data-v3-r4] [data-i18n-key="updates_eyebrow"]:where(:not([data-wichf-shell], [data-wichf-shell] *)),
html[data-page-id="home"][data-v3-r4] [data-i18n-key^="more_"][data-i18n-key$="_type"]:where(:not([data-wichf-shell], [data-wichf-shell] *)) { color: #72501f !important; }

html[data-v3-r4-r1] .ex-page .button:where(:not([data-wichf-shell], [data-wichf-shell] *)),
html[data-v3-r4-r1] .ex-page .button--gold:where(:not([data-wichf-shell], [data-wichf-shell] *)) { color: #173229 !important; }
html[data-v3-r4-r1] .ex-page .ex-browser__heading .ex-eyebrow:where(:not([data-wichf-shell], [data-wichf-shell] *)) { color: #d8bd87 !important; }

html[data-page-id="global-heritage-map"][data-v3-r4] button[data-mode-list]:where(:not([data-wichf-shell], [data-wichf-shell] *)) { color: #533b18 !important; }
html[data-page-id="global-heritage-map"][data-v3-r4] .heritage-discovery-card__number:where(:not([data-wichf-shell], [data-wichf-shell] *)),
html[data-page-id="global-heritage-map"][data-v3-r4] .heritage-related__grid a > span:where(:not([data-wichf-shell], [data-wichf-shell] *)) { color: #e1c491 !important; }

html[data-page-id="about"][data-v3-r4] .s3-glance__layout .s3-section-heading .s3-eyebrow:where(:not([data-wichf-shell], [data-wichf-shell] *)),
html[data-page-id="about"][data-v3-r4] #why-wichf .s3-section-heading .s3-eyebrow:where(:not([data-wichf-shell], [data-wichf-shell] *)) { color: #70501c !important; }
