/* ===========================================================================
   premium-corporate.css — the Boardroom layer
   ---------------------------------------------------------------------------
   Loaded after premium.css by templates/template-premium-corporate.html and
   scoped to .pm--corp on <body>, so nothing here reaches any other template.

   Two jobs. The first is to make the page read as a board paper rather than a
   portfolio: square corners instead of soft ones, ruled labels instead of
   pills, and a menu of ten items that behaves at ten rather than five. The
   second is to style the four blocks this template adds and premium.css has
   never heard of — the career rail, the qualifications list beside the
   credentials panel, and the link boxes.

   Only tokens from tokens.css are used, so light and dark both come free.
   =========================================================================== */


/* ---------------------------------------------------------------------------
   1 — THE CORPORATE REGISTER
   --------------------------------------------------------------------------- */

/* Every Premium card, panel and photo on this page squares off at once. It is
   one declaration and it is most of why the layout does not read as Premium
   with sections bolted on. */
.pm--corp {
  --pm-radius: var(--radius-xs);
  --pm-radius-lg: var(--radius-sm);
}

/* The eyebrow stops being a pill and becomes a ruled label — the one piece of
   section furniture that appears above every heading, so changing it changes
   the whole page. */
.pm--corp .eyebrow {
  padding: 0 0 var(--space-2);
  border: 0;
  border-bottom: 2px solid var(--color-accent);
  border-radius: 0;
  background: none;
  color: var(--color-text);
  letter-spacing: var(--tracking-widest);
  text-transform: uppercase;
}

/* Contact follows a link section rather than the reviews rail, and two sunken
   bands meeting with nothing between them lose the join. */
.pm--corp #contact { border-top: 1px solid var(--color-border); }


/* ---------------------------------------------------------------------------
   2 — TOP BAR AND MENU
   --------------------------------------------------------------------------- */

.pm--corp .topbar__mark {
  border-radius: var(--radius-xs);
  box-shadow: 0 0 0 1px var(--accent-line);
}

.pm--corp .topbar__brandtext {
  display: grid;
  min-width: 0;
  gap: 1px;
}

.pm--corp .topbar__role {
  overflow: hidden;
  color: var(--color-text-subtle);
  font-size: var(--text-2xs);
  font-weight: var(--weight-semibold);
  letter-spacing: var(--tracking-widest);
  line-height: 1.2;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

/* Ten items, not five. Smaller, tighter and in capitals, which is both the
   corporate register and the only way they fit beside the owner tools. */
.pm--corp .topnav { min-width: 0; }

.pm--corp .topnav__list {
  flex-wrap: nowrap;
  gap: 0;
}

.pm--corp .topnav__link {
  padding: 0.4rem 0.45rem;
  border-radius: var(--radius-xs);
  font-size: var(--text-2xs);
  font-weight: var(--weight-semibold);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  white-space: nowrap;
}

/* premium.css opens the bar at 60rem, which was right for five items. Ten of
   them need more room than that, so below the wider mark the burger and the
   panel take the menu back. */
@container frame (max-width: 70rem) {
  .pm--corp .topnav { display: none; }
  .pm--corp .topbar__cta { display: none; }
  .pm--corp .topbar__burger { display: inline-flex; }
}

@container frame (max-width: 34rem) {
  .pm--corp .topbar__role { display: none; }
}


/* ---------------------------------------------------------------------------
   3 — CAREER RAIL
   --------------------------------------------------------------------------- */

.pm--corp .career {
  margin: 0;
  padding: 0;
  list-style: none;
}

.pm--corp .career__item {
  position: relative;
  display: grid;
  gap: 0.35rem;
  padding: var(--space-6) 0 var(--space-6) var(--space-6);
  border-top: 1px solid var(--color-border);
}

.pm--corp .career__item:first-child {
  padding-top: 0;
  border-top: 0;
}

/* The rail itself: one hairline down the left of the list, broken at neither
   end by a node that floats off it. */
.pm--corp .career__item::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0.3125rem;
  width: 1px;
  background: var(--color-border);
}

