/* BExDB — Brutalist CSS */

@import url("https://fonts.googleapis.com/css2?family=IBM+Plex+Serif:ital,wght@0,300;0,400;0,500;1,300;1,400;1,500&display=swap");

@font-face {
  font-family: "WilcoLoftSans";
  src: url("/assets/fonts/WilcoLoftSans-Treble-ec2256489c441e9c8678dee7ff7394d1.otf?vsn=d") format("opentype");
  font-weight: normal;
  font-style: normal;
}

/* Reset */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

[hidden] {
  display: none !important;
}

/* Theme variables */
:root,
[data-theme="light"] {
  --color-bg: #fff;
  --color-text: #000;
  --color-link: #0000ee;
  --color-muted: #666;
  --color-border: #000;
  --color-border-mid: #868585;
  --color-border-light: #ccc;
  --color-surface: #f0f0f0;
  --color-error: #cc0000;
  --color-focus: #0000ee;
  --color-flash-info-bg: #eef;
  --color-flash-info-border: #0000ee;
  --color-flash-error-bg: #fee;
  --color-flash-error-border: #cc0000;
  --color-subtitle: #555;
  --color-block-project: #2563eb;
  --color-block-milestone: #16a34a;
  --color-block-role: #dc2626;
  --color-block-highlight: #eab308;
  --color-block-event: #8b5cf6;
  --color-block-award: #f59e0b;
  --color-header-bg: #e8e8ff;
  color-scheme: light;
}

[data-theme="dark"] {
  --color-bg: #2e3034;
  --color-text: #e0e0e0;
  --color-link: #a1bcf2;
  --color-muted: #999;
  --color-border: #555;
  --color-border-mid: #868585;
  --color-border-light: #444;
  --color-surface: #2a2a2a;
  --color-error: #ff6b6b;
  --color-focus: #6d9eff;
  --color-flash-info-bg: #1a2a4a;
  --color-flash-info-border: #6d9eff;
  --color-flash-error-bg: #3a1a1a;
  --color-flash-error-border: #ff6b6b;
  --color-subtitle: #aaa;
  --color-block-project: #6d9eff;
  --color-block-milestone: #4ade80;
  --color-block-role: #f87171;
  --color-block-highlight: #facc15;
  --color-block-event: #a78bfa;
  --color-block-award: #fbbf24;
  --color-header-bg: #2a2a44;
  color-scheme: dark;
}

