/* OSMED Job Jar — styles derived from the OSMED Brand Guidelines (SPEC §10). */

:root {
  /* Primary */
  --periwinkle: #6068B2;
  --basalt: #31261D;
  --tang: #F68D2E;
  /* Secondary */
  --glaucous: #6B7DB9;
  --sky: #BFE3ED;
  --jeju: #9A887B;
  --moss: #92ACA0;
  --pumpkin: #F99963;
  --aqua: #68CABA;
  /* Tertiary */
  --fog: #E9E8E0;
  --white: #FFFFFF;
  --black: #000000;

  --bg: var(--fog);
  --surface: var(--white);
  --text: var(--basalt);
  --text-muted: #5E5248;
  --border: #CFCDC2;
  --link: #4A529A;
  --focus: var(--tang);
  --danger: #B3261E;

  --font-head: "Barlow", "DIN Alternate", "Helvetica Neue", Arial, sans-serif;
  --font-body: "Finlandica", "Helvetica Neue", Arial, sans-serif;

  --radius: 6px;
  --radius-sm: 4px;
  --gutter: 16px;
  --max: 1200px;
  --shadow: 0 1px 2px rgba(49, 38, 29, .06);
}

@media (min-width: 640px) { :root { --gutter: 24px; } }
@media (min-width: 1200px) { :root { --gutter: 32px; } }

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; -webkit-tap-highlight-color: transparent; } /* tap feedback comes from :active styles */
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
main { flex: 1; }
main:focus { outline: none; }
img { max-width: 100%; }

h1, h2, h3, h4 { font-family: var(--font-head); font-weight: 500; line-height: 1.15; margin: 0 0 .5em; }
a { color: var(--link); text-underline-offset: 2px; }
a:hover { color: var(--periwinkle); }
p { margin: 0 0 1em; }
code { font-size: .875em; }

:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }

.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link { position: absolute; left: -9999px; top: 8px; z-index: 100; background: var(--basalt); color: var(--white); padding: 8px 12px; }
.skip-link:focus { left: 8px; }
.muted { color: var(--text-muted); }
.pre-line { white-space: pre-line; }
.req { color: var(--danger); }

/* --- Header ------------------------------------------------------------------- */
.env-banner { background: var(--tang); color: var(--basalt); text-align: center; font-family: var(--font-head); font-weight: 600; font-size: .875rem; padding: 4px var(--gutter); letter-spacing: .04em; text-transform: uppercase; }

.site-header { background: var(--fog); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 20; }
.site-header__inner { max-width: var(--max); margin: 0 auto; padding: 12px var(--gutter); display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--basalt); margin-right: auto; padding: 4px 0; }
.brand__logo { height: 20px; width: auto; display: block; }
.brand__name { font-family: var(--font-head); font-weight: 600; font-size: 1.125rem; letter-spacing: .06em; text-transform: uppercase; border-left: 1px solid var(--border); padding-left: 12px; }

.nav-toggle { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; border: 1px solid var(--border); background: var(--white); border-radius: var(--radius-sm); cursor: pointer; }
.nav-toggle__bars, .nav-toggle__bars::before, .nav-toggle__bars::after { display: block; width: 18px; height: 2px; background: var(--basalt); position: relative; content: ""; }
.nav-toggle__bars::before { position: absolute; top: -6px; }
.nav-toggle__bars::after { position: absolute; top: 6px; }

.site-nav { display: none; width: 100%; }
.site-nav.is-open { display: block; }
.site-nav ul { list-style: none; margin: 0; padding: 8px 0; display: flex; flex-direction: column; gap: 2px; }
.site-nav a:not(.btn) { display: block; padding: 10px 8px; font-family: var(--font-head); font-weight: 500; text-decoration: none; color: var(--basalt); border-radius: var(--radius-sm); }
.site-nav a:not(.btn):hover { background: rgba(96, 104, 178, .08); }
.site-nav a[aria-current="page"] { color: var(--periwinkle); border-radius: 0; box-shadow: inset 3px 0 0 var(--periwinkle); }
.site-nav__cta { display: none; }
.user-menu { display: flex; align-items: center; gap: 10px; padding: 8px; border-top: 1px solid var(--border); }
.user-menu__name { font-size: .875rem; }
.user-menu form { margin-left: auto; }