.pm--corp .career__item:first-child::before { top: 0.55rem; }
.pm--corp .career__item:last-child::before { bottom: auto; height: 1.4rem; }

.pm--corp .career__item::after {
  content: "";
  position: absolute;
  top: 0.35rem;
  left: 0;
  width: 0.6875rem;
  height: 0.6875rem;
  border: 2px solid var(--color-accent);
  border-radius: var(--radius-full);
  /* #career is a sunken band, so the node has to be punched out of that
     colour rather than the page colour. */
  background: var(--color-bg-sunken);
}

.pm--corp .career__item:not(:first-child)::after { top: calc(var(--space-6) + 0.35rem); }

.pm--corp .career__years {
  margin: 0;
  color: var(--color-accent-text);
  font-size: var(--text-xs);
  font-weight: var(--weight-bold);
  font-variant-numeric: tabular-nums;
  letter-spacing: var(--tracking-wide);
}

.pm--corp .career__role {
  margin: 0;
  font-size: var(--text-lg);
  font-weight: var(--weight-bold);
  letter-spacing: var(--tracking-tight);
  line-height: var(--leading-snug);
}

.pm--corp .career__org {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin: 0;
  color: var(--color-text-muted);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
}

.pm--corp .career__org .icon {
  flex: none;
  color: var(--color-text-subtle);
}

.pm--corp .career__text {
  margin: 0.35rem 0 0;
  max-width: 64ch;
  color: var(--color-text-muted);
  line-height: var(--leading-relaxed);
}

/* Wide enough, and the years move out into their own column — the shape a
   career history is read in on paper. */
@container frame (min-width: 52rem) {
  .pm--corp .career__item {
    grid-template-columns: 9rem minmax(0, 1fr);
    column-gap: var(--space-8);
    padding-left: var(--space-8);
  }
  .pm--corp .career__years {
    grid-column: 1;
    grid-row: 1 / -1;
    padding-top: 0.3rem;
  }
  .pm--corp .career__role,
  .pm--corp .career__org,
  .pm--corp .career__text { grid-column: 2; }
}


/* ---------------------------------------------------------------------------
   4 — QUALIFICATIONS AND CREDENTIALS
   --------------------------------------------------------------------------- */

.pm--corp .edu {
  display: grid;
  gap: var(--space-8);
}

@container frame (min-width: 56rem) {
  .pm--corp .edu {
    grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr);
    gap: var(--space-10);
    align-items: start;
  }
}

.pm--corp .edu__list {
  display: grid;
  gap: var(--space-4);
  margin: 0;
  padding: 0;
  list-style: none;
}

.pm--corp .edu__item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  column-gap: var(--space-4);
  row-gap: 0.3rem;
  padding: var(--space-5);
  border: 1px solid var(--color-border);
  border-left: 3px solid var(--color-accent);
  border-radius: var(--radius-xs);
  background: var(--color-surface);
}

.pm--corp .edu__year {
  grid-column: 2;
  grid-row: 1;
  margin: 0;
  color: var(--color-accent-text);
  font-size: var(--text-xs);
  font-weight: var(--weight-bold);
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.pm--corp .edu__degree {
  grid-column: 1;
  grid-row: 1;
  margin: 0;
  font-size: var(--text-base);
  font-weight: var(--weight-bold);
  letter-spacing: var(--tracking-tight);
  line-height: var(--leading-snug);
}

.pm--corp .edu__inst,
.pm--corp .edu__note {
  grid-column: 1 / -1;
  margin: 0;
}

.pm--corp .edu__inst {
  color: var(--color-text-muted);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
}

.pm--corp .edu__note {
  color: var(--color-text-subtle);
  font-size: var(--text-sm);
  line-height: var(--leading-normal);
}

.pm--corp .creds {
  padding: var(--space-6);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xs);
  background: var(--color-surface);
  box-shadow: var(--shadow-sm);
}

