/* ============================================================
   Heartscore — global stylesheet
   v1, neutral: Helvetica Neue, greyscale.
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Archivo+Black&display=swap');

body { margin: 0; }
.site-bar, .breadcrumbs-bar, .progress-bar { margin: 0!important; }

:root {
  --paper: #fafafa;
  --ink: #1a1a1a;
  --ink-soft: #555;
  --ink-faint: #888;
  --rule: #e0e0e0;
  --card-readcrumbg: #f0f0f0;

  --status-complete: #1a1a1a;
  --status-incomplete: #888;
  --status-onhold: #c0c0c0;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: -apple-system, "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 1rem;
  line-height: 1.5;
}

/* --- breadcrumbs / site bar --- */

.site-bar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--paper);
  border-bottom: 1px solid var(--rule);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  padding: 0.5rem 1.25rem 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  row-gap: 0.5rem;
}

.site-bar > .breadcrumbs {
  flex-basis: 100%;
  order: 3;
  margin: 0 -1.25rem;
  padding: 0.25rem 1.25rem;
  border-top: 1px solid var(--rule);
  background: var(--paper);
  font-size: 0.8125rem;
  color: var(--ink-faint);
  line-height: 1.2;
}


.site-logo {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
}

.site-logo img {
  height: 48px;
  width: auto;
  display: block;
}

.site-menu {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.breadcrumbs-bar {
  position: sticky;
  top: 37px;
  z-index: 49;
  background: var(--paper);
  border-bottom: 1px solid var(--rule);
  padding: 0.4rem 1.25rem;
  font-size: 0.8125rem;
  color: var(--ink-faint);
  line-height: 1.3;
}

.breadcrumbs {
  width: 100%;
}

.breadcrumbs a {
  color: var(--ink-faint);
  text-decoration: none;
}
.breadcrumbs a:hover { color: var(--ink); text-decoration: underline; }
.breadcrumbs [aria-current="page"] { color: var(--ink); }
.crumb-sep { margin: 0 0.4em; color: var(--ink-faint); }

/* --- page wrapper --- */

.wrapper {
  max-width: 640px;
  margin: 0 auto;
  padding: 2rem 1.25rem 4rem;
  text-align: center;
}

/* --- typography --- */

h1, h2, h3, h4, h5, h6 {
  font-weight: 600;
  margin: 0 0 1rem;
  line-height: 1.1;
}

h1 {
  font-size: 2rem;
  margin: 1.5rem 0 1.5rem;
}

h2 {
  font-size: 1.125rem;
  font-weight: 600;
  margin: 1.5rem 0 0.5rem;
}

h3 {
  font-size: 1.125rem;
  margin: 2rem 0 0.5rem;
}

h3 a {
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1px solid var(--ink);
}
h3 a:hover { background: var(--ink); color: var(--paper); }

h4 {
  font-size: 0.875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ink-soft);
  margin: 2.5rem 0 1rem;
}

p {
  margin: 0 0 1.25rem;
  font-size: 1.0625rem;
  line-height: 1.55;
}

a { color: var(--ink); }

/* --- card sections --- */

.card {
  background: var(--card-bg);
  border-radius: 4px;
  padding: 1.5rem 1.25rem;
  margin: 0 0 1rem;
}

.card p { margin: 0 0 1rem; }
.card p:last-child { margin-bottom: 0; }

/* --- hub realm sections --- */

.realm ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.realm li { padding: 10px 0; }

.realm a { text-decoration: none; }
.realm a:hover { text-decoration: underline; }

.izq-link { font-weight: 600; }

.status-complete { color: var(--status-complete); }
.status-incomplete { color: var(--status-incomplete); }
.status-onhold { color: var(--status-onhold); }

/* --- Q reference button --- */

