/* The course card (resources/views/partials/course-card.blade.php): home page, course list and category pages.
   Glass tile, 16:9 picture with tags, title (two lines at most), an optional one-line subtitle, a 2 x 2 grid of real numbers,
   a divider, the price and one button. The title link covers the whole card, so the card is a single tap target. */

.cc { position: relative; display: flex; flex-direction: column; min-width: 0; border-radius: var(--g-r-tile); background: var(--g-tile);
  border: 1px solid var(--g-tile-line); color: var(--g-text); transition: box-shadow .15s, background .15s, transform .15s; }
.cc:hover { background: var(--g-tile-hover); box-shadow: 0 8px 20px rgba(60, 40, 160, .12); }
@media (hover: hover) { .cc:hover { transform: translateY(-2px); } }
.cc:focus-within { outline: 3px solid var(--g-accent); outline-offset: 2px; }
.cc:focus-within .cc-title a:focus-visible { outline: 0; }

.cc-thumb { position: relative; aspect-ratio: 16 / 9; margin: 8px 8px 0; border-radius: 12px; overflow: hidden;
  background: linear-gradient(135deg, #5b31e1, #3f47e0); display: grid; place-items: center; }
.cc-thumb img { width: 100%; height: 100%; object-fit: cover; }
.cc-thumb__name { padding: 10px; color: #fff; font-size: 17px; font-weight: 700; text-align: center; }
.cc-tags { position: absolute; left: 8px; top: 8px; right: 8px; display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; list-style: none; }
.cc-tag { padding: 1px 10px; border-radius: 999px; background: #fff; color: #3a1fb0; font-size: 13px; font-weight: 700; line-height: 1.6;
  box-shadow: 0 2px 6px rgba(15, 23, 42, .18); }
.cc-tag--hot { background: #e11d74; color: #fff; }
.cc-tag--free { background: #047857; color: #fff; }
.cc-tag--book { background: #fff; color: #047857; }

/* The body always takes the card's own width: a long one-line subtitle must never push it wider and over the next card. */
.cc { align-items: stretch; overflow: hidden; }
.cc-body { display: flex; flex-direction: column; flex: 1 1 auto; align-self: stretch; box-sizing: border-box; width: 100%; min-width: 0; gap: 8px; padding: 10px 12px 12px; }
.cc-body > * { min-width: 0; max-width: 100%; }
.cc-title { margin: 0; font-size: 17px; line-height: 1.4; }
.cc-title a { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; color: inherit; overflow-wrap: anywhere; }
/* The stretched link: its invisible box covers the whole card. */
.cc-title a::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.cc-sub { margin: -4px 0 0; color: var(--g-muted); font-size: 14px; line-height: 1.45; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.cc-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; margin: 0; padding: 0; list-style: none; }
.cc-stats--row { grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); }
.cc-stats li { display: flex; align-items: center; gap: 6px; min-width: 0; min-height: 34px; padding: 4px 8px; border-radius: 10px;
  background: var(--g-field); border: 1px solid var(--g-line); font-size: 14px; font-weight: 700; line-height: 1.3; white-space: nowrap; }
.cc-stats svg { flex: none; width: 18px; height: 18px; color: var(--g-accent); }

.cc-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: auto; padding-top: 10px; border-top: 1px solid var(--g-line); }
.cc-price { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; min-width: 0; margin: 0; color: var(--g-accent); font-size: 20px; font-weight: 700; line-height: 1.3; }
.cc-price s { color: var(--g-muted); font-size: 15px; font-weight: 400; }
.cc-price--mine { color: var(--g-green-text); font-size: 15px; }
.cc-off { display: inline-block; padding: 0 8px; border-radius: 999px; background: rgba(225, 29, 116, .12); color: var(--g-pink-text); font-size: 12.5px; font-weight: 700; line-height: 1.7; }
.cc-btn { flex: none; display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 14px; border-radius: 14px;
  background: var(--g-brand); color: #fff; font-size: 16px; font-weight: 700; }
.cc-btn svg { width: 18px; height: 18px; }

/* The course list: one card a row on phones, two from 600px, four on computers. */
.cs-grid > .cc { height: 100%; }

@media (prefers-reduced-motion: reduce) { .cc { transition: none; } .cc:hover { transform: none; } }
