/* One viewport-sized image behind public shells and all decorated pages.
   A fixed layer avoids stretching the illustration to the document height. */
@media screen {
  html[data-public-nature]::before,
  html[data-nature-background][data-mode]::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background: var(--vf-surface-page) url("/static/public-nature/landscape.webp") center bottom / cover no-repeat;
  }

  html[data-nature-background][data-mode="dark"]::before {
    background-color: var(--vf-surface-page);
    background-image: linear-gradient(color-mix(in srgb,var(--vf-surface-page) 88%,transparent), color-mix(in srgb,var(--vf-surface-page) 68%,transparent)), url("/static/public-nature/landscape.webp");
  }

  /* Private light pages retain their pale canvas over the existing landscape.
     Public light pages keep their established, unfiltered illustration. */
  html[data-nature-background][data-mode="light"]:not([data-public-nature])::before {
    background-image: linear-gradient(color-mix(in srgb,var(--vf-surface-page) 40%,transparent), color-mix(in srgb,var(--vf-surface-page) 72%,transparent)), url("/static/public-nature/landscape.webp");
  }

  /* Match the complete appearance.css body contract plus the shared marker:
     its opaque canvas otherwise paints over the fixed landscape. */
  html[data-appearance="v1"][data-nature-background][data-mode] body,
  html[data-appearance="v1"][data-nature-background][data-mode] body:is(#vf-app,#vf-public,#vf-staff,:has(>main.pair-page),.vf-demo-start):not(.public-shell),
  html[data-appearance="v1"][data-nature-background][data-mode] body:is(#vf-app,#vf-public,#vf-staff):is(.vf-shell.public-shell,.ui-2026.vf-shell.vf-clean,.staff-shell,.admin-login-shell) {
    background: transparent !important;
    min-block-size: 100vh;
    min-block-size: 100dvh;
  }

  html[data-appearance="v1"][data-public-nature][data-mode] body:is(#vf-app,#vf-public,.public-shell).public-shell {
    background: transparent !important;
    min-block-size: 100vh;
    min-block-size: 100dvh;
  }

  /* The landing hero and login main previously painted independent copies. */
  html[data-public-nature][data-mode] body#vf-public.public-shell.vf-public-clean.public-showcase-page main .showcase-hero,
  html[data-public-nature][data-mode] body#vf-app.public-shell.vf-public-clean:has(> main > .public-login-nature) > main {
    background: transparent !important;
  }

  /* Give content that used to sit on the flat canvas a paired reading surface. */
  html[data-appearance="v1"][data-public-nature][data-mode] body:is(#vf-app,#vf-public).public-shell :is(
    .hero-grid > .copy, .auth-welcome, .news-intro, .legal-page > .page-head
  ) {
    background: var(--vf-surface) !important;
    border-radius: 1rem;
    padding: clamp(.75rem, 2vw, 1.25rem) !important;
  }

  html[data-appearance="v1"][data-public-nature][data-mode] body:is(#vf-app,#vf-public).public-shell :is(
    .privacy-page-hero, .privacy-answer, .news-date
  ) {
    background: var(--vf-surface) !important;
  }

  html[data-public-nature] .news-date {
    align-self: start;
    border-radius: .75rem;
    padding: .5rem;
  }

  html[data-appearance="v1"][data-public-nature][data-mode] body:is(#vf-app,#vf-public).public-shell .vf-appearance-footer {
    background: transparent !important;
  }

  html[data-public-nature] body.public-shell .vf-appearance-footer .vf-appearance-control {
    background: var(--vf-surface) !important;
    border-radius: .75rem;
    padding: .625rem !important;
  }

  /* Public footers follow appearance in DOM order. Spare space precedes the
     controls on short pages; existing main content keeps its position. */
  html[data-appearance="v1"][data-public-nature][data-public-page-footer][data-mode] body:is(#vf-app,#vf-public).public-shell {
    display: flex !important;
    flex-direction: column !important;
  }

  html[data-appearance="v1"][data-public-nature][data-public-page-footer][data-mode] body:is(#vf-app,#vf-public).public-shell > .vf-appearance-footer {
    margin-block-start: auto !important;
    padding-block-end: 20px !important;
  }

  html[data-public-page-footer] body.public-shell > :is(.site-footer,.news-footer,.footer) {
    margin-block-end: 0 !important;
  }
}

@media (forced-colors: active) {
  html[data-public-nature]::before,
  html[data-nature-background][data-mode]::before {
    content: none;
  }
}

/* Keep public privacy prose and optional audio on a calm reading surface. */
html[data-public-nature] body.public-shell .secondary-page.privacy-page {
  background: var(--vf-surface, Canvas);
  border-radius: 18px;
  padding: clamp(16px,3vw,32px);
}
html[data-public-nature] body#vf-public.public-shell .privacy-page > .vf-audio-intro {
  background: var(--vf-surface, Canvas) !important;
  border: 1px solid var(--vf-border, GrayText);
  border-radius: 18px;
}
@media (max-width: 600px) {
  html body.public-shell .storage-info h1 {font-size:1.6rem!important;line-height:1.18!important;overflow-wrap:normal!important;}
  html body.public-shell .storage-info .storage-table-wrap {overflow:visible;max-width:100%;background:transparent!important;}
  html body.public-shell .storage-info .storage-table-wrap table,
  html body.public-shell .storage-info .storage-table-wrap tbody,
  html body.public-shell .storage-info .storage-table-wrap tr {display:block;min-width:0;width:100%;}
  html body.public-shell .storage-info .storage-table-wrap thead {position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap;}
  html body.public-shell .storage-info .storage-table-wrap tr {margin:0 0 12px;border:1px solid var(--vf-border,GrayText);border-radius:12px;overflow:hidden;background:var(--vf-surface,Canvas);}
  html body.public-shell .storage-info .storage-table-wrap :is(table,tbody) {background:transparent!important;}
  html[data-mode="dark"][data-appearance="v1"] body#vf-app.public-shell .storage-info .storage-table-wrap tbody {background:var(--vf-surface,Canvas)!important;}
  html body.public-shell .storage-info .storage-table-wrap td {display:block;width:100%;min-width:0;padding:8px 12px;overflow-wrap:anywhere;white-space:normal;}
  html body.public-shell .storage-info .storage-table-wrap td + td {border-top:1px solid var(--vf-border,GrayText);}
  html body.public-shell .storage-info .storage-table-wrap td::before {display:block;font-weight:750;margin-bottom:2px;}
  html:is([lang="no"],[lang="nb"]) body.public-shell .storage-info td:nth-child(1)::before {content:"Navn";}
  html:is([lang="no"],[lang="nb"]) body.public-shell .storage-info td:nth-child(2)::before {content:"Formål";}
  html:is([lang="no"],[lang="nb"]) body.public-shell .storage-info td:nth-child(3)::before {content:"Varighet";}
  html:is([lang="no"],[lang="nb"]) body.public-shell .storage-info td:nth-child(4)::before {content:"Valgfritt?";}
  html[lang="en"] body.public-shell .storage-info td:nth-child(1)::before {content:"Name";}
  html[lang="en"] body.public-shell .storage-info td:nth-child(2)::before {content:"Purpose";}
  html[lang="en"] body.public-shell .storage-info td:nth-child(3)::before {content:"Duration";}
  html[lang="en"] body.public-shell .storage-info td:nth-child(4)::before {content:"Optional?";}
}
