/* Hogares de Paz — Polish layer (Paso B)
   Adds: smoother transitions, richer card interactions, refined typography,
   better empty states, page transitions, and consistent spacing.
   Loaded on top of tokens.css. */

/* ---------- Global typography refinement ---------- */

.hp-root {
  font-feature-settings: 'ss01', 'cv11', 'kern';
  text-rendering: optimizeLegibility;
}

/* Serif headings feel more considered: tighter tracking, better line-height */
.hp-serif {
  font-weight: 600;
  letter-spacing: -0.025em;
  line-height: 1.15;
  text-wrap: balance;
}

/* Body paragraphs read nicer */
p, .hp-p {
  text-wrap: pretty;
}

/* ---------- Smooth page/route transitions ---------- */

@keyframes hp-route-in {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}
main { animation: hp-route-in 0.28s cubic-bezier(.2,.9,.3,1) both; }

/* ---------- Card refinements ---------- */

.hp-card {
  transition: border-color 0.18s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

/* Interactive cards get a subtle lift on hover */
.hp-card-hover,
.hp-card[data-interactive="true"] {
  cursor: pointer;
}
.hp-card-hover:hover,
.hp-card[data-interactive="true"]:hover {
  border-color: var(--hp-ink-soft);
  box-shadow: 0 2px 4px rgba(10,31,68,0.04), 0 10px 28px rgba(10,31,68,0.07);
  transform: translateY(-1px);
}

/* ---------- Button micro-interactions ---------- */

.hp-btn {
  transition: background 0.16s ease, color 0.16s ease, border-color 0.16s ease, box-shadow 0.18s ease, transform 0.12s ease;
  position: relative;
}
.hp-btn:active { transform: translateY(0.5px); }
.hp-btn-primary {
  box-shadow: 0 1px 2px rgba(10,31,68,0.15), 0 2px 6px rgba(10,31,68,0.08);
}
.hp-btn-primary:hover {
  box-shadow: 0 2px 4px rgba(10,31,68,0.2), 0 6px 14px rgba(10,31,68,0.15);
}

/* ---------- Form elements — consistency ---------- */

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="tel"],
input[type="url"],
input[type="date"],
input[type="time"],
textarea,
select {
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}
input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--hp-ink) !important;
  box-shadow: 0 0 0 3px rgba(10,31,68,0.10);
}

/* ---------- Sidebar nav polish ---------- */

nav button, nav a {
  transition: background 0.14s ease, color 0.14s ease, padding 0.14s ease;
}

/* ---------- Scrollbar refinement ---------- */

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: var(--hp-line-strong);
  border-radius: 10px;
  border: 2px solid var(--hp-bg);
}
::-webkit-scrollbar-thumb:hover {
  background: var(--hp-ink-ghost);
}

/* ---------- Pill refinement ---------- */

.hp-pill {
  transition: background 0.15s, color 0.15s;
  font-weight: 500;
}

/* ---------- Empty state component ---------- */

.hp-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 56px 32px;
  text-align: center;
  color: var(--hp-ink-soft);
  border: 1px dashed var(--hp-line-strong);
  border-radius: var(--hp-r);
  background:
    radial-gradient(circle at top, rgba(10,31,68,0.02), transparent 70%);
}
.hp-empty svg { opacity: 0.5; margin-bottom: 14px; }
.hp-empty .hp-empty-title {
  font-family: var(--hp-sans);
  font-weight: 600;
  font-size: 17px;
  color: var(--hp-ink);
  margin-bottom: 6px;
  letter-spacing: -0.02em;
}
.hp-empty .hp-empty-sub {
  font-size: 13px;
  max-width: 360px;
  line-height: 1.55;
  margin-bottom: 18px;
}

/* ---------- Section dividers with character ---------- */

.hp-section-title {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 32px 0 16px;
}
.hp-section-title::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(to right, var(--hp-line), transparent);
}
.hp-section-title > span:first-child {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--hp-ink-ghost);
}

/* ---------- Subtle focus ring for accessibility ---------- */

*:focus-visible {
  outline: 2px solid color-mix(in oklab, var(--hp-ink) 50%, transparent);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ---------- Loading shimmer ---------- */

.hp-skeleton {
  background: linear-gradient(
    90deg,
    var(--hp-line) 0%,
    color-mix(in oklab, var(--hp-line) 60%, var(--hp-bg)) 50%,
    var(--hp-line) 100%
  );
  background-size: 200% 100%;
  animation: hp-shimmer 1.6s ease-in-out infinite;
  border-radius: 6px;
}

/* ---------- Chip/tag refinement ---------- */

.hp-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 500;
  background: var(--hp-gold-tint);
  color: var(--hp-ink);
  border: 1px solid color-mix(in oklab, var(--hp-ink) 15%, transparent);
}

/* ---------- Responsive density fixes ---------- */

@media (max-width: 900px) {
  main { padding: 20px 16px !important; }
}

/* ---------- Print-friendly hide ---------- */

@media print {
  nav, aside, .hp-btn, header button { display: none !important; }
}

/* ---------- Lesson body (rich HTML from manual) ---------- */

.hp-lesson-body h2 {
  font-family: var(--hp-serif, 'Cormorant Garamond', 'Source Serif 4', Georgia, serif);
  font-size: 22px;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--hp-wine, #7a1e3e);
  margin: 36px 0 14px;
  padding-bottom: 8px;
  border-bottom: 1px solid color-mix(in oklab, var(--hp-wine, #7a1e3e) 20%, transparent);
  text-wrap: pretty;
}
.hp-lesson-body h2:first-child { margin-top: 0; }

.hp-lesson-body h3 {
  font-family: var(--hp-serif, 'Cormorant Garamond', 'Source Serif 4', Georgia, serif);
  font-size: 17px;
  font-weight: 600;
  color: var(--hp-ink);
  margin: 24px 0 10px;
  text-wrap: pretty;
}

.hp-lesson-body h4 {
  font-size: 14px;
  font-weight: 600;
  color: var(--hp-ink);
  margin: 18px 0 8px;
  letter-spacing: 0.01em;
}

.hp-lesson-body p {
  margin: 10px 0;
  line-height: 1.75;
  text-wrap: pretty;
}

.hp-lesson-body strong { font-weight: 600; color: var(--hp-ink); }
.hp-lesson-body em { font-style: italic; }

.hp-lesson-body ul,
.hp-lesson-body ol {
  margin: 12px 0;
  padding-left: 24px;
}
.hp-lesson-body ul { list-style: disc; }
.hp-lesson-body ol { list-style: decimal; }

.hp-lesson-body li {
  margin: 6px 0;
  line-height: 1.7;
  text-wrap: pretty;
}

.hp-lesson-body ul ul,
.hp-lesson-body ol ol,
.hp-lesson-body ul ol,
.hp-lesson-body ol ul {
  margin: 6px 0;
}

.hp-lesson-body a {
  color: var(--hp-wine, #7a1e3e);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.hp-lesson-body blockquote {
  margin: 14px 0;
  padding: 2px 0 2px 18px;
  border-left: 3px solid var(--hp-wine, #7a1e3e);
  font-style: italic;
  color: var(--hp-ink-soft);
}
