/* ============================================================
   Antoneta — Biblioteca Tehnica
   biblioteca/biblioteca.css
   ============================================================ */

:root {
  --blue:      #1F4E79;
  --blue-l:    #2E75B6;
  --blue-bg:   #EBF3FB;
  --text:      #1a1d23;
  --muted:     #6b7280;
  --border:    #e2e6ea;
  --bg:        #f5f7fa;
  --white:     #ffffff;
  --r:         8px;
  --sh:        0 2px 8px rgba(0,0,0,0.08);
  --sh-md:     0 4px 16px rgba(0,0,0,0.10);
  --font:      'Segoe UI', system-ui, -apple-system, sans-serif;
  --mono:      'Cascadia Mono', 'Consolas', monospace;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: var(--font); background: var(--bg); color: var(--text); line-height: 1.65; }
.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;
}
.hidden { display: none !important; }
.bib-page { min-height: calc(100vh - 140px); }

/* ── Layout ─────────────────────────────────────────────── */
.bib-wrap    { max-width: 1120px; margin: 0 auto; padding: 0 20px; }
.bib-wrap-sm { max-width: 800px;  margin: 0 auto; padding: 0 20px; }

/* ── Breadcrumb ──────────────────────────────────────────── */
.bib-breadcrumb {
  padding: 14px 0;
  font-size: 13px;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.bib-breadcrumb a { color: var(--blue-l); text-decoration: none; }
.bib-breadcrumb a:hover { text-decoration: underline; }
.bib-breadcrumb .sep { color: var(--border); }

/* ── Hub page ────────────────────────────────────────────── */
.bib-hero {
  background: linear-gradient(135deg, var(--blue) 0%, var(--blue-l) 100%);
  color: #fff;
  padding: 52px 20px 44px;
  text-align: center;
}
.bib-kicker,
.bib-hero .bib-kicker {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  opacity: .8;
  margin-bottom: 8px;
  max-width: none;
}
.bib-hero h1 { font-size: clamp(26px, 5vw, 40px); font-weight: 800; margin-bottom: 12px; }
.bib-hero p  { font-size: 16px; opacity: .88; max-width: 560px; margin: 0 auto 28px; }

.bib-search-bar {
  display: flex;
  max-width: 520px;
  margin: 0 auto;
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--sh-md);
}
.bib-search-bar input {
  flex: 1;
  border: none;
  padding: 14px 18px;
  font-size: 15px;
  font-family: var(--font);
  color: var(--text);
  outline: none;
}
.bib-search-bar button {
  background: var(--blue);
  color: #fff;
  border: none;
  padding: 14px 22px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: background .15s;
}
.bib-search-bar button:hover { background: var(--blue-l); }

/* ── Categorii grid ──────────────────────────────────────── */
.bib-cats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px;
  padding: 36px 0 28px;
}
.bib-cat-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 22px 18px;
  text-decoration: none;
  color: var(--text);
  transition: box-shadow .18s, border-color .18s, transform .18s;
  display: flex;
  align-items: flex-start;
  gap: 14px;
}
.bib-cat-card:hover {
  box-shadow: var(--sh-md);
  border-color: var(--blue-l);
  transform: translateY(-2px);
}
.bib-cat-icon { font-size: 28px; flex-shrink: 0; }
.bib-cat-name { font-weight: 700; font-size: 15px; margin-bottom: 3px; color: var(--blue); }
.bib-cat-nr   { font-size: 12px; color: var(--muted); }

/* ── Articole grid ───────────────────────────────────────── */
.bib-section-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .8px;
  margin: 32px 0 14px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.bib-section-title h2 {
  font: inherit;
  margin: 0;
}
.bib-section-title a { font-size: 12px; color: var(--blue-l); text-decoration: none; }

