/* masters.md FIRST: Read masters.md BEFORE editing or adding files.
 * styles-cursuri2.css — overlay for cursuri2.html ONLY. Loaded AFTER
 * styles-nou.css, so it can only add to the course cards, never break the
 * pages that already ship. Three things live here:
 *
 *   1. THE TEACHER PHOTO SECTION (.mentor-photo) — on EVERY card, the featured
 *      one included, all the same size. It is a PORTRAIT tile (aspect-ratio
 *      3/4), not the old round avatar, because that is the shape the photos
 *      will actually be shot in; aspect-ratio holds that proportion at every
 *      width, phones included, so nothing gets squashed on mobile.
 *      The <img> carries onerror="this.remove()" in the markup, so a teacher
 *      whose portrait has not been shot yet falls back to the dashed initials
 *      underneath instead of a broken image.
 *      Files: assets/profesori/<data-slug>.jpg — see the README there.
 *
 *   2. THE FEATURED CARD (.course-card.is-featured) — card 02 spans two grid
 *      columns, so the first desktop row reads 01 + a double-width 02.
 *
 *   3. THE "NU E UN CURS OBIȘNUIT" PANEL (.feature-format) — what the extra
 *      width bought us. The featured card's left column carries the same small
 *      portrait as everyone else plus the teacher's name, and the rest of that
 *      column sells the thing that actually makes this course different: the
 *      two private 1-to-1 hours. The card's own stats box still reads "12 h",
 *      which is exactly 10 recorded + 2 live — the panel is what breaks that
 *      number down, so the two can never contradict each other.
 *
 * If we keep this, fold all three blocks into styles-nou.css and drop this
 * file. */

/* ---- 1. Teacher photo section (all cards) ---------------------------- */
.mentor-photo {
  position: relative;
  flex: 0 0 74px; width: 74px; aspect-ratio: 3 / 4;
  border-radius: 10px; overflow: hidden;
  display: grid; place-items: center;
  background: var(--kraft);
  box-shadow: 0 0 0 1px var(--border);
}
.mentor-photo img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover; object-position: 50% 22%; /* faces sit high in a portrait */
  display: block;
}
/* onerror="this.hidden=true" marks a missing portrait; display:block above
   would otherwise override [hidden] and show a broken-image icon. */
.mentor-photo img[hidden] { display: none; }
/* What shows until the portrait file exists: the initials, in the same dashed
   placeholder language as the old .mentor-avatar.is-tba. */
.mentor-photo-fallback {
  width: 100%; height: 100%;
  display: grid; place-items: center;
  font-family: var(--font-mono); font-size: .62rem; font-weight: 700;
  letter-spacing: .05em; color: var(--fog);
  border: 1px dashed var(--border-strong); border-radius: 10px;
  background: transparent;
}
/* The row is taller than one line of text now, so align to the top of the
   photo instead of centring the name against it. */
.course-mentor { align-items: flex-start; }
.course-mentor > span:last-child { padding-top: 2px; }
.course-card.is-alt .mentor-photo { box-shadow: 0 0 0 1px rgba(27, 28, 31, .12); }
.course-card.is-alt .mentor-photo-fallback { border-color: rgba(27, 28, 31, .30); }

/* ---- 2. Featured card ------------------------------------------------ */
.course-card.is-featured {
  grid-column: span 2;
  display: grid;
  grid-template-columns: 260px 1fr;
  /* Four explicit rows = the four blocks of a normal card (tags, title, blurb,
     footer), so the left column can say `grid-row: 1 / -1` and actually span
     them. Without explicit rows, -1 resolves to line 1 and the title would be
     pushed back underneath the column. Last row is 1fr so the footer stays
     pinned to the bottom, exactly like .course-foot everywhere else. */
  grid-template-rows: auto auto auto 1fr;
  column-gap: 26px;
  position: relative;
  /* Warmer, brighter surface than either the plain or the .is-alt card, so it
     reads as pinned before you even notice the ring. The !important pair is
     aimed at .is-alt, which the filter script can add to any card by position
     and which would otherwise repaint this one mid-filter. */
  background: linear-gradient(180deg, var(--surface) 0%, var(--kraft) 100%) !important;
  border-color: var(--coral-deep) !important;
  box-shadow: 0 0 0 3px rgba(140, 32, 22, .12), var(--shadow-soft);
}
.course-card.is-featured:hover {
  transform: translateY(-3px);
  box-shadow: 0 0 0 3px rgba(140, 32, 22, .20), 0 18px 40px rgba(27, 28, 31, .12);
}
/* Everything that is not the left column belongs in the right-hand one. */
.is-featured > *:not(.feature-side) { grid-column: 2; }