@media (min-width: 900px) {
  .nav-toggle { display: none; }
  .site-nav { display: flex !important; width: auto; align-items: center; gap: 16px; }
  .site-nav ul { flex-direction: row; align-items: center; padding: 0; gap: 4px; }
  .site-nav a:not(.btn) { padding: 8px 10px; }
  .site-nav a[aria-current="page"] { box-shadow: inset 0 -3px 0 var(--periwinkle); border-radius: 0; }
  .site-nav__cta { display: block; margin-left: 8px; }
  .user-menu { border-top: 0; padding: 0; border-left: 1px solid var(--border); padding-left: 16px; }
  .user-menu__name { display: none; }
}
@media (min-width: 1200px) { .user-menu__name { display: inline; } }

.avatar { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; flex: none; }
.avatar--sm { width: 24px; height: 24px; }
.avatar--initial { display: inline-flex; align-items: center; justify-content: center; background: var(--periwinkle); color: var(--white); font-family: var(--font-head); font-weight: 600; font-size: .875rem; }

.fab {
  position: fixed; right: 16px; bottom: 16px; width: 56px; height: 56px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--tang); color: var(--basalt); text-decoration: none;
  box-shadow: 0 2px 8px rgba(49, 38, 29, .25); z-index: 30;
  -webkit-tap-highlight-color: transparent; /* no grey/blue square on tap; the pulse is the feedback */
}
.fab:hover { color: var(--basalt); }
.fab:focus { outline: none; }
.fab:focus-visible { outline: 3px solid var(--basalt); outline-offset: 3px; }
.fab__icon { display: block; }
.fab.is-pulsing { animation: fab-pulse 320ms ease-out; }
@keyframes fab-pulse {
  0% { transform: scale(1); box-shadow: 0 2px 8px rgba(49, 38, 29, .25), 0 0 0 0 rgba(246, 141, 46, .55); }
  35% { transform: scale(.9); }
  100% { transform: scale(1); box-shadow: 0 2px 8px rgba(49, 38, 29, .25), 0 0 0 14px rgba(246, 141, 46, 0); }
}
@media (min-width: 900px) { .fab { display: none; } }

/* --- Layout -------------------------------------------------------------------- */
.page { width: 100%; max-width: var(--max); margin: 0 auto; padding: 24px var(--gutter) 64px; }
.page-title { font-size: 2.25rem; text-transform: uppercase; color: var(--periwinkle); letter-spacing: .01em; }
@media (min-width: 1200px) { .page-title { font-size: 2.75rem; } }
.lead { font-size: 1.125rem; color: var(--text-muted); max-width: 48rem; }
.breadcrumb { margin-bottom: 16px; font-size: .9375rem; }
.breadcrumb a { text-decoration: none; }

.page-head { position: relative; display: flex; gap: 24px; align-items: flex-end; margin-bottom: 24px; padding-bottom: 20px; overflow: hidden; }
.page-head::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1px; background: var(--border); }
.page-head > div { position: relative; z-index: 1; }
.page-head__deco { position: absolute; right: -24px; top: -40px; height: 220px; width: auto; opacity: 1; pointer-events: none; display: none; }
@media (min-width: 900px) { .page-head__deco { display: block; } .page-head > div { max-width: 70%; } }
/* Decorative diagonal rule, desktop only: on narrow screens it would cut through the lead text. */
.page-head--board::before {
  content: none; position: absolute; right: 18%; top: -60%; width: 1px; height: 260%;
  background: var(--border); transform: rotate(40deg); transform-origin: top; pointer-events: none;
}
@media (min-width: 900px) { .page-head--board::before { content: ""; } }

