@import "variables.css";

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  line-height: 1.2;
}

html,
body {
  scroll-behavior: smooth;
  height: 100vh;
  width: 100vw;
}

body {
  background: var(--bg);
  color: var(--fg);
  margin: 0;

  display: flex;
  flex-flow: column nowrap;
}

body::-webkit-scrollbar,
main::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

body::-webkit-scrollbar-track,
main::-webkit-scrollbar-track {
  background: var(--bg);
}

body::-webkit-scrollbar-thumb,
main::-webkit-scrollbar-thumb {
  background: var(--fg);
}

body::-webkit-scrollbar-thumb:hover,
main::-webkit-scrollbar-thumb:hover {
  opacity: 0.8;
  cursor: grabbing;
}

body ::selection {
  background: var(--fg);
  color: var(--bg) !important;
}

img {
  max-width: 100%;
  max-height: 100%;
}

/* TYPO GENERAL */
html,
body {
  font-size: clamp(0.9rem, 0.8rem + 0.7vw, 1.4rem);
  font-family: var(--bodyfont);
  color: var(--fg);
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--titlefont);
  color: var(--fg);
  font-weight: normal;
  font-style: normal;
}

h1 {
  font-size: var(--s5);
}

h2 {
  font-size: var(--s4);
}

h3 {
  font-size: var(--s3);
}

h4 {
  font-size: var(--s2);
}

h5 {
  font-size: var(--s1);
}

h6 {
  font-size: var(--s0);
}

.title {
  font-family: var(--titlefont);
}

a,
a:visited {
  color: var(--fg);
}

a:hover,
a:focus {
  -webkit-text-stroke: 0 var(--accent);
  text-decoration: none;
  color: var(--accent);
}

p {
  line-height: 1.4;
}

p a {
  -webkit-text-stroke: calc(var(--stroke-width) / 2) var(--accent);
  transition: -webkit-text-stroke var(--delay);
  font-weight: bold;
}

p a:hover,
p a:focus {
  -webkit-text-stroke: 0 var(--accent);
}

a#previous {
  text-decoration: none;
  font-family: "Garamond/t";
  font-size: var(--s2);
  display: block;
  line-height: var(--s5);
  width: fit-content;
}

main {
  padding: 2rem;
  font-size: var(--s0);
  scrollbar-color: var(--fg) var(--bg) !important;
  scrollbar-width: auto;
}

ul {
  list-style: none;
}

/* HEADER */
header.menu-temp {
  position: absolute;
  font-family: "Redaction_10-Bold-CVB";
  font-weight: normal;
  color: var(--bg);
  font-size: 5rem;
  -webkit-text-stroke: 0.01rem var(--fg);
  text-shadow: -0.05em 0.05rem var(--fg);
  transition: all 0.25s ease-in-out;
}

header.menu-temp:hover {
  text-shadow: 0 0 var(--fg);
  transition: all 0.25s ease-in-out;
  cursor: pointer;
}

header.menu-temp span {
  position: fixed;
  z-index: 1000;
}

header.menu-temp a {
  color: var(--bg);
  text-decoration: none;
  -webkit-text-stroke: var(--stroke-width) var(--fg);
  margin: 0;
}

header.menu-temp .nos {
  top: 0rem;
  left: 1rem;
}
header.menu-temp .futurs {
  top: 0rem;
  right: 1rem;
}
header.menu-temp .point {
  bottom: 0rem;
  left: 1rem;
}
header.menu-temp .net {
  bottom: 0rem;
  right: 1rem;
}

/* Dialog */
.hidden {
  display: none;
}