/* Base */
html {
  font-family: Helvetica, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.4;
  color: var(--color-text);
  background: var(--color-bg);
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a {
  color: var(--color-link);
}

/* Typography */
h1,
h2,
h3,
h4 {
  font-weight: 700;
  line-height: 1.2;
  margin-top: 1rem;
  margin-bottom: 0.5rem;
}

h1 {
  font-size: 1.75rem;
}
h2 {
  font-size: 1.375rem;
}
h3 {
  font-size: 1.125rem;
}
h4 {
  font-size: 1rem;
}

h1:first-child,
h2:first-child,
h3:first-child {
  margin-top: 0;
}

p {
  margin: 0.5rem 0;
}

ul,
ol {
  margin: 0.5rem 0;
  padding-left: 1.5rem;
}

li {
  margin: 0.25rem 0;
}

/* Header */
header {
}

header nav {
  font-size: 0.875rem;
}

/* Logged-in tabbed header */
.app-header {
  display: flex;
  flex-direction: column;
}

.app-topbar {
  padding: 1.5rem 5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

a.site-logo {
  display: flex;
  align-items: center;
  text-decoration: none;
}

.app-topbar nav {
  font-size: 0.875rem;
  display: flex;
  gap: 1rem;
}

a.feedback-link {
  color: #9b30ff;
}

.app-status {
  font-size: 0.875rem;
  color: var(--color-muted);
}

.app-tabbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  padding: 0 5rem;
  border-bottom: 1px solid var(--color-border);
}

.app-tabs {
  display: flex;
  align-items: flex-end;
  gap: 0.25rem;
}

.app-tab {
  display: inline-block;
  padding: 0.375rem 1rem;
  border: 1px solid var(--color-border);
  border-bottom: none;
  text-decoration: none;
  color: var(--color-link);
  font-size: 0.875rem;
  background: transparent;
  position: relative;
  bottom: 0;
}

.app-tab-active {
  background: var(--color-bg);
  color: var(--color-text);
  font-weight: 700;
  bottom: -1px;
}

.app-tabs-secondary {
  font-size: 0.875rem;
  padding-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}

/* Main */
main {
  padding: 1.5rem 1rem;
  max-width: 768px;
  margin: 0 auto;
  width: 100%;
  flex: 1;
}

/* Footer */
footer {
  padding: 0.75rem 1rem;
  font-size: 0.875rem;
  text-align: center;
  margin-top: auto;
}

/* Forms */
label {
  display: block;
  font-weight: 700;
  margin-bottom: 0.25rem;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="date"],
input[type="datetime-local"],
textarea,
select {
  display: block;
  width: 100%;
  max-width: 400px;
  padding: 0.375rem;
  font-family: inherit;
  font-size: inherit;
  color: var(--color-text);
}

textarea {
  min-height: 6rem;
  max-width: 100%;
  resize: vertical;
  line-height: 1.4;
}

textarea[name="profile[bio]"] {
  min-height: 14rem;
}

input:focus,
textarea:focus,
select:focus {
  outline: 2px solid var(--color-focus);
  outline-offset: 1px;
}

.field {
  margin-bottom: 0.75rem;
}

.field .error {
  color: var(--color-error);
  font-size: 0.875rem;
}



/* Align label columns across multiple form-grids on the same page */
.account-settings .form-grid {
  grid-template-columns: 11rem 1fr;
}

.auth-page .form-grid {
  grid-template-columns: 7rem 1fr;
}

/* Horizontal form layout */
.form-grid {
  display: grid;
  grid-template-columns: max-content 1fr;
  column-gap: 1rem;
  row-gap: 0.5rem;
  align-items: center;
}

/* Make fieldset/label transparent to parent grid */
.form-grid .fieldset {
  display: contents;
}
.form-grid .fieldset > label {
  display: contents;
}

/* Label text: column 1, right-aligned */
.form-grid .fieldset > label > .label {
  text-align: right;
  align-self: center;
  white-space: nowrap;
  font-weight: 700;
  margin-bottom: 0;
}

/* Inputs fill column 2, no max-width cap */
.form-grid .fieldset > label > input,
.form-grid .fieldset > label > select,
.form-grid .fieldset > label > textarea {
  max-width: none;
  width: 100%;
}

/* Date inputs: fixed width */
.form-grid .fieldset > label > input[type="date"],
.form-grid .fieldset > label > input[type="datetime-local"] {
  width: 200px;
}

/* Field error banner: above the input row, column 2 only */
.form-grid .form-error-banner {
  grid-column: 1 / -1;
  background: #fefce8;
  color: #dc2626;
  padding: 0.4rem 0.6rem;
  margin-bottom: 0.25rem;
  font-size: 0.875rem;
  text-align: center;
}

/* Error messages: column 2 only */
.form-grid .fieldset > p {
  grid-column: 2;
  margin-top: -0.25rem;
}

/* Submit/Save buttons */
.form-grid .form-actions button[type="submit"] {
  min-width: 100px;
}

/* Heading in column 2 */
.form-grid > h1 {
  grid-column: 2;
  margin-bottom: 0.5rem;
}

/* Hint text: column 2 only */
.form-grid .form-hint {
  grid-column: 2;
  font-size: 0.8125rem;
  margin-top: -0.25rem;
}

/* Action buttons row: column 2 only */
.form-grid .form-actions {
  grid-column: 2;
  margin-top: 0.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}

/* Radio groups in column 2 */
.form-grid .radio-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.form-grid .radio-group label {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  font-weight: normal;
}

/* Buttons */
button,
input[type="submit"],
.btn {
  display: inline-block;
  padding: 0.375rem 0.75rem;
  cursor: pointer;
  color: var(--color-text);
}

/* Flash messages */
.flash-banner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0.75rem;
  margin-bottom: 0.75rem;
  border: 2px solid var(--color-border);
  cursor: pointer;
}

.flash-banner button {
  background: none;
  border: none;
  font-size: 1.25rem;
  cursor: pointer;
  padding: 0 0.25rem;
}

.flash-info {
  border-color: var(--color-flash-info-border);
  background: var(--color-flash-info-bg);
}

.flash-error {
  border-color: var(--color-flash-error-border);
  background: var(--color-flash-error-bg);
  color: var(--color-error);
}

/* Tables */
table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  border: 1px solid var(--color-border);
  padding: 0.375rem 0.5rem;
  text-align: left;
}

th {
  font-weight: 700;
  background: var(--color-surface);
}

/* Utility */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.text-muted {
  color: var(--color-muted);
}

