/* ============================================================
   IYBS · Temas (Topic Knowledge Graph)
   ============================================================ */

/* ── Index hero ── */
.temas-hero {
  background: var(--teal-deep);
  color: var(--warm-white);
  padding: calc(72px + 3rem) 0 3rem;
  text-align: center;
}
.temas-hero h1 {
  font-family: var(--font-serif);
  font-size: clamp(2rem, 5vw, 3rem);
  margin-bottom: .75rem;
  color: var(--warm-white);
}
.temas-hero p {
  font-size: 1.1rem;
  color: rgba(255, 255, 255, 0.82);
}

/* ── Topic grid (index + home section) ── */
.temas-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
}

.tema-card {
  display: flex;
  flex-direction: column;
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  box-shadow: 0 2px 12px rgba(0, 0, 0, .07);
  transition: transform 220ms ease, box-shadow 220ms ease;
}
.tema-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 30px rgba(0, 0, 0, .13);
  text-decoration: none;
}
.tema-card__img-wrap {
  height: 160px;
  overflow: hidden;
  background: var(--teal-deep);
}
.tema-card__img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 400ms ease;
}
.tema-card:hover .tema-card__img-wrap img {
  transform: scale(1.04);
}
.tema-card__body {
  padding: 1.25rem;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: .4rem;
}
.tema-card__title {
  font-family: var(--font-serif);
  font-size: 1.2rem;
  color: var(--teal-deep);
  margin: 0;
  line-height: 1.25;
}
.tema-card__subtitle {
  font-size: .875rem;
  color: #666;
  margin: 0;
  line-height: 1.5;
}
.tema-card__count {
  font-size: .78rem;
  color: var(--gold);
  font-weight: 600;
  margin-top: auto;
  padding-top: .5rem;
}

.temas-section-heading {
  font-family: var(--font-serif);
  font-size: 1.25rem;
  color: var(--teal-deep);
  margin: 0 0 1.25rem;
}

.temas-search-wrap {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 2rem;
}
.temas-search {
  flex: 1;
  max-width: 400px;
  padding: .6rem 1rem;
  border: 1.5px solid #d4cfc9;
  border-radius: 50px;
  font-size: .9375rem;
  background: #fff;
  color: var(--text);
  outline: none;
  transition: border-color 200ms;
}
.temas-search:focus { border-color: var(--teal-deep); }
.temas-search-count {
  font-size: .85rem;
  color: #888;
  white-space: nowrap;
}
.temas-no-results {
  text-align: center;
  color: #888;
  padding: 2.5rem 0;
  font-size: 1rem;
}

.temas-empty {
  text-align: center;
  color: #666;
  font-size: 1.1rem;
  padding: 3rem 0;
}

/* ── Single topic hero ── */
.tema-hero {
  position: relative;
  background: var(--teal-deep);
  color: var(--warm-white);
  padding: calc(72px + 3rem) 0 3.5rem;
  overflow: hidden;
}
.tema-hero__bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  opacity: .35;
}
.tema-hero__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(0,0,0,.25), rgba(0,0,0,.55));
}
.tema-hero__inner {
  position: relative;
  z-index: 1;
}
.tema-hero__back {
  display: inline-block;
  color: rgba(255, 255, 255, .65);
  text-decoration: none;
  font-size: .875rem;
  margin-bottom: 1.25rem;
  transition: color 200ms;
}
.tema-hero__back:hover { color: #fff; }
.tema-hero__title {
  font-family: var(--font-serif);
  font-size: clamp(2rem, 5vw, 3rem);
  color: var(--warm-white);
  margin: 0 0 .75rem;
  max-width: 720px;
  line-height: 1.15;
}
.tema-hero__subtitle {
  font-size: 1.15rem;
  color: rgba(255, 255, 255, 0.82);
  max-width: 600px;
  line-height: 1.6;
  margin: 0;
}

/* ── Body markdown ── */
.tema-body-section { background: #fff; }
.tema-body {
  font-size: 1.0625rem;
  line-height: 1.8;
  color: var(--text);
}
.tema-body h2,
.tema-body h3,
.tema-body h4 {
  font-family: var(--font-serif);
  color: var(--teal-deep);
  margin: 2rem 0 .75rem;
}
.tema-body p     { margin-bottom: 1.1rem; }
.tema-body a     { color: var(--teal); }
.tema-body ul,
.tema-body ol    { padding-left: 1.5rem; margin-bottom: 1rem; }
.tema-body li    { margin-bottom: .4rem; }
.tema-body blockquote {
  border-left: 3px solid var(--gold);
  margin: 1.5rem 0;
  padding: .75rem 1.25rem;
  background: rgba(200, 164, 94, .07);
  font-style: italic;
  color: #555;
}
.tema-body code {
  background: #f4f1ec;
  padding: .15em .4em;
  border-radius: 3px;
  font-size: .9em;
}
.tema-body pre {
  background: #f4f1ec;
  padding: 1rem;
  border-radius: 6px;
  overflow-x: auto;
  margin-bottom: 1rem;
}
.tema-body table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1rem;
  font-size: .95rem;
}
.tema-body th,
.tema-body td {
  padding: .5rem .75rem;
  border: 1px solid #e0dbd4;
  text-align: left;
}
.tema-body th { background: #f4f1ec; font-weight: 600; }

/* ── Related topics ── */
.tema-related-section { background: var(--cream, #faf7f2); }
.tema-related__heading {
  font-size: .875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: #888;
  margin-bottom: 1rem;
}
.tema-related-pills {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
}
.tema-pill {
  display: inline-block;
  padding: .45rem 1.1rem;
  background: rgba(38, 122, 115, .1);
  color: var(--teal-deep);
  border-radius: 50px;
  font-size: .875rem;
  font-weight: 600;
  text-decoration: none;
  transition: background 200ms ease, color 200ms ease;
}
.tema-pill:hover {
  background: var(--teal-deep);
  color: #fff;
  text-decoration: none;
}

/* ── Community CTA strip ── */
.tema-cta-strip {
  background: var(--teal-deep);
  padding: 3rem 0;
}
.tema-cta-strip__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  flex-wrap: wrap;
}
.tema-cta-strip__title {
  font-family: var(--font-serif);
  font-size: 1.5rem;
  color: var(--warm-white);
  margin: 0 0 .35rem;
}
.tema-cta-strip__sub {
  font-size: .9375rem;
  color: rgba(255, 255, 255, .72);
  margin: 0;
  max-width: 480px;
}

/* ── Responsive ── */
@media (max-width: 640px) {
  .temas-grid           { grid-template-columns: 1fr; }
  .tema-cta-strip__inner { flex-direction: column; text-align: center; }
  .tema-cta-strip__sub  { max-width: none; }
}
