/**
 * @file
 * Copy of https://design-system.alpha.canada.ca/styles/style.css
 *
 * • Not included in GCDS but used for gc.ca site theming.
 * • Unchanged from the original
 * • Review periodically to confirm if still needed.
 */

.bg-full-width {
  position: relative;
  width: calc(100% + var(--gcds-spacing-300));
  margin-inline: calc(-1 * var(--gcds-spacing-150));
  padding-inline: var(--gcds-spacing-150);
}
.bg-full-width::before,
.bg-full-width::after {
  position: absolute;
  top: 0;
  width: 100vw;
  height: 100%;
  content: "";
  background-color: inherit;
}
.bg-full-width::before {
  left: calc(-100vw + 0.01px);
}
.bg-full-width::after {
  right: calc(-100vw + 0.01px);
}

.bg-light-blue {
  color: var(--gcds-color-blue-800);
  background-color: var(--gcds-color-blue-100);
}

a[href] {
  text-decoration-color: currentColor;
}
a[href]:not([class*="link-light"]):hover:not(:focus) {
  color: var(--gcds-link-hover);
}
a[href]:focus {
  text-decoration: none;
  color: var(--gcds-focus-text);
  border-radius: var(--gcds-border-radius-sm);
  outline: var(--gcds-spacing-50) solid var(--gcds-focus-background);
  outline-offset: var(--gcds-border-width-md);
  background-color: var(--gcds-focus-background);
  box-shadow: 0 0 0 var(--gcds-border-width-md) var(--gcds-color-grayscale-0);
}

.layout-container
  a[href]:not([class*="link-inherit"], [class*="link-light"], :focus, :hover) {
  color: var(--gcds-link-default);
}

h1 {
  max-width: 32ch;
}

h2 {
  max-width: 37ch;
}

h3 {
  max-width: 42ch;
}

h4 {
  max-width: 46ch;
}

h5 {
  max-width: 53ch;
}

h6 {
  max-width: 60ch;
}

.layout-container ul li,
p {
  max-width: 65ch;
  font: var(--gcds-font-text-long);
}

ul li p:last-child,
ol li p:last-child {
  margin-block-end: var(--gcds-spacing-0) !important;
}

code,
[class*="language-"] {
  font-family: var(--gcds-font-families-monospace);
}

code:not([class*="language-"]) {
  padding: var(--gcds-spacing-50);
  border-radius: var(--gcds-border-radius-sm);
  background-color: var(--gcds-color-grayscale-50);
  font-size: 80%;
  line-height: var(--gcds-line-heights-caption);
}

/*
 * General
 */
