* {
  margin: 0px;
  padding: 0;
}

:root {
  --links-color: #2c2cff;
  --modal-color: #eeeeee;
  --background-color: #cccccc;
  --margins: 0.6rem;
  --underline-offset: 0.2em;
  --home-text-color: black;
  --font-size-S: 14px;
  --line-height-S: 1rem;
  --font-size-M: calc(var(--font-size-S) * 1.5);
  --line-height-M: calc(var(--line-height-S) * 1.5);
  --font-size-L: calc(var());
  --font-size-L: calc(var(--font-size-S)* 3);
  --line-height-L: calc(var(--line-height-S) * 2.5);
  --border: 1px dashed;
  --modalBackdropColor: red;
}

body {
  color: var(--home-text-color);
  /* activate the following line to see the grid */
  /* background-image: linear-gradient(0deg, #bababa00 50%, #9e9e9e89 50%); */
  background-color: var(--background-color);
  background-size: 1rem 1rem;
  font-family: sans-serif;
  font-weight: normal;
  line-height: var(--line-height-S);
  font-size: var(--font-size-S);
  padding: var(--margins);
}

body.project {
  padding: 0;
  background-color: #6a6a6a;
}

main {
}

a {
  color: var(--links-color);
  text-decoration: none dashed 1px;
  /* text-underline-offset: var(--underline-offset); */
}

a:hover {
  color: black;
}

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

p {
  letter-spacing: normal;
}

header {
  z-index: 1;
  color: var(--home-text-color);
  max-width: 800px;
  width: fit-content;!i;!;
}

summary.menu-links {
  cursor: pointer;
  text-decoration: none dashed 1px;
  text-underline-offset: var(--underline-offset);
  color: var(--links-color);
  /* padding-left: calc(var(--margins) /2); */
  /* padding-top: calc(var(--margins) /2); */
}

summary:hover {
  color: black;
}

summary::marker {
  display: none;
  content: "";
}

#about {
  /* padding: 0.5rem; */
  background-color: transparent;
  /* color: white; */
  padding-left: calc(var(--margins) / 2);
  padding-top: calc(var(--margins) / 2);
}

.big-text {
  font-size: var(--font-size-S);
  line-height: var(--line-height-S);
}

.big-text p{
    /* padding-left: calc(var(--margins)/2); */
}

#filter-menu {
  text-wrap: balance;
  /* background-color: #9e9e9e; */
  border: var(--border);
  margin-top: var(--line-height-S););
  padding: calc(var(--margins) /2);
  !;!i;!;
}

#filters a {
  text-decoration: none;
  margin-left: 0.1rem;
  margin-right: var(--margins);
  color: var(--home-text-color);
}

.filter-box {
  /* padding: 0 0 1.13em 0; */
  /* border-radius: 0.4rem; */
  width: fit-content;
  display: inline-block;
}

.all-button {
  font-size: 48px;
  line-height: 1.5rem;
}

.thumbnail-container.thumb-S {
  height: 7rem;
}

.thumbnail-container.thumb-M {
  height: 10rem;
}

.thumbnail-container.thumb-L {
  height: 15rem;
}

.thumbnail-container img {
  height: auto;
  max-height: 100%;
}

.projects {
  list-style: none;
  padding: 0;
  margin-top: var(--line-height-S);
  font-size: 0;
}

.projects img {
}

.projects svg {
  width: auto;
  height: 100%;
}

.projects li {
  display: inline-block;
  vertical-align: top;
  margin-bottom: var(--margins);
  margin-right: var(--margins);
  background-color: #d69797;
  /* border: 1px solid; */
  padding: calc(var(--margins) / 2);
  padding-bottom: 0;
}

.projects a {
  text-decoration: none;
}

.projects a svg path {
  fill: currentColor !important;
}

.projects-titles {
  /* color: var(--home-text-color) !important; */!i;!;
  /* display: inline-table; */
  font-size: var(--font-size-S);
  max-width: 10rem;
  text-wrap: balance;
  line-height: var(--line-height-S);
  margin: calc(var(--line-height-S) / 4) 0;
}

.project-text {
  width: 35rem;
  max-width: calc(100vw - (var(--margins) * 4));
  padding: calc(var(--margins) / 2);
  margin: var(--margins);
  text-shadow: none;
  position: relative;
  z-index: 2;
  background-color: transparent;
}

.project-title {
  text-wrap: balance;
  text-transform: uppercase;
}

