/* ==========================================================================
   Codanics — Python ka Chilla: Build AI Agents
   Component styles for the "Five AI Research Agents" book.
   Brand tokens match the Codanics book style guide.
   ========================================================================== */

:root {
  --codanics-teal: #008b8b;
  --codanics-teal-light: #2ec4c4;
  --codanics-navy: #05043b;
  --codanics-light: #f7fbfb;
}

/* The cover is shown inside the hero below, so hide Quarto's automatic copy
   (book.cover-image is still needed for the EPUB cover and social previews). */
.quarto-cover-image {
  display: none;
}

/* --------------------------------------------------------------- hero card */
.hero {
  display: grid;
  grid-template-columns: 210px 1fr;
  gap: 1.6rem;
  align-items: center;
  padding: 1.3rem;
  border: 1px solid rgba(0, 139, 139, 0.25);
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(0, 139, 139, 0.08), rgba(5, 4, 59, 0.05));
  margin: 1rem 0 2rem 0;
}

.hero img {
  max-width: 200px;
  border-radius: 14px;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.18);
}

.hero h2 {
  margin-top: 0;
  border-bottom: none;
}

@media (max-width: 760px) {
  .hero {
    grid-template-columns: 1fr;
    justify-items: center;
    text-align: center;
  }
}

/* ------------------------------------------------------------- author card */
.author-card {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 1.2rem;
  align-items: center;
  border-left: 5px solid var(--codanics-teal);
  padding: 1rem;
  background: rgba(0, 139, 139, 0.06);
  border-radius: 14px;
  margin: 1.5rem 0;
}

.author-card img {
  width: 110px;
  border-radius: 50%;
  background: #fff;
}

/* ------------------------------------------------------------ download box */
.download-box {
  border: 1px solid rgba(0, 139, 139, 0.4);
  padding: 1rem 1.2rem;
  border-radius: 14px;
  margin: 1.2rem 0;
  background: rgba(0, 139, 139, 0.07);
}

.download-box a {
  font-weight: 700;
}

/* --------------------------------------------------------- download buttons */
.dl-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0.75rem 0 1.25rem 0;
}

.dl-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 0.9rem;
  border-radius: 10px;
  background: var(--codanics-teal);
  color: #ffffff !important;
  font-weight: 700;
  font-size: 0.85rem;
  text-decoration: none !important;
  border: 1px solid rgba(0, 139, 139, 0.5);
}

.dl-btn:hover {
  filter: brightness(1.08);
}

.dl-btn.secondary {
  background: rgba(0, 139, 139, 0.1);
  color: var(--codanics-navy) !important;
}

[data-bs-theme="dark"] .dl-btn.secondary {
  color: #ffffff !important;
  background: rgba(0, 139, 139, 0.28);
}

/* ------------------------------------------------------- agent / goal cards */
.agent-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 0.9rem;
  margin: 1.2rem 0 1.8rem 0;
}

.agent-card {
  border: 1px solid rgba(0, 139, 139, 0.25);
  border-left: 5px solid var(--codanics-teal);
  border-radius: 12px;
  padding: 0.85rem 1rem;
  background: rgba(0, 139, 139, 0.05);
}

.agent-card .num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.7rem;
  height: 1.7rem;
  border-radius: 50%;
  background: var(--codanics-teal);
  color: #fff;
  font-weight: 700;
  font-size: 0.85rem;
  margin-right: 0.45rem;
}

.agent-card .name {
  font-weight: 700;
  color: var(--codanics-navy);
}

[data-bs-theme="dark"] .agent-card .name {
  color: var(--codanics-teal-light);
}

.agent-card .tag {
  display: block;
  font-size: 0.86rem;
  opacity: 0.85;
  margin-top: 0.35rem;
}

.chapter-goals {
  border: 1px solid rgba(0, 139, 139, 0.25);
  border-left: 5px solid var(--codanics-teal);
  border-radius: 12px;
  padding: 0.5rem 1.1rem;
  background: rgba(0, 139, 139, 0.05);
  margin: 1rem 0 1.5rem 0;
}

.time-storage {
  border-left: 5px solid var(--codanics-navy);
  padding: 0.8rem 1rem;
  background: rgba(5, 4, 59, 0.06);
  border-radius: 12px;
}

[data-bs-theme="dark"] .time-storage {
  background: rgba(46, 196, 196, 0.1);
  border-left-color: var(--codanics-teal);
}

/* ------------------------------------------------------------- brand footer */
.codanics-footer {
  margin-top: 3rem;
  padding: 1.2rem 0 0.4rem 0;
  border-top: 1px solid rgba(0, 139, 139, 0.28);
}

.codanics-footer-inner {
  display: grid;
  grid-template-columns: 1.2fr 2fr;
  gap: 1rem;
  align-items: center;
  padding: 1rem 1.2rem;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(0, 139, 139, 0.08), rgba(5, 4, 59, 0.04));
}

.codanics-footer-brand {
  font-size: 0.92rem;
  line-height: 1.5;
}

.codanics-footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  justify-content: flex-end;
}

.codanics-footer-links a {
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  background: rgba(0, 139, 139, 0.1);
  color: var(--codanics-navy);
  font-weight: 700;
  text-decoration: none;
  font-size: 0.86rem;
}

.codanics-footer-links a:hover {
  background: var(--codanics-teal);
  color: #fff;
}

[data-bs-theme="dark"] .codanics-footer-links a {
  color: #ffffff;
  background: rgba(0, 139, 139, 0.28);
}

@media (max-width: 900px) {
  .codanics-footer-inner {
    grid-template-columns: 1fr;
  }

  .codanics-footer-links {
    justify-content: flex-start;
  }
}

/* ------------------------------------------------------------------- print */
@media print {
  .codanics-footer,
  .dl-row {
    display: none !important;
  }
}
