/* ═══════════════════════════════════════════
   Biblioteca lui Costin — Main Stylesheet
   ═══════════════════════════════════════════ */

:root {
  --blue: #154c8a;
  --blue-dark: #0e3460;
  --blue-light: #e8f0f8;
  --blue-mid: #c5d9ed;
  --bg: #fafbfd;
  --bg-warm: #f5f7fa;
  --text: #1a1a2e;
  --text-mid: #5a6478;
  --text-light: #8e96a4;
  --border: #e2e7ef;
  --white: #ffffff;
  --font-display: 'Cormorant Garamond', Georgia, 'Times New Roman', serif;
  --font-body: 'Inter', 'Helvetica Neue', Arial, sans-serif;
}

/* ─── RESET & BASE ─── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  background-color: var(--bg);
  color: var(--text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

::selection { background: rgba(21, 76, 138, 0.12); }

img { display: block; max-width: 100%; }
a { text-decoration: none; color: inherit; }
button { font-family: inherit; }

.container { max-width: 980px; margin: 0 auto; padding-left: 24px; padding-right: 24px; }

/* ─── ANIMATIONS ─── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.fade-up { animation: fadeUp 0.55s cubic-bezier(0.22, 1, 0.36, 1) forwards; }
.fade-in { animation: fadeIn 0.4s ease forwards; }

.fade-up-d1 { animation-delay: 0.08s; opacity: 0; }
.fade-up-d2 { animation-delay: 0.16s; opacity: 0; }
.fade-up-d3 { animation-delay: 0.24s; opacity: 0; }
.fade-up-d4 { animation-delay: 0.32s; opacity: 0; }

/* ─── NAVIGATION ─── */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(250, 251, 253, 0.92);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 8px;
  padding-bottom: 8px;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
}

.nav-brand img { height: 42px; width: 42px; object-fit: contain; }

.nav-brand-text { line-height: 1; }

.nav-brand-title {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
  color: var(--blue);
  letter-spacing: 0.04em;
}

.nav-brand-sub {
  font-family: var(--font-display);
  font-size: 10.5px;
  font-weight: 600;
  color: var(--blue);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  margin-top: 1px;
}

.nav-links { display: flex; gap: 24px; flex-wrap: wrap; }

.nav-link {
  padding: 0;
  border: none;
  background: none;
  cursor: pointer;
  font-size: 12.5px;
  font-weight: 400;
  color: var(--text-light);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  font-family: var(--font-body);
  transition: color 0.2s;
  position: relative;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: -3px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--blue);
  transition: width 0.3s;
}

.nav-link:hover::after,
.nav-link.active::after { width: 100%; }

.nav-link.active { font-weight: 600; color: var(--blue); }

/* ─── SECTION (page container) ─── */
.section { display: none; }
.section.active { display: block; }

/* ─── HERO ─── */
.hero {
  padding: 60px 0 48px;
  text-align: center;
}

.hero-logo {
  height: 140px;
  width: 140px;
  object-fit: contain;
  margin: 0 auto 28px;
}

.hero-title {
  font-family: var(--font-display);
  font-size: clamp(28px, 4vw, 40px);
  font-weight: 400;
  color: var(--text);
  margin-bottom: 16px;
  letter-spacing: -0.01em;
}

.hero-subtitle {
  font-family: var(--font-display);
  font-size: clamp(17px, 2.2vw, 21px);
  font-weight: 300;
  color: var(--text-mid);
  max-width: 520px;
  margin: 0 auto;
  line-height: 1.65;
  font-style: italic;
}

/* ─── CARDS GRID ─── */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
  padding-bottom: 48px;
}

.card {
  background: var(--white);
  padding: 32px 28px;
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: all 0.3s ease;
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(21, 76, 138, 0.1);
}

.card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 3px;
  height: 100%;
  background: var(--blue);
  border-radius: 8px 0 0 8px;
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.card-title {
  font-family: var(--font-display);
  font-size: 21px;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--text);
}

.card-count {
  font-size: 11px;
  color: var(--blue);
  font-weight: 600;
  letter-spacing: 0.06em;
  white-space: nowrap;
}

.card-desc {
  font-size: 14px;
  color: var(--text-mid);
  line-height: 1.55;
}

/* ─── BOOK COVERS STRIP (homepage) ─── */
.covers-strip {
  padding-bottom: 48px;
  text-align: center;
}

.covers-strip .section-label { margin-bottom: 20px; }

.covers-row {
  display: flex;
  gap: 20px;
  justify-content: center;
  flex-wrap: wrap;
  padding: 0 20px;
}

.cover-thumb {
  height: 160px;
  width: auto;
  border-radius: 4px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.12);
  object-fit: contain;
  cursor: pointer;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.cover-thumb:hover {
  transform: scale(1.04);
  box-shadow: 0 8px 24px rgba(0,0,0,0.15);
}

.covers-cta {
  margin-top: 20px;
}

/* ─── FEATURED BOOK (dark block) ─── */
.featured-block {
  background: var(--blue-dark);
  border-radius: 10px;
  padding: 48px 40px;
  display: flex;
  gap: 32px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 80px;
}