.site-footer { border-top: 1px solid var(--border); padding: 20px var(--gutter) 88px; text-align: center; font-size: .875rem; color: var(--text-muted); }
.site-footer p { margin: 0 0 4px; }
@media (min-width: 900px) { .site-footer { padding-bottom: 24px; } }

/* --- Flash & toast -------------------------------------------------------------- */
.flash-region { max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }
.flash-region:not(:empty) { padding-top: 16px; }
.flash { display: flex; align-items: flex-start; gap: 12px; padding: 12px 16px; border-radius: var(--radius); color: var(--basalt); margin-bottom: 8px; }
.flash span { flex: 1; }
.flash--success { background: var(--moss); }
.flash--error { background: var(--pumpkin); }
.flash__close { border: 0; background: transparent; font-size: 1.25rem; line-height: 1; cursor: pointer; color: var(--basalt); padding: 0 4px; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--basalt); color: var(--white); padding: 12px 18px; border-radius: var(--radius); z-index: 50; max-width: calc(100% - 32px); }

/* --- Buttons --------------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 10px 18px; border-radius: var(--radius-sm); border: 1px solid transparent;
  font-family: var(--font-head); font-weight: 500; font-size: .9375rem; letter-spacing: .04em; text-transform: uppercase;
  text-decoration: none; cursor: pointer; line-height: 1.2; transition: background-color .15s, border-color .15s, transform .1s;
  --spin: var(--basalt);
}
.btn--sm { min-height: 36px; padding: 6px 12px; font-size: .8125rem; }
.btn--block { width: 100%; }
.btn--primary { background: var(--periwinkle); color: var(--white); }
.btn--primary:hover { background: #4E569C; color: var(--white); }
.btn--accent { background: var(--tang); color: var(--basalt); }
.btn--accent:hover { background: #E57E22; color: var(--basalt); }
.btn--secondary { background: var(--white); color: var(--basalt); border-color: var(--basalt); }
.btn--secondary:hover { background: var(--fog); color: var(--basalt); }
.btn--danger { background: var(--white); color: var(--danger); border-color: var(--danger); }
.btn--danger:hover { background: #FBEAEA; color: var(--danger); }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.btn:not([disabled]):active { transform: scale(.97); }

/* Busy state: a spinner replaces the label while a request triggered by the button is in flight. */
.btn--primary { --spin: var(--white); }
.btn--danger { --spin: var(--danger); }
.is-busy { pointer-events: none; cursor: progress; }
.btn.is-busy { position: relative; color: transparent !important; }
.btn.is-busy::after {
  content: ""; position: absolute; top: 50%; left: 50%; width: 1.1em; height: 1.1em; margin: -.55em 0 0 -.55em;
  border: 2px solid var(--spin); border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite;
}
:not(.btn).is-busy { opacity: .6; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Thin progress bar along the top edge for page loads and background requests. */
.loading-bar { position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 100; overflow: hidden; pointer-events: none; opacity: 0; transition: opacity .15s; }
.loading-bar.is-active { opacity: 1; transition-delay: .15s; }
.loading-bar::before { content: ""; position: absolute; top: 0; bottom: 0; left: -40%; width: 40%; background: var(--periwinkle); animation: loading-slide 1.1s ease-in-out infinite; }
@keyframes loading-slide { to { left: 100%; } }
@media (prefers-reduced-motion: reduce) {
  .btn.is-busy::after { animation-duration: 2s; }
  .loading-bar::before { left: 0; width: 100%; animation: none; opacity: .6; }
}
.link-button { border: 0; background: none; padding: 0; color: var(--link); text-decoration: underline; cursor: pointer; font: inherit; }
.link-button--danger { color: var(--danger); }
.link { font-family: var(--font-head); font-weight: 500; }
.button-row { display: flex; gap: 8px; flex-wrap: wrap; }

/* --- Badges & chips ------------------------------------------------------------- */
.badge { display: inline-block; padding: 2px 10px; border-radius: 999px; font-family: var(--font-head); font-weight: 600; font-size: .75rem; letter-spacing: .06em; text-transform: uppercase; white-space: nowrap; }
.badge--recruiting { background: var(--tang); color: var(--basalt); }
.badge--active { background: var(--periwinkle); color: var(--white); }
.badge--expired { background: var(--jeju); color: var(--basalt); }
.badge--archived { background: var(--basalt); color: var(--fog); }
.badge--draft { background: var(--sky); color: var(--basalt); }

.chips { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 4px; padding: 2px 10px; border-radius: 999px; background: var(--fog); color: var(--basalt); font-size: .8125rem; border: 1px solid var(--border); text-decoration: none; }
a.chip:hover { border-color: var(--periwinkle); color: var(--basalt); }
.chip--more { background: transparent; }
.chip--removable { background: rgba(96, 104, 178, .12); border-color: transparent; padding-right: 4px; }
.chip__remove { border: 0; background: transparent; cursor: pointer; font-size: 1rem; line-height: 1; padding: 2px 6px; color: var(--basalt); border-radius: 50%; }
.chip__remove:hover { background: rgba(49, 38, 29, .1); }

.count-badge { display: inline-block; background: var(--tang); color: var(--basalt); font-family: var(--font-head); font-weight: 600; font-size: .75rem; padding: 2px 8px; border-radius: 999px; text-decoration: none; }
.interested { font-family: var(--font-head); font-weight: 600; font-size: .8125rem; color: var(--link); }

.slots { display: inline-flex; align-items: center; gap: 8px; font-size: .875rem; }
.slots__dots { display: inline-flex; gap: 3px; }
.slots__dot { width: 10px; height: 10px; border-radius: 50%; border: 2px solid var(--periwinkle); background: transparent; }
.slots__dot--filled { background: var(--periwinkle); }

/* --- Forms ----------------------------------------------------------------------- */
.field { margin-bottom: 20px; border: 0; padding: 0; min-width: 0; }
fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
.field__label { display: block; font-family: var(--font-head); font-weight: 500; font-size: 1rem; margin-bottom: 4px; padding: 0; }
.field__hint { font-size: .875rem; color: var(--text-muted); margin: 0 0 6px; }
.field-error { color: var(--danger); font-size: .875rem; font-weight: 600; margin: 6px 0 0; }
.field-row { display: flex; flex-wrap: wrap; gap: 16px; }
.field-row .field { flex: 0 1 auto; }
.field--grow { flex: 1 1 240px !important; }
.field--inline { display: flex; gap: 16px; margin-top: -8px; }

.input, .select, .textarea {
  display: block; width: 100%; min-height: 44px; padding: 10px 12px;
  border: 1px solid #A39E92; border-radius: var(--radius-sm); background: var(--white);
  color: var(--text); font: inherit; font-size: 1rem;
}
.input--sm, .select--sm { min-height: 36px; padding: 6px 10px; font-size: .9375rem; width: auto; }
.input--num { width: 7rem; }
.input--date { width: 12rem; }
.textarea { resize: vertical; line-height: 1.5; }
.input[aria-invalid="true"], .select[aria-invalid="true"], .textarea[aria-invalid="true"], .is-invalid { border-color: var(--danger); }
.input:focus, .select:focus, .textarea:focus { border-color: var(--periwinkle); }
.radio, .checkbox { display: flex; align-items: center; gap: 8px; min-height: 36px; cursor: pointer; }
.radio input, .checkbox input { width: 18px; height: 18px; accent-color: var(--periwinkle); margin: 0; }
.inline-field { display: inline-flex; align-items: center; gap: 8px; font-family: var(--font-head); font-weight: 500; font-size: .875rem; }

/* Equal-width options on one row; on narrow screens a long label wraps inside its own cell. */
.segmented { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; width: 100%; border: 1px solid var(--basalt); border-radius: var(--radius-sm); overflow: hidden; }
@media (min-width: 640px) { .segmented { display: inline-grid; width: auto; } }
.segmented__opt { position: relative; display: flex; }
.segmented__opt input { position: absolute; opacity: 0; inset: 0; }
.segmented__opt span { flex: 1; display: flex; align-items: center; justify-content: center; text-align: center; min-height: 44px; padding: 8px 10px; font-family: var(--font-head); font-weight: 500; line-height: 1.2; cursor: pointer; background: var(--white); border-right: 1px solid var(--basalt); }
@media (min-width: 640px) { .segmented__opt span { padding: 10px 16px; white-space: nowrap; } }
.segmented__opt:last-child span { border-right: 0; }
.segmented__opt input:checked + span { background: var(--periwinkle); color: var(--white); }
.segmented__opt input:focus-visible + span { outline: 3px solid var(--focus); outline-offset: -3px; }

.form-page { max-width: 760px; }
.form-section { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; margin-bottom: 20px; }
@media (min-width: 640px) { .form-section { padding: 24px 28px; } }
.form-section__title { font-size: 1.375rem; color: var(--basalt); border-bottom: 1px solid var(--border); padding-bottom: 8px; margin-bottom: 16px; }
.form-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding: 8px 0; }
.stack { display: flex; flex-direction: column; gap: 10px; }