[role="alertdialog"] {
  padding: 1rem;
  border: var(--stroke-width) solid var(--fg);
  background-color: var(--bg);
  min-height: 50vh;
  max-height: 80vh;
  max-width: 80vw;
  font-size: var(--s1);
  font-family: "Amiamie", sans-serif;
  text-shadow: none;
  color: var(--fg);
  z-index: 10000;
  position: fixed;
  top: 50%;
  left: 50%; /* move to the middle of the screen (assumes relative parent is the body/viewport) */
  transform: translate(
    -50%,
    -50%
  ); /* move backwards 50% of this element's width */

  width: calc(100% - (1rem * 2)); /* == breakpoint - left+right margin */
  min-height: auto;
}

.dialog_label {
  text-align: center;
}

.dialog_form_actions {
  text-align: right;
  padding: 0 2rem 2rem;
}

.dialog_desc {
  padding: 1rem 2rem;
}

/* dialog::backdrop, */
.dialog-backdrop {
  cursor: normal !important;
  position: fixed;
  overflow-y: auto;
  z-index: 1;
  inset: 0;
}

.dialog-backdrop {
  background: rgb(0 0 0 / 50%);
}

.dialog-backdrop.active {
  display: block;
}

.no-scroll {
  overflow-y: auto !important;
}

/* this is added to the body when a dialog is open */
.has-dialog {
  overflow: hidden;
}

#ex_alertdialog [aria-disabled="true"] {
  opacity: 0.4;
}

/* bouton fermer */
#notes_cancel {
  padding: 0.5em 1em;
  color: var(--fg);
  background: var(--bg);
  border: solid var(--stroke-width) var(--fg);
}

#notes_cancel:hover,
#notes_cancel:focus {
  color: var(--bg);
  background: var(--fg);
  cursor: pointer;
}

#notes_save {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

#notes_save svg {
  display: block;
  width: 0.75rem;
}

#notes_save .icon {
  display: none;
}

@keyframes rotate {
  0% {
    transform: rotate(0deg);
  }

  100% {
    transform: rotate(360deg);
  }
}

#notes_save.loading .spinner {
  display: block;
  animation: rotate 2s linear infinite;
}

#notes_save.saved .check {
  display: block;
}

/* NAV */
#navVolet3 {
  position: fixed;
  bottom: 0;
  left: 0;

  width: 100%;
  background: transparent;

  z-index: 100;
}

#navVolet3 ul {
  font-family: "Garamond/t";
  font-size: var(--s2);
  display: flex;
  flex-flow: row wrap;
  justify-content: center;
  gap: 3rem;
  margin: 0 auto;
  border-radius: 1em;
  padding: 1rem 2rem;

  max-width: 100%;
  text-align: center;
}

#navVolet3 ul li a {
  color: var(--fg) !important;
  background: var(--bg);
  border: solid transparent var(--stroke-width);
  border-color: transparent transparent var(--fg) transparent;
  border-radius: 1em;
  transition: border-color ease var(--delay);
  padding: 0.3rem 0.8rem;
  text-decoration: none;
}

#navVolet3 ul li a:hover,
#navVolet3 ul li a:focus {
  border-color: var(--fg);
  box-shadow: 0px 0px 1rem var(--accent);
  text-decoration: none;
}

/* IMAGES SVG ---------------------- */
.image_wrapper {
  overflow: hidden;
  position: relative;
}

svg.image-cover,
svg.image-cover use {
  height: 100%;
  width: 100%;
  aspect-ratio: 16 / 9;
}

svg.image-cover use {
  stroke: var(--fg);
  fill: none;
  stroke-width: var(--stroke-width);
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: stroke-width ease-in-out 0.1s;
}

/* INDEX ---------------------- */
#homepage {
  scroll-padding: 2rem;
}

/* Horizontal scolling sur grands écrans */
@media screen and (min-width: 992px) {
  #homepage ~ #navVolet3 {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    max-width: 90vw;
  }

  #homepage {
    height: 100vw;
    min-height: 100vw;
    width: 92vh;
    transform: rotate(-90deg) translateY(-92vh);
    transform-origin: top right;
    overflow-x: hidden;
    overflow-y: auto;
  }

  article {
    transform: rotate(90deg) translateX(20vw);
  }

  #end {
    transform: rotate(90deg);
  }

  article + article {
    margin-top: 300px;
  }
}