.feature-side {
  grid-column: 1; grid-row: 1 / -1;
  display: flex; flex-direction: column; gap: 16px;
  align-self: stretch;
}
.feature-pin {
  align-self: flex-start;
  font-family: var(--font-mono); font-size: .6rem; font-weight: 700;
  letter-spacing: .1em; text-transform: uppercase;
  padding: 6px 11px; border-radius: 999px;
  background: var(--coral-deep); color: var(--cream);
  box-shadow: 0 4px 14px rgba(140, 32, 22, .32);
}
/* Photo + name, the same pattern (and the same photo size) as the mentor row
   at the bottom of every other card — it just lives up here instead. */
.feature-teacher { display: flex; align-items: flex-start; gap: 12px; }
.feature-teacher > span:last-child { padding-top: 2px; }
/* ...which is why the footer's mentor row is dropped on this card only: same
   face, same name, twice on one card. */
.is-featured .course-mentor { display: none; }

/* ---- 3. "Nu e un curs obisnuit" panel -------------------------------- */
.feature-format {
  flex: 1 1 auto;                 /* eats the height the big photo used to */
  display: flex; flex-direction: column; gap: 10px;
  background: var(--surface);
  border: 1px solid rgba(140, 32, 22, .22);
  border-left: 3px solid var(--coral-deep);
  border-radius: var(--radius);
  padding: 14px 15px;
}
.feature-format-label {
  font-family: var(--font-mono); font-size: .6rem; font-weight: 700;
  letter-spacing: .1em; text-transform: uppercase;
  color: var(--coral-deep);
}
.ff-lead {
  margin: 0; font-size: .92rem; line-height: 1.5; color: var(--ink);
}
.ff-lead b { font-weight: 600; }
/* The two sessions drawn as two slots rather than described in a sentence —
   at a glance you can SEE that there are two of them and that each is an hour,
   which is the whole claim of the panel. */
.ff-sessions { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.ff-sessions li {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 7px 10px; border-radius: 8px;
  background: rgba(140, 32, 22, .06);
  border: 1px solid rgba(140, 32, 22, .16);
}
.ff-s-n {
  font-family: var(--font-mono); font-size: .62rem; letter-spacing: .07em;
  text-transform: uppercase; color: var(--muted);
}
.ff-s-h { font-size: .95rem; font-weight: 600; color: var(--coral-deep); }
.ff-row {
  display: grid; grid-template-columns: auto 1fr;
  align-items: baseline; gap: 10px;
  padding-top: 2px;
}
/* The recorded hours: present, but deliberately quieter than the live ones. */
.ff-n {
  font-size: 1rem; font-weight: 600; color: var(--ink);
  white-space: nowrap;
}
.ff-k {
  font-family: var(--font-mono); font-size: .62rem; line-height: 1.5;
  letter-spacing: .02em; color: var(--muted);
}
.ff-note {
  margin: auto 0 0; padding-top: 10px;
  border-top: 1px dashed rgba(140, 32, 22, .22);
  font-size: .78rem; line-height: 1.5; color: var(--muted-2);
}
/* A wide card can afford a bigger title and a calmer measure on the blurb. */
.is-featured h3 { font-size: 1.42rem; }
.is-featured > p { max-width: 60ch; }
.is-featured .course-cta { width: auto; min-width: 220px; margin-inline: auto; }

/* ---- Responsive ------------------------------------------------------ */
@media (max-width: 980px) {
  .course-card.is-featured { grid-template-columns: 232px 1fr; column-gap: 20px; }
}
/* One column: the card stops spanning and stacks — pin, teacher, the 1-to-1
   panel, then the usual card content. The photo keeps its 3/4 portrait shape
   because it is set with aspect-ratio, not a fixed height. */
@media (max-width: 620px) {
  .course-card.is-featured {
    grid-column: span 1;
    grid-template-columns: 1fr;
    grid-template-rows: none;
    row-gap: 18px;
  }
  .is-featured > *:not(.feature-side) { grid-column: 1; }
  .feature-side { grid-column: 1; grid-row: auto; }
  /* Stacked, the reading order has to start with WHICH course this is —
     unordered, the teacher and the 1-to-1 panel came before the title, so you
     met the mentor of a course you had not been told the name of yet. */
  .is-featured .course-top { order: 1; }
  .is-featured h3          { order: 2; }
  .is-featured > p         { order: 3; }
  .feature-side            { order: 4; }
  .is-featured .course-foot { order: 5; }
  .is-featured h3 { font-size: 1.22rem; }
  .is-featured .course-cta { width: 100%; min-width: 0; }
}