.project-info {
  text-align: center;
  width: auto;
  font-family: courier new;
  text-decoration: underline wavy 0.08em;
  text-transform: none;
  font-size: 0.8em;
  margin: 0 2rem 0.5rem 2rem;
  text-underline-offset: 0.5em;
}

#project-background {
  position: fixed;
  background-repeat: repeat;
  background-attachment: local;
  top: 0;
  bottom: 0;
  width: 100%;
  z-index: -1;
}

#colophon {
  margin-top: var(--line-height-M);
  font-size: var(--font-size-S);
  line-height: var(--line-height-S);
  position: absolute;
}

#colophon p {
  width: fit-content;
  padding: 0 calc(var(--margins) / 2) calc(var(--margins) * 2)
    calc(var(--margins) / 2);
}

/* PROJECT MODAL ------------------------------------- */

#project-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  border: none;
  max-width: 300vw;
  max-height: 300vh;
  /* box-shadow: 0.1em 0.1em 1em #0000002e; */
}

#project-modal::backdrop {
  cursor: pointer;
  opacity: 0;
  background-image: repeating-linear-gradient(45deg, #444cf700 25%, transparent 25%, transparent 75%, var(--modalBackdropColor) 75%, var(--modalBackdropColor)), repeating-linear-gradient(45deg, var(--modalBackdropColor) 25%, #00000000 25%, #00000000 75%, var(--modalBackdropColor) 75%, var(--modalBackdropColor));
  background-position: 0 0, 10px 10px;
  background-size: 20px 20px;
  mix-blend-mode: multiply;
}

.resizable {
  position: relative;
  background-color: var(--modal-color);
  width: 70vw;
  height: 90vh;
  min-width: 320px;
  min-height: 240px;
  max-width: calc(100vw - 12px);
  max-height: 100vh;
  overflow: auto; /* nécessaire pour que la poignée native apparaisse */
  box-sizing: border-box;
}

#project-frame {
  width: 100%;
  height: calc(
    100% - calc(var(--line-height-S
  )*2));); /* prend le reste sous le header */
  border: 0;
  display: block;
  z-index: 1;
  outline: none;
}

#iframe-overlay {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(
    var(--line-height-M) + var(--margins) + var(--margins)
  ); /* laisse la hauteur du header libre */
  bottom: 0;
  z-index: 5; /* au-dessus de l'iframe (z-index iframe ~1) */
  background: transparent; /* invisible, mais capte les events */
  display: none; /* caché par défaut */
  touch-action: none; /* empêche le défilement natif pendant capture */
  pointer-events: auto;
}

#project-window-bar {
  z-index: 10;
  position: relative;
  /* height: 48px; */
  display: flex;
  align-items: center;
  justify-content: space-between;
  /* padding: calc(var(--margins) / 2); */
  background: var(--modal-color);
  user-select: none;
  cursor: grab;
  line-height: var(--line-height-S);
}

#project-window-footer {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  font-size: var(--font-size-S);
  display: flex;
  justify-content: space-between;
  padding: 0 calc(var(--margins) * 2) 0 var(--margins);
  line-height: var(--line-height-S);
  background-color: var(--modal-color);
}

.projects-counter {
  margin-left: var(--margins);
}

.close-button {
  font: inherit;
  color: var(--links-color);
  padding: 0 var(--margins);
  border: none;
  /* border-right: 1px solid var(--links-color); */
  background: none;
  cursor: pointer;
}

.close-button:hover {
  color: var(--home-text-color);
}

#open-in-new-tab {
  padding: 0 var(--margins);
  /* border-left: 1px solid var(--links-color); */
}

#resize-handle {
  position: absolute;
  width: var(--line-height-S);
  height: var(--line-height-S);
  bottom: 0px;
  right: 0px;
  cursor: nwse-resize;
  touch-action: none; /* évite le scroll du navigateur pendant resize */
  z-index: 10;
  background-color: var(--modal-color);
}

#resize-handle::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: linear-gradient(
    135deg,
    transparent 0 12px,
    black 12px 13px,
    white 13px 14px,
    transparent 14px 15px,
    black 15px 16px,
    white 16px 17px,
    transparent 17px 18px,
    black 18px 19px,
    white 19px 20px,
    transparent 20px 21px
  );
  pointer-events: auto;
  bottom: 1px;
  right: 1px;
  opacity: 0.2;
}

#prev-project, #next-project{
border: none;
cursor: pointer;
color: var(--links-color);
}

.nav-arrow[disabled] {
  display: none;
}