/* On cible l'intérieur de l'article mais on garde l'intersectionObserver sur l'article même */
article a {
  aspect-ratio: 16 / 9;
  display: block;
  margin: 0 auto;
  border-radius: 1rem;
  border: solid var(--fg) var(--stroke-width);
  background: var(--bg);
  filter: blur(0px);
  opacity: 1;
  transform: scale(1);

  transform-origin: bottom;
  text-decoration: none;
  box-shadow: 0px 0px 2px transparent;
  color: var(--fg);
  transition:
    filter linear 0.1s,
    transform linear 0.1s,
    opacity linear 0.1s,
    box-shadow var(--delay),
    color var(--delay);
}

.item_article {
  scroll-margin: 20em;
}

.item_article .image_wrapper {
  border-radius: 1rem;
  overflow: hidden;
  background: var(--bg);
}

.item_article .meta_info {
  padding: 0.5rem 1rem;
  border-top: solid var(--fg) var(--stroke-width);
}

.item_article .meta_info p {
  color: var(--fg);
  transform: translateY(-1em);
  opacity: 0;
  transition:
    transform var(--delay),
    opacity var(--delay);
}

.meta_info span + span::before {
  content: "/ ";
  font-family: "Garamond/t";
  font-size: 1.5em;
  margin-left: 0.3rem;
  vertical-align: middle;
  font-weight: bold;
}

/* LISTE ARTICLES HOVER */
.item_article a:focus .meta_info p,
.item_article:hover .meta_info p {
  transform: translateY(-0.1em);
  opacity: 1;
}

.item_article a:focus,
.item_article:hover a {
  box-shadow: 0rem 0rem 2.5rem var(--accent);
  color: var(--accent);
}

.item_article h2 {
  line-height: 1;
  margin-top: 0.17em;
}

.item_article svg.play-button {
  opacity: 0;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  transition: opacity var(--delay);
  height: 3rem;
  height: 100%;
  width: 100%;
}

.item_article svg.play-button use {
  stroke-width: var(--stroke-width) !important;
  color: var(--fg);
}

.item_article a:focus svg.play-button,
.item_article:hover svg.play-button {
  opacity: 1;
}

#end {
  text-transform: uppercase;
  text-align: center;
  margin-top: 2rem;
}

/* ARTICLE ---------------------- */

@keyframes static-animation {
  0% {
    transform: translate(0, 0);
  }
  10% {
    transform: translate(-5%, -5%);
  }
  20% {
    transform: translate(-10%, 5%);
  }
  30% {
    transform: translate(5%, -10%);
  }
  40% {
    transform: translate(-5%, 15%);
  }
  50% {
    transform: translate(-10%, 5%);
  }
  60% {
    transform: translate(15%, 0);
  }
  70% {
    transform: translate(0, 10%);
  }
  80% {
    transform: translate(-15%, 0);
  }
  90% {
    transform: translate(10%, 5%);
  }
  100% {
    transform: translate(5%, 0);
  }
}

/* seulement sur les singles*/
body:not(.body_index) {
  position: relative;
  overflow: hidden;
}

body:not(.body_index)::before {
  content: "";
  position: absolute;
  top: -50%;
  left: -50%;
  right: -50%;
  bottom: -50%;
  width: 200%;
  height: 200vh;
  background: transparent
    url("http://assets.iceable.com/img/noise-transparent.png") repeat 0 0;
  background-repeat: repeat;
  animation: static-animation 1s infinite;
  opacity: 1;
  visibility: visible;
  mix-blend-mode: hard-light;
  overflow: hidden;
  z-index: -1;
}

.main div.wrapper {
  max-width: var(--max-width);
  margin: auto;
}

