/* ============================================================
   Global Voices — instructor / profile page
   Layered on css/styles.css and reusing its tokens. Scoped to
   #page-instructor and the .pf-* classes, so no other page moves.
   ============================================================ */

#page-instructor { --hair: rgba(255, 255, 255, 0.09); }

/* ---------- 1. Header ---------------------------------------- */

.instructor-head__role { max-width: 46rem; margin-inline: auto; }

.pf-motto {
  max-width: 40rem;
  margin: 1.5rem auto 0;
  font-size: clamp(1rem, 2.2vw, 1.15rem);
  font-weight: 600;
  line-height: 1.6;
  color: var(--ink-soft);
  text-wrap: balance;
}

.pf-motto::before,
.pf-motto::after { content: "\201C"; color: var(--orange); }
.pf-motto::after { content: "\201D"; }

/* ---------- 2. Stat row -------------------------------------- */

.pf-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-bottom: 2.4rem;
}

.pf-stat {
  display: grid;
  gap: 0.1rem;
  padding: 1.15rem 1.3rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  background: var(--panel-grad);
}

.pf-stat strong {
  font-size: clamp(1.5rem, 3.4vw, 2.1rem);
  font-weight: 900;
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: var(--orange);
  font-variant-numeric: tabular-nums;
}

.pf-stat span { font-size: 0.84rem; color: var(--ink-soft); }

/* ---------- 3. Section blocks -------------------------------- */

.pf-block { margin-bottom: 2.6rem; }

.pf-block__head { margin-bottom: 1.5rem; }

.pf-block__title {
  margin: 0 0 0.5rem;
  font-size: clamp(1.7rem, 4vw, 2.5rem);
  font-weight: 900;
  letter-spacing: -0.025em;
  line-height: 1.12;
}

.pf-block__sub {
  margin: 0;
  max-width: 52rem;
  color: var(--ink-soft);
  line-height: 1.7;
}

/* ---------- 4. Project filters ------------------------------- */

.pf-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin-bottom: 1.5rem;
}

.pf-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 1.05rem;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.04);
  color: var(--ink-soft);
  font-size: 0.88rem;
  font-weight: 700;
  transition: color 0.2s, background 0.2s, border-color 0.2s, transform 0.2s;
}

.pf-chip__n {
  font-size: 0.74rem;
  font-weight: 800;
  padding: 0.1rem 0.45rem;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.1);
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.pf-chip:hover {
  color: #fff;
  border-color: rgba(255, 138, 30, 0.5);
  transform: translateY(-1px);
}

.pf-chip.is-on {
  background: var(--grad-btn);
  border-color: transparent;
  color: #fff;
  box-shadow: var(--glow-orange);
}

.pf-chip.is-on .pf-chip__n { background: rgba(0, 0, 0, 0.22); color: #fff; }

/* ---------- 5. Project cards --------------------------------- */

.pf-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(17rem, 100%), 1fr));
  align-items: start;          /* text-only cards hug their content */
  gap: 1.1rem;
}

.pf-card {
  position: relative;
  display: flex;
  flex-direction: column;
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  background: var(--panel-grad);
  box-shadow: var(--shadow-card);
  overflow: hidden;
  transition: transform 0.25s, border-color 0.25s, box-shadow 0.25s;
}

.pf-card__body {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.6rem;
  flex: 1;
  padding: 1.4rem 1.5rem 1.3rem;
}

/* Real screenshots of the apps, cropped to a consistent 16:10 so the
   grid stays even whether or not a project has one. */
.pf-card__shot {
  aspect-ratio: 16 / 10;
  background: #070b14;
  border-bottom: 1px solid var(--line);
  overflow: hidden;
}

.pf-card__shot img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  display: block;
  transition: transform 0.45s cubic-bezier(0.16, 1, 0.3, 1);
}

.pf-card.has-shot:hover .pf-card__shot img { transform: scale(1.035); }

.pf-card:hover {
  transform: translateY(-3px);
  border-color: rgba(255, 138, 30, 0.4);
  box-shadow: var(--shadow-card-hover);
}

.pf-card__status {
  align-self: flex-start;
  padding: 0.22rem 0.7rem;
  border-radius: var(--radius-pill);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #8fe3b0;
  background: rgba(86, 192, 43, 0.14);
  border: 1px solid rgba(86, 192, 43, 0.35);
}

.pf-card.is-progress .pf-card__status {
  color: var(--gold);
  background: rgba(255, 210, 122, 0.12);
  border-color: rgba(255, 210, 122, 0.4);
}

.pf-card__title {
  margin: 0;
  font-size: 1.14rem;
  font-weight: 800;
  line-height: 1.3;
  color: #fff;
  text-wrap: balance;
}

.pf-card__desc {
  margin: 0;
  font-size: 0.92rem;
  line-height: 1.65;
  color: var(--ink-soft);
}

.pf-card__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin: 0.15rem 0 0;
  padding: 0;
  list-style: none;
}

.pf-card__tags li {
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--ink-faint);
}

.pf-card__go {
  margin-top: auto;
  padding: 0.45rem 0 0;
  border: 0;
  background: none;
  color: var(--orange);
  font-size: 0.87rem;
  font-weight: 800;
  text-decoration: none;
  transition: color 0.2s, gap 0.2s;
}

a.pf-card__go:hover { color: var(--gold); }

.pf-card__go.is-quiet {
  color: var(--ink-faint);
  font-weight: 600;
  font-style: italic;
}