.error-summary { border: 2px solid var(--danger); background: var(--white); border-radius: var(--radius); padding: 16px 20px; margin-bottom: 20px; }
.error-summary h2 { font-size: 1.125rem; color: var(--danger); }
.error-summary ul { margin: 0; padding-left: 20px; }
.error-summary a { color: var(--danger); font-weight: 600; }

.notice { background: var(--white); border-left: 4px solid var(--periwinkle); padding: 10px 14px; border-radius: var(--radius-sm); }
.notice--info { background: var(--sky); border-left-color: var(--periwinkle); }
.notice--error { border-left-color: var(--danger); }

/* Markdown editor */
.md-field__head { display: flex; align-items: flex-end; justify-content: space-between; gap: 8px; }
.md-tabs { display: inline-flex; margin-bottom: 4px; }
.md-tab { border: 1px solid var(--border); background: var(--white); padding: 4px 10px; font-family: var(--font-head); font-size: .8125rem; cursor: pointer; color: var(--text-muted); }
.md-tab:first-child { border-radius: var(--radius-sm) 0 0 var(--radius-sm); }
.md-tab:last-child { border-radius: 0 var(--radius-sm) var(--radius-sm) 0; border-left: 0; }
.md-tab[aria-pressed="true"] { background: var(--basalt); color: var(--white); border-color: var(--basalt); }
.md-preview { min-height: 120px; border: 1px dashed var(--border); border-radius: var(--radius-sm); padding: 10px 12px; background: var(--white); }