.main {
  padding: 4rem calc(calc(100% - var(--max-width)) / 2) 4rem
    calc(calc(100% - var(--max-width)) / 2);
  overflow-y: auto;
  background: transparent;
  z-index: 0;
  position: relative;
}

.main > div.wrapper {
  background: var(--bg);
  position: fixed;
  z-index: -1;
  width: 100%;
  height: 100%;
  box-shadow:
    -2em 0 1em var(--bg),
    2em 0 1em var(--bg);
}

.main h1 {
  margin: 1rem 0 0rem 0;
  position: relative;
}

.main ul {
  margin: 2rem 0;
  padding: 2rem;
  padding-left: 3rem;
  border: solid var(--fg) var(--stroke-width);
  border-radius: 1rem;
  width: 100%;
}

.main ul li::marker {
  content: "— ";
}

.main ul li + li {
  margin-top: 0.2em;
}

.main p + p {
  margin-top: 0.5em;
}

.main ul ~ p {
  font-style: italic;
}

/* Logos podcasts */
.link-logo {
  display: flex;
  gap: 1rem;
  height: 2.5rem;
  justify-content: start;
  margin: 1rem auto;
}

.link-logo a {
  flex: 0 0 min-content;
  min-width: 2.6rem;
}

.link-logo img {
  min-height: 100%;
}

/* Temporaire */
#disclaimer,
.main #video-wrapper {
  margin-bottom: 2rem;
  border: solid var(--fg) var(--stroke-width);
  border-radius: 1rem;
  overflow: hidden;
  position: relative;
}

#disclaimer {
  text-align: center;
}

.main #video-wrapper #disclaimer {
  position: absolute;
  text-align: center;
  margin: 0rem;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

@media screen and (max-width: 768px) {
  .main #video-wrapper #disclaimer {
    width: calc(100% - 2rem);
    max-height: calc(100% - 2rem);
    overflow-y: auto;
  }
}

#disclaimer {
  padding: 1rem;
}

/* style de l'article */
.main svg.image-cover {
  margin: auto;
  max-height: 50vh;
  aspect-ratio: 16 / 9;
  border: solid var(--fg) var(--stroke-width);
  border-radius: 1rem;
}

.title ~ .author {
  font-size: var(--s2);
}

.author span + span {
  content: "+";
  border-left: none;
  margin-left: 0;
  padding-left: 0;
}

.author span + span::before {
  content: "+ ";
}

.title ~ .meta_info {
  margin-bottom: 1rem;
}

h2.titre-episode {
  font-size: var(--s3);
  margin: 1em 0 0.1em 0;
  width: 100%;
}

h2.titre-episode + p {
  font-size: var(--s1) !important;
  margin: 0 0 1rem 0;
}

.audio-player {
  background: var(--accent);
  border: solid var(--fg) var(--stroke-width);
  border-radius: 1rem;
  margin-bottom: 1rem;
  padding: 0.75rem;
  padding-bottom: 0.5rem;
  margin-bottom: 1.5rem;
}

.audio-player button {
  width: 1.5em;
  height: 1.5em;
  cursor: pointer;
  background: transparent;
  font-size: 2rem;
  border: none;
  color: var(--fg);
  flex: 0 1 auto;
}

.audio-player button:hover,
.audio-player button:focus {
  color: var(--bg);
}

.audio-wrapper {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.controls {
  flex: 1 1 auto;
}

.timeline {
  background: var(--bg) !important;
  margin-bottom: 0.5rem;
  cursor: pointer;
  width: 100%;
  height: calc(var(--stroke-width) * 2);
}

.progress {
  height: 100%;
  background: var(--fg);
  width: 0%;
}

hr {
  border-color: var(--fg);
  border-width: var(--stroke-width) 0 0 0;
  margin-top: 3rem;
  margin-bottom: 3rem;
}

/* PAGES META ---------------------- */
.page h2,
.page h3,
.page h4,
.page h5,
.page h6 {
  margin: 1em 0 0.5em 0;
}

.page .logos {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, max-content));
  /* grid-template-rows: minmax(200px, 1fr); */
  /* this is better for small screens, once min() is better supported */
  /* grid-template-columns: repeat(auto-fill, minmax(min(200px, 100%), 1fr)); */
  gap: 1rem;
}

