/* Page-only UOJ staff profile sub-theme. All selectors stay under body.profile-theme. */

body.profile-theme {
  --profile-primary: #3b5998;
  --profile-primary-dark: #314a7e;
  --profile-accent: #fe2712;
  --profile-text: #1f2933;
  --profile-muted: #5f6b7a;
  --profile-border: #e4e8ef;
  --profile-surface: #ffffff;
  --profile-bg: #f5f7fb;
  --profile-chip-bg: #eef2fb;
  --profile-chip-text: #314a7e;
  --profile-radius: 14px;
  --profile-shadow: 0 8px 24px rgba(31, 41, 51, 0.08);
  --profile-font: "Segoe UI", system-ui, -apple-system, sans-serif;
}

body.profile-theme,
body.profile-theme #wrapper,
body.profile-theme .main-content {
  overflow-x: hidden;
  max-width: 100%;
}

body.profile-theme .main-content {
  background: var(--profile-bg);
  font-family: var(--profile-font);
  color: var(--profile-text);
}

/* Skip link */
body.profile-theme .profile-skip-link {
  position: absolute;
  left: -9999px;
  z-index: 100;
  padding: 10px 16px;
  background: var(--profile-primary-dark);
  color: #fff;
  border-radius: 0 0 8px 0;
}

body.profile-theme .profile-skip-link:focus {
  left: 0;
  top: 0;
}

/* Layout: identity card + content */
body.profile-theme .profile-section-wrap {
  padding: 28px 0 56px;
}

body.profile-theme .profile-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 20px;
}

@media (min-width: 992px) {
  body.profile-theme .profile-layout {
    grid-template-columns: 300px minmax(0, 1fr);
    align-items: start;
  }
}

/* Identity card */
body.profile-theme .profile-card {
  background: var(--profile-surface);
  border: 1px solid var(--profile-border);
  border-radius: var(--profile-radius);
  box-shadow: var(--profile-shadow);
  padding: 22px 20px;
  text-align: center;
}

@media (min-width: 992px) {
  body.profile-theme .profile-card {
    position: sticky;
    top: 90px;
  }
}

body.profile-theme .profile-card__photo {
  width: 148px;
  height: 148px;
  border-radius: 50%;
  object-fit: cover;
  border: 4px solid #fff;
  outline: 1px solid var(--profile-border);
  box-shadow: 0 6px 18px rgba(31, 41, 51, 0.16);
  margin: 0 auto 14px;
  display: block;
  background: #eef2fb;
}

body.profile-theme .profile-card__name {
  margin: 0 0 2px;
  font-size: 20px;
  font-weight: 700;
  line-height: 1.25;
  color: var(--profile-text);
  font-family: var(--profile-font);
}

body.profile-theme .profile-card__role {
  margin: 0 0 10px;
  font-size: 14px;
  color: var(--profile-muted);
}

body.profile-theme .profile-card__dept {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 999px;
  background: var(--profile-chip-bg);
  color: var(--profile-chip-text);
  font-size: 12.5px;
  font-weight: 600;
  margin-bottom: 16px;
}

body.profile-theme .profile-card__actions {
  display: grid;
  gap: 8px;
}

body.profile-theme .profile-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  border: 1px solid transparent;
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

body.profile-theme .profile-btn svg {
  flex: 0 0 auto;
}

body.profile-theme .profile-btn--primary {
  background: var(--profile-primary);
  color: #fff;
}

body.profile-theme .profile-btn--primary:hover,
body.profile-theme .profile-btn--primary:focus-visible {
  background: var(--profile-primary-dark);
  color: #fff;
  text-decoration: none;
}

body.profile-theme .profile-btn--ghost {
  background: transparent;
  color: var(--profile-primary-dark);
  border-color: var(--profile-border);
}

body.profile-theme .profile-btn--ghost:hover,
body.profile-theme .profile-btn--ghost:focus-visible {
  border-color: var(--profile-primary);
  background: var(--profile-chip-bg);
  color: var(--profile-primary-dark);
  text-decoration: none;
}

/* Section nav (segmented tab bar) */
body.profile-theme .profile-nav {
  background: var(--profile-surface);
  border: 1px solid var(--profile-border);
  border-radius: 999px;
  box-shadow: var(--profile-shadow);
  padding: 5px;
  margin: 0 0 16px;
}

