/* ============================================================
   Pizca Isarelli — Base
   ============================================================ */

/* TODO: Autoalojar las fuentes en /assets/fonts/ en WOFF2.
   Mientras tanto, se cargan desde Google Fonts.
   Fallbacks: Georgia/serif para Fraunces, system-ui/sans-serif para DM Sans. */

@import url('https://fonts.googleapis.com/css2?family=Fraunces:ital,opsz,wght@0,9..144,300;0,9..144,400;0,9..144,500;0,9..144,600;0,9..144,700;0,9..144,900;1,9..144,400;1,9..144,700&family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;0,9..40,600;1,9..40,400&display=swap');

@layer base {

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

html {
  font-size: 100%;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  hanging-punctuation: first last;
}

body {
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: var(--leading-normal);
  color: var(--text-primary);
  background-color: var(--surface-bg);
  min-height: 100dvh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* ---- Imágenes ---- */
img, svg, video {
  display: block;
  max-width: 100%;
}

img {
  height: auto;
  object-fit: cover;
}

/* ---- Tipografía base ---- */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-title);
  font-weight: 700;
  line-height: var(--leading-tight);
  color: var(--text-primary);
  text-wrap: balance;
}

h1 { font-size: var(--text-3xl); }
h2 { font-size: var(--text-2xl); }
h3 { font-size: var(--text-xl); }
h4 { font-size: var(--text-lg); }
h5 { font-size: var(--text-md); }
h6 { font-size: var(--text-base); }

p {
  max-width: var(--max-width-text);
  text-wrap: pretty;
}

p + p { margin-top: var(--space-4); }

a {
  color: var(--text-link);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  transition: color var(--transition-fast), text-decoration-color var(--transition-fast);
}

a:hover {
  color: var(--text-link-hover);
}

a:focus-visible {
  outline: 2px solid var(--color-terracota);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}

strong, b { font-weight: 600; }
em, i      { font-style: italic; }

/* ---- Listas ---- */
ul, ol {
  padding-left: var(--space-6);
}

li + li {
  margin-top: var(--space-2);
}

/* ---- Formularios ---- */
input, select, textarea, button {
  font-family: inherit;
  font-size: inherit;
}

button {
  cursor: pointer;
  background: none;
  border: none;
}

label {
  display: block;
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: var(--space-2);
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="search"],
select,
textarea {
  width: 100%;
  padding: var(--space-3) var(--space-4);
  border: var(--border);
  border-radius: var(--radius-md);
  background: var(--surface-card);
  color: var(--text-primary);
  font-size: var(--text-base);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
  appearance: none;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
input[type="number"]:focus,
input[type="search"]:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--color-terracota);
  box-shadow: 0 0 0 3px rgba(198, 93, 59, 0.15);
}

textarea {
  resize: vertical;
  min-height: 100px;
}

select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%235A4A3A' stroke-width='2'%3E%3Cpolyline points='6,9 12,15 18,9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}

/* ---- Utilidades de layout ---- */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.container--wide {
  max-width: var(--max-width-wide);
}

.container--text {
  max-width: var(--max-width-text);
}

/* ---- Skip link ---- */
.skip-link {
  position: absolute;
  top: -999px;
  left: var(--space-4);
  padding: var(--space-3) var(--space-6);
  background: var(--color-terracota);
  color: white;
  font-weight: 600;
  border-radius: 0 0 var(--radius-md) var(--radius-md);
  text-decoration: none;
  z-index: var(--z-toast);
  transform: translateY(-100%);
  transition: transform var(--transition-fast);
}

.skip-link:focus {
  top: 0;
  transform: translateY(0);
}

/* ---- Utilidades de texto ---- */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.text-center { text-align: center; }
.text-right  { text-align: right; }
.text-muted  { color: var(--text-muted); }
.text-small  { font-size: var(--text-sm); }

/* ---- Separador ---- */
hr {
  border: none;
  border-top: var(--border);
  margin-block: var(--space-8);
}

/* ---- Tablas ---- */
table {
  border-collapse: collapse;
  width: 100%;
}
th, td {
  text-align: left;
  padding: var(--space-3) var(--space-4);
  border-bottom: var(--border);
}
th {
  font-weight: 600;
  font-size: var(--text-sm);
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ---- Código ---- */
code {
  font-family: monospace;
  font-size: 0.9em;
  background: var(--surface-muted);
  padding: 0.1em 0.35em;
  border-radius: var(--radius-sm);
}

/* ---- Reducción de movimiento ---- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

} /* @layer base */
