/**
 * @file
 * tpemis_portal interior content theming.
 *
 * Token-driven typography + a clean "prose card" for node/content pages, so
 * interior pages read as part of the design system (sans type, comfortable
 * measure, a contained white surface) rather than Olivero's serif body. Scoped
 * to node content within .tp-main; the front-page marketing sections
 * (.tp-hero/.tp-front) have their own styling and are unaffected.
 */

/* Page title (content-above region) - token-driven, not Olivero's display serif. */
.tp-main .page-title,
.tp-main .block-page-title-block h1 {
  margin: 0 0 var(--tp-spacing-5, 1.5rem);
  font-family: var(--tp-font-family-sans, system-ui, sans-serif);
  font-size: clamp(1.75rem, 3vw, 2.5rem);
  font-weight: var(--tp-font-weight-bold, 700);
  line-height: var(--tp-line-height-tight, 1.15);
  color: var(--tp-color-text-default, #1a2230);
}

/* Prose card: a full node's content sits on a clean surface that spans the full
   width of the content region, consistent with the other blocks (no narrow,
   left-aligned measure). Scoped to the FULL view mode so teasers in listings/
   grids are not wrongly boxed. */
.tp-main article.node--view-mode-full {
  padding: var(--tp-spacing-6, 2rem);
  border-radius: var(--tp-border-radius-lg, 16px);
  background: var(--tp-color-surface-default, #fff);
  border: 1px solid var(--tp-color-border-default, #e3e8ef);
  box-shadow: 0 1px 3px rgba(16, 24, 40, 0.04);
}

/* Prose typography within content. */
.tp-main .node,
.tp-main .text-content,
.tp-main .field--name-body {
  font-family: var(--tp-font-family-sans, system-ui, sans-serif);
  font-size: var(--tp-font-size-md, 1rem);
  line-height: var(--tp-line-height-relaxed, 1.65);
  color: var(--tp-color-text-default, #1a2230);
}
.tp-main .text-content :is(h2, h3, h4) {
  font-weight: var(--tp-font-weight-bold, 700);
  line-height: var(--tp-line-height-tight, 1.2);
  color: var(--tp-color-text-default, #1a2230);
}
.tp-main .text-content h2 {
  margin: var(--tp-spacing-6, 2rem) 0 var(--tp-spacing-3, 0.75rem);
  font-size: var(--tp-font-size-xl, 1.5rem);
}
.tp-main .text-content h3 {
  margin: var(--tp-spacing-5, 1.5rem) 0 var(--tp-spacing-2, 0.5rem);
  font-size: var(--tp-font-size-lg, 1.25rem);
}
.tp-main .text-content p,
.tp-main .text-content ul,
.tp-main .text-content ol {
  margin: 0 0 var(--tp-spacing-4, 1rem);
}
.tp-main .text-content :is(ul, ol) {
  padding-inline-start: var(--tp-spacing-5, 1.5rem);
}
.tp-main .text-content li {
  margin-bottom: var(--tp-spacing-2, 0.5rem);
}
.tp-main .text-content a {
  color: var(--tp-color-primary, #1b3a6b);
  text-decoration: underline;
}
.tp-main .text-content a:hover {
  text-decoration: none;
}
/* Buttons embedded in body content (e.g. the "Apply for ..." CTAs) carry the
   brand fill, so they need a white label - not the inline link colour above,
   which rendered navy text on a navy button (invisible). */
.tp-main .text-content a.button,
.tp-main a.button {
  color: #fff;
  text-decoration: none;
}
.tp-main .text-content a.button:hover,
.tp-main a.button:hover {
  color: #fff;
  text-decoration: none;
}

/* Sleek "My account" profile page (tp-profile). Full-bleed hero band, a
   two-column layout (identity card + status/quick-links sidebar). The user page
   renders inside .tp-main, so let it run full width here and give the area
   below the hero a light surface; the hero owns the name, so the page title
   block is hidden. Token-driven, scoped to body.tp-user-page. */
.tp-user-page .tp-main {
  max-width: none;
  padding: 0;
  background: var(--tp-color-surface-subtle, #f4f6f9);
}
.tp-user-page .tp-main .block-page-title-block {
  display: none;
}
/* The full-region grid span (so the hero band reaches the content edges like
   the global header) is applied globally in tpemis-shell.css; the hero's inner
   content and the cards below stay centred via their own max-width. */
.tp-profile {
  font-family: var(--tp-font-family-sans, system-ui, sans-serif);
}

/* Hero band. */
.tp-profile-hero {
  background:
    radial-gradient(1200px 360px at 85% -20%, rgba(255, 255, 255, 0.10), transparent),
    linear-gradient(135deg, var(--tp-color-primary, #1b3a6b) 0%, #2c2a6b 60%, #3b2f8f 100%);
  color: #fff;
}
.tp-profile-hero__inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: var(--tp-spacing-7, 2.5rem) var(--tp-spacing-5, 1.5rem) var(--tp-spacing-8, 3.5rem);
}
.tp-profile-hero__crumb {
  display: flex;
  gap: var(--tp-spacing-2, 0.5rem);
  align-items: center;
  font-size: var(--tp-font-size-sm, 0.875rem);
  color: rgba(255, 255, 255, 0.7);
}
.tp-profile-hero__crumb a {
  color: rgba(255, 255, 255, 0.85);
  text-decoration: none;
}
.tp-profile-hero__crumb a:hover {
  text-decoration: underline;
}
.tp-profile-hero__name {
  margin: var(--tp-spacing-3, 0.75rem) 0 var(--tp-spacing-2, 0.5rem);
  font-size: clamp(2rem, 4vw, 3rem);
  line-height: 1.05;
  color: #fff;
}
.tp-profile-hero__sub {
  margin: 0;
  font-size: var(--tp-font-size-lg, 1.125rem);
  color: rgba(255, 255, 255, 0.82);
}

/* Two-column layout, pulled up to overlap the hero base. */
.tp-profile-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: var(--tp-spacing-6, 2rem);
  max-width: 1200px;
  margin: -1.5rem auto 0;
  padding: 0 var(--tp-spacing-5, 1.5rem) var(--tp-spacing-8, 3.5rem);
}

/* Cards share a surface treatment. */
.tp-profile-card,
.tp-profile-panel {
  background: var(--tp-color-surface-default, #fff);
  border: 1px solid var(--tp-color-border-default, #e7eaf0);
  border-radius: var(--tp-border-radius-lg, 18px);
  box-shadow: 0 10px 30px rgba(16, 24, 40, 0.06);
}
.tp-profile-card {
  padding: var(--tp-spacing-6, 2rem);
}

/* Identity header. */
.tp-profile-card__head {
  display: flex;
  align-items: flex-start;
  gap: var(--tp-spacing-4, 1rem);
  padding-bottom: var(--tp-spacing-5, 1.5rem);
  border-bottom: 1px solid var(--tp-color-border-default, #eef1f5);
}
.tp-profile-avatar {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  border-radius: 18px;
  overflow: hidden;
  background: linear-gradient(135deg, var(--tp-color-primary, #1b3a6b), var(--tp-color-secondary, #2a6496));
  color: #fff;
  font-size: 1.5rem;
  font-weight: var(--tp-font-weight-bold, 700);
  letter-spacing: 0.02em;
}
/* Real photo (student record / user picture) fills the avatar square. */
.tp-profile-avatar--photo {
  background: none;
}
.tp-profile-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.tp-profile-id {
  flex: 1 1 auto;
  min-width: 0;
}
.tp-profile-id__name {
  margin: 0 0 var(--tp-spacing-2, 0.5rem);
  font-size: var(--tp-font-size-xl, 1.375rem);
  font-weight: var(--tp-font-weight-bold, 700);
  color: var(--tp-color-text-default, #1a2230);
}
.tp-profile-badges {
  display: flex;
  flex-wrap: wrap;
  gap: var(--tp-spacing-2, 0.5rem);
}
.tp-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
  padding: 0.2rem 0.7rem;
  border-radius: 999px;
  font-size: var(--tp-font-size-sm, 0.8125rem);
  font-weight: var(--tp-font-weight-bold, 700);
}
.tp-badge--success {
  background: #dcfce7;
  color: #15803d;
}
.tp-badge--success::before {
  content: "";
  width: 0.5em;
  height: 0.5em;
  border-radius: 50%;
  background: #16a34a;
}
.tp-badge--info {
  background: rgba(43, 100, 150, 0.12);
  color: var(--tp-color-secondary, #2a6496);
}
.tp-badge--neutral {
  background: var(--tp-color-surface-subtle, #eef1f5);
  color: var(--tp-color-text-muted, #5b6473);
}
.tp-profile-id__email {
  margin: var(--tp-spacing-2, 0.5rem) 0 0;
  font-size: var(--tp-font-size-sm, 0.9375rem);
  color: var(--tp-color-text-muted, #5b6473);
}
.tp-profile-edit {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
  padding: 0.4rem 0.9rem;
  border: 1px solid var(--tp-color-border-default, #cdd5e0);
  border-radius: var(--tp-border-radius-md, 8px);
  color: var(--tp-color-primary, #1b3a6b);
  font-size: var(--tp-font-size-sm, 0.875rem);
  font-weight: var(--tp-font-weight-bold, 700);
  text-decoration: none;
}
.tp-profile-edit:hover {
  background: var(--tp-color-surface-subtle, #f4f6f9);
}
.tp-profile-edit svg {
  width: 14px;
  height: 14px;
}

/* Contact fields grid. */
.tp-profile-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--tp-spacing-1, 0.25rem) var(--tp-spacing-6, 2rem);
  margin: 0;
  padding: var(--tp-spacing-4, 1rem) 0;
}
.tp-profile-field {
  display: flex;
  align-items: flex-start;
  gap: var(--tp-spacing-3, 0.75rem);
  padding: var(--tp-spacing-3, 0.75rem) 0;
  border-bottom: 1px solid var(--tp-color-border-default, #f0f2f6);
}
.tp-profile-field__icon {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: rgba(27, 58, 107, 0.08);
  color: var(--tp-color-primary, #1b3a6b);
}
.tp-profile-field__label {
  margin: 0;
  font-size: var(--tp-font-size-xs, 0.75rem);
  font-weight: var(--tp-font-weight-bold, 700);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--tp-color-text-muted, #8a93a3);
}
.tp-profile-field__value {
  margin: 0.15rem 0 0;
  font-size: var(--tp-font-size-md, 1rem);
  color: var(--tp-color-text-default, #1a2230);
}
.tp-profile-field__value a {
  color: var(--tp-color-secondary, #2a6496);
  text-decoration: none;
}
.tp-profile-field__value a:hover {
  text-decoration: underline;
}

/* Student record subsection (only for enrolled students). */
.tp-profile-section {
  padding-top: var(--tp-spacing-4, 1rem);
  border-top: 1px solid var(--tp-color-border-default, #eef1f5);
}
.tp-profile-section__title {
  margin: 0;
  font-size: var(--tp-font-size-xs, 0.75rem);
  font-weight: var(--tp-font-weight-bold, 700);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--tp-color-primary, #1b3a6b);
}
/* Outstanding fee balance callout. */
.tp-profile-balance {
  display: flex;
  align-items: center;
  gap: var(--tp-spacing-3, 0.75rem);
  margin-top: var(--tp-spacing-3, 0.75rem);
  padding: var(--tp-spacing-4, 1rem);
  border: 1px solid var(--tp-color-border-default, #e3e8ef);
  border-radius: var(--tp-border-radius-md, 12px);
  background: var(--tp-color-surface-subtle, #f7f9fc);
}
.tp-profile-balance.is-owing {
  border-color: #f4c77b;
  background: #fff7ea;
}
.tp-profile-balance__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: rgba(27, 58, 107, 0.08);
  color: var(--tp-color-primary, #1b3a6b);
}
.tp-profile-balance.is-owing .tp-profile-balance__icon {
  background: rgba(232, 160, 32, 0.18);
  color: #b7791f;
}
.tp-profile-balance__body {
  flex: 1 1 auto;
}
.tp-profile-balance__label {
  margin: 0;
  font-size: var(--tp-font-size-xs, 0.75rem);
  font-weight: var(--tp-font-weight-bold, 700);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--tp-color-text-muted, #8a93a3);
}
.tp-profile-balance__amount {
  margin: 0.1rem 0 0;
  font-size: var(--tp-font-size-lg, 1.25rem);
  font-weight: var(--tp-font-weight-bold, 700);
  color: var(--tp-color-text-default, #1a2230);
}
.tp-profile-balance__action {
  flex: 0 0 auto;
  padding: 0.5rem 1rem;
  border-radius: var(--tp-border-radius-md, 8px);
  background: var(--tp-color-brand-accent, #e8a020);
  color: #fff;
  font-weight: var(--tp-font-weight-bold, 700);
  text-decoration: none;
}
.tp-profile-balance__action:hover,
.tp-profile-balance__action:focus-visible {
  background: var(--tp-color-brand-accent-light, #e11d48);
  /* Hold the label white over the global a:hover colour (contrast on accent). */
  color: #fff;
}
.tp-profile-balance__ok {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
  padding: 0.3rem 0.75rem;
  border-radius: 999px;
  background: #dcfce7;
  color: #15803d;
  font-size: var(--tp-font-size-sm, 0.8125rem);
  font-weight: var(--tp-font-weight-bold, 700);
}
/* Student self-service links (View student records / digital ID card). */
.tp-profile-student-links {
  display: flex;
  flex-wrap: wrap;
  gap: var(--tp-spacing-3, 0.75rem);
  margin-top: var(--tp-spacing-4, 1rem);
}

/* Action buttons. */
.tp-profile-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--tp-spacing-3, 0.75rem);
  padding-top: var(--tp-spacing-5, 1.5rem);
  border-top: 1px solid var(--tp-color-border-default, #eef1f5);
}
.tp-profile-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  padding: var(--tp-spacing-3, 0.75rem) var(--tp-spacing-5, 1.25rem);
  border: 1px solid var(--tp-color-primary, #1b3a6b);
  border-radius: var(--tp-border-radius-md, 10px);
  font-size: var(--tp-font-size-md, 1rem);
  font-weight: var(--tp-font-weight-bold, 700);
  text-decoration: none;
}
.tp-profile-btn__icon {
  display: inline-flex;
}
.tp-profile-btn__icon svg {
  width: 16px;
  height: 16px;
}
.tp-profile-btn--primary {
  background: var(--tp-color-primary, #1b3a6b);
  color: #fff;
}
.tp-profile-btn--primary:hover {
  background: var(--tp-color-secondary, #2a6496);
}
.tp-profile-btn--secondary {
  background: var(--tp-color-surface-default, #fff);
  color: var(--tp-color-primary, #1b3a6b);
}
.tp-profile-btn--secondary:hover {
  background: var(--tp-color-surface-subtle, #f4f6f9);
}

/* Sidebar panels. */
.tp-profile-side {
  display: flex;
  flex-direction: column;
  gap: var(--tp-spacing-6, 2rem);
}
.tp-profile-panel {
  padding: var(--tp-spacing-5, 1.5rem);
}
.tp-profile-panel__title {
  display: flex;
  align-items: center;
  gap: var(--tp-spacing-2, 0.5rem);
  margin: 0 0 var(--tp-spacing-4, 1rem);
  font-size: var(--tp-font-size-lg, 1.125rem);
  font-weight: var(--tp-font-weight-bold, 700);
  color: var(--tp-color-text-default, #1a2230);
}
.tp-profile-panel__title svg {
  color: var(--tp-color-primary, #1b3a6b);
}

/* Application status progress + checklist. */
.tp-profile-progress__row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: var(--tp-font-size-sm, 0.9375rem);
  color: var(--tp-color-text-default, #1a2230);
}
.tp-profile-progress__row strong {
  color: var(--tp-color-primary, #1b3a6b);
}
.tp-profile-progress__track {
  height: 8px;
  margin: var(--tp-spacing-2, 0.5rem) 0 var(--tp-spacing-4, 1rem);
  border-radius: 999px;
  background: var(--tp-color-surface-subtle, #eef1f5);
  overflow: hidden;
}
.tp-profile-progress__track span {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--tp-color-primary, #1b3a6b), var(--tp-color-secondary, #2a6496));
}
.tp-profile-steps {
  list-style: none;
  margin: 0 0 var(--tp-spacing-5, 1.5rem);
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--tp-spacing-3, 0.75rem);
}
.tp-profile-step {
  display: flex;
  align-items: center;
  gap: var(--tp-spacing-3, 0.75rem);
  font-size: var(--tp-font-size-md, 0.9375rem);
  color: var(--tp-color-text-muted, #8a93a3);
}
.tp-profile-step::before {
  content: "";
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px dashed var(--tp-color-border-default, #cdd5e0);
}
.tp-profile-step.is-done {
  color: var(--tp-color-text-default, #1a2230);
}
.tp-profile-step.is-done::before {
  border: 0;
  background:
    #16a34a
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='white'%3E%3Cpath d='M8 13.5l-3.5-3.5 1.4-1.4L8 10.7l5.1-5.1 1.4 1.4z'/%3E%3C/svg%3E")
    center / 14px no-repeat;
}
.tp-profile-continue {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5em;
  padding: var(--tp-spacing-3, 0.85rem);
  border-radius: var(--tp-border-radius-md, 10px);
  background: var(--tp-color-brand-accent, #e8a020);
  color: #fff;
  font-weight: var(--tp-font-weight-bold, 700);
  text-decoration: none;
}
.tp-profile-continue:hover,
.tp-profile-continue:focus-visible {
  background: var(--tp-color-brand-accent-light, #f5b342);
  /* Hold the label white over the global a:hover colour (contrast on accent). */
  color: #fff;
}

/* Quick links. */
.tp-profile-links ul {
  list-style: none;
  margin: 0;
  padding: 0;
}
.tp-profile-links a {
  display: flex;
  align-items: center;
  gap: var(--tp-spacing-3, 0.75rem);
  padding: var(--tp-spacing-3, 0.75rem) var(--tp-spacing-2, 0.5rem);
  border-bottom: 1px solid var(--tp-color-border-default, #f0f2f6);
  color: var(--tp-color-text-default, #1a2230);
  font-size: var(--tp-font-size-md, 0.9375rem);
  text-decoration: none;
}
.tp-profile-links li:last-child a {
  border-bottom: 0;
}
.tp-profile-links a:hover {
  color: var(--tp-color-primary, #1b3a6b);
}
.tp-profile-links__icon {
  display: inline-flex;
  color: var(--tp-color-text-muted, #5b6473);
}
.tp-profile-links__label {
  flex: 1 1 auto;
}
.tp-profile-links__arrow {
  color: var(--tp-color-text-muted, #b0b7c3);
}

@media (max-width: 960px) {
  .tp-profile-layout {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 560px) {
  .tp-profile-grid {
    grid-template-columns: 1fr;
  }
  .tp-profile-card {
    padding: var(--tp-spacing-4, 1.25rem);
  }
}

/* Listings (views): clean token-driven table + result summary. Scoped to
   .view so it does not touch prose tables or the SDC data-table (.tp-table). */
.tp-main .view table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--tp-font-family-sans, system-ui, sans-serif);
  font-size: var(--tp-font-size-md, 1rem);
  background: var(--tp-color-surface-default, #fff);
  border: 1px solid var(--tp-color-border-default, #e3e8ef);
  border-radius: var(--tp-border-radius-md, 8px);
  overflow: hidden;
}
.tp-main .view thead th {
  padding: var(--tp-spacing-3, 0.75rem) var(--tp-spacing-4, 1rem);
  text-align: start;
  font-size: var(--tp-font-size-sm, 0.875rem);
  font-weight: var(--tp-font-weight-bold, 700);
  color: var(--tp-color-text-muted, #5b6473);
  background: var(--tp-color-surface-subtle, #f4f6f9);
  border-bottom: 1px solid var(--tp-color-border-default, #e3e8ef);
}
.tp-main .view tbody td {
  padding: var(--tp-spacing-3, 0.75rem) var(--tp-spacing-4, 1rem);
  border-bottom: 1px solid var(--tp-color-border-default, #e3e8ef);
  color: var(--tp-color-text-default, #1a2230);
}
.tp-main .view tbody tr:last-child td {
  border-bottom: 0;
}
.tp-main .view tbody tr:hover {
  background: var(--tp-color-surface-subtle, #f4f6f9);
}
.tp-main .view td a {
  color: var(--tp-color-primary, #1b3a6b);
  text-decoration: none;
}
.tp-main .view td a:hover {
  text-decoration: underline;
}
/* Result-count summary + pager spacing. */
.tp-main .view .view-header,
.tp-main .view .views-row-count,
.tp-main .view .view-empty {
  margin-bottom: var(--tp-spacing-4, 1rem);
  color: var(--tp-color-text-muted, #5b6473);
  font-size: var(--tp-font-size-sm, 0.875rem);
}
.tp-main .view .views-element-container,
.tp-main .view .pager {
  margin-top: var(--tp-spacing-5, 1.5rem);
}
