/* Generated by docs/home.mjs: the documentation homepage's interactive sections. */

/* Theme colours glide from one institution to the next: registered custom properties can be animated, so
   everything that uses them, the SVG drawing included, follows. */
@property --ggds-color-institution { syntax: '<color>'; inherits: true; initial-value: #005f8f; }
@property --ggds-color-institution-deep { syntax: '<color>'; inherits: true; initial-value: #005d8c; }
@media (prefers-reduced-motion: no-preference) {
  :root { transition: --ggds-color-institution .6s ease-out, --ggds-color-institution-deep .6s ease-out; }
}

/* One design system, every institution */
.home-theme {
  position: relative;
  padding: var(--ggds-space-8) 0;
  border-block: 1px solid var(--ggds-color-border-subtle);
  background:
    linear-gradient(90deg, var(--ggds-color-flag-red) 0 33.33%, var(--ggds-color-flag-gold) 33.33% 66.66%, var(--ggds-color-flag-green) 66.66%) top / 100% 3px no-repeat,
    radial-gradient(60rem 30rem at 100% 0%, color-mix(in srgb, var(--ggds-color-institution) 10%, transparent), transparent 70%);
}

.home-theme__grid {
  display: grid;
  gap: var(--ggds-space-8);
  align-items: center;
}

@media (min-width: 64rem) {
  .home-theme__grid { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); }
}

.home-theme__text h2 { margin-top: 0; font-size: var(--ggds-font-size-2xl); }

.home-theme__picker { margin: 0 0 var(--ggds-space-4); padding: 0; border: 0; min-width: 0; }

.home-theme__legend {
  margin-bottom: var(--ggds-space-3);
  font-weight: var(--ggds-font-weight-bold);
}

.home-theme__options { display: flex; flex-wrap: wrap; gap: var(--ggds-space-2); }

/* The radio stays in the page for keyboards and screen readers; its label is the chip. */
.home-theme__input {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: 0;
  opacity: 0;
}

.home-theme__chip {
  display: inline-flex;
  align-items: center;
  gap: var(--ggds-space-2);
  min-height: 44px;
  padding: 0 var(--ggds-space-4) 0 var(--ggds-space-2);
  border: 2px solid var(--ggds-color-border-strong);
  border-radius: var(--ggds-radius-pill);
  background: var(--ggds-color-surface);
  font-weight: var(--ggds-font-weight-bold);
  cursor: pointer;
}

.home-theme__chip:hover { border-color: var(--ggds-color-text); }

.home-theme__input:checked + .home-theme__chip {
  border-color: var(--ggds-color-text);
  background: var(--ggds-color-text);
  color: var(--ggds-color-text-inverse);
}

.home-theme__input:focus-visible + .home-theme__chip {
  outline: 3px solid var(--ggds-color-focus-ring);
  outline-offset: 2px;
  box-shadow: 0 0 0 2px var(--ggds-color-focus-halo);
}

.home-theme__dot {
  flex: none;
  width: 1.75rem;
  height: 1.75rem;
  border: 2px solid var(--ggds-color-surface);
  border-radius: 50%;
  box-shadow: 0 0 0 1px var(--ggds-color-border-strong);
}

.home-theme__now { min-height: 1.6em; margin: 0 0 var(--ggds-space-4); color: var(--ggds-color-text-muted); }
.home-theme__name { display: none; }
.home-theme__name code { margin-inline-start: var(--ggds-space-1); }

/* Without :has(), the picker cannot change the page; show the default's name. */
@supports not selector(:has(*)) {
  .home-theme__picker, .home-theme__now { display: none; }
}

.home-theme__demo { perspective: 1200px; }

.home-theme__preview {
  box-shadow: var(--ggds-shadow-2);
}

@media (prefers-reduced-motion: no-preference) and (min-width: 64rem) {
  .home-theme__preview { transform: rotateY(-8deg) rotateX(3deg); transition: transform .4s ease-out; }
  .home-theme__demo:hover .home-theme__preview { transform: none; }
}

.home-theme__preview .docs-theme__body .ggds-button { pointer-events: none; }
.home-theme__link { color: var(--ggds-color-link); text-decoration: underline; text-underline-offset: .15em; }

/* See it work */
.home-work__grid { display: grid; gap: var(--ggds-space-6); }

@media (min-width: 64rem) {
  .home-work__grid { grid-template-columns: minmax(0, 4fr) minmax(0, 8fr); align-items: start; }
}

.home-work__item {
  min-width: 0;
  padding: var(--ggds-space-6);
  border: 1px solid var(--ggds-color-border-subtle);
  border-radius: var(--ggds-radius-lg);
  background: var(--ggds-color-surface-sunken);
}

.home-work__item > h3 { margin-top: 0; }

.home-try__card {
  padding: var(--ggds-space-4);
  border-radius: var(--ggds-radius-md);
  background: var(--ggds-color-surface);
  box-shadow: var(--ggds-shadow-1);
}

.home-try__card .ggds-input { max-width: 100%; }
.home-try__card .ggds-button { margin-bottom: 0; }
.home-try__screen > :last-child { margin-bottom: 0; }

@media (prefers-reduced-motion: no-preference) {
  .home-try__screen:not([hidden]) { animation: home-in .3s ease-out; }
  @keyframes home-in { from { opacity: 0; transform: translateY(6px); } }
}

/* Same page, any screen */
.home-screens__controls {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: var(--ggds-space-4);
  margin-bottom: var(--ggds-space-4);
}

.home-screens__controls[hidden] { display: none; }

.home-screens__slider { flex: 1 1 14rem; }
.home-screens__slider .ggds-label { margin-bottom: var(--ggds-space-1); }
.home-screens__range { width: 100%; min-height: 44px; accent-color: var(--ggds-color-link); }
.home-screens__out { display: block; font-variant-numeric: tabular-nums; color: var(--ggds-color-text-muted); }

.home-screens__presets { display: flex; flex-wrap: wrap; gap: var(--ggds-space-2); }

.home-screens__preset {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  min-height: 44px;
  padding: var(--ggds-space-1) var(--ggds-space-3);
  border: 2px solid var(--ggds-color-border-strong);
  border-radius: var(--ggds-radius-md);
  background: var(--ggds-color-surface);
  color: var(--ggds-color-text);
  font: inherit;
  font-weight: var(--ggds-font-weight-bold);
  line-height: 1.2;
  cursor: pointer;
}

.home-screens__preset[aria-pressed="true"] { border-color: var(--ggds-color-text); background: var(--ggds-color-text); color: var(--ggds-color-text-inverse); }
.home-screens__px { font-size: var(--ggds-font-size-xs); font-weight: 400; }

.home-screens__stage { overflow: hidden; }

.home-screens__device {
  width: 100%;
  margin-inline: auto;
  overflow: hidden;
  border: 1px solid var(--ggds-color-border-strong);
  border-radius: var(--ggds-radius-lg);
  background: var(--ggds-color-surface);
  box-shadow: var(--ggds-shadow-2);
  transform-origin: top left;
}

@media (prefers-reduced-motion: no-preference) {
  .home-screens__device { transition: width .25s ease-out, transform .25s ease-out; }
}

.home-screens__bar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: var(--ggds-space-2) var(--ggds-space-3);
  border-bottom: 1px solid var(--ggds-color-border-subtle);
  background: var(--ggds-color-surface-sunken);
}