/* Comboboxes (tags, people, postings) */
.tag-input, .person-input { position: relative; }
.tag-input { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 6px; min-height: 44px; background: var(--white); border: 1px solid #A39E92; border-radius: var(--radius-sm); }
.tag-input:focus-within { border-color: var(--periwinkle); }
.tag-input__chips { display: contents; list-style: none; }
.tag-input__text { flex: 1 1 140px; min-width: 120px; border: 0; padding: 6px; font: inherit; background: transparent; outline: none; }
.combo-list { position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 40; list-style: none; margin: 0; padding: 4px; background: var(--white); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: 0 6px 20px rgba(49, 38, 29, .15); max-height: 300px; overflow-y: auto; }
.combo-option { display: flex; align-items: center; gap: 8px; justify-content: space-between; padding: 10px 10px; border-radius: var(--radius-sm); cursor: pointer; }
.combo-option--person { justify-content: flex-start; }
.combo-option[aria-selected="true"], .combo-option:hover { background: rgba(96, 104, 178, .12); }
.combo-option--create { font-weight: 600; color: var(--link); }
.combo-option--similar { background: var(--sky); }
.combo-option__count { font-size: .75rem; color: var(--text-muted); background: var(--fog); border-radius: 999px; padding: 0 8px; }
.combo-empty { padding: 10px; color: var(--text-muted); font-size: .875rem; }

.related-editor { list-style: none; margin: 0 0 8px; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.related-editor__row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 6px 8px; background: var(--fog); border-radius: var(--radius-sm); }
.related-editor__title { flex: 1; min-width: 160px; }

/* --- Board ----------------------------------------------------------------------- */
.board { display: grid; gap: 20px; grid-template-columns: 1fr; }
@media (min-width: 1200px) { .board { grid-template-columns: 280px 1fr; align-items: start; } }

.filters__toggle { width: 100%; }
.filters__panel { display: none; margin-top: 12px; padding: 16px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.filters__panel.is-open { display: block; }
.filters__actions { display: flex; align-items: center; gap: 12px; }
@media (min-width: 640px) {
  .filters__panel.is-open { display: grid; grid-template-columns: 1fr 1fr; column-gap: 16px; }
}
@media (min-width: 1200px) {
  .filters__toggle { display: none; }
  .filters__panel, .filters__panel.is-open { display: block; margin-top: 0; position: sticky; top: 84px; }
}

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 16px; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab { display: inline-flex; align-items: center; gap: 8px; padding: 10px 14px; font-family: var(--font-head); font-weight: 500; font-size: 1rem; text-decoration: none; color: var(--text-muted); border-bottom: 3px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tab[aria-selected="true"] { color: var(--basalt); border-bottom-color: var(--periwinkle); }
.tab:hover { color: var(--basalt); }
.tab__count { font-size: .75rem; background: var(--white); border: 1px solid var(--border); border-radius: 999px; padding: 0 8px; color: var(--text-muted); font-family: var(--font-body); }

.results-bar { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.results-count { font-size: 1.125rem; margin: 0; font-family: var(--font-head); color: var(--text-muted); }
.results-controls { display: flex; gap: 12px; flex-wrap: wrap; }

.cards { list-style: none; margin: 0; padding: 0; display: grid; gap: 16px; grid-template-columns: 1fr; }
@media (min-width: 640px) { .cards { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1400px) { .cards { grid-template-columns: 1fr 1fr 1fr; } }
.load-more-row { grid-column: 1 / -1; text-align: center; padding: 8px; }

.card {
  position: relative; height: 100%; display: flex; flex-direction: column; gap: 10px;
  background: var(--surface); border: 1px solid var(--border); border-left-width: 6px; border-radius: var(--radius);
  padding: 16px; box-shadow: var(--shadow); transition: border-color .15s, transform .15s;
}
.card:hover { border-color: var(--periwinkle); transform: translateY(-1px); }
.card__title { font-size: 1.25rem; margin: 0; }
.card__link { color: var(--basalt); text-decoration: none; }
.card__link::after { content: ""; position: absolute; inset: 0; }
.card__link:focus-visible { outline: none; }
.card:has(:focus-visible) { outline: 3px solid var(--focus); outline-offset: 2px; }
.card__meta { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: .875rem; color: var(--text-muted); margin: 0; }
.card__foot { margin-top: auto; display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding-top: 8px; border-top: 1px solid var(--fog); }
.meta-item { display: inline-flex; align-items: center; gap: 6px; }
.meta-icon { width: 8px; height: 8px; border-radius: 50%; background: var(--jeju); }
.meta-icon--hard_deadline { background: var(--danger); }
.meta-icon--target { background: var(--periwinkle); }

.empty { position: relative; overflow: hidden; text-align: center; padding: 48px 16px; background: var(--surface); border: 1px dashed var(--border); border-radius: var(--radius); }
.empty h2, .empty h3 { font-size: 1.375rem; position: relative; }
.empty p { position: relative; }
.empty__deco { position: absolute; right: -30px; bottom: -40px; height: 160px; width: auto; }

/* --- Detail ---------------------------------------------------------------------- */
.banner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; border-radius: var(--radius); margin-bottom: 16px; }
.banner p { margin: 0; }
.banner--draft { background: var(--sky); border: 1px dashed var(--periwinkle); }

.detail__head { background: var(--surface); border: 1px solid var(--border); border-left-width: 6px; border-radius: var(--radius); padding: 20px; margin-bottom: 20px; }
@media (min-width: 640px) { .detail__head { padding: 24px 28px; } }
.detail__status { margin-bottom: 8px; }
.detail__title { font-size: 1.75rem; margin-bottom: 12px; }
@media (min-width: 900px) { .detail__title { font-size: 2.25rem; } }
.facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px 24px; margin: 16px 0 0; padding-top: 16px; border-top: 1px solid var(--fog); }
.facts dt { font-family: var(--font-head); font-weight: 500; font-size: .75rem; letter-spacing: .08em; text-transform: uppercase; color: var(--text-muted); }
.facts dd { margin: 2px 0 0; }

.detail__grid { display: grid; gap: 20px; grid-template-columns: 1fr; }
@media (min-width: 900px) { .detail__grid { grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr); align-items: start; } .detail__side { position: sticky; top: 84px; } }
.detail__content { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; }
@media (min-width: 640px) { .detail__content { padding: 24px 28px; } }
.detail__side { display: flex; flex-direction: column; gap: 16px; }
@media (max-width: 899px) { .detail__side { order: -1; } }
.section + .section { margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--fog); }
.section__title { font-size: 1.125rem; letter-spacing: .06em; text-transform: uppercase; color: var(--periwinkle); }

.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; display: flex; flex-direction: column; gap: 12px; }
.panel--volunteer { border-top: 4px solid var(--tang); }
.panel--manager { border-top: 4px solid var(--periwinkle); }
.panel__title { font-size: 1.25rem; margin: 0; }
.panel p { margin: 0; }
.people { list-style: none; margin: 0; padding: 0; }
.people li { padding: 4px 0; }