.featured-logo {
  height: 72px;
  width: 72px;
  object-fit: contain;
  opacity: 0.6;
  flex-shrink: 0;
}

.featured-content { flex: 1; min-width: 280px; }

.featured-label {
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--blue-mid);
  font-weight: 600;
  margin-bottom: 8px;
}

.featured-title {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 600;
  color: #fff;
  margin-bottom: 6px;
  line-height: 1.3;
}

.featured-author {
  font-family: var(--font-display);
  font-size: 16px;
  font-style: italic;
  color: var(--blue-mid);
  margin-bottom: 12px;
}

.featured-desc {
  font-size: 14px;
  color: rgba(255,255,255,0.7);
  line-height: 1.6;
}

/* ─── BUTTONS ─── */
.btn-outline {
  padding: 10px 24px;
  border: 1.5px solid var(--blue);
  background: none;
  color: var(--blue);
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-family: var(--font-body);
  border-radius: 4px;
  transition: all 0.2s;
}

.btn-outline:hover {
  background: var(--blue);
  color: #fff;
}

.btn-outline-light {
  border-color: var(--blue-mid);
  color: var(--blue-mid);
}

.btn-outline-light:hover {
  background: var(--blue-mid);
  color: var(--blue-dark);
}

.btn-solid {
  padding: 10px 24px;
  border: none;
  background: var(--blue);
  color: #fff;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-family: var(--font-body);
  border-radius: 4px;
  transition: all 0.2s;
}

.btn-solid:hover { background: var(--blue-dark); }

.btn-disabled {
  padding: 10px 24px;
  border: 1.5px solid var(--border);
  background: transparent;
  color: var(--text-light);
  cursor: default;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-family: var(--font-body);
  border-radius: 4px;
}

/* ─── SECTION LABEL ─── */
.section-label {
  font-size: 11px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--blue);
  font-weight: 600;
  margin-bottom: 12px;
  font-family: var(--font-body);
}

/* ─── PAGE HEADERS ─── */
.page-title {
  font-family: var(--font-display);
  font-size: clamp(30px, 4.5vw, 42px);
  font-weight: 400;
  margin-bottom: 8px;
  letter-spacing: -0.01em;
}

.page-subtitle {
  font-family: var(--font-display);
  font-size: 18px;
  font-style: italic;
  color: var(--text-mid);
  margin-bottom: 36px;
}

.page-content {
  padding-top: 56px;
  padding-bottom: 96px;
}

/* ─── RECOMMENDATION CARDS ─── */
.rec-list { display: flex; flex-direction: column; gap: 16px; }

.rec-card {
  background: var(--white);
  border-radius: 8px;
  border: 1px solid var(--border);
  padding: 32px 28px;
  display: flex;
  gap: 24px;
  align-items: flex-start;
  transition: all 0.3s ease;
}

.rec-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(21, 76, 138, 0.1);
}

.rec-number {
  font-family: var(--font-display);
  font-size: 44px;
  font-weight: 300;
  color: var(--blue-mid);
  line-height: 1;
  min-width: 48px;
  text-align: right;
}

.rec-tag {
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--blue);
  font-weight: 600;
}

.rec-title {
  font-family: var(--font-display);
  font-size: 23px;
  font-weight: 600;
  margin: 6px 0 4px;
  line-height: 1.3;
}

.rec-author {
  font-family: var(--font-display);
  font-size: 15px;
  font-style: italic;
  color: var(--text-light);
  margin-bottom: 10px;
}

.rec-note {
  font-family: var(--font-display);
  font-size: 16px;
  line-height: 1.65;
  color: var(--text-mid);
}

/* ─── BOOKS SECTION ─── */
.filter-tabs {
  display: flex;
  gap: 20px;
  margin-bottom: 32px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 12px;
}

.filter-tab {
  padding: 0 0 6px;
  border: none;
  background: none;
  cursor: pointer;
  font-size: 13px;
  font-weight: 400;
  color: var(--text-light);
  border-bottom: 2px solid transparent;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-family: var(--font-body);
  transition: all 0.2s;
}

.filter-tab.active {
  font-weight: 600;
  color: var(--blue);
  border-bottom-color: var(--blue);
}

/* Book detail panel */
.book-detail {
  background: var(--white);
  padding: 36px 32px;
  margin-bottom: 24px;
  border-left: 3px solid var(--blue);
  border-radius: 0 8px 8px 0;
  box-shadow: 0 2px 12px rgba(0,0,0,0.04);
  position: relative;
  display: flex;
  gap: 28px;
  align-items: flex-start;
  flex-wrap: wrap;
  animation: fadeIn 0.3s ease;
}

.book-detail-close {
  position: absolute;
  top: 14px;
  right: 18px;
  border: none;
  background: none;
  cursor: pointer;
  font-size: 18px;
  color: var(--text-light);
  transition: color 0.2s;
}

.book-detail-close:hover { color: var(--text); }

.book-detail-cover {
  height: 200px;
  width: auto;
  border-radius: 4px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.12);
  object-fit: contain;
}

.book-detail-info { flex: 1; min-width: 260px; }

.book-detail-category {
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--blue);
  font-weight: 600;
}

