/* ==========================================================
   Cambay Solutions – eBooks Page  |  assets/css/ebooks.css
   ========================================================== */

/* ── Tokens ─────────────────────────────────────────────── */
:root {
  --eb-blue:       #0078D4;   /* Microsoft-aligned primary */
  --eb-blue-dark:  #005A9E;
  --eb-blue-pale:  #EFF6FC;
  --eb-text:       #1a1a2e;
  --eb-muted:      #5a6172;
  --eb-border:     rgba(0,0,0,.09);
  --eb-surface:    #f7f8fc;
  --eb-white:      #ffffff;
  --eb-radius:     12px;
  --eb-radius-sm:  7px;
  --eb-shadow:     0 2px 14px rgba(0,120,212,.07);
  --eb-shadow-hov: 0 6px 28px rgba(0,120,212,.14);
  --eb-font:       'Segoe UI', system-ui, sans-serif;
  --eb-transition: .22s cubic-bezier(.4,0,.2,1);
}

/* ── Base ────────────────────────────────────────────────── */
.eb-page { font-family: var(--eb-font); color: var(--eb-text); }
.eb-container { max-width: 1160px; margin: 0 auto; padding: 0 24px; }

/* ── Hero ────────────────────────────────────────────────── */
.eb-hero {
  background: linear-gradient(135deg, #0078D4 0%, #004578 100%);
  padding: 72px 24px 60px;
  text-align: center;
}
.eb-hero__inner { max-width: 660px; margin: 0 auto; }

.eb-eyebrow {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: rgba(255,255,255,.75);
  margin-bottom: 14px;
}

.eb-hero__title {
  font-size: clamp(28px, 4vw, 42px);
  font-weight: 700;
  color: #fff;
  margin: 0 0 16px;
  line-height: 1.15;
}

.eb-hero__sub {
  font-size: 16px;
  color: rgba(255,255,255,.85);
  line-height: 1.7;
  margin: 0 0 28px;
}

.eb-hero__meta {
  display: flex;
  justify-content: center;
  gap: 28px;
  flex-wrap: wrap;
  margin-bottom: 32px;
}
.eb-hero__meta span {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  color: rgba(255,255,255,.8);
}
.eb-hero__meta svg { width: 16px; height: 16px; flex-shrink: 0; }

/* ── Toolbar (count + search) ────────────────────────────── */
.eb-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

/* ── Search ──────────────────────────────────────────────── */
.eb-search-wrap {
  position: relative;
  width: 260px;
  flex-shrink: 0;
}
.eb-search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 15px;
  height: 15px;
  color: var(--eb-muted);
  pointer-events: none;
}
.eb-search {
  width: 100%;
  padding: 8px 14px 8px 36px;
  border: 1px solid var(--eb-border);
  border-radius: var(--eb-radius-sm);
  font-size: 13px;
  font-family: var(--eb-font);
  background: var(--eb-white);
  color: var(--eb-text);
  outline: none;
  box-sizing: border-box;
  transition: border-color var(--eb-transition), box-shadow var(--eb-transition);
}
.eb-search:focus {
  border-color: var(--eb-blue);
  box-shadow: 0 0 0 3px rgba(0,120,212,.12);
}

@media (max-width: 480px) {
  .eb-toolbar { flex-direction: column; align-items: flex-start; }
  .eb-search-wrap { width: 100%; }
}

/* ── Section ─────────────────────────────────────────────── */
.eb-section {
  background: var(--eb-surface);
  padding: 56px 0 72px;
  min-height: 300px;
}

.eb-count {
  font-size: 13px;
  color: var(--eb-muted);
  font-weight: 500;
  margin: 0;
}

/* ── Grid ────────────────────────────────────────────────── */
.eb-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr); /* ← change 3 to however many columns you want */
  gap: 24px;
}

/* ── Card ────────────────────────────────────────────────── */
.eb-card {
  background: var(--eb-white);
  border: 1px solid var(--eb-border);
  border-radius: var(--eb-radius);
  box-shadow: var(--eb-shadow);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: box-shadow var(--eb-transition), transform var(--eb-transition);
}
.eb-card:hover {
  box-shadow: var(--eb-shadow-hov);
  transform: translateY(-2px);
}

/* cover */
.eb-card__cover {
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--eb-blue-pale);
  display: flex;
  align-items: center;
  justify-content: center;
}
.eb-card__cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.eb-card__cover-fallback {
  width: 100%;
  height: 100%;
}
.eb-card__cover-fallback img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* body */
.eb-card__body {
  padding: 20px 20px 0;
  flex: 1;
}
.eb-card__title {
  font-size: 15px;
  font-weight: 600;
  color: var(--eb-text);
  line-height: 1.45;
  margin: 0 0 10px;
}
.eb-card__desc-wrap {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  transition: all var(--eb-transition);
}
.eb-card__desc-wrap.is-expanded {
  display: block;
}
.eb-toggle {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 6px;
  padding: 0;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  font-family: var(--eb-font);
  color: var(--eb-blue);
}
.eb-toggle:hover { color: var(--eb-blue-dark); }
.eb-toggle__icon {
  width: 14px;
  height: 14px;
  transition: transform var(--eb-transition);
}
.eb-toggle[aria-expanded="true"] .eb-toggle__icon {
  transform: rotate(180deg);
}
.eb-card__desc {
  font-size: 13px;
  color: var(--eb-muted);
  line-height: 1.6;
  margin: 0;
}

/* footer */
.eb-card__footer {
  padding: 16px 20px 20px;
}

/* ── Buttons ─────────────────────────────────────────────── */
.eb-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 18px;
  border-radius: var(--eb-radius-sm);
  font-size: 13px;
  font-weight: 600;
  font-family: var(--eb-font);
  text-decoration: none;
  cursor: pointer;
  transition: background var(--eb-transition), color var(--eb-transition), box-shadow var(--eb-transition);
  border: none;
}
.eb-btn svg { width: 16px; height: 16px; flex-shrink: 0; }

.eb-btn--download {
  background: var(--eb-blue);
  color: #fff;
  width: 100%;
  justify-content: center;
  box-sizing: border-box;
}
.eb-btn--download:hover {
  background: var(--eb-blue-dark);
  color: #fff;
  box-shadow: 0 4px 14px rgba(0,120,212,.35);
}
.eb-btn--download:active { transform: scale(.98); }

.eb-btn--unavailable {
  background: var(--eb-surface);
  color: var(--eb-muted);
  border: 1px solid var(--eb-border);
  cursor: default;
  font-size: 13px;
  white-space: nowrap;
}

.eb-size {
  font-size: 11px;
  font-weight: 400;
  opacity: .8;
}

/* ── States ──────────────────────────────────────────────── */
.eb-empty,
.eb-no-results {
  text-align: center;
  color: var(--eb-muted);
  font-size: 15px;
  padding: 60px 0;
  grid-column: 1 / -1;
}
.eb-no-results[hidden] { display: none; }
.eb-card[hidden] { display: none; }

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 640px) {
  .eb-hero { padding: 48px 20px 40px; }
  .eb-grid { grid-template-columns: 1fr; }
  .eb-toolbar { flex-direction: column; align-items: flex-start; }
  .eb-search-wrap { width: 100%; }
}