.disclosure summary { cursor: pointer; font-family: var(--font-head); font-weight: 500; color: var(--link); padding: 6px 0; }
.disclosure[open] summary { margin-bottom: 8px; }
.disclosure--inline summary { padding: 0; }

.slots-form fieldset { margin: 0; }
.slots-form__row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.slots-form__counts { display: contents; }
.slots-form .input--num { width: 5rem; }

.related { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.related__kind { font-family: var(--font-head); font-weight: 600; font-size: .75rem; letter-spacing: .06em; text-transform: uppercase; color: var(--text-muted); margin-right: 6px; }

.interests { margin-top: 24px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; }
@media (min-width: 640px) { .interests { padding: 24px 28px; } }
.interests__group { font-size: 1rem; margin: 20px 0 10px; display: flex; align-items: center; gap: 8px; }
.interest-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.interest { border: 1px solid var(--border); border-left: 4px solid var(--border); border-radius: var(--radius-sm); padding: 12px 14px; }
.interest--pending { border-left-color: var(--tang); }
.interest--accepted { border-left-color: var(--periwinkle); }
.interest__head { display: flex; flex-wrap: wrap; gap: 6px; align-items: baseline; font-size: .9375rem; }
.interest__msg { margin: 8px 0; }
.interest__note { font-size: .875rem; margin: 0 0 8px; }
.interest__form { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.interest__form .input--sm { flex: 1 1 200px; width: auto; }
.interest-state--accepted { color: var(--link); }
.interest-state--declined, .interest-state--withdrawn { color: var(--text-muted); }

.prose { overflow-wrap: anywhere; }
.prose > :last-child { margin-bottom: 0; }
.prose ul, .prose ol { padding-left: 1.25em; margin: 0 0 1em; }
.prose blockquote { margin: 0 0 1em; padding: 4px 12px; border-left: 4px solid var(--border); color: var(--text-muted); }
.prose pre { background: var(--fog); padding: 10px; border-radius: var(--radius-sm); overflow-x: auto; }
.prose table { border-collapse: collapse; margin: 0 0 1em; display: block; overflow-x: auto; }
.prose th, .prose td { border: 1px solid var(--border); padding: 6px 10px; text-align: left; }
.prose h1, .prose h2, .prose h3 { font-size: 1.125rem; margin-top: 1em; }

/* --- Lists (My stuff) ------------------------------------------------------------ */
.list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.list__row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; background: var(--surface); border: 1px solid var(--border); border-left-width: 6px; border-radius: var(--radius); padding: 14px 16px; }
.list__main { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1 1 280px; }
.list__title { font-family: var(--font-head); font-weight: 500; font-size: 1.125rem; color: var(--basalt); text-decoration: none; }
.list__title:hover { text-decoration: underline; }
.list__aside { display: flex; align-items: center; gap: 12px; }

/* --- Admin ----------------------------------------------------------------------- */
.toolbar { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.table { width: 100%; border-collapse: collapse; font-size: .9375rem; }
.table th, .table td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--fog); vertical-align: top; }
.table thead th { font-family: var(--font-head); font-weight: 600; font-size: .8125rem; letter-spacing: .06em; text-transform: uppercase; background: var(--fog); }
.table thead a { color: var(--basalt); text-decoration: none; }
.table thead a[aria-current] { color: var(--periwinkle); text-decoration: underline; }
.inline-form { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 6px 0; }