.home-screens__bar span { width: 10px; height: 10px; border-radius: 50%; background: var(--ggds-color-border-strong); }
.home-screens__bar code { margin-inline-start: auto; font-size: var(--ggds-font-size-xs); }

.home-screens__frame { display: block; width: 100%; height: 640px; border: 0; }

/* Generated by docs/home.mjs: the homepage's theme picker. */
:root:not([data-ggds-theme]):has(#home-theme-mocdti:checked) { --ggds-color-institution: #005f8f; --ggds-color-institution-deep: #005d8c; }
:root:has(#home-theme-mocdti:checked) .home-theme__name[data-theme="mocdti"] { display: inline; }
.home-theme__dot--mocdti { background: #005f8f; }
:root:not([data-ggds-theme]):has(#home-theme-csa:checked) { --ggds-color-institution: #222164; --ggds-color-institution-deep: #222164; }
:root:has(#home-theme-csa:checked) .home-theme__name[data-theme="csa"] { display: inline; }
.home-theme__dot--csa { background: #222164; }
:root:not([data-ggds-theme]):has(#home-theme-dpc:checked) { --ggds-color-institution: #1276bc; --ggds-color-institution-deep: #0e5c93; }
:root:has(#home-theme-dpc:checked) .home-theme__name[data-theme="dpc"] { display: inline; }
.home-theme__dot--dpc { background: #1276bc; }
:root:not([data-ggds-theme]):has(#home-theme-gdcl:checked) { --ggds-color-institution: #006e35; --ggds-color-institution-deep: #006732; }
:root:has(#home-theme-gdcl:checked) .home-theme__name[data-theme="gdcl"] { display: inline; }
.home-theme__dot--gdcl { background: #006e35; }
:root:not([data-ggds-theme]):has(#home-theme-gdnr:checked) { --ggds-color-institution: #1848f0; --ggds-color-institution-deep: #1744e2; }
:root:has(#home-theme-gdnr:checked) .home-theme__name[data-theme="gdnr"] { display: inline; }
.home-theme__dot--gdnr { background: #1848f0; }
:root:not([data-ggds-theme]):has(#home-theme-gifec:checked) { --ggds-color-institution: #003f87; --ggds-color-institution-deep: #003f87; }
:root:has(#home-theme-gifec:checked) .home-theme__name[data-theme="gifec"] { display: inline; }
.home-theme__dot--gifec { background: #003f87; }
:root:not([data-ggds-theme]):has(#home-theme-gmet:checked) { --ggds-color-institution: #21438c; --ggds-color-institution-deep: #21438c; }
:root:has(#home-theme-gmet:checked) .home-theme__name[data-theme="gmet"] { display: inline; }
.home-theme__dot--gmet { background: #21438c; }
:root:not([data-ggds-theme]):has(#home-theme-gpcl:checked) { --ggds-color-institution: #0c075b; --ggds-color-institution-deep: #0c075b; }
:root:has(#home-theme-gpcl:checked) .home-theme__name[data-theme="gpcl"] { display: inline; }
.home-theme__dot--gpcl { background: #0c075b; }
:root:not([data-ggds-theme]):has(#home-theme-gi-kace:checked) { --ggds-color-institution: #0808af; --ggds-color-institution-deep: #0808af; }
:root:has(#home-theme-gi-kace:checked) .home-theme__name[data-theme="gi-kace"] { display: inline; }
.home-theme__dot--gi-kace { background: #0808af; }
:root:not([data-ggds-theme]):has(#home-theme-nca:checked) { --ggds-color-institution: #061f45; --ggds-color-institution-deep: #061f45; }
:root:has(#home-theme-nca:checked) .home-theme__name[data-theme="nca"] { display: inline; }
.home-theme__dot--nca { background: #061f45; }
:root:not([data-ggds-theme]):has(#home-theme-nita:checked) { --ggds-color-institution: #00342b; --ggds-color-institution-deep: #00342b; }
:root:has(#home-theme-nita:checked) .home-theme__name[data-theme="nita"] { display: inline; }
.home-theme__dot--nita { background: #00342b; }
:root:not([data-ggds-theme]):has(#home-theme-pcsrc:checked) { --ggds-color-institution: #ca0a15; --ggds-color-institution-deep: #b20912; }
:root:has(#home-theme-pcsrc:checked) .home-theme__name[data-theme="pcsrc"] { display: inline; }
.home-theme__dot--pcsrc { background: #ca0a15; }

/* The story, told as people scroll: the preview takes on one institution's colours after another while its button
   and link stay exactly the same, as the words beside it say, and the chip of each institution grows while its
   colours are shown. Only the preview changes, never the page around it. It jumps from one theme to the next (steps),
   never through a mix of two, so its words are always at full contrast. It ends on the page's own theme, and stops
   as soon as someone chooses an institution. */
@media (prefers-reduced-motion: no-preference) {
  @supports (animation-timeline: view()) {
    .home-theme { timeline-scope: --home-preview; }
    .home-theme__preview { view-timeline: --home-preview block; animation: home-theme-tour steps(1, end) both; animation-timeline: --home-preview; animation-range: contain 0% contain 100%; }
    .home-theme__dot { animation: home-theme-dot linear both; animation-timeline: --home-preview; }
    .home-theme__dot--mocdti { animation-range: contain 0% contain 8.33%; }
    .home-theme__dot--csa { animation-range: contain 8.33% contain 16.67%; }
    .home-theme__dot--dpc { animation-range: contain 16.67% contain 25%; }
    .home-theme__dot--gdcl { animation-range: contain 25% contain 33.33%; }
    .home-theme__dot--gdnr { animation-range: contain 33.33% contain 41.67%; }
    .home-theme__dot--gifec { animation-range: contain 41.67% contain 50%; }
    .home-theme__dot--gmet { animation-range: contain 50% contain 58.33%; }
    .home-theme__dot--gpcl { animation-range: contain 58.33% contain 66.67%; }
    .home-theme__dot--gi-kace { animation-range: contain 66.67% contain 75%; }
    .home-theme__dot--nca { animation-range: contain 75% contain 83.33%; }
    .home-theme__dot--nita { animation-range: contain 83.33% contain 91.67%; }
    .home-theme__dot--pcsrc { animation-range: contain 91.67% contain 100%; }
    :root:is([data-ggds-theme], :has(.home-theme__input:not(:first-of-type):checked)) :is(.home-theme__preview, .home-theme__dot) { animation: none; }
  }
}
/* On a phone there is no pointer to straighten the tilted preview, so it settles flat as it comes up the screen. */
@media (prefers-reduced-motion: no-preference) and (max-width: 63.99rem) {
  @supports (animation-timeline: view()) {
    .home-theme__preview {
      animation: home-theme-tour steps(1, end) both, home-theme-settle linear both;
      animation-timeline: --home-preview, --home-preview;
      animation-range: contain 0% contain 100%, entry 0% entry 100%;
    }
  }
}
@keyframes home-theme-tour {
  0% { --ggds-color-institution: #005f8f; --ggds-color-institution-deep: #005d8c; }
  8.33% { --ggds-color-institution: #222164; --ggds-color-institution-deep: #222164; }
  16.67% { --ggds-color-institution: #1276bc; --ggds-color-institution-deep: #0e5c93; }
  25% { --ggds-color-institution: #006e35; --ggds-color-institution-deep: #006732; }
  33.33% { --ggds-color-institution: #1848f0; --ggds-color-institution-deep: #1744e2; }
  41.67% { --ggds-color-institution: #003f87; --ggds-color-institution-deep: #003f87; }
  50% { --ggds-color-institution: #21438c; --ggds-color-institution-deep: #21438c; }
  58.33% { --ggds-color-institution: #0c075b; --ggds-color-institution-deep: #0c075b; }
  66.67% { --ggds-color-institution: #0808af; --ggds-color-institution-deep: #0808af; }
  75% { --ggds-color-institution: #061f45; --ggds-color-institution-deep: #061f45; }
  83.33% { --ggds-color-institution: #00342b; --ggds-color-institution-deep: #00342b; }
  91.67% { --ggds-color-institution: #ca0a15; --ggds-color-institution-deep: #b20912; }
  100% { --ggds-color-institution: #005f8f; --ggds-color-institution-deep: #005d8c; }
}
@keyframes home-theme-dot { 0%, 100% { transform: none; } 15%, 85% { transform: scale(1.3); } }
@keyframes home-theme-settle { from { transform: rotateY(-14deg) rotateX(6deg) translateY(var(--ggds-space-6)); } }
