@font-face {
  font-family: "Luciole";
  src: url("fonts/Luciole-Math/Luciole-Regular.woff2") format("woff2");
  font-weight: normal;
  font-display: swap;
}
@font-face {
  font-family: "Luciole";
  src: url("fonts/Luciole-Math/Luciole-Italic.woff2");
  font-weight: normal;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "Luciole";
  src: url("fonts/Luciole-Math/Luciole-Bold.woff2");
  font-weight: bold;
  font-display: swap;
}
@font-face {
  font-family: "Luciole";
  src: url("fonts/Luciole-Math/Luciole-BoldItalic.woff2");
  font-weight: bold;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "Luciole Math";
  src: url("fonts/Luciole-Math/Luciole-Math.otf") format("opentype");
  font-display: swap;
}

@property --w1 {
  syntax: '<percentage>';
  inherits: false;
  initial-value: 5%;
}
@property --w2 {
  syntax: '<percentage>';
  inherits: false;
  initial-value: 5%;
}

body > nav::after {
  content: '';
  background: red;
  display: block;
  height: 2svh;
  width: calc(100% + 2 * var(--spacing));
  margin-inline: calc(-1 * var(--spacing));
  background: linear-gradient(to bottom, var(--nav-background) 0%, var(--nav-background) var(--w1), white calc(0.5 * var(--w2)), var(--background-color) var(--w2), var(--background-color));
  animation: lapping-waves calc(var(--animation-speed) * 15s) ease-in-out infinite;
}

@keyframes lapping-waves {
  0% {
    --w1: 5%;
    --w2: 5%;
  }
  
  20% {
    --w1: 85%;
    --w2: 95%;
  }
  
  80% {
    --w1: 5%;
  }
  
  100% {
    --w2: 5%;
  }
}

:root {
    --header-font: 'Luciole',sans-serif;
    --text-font: 'Luciole', sans-serif;
    --readable-width: 80ch;
    --border-radius: 1em;
  
    --animation-speed: 1;

    color-scheme: light dark;
    --spacing: 1em;
  
    --background-color: hsl(45.5, 75.1%, 90.1%);
    --nav-background: oklch(0.8 0.5 200);
}

@media (prefers-reduced-motion) {
  :root {
    --animation-speed: 0;
  }
}

@media (prefers-color-scheme: dark) {
  :root {
    --background-color: hsl(45.5, 75.1%, 10.1%);
    --nav-background: oklch(0.2 0.5 200);
  }
}

nav {
  background: var(--nav-background);
}

body {
    font-family: var(--text-font);
    line-height: 2;
    background: var(--background-color);
    margin: 0;
}

body > * {
  padding-inline: var(--spacing);
}

p {
    margin-block: 1lh;
}

img, video {
  max-width: 100%;
  max-height: 50svh;
}

figure {
    display: grid;
    justify-content: center;
    align-content: center;
    margin-block: 1lh;
    margin-inline: 0;
    gap: var(--spacing);
}

h1,h2,h3,h4,h5,h6 {
    font-family: var(--header-font);
    text-align: center;
}

:is(h1,h2,h3,h4,h5,h6) a {
  text-decoration: none;
}

nav {
  margin-bottom: 1lh;
}


nav > nav > ul {
  list-style: none;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: var(--spacing);
  justify-content: space-between;
}

nav a {
  color: CanvasText;
  
  &:is(:focus,:hover) {
    color: color-mix(in oklab, CanvasText, var(--nav-background) 50%);
  }
  &:is(:active) {
    color: color-mix(in oklab, CanvasText, var(--nav-background) 20%);
  }
}

main {
  max-width: var(--readable-width);
  margin-inline: auto;
}

header time {
    font-size: smaller;
    font-weight: normal;
}

article {
    container-type: inline-size;
}

iframe {
    display: block;
    margin-inline: auto;

    width: 100cqw;
}

iframe, img, video {
  border: none;
  border-radius: var(--border-radius);
}

figcaption {
    text-align: center;
    font-style: italic;
}

#logo {
    text-decoration: none;
    font-size: 2em;
    display: block;
    text-align: center;
    font-weight: bold;
}

body.news .news-item {
    & header {
        background: var(--nav-background);
        border-radius: var(--border-radius) var(--border-radius) 0 0;

        & :last-child {
            margin-bottom: 0;
        }
        
    }
    
    & header + * {
        border-radius: 0 0 var(--border-radius) var(--border-radius);
    }
}

footer {
    margin-top: 5lh;
    text-align: center;
}

nav.pager {
    display: flex;
    justify-content: space-between;
    padding-inline: var(--spacing);
    gap: var(--spacing);
}


[rel="next"]::before {
    content: '« ';
}

[rel="prev"]::after {
    content: ' »';
}