.bordered {
  border: 2px solid var(--color-border);
}

.section-divider {
  border-top: 1px solid var(--color-border);
  padding-top: 1rem;
}

/* Auth pages */
.auth-page {
  max-width: 480px;
  margin: 2rem auto;
}

.auth-site-name {
  text-align: center;
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
}

.auth-page .site-logo {
  display: block;
  text-align: center;
  margin-bottom: 0.25rem;
}

.auth-page h1 {
  margin-bottom: 0.5rem;
  text-align: center;
}

.auth-subheading {
  text-align: center;
  margin-bottom: 1.5rem;
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin: 1.25rem 0;
}

.auth-divider::before,
.auth-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: currentColor;
}

.auth-oauth {
  display: flex;
  flex-direction: row;
  gap: 0.75rem;
}

.auth-oauth a.btn {
  flex: 1;
  display: block;
  text-align: center;
  text-decoration: none;
  border: 1px solid var(--color-border);
  background: var(--color-surface);
}


.auth-terms {
  margin-top: 1.5rem;
  font-size: 0.875rem;
  text-align: center;
}

/* Full-width main override */
main.full-width {
  max-width: none;
  margin: 0;
  padding: 0;
  width: 100%;
}

/* App layout (logged-in pages) */
.app-layout {
  display: grid;
  grid-template-columns: minmax(150px, 200px) minmax(500px, 100%);
  align-items: start;
  min-height: 100%;
}

.app-sidebar {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  font-size: 0.875rem;
  padding: 1.5rem 1rem;
}

.app-main {
  padding: 1.5rem 1rem;
  max-width: 900px;
}

.app-sidebar a,
.app-sidebar button {
  display: block;
  background: none;
  border: none;
  padding: 0;
  color: var(--color-link);
  text-decoration: underline;
  cursor: pointer;
  font-size: 0.875rem;
  text-align: left;
}

.sidebar-group {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  margin-top: 0.75rem;
}

.sidebar-publish-date {
  color: var(--color-subtitle);
  margin: 0.125rem 0 0;
}

.profile-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  font-size: 0.875rem;
}

.profile-header {
  margin-bottom: 1rem;
}

.profile-header h1 {
  font-size: 2.25rem;
  margin-bottom: 1rem;
}

.profile-subtitle {
  color: var(--color-subtitle);
}

.profile-header-links {
  font-size: 0.875rem;
  margin-top: 0.25rem;
}

.profile-filters {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  font-size: 0.875rem;
}

.profile-filters label {
  display: block;
  font-weight: normal;
  margin-bottom: 0.125rem;
}

.profile-filters select {
  display: block;
  width: auto;
  max-width: 100%;
  font-size: 0.875rem;
}

.profile-block {
  display: grid;
  grid-template-columns: 6rem 1fr;
  gap: 0 1rem;
  padding: 0.75rem 0.5rem;
  align-items: start;
}

.profile-block + .profile-block {
  border-top: 1px solid var(--color-border-light);
}

.profile-block-type {
  display: inline-block;
  align-self: start;
  padding: 3px 10px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: capitalize;
  color: #fff;
  margin-left: -1rem;
}