.q-button {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0.5rem 0 1.5rem;
  padding: 0.4rem 0.75rem 0.4rem 0.5rem;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 0.8125rem;
  background: transparent;
  color: var(--ink-soft);
  border: 1px solid var(--rule);
  border-radius: 3px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.q-button::before {
  content: "Q";
  font-family: 'Archivo Black', -apple-system, "Helvetica Neue", Arial, sans-serif;
  font-size: 1.25rem;
  font-weight: 400;
  line-height: 1;
}
.q-button:hover,
.q-button:focus-visible {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
  outline: none;
}

/* --- Q modal --- */

.q-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  z-index: 100;
}
.q-modal[hidden] { display: none; }

.q-modal-content {
  background: var(--paper);
  max-width: 480px;
  width: 100%;
  padding: 2rem 1.5rem 1.75rem;
  border-radius: 4px;
  position: relative;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.q-modal-close {
  position: absolute;
  top: 0.5rem;
  right: 0.75rem;
  background: transparent;
  border: none;
  font-size: 1.5rem;
  line-height: 1;
  color: var(--ink-soft);
  cursor: pointer;
  padding: 0.25rem 0.5rem;
}
.q-modal-close:hover { color: var(--ink); }

.q-modal-id {
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 0.8125rem;
  color: var(--ink-faint);
  margin: 0 0 1rem;
  letter-spacing: 0.05em;
}

.q-modal-text {
  font-size: 1.125rem;
  line-height: 1.5;
  margin: 0;
}

/* --- mobile --- */

@media (max-width: 640px) {
  .wrapper { padding: 1.5rem 1rem 3rem; }
  .site-bar { padding: 0.625rem 1rem; font-size: 0.75rem; }
  h1 { font-size: 1.75rem; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* --- Progress bar --- */

.progress-bar {
  position: sticky;
  top: 68px;
  z-index: 48;
  background: var(--paper);
  border-bottom: 1px solid var(--rule);
  padding: 0.5rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.8125rem;
}

.progress-track {
  flex: 1;
  height: 6px;
  background: var(--rule);
  border-radius: 3px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: var(--ink);
  transition: width 0.3s ease;
}

.progress-text {
  color: var(--ink-faint);
  font-variant-numeric: tabular-nums;
  font-size: 0.75rem;
  min-width: 3.5em;
  text-align: right;
}

.progress-settings {
  background: transparent;
  border: none;
  cursor: pointer;
  font-size: 1rem;
  color: var(--ink-faint);
  padding: 0.25rem 0.5rem;
  line-height: 1;
}
.progress-settings:hover { color: var(--ink); }

/* --- "I've read this" button --- */

.read-button-wrap {
  margin-top: 3rem;
  text-align: center;
}

.read-button {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--ink);
  border-radius: 4px;
  padding: 0.75rem 1.5rem;
  font-size: 0.9375rem;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.read-button:hover { background: var(--ink); color: var(--paper); }
.read-button.is-read {
  background: var(--ink);
  color: var(--paper);
}

/* --- Locked level state on theme home --- */

.realm a.is-locked {
  pointer-events: none;
  color: var(--ink-faint);
  opacity: 0.6;
}
.realm a.is-locked::before {
  content: "🔒 ";
}

.unlock-override {
  display: inline-block;
  margin-left: 0.75rem;
  background: transparent;
  color: var(--ink-faint);
  border: 1px solid var(--rule);
  border-radius: 3px;
  padding: 0.2rem 0.6rem;
  font-size: 0.75rem;
  cursor: pointer;
}
.unlock-override:hover {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
}

/* --- Hub per-theme % --- */

.hub-progress {
  color: var(--ink-faint);
  font-size: 0.875rem;
}

/* --- Clear-progress button in settings modal --- */

.clear-progress {
  margin-top: 1rem;
  background: transparent;
  color: #b00;
  border: 1px solid #b00;
  border-radius: 3px;
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  cursor: pointer;
}
.clear-progress:hover {
  background: #b00;
  color: white;
}

/* --- Site footer --- */

.site-footer {
  max-width: 640px;
  margin: 4rem auto 0;
  padding: 2rem 1.25rem;
  border-top: 1px solid var(--rule);
  text-align: center;
  font-size: 0.8125rem;
  color: var(--ink-faint);
}

.site-footer a {
  color: var(--ink-faint);
}