.pm--corp .creds__head {
  margin: 0 0 var(--space-4);
  padding-bottom: var(--space-3);
  border-bottom: 1px solid var(--color-border);
  color: var(--color-text-muted);
  font-size: var(--text-xs);
  font-weight: var(--weight-bold);
  letter-spacing: var(--tracking-widest);
  text-transform: uppercase;
}

.pm--corp .creds__list {
  display: grid;
  gap: var(--space-4);
  margin: 0;
  padding: 0;
  list-style: none;
}

.pm--corp .cred {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
}

.pm--corp .cred .icon {
  flex: none;
  margin-top: 0.15rem;
  color: var(--color-accent-text);
}

.pm--corp .cred__title {
  display: block;
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  line-height: var(--leading-snug);
}

.pm--corp .cred__meta {
  display: block;
  margin-top: 0.15rem;
  color: var(--color-text-subtle);
  font-size: var(--text-xs);
}


/* ---------------------------------------------------------------------------
   5 — LINK BOXES
   --------------------------------------------------------------------------- */

.pm--corp .lnkboxes {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 17rem), 1fr));
  gap: var(--space-4);
}

.pm--corp .lnkbox {
  position: relative;
  display: grid;
  gap: 0.3rem;
  align-content: start;
  padding: var(--space-5) var(--space-8) var(--space-5) var(--space-5);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xs);
  background: var(--color-surface);
  color: inherit;
  text-decoration: none;
  transition: border-color var(--duration-fast) var(--ease-out),
              box-shadow var(--duration-fast) var(--ease-out),
              transform var(--duration-fast) var(--ease-out);
}

/* The accent edge arrives on hover rather than sitting there on all thirty
   boxes at once, which would turn a list into a barcode. */
.pm--corp .lnkbox::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: var(--color-accent);
  opacity: 0;
  transition: opacity var(--duration-fast) var(--ease-out);
}

.pm--corp .lnkbox:hover {
  border-color: var(--color-accent-soft-border);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.pm--corp .lnkbox:hover::before { opacity: 1; }

.pm--corp .lnkbox:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

.pm--corp .lnkbox__title {
  font-size: var(--text-sm);
  font-weight: var(--weight-bold);
  letter-spacing: var(--tracking-tight);
  line-height: var(--leading-snug);
}

.pm--corp .lnkbox__sub {
  color: var(--color-text-muted);
  font-size: var(--text-xs);
  line-height: var(--leading-normal);
}

.pm--corp .lnkbox__go {
  position: absolute;
  top: var(--space-5);
  right: var(--space-5);
  width: 1rem;
  height: 1rem;
  color: var(--color-text-subtle);
  transition: color var(--duration-fast) var(--ease-out),
              transform var(--duration-fast) var(--ease-out);
}

.pm--corp .lnkbox:hover .lnkbox__go {
  color: var(--color-accent-text);
  transform: translate(2px, -2px);
}

@media (prefers-reduced-motion: reduce) {
  .pm--corp .lnkbox:hover { transform: none; }
  .pm--corp .lnkbox:hover .lnkbox__go { transform: none; }
}


/* ---------------------------------------------------------------------------
   6 — EMPTIED BLOCKS
   ---------------------------------------------------------------------------
   A block leaves the published page by holding nothing: the renderer takes
   out the career post, the degree, the credential or the box whose first
   line was cleared. The builder's preview has no renderer — it writes the
   blank and leaves the element where it is, which on a rail or a grid shows
   as a gap with a bullet beside it.

   These four rules say the same thing CSS can say without one, matched on
   exactly the line each block is dropped by, so the preview and the page
   agree and a saved profile that somehow kept an empty block still reads
   right.
   --------------------------------------------------------------------------- */

.pm--corp .career__item:has(.career__role:empty) { display: none; }
.pm--corp .edu__item:has(.edu__degree:empty) { display: none; }
.pm--corp .cred:has(.cred__title:empty) { display: none; }
.pm--corp .lnkbox:has(.lnkbox__title:empty),
.pm--corp .lnkbox[href=""] { display: none; }