.bib-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
  margin-bottom: 32px;
}
.bib-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--r);
  overflow: hidden;
  text-decoration: none;
  color: var(--text);
  display: flex;
  flex-direction: column;
  transition: box-shadow .18s, border-color .18s;
}
.bib-card:hover { box-shadow: var(--sh-md); border-color: var(--blue-l); }
.bib-card-img {
  width: 100%;
  aspect-ratio: 16/7;
  object-fit: cover;
  background: var(--blue-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 40px;
  color: var(--blue-l);
}
.bib-card-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.bib-card-body    { padding: 16px; flex: 1; display: flex; flex-direction: column; }
.bib-card-cat  {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .8px;
  color: var(--blue-l);
  margin-bottom: 6px;
}
.bib-card h3   { font-size: 15px; font-weight: 700; margin-bottom: 6px; line-height: 1.4; }
.bib-card p    { font-size: 13px; color: var(--muted); flex: 1; line-height: 1.55; }
.bib-card-foot {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
  color: var(--muted);
}
.bib-tags { display: flex; gap: 5px; flex-wrap: wrap; margin-top: 8px; }
.bib-tag  {
  background: var(--blue-bg);
  color: var(--blue);
  border-radius: 6px;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 600;
}

/* ── Filtru categorii ────────────────────────────────────── */
.bib-filter {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 20px 0;
}
.bib-filter-btn {
  background: var(--white);
  border: 1.5px solid var(--border);
  border-radius: 20px;
  padding: 6px 16px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  color: var(--text);
  transition: background .15s, border-color .15s, color .15s;
  font-family: var(--font);
}
.bib-filter-btn:hover,
.bib-filter-btn.active {
  background: var(--blue);
  border-color: var(--blue);
  color: #fff;
}

/* ── Paginare ────────────────────────────────────────────── */
.bib-pagination {
  display: flex;
  gap: 6px;
  justify-content: center;
  padding: 24px 0;
}
.bib-pag-btn {
  border: 1.5px solid var(--border);
  background: var(--white);
  color: var(--text);
  border-radius: 8px;
  padding: 7px 13px;
  font-size: 13px;
  cursor: pointer;
  font-family: var(--font);
  transition: background .15s;
}
.bib-pag-btn:hover { background: var(--blue-bg); }
.bib-pag-btn.active { background: var(--blue); color: #fff; border-color: var(--blue); }
.bib-pag-btn:disabled { opacity: .4; cursor: not-allowed; }

/* ── Articol page ────────────────────────────────────────── */
.bib-article-layout {
  display: grid;
  grid-template-columns: 1fr 260px;
  gap: 32px;
  padding: 32px 0 60px;
  align-items: start;
}
.bib-article-main {
  min-width: 0;
}
@media (max-width: 840px) {
  .bib-article-layout {
    display: block;
    padding: 24px 0 52px;
  }
  .bib-article-toc {
    position: static;
    top: auto;
    width: 100%;
    max-height: 220px;
    overflow-y: auto;
    margin: 0 0 24px;
  }
}

.bib-article-header { margin-bottom: 28px; }
.bib-category-head {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 24px;
  margin-top: 18px;
}
.bib-category-head p {
  color: var(--muted);
  max-width: 720px;
}
.bib-article-header h1 {
  font-size: clamp(22px, 4vw, 32px);
  font-weight: 800;
  line-height: 1.25;
  margin-bottom: 12px;
  color: var(--text);
}
.bib-article-meta {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 13px;
  color: var(--muted);
  flex-wrap: wrap;
}
.bib-article-meta .bib-cat {
  background: var(--blue-bg);
  color: var(--blue);
  border-radius: 6px;
  padding: 3px 10px;
  font-weight: 700;
  font-size: 11px;
}

.bib-article-cover {
  width: 100%;
  border-radius: var(--r);
  margin-bottom: 28px;
  background: var(--blue-bg);
  min-height: 200px;
  object-fit: cover;
  display: block;
}

/* ── Cuprins (TOC) ───────────────────────────────────────── */
.bib-article-toc {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 18px;
  position: sticky;
  top: 80px;
}
.bib-toc-title { font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .8px; margin-bottom: 12px; }
.bib-toc-list  { list-style: none; }
.bib-toc-list li { margin-bottom: 6px; }
.bib-toc-list a  { font-size: 13px; color: var(--blue-l); text-decoration: none; display: block; padding: 4px 0; border-left: 2px solid transparent; padding-left: 10px; transition: border-color .15s, color .15s; }
.bib-toc-list a:hover,
.bib-toc-list a.active { border-color: var(--blue); color: var(--blue); font-weight: 600; }
.bib-toc-list a.is-sub { padding-left: 22px; }

/* ── Continut articol ────────────────────────────────────── */
.bib-content h2 { font-size: 20px; font-weight: 700; margin: 32px 0 14px; color: var(--blue); padding-bottom: 8px; border-bottom: 1px solid var(--border); }
.bib-content h3 { font-size: 16px; font-weight: 700; margin: 24px 0 10px; }
.bib-content h4 { font-size: 14px; font-weight: 700; margin: 18px 0 8px; }
.bib-content p  { margin-bottom: 16px; font-size: 15px; line-height: 1.75; }
.bib-content {
  max-width: 100%;
  overflow-wrap: break-word;
}
.bib-content blockquote {
  background: #FFF8E7;
  border-left: 4px solid #F59E0B;
  border-radius: 0 var(--r) var(--r) 0;
  padding: 14px 18px;
  margin: 16px 0;
  font-size: 14px;
}
.bib-content ul,
.bib-content ol { margin: 12px 0 16px 24px; }
.bib-content li { margin-bottom: 6px; font-size: 15px; line-height: 1.65; }
.bib-content strong { color: var(--text); }
.bib-content em     { color: var(--muted); }
.bib-content code {
  background: #f0f4f8;
  border-radius: 4px;
  padding: 2px 6px;
  font-family: var(--mono);
  font-size: 13px;
  color: #c0392b;
}
.bib-content pre {
  background: #1a1d23;
  color: #e2e8f0;
  border-radius: var(--r);
  padding: 16px 20px;
  overflow-x: auto;
  margin: 16px 0;
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.6;
}
.bib-content pre code { background: none; color: inherit; padding: 0; }

.bib-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 16px 0;
  font-size: 14px;
}
.bib-content th {
  background: var(--blue);
  color: #fff;
  padding: 10px 14px;
  text-align: left;
  font-weight: 600;
}
.bib-content td {
  padding: 9px 14px;
  border-bottom: 1px solid var(--border);
}
.bib-content tr:nth-child(even) td { background: var(--blue-bg); }

.bib-content .bib-figure {
  margin: 26px 0;
  padding: 0;
}
.bib-content .bib-figure img {
  display: block;
  width: 100%;
  max-height: 620px;
  object-fit: contain;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
}
.bib-content .bib-figure figcaption {
  margin-top: 8px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
  text-align: center;
}

/* Nota tehnica / avertisment */
.bib-nota {
  background: #FFF8E7;
  border-left: 4px solid #F59E0B;
  border-radius: 0 var(--r) var(--r) 0;
  padding: 14px 18px;
  margin: 16px 0;
  font-size: 14px;
}
.bib-nota strong { color: #92400E; }

/* ── CTA calculator ──────────────────────────────────────── */
.bib-cta {
  background: linear-gradient(135deg, var(--blue), var(--blue-l));
  color: #fff;
  border-radius: var(--r);
  padding: 24px 28px;
  margin: 32px 0;
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
}
.bib-cta-icon { font-size: 36px; flex-shrink: 0; }
.bib-cta-text h2,
.bib-cta-text h3 { font-size: 17px; font-weight: 700; margin-bottom: 4px; color: #fff; }
.bib-cta-text p  { font-size: 13px; opacity: .88; }
.bib-cta a {
  display: inline-block;
  background: rgba(255,255,255,.9);
  color: var(--blue);
  border-radius: 9px;
  padding: 11px 22px;
  font-weight: 700;
  font-size: 14px;
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
  transition: background .15s;
}
.bib-cta a:hover { background: #fff; }

/* ── Similare ────────────────────────────────────────────── */
.bib-similare { margin-top: 40px; }
.bib-similare h2 { font-size: 16px; font-weight: 700; color: var(--text); margin-bottom: 14px; }
.bib-sim-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 12px;
}

/* ── Loading / empty states ──────────────────────────────── */
.bib-loading {
  text-align: center;
  padding: 60px 20px;
  color: var(--muted);
  font-size: 15px;
}
.bib-loading .spinner {
  width: 32px; height: 32px;
  border: 3px solid var(--border);
  border-top-color: var(--blue);
  border-radius: 50%;
  animation: spin .8s linear infinite;
  margin: 0 auto 14px;
}
@keyframes spin { to { transform: rotate(360deg); } }

.bib-empty {
  text-align: center;
  padding: 60px 20px;
  color: var(--muted);
}
.bib-empty-grid { grid-column: 1 / -1; }
.bib-empty-icon { font-size: 48px; margin-bottom: 12px; }
.bib-empty h3   { font-size: 18px; color: var(--text); margin-bottom: 6px; }

/* ── Footer biblioteca ───────────────────────────────────── */
.bib-footer {
  background: var(--blue);
  color: rgba(255,255,255,.65);
  padding: 20px;
  text-align: center;
  font-size: 12px;
  margin-top: 40px;
}
.bib-footer a { color: rgba(255,255,255,.8); text-decoration: none; }

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 600px) {
  .bib-wrap,
  .bib-wrap-sm    { padding: 0 14px; }
  .bib-grid        { grid-template-columns: 1fr; }
  .bib-cats        { grid-template-columns: 1fr 1fr; }
  .bib-article-layout { padding: 18px 0 42px; }
  .bib-article-toc { display: none; }
  .bib-article-header { margin-bottom: 20px; }
  .bib-article-header h1 { font-size: 24px; }
  .bib-content h2 { font-size: 18px; scroll-margin-top: 80px; }
  .bib-content p,
  .bib-content li { font-size: 14px; line-height: 1.7; }
  .bib-content pre {
    max-width: 100%;
    padding: 12px;
    font-size: 12px;
  }
  .bib-content table {
    display: block;
    overflow-x: auto;
    white-space: nowrap;
  }
  .bib-cta {
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
  }
  .bib-cta-text { width: 100%; }
  .bib-cta a {
    align-self: center;
    max-width: 100%;
    white-space: normal;
    text-align: center;
  }
  .bib-hero        { padding: 36px 20px 32px; }
  .bib-filter      { gap: 6px; }
  .bib-filter-btn  { font-size: 12px; padding: 5px 12px; }
}