body.profile-theme .profile-nav ul {
  display: flex;
  gap: 4px;
  margin: 0;
  padding: 0;
  list-style: none;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

body.profile-theme .profile-nav ul::-webkit-scrollbar {
  display: none;
}

body.profile-theme .profile-nav li {
  flex: 1 0 auto;
}

body.profile-theme .profile-nav a {
  display: block;
  text-align: center;
  white-space: nowrap;
  padding: 9px 16px;
  border-radius: 999px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--profile-muted);
  text-decoration: none;
  transition: background-color 0.15s ease, color 0.15s ease;
}

body.profile-theme .profile-nav a:hover,
body.profile-theme .profile-nav a:focus-visible {
  color: var(--profile-primary-dark);
  background: var(--profile-chip-bg);
  text-decoration: none;
}

body.profile-theme .profile-nav a.is-active {
  background: var(--profile-primary);
  color: #fff;
}

/* Content sections */
body.profile-theme .profile-section {
  background: var(--profile-surface);
  border: 1px solid var(--profile-border);
  border-radius: var(--profile-radius);
  box-shadow: var(--profile-shadow);
  padding: 22px 20px;
  margin-bottom: 16px;
}

body.profile-theme .profile-section:last-child {
  margin-bottom: 0;
}

body.profile-theme .profile-section h2 {
  margin: 0 0 12px;
  font-size: 18px;
  font-weight: 700;
  color: var(--profile-primary-dark);
  font-family: var(--profile-font);
  display: flex;
  align-items: center;
  gap: 10px;
}

body.profile-theme .profile-section h2::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--profile-border);
}

body.profile-theme .profile-section p {
  margin: 0;
  font-size: 15px;
  line-height: 1.7;
  color: var(--profile-text);
}

body.profile-theme .profile-empty {
  color: var(--profile-muted);
  font-style: italic;
}

/* Qualifications: desktop table / mobile cards */
body.profile-theme .profile-table-wrap {
  display: none;
}

body.profile-theme .profile-qual-cards {
  display: grid;
  gap: 12px;
}

@media (min-width: 768px) {
  body.profile-theme .profile-table-wrap {
    display: block;
    overflow-x: auto;
  }

  body.profile-theme .profile-qual-cards {
    display: none;
  }
}

body.profile-theme .profile-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14.5px;
}

body.profile-theme .profile-table th,
body.profile-theme .profile-table td {
  padding: 11px 14px;
  text-align: left;
  border-bottom: 1px solid var(--profile-border);
}

body.profile-theme .profile-table thead th {
  background: var(--profile-chip-bg);
  color: var(--profile-primary-dark);
  font-weight: 700;
  white-space: nowrap;
}

body.profile-theme .profile-table tbody tr:last-child td {
  border-bottom: 0;
}

body.profile-theme .profile-table tbody tr:hover {
  background: #fafbfe;
}

body.profile-theme .profile-qual-card {
  border: 1px solid var(--profile-border);
  border-radius: 12px;
  padding: 14px 16px;
}

body.profile-theme .profile-qual-card h3 {
  margin: 0 0 6px;
  font-size: 15.5px;
  font-weight: 700;
  color: var(--profile-text);
  font-family: var(--profile-font);
}

body.profile-theme .profile-qual-card dl {
  margin: 0;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 4px 12px;
  font-size: 13.5px;
}

body.profile-theme .profile-qual-card dt {
  color: var(--profile-muted);
  font-weight: 600;
}

body.profile-theme .profile-qual-card dd {
  margin: 0;
  color: var(--profile-text);
}

/* Interest chips */
body.profile-theme .profile-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

body.profile-theme .profile-chips li {
  padding: 7px 14px;
  border-radius: 999px;
  background: var(--profile-chip-bg);
  color: var(--profile-chip-text);
  font-size: 13.5px;
  font-weight: 600;
}

/* Contact list */
body.profile-theme .profile-contact-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 10px;
}

body.profile-theme .profile-contact-list a {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--profile-primary-dark);
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
}

body.profile-theme .profile-contact-list a:hover,
body.profile-theme .profile-contact-list a:focus-visible {
  color: var(--profile-primary);
  text-decoration: underline;
}

body.profile-theme .profile-contact-list svg {
  flex: 0 0 auto;
  color: var(--profile-primary);
}

/* Focus visibility */
body.profile-theme a:focus-visible,
body.profile-theme button:focus-visible {
  outline: 2px solid var(--profile-primary);
  outline-offset: 2px;
}

/* Motion preferences */
@media (prefers-reduced-motion: no-preference) {
  body.profile-theme {
    scroll-behavior: smooth;
  }
}

@media (prefers-reduced-motion: reduce) {
  body.profile-theme .profile-btn,
  body.profile-theme .profile-nav a {
    transition: none;
  }
}
