/* ------------------------------------------------------------------ Styles fonctionnels */
body {
  margin: 0;
  overflow: hidden;
}
article {
  position: absolute;
  inset: 0;
  display: none;
}
article.visible {
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
}
#bar {
  position: fixed;
  bottom: 0;
  height: 2px;
  background: white;
}
#bar.animated {
  animation: baranim 30s linear 1 forwards;
}
@keyframes baranim {
  0% {
    width: 0;
  }
  66.666% {
    width: 100%;
    background: white;
  }
  100% {
    width: 100%;
    background: red;
  }
}

/* ------------------------------------------------------------------ Styles personnalisables */
:root {
  --padding: 40px;
  --basesize: 4vw;
}

@font-face {
  font-family: "meta-old-french";
  src: url("fonts/Meta-old-French.otf") format("opentype");
  font-weight: normal;
  font-style: normal;
}

@font-face {
  font-family: "ocr-pbi-newsletter";
  src: url("fonts/Ocr-Pbi-newsletter.otf") format("opentype");
  font-weight: normal;
  font-style: normal;
}

body {
  font-family: "ocr-pbi-newsletter";
  background: white;
  color: #000;
}
article {
  text-align: left;
  font-size: var(--basesize);
  background: #000;
  color: white;
  padding: var(--padding);
  line-height: 1.25;
}

a {
  color: yellow;
}

a:hover {
  text-decoration-style: wavy;
  background-color: black;
}

p {
  max-width: 35em;
  margin: 0;
}

p.legende {
  position: absolute;
  top: 0;
  right: 0;
  font-size: .25em;
  line-height: 1.4;
  padding: var(--padding);
  text-align: right;
}

/* Taille par défaut des images et vidéos */
img {
  max-width: 100%;
  max-height: 100%;
  margin: 0;
  display: block;
}
video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  margin: 0 auto;
  display: block;
}

/* Images “fullscreen” */
.cover img,
.cover video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.contain img,
.contain video {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* Taille du texte */
.smalltext {
  font-size: .5em;
  line-height: 1.2;
}
.bigtext {
  font-size: 2.5em;
  line-height: 1.1;
}
.hugetext {
  font-size: 5em;
  line-height: 1;
}

/* intégration youtube, vimeo, etc. */
.embedded {
  background: white;
  position: absolute;
  inset: var(--padding);
}
.embedded iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

/* ------------------------------------------------------------------ Vue grille */
.grid {
  --basesize: calc(2vw / 4.5);
  overflow: auto;
  background: #eee;
  padding: 2em;
}

.grid .slides {
  position: static;
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 2em;
}

.grid article {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  position: relative;
  overflow: hidden;
  background: black;
  aspect-ratio: 16 / 9;
  padding: 1em !important;
  box-shadow: rgba(0, 0, 0, 0.16) 0px 1px 4px;
  color: white;
}

.grid article::after {
  position: absolute;
  right: 0;
  top: 0;
  font-size: 18px;
  content: attr(data-id);
  background: black;
  width: 3ch;
  text-align: center;
  empty-cells: 3;
}

.grid .embed {
  align-self: center;
}

.grid .embed::before {
  position: absolute;
  inset: 0;
  content: attr(rel);
  -ms-flex-item-align: center;
  align-self: center;
  text-align: center;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 2em;
  padding: 2em;
  word-break: break-all;
  margin: 0 auto;
  color: yellow;
}

/* ------------------------------------------------------------------ Print / PDF */
@media print {
  @page {
    margin: 0;
    size: A4 landscape;
  }
  #bar {
    display: none;
  }
  .embedded::before {
    content: attr(rel);
    z-index: 2;
    position: absolute;
    bottom: 0;
    left: 0;
    color: white;
    background: #000;
    padding: 0.5em 0.75em;
    font-size: 0.5em;
  }
}