/* --- Login & simple pages ---------------------------------------------------------- */
.login { position: relative; overflow: hidden; display: flex; align-items: center; justify-content: center; padding: 48px var(--gutter); min-height: 80vh; }
.login::before { content: ""; position: absolute; left: 50%; top: -10%; width: 1px; height: 140%; background: var(--border); transform: rotate(40deg); }
.login__deco { position: absolute; pointer-events: none; width: auto; }
.login__deco--m { height: 260px; right: -40px; top: -30px; }
.login__deco--e { height: 220px; left: -60px; bottom: -40px; }
.login__card { position: relative; z-index: 1; width: 100%; max-width: 440px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 32px 28px; text-align: center; }
.login__logo { width: 200px; height: auto; margin: 0 auto 8px; display: block; }
.login__lockup { width: 100%; max-width: 300px; height: auto; margin: 0 auto 16px; display: block; }
.login__title { font-size: 2rem; text-transform: uppercase; color: var(--periwinkle); letter-spacing: .04em; }
.login__card .lead { font-size: 1rem; }
.dev-login { margin-top: 24px; padding-top: 16px; border-top: 1px dashed var(--border); text-align: left; }
.dev-login h2 { font-size: 1rem; margin-bottom: 0; }

.error-page { position: relative; overflow: hidden; padding: 48px 0; }
.error-page__code { font-family: var(--font-head); font-weight: 600; font-size: 4rem; color: var(--border); margin: 0; line-height: 1; }
.error-page__deco { position: absolute; right: -20px; top: 20px; height: 220px; width: auto; }
.test-email { margin-top: 8px; }

