@font-face {
  font-family: 'Police du site';
  src: url('./fonts/payzant-pen-nf.regular.ttf');
  font-display: swap;
}

@font-face {
  font-family: 'Remachine Script';
  src: url('./fonts/RemachineScript_Personal_Use.ttf') format('truetype');
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: 'MyType';
  src: url('./fonts/mytype-web.ttf?v=2') format('truetype');
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

:root {
  --site-font: 'Police du site', system-ui, sans-serif;
  color-scheme: light;
  font-family: var(--site-font);
  color: #282b25;
  background: #f3eee5;
  --paper: #fffaf0;
  --cream: #f3eee5;
  --ink: #282b25;
  --forest: #183d34;
  --forest-strong: #102d26;
  --muted: #555d53;
  --line: #d9d4c9;
  --berry: #932b32;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
p, figure { margin: 0; }
h1, h2, h3, h4, h5, h6 {
  display: block;
  margin: 0;
  padding: 0;
  font: 650 1rem/1.25 var(--site-font);
  color: inherit;
}
h2 { font-size: clamp(1.2rem, 2.5vw, 1.6rem); }
h3 { font-size: clamp(1.05rem, 2vw, 1.2rem); }
h4, h5, h6 { font-size: 1rem; }
button, input, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; }
fieldset { min-inline-size: 0; margin: 0; padding: 0; border: 0; }
legend { padding: 0; }
img { display: block; max-inline-size: 100%; }

:focus-visible {
  outline: 3px solid #338476;
  outline-offset: 3px;
}

h1:focus, .calendar-grid:focus { outline: none; }

.visually-hidden {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.screen {
  min-block-size: 100vh;
  min-block-size: 100svh;
  padding: clamp(1rem, 4vw, 3rem);
}

.backdrop {
  color: var(--paper);
  background-color: #162d27;
  background-image: linear-gradient(155deg, #11271fba, #10231c5c 57%, #171a15aa), var(--background-image, none);
  background-position: center;
  background-size: cover;
}

.login, .puppet-screen {
  display: grid;
  align-items: center;
  justify-items: center;
}

.puppet-screen { background: var(--cream); }
.puppet-confirmation { margin-block-end: 1.25rem; line-height: 1.5; overflow-wrap: anywhere; }

.login-card {
  inline-size: min(100%, 31rem);
  padding: clamp(1.25rem, 5vw, 2.7rem);
  color: var(--ink);
  background: var(--paper);
  border: 1px solid #e0d7c8;
  border-radius: 1.6rem;
  box-shadow: 0 1.5rem 4rem #091a1480;
}

h1 {
  font: 600 clamp(1.5rem, 3vw, 2.3rem)/1.15 var(--site-font);
  letter-spacing: -0.02em;
  text-wrap: balance;
}

.login-card h1 {
  margin-block-end: 1.25rem;
  font-size: clamp(1.4rem, 3vw, 1.9rem);
  color: var(--forest-strong);
}

.login-card legend, .password-label {
  font-size: 0.95rem;
  font-weight: 650;
}

.profiles {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-block: 0.6rem 1.25rem;
}

.profile-chip { position: relative; }

.profile-chip-content {
  display: flex;
  min-block-size: 2.75rem;
  align-items: center;
  gap: 0.4rem;
  padding: 0.2rem 0.75rem 0.2rem 0.2rem;
  border: 1px solid var(--line);
  border-radius: 10rem;
  background: #fffdf8;
  color: var(--forest);
  font-weight: 650;
  cursor: pointer;
}

.profile-chip input:checked + .profile-chip-content {
  color: #fff;
  background: var(--forest);
  border-color: var(--forest);
}

.profile-chip input:focus-visible + .profile-chip-content {
  outline: 3px solid #338476;
  outline-offset: 3px;
}

.profile-chip input:disabled + .profile-chip-content { cursor: default; }

.password-field {
  position: relative;
  margin-block: 0.4rem 1rem;
}

.password-field input, .puppet-name-form input, textarea {
  inline-size: 100%;
  min-block-size: 2.75rem;
  padding: 0.65rem 0.8rem;
  color: var(--ink);
  background: #fffefa;
  border: 1px solid #b9b6aa;
  border-radius: 0.6rem;
}

.password-field input { padding-inline-end: 3rem; }
.password-field input::-ms-reveal { display: none; }

.password-toggle {
  position: absolute;
  inset-block: 0;
  inset-inline-end: 0.15rem;
  display: grid;
  inline-size: 2.75rem;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 0.5rem;
  background: transparent;
  color: var(--muted);
}

.password-toggle:hover:enabled { color: var(--forest-strong); }
.password-toggle:focus-visible { outline-offset: -4px; }

.password-eye {
  position: relative;
  display: grid;
  inline-size: 1.2rem;
  block-size: 1.2rem;
  place-items: center;
}

.password-eye::before {
  content: '';
  inline-size: 0.85rem;
  block-size: 0.85rem;
  border: 1.5px solid currentColor;
  border-radius: 70% 15%;
  background: radial-gradient(circle, currentColor 0.15rem, transparent 0.17rem);
  transform: rotate(45deg);
}

.password-field input[type='password'] + .password-toggle .password-eye::after {
  content: '';
  position: absolute;
  inline-size: 1.25rem;
  block-size: 2px;
  background: currentColor;
  box-shadow: 0 1px #fffefa;
  transform: rotate(45deg);
}

input[aria-invalid='true'] { border-color: var(--berry); }
textarea { display: block; resize: vertical; }

.puppet-name-form label { font-weight: 650; }
.puppet-name-form input { display: block; margin-block: 0.4rem 1rem; }

.primary, .secondary {
  display: inline-flex;
  min-block-size: 2.75rem;
  align-items: center;
  justify-content: center;
  padding: 0.5rem 0.9rem;
  border: 1px solid transparent;
  border-radius: 0.65rem;
  font-weight: 675;
  line-height: 1.25;
  text-align: center;
}

.primary { background: var(--forest); color: #fff; }
.primary:hover:enabled { background: var(--forest-strong); }
.login-card .primary { inline-size: 100%; }
.secondary { color: var(--forest-strong); background: #fffdf8; border-color: var(--line); }
.secondary:hover:enabled { background: #e8eee6; }
.primary:disabled, .secondary:disabled { opacity: 0.55; }
.delete-photo { color: var(--berry); }

.notice {
  padding: 0.75rem 0.9rem;
  border-radius: 0.65rem;
  line-height: 1.4;
}

.notice.error {
  color: #6d1d24;
  background: #fae8e6;
  border: 1px solid #e6bdb9;
}

.login-card .notice { margin-block-start: 0.9rem; }
.status { margin: clamp(1rem, 6vw, 3rem) auto; inline-size: min(90%, 32rem); }
.status button { margin-block-start: 0.7rem; }

.calendar {
  position: relative;
  display: flex;
  flex-direction: column;
  min-block-size: 100dvh;
  padding: clamp(0.5rem, 2vw, 1.5rem);
  background-image: var(--background-image, none);
  background-size: 100% 100%;
}

.calendar > .notice { margin-block-end: 0.5rem; }

.calendar-logout {
  position: absolute;
  inset-block-end: 0.25rem;
  inset-inline-end: 0.25rem;
  display: grid;
  place-items: center;
  inline-size: 2.5rem;
  block-size: 2.5rem;
  appearance: none;
  padding: 0;
  border: 0;
  color: #808080;
  background: transparent;
  font-size: 1.25rem;
  line-height: 1;
}

.calendar-grid {
  display: grid;
  flex: 1;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-template-rows: repeat(6, minmax(2.5rem, 1fr));
  margin: 0;
  padding: 0;
  list-style: none;
}

.calendar-grid > li { display: grid; place-items: center; }

.calendar-case {
  position: relative;
  display: grid;
  place-items: center;
  appearance: none;
  inline-size: clamp(2.5rem, min(14vw, 13vh), 6.5rem);
  aspect-ratio: 1;
  padding: 0;
  color: #ffff00;
  background: transparent;
  border: 2px solid currentColor;
}

.calendar-case:hover:enabled .case-number { transform: scale(1.1); }
.calendar-case:disabled { opacity: 0.72; }

.case-number {
  font: 600 clamp(1.5rem, min(6vw, 8vh), 4rem)/1 var(--site-font);
  -webkit-text-stroke: 2px #000;
  paint-order: stroke fill;
}

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.19rem 0.38rem;
  border-radius: 10rem;
  color: #fff;
  background: var(--berry);
  font-size: 0.65rem;
  font-weight: 760;
  line-height: 1;
  letter-spacing: 0.01em;
}

.calendar-case .badge {
  position: absolute;
  inset-block-start: 0;
  inset-inline-end: 0;
  transform: translate(35%, -35%);
}

.paper-screen {
  color: var(--ink);
  background: var(--cream);
}

.editor-shell { max-inline-size: 59rem; }
.editor-shell .notice { margin-block-end: 0.65rem; }
.save-status { min-block-size: 1.4rem; margin-block-end: 0.6rem; color: var(--muted); font-size: 0.9rem; }
.editor-blocks { display: grid; gap: 0.7rem; }

.puppet-editor { margin-block-end: 0.6rem; }

.puppet-row, .puppet-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.3rem 0.8rem;
}

.puppet-heading, .participant-header h3 {
  color: var(--forest-strong);
  font: 400 clamp(1.65rem, 1.25rem + 1.4vw, 2.25rem)/1.3 'Remachine Script', 'Segoe Print', 'Bradley Hand', cursive;
  overflow-wrap: anywhere;
}

.puppet-rename {
  min-block-size: 2.75rem;
  padding: 0;
  border: 0;
  color: var(--forest);
  background: transparent;
  font-size: 0.85rem;
  text-decoration: underline;
  text-underline-offset: 0.18em;
}

.puppet-editor .puppet-name-form {
  max-inline-size: 30rem;
  margin-block-start: 0.5rem;
  padding: 0.85rem;
  border: 1px solid var(--line);
  border-radius: 0.75rem;
  background: var(--paper);
}

.puppet-editor .notice { margin-block: 0.65rem 0; }

.upload-widget {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 0.7rem;
  color: var(--forest);
  background: #f8f6ed;
  border: 1px dashed #7c8b79;
  border-radius: 0.75rem;
}

.upload-widget:hover, .upload-widget.dragging { background: #e4eee4; }
.upload-choice {
  position: relative;
  display: flex;
  min-block-size: 2.75rem;
  align-items: center;
  gap: 0.75rem;
  cursor: pointer;
}

.upload-choice:focus-within { outline: 3px solid #338476; outline-offset: 2px; }
.upload-camera { display: none; }
fieldset:disabled .upload-widget { opacity: 0.6; }
fieldset:disabled .upload-choice { cursor: default; }

.upload-plus {
  flex: 0 0 2rem;
  display: grid;
  place-items: center;
  block-size: 2rem;
  border-radius: 50%;
  color: #fff;
  background: var(--forest);
  font-size: 1.25rem;
  line-height: 1;
}

.upload-hint { display: block; font-size: 0.8rem; color: var(--muted); }

.editor-block {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1rem;
  padding: clamp(0.75rem, 2vw, 1.1rem);
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 0.85rem;
}

.photo-preview {
  display: block;
  align-self: start;
  max-inline-size: min(100%, 50vw);
  margin-inline: auto;
  padding: 0;
  border: 0;
  border-radius: 0.55rem;
  background: transparent;
  cursor: zoom-in;
}

.photo-preview img {
  max-block-size: 50vh;
  max-block-size: 50dvh;
  object-fit: contain;
  border-radius: 0.55rem;
}

.photo-viewer {
  --viewer-margin: clamp(0.5rem, 2vw, 1.1rem);
  position: fixed;
  inset: 0;
  inline-size: 100%;
  block-size: 100%;
  max-inline-size: none;
  max-block-size: none;
  margin: 0;
  padding: var(--viewer-margin);
  overflow: hidden;
  border: 0;
  color: #fff;
  background: #101410;
}

.photo-viewer[open] { display: grid; place-items: center; }
.photo-viewer::backdrop { background: #101410; }
body:has(.photo-viewer[open]) { overflow: hidden; }

.photo-viewer-picture {
  inline-size: min(100%, calc((100vh - var(--viewer-margin) * 2) * var(--photo-ratio, 1)));
  inline-size: min(100%, calc((100dvh - var(--viewer-margin) * 2) * var(--photo-ratio, 1)));
  aspect-ratio: var(--photo-ratio, 1);
  padding: 0;
  border: 0;
  background: transparent;
  cursor: zoom-out;
}

.photo-viewer-picture img {
  inline-size: 100%;
  block-size: 100%;
  object-fit: contain;
}

.photo-viewer-close {
  position: absolute;
  z-index: 1;
  inset-block-start: var(--viewer-margin);
  inset-inline-end: var(--viewer-margin);
  display: grid;
  inline-size: 2.75rem;
  block-size: 2.75rem;
  place-items: center;
  padding: 0;
  border: 1px solid #ffffff80;
  border-radius: 50%;
  color: #fff;
  background: #101410eb;
  font-size: 1.65rem;
  line-height: 1;
}

.photo-viewer button:focus-visible { outline-color: #fff; }

.block-controls label span { display: block; margin-block-end: 0.4rem; font-weight: 650; }
.block-actions { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-block-start: 0.65rem; }
.block-actions .secondary { font-size: 0.875rem; }
.editor-actions { display: flex; justify-content: flex-end; margin-block-start: 1rem; }
.photo-required { color: var(--forest-strong); font-weight: 650; }

.editor-login {
  inline-size: min(92vw, 28rem);
  padding: clamp(1rem, 4vw, 1.65rem);
  border: 1px solid var(--line);
  border-radius: 0.9rem;
  color: var(--ink);
  background: var(--paper);
  box-shadow: 0 0.7rem 2rem #10231c48;
}

.editor-login::backdrop { background: #10231cb8; }
.editor-login-profile { margin-block: 0.4rem 1rem; }
.editor-login .notice { margin-block-start: 0.75rem; }
.editor-login-actions { display: flex; flex-wrap: wrap; gap: 0.45rem; }

.page-toolbar-screen {
  --page-gutter: clamp(0.65rem, 3vw, 1.75rem);
  padding: 0;
}

.page-toolbar-top {
  position: sticky;
  z-index: 2;
  inset-block-start: 0;
  box-shadow: 0 3px 9px #102d2620;
}

.page-toolbar {
  color: var(--paper);
  background: var(--forest-strong);
}

.page-toolbar-inner, .content-navigation, .publications-body {
  max-inline-size: 72rem;
}

.page-toolbar-inner, .content-navigation, .publications-body, .editor-shell {
  margin-inline: auto;
  padding-inline: var(--page-gutter);
}

.page-toolbar-inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: clamp(0.35rem, 2vw, 1rem);
  min-block-size: 3.5rem;
  padding-block: 0.25rem;
}

.page-toolbar-inner h1 {
  overflow: hidden;
  font-size: clamp(0.95rem, 4.7vw, 1.55rem);
  text-wrap: nowrap;
  text-overflow: ellipsis;
}

.page-toolbar-inner .back {
  min-block-size: 2.75rem;
  padding: 0.3rem clamp(0.45rem, 2vw, 0.9rem);
  border: 1px solid #b8cec4;
  border-radius: 0.5rem;
  color: inherit;
  background: #ffffff10;
  font-size: clamp(0.72rem, 3.1vw, 0.9rem);
  font-weight: 500;
  line-height: 1.25;
  white-space: nowrap;
}

.page-toolbar-inner .back:hover:enabled { background: #ffffff26; }
.page-toolbar-inner .back:focus-visible { outline-color: var(--paper); }
.page-toolbar-inner .back:disabled { opacity: 0.6; }

.publications-navigation {
  border-block-end: 1px solid #bccdc2;
  background: #e2ebe2;
}

.content-navigation {
  display: grid;
  grid-template-columns: 2rem minmax(0, 1fr) 2rem;
  align-items: center;
  gap: 0.35rem;
  padding-block: 0.35rem;
}

.content-strip {
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
  user-select: none;
}

.content-strip::-webkit-scrollbar { display: none; }
.content-strip.dragging, .content-strip.dragging button { cursor: grabbing; }

.content-strip-days {
  display: flex;
  min-inline-size: 100%;
  inline-size: max-content;
  justify-content: center;
  gap: 0.4rem;
  margin: 0;
  padding: 0.55rem 0.4rem 0.85rem;
  list-style: none;
}

.content-day-tile {
  position: relative;
  display: grid;
  min-inline-size: 4.25rem;
  min-block-size: 3.6rem;
  place-items: center;
  align-content: center;
  gap: 0.15rem;
  padding: 0.25rem 0.4rem;
  border: 1px solid #dfd0c6;
  border-block-start: 0.22rem solid var(--berry);
  border-radius: 0.3rem 0.3rem 0.65rem 0.25rem;
  color: var(--berry);
  background: linear-gradient(160deg, #fffdf7 80%, #f3e6d8);
  box-shadow: 0.12rem 0.22rem 0.28rem #69584c35;
}

.content-day-tile[aria-current='date'] {
  border-color: var(--forest-strong);
  color: var(--paper);
  background: var(--forest-strong);
  box-shadow: 0 2px 5px #102d2630;
  scale: 1.15;
}

.content-day-tile[aria-current='date']::after {
  content: '';
  position: absolute;
  inset-block-end: -0.45rem;
  inset-inline: 25%;
  block-size: 0.15rem;
  border-radius: 1rem;
  background: var(--forest-strong);
}

.content-day-tile .day-number { font: 700 1.55rem/0.9 var(--site-font); }
.content-day-tile .day-month { font-size: 0.72rem; font-weight: 700; }

.content-day-tile .badge {
  position: absolute;
  inset-block-start: -0.38rem;
  inset-inline-end: 0.15rem;
}

.content-arrow {
  position: relative;
  display: grid;
  min-block-size: 2.75rem;
  place-items: center;
  padding: 0;
  border: 1px solid #a3b7aa;
  border-radius: 0.55rem;
  color: var(--forest-strong);
  background: var(--paper);
}

.content-arrow:hover { background: #e4eee4; }
.content-arrow[hidden] { display: grid !important; visibility: hidden; }
.content-chevron { font-size: 1.55rem; line-height: 1; }

.content-arrow-news {
  position: absolute;
  z-index: 1;
  inset-block-start: -0.5rem;
  inset-inline-start: 50%;
  transform: translateX(-50%);
  white-space: nowrap;
}

.publications-body, .editor-shell { padding-block: clamp(1rem, 4vw, 2rem) 2rem; }
.publications-body > .notice { margin-block-end: 1rem; }
.content-days { display: grid; gap: clamp(1.6rem, 5vw, 4rem); }
.content-day-empty { color: var(--muted); }

.day-sections { display: grid; gap: 1rem; }

.participant {
  min-inline-size: 0;
  overflow: hidden;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 0.9rem;
}

.participant-header {
  display: flex;
  min-block-size: 3.7rem;
  inline-size: 100%;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem clamp(0.65rem, 2vw, 1.25rem);
  background: #e9eee6;
}


.participant-header .edit {
  display: grid;
  flex: 0 0 2.75rem;
  inline-size: 2.75rem;
  block-size: 2.75rem;
  place-items: center;
  margin-inline-start: auto;
  padding: 0;
  border: 0;
  border-radius: 0.65rem;
  color: var(--forest-strong);
  background: transparent;
}

.participant-header .edit:hover { background: #dbe7db; }
.participant-header .edit svg { inline-size: 1.05rem; block-size: 1.05rem; }

.avatar {
  display: grid;
  flex: none;
  inline-size: 48px;
  block-size: 48px;
  place-items: center;
  overflow: hidden;
  color: #fff;
  background: var(--forest);
  border-radius: 50%;
  font-weight: 700;
}

button.avatar { padding: 0; border: 0; cursor: zoom-in; }

.avatar img { inline-size: 100%; block-size: 100%; object-fit: cover; }

.participant-posts {
  display: grid;
  gap: 1rem;
  inline-size: min(100%, 52rem);
  margin-inline: auto;
  padding: clamp(0.75rem, 2vw, 1.25rem);
}

.block-controls textarea,
.participant-posts figcaption {
  font-family: 'MyType', var(--site-font);
}

.participant-posts figcaption {
  margin-block-start: 0.6rem;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  line-height: 1.55;
}

@media (min-width: 38rem) {
  .editor-block { grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); }
}

@media (orientation: portrait) and (pointer: coarse) and (max-width: 45rem) {
  .photo-preview { max-inline-size: 100%; }
}

@media (orientation: landscape) {
  .calendar {
    background-image: var(--background-landscape-image, var(--background-image, none));
  }

  .calendar-grid {
    grid-template-columns: repeat(6, minmax(0, 1fr));
    grid-template-rows: repeat(4, minmax(2.5rem, 1fr));
  }
}

@media (pointer: coarse) and (max-width: 60rem) {
  .upload-camera {
    display: flex;
    padding-inline: 0.65rem;
    border: 1px solid var(--line);
    border-radius: 0.65rem;
    background: #fffdf8;
  }
}