@keyframes fade {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
body {
  animation: fade 0.05s normal forwards ease-in-out;
}

.remove-empty-p p:empty {
  display: none;
}

iframe {
  max-width: 100%;
}

ul li p.mb-400:has(+ ul),
ul li ul.mb-400 {
  margin-block-end: 0;
}
ul li ul li {
  list-style: circle;
}

.anatomy-list {
  margin-block-end: var(--gcds-spacing-450);
  counter-reset: item;
}
.anatomy-list > li {
  position: relative;
  max-width: 65ch;
  margin-block-end: var(--gcds-spacing-400);
  padding-inline-start: var(--gcds-spacing-450);
  counter-increment: item;
}
.anatomy-list > li::before {
  position: absolute;
  left: 0;
  display: inline-block;
  width: var(--gcds-spacing-400);
  height: var(--gcds-spacing-400);
  margin-inline-end: var(--gcds-spacing-200);
  content: counter(item);
  text-align: center;
  color: var(--gcds-text-light);
  border-radius: var(--gcds-border-radius-xl);
  background: #c54600;
  font-size: var(--gcds-font-sizes-caption);
}
.anatomy-list ul {
  margin-inline-start: var(--gcds-spacing-550);
  list-style: disc;
}

/*
 * Code showcase
 */
.code-showcase .showcase {
  width: 100%;
  background-color: #262626;
}
.code-showcase .showcase[aria-hidden="true"] {
  display: block;
  overflow: hidden;
  width: 0;
  height: 0;
  margin: 0;
  padding: 0;
  border: 0;
}
.code-showcase .showcase[aria-hidden="false"] {
  margin-top: calc(-1 * var(--gcds-spacing-400));
}
.code-showcase gcds-button {
  margin: 0 var(--gcds-spacing-300) 0 0;
}
.code-showcase .code-copy {
  display: none;
  visibility: hidden;
}

/*
 * Copy code button
 */
.code-copy-button {
  --gcds-button-secondary-default-text: white;

  width: fit-content;
}

.code-copy-button:hover {
  --gcds-button-secondary-default-text: var(--gcds-link-default);
}

.component-preview p {
  margin-block-end: var(--gcds-spacing-0);
}
.component-preview div > p {
  max-width: none;
}

.component-preview-box a {
  height: 100%;
  transition: all 0.35s;
  border: var(--gcds-border-width-md) solid transparent;
}
.component-preview-box a:hover {
  border-color: var(--gcds-border-default);
}
.component-preview-box a:hover .text-secondary {
  color: inherit;
}
.component-preview-box a:focus {
  outline: var(--gcds-outline-width) solid var(--gcds-focus-background);
  outline-offset: var(--gcds-border-width-md);
  background-color: var(--gcds-focus-background);
}
.component-preview-box a:focus .text-secondary {
  color: var(--gcds-focus-text);
}

@media (max-width: 64rem) {
  .table-overflow {
    overflow-x: scroll;
    max-width: var(--gcds-container-full);
    box-shadow:
      inset calc(-1 * var(--gcds-border-width-xl)) 0 0
        var(--gcds-color-grayscale-50),
      inset var(--gcds-border-width-xl) 0 0 var(--gcds-color-grayscale-50);
  }
}

table {
  width: var(--gcds-container-full);
  text-align: left;
}
.table-overflow table {
  min-width: var(--gcds-container-md);
  box-shadow:
    inset calc(-1 * var(--gcds-border-width-xl)) 0 0
      var(--gcds-color-grayscale-0),
    inset var(--gcds-border-width-xl) 0 0 var(--gcds-color-grayscale-0);
}
table tr {
  vertical-align: baseline;
}
table thead tr {
  border-block-end: var(--gcds-border-width-md) solid var(--gcds-border-default);
}
table tbody tr {
  border-block-end: var(--gcds-border-width-sm) solid var(--gcds-border-default);
}
table td,
table th {
  padding: var(--gcds-spacing-300) var(--gcds-spacing-250);
}
table td:first-child,
table th:first-child {
  padding-inline-start: 0;
}
table td:last-child,
table th:last-child {
  padding-inline-end: 0;
}
table th {
  padding-block-start: 0;
  font-weight: var(--gcds-font-weights-bold);
}
table .color-preview {
  width: var(--gcds-spacing-500);
  height: var(--gcds-spacing-500);
  margin-block-start: calc(-1 * var(--gcds-spacing-200));
  border-radius: var(--gcds-spacing-500);
}
table .spacing-preview {
  background-color: var(--gcds-color-blue-500);
}

.table-display-token-color tr {
  vertical-align: top;
}
.table-display-token-color td {
  padding-block: calc(var(--gcds-spacing-300) + var(--gcds-spacing-200));
}
.table-display-token-color th:nth-child(1) {
  width: var(--gcds-spacing-500);
}
.table-display-token-color th:nth-child(2) {
  width: 30%;
}
.table-display-token-color th:nth-child(4) {
  width: 7ch;
}
.table-display-token-color th:nth-child(5) {
  width: 35%;
}

.table-base-colors th:nth-child(2) {
  width: 40%;
}
.table-base-colors th:nth-child(4) {
  width: 7ch;
}
.table-base-colors th:nth-child(5) {
  display: none;
}

.table-display-token-typography th,
.table-display-token-fontFamilies th,
.table-display-token-fontWeights th {
  width: 30%;
  min-width: 13.125rem;
}
.table-display-token-typography th:nth-child(3),
.table-display-token-fontFamilies th:nth-child(3),
.table-display-token-fontWeights th:nth-child(3) {
  width: 40%;
}

.table-display-token-typography tr.row-label,
.table-display-token-typography tr.row-textLong {
  display: none;
}

.table-display-token-fontFamilies .row-icons {
  display: none;
}

.table-display-token-dimension {
  margin-block-end: var(--gcds-spacing-600);
}
.table-display-token-dimension tr {
  vertical-align: top;
}

nav.tabs ul {
  display: flex;
  flex-wrap: wrap;
  width: var(--gcds-container-full);
  margin-block-end: var(--gcds-spacing-500);
  margin-inline-start: 0;
  list-style: none;
  border-block-end: var(--gcds-border-width-md) solid
    var(--gcds-color-grayscale-100);
  background-color: var(--gcds-color-grayscale-0);
  gap: var(--gcds-spacing-100);
}
nav.tabs a {
  display: block;
  color: var(--gcds-text-default);
  border-radius: var(--gcds-button-border-radius)
    var(--gcds-button-border-radius) 0 0;
}
nav.tabs a[aria-current="page"] {
  margin-block-start: 0;
  margin-block-end: 0;
  text-decoration: none;
  pointer-events: none;
  border: var(--gcds-border-width-md) solid var(--gcds-color-grayscale-100);
  border-block-end: 0 solid var(--gcds-color-grayscale-0);
  background-color: var(--gcds-color-grayscale-0);
  box-shadow: 0 var(--gcds-border-width-xl) 0
    calc(var(--gcds-border-width-md) * -1) var(--gcds-color-grayscale-0);
  font-weight: bold;
}
nav.tabs a:hover {
  background-color: var(--gcds-color-grayscale-50);
}
nav.tabs a:active {
  color: var(--gcds-focus-text) !important;
}
nav.tabs a:focus {
  text-decoration: none;
  color: var(--gcds-focus-text);
  background-color: var(--gcds-focus-background);
}
nav.tabs a[aria-current="page"]:focus {
  border-color: var(--gcds-focus-background);
}

.hero {
  margin: calc(-1 * var(--gcds-spacing-200));
  background: url(../../images/common/home/home-hero.jpg) top center no-repeat;
  background-size: cover;
}
.hero::before {
  display: block;
  overflow: hidden;
  width: 0;
  height: 0;
  margin: 0;
  content: "Image credit: John Lee, https://unsplash.com/photos/oMneOBYhJxY?utm_source=unsplash&utm_medium=referral&utm_content=creditShareLink";
}
.hero .hero__content {
  position: relative;
  width: 80%;
  max-width: 40.625rem;
}
.hero .hero__content::before {
  position: absolute;
  top: 0;
  left: calc(-100vw + 0.01px);
  width: 100vw;
  height: 100%;
  content: "";
  background-color: var(--gcds-color-blue-900);
}

.search-result {
  padding-block-end: var(--gcds-spacing-400);
  border-block-end: solid 1px var(--gcds-color-grayscale-1000);
}
.search-result mark {
  background-color: inherit;
  font-weight: var(--gcds-font-weights-bold);
}

.results-loader {
  width: var(--gcds-spacing-500);
  animation:
    l20-1 0.8s infinite linear alternate,
    l20-2 1.6s infinite linear;
  border: var(--gcds-border-width-xl) solid var(--gcds-text-primary);
  border-radius: var(--gcds-border-radius-xl);
  aspect-ratio: 1;
}

@keyframes l20-1 {
  0% {
    clip-path: polygon(50% 50%, 0 0, 50% 0%, 50% 0%, 50% 0%, 50% 0%, 50% 0%);
  }
  12.5% {
    clip-path: polygon(
      50% 50%,
      0 0,
      50% 0%,
      100% 0%,
      100% 0%,
      100% 0%,
      100% 0%
    );
  }
  25% {
    clip-path: polygon(
      50% 50%,
      0 0,
      50% 0%,
      100% 0%,
      100% 100%,
      100% 100%,
      100% 100%
    );
  }
  50% {
    clip-path: polygon(
      50% 50%,
      0 0,
      50% 0%,
      100% 0%,
      100% 100%,
      50% 100%,
      0% 100%
    );
  }
  62.5% {
    clip-path: polygon(
      50% 50%,
      100% 0,
      100% 0%,
      100% 0%,
      100% 100%,
      50% 100%,
      0% 100%
    );
  }
  75% {
    clip-path: polygon(
      50% 50%,
      100% 100%,
      100% 100%,
      100% 100%,
      100% 100%,
      50% 100%,
      0% 100%
    );
  }
  100% {
    clip-path: polygon(
      50% 50%,
      50% 100%,
      50% 100%,
      50% 100%,
      50% 100%,
      50% 100%,
      0% 100%
    );
  }
}
@keyframes l20-2 {
  0% {
    transform: scaleY(1) rotate(0deg);
  }
  49.99% {
    transform: scaleY(1) rotate(135deg);
  }
  50% {
    transform: scaleY(-1) rotate(0deg);
  }
  100% {
    transform: scaleY(-1) rotate(-135deg);
  }
}