.book-detail-title {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 600;
  margin: 10px 0 4px;
  line-height: 1.25;
}

.book-detail-subtitle {
  font-family: var(--font-display);
  font-size: 16px;
  font-style: italic;
  color: var(--text-light);
  margin-bottom: 14px;
}

.book-detail-meta {
  font-size: 13px;
  color: var(--text-light);
  margin-bottom: 16px;
}

.book-detail-desc {
  font-family: var(--font-display);
  font-size: 17px;
  line-height: 1.75;
  color: var(--text-mid);
}

/* Book grid */
.books-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 24px;
}

.book-item {
  cursor: pointer;
  text-align: center;
  padding: 16px;
  border-radius: 8px;
  border: 1.5px solid transparent;
  transition: all 0.2s;
}

.book-item:hover { background: var(--bg-warm); }
.book-item.active {
  background: var(--blue-light);
  border-color: var(--blue);
}

.book-item-cover {
  height: 180px;
  width: auto;
  max-width: 100%;
  border-radius: 4px;
  object-fit: contain;
  box-shadow: 0 4px 16px rgba(0,0,0,0.12);
  margin: 0 auto 14px;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.book-item:hover .book-item-cover {
  transform: scale(1.04);
  box-shadow: 0 8px 24px rgba(0,0,0,0.15);
}

.book-item-title {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 4px;
  line-height: 1.3;
  color: var(--text);
}

.book-item-meta {
  font-size: 11px;
  color: var(--text-light);
}

/* ─── EBOOKS ─── */
.ebook-list { display: flex; flex-direction: column; gap: 12px; }

.ebook-card {
  background: var(--white);
  border-radius: 8px;
  border: 1px solid var(--border);
  padding: 32px 28px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
}

.ebook-info { flex: 1; min-width: 260px; }

.ebook-title {
  font-family: var(--font-display);
  font-size: 21px;
  font-weight: 600;
  margin-bottom: 6px;
  line-height: 1.3;
}

.ebook-desc {
  font-family: var(--font-display);
  font-size: 15px;
  color: var(--text-mid);
  margin-bottom: 4px;
  line-height: 1.5;
}

.ebook-meta { font-size: 12px; color: var(--text-light); }

/* ─── PODCAST ─── */
.podcast-block {
  background: var(--blue-dark);
  border-radius: 10px;
  padding: 64px 40px;
  text-align: center;
}

.podcast-icon {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  border: 1.5px solid var(--blue-mid);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 24px;
}

.podcast-title {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 400;
  color: #fff;
  margin-bottom: 10px;
}

.podcast-desc {
  font-family: var(--font-display);
  font-size: 16px;
  color: rgba(255,255,255,0.5);
  max-width: 400px;
  margin: 0 auto 32px;
  line-height: 1.6;
  font-style: italic;
}

.podcast-badge {
  display: inline-block;
  padding: 10px 24px;
  border: 1.5px solid var(--blue-mid);
  border-radius: 4px;
  color: var(--blue-mid);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-family: var(--font-body);
}

/* ─── ABOUT ─── */
.about-content {
  max-width: 720px;
  margin: 0 auto;
}

.about-text {
  font-family: var(--font-display);
  font-size: 18px;
  line-height: 1.85;
  color: var(--text-mid);
}

.about-text p { margin-bottom: 20px; }
.about-text p:last-child { margin-bottom: 0; }
.about-text strong { color: var(--text); }

.about-links {
  margin-top: 36px;
  padding-top: 28px;
  border-top: 1px solid var(--border);
}

.about-links-label {
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-light);
  font-weight: 600;
  margin-bottom: 14px;
}

.about-links-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.about-link-item {
  padding: 8px 16px;
  border: 1.5px solid var(--border);
  border-radius: 4px;
  font-size: 13px;
  color: var(--text-mid);
  cursor: pointer;
  transition: all 0.2s;
  font-family: var(--font-body);
}

.about-link-item:hover {
  border-color: var(--blue);
  color: var(--blue);
}

/* ─── FOOTER ─── */
.footer {
  border-top: 1px solid var(--border);
  padding: 32px 24px;
  text-align: center;
}

.footer-logo {
  height: 48px;
  width: 48px;
  object-fit: contain;
  margin: 0 auto 12px;
}

.footer-text {
  font-size: 12px;
  color: var(--text-light);
  letter-spacing: 0.04em;
}

/* ─── RESPONSIVE ─── */
@media (max-width: 768px) {
  .nav-inner { flex-direction: column; gap: 10px; }
  .nav-links { justify-content: center; gap: 16px; }
  .featured-block { padding: 32px 24px; }
  .book-detail { padding: 24px 20px; }
  .rec-card { padding: 24px 20px; }
  .rec-number { font-size: 32px; min-width: 36px; }
  .books-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 16px; }
  .book-item-cover { height: 140px; }
}

@media (max-width: 480px) {
  .nav-links { gap: 12px; }
  .nav-link { font-size: 11px; }
  .cards-grid { grid-template-columns: 1fr; }
  .books-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .book-item { padding: 10px; }
  .book-item-cover { height: 120px; }
}
