﻿/* Base variables */
:root {
  --color-background: #e3dedd;
  --color-foreground: #000000;
  --color-paper: #ffffff;
  --color-placeholder: #bfb9b8;
  --color-accent: #86341c;
  --color-space: #bfb9b8;
}

/* Reset e stile base */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  background-color: var(--color-background);
  color: var(--color-foreground);
  font-family: 'Cousine', 'Courier New', monospace;
  font-size: 16px;
  padding: 0.5rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 2rem;
}

@media (hover: none) and (pointer: coarse) {
  body {
    min-height: 100svh;
  }
}

/* Utility flex */
.flex-row       { display: flex; flex-direction: row; }
.flex-column    { display: flex; flex-direction: column; }
.wrap           { flex-wrap: wrap; }
.flex-1         { flex: 1; }
.flex-2         { flex: 2; }
.grow-1         { flex-grow: 1; }
.gap-xs         { gap: 0.25rem; }
.gap-sm         { gap: 0.5rem; }
.gap-md         { gap: 1rem; }
.gap-lg         { gap: 2rem; }

/* Allineamento */
.justify-center { justify-content: center; }
.justify-space  { justify-content: space-between; }
.justify-end    { justify-content: flex-end; }
.align-center   { align-items: center; }
.align-end      { align-items: flex-end; }

/* Contenitori */
.paper {
  min-height: 1.375rem;
  max-width: 1024px;
  padding: 2px;
  background-color: var(--color-paper);
}
#inputArea {
  position: absolute;
  opacity: 0;
  pointer-events: none;
  height: 0;
  width: 0;
}
#content {
  width: 100%;
  max-width: 100%;
  position: relative;
  word-wrap: break-word;
  text-align: left;
  outline: none;
}
#placeholder {
  color: var(--color-placeholder);
  pointer-events: none;
  user-select: none;
}
.hidden {
  display: none;
}

/* Elementi di pausa */
.pause {
  display: inline-block;
  width: 0.5em;
  background-color: var(--color-background);
  opacity: 1;
  transition: opacity 0.5s ease;
}
.new-pause {
  opacity: 0;
  animation: fadeIn 0.5s ease forwards;
}
@keyframes fadeIn {
  to {
    opacity: 1;
  }
}

.space {
  background-color: var(--color-space);
}

/* Tipografia */
h1 {
  font-size: 1.5rem;
}
h1, h2, h3 {
  font-weight: normal;
}
footer p {
  text-align: center;
}

/* Link e bottoni */
a, button {
  color: var(--color-foreground);
  transition: color 0.3s ease;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}
button {
  cursor: pointer;
  font-size: 1rem;
  background: none;
  border: none;
  text-decoration: underline;
}
a:active,
button:active {
  color: var(--color-accent);
}
@media (hover: hover) and (pointer: fine) {
  a:hover,
  button:hover {
    color: var(--color-accent);
  }
}

/* Evidenziazione selezione */
::selection {
  color: #ffffff;
  background: #86341c;
}
