/* ==========================================================================
   Modern Cards — teachPress publication template
   ========================================================================== */

.tpc_publication_grid {
  --tpc-ink:        #1c2530;
  --tpc-muted:      #5b6673;
  --tpc-line:       #e3e7ec;
  --tpc-surface:    #ffffff;
  --tpc-page:       #f6f7f9;
  --tpc-accent:     #14535a;   /* deep teal */
  --tpc-accent-2:   #1b3a5c;   /* deep navy */
  --tpc-accent-soft:#e7f1f1;

  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 22px;
  padding: 6px 0;
}

.tpc_h3, .tpc_h4 {
  grid-column: 1 / -1;
  font-family: Georgia, 'Source Serif Pro', serif;
  color: var(--tpc-ink);
  border-bottom: 2px solid var(--tpc-accent);
  padding-bottom: 8px;
  margin: 28px 0 4px;
}
.tpc_h3:first-child, .tpc_h4:first-child { margin-top: 0; }

/* -------------------- card -------------------- */

.tpc_card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--tpc-surface);
  border: 1px solid var(--tpc-line);
  border-left: 4px solid var(--tpc-accent-2);
  border-radius: 10px;
  padding: 18px 20px 16px;
  box-shadow: 0 1px 2px rgba(20, 30, 40, 0.04);
  transition: transform .18s ease, box-shadow .18s ease, border-left-color .18s ease;
}

.tpc_card:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 24px rgba(20, 30, 40, 0.10);
  border-left-color: var(--tpc-accent);
}

/* color-code the left bar by publication type */
.tpc_card_article       { border-left-color: #0d9488; }
.tpc_card_inproceedings,
.tpc_card_conference     { border-left-color: #2563eb; }
.tpc_card_inbook,
.tpc_card_incollection   { border-left-color: #9333ea; }
.tpc_card_misc,
.tpc_card_unpublished    { border-left-color: #94a3b8; }

/* -------------------- top row: year + type badges -------------------- */

.tpc_card_top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin: 0 0 6px;
}

.tpc_year_badge {
  font-family: 'SFMono-Regular', Consolas, monospace;
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: .02em;
  color: #ffffff;
  background: #64748b;
  border-radius: 999px;
  padding: 3px 10px;
}

.tpc_card .tp_pub_type {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--tpc-muted);
  background: var(--tpc-page);
  border: 1px solid var(--tpc-line);
  border-radius: 999px;
  padding: 3px 10px;
}

/* color-code the type badge to match each publication type's accent */
.tpc_card_article .tp_pub_type {
  color: #ffffff;
  background: #0d9488;
  border-color: #0d9488;
}

.tpc_card_inproceedings .tp_pub_type,
.tpc_card_conference .tp_pub_type {
  color: #ffffff;
  background: #2563eb;
  border-color: #2563eb;
}

.tpc_card_inbook .tp_pub_type,
.tpc_card_incollection .tp_pub_type {
  color: #ffffff;
  background: #9333ea;
  border-color: #9333ea;
}

.tpc_card_misc .tp_pub_type,
.tpc_card_unpublished .tp_pub_type {
  color: #ffffff;
  background: #94a3b8;
  border-color: #94a3b8;
}

.tpc_card .tp_pub_label_status {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  color: #9a5b00;
  background: #fff2df;
  border-radius: 999px;
  padding: 3px 10px;
}

.tpc_card .tp_pub_label_award i {
  color: #b8860b;
  margin-right: 4px;
}

/* -------------------- image -------------------- */

.tpc_card_image { margin: 12px -20px 14px; overflow: hidden; border-radius: 6px; }
.tpc_card_image img { width: 100% !important; height: auto !important; display: block; }

/* -------------------- body -------------------- */

.tpc_card_body { flex: 1 1 auto; }

.tpc_title {
  font-family: Georgia, 'Source Serif Pro', serif;
  font-size: 16.5px;
  line-height: 1.38;
  font-weight: 700;
  color: var(--tpc-ink);
  margin: 0 0 4px;
}

.tpc_title a { color: inherit; text-decoration: none; border-bottom: 1px solid transparent; }
.tpc_title a:hover { border-bottom-color: var(--tpc-accent); }

.tpc_authors {
  font-size: 13.5px;
  color: var(--tpc-muted);
  margin: 0 0 4px;
  line-height: 1.4;
}

.tpc_meta {
  font-size: 13px;
  font-style: italic;
  color: var(--tpc-muted);
  margin: 0 0 6px;
  line-height: 1.35;
}

/* -------------------- footer: links / buttons / tags -------------------- */

.tpc_card_footer {
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid var(--tpc-line);
  font-size: 12.5px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.tpc_card_footer a {
  display: inline-block;
  color: var(--tpc-accent-2);
  background: var(--tpc-page);
  border: 1px solid var(--tpc-line);
  border-radius: 6px;
  padding: 4px 10px;
  text-decoration: none;
  font-weight: 600;
  transition: background .15s ease, color .15s ease, border-color .15s ease;
}

.tpc_card_footer a:hover {
  background: var(--tpc-accent);
  border-color: var(--tpc-accent);
  color: #fff;
}

/* teachPress inserts its own separators/spans inside the menu line —
   neutralise them since our buttons already have spacing via gap */
.tpc_card_footer .tp_resource_link,
.tpc_card_footer span {
  display: inline-flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* -------------------- info container (bibtex / abstract toggles) -------------------- */

.tpc_card .tp_info_container {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px dashed var(--tpc-line);
  font-size: 12.5px;
  color: var(--tpc-muted);
  background: var(--tpc-page);
  border-radius: 6px;
  padding: 10px 12px;
}

/* -------------------- responsive -------------------- */

@media (max-width: 640px) {
  .tpc_publication_grid { grid-template-columns: 1fr; gap: 16px; }
  .tpc_card { padding: 16px; }
}

/* respect reduced motion preference */
@media (prefers-reduced-motion: reduce) {
  .tpc_card { transition: none; }
}