/* Status color bars (kept last so they win over component borders). */
.card--recruiting { border-left-color: var(--tang); }
.card--active { border-left-color: var(--periwinkle); }
.card--expired { border-left-color: var(--jeju); }
.card--archived { border-left-color: var(--basalt); }
.card--draft { border-left-color: var(--sky); border-left-style: dashed; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
  .card:hover { transform: none; }
}

@media print {
  .site-header, .site-footer, .fab, .detail__side, .interests, .filters { display: none !important; }
  body { background: var(--white); }
}

/* Touch screens: hover styles otherwise stick after a tap; use brief :active feedback instead. */
@media (hover: none) {
  .card:hover { border-color: var(--border); transform: none; }
  .card:active { border-color: var(--periwinkle); }
  .btn--primary:hover { background: var(--periwinkle); }
  .btn--accent:hover { background: var(--tang); }
  .btn--secondary:hover { background: var(--white); }
  .btn--danger:hover { background: var(--white); }
  .btn--primary:active { background: #4E569C; }
  .btn--accent:active { background: #E57E22; }
  .btn--secondary:active { background: var(--fog); }
  .btn--danger:active { background: #FBEAEA; }
  .site-nav a:not(.btn):hover { background: none; }
  .site-nav a:not(.btn):active, .tab:active { background: rgba(96, 104, 178, .08); }
}
