/* Скицникът (src/schizzi/): листовете във формата и в картата (редакторът — schizzo-editor.css). Листът е
   бял като хартия и в тъмната тема — така ще излезе и в печата. */

/* `hidden` печели и над елементите със собствен `display` (лентите с бутоните). */
.schizzi [hidden] {
  display: none;
}

.schizzi__fogli {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr));
  gap: 16px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.schizzi__fogli:not(:empty) {
  margin-bottom: 16px;
}

/* На страницата на картата — с отстъпа на полетата на разделите (sheet.css, `.kv`). */
.sheet__section > .schizzi__fogli {
  margin: 0;
  padding: 18px;
}

.schizzi > .toolbar + .field__hint {
  margin-top: 10px;
}

.schizzi__foglio {
  display: grid;
  gap: 8px;
  align-content: start;
}

.schizzi__figura {
  display: grid;
  gap: 6px;
  margin: 0;
}

.schizzo {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 7 / 5;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #ffffff;
}

.schizzi__piede {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.schizzi__nome {
  font-weight: 600;
}

/* Прегледът е бутон: във формата отваря редактора, на страницата на картата — листа на цял екран. */
.schizzi__anteprima {
  display: block;
  width: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  cursor: zoom-in;
}

.schizzi__anteprima:focus-visible {
  outline: 2px solid var(--fg);
  outline-offset: 2px;
  border-radius: var(--radius);
}

/* Листът на цял екран (schizzo-intero.js): горе името и „Chiudi“, отдолу листът — колкото позволява
   екранът, с пропорциите си. */
.schizzo-intero {
  width: 100%;
  max-width: none;
  height: 100%;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: var(--bg);
  color: var(--fg);
}

.schizzo-intero[open] {
  display: flex;
  flex-direction: column;
}

.schizzo-intero::backdrop {
  background: var(--bg);
}

.schizzo-intero__testa {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 6px var(--gutter);
  border-bottom: 1px solid var(--line);
}

.schizzo-intero__titolo {
  margin: 0;
  font-size: 1.05rem;
}

.schizzo-intero__corpo {
  display: grid;
  flex: 1;
  place-items: center;
  min-height: 0;
  padding: 8px;
  background: var(--wash);
}

.schizzo-intero__corpo .schizzo {
  width: 100%;
  height: 100%;
  max-height: 100%;
  aspect-ratio: auto;
}

/* Телефон изправен: листът е легнал — подсказка да се завърти (като в редактора). */
.schizzo-intero__ruota {
  display: none;
  margin: 0;
  padding: 6px var(--gutter);
  color: var(--muted);
  font-size: 0.85rem;
  text-align: center;
}

@media (orientation: portrait) and (max-width: 640px) {
  .schizzo-intero__ruota {
    display: block;
  }
}
