*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:             #f6f5f1;
  --surface:        #ffffff;
  --border:         #e8e6df;
  --border-light:   #f2f0eb;
  --text:           #1a1a1a;
  --text-secondary: #6b6b6b;
  --text-muted:     #adadad;
  --success:        #16a34a;
  --success-light:  #dcfce7;
  --shadow-sm: 0 1px 4px rgba(0,0,0,.06);
  --shadow-md: 0 4px 18px rgba(0,0,0,.09);
  --shadow-lg: 0 12px 36px rgba(0,0,0,.13);
  --radius:    12px;
  --radius-sm: 6px;
}

html, body {
  height: 100%;
  font-family: 'Jost', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* ── Layout ── */
.repo-layout {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ── Header ── */
.repo-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 28px 40px 24px;
  display: flex;
  justify-content: center;
}
.repo-header-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
}
.repo-logo img {
  height: 44px;
  width: auto;
  flex-shrink: 0;
}
.repo-heading {
  flex: 1;
  min-width: 200px;
}
.repo-title {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -.3px;
  color: var(--text);
  line-height: 1.2;
}
.repo-subtitle {
  font-size: 13px;
  font-weight: 400;
  color: var(--text-muted);
  margin-top: 3px;
}

/* ── Stats ── */
.repo-stats {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}
.repo-stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 18px;
  min-width: 76px;
}
.repo-stat-number {
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.1;
}
.repo-stat-label {
  font-size: 10px;
  font-weight: 500;
  letter-spacing: .5px;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-top: 2px;
}

/* ── Main ── */
.repo-main {
  flex: 1;
  max-width: 1100px;
  width: 100%;
  margin: 0 auto;
  padding: 36px 40px 64px;
}

/* ── Grid ── */
.nlm-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}

/* ── Card ── */
.nlm-card {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 4px solid var(--card-accent, #888);
  border-radius: var(--radius);
  text-decoration: none;
  color: inherit;
  box-shadow: var(--shadow-sm);
  transition: box-shadow .2s ease, transform .2s ease;
  overflow: hidden;
}
.nlm-card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-3px);
}

.nlm-card-body {
  padding: 16px 18px 14px 16px;
  flex: 1;
  display: flex;
  flex-direction: column;
}
.nlm-card-index {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .8px;
  color: var(--card-accent, #888);
  text-transform: uppercase;
  margin-bottom: 10px;
  opacity: .7;
}
.nlm-card-name {
  font-size: 14.5px;
  font-weight: 700;
  line-height: 1.38;
  color: var(--text);
  flex: 1;
  margin-bottom: 8px;
}
.nlm-card-desc {
  font-size: 12px;
  font-weight: 400;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-top: 2px;
}

/* ── Footer ── */
.nlm-card-footer {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  padding: 9px 16px 11px;
  border-top: 1px solid var(--border-light);
}
.nlm-card-tag {
  display: inline-block;
  background: var(--card-accent, #888);
  color: #fff;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: .5px;
  text-transform: uppercase;
  border-radius: 20px;
  padding: 3px 11px;
  opacity: .88;
}
.nlm-card-pdf {
  display: inline-block;
  font-size: 10.5px;
  font-weight: 600;
  color: var(--text-secondary);
  text-decoration: none;
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 3px 11px;
  margin-left: auto;
  transition: color .15s, border-color .15s;
}
.nlm-card-pdf:hover {
  color: var(--card-accent, #888);
  border-color: var(--card-accent, #888);
}

/* ── Card YouTube ── */
.nlm-card--yt {
  cursor: pointer;
}
.nlm-card--yt:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-3px);
}
.nlm-card-yt-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10.5px;
  font-weight: 700;
  color: #fff;
  background: #ef4444;
  border-radius: 20px;
  padding: 3px 10px;
  margin-left: auto;
}

/* ── Modal YouTube ── */
.yt-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.75);
  z-index: 300;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.yt-backdrop.open { display: flex; }
.yt-modal {
  position: relative;
  width: 100%;
  max-width: 860px;
  background: #000;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 24px 64px rgba(0,0,0,.5);
}
.yt-close {
  position: absolute;
  top: -38px;
  right: 0;
  background: none;
  border: none;
  color: #fff;
  font-size: 28px;
  cursor: pointer;
  line-height: 1;
  opacity: .8;
  transition: opacity .15s;
  z-index: 10;
}
.yt-close:hover { opacity: 1; }
.yt-wrap {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%; /* 16:9 */
}
.yt-wrap iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: none;
}

/* ── Card bloqueada ── */
.nlm-card--locked {
  position: relative;
  cursor: not-allowed;
  pointer-events: none;
  user-select: none;
}
.nlm-card--locked .nlm-card-body,
.nlm-card--locked .nlm-card-footer {
  filter: blur(1.5px);
  opacity: .45;
}
.nlm-lock-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: rgba(255,255,255,.22);
  border-radius: var(--radius);
  backdrop-filter: blur(2px);
}
.nlm-countdown {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1.5px;
  color: var(--card-accent, #888);
  background: rgba(255,255,255,.92);
  border-radius: 20px;
  padding: 4px 14px;
  box-shadow: 0 2px 8px rgba(0,0,0,.12);
  font-variant-numeric: tabular-nums;
}
.nlm-lock-icon {
  width: 38px;
  height: 38px;
  color: var(--card-accent, #888);
  opacity: .85;
  filter: drop-shadow(0 2px 6px rgba(0,0,0,.18));
}
.nlm-card-unlock-date {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: .3px;
  margin-left: auto;
}

/* ── Responsive ── */
@media (max-width: 960px) {
  .nlm-grid { grid-template-columns: repeat(2, 1fr); }
  .repo-main { padding: 28px 24px 48px; }
  .repo-header { padding: 22px 24px; }
  .repo-stats { display: none; }
}
@media (max-width: 500px) {
  .nlm-grid { grid-template-columns: 1fr; }
  .repo-title { font-size: 17px; }
}