.profile-block-type.type-project       { background: var(--color-block-project); color: #fff; }
.profile-block-type.type-milestone     { background: var(--color-block-milestone); color: #fff; }
.profile-block-type.type-role          { background: var(--color-block-role); color: #fff; }
.profile-block-type.type-highlight     { background: var(--color-block-highlight); color: #000; }
.profile-block-type.type-event         { background: var(--color-block-event); color: #fff; }
.profile-block-type.type-award         { background: var(--color-block-award); color: #000; }
.profile-block-type.type-training      { background: #0891b2; color: #fff; }
.profile-block-type.type-publication   { background: #4338ca; color: #fff; }
.profile-block-type.type-patent        { background: #ea580c; color: #fff; }
.profile-block-type.type-certification { background: #6f7f8f; color: #fff; }
.profile-block-type.type-degree        { background: #7c3aed; color: #fff; }
.profile-block-type.type-license       { background: #0e7490; color: #fff; }
.profile-block-type.type-presentation  { background: #0f766e; color: #fff; }
.profile-block-type.type-failure       { background: #5d365c; color: #fff; }
.profile-block-type.type-disappointment { background: #9f1239; color: #fff; }
.profile-block-type.type-learning      { background: #15803d; color: #fff; }
.profile-block-type.type-idea          { background: #ffef00; color: #6a4312; }

.profile-block-content {
  min-width: 0;
}

.profile-block-top {
  display: flex;
  flex-direction: column;
}

.profile-block-title {
  flex: 1;
  margin: 0;
  font-size: 1rem;
  font-weight: bold;
}

.profile-block-date {
  display: block;
  font-size: 0.875rem;
  color: var(--color-subtitle);
  margin-top: 0.125rem;
  white-space: normal;
}

.profile-block-desc {
  font-size: 0.875rem;
  margin-top: 0.25rem;
}

.profile-block-actions {
  font-size: 0.875rem;
  display: flex;
  gap: 0.5rem;
  margin-top: 0.25rem;
}

.profile-block-actions button {
  padding: 0;
  font-size: 0.875rem;
  font-family: inherit;
  background: none;
  border: none;
  color: var(--color-link);
  text-decoration: underline;
  cursor: pointer;
}

/* Publish preview banner */
.preview-banner {
  font-family: Helvetica, Arial, sans-serif;
  background: #fffbc2;
  border: 2px solid var(--color-border);
  padding: 0.75rem;
  margin-bottom: 1.5rem;
  font-size: 0.875rem;
}

.preview-banner-actions {
  margin-top: 0.5rem;
  display: flex;
  gap: 0.75rem;
  align-items: center;
}

/* Active filter */
.active-filter {
  font-weight: 700;
  text-decoration: underline;
}


/* Role-grouped layout */
.role-group {
  margin-bottom: 1.5rem;
}

.role-group-header {
  padding: 0.5rem 0;
  margin-bottom: 0.25rem;
}

.role-group-header-info {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.role-group-title {
  font-size: 1.375rem;
  margin: 0;
}

.role-group-org {
  color: var(--color-text);
}

.role-group-date {
  font-size: 0.875rem;
  color: var(--color-subtitle);
}

.role-group-meta {
  font-size: 0.875rem;
  color: var(--color-subtitle);
}

.role-group-actions {
  font-size: 0.875rem;
  white-space: nowrap;
  display: flex;
  gap: 0.75rem;
  align-items: baseline;
}

.role-group-actions button {
  background: none;
  border: none;
  padding: 0;
  color: var(--color-link);
  text-decoration: underline;
  cursor: pointer;
  font-size: inherit;
}

.title-anchor {
  margin-left: 0.35rem;
  color: #bbb;
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: normal;
  vertical-align: middle;
}

.title-anchor:hover {
  color: #888;
}

.title-copy-link {
  background: none;
  border: none;
  padding: 0;
  margin-left: 0.5rem;
  color: var(--color-link);
  text-decoration: underline;
  cursor: pointer;
  font-size: 0.75rem;
  font-weight: normal;
  vertical-align: middle;
}

.role-group-children {
  border: 1px solid var(--color-border-light);
  margin-left: 2rem;
}

.role-group-children:empty {
  border: none;
}

.vis-private {
  font-size: 0.75rem;
  text-transform: uppercase;
  border: 1px solid var(--color-border);
  padding: 0.125rem 0.25rem 0.0125rem 0.25rem;
  margin-left: 0.375rem;
  vertical-align: middle;
}

/* === Public block page === */

.pub-block-profile-link {
  margin-top: 2rem;
  font-size: 0.875rem;
  color: var(--color-subtitle);
}

/* === Public profile two-column layout === */

.pub-profile-layout {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.pub-profile-body {
}

.pub-profile-name {
  font-size: 3rem;
  line-height: 1.1;
  margin: 0 0 1rem 0;
}

.pub-profile-bio {
  margin: 0.25rem 0 0;
  color: var(--color-text);
}


/* Responsive */
@media (min-width: 768px) and (max-width: 1023px) {
  .app-layout {
    grid-template-columns: 1fr;
  }

  .pub-profile-name {
    font-size: 2.5rem;
  }

  .role-group-children {
    margin-left: 0;
  }
}

/* Responsive */
@media (max-width: 768px) {
  header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }

  header nav {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
  }

  .app-topbar {
    flex-wrap: wrap;
    gap: 0.25rem;
  }

  .app-tabbar {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
    padding-bottom: 0.5rem;
  }

  h1 {
    font-size: 1.5rem;
  }
  h2 {
    font-size: 1.25rem;
  }

  .app-layout {
    grid-template-columns: 1fr;
  }

  .app-sidebar {
    border-bottom: 1px solid var(--color-border-light);
    padding-bottom: 1rem;
  }

  .profile-block {
    grid-template-columns: 1fr;
    gap: 0.25rem;
  }

  .profile-block-type {
    grid-row: auto;
  }

  .pub-profile-name {
    font-size: 2.5rem;
  }

  .role-group-children {
    margin-left: 0;
  }
}

/* Unpublished profile page */

.unpublished-notice {
  text-align: center;
  padding: 4rem 1rem;
  max-width: 600px;
  margin: 0 auto;
}

.unpublished-heading {
  font-size: 2rem;
  font-weight: bold;
  margin-bottom: 0.5rem;
}

.unpublished-divider {
  border: none;
  border-top: 2px solid currentColor;
  width: 200px;
  margin: 1.5rem auto;
}

.unpublished-cta {
  font-size: 0.95rem;
}


.page-content {
  max-width: 768px;
}

/* ── Homepage Two-Column Layout ─────────────────── */
.home-layout {
  display: grid;
  grid-template-columns: 35fr 65fr;
  gap: 2rem;
  max-width: 1200px;
  margin: 0 auto;
  align-items: start;
}

.home-left {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.home-hero {
  font-size: 2rem;
}

.home-cta {
  display: block;
  font-size: 1.25rem;
  font-weight: bold;
  margin: 0.5rem 0;
  text-align: center;
}

.home-section-label {
  font-size: 0.875rem;
  font-weight: normal;
  color: var(--color-muted);
  margin: 0;
}

.home-examples {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.home-section-block {
  margin-top: 0.5rem;
}

.home-profile-demo {
  border: 1px solid var(--color-border);
  padding: 1.5rem;
}

.home-profile-demo {
  font-family: "IBM Plex Serif", serif;
}

.home-profile-demo .profile-header h1 {
  font-family: "IBM Plex Serif", serif;
  font-weight: 500;
}

.home-profile-demo .role-group-title {
  font-family: "IBM Plex Serif", serif;
  font-weight: 400;
}


/* ── Homepage Section Headings ─────────────────── */
.who-uses-heading {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
  white-space: nowrap;
}

.who-uses-heading::before,
.who-uses-heading::after {
  content: "";
  flex: 1;
  height: 1px;
  background: currentColor;
}

.home-footer {
  padding-top: 1rem;
  border-top: 1px solid var(--color-border);
  font-size: 0.875rem;
  text-align: left;
}

/* ── Experience Table ───────────────────────────── */
.experience-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
  margin-bottom: 1.5rem;
  table-layout: fixed;
}

.experience-table th,
.experience-table td {
  text-align: left;
  padding: 0.4rem 0.5rem;
  border: 1px solid var(--color-border-mid);
  vertical-align: top;
}

.experience-table th {
  font-weight: 700;
  text-align: center;
  background: var(--color-bg-subtle, #f5f5f5);
}

/* Column widths (6 columns, no link column) */
.experience-table col.col-type    { width: 9%; }
.experience-table col.col-start   { width: 8%; }
.experience-table col.col-end     { width: 8%; }
.experience-table col.col-title   { width: 55%; }
.experience-table col.col-public  { width: 7%; }
.experience-table col.col-actions { width: 13%; }

/* Center-aligned columns */
.experience-table td.col-start,
.experience-table td.col-end,
.experience-table td.col-public {
  text-align: center;
}

/* Type badge overhang — mirrors the block view */

.experience-table td.col-title {
  font-size: 1rem;
  font-weight: bold;
}

.experience-table td small {
  display: block;
  font-size: 0.875rem;
  font-weight: normal;
  color: #222;
  margin-top: 0.2rem;
}

/* No gap between org and description preview */
.experience-table td small + small {
  margin-top: 0;
}

.experience-table input[type="checkbox"] {
  cursor: pointer;
}

.experience-table td.col-actions {
  white-space: nowrap;
}

.experience-table td.col-actions a,
.experience-table td.col-actions button {
  background: none;
  border: none;
  padding: 0;
  margin: 0;
  cursor: pointer;
  font: inherit;
  color: var(--color-link, #00e);
  text-decoration: underline;
}

.experience-table td.col-actions a + a,
.experience-table td.col-actions button + button,
.experience-table td.col-actions a + button,
.experience-table td.col-actions button + a {
  margin-left: 0.5rem;
}

@media print {
  .app-header { display: none; }
  .role-group-children { border-color: transparent; }
  .profile-block + .profile-block { border-top-color: transparent; }
}