.page .logos img {
  max-height: 120px;
  width: auto;
}

.page #main-page ul li::marker {
  content: "";
}

.page #main-page ul li:nth-of-type(2n + 1) {
  margin-top: 1.5rem;
}

/* PAGES ---------------------- */
.meta ul li + li:nth-of-type(2n + 1) {
  margin-top: 0.75rem;
}

/* À PROPOS ---------------------- */
.body_a-propos p:first-of-type {
  font-family: var(--titlefont);
  font-size: var(--s1);
  margin-top: 2rem;
}

/* ÉDITO ---------------------- */
.body_la-mort-vivante h1.title {
  margin-bottom: 0.5em;
}

.body_la-mort-vivante #main-page ul li + li {
  margin-top: 0.75rem;
}

.body_la-mort-vivante #main-page ul li + li:nth-of-type(2n + 1) {
  margin-top: 0.75rem;
}

/* PORTRAIT ---------------------- */
@media (orientation: portrait), (max-width: 992px) {
  :root {
    --stroke-width: 1px;
  }

  body:not(.body_index)::before {
    display: none;
    animation: none;
  }

  body {
    overflow-x: hidden !important;
    max-width: 100vw;
  }

  .main {
    padding: 7rem 2rem;
  }

  header.menu-temp {
    font-size: 4rem;
  }

  #navVolet3 ul {
    padding: 1rem 1rem 2rem 1rem;
    gap: 0.5rem;
    row-gap: 1rem;
  }

  article + article {
    margin-top: 1rem;
  }

  #homepage article p {
    opacity: 1;
    transform: translateY(0em);
  }

  .item_article h2 {
    hyphens: auto;
  }
}

#celleux-integration {
  border: solid var(--fg) var(--stroke-width);
  border-radius: 1em;
  padding: 2rem;
  margin-bottom: 2rem;
  aspect-ratio: 16 / 9;
  position: relative;
  overflow: hidden;
}

#celleux-start {
  text-decoration: none;
  color: var(--fg);
  padding: 0.5em 1em;
  z-index: 100;
  text-align: center;
  transition:
    scale ease 8s,
    border-color ease 8s;

  position: absolute;
  bottom: 1rem;
  left: 0;
  width: 100%;
  scale: 1;
  cursor: pointer;
}

#celleux-start:hover a,
#celleux-start:focus a {
  text-decoration: none;
}

#celleux-start:active,
#celleux-start:focus,
#celleux-start:hover {
  border-color: transparent;
  scale: 1.2;
}

#celleux-integration svg {
  border: none;
  scale: 1;
  transition: scale cubic-bezier(0.65, 0, 0.35, 1) 8s;
}

#celleux-start:focus ~ svg,
#celleux-start:hover ~ svg {
  scale: 4;
}

#celleux-integration svg use {
  /* animation: stroke 5s infinite cubic-bezier(0.83, 0, 0.17, 1) alternate; */
  animation: stroke 10s infinite cubic-bezier(0.37, 0, 0.63, 1) alternate;
  stroke: var(--fg);
}

@keyframes stroke {
  0% {
    fill: none;
    stroke: var(--fg);
    stroke-dashoffset: 0%;
    stroke-dasharray: 0 30%;
    stroke-width: var(--stroke-width);
  }
  50% {
    stroke: var(--fg);
    stroke-dasharray: 30% 30% 0;
  }
  100% {
    fill: none;
    stroke: var(--fg);
    stroke-dashoffset: 0%;
    stroke-dasharray: 50% 0;
    stroke-width: calc(2 * var(--stroke-width));
  }
}
