/* Main frontend styles for Tanovis Parent */

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-kerning: none;
  text-rendering: optimizeSpeed;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--wp--preset--font-family--tanovis-bold);
  font-weight: 700;
}

p,
a,
ul,
ol,
li,
blockquote,
table,
th,
td,
pre,
code,
kbd,
samp,
input,
textarea,
select,
option,
button,
label,
legend,
caption {
  font-family: var(--wp--preset--font-family--suisse-intl);
}

ul,
ol,
li {
  list-style: none;
}

a {
  text-decoration: none;
  color: inherit;
  &:hover {
    color: inherit;
  }
}

.wp-site-blocks {
  overflow-x: clip;
}

.container {
  max-width: var(--px-1300);
  padding: var(--px-40) var(--px-20);
  margin: 0 auto;
}

@media (min-width: 48rem) {
  .container {
    padding: var(--px-64) var(--px-40);
  }
}

/* ========================== Reduce animation preference ========================== */
/* There is a copy of this in the main.js file and editor.css file. */

@media (prefers-reduced-motion: reduce) {
  .bg-light {
    background-color: var(--wp--preset--color--theme-light-bg);
    color: var(--wp--preset--color--theme-light-fg);
  }

  .bg-medium {
    background-color: var(--wp--preset--color--theme-medium-bg);
    color: var(--wp--preset--color--theme-medium-fg);
  }

  .bg-dark {
    background-color: var(--wp--preset--color--theme-dark-bg);
    color: var(--wp--preset--color--theme-dark-fg);
  }

  .bg-accent {
    background-color: var(--wp--preset--color--theme-accent-bg);
    color: var(--wp--preset--color--theme-accent-fg);
  }
}

/* Image aspect ratios */
.aspect-ratio-16-9 {
  --ar: calc(16 / 9);
  aspect-ratio: 16 / 9;
  img {
    aspect-ratio: 16 / 9;
  }
}

.aspect-ratio-9-16 {
  --ar: calc(9 / 16);
  aspect-ratio: 9 / 16;
  img {
    aspect-ratio: 9 / 16;
  }
}

.aspect-ratio-1-1 {
  --ar: calc(1 / 1);
  aspect-ratio: 1 / 1;
  img {
    aspect-ratio: 1 / 1;
  }
}

.aspect-ratio-4-3 {
  --ar: calc(4 / 3);
  aspect-ratio: 4 / 3;
  img {
    aspect-ratio: 4 / 3;
  }
}

.aspect-ratio-3-4 {
  --ar: calc(3 / 4);
  aspect-ratio: 3 / 4;
  img {
    aspect-ratio: 3 / 4;
  }
}

/* ========================== Image cutouts ========================== */
.cutout {
  --cut: 20%;
  --tan: 0.625; /* 32deg */
  transition: clip-path 0.5s cubic-bezier(0.4, 0, 0.2, 1);

  &.cutout-top-left {
    clip-path: polygon(
      var(--cut) 0%,
      100% 0%,
      100% 100%,
      0% 100%,
      0% calc(var(--cut) * var(--tan) * var(--ar))
    );
  }

  &.cutout-top-right {
    clip-path: polygon(
      0% 0%,
      calc(100% - var(--cut)) 0%,
      100% calc(var(--cut) * var(--tan) * var(--ar)),
      100% 100%,
      0% 100%
    );
  }

  &.cutout-bottom-left {
    clip-path: polygon(
      0% 0%,
      100% 0%,
      100% 100%,
      var(--cut) 100%,
      0% calc(100% - (var(--cut) * var(--tan) * var(--ar)))
    );
  }

  &.cutout-bottom-right {
    clip-path: polygon(
      0% 0%,
      100% 0%,
      100% calc(100% - (var(--cut) * var(--tan) * var(--ar))),
      calc(100% - var(--cut)) 100%,
      0% 100%
    );
  }

  img {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }
}

main.site-content {
  position: relative;
}

/* ========================== Button Component ========================== */
.btn {
  display: inline-block;
  text-decoration: none;
  padding: var(--px-10) var(--px-16) var(--px-8);
  border-radius: var(--px-32);
  background: transparent;
  border: 1px solid currentColor;
  color: inherit;
  font-family: var(--wp--preset--font-family--tanovis-bold);
  font-weight: 700;
  font-size: var(--px-16);
  cursor: pointer;
  transition: all 0.2s ease;
  border-color: var(--wp--preset--color--navigation-fg);
  color: var(--wp--preset--color--navigation-fg);
}

.btn:hover {
  background-color: var(--wp--preset--color--navigation-fg);
  color: var(--wp--preset--color--base);
}

/* ========================== Link Component ========================== */
.link {
  position: relative;
  display: block;
  padding: var(--px-16) var(--px-28) var(--px-16) var(--px-16);
  font-family: var(--wp--preset--font-family--tanovis-bold);
  font-weight: 700;
  text-decoration: none;
  color: inherit;
}

.link__arrow {
  position: relative;
  left: var(--px-8);
  top: var(--px-4);
  transition: left 0.2s ease;
}

.link:hover .link__arrow {
  left: var(--px-12);
}
