﻿.roles__panel {
  width: min(1100px, 100%);
  padding: clamp(14px, 2vw, 26px);
  border-radius: 24px;
  /* No inner scrolling: on very short screens the section simply grows and the page scrolls. */
  box-sizing: border-box;
}

.roles__table {
  width: 100%;
  table-layout: fixed;
  border-collapse: collapse;
  border-spacing: 0;
  color: var(--ink);
  font-family: var(--sans);
  font-size: 14px;
}

.roles__caption {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.roles__table th:nth-child(1),
.roles__table td:nth-child(1) { width: 34%; }
.roles__table th:nth-child(2),
.roles__table td:nth-child(2) { width: 44%; }
.roles__table th:nth-child(3),
.roles__table td:nth-child(3) { width: 22%; }

.roles__th {
  padding: 0 14px 8px;
  text-align: left;
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-3);
  border-bottom: 1px solid rgba(11, 26, 42, 0.08);
  white-space: nowrap;
}
.roles__th--dates { text-align: right; }

.roles__row {
  transition: background-color 0.25s var(--ease-out, ease);
}
.roles__row:hover { background: rgba(255, 255, 255, 0.45); }
.roles__row + .roles__row .roles__cell { border-top: 1px solid rgba(11, 26, 42, 0.08); }

.roles__cell {
  padding: 10px 14px;
  vertical-align: middle;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.roles__table tbody tr:first-child .roles__cell { border-top: 0; }

.roles__company {
  display: table-cell;
}
.roles__logo {
  position: relative;
  display: inline-block;
  vertical-align: middle;
  width: 34px;
  height: 34px;
  margin-right: 12px;
  border-radius: 9px;
  overflow: hidden;
  flex: none;
  background-size: cover;
  background-position: center;
}
.roles__name {
  font-weight: 600;
  color: var(--ink);
  vertical-align: middle;
}

.roles__title { font-weight: 500; color: var(--ink); }
.roles__sub {
  display: block;
  margin-top: 2px;
  font-size: 0.8em;
  color: var(--ink-3);
  overflow: hidden;
  text-overflow: ellipsis;
}

.roles__dates {
  text-align: right;
  white-space: nowrap;
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--ink-2);
}
.roles__now {
  display: inline-block;
  margin-left: 8px;
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  vertical-align: middle;
}

/* Laptop heights: tighten slightly so 10 rows fit at 1280x720 */
@media (min-width: 641px) and (max-height: 800px) {
  .roles__cell { padding-top: 5px; padding-bottom: 5px; }
  .roles__sub { line-height: 1.2; }
}

/* Short screens */
@media (max-height: 520px) {
  .roles__cell { padding: 6px 10px; }
  .roles__th { padding: 0 10px 6px; }
  .roles__logo { width: 26px; height: 26px; margin-right: 10px; border-radius: 7px; }
  .roles__table { font-size: 13px; }
  .roles__dates { font-size: 11.5px; }
  .roles__sub { margin-top: 0; }
}

/* Phones: two-line grid cards, nothing truncated */
@media (max-width: 640px) {
  .roles__panel { padding: 10px; border-radius: 18px; }

  .roles__table,
  .roles__table tbody { display: block; width: 100%; }
  .roles__table thead {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    white-space: nowrap;
  }

  .roles__row {
    display: grid;
    grid-template-columns: 28px minmax(0, 1fr) auto;
    grid-template-areas:
      "logo company dates"
      "logo role dates";
    column-gap: 10px;
    row-gap: 1px;
    align-items: start;
    padding: 7px 4px;
    box-sizing: border-box;
  }
  .roles__row + .roles__row { border-top: 1px solid rgba(11, 26, 42, 0.08); }
  .roles__row + .roles__row .roles__cell { border-top: 0; }

  /* Company cell dissolves so logo and name can be placed independently */
  .roles__company { display: contents; }
  .roles__cell {
    padding: 0;
    min-width: 0;
    width: auto;
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
  }

  .roles__table td:nth-child(n) { width: auto; }
  /* Exactly wide enough for "Sep 2026 –" in the mono font, so ranges break at the dash.
     (Needs this specificity to beat the td:nth-child(n) reset above.) */
  .roles__table td.roles__dates { width: 10.5ch; }

  .roles__logo { grid-area: logo; margin: 0; align-self: start; width: 28px; height: 28px; }
  .roles__name {
    grid-area: company;
    min-width: 0;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.2;
    white-space: normal;
    overflow-wrap: anywhere;
  }
  .roles__role {
    grid-area: role;
    min-width: 0;
    font-size: 13px;
    line-height: 1.25;
    color: var(--ink);
    white-space: normal;
    overflow-wrap: anywhere;
  }
  .roles__title { white-space: normal; overflow-wrap: anywhere; }
  .roles__sub {
    display: block;
    margin: 1px 0 0;
    font-size: 11.5px;
    line-height: 1.25;
    color: var(--ink-3);
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
    overflow-wrap: anywhere;
  }
  .roles__dates {
    grid-area: dates;
    align-self: start;
    justify-self: end;
    font-size: 10.5px;
    line-height: 1.25;
    text-align: right;
    white-space: normal;
  }
  .roles__now {
    display: block;
    width: fit-content;
    margin: 3px 0 0 auto;
    padding: 1px 6px;
    font-size: 9px;
  }
}

/* Shorter phones: slightly tighter rows (page may scroll if still taller). */
/* Shorter phones: slightly smaller type and tighter rows so heading + table fit one screen. */
@media (max-width: 640px) and (max-height: 740px) {
  .roles__row { padding: 4px 4px; }
  .roles__name { font-size: 13px; }
  .roles__title { font-size: 12px; line-height: 1.2; }
  .roles__sub { font-size: 10.5px; line-height: 1.2; }
  .roles__dates { font-size: 10px; }
}

@media (max-width: 640px) and (max-height: 520px) {
  .roles__row { padding: 4px 4px; }
}

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