.pf-note {
  margin: 1.1rem 0 0;
  font-size: 0.84rem;
  color: var(--ink-faint);
}

/* ---------- 6. Skill groups ---------------------------------- */

.pf-skills {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(15rem, 100%), 1fr));
  align-items: start;          /* let each group hug its own content */
  gap: 1.1rem;
}

.pf-skill {
  padding: 1.3rem 1.4rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
}

.pf-skill h3 {
  margin: 0 0 0.9rem;
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold);
}

.pf-skill ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.pf-skill li {
  padding: 0.32rem 0.7rem;
  border-radius: 0.5rem;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--ink);
}

/* ---------- 7. Credentials ----------------------------------- */

/* styles.css builds .cred-grid and .card__head from plain 1fr tracks and a
   no-wrap flex row. A 1fr track's automatic minimum is min-content, so long
   credential names and long card titles push both wider than a 320px
   viewport. minmax(0, 1fr) and a wrapping head let them shrink instead. */
#page-instructor .cred-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
#page-instructor .card__head { flex-wrap: wrap; }
#page-instructor .card__title { min-width: 0; }

/* Same cause: a fixed 1.9rem heading in a no-wrap flex row cannot get
   narrower than the word "Competencies", which is wider than a 320px
   screen allows once the panel padding is taken off. */
#page-instructor .competencies__title {
  flex-wrap: wrap;
  font-size: clamp(1.35rem, 5vw, 1.9rem);
}

.cred-card--wide { grid-column: 1 / -1; }

.cred-cols {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.9fr);
  gap: 1.4rem 2.4rem;
  align-items: start;
}

.cred-col__title {
  margin: 0 0 0.9rem;
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold);
}

/* the certification column runs two-up once there is room */
.cred-col:last-child { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(15rem, 100%), 1fr)); gap: 0 1.8rem; }
.cred-col:last-child .cred-col__title { grid-column: 1 / -1; }

/* ---------- 8. Responsive ------------------------------------ */

@media (max-width: 900px) {
  .pf-stats { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 860px) {
  .cred-cols { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 700px) {
  #page-instructor .cred-grid { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 560px) {
  .instructor-head { padding-block: 2.25rem 1.75rem; }
  .instructor-head__photo { width: 170px; height: 170px; }
  .pf-stats { grid-template-columns: 1fr; gap: 0.7rem; }
  .pf-stat { display: flex; align-items: baseline; gap: 0.7rem; }
}

/* ---------- 9. Reduced motion -------------------------------- */

@media (prefers-reduced-motion: reduce) {
  .pf-chip, .pf-card, .pf-card__go, .pf-card__shot img { transition: none; }
  .pf-chip:hover, .pf-card:hover { transform: none; }
  .pf-card.has-shot:hover .pf-card__shot img { transform: none; }
}

/* ---------- 10. Certificate viewer ---------------------------
   The document opens in place instead of being downloaded, and
   the visitor leaves through the Back button. */

.certv {
  position: fixed;
  inset: 0;
  z-index: 120;                 /* above the sticky nav (50), below the session modal (100)… */
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(0.75rem, 2.5vw, 2rem);
  background: rgba(2, 4, 10, 0.86);
  backdrop-filter: blur(6px);
}

.certv[hidden] { display: none !important; }

.certv__panel {
  display: flex;
  flex-direction: column;
  width: min(64rem, 100%);
  max-height: 100%;
  overflow: hidden;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: var(--bg-2);
  box-shadow: 0 40px 90px -30px rgba(0, 0, 0, 0.9);
}

.certv__bar {
  display: flex;
  align-items: center;
  gap: 0.9rem 1.25rem;
  flex-wrap: wrap;
  padding: 0.9rem 1.15rem;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
}

.certv__back {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.55rem 1.1rem;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(255, 138, 30, 0.55);
  background: rgba(255, 138, 30, 0.15);
  color: #fff;
  font-size: 0.88rem;
  font-weight: 800;
  transition: background 0.2s, border-color 0.2s;
}

.certv__back:hover { background: rgba(255, 138, 30, 0.35); border-color: var(--orange); }

.certv__head { flex: 1 1 12rem; min-width: 0; display: grid; gap: 0.1rem; }
.certv__head strong { font-size: 0.98rem; font-weight: 800; color: #fff; }
.certv__head span { font-size: 0.8rem; color: var(--ink-soft); }

.certv__stage {
  flex: 1;
  min-height: 0;
  display: grid;
  place-items: center;
  padding: clamp(0.75rem, 2vw, 1.25rem);
  background: #0a0f1c;
  overflow: auto;
}

.certv__img {
  display: block;
  max-width: 100%;
  max-height: 76vh;
  border-radius: 0.5rem;
  background: #fff;
}

.certv__frame {
  width: 100%;
  height: min(76vh, 44rem);
  border: 0;
  border-radius: 0.5rem;
  background: #0a0f1c;
}

/* the credential entry's own control */
.cred-item__cert {
  display: block;
  margin-top: 0.3rem;
  padding: 0;
  border: 0;
  background: none;
  color: var(--orange);
  font-family: inherit;
  font-weight: 700;
  font-size: 0.86rem;
  text-align: left;
  text-decoration: underline;
  text-decoration-color: rgba(255, 138, 30, 0.4);
  text-underline-offset: 3px;
}

.cred-item__cert:hover { color: var(--gold); text-decoration-color: currentColor; }

@media (prefers-reduced-motion: reduce) {
  .certv__back, .cred-item__cert { transition: none; }
}
