/* Imperial Rose Guild Hall - the people side: themes chosen on the Profile page, the profile card, Applications,
   Events, Crafters, Requests, and the public application form (/join/). Builds on style.css and its colours. */

/* ---------------------------------------------------------------- a theme chosen on the Profile page
   style.css follows the system (dark, light with prefers-color-scheme); <html data-theme> overrides it. */
:root[data-theme="dark"] {
  --bg: #140e0d;
  --bg-glow: #2a1512;
  --surface: #1f1715;
  --surface-2: #281d1a;
  --surface-3: #33251f;
  --border: #3b2b26;
  --border-strong: #5b4038;
  --text: #ecdfc6;
  --muted: #b39f86;
  --faint: #86725f;
  --rose: #c8324f;
  --rose-bright: #e46a83;
  --rose-deep: #7d1428;
  --rose-wash: rgba(200, 50, 79, 0.14);
  --gold: #d6af62;
  --gold-wash: rgba(214, 175, 98, 0.12);
  --good: #8fbf7a;
  --good-wash: rgba(143, 191, 122, 0.13);
  --bad: #ec7a6f;
  --bad-wash: rgba(236, 122, 111, 0.13);
  --warn: #eab155;
  --warn-wash: rgba(234, 177, 85, 0.14);
  --shadow: 0 1px 0 rgba(255, 235, 200, 0.03) inset, 0 8px 24px rgba(0, 0, 0, 0.35);
  color-scheme: dark;
}
:root[data-theme="light"] {
  --bg: #f1e7d3;
  --bg-glow: #f7d9cf;
  --surface: #fbf5e8;
  --surface-2: #f4ead6;
  --surface-3: #ecdfc5;
  --border: #dccaa8;
  --border-strong: #c3a982;
  --text: #2b1c15;
  --muted: #6d5646;
  --faint: #927a64;
  --rose: #a61e3a;
  --rose-bright: #b8274a;
  --rose-deep: #7d1428;
  --rose-wash: rgba(166, 30, 58, 0.09);
  --gold: #8a6420;
  --gold-wash: rgba(138, 100, 32, 0.1);
  --good: #3f7a2c;
  --good-wash: rgba(63, 122, 44, 0.1);
  --bad: #b2362a;
  --bad-wash: rgba(178, 54, 42, 0.09);
  --warn: #9a5f00;
  --warn-wash: rgba(196, 128, 20, 0.13);
  --shadow: 0 1px 2px rgba(80, 50, 20, 0.08), 0 6px 18px rgba(80, 50, 20, 0.08);
  color-scheme: light;
}

/* ---------------------------------------------------------------- shared bits */
input[type="datetime-local"],
input[type="url"],
input[type="email"] {
  background: var(--surface-2);
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  padding: 8px 10px;
  min-height: 38px;
  max-width: 100%;
  font: inherit;
  color: inherit;
}
textarea {
  width: 100%;
  resize: vertical;
  line-height: 1.45;
}
.card-title {
  margin: 0 0 12px;
  font-size: 17px;
}
.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 10px 14px;
  margin-bottom: 10px;
  align-items: end;
}
.card > .field,
.card > form > .field,
.event-form > .field {
  margin-bottom: 10px;
}
.seg-count {
  display: inline-block;
  margin-left: 6px;
  padding: 0 6px;
  border-radius: 9px;
  background: var(--rose-wash);
  color: var(--rose-bright);
  font-size: 11px;
  line-height: 17px;
}
.name-link {
  background: none;
  border: 0;
  padding: 0;
  color: inherit;
  text-align: left;
  cursor: pointer;
  font: inherit;
}
.name-link.cell-main {
  font-weight: 600;
}
.name-link:hover,
.name-link:focus-visible {
  color: var(--rose-bright);
  text-decoration: underline;
}
.name-link.inline {
  display: inline;
  color: var(--text);
  font-weight: 600;
}
.who-link {
  color: inherit;
}
.who-link:hover {
  text-decoration: none;
}
.who-link:hover .name,
.who-link[aria-current="page"] .name {
  color: var(--rose-bright);
}
.grow {
  flex: 1;
}

/* ---------------------------------------------------------------- the profile card */
.profile-dialog {
  width: min(520px, calc(100vw - 24px));
}
.profile-card {
  padding: 16px 18px 18px;
}
.profile-card.preview {
  padding: 0;
}
.card-head {
  display: flex;
  gap: 14px;
  align-items: center;
  margin-bottom: 12px;
}
.card-head h2 {
  margin: 0 0 2px;
}
.avatar {
  flex: none;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 24px;
  color: #fff;
  background: radial-gradient(circle at 35% 30%, var(--rose-bright), var(--rose-deep));
  border: 2px solid var(--gold);
}
.profile-facts {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 4px 14px;
  margin: 0 0 10px;
}
.profile-facts > div {
  display: contents;
}
.profile-facts dt {
  color: var(--muted);
  font-size: 13px;
}
.profile-facts dd {
  margin: 0;
  overflow-wrap: anywhere;
}
.profile-about {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  padding: 10px 12px;
  border-left: 3px solid var(--gold);
  background: var(--surface-2);
  border-radius: 0 8px 8px 0;
}
.profile-card h3,
.attendees h3 {
  margin: 14px 0 6px;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--muted);
  font-family: var(--font-body);
}
.skill-block {
  margin-bottom: 8px;
}

/* ---------------------------------------------------------------- the Profile page */
.profile-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  gap: 0 18px;
  align-items: start;
}
.pref-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}
.pref-row > span:first-child {
  min-width: 110px;
}
label.check.pref-row {
  align-items: flex-start;
  color: var(--text);
}
label.check.pref-row input {
  margin-top: 3px;
}
.char-list {
  list-style: none;
  margin: 0 0 10px;
  padding: 0;
}
.char-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}
.known-here {
  margin: 4px 0 12px;
}
.inline-form .field.grow {
  flex: 1;
  min-width: 200px;
}
.inline-form .field.grow input {
  width: 100%;
}
.inline-form {
  align-items: flex-end;
}
.feed-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
  padding: 8px 0;
  border-top: 1px solid var(--border);
}
.feed-row > span:first-child {
  flex: 1 1 100%;
}
code.feed {
  flex: 1;
  min-width: 0;
  font-family: var(--font-mono);
  font-size: 12px;
  padding: 4px 8px;
  border-radius: 6px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  overflow-wrap: anywhere;
}

/* ---------------------------------------------------------------- Applications */
.badge.app-new {
  color: var(--gold);
  border-color: var(--gold);
  background: var(--gold-wash);
}
.badge.app-accepted,
.badge.app-joined {
  color: var(--good);
  border-color: var(--good);
  background: var(--good-wash);
}
.badge.app-declined {
  color: var(--bad);
  border-color: var(--bad);
  background: var(--bad-wash);
}
.app-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr);
  gap: 0 18px;
  align-items: start;
}
.qa-list {
  margin: 0 0 10px;
}
.qa {
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}
.qa dt {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--muted);
  margin-bottom: 2px;
}
.qa dd {
  margin: 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.notes {
  list-style: none;
  padding: 0;
  margin: 0 0 12px;
}
.notes li {
  padding: 8px 10px;
  margin-bottom: 8px;
  border-radius: 8px;
  background: var(--surface-2);
}
.notes p {
  margin: 4px 0 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

/* ---------------------------------------------------------------- Events */
.cal-toolbar {
  gap: 10px;
}
.cal-nav {
  display: flex;
  align-items: center;
  gap: 6px;
}
.cal-title {
  margin: 0 6px;
  min-width: 150px;
  text-align: center;
  font-size: 18px;
}
.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--border);
  gap: 1px;
}
.cal-head {
  background: var(--surface-2);
  padding: 6px 8px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--muted);
}
.cal-cell {
  background: var(--surface);
  min-height: 104px;
  padding: 4px 5px 6px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}
.cal-cell.other {
  background: var(--surface-2);
}
.cal-cell.other .cal-day {
  color: var(--faint);
}
.cal-day {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  align-self: flex-end;
  min-width: 22px;
  text-align: center;
  line-height: 22px;
  border-radius: 11px;
}
.cal-cell.today .cal-day {
  background: var(--rose);
  color: #fff;
}
.cal-chip {
  display: block;
  width: 100%;
  text-align: left;
  font-size: 12px;
  line-height: 1.3;
  padding: 2px 6px;
  border-radius: 5px;
  border: 1px solid var(--border-strong);
  border-left: 3px solid var(--gold);
  background: var(--surface-2);
  color: var(--text);
  cursor: pointer;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cal-chip.public {
  border-left-color: var(--rose);
}
.cal-chip.going {
  background: var(--good-wash);
}
.cal-chip.cancelled {
  text-decoration: line-through;
  opacity: 0.6;
}
.cal-chip-time {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.agenda-day {
  margin-bottom: 16px;
}
.agenda-day h3 {
  margin: 0 0 6px;
  font-size: 15px;
  color: var(--gold);
}
.agenda-row {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  text-align: left;
  padding: 10px 14px;
  margin-bottom: 6px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
}
.agenda-row:hover {
  border-color: var(--gold);
}
.agenda-row.cancelled .agenda-title {
  text-decoration: line-through;
  opacity: 0.7;
}
.agenda-time {
  flex: none;
  width: 110px;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}
.agenda-main {
  flex: 1;
  min-width: 0;
}
.agenda-title {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  font-weight: 600;
}
.agenda-going {
  flex: none;
  font-size: 13px;
  color: var(--muted);
  text-align: right;
}
.rsvp-mine {
  display: block;
  font-size: 12px;
  color: var(--gold);
}
.rsvp-mine.yes {
  color: var(--good);
}
.badge.public-badge {
  color: var(--rose-bright);
  border-color: var(--rose);
  background: var(--rose-wash);
}
.event-dialog {
  width: min(620px, calc(100vw - 24px));
}
.event-detail,
.event-form {
  padding: 16px 18px 18px;
}
.event-detail h2 {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 0 0 6px;
}
.event-when {
  font-weight: 600;
  color: var(--gold);
  margin-bottom: 4px;
}
.event-desc {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.rsvp {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin: 14px 0 6px;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--surface-2);
}
.attendees .names {
  margin: 0;
}
.event-detail .actions {
  margin-top: 14px;
}

/* ---------------------------------------------------------------- Crafters */
.skill-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: 0 14px;
}
.skill-card h3 {
  margin: 0 0 8px;
}
.skill-people {
  list-style: none;
  margin: 0;
  padding: 0;
}
.skill-people li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 70px 32px;
  align-items: center;
  gap: 10px;
  padding: 3px 0;
}
.skill-people .bar {
  height: 6px;
  border-radius: 3px;
  background: var(--surface-3);
  overflow: hidden;
}
.skill-people .bar > span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--rose-deep), var(--gold));
}
.skill-people .lvl {
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.skill-makes {
  margin-top: 10px;
}
.skill-makes summary {
  cursor: pointer;
  margin-bottom: 6px;
}
.makers {
  margin: 0;
  line-height: 1.7;
}

/* ---------------------------------------------------------------- Requests */
.req-fields {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 10px;
  margin-bottom: 8px;
}
.req-fields .field:nth-of-type(1) {
  flex: 2 1 200px;
}
.req-fields .field:nth-of-type(2) {
  flex: 0 1 100px;
}
.req-fields .field:nth-of-type(3) {
  flex: 3 1 220px;
}
.req-pick:empty {
  display: none;
}
.req-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 0 14px;
}
.req-card {
  display: flex;
  flex-direction: column;
}
.req-card.done,
.req-card.cancelled {
  opacity: 0.8;
}
.req-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}
.req-title {
  font-size: 16px;
}
.req-note {
  padding: 6px 10px;
  border-left: 3px solid var(--border-strong);
  background: var(--surface-2);
  border-radius: 0 6px 6px 0;
  overflow-wrap: anywhere;
}
.req-where {
  color: var(--good);
}
.req-card .actions {
  margin-top: auto;
  padding-top: 6px;
}

/* ---------------------------------------------------------------- phones */
@media (max-width: 640px) {
  /* the header keeps to one line: the name shortens, the rank shows on the Profile page */
  .who .badge.rank {
    display: none;
  }
  .who-link .name {
    display: inline-block;
    max-width: 28vw;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    vertical-align: bottom;
  }
}
@media (max-width: 760px) {
  .profile-grid,
  .app-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .cal-cell {
    min-height: 64px;
    padding: 3px;
  }
  .cal-chip {
    font-size: 0;
    padding: 0;
    height: 6px;
    border-left-width: 1px;
    background: var(--gold);
  }
  .cal-chip.public {
    background: var(--rose);
  }
  .cal-chip-time {
    display: none;
  }
  .cal-head {
    padding: 4px;
    text-align: center;
  }
  .cal-title {
    min-width: 0;
    font-size: 16px;
  }
  .agenda-row {
    flex-wrap: wrap;
    gap: 4px 12px;
  }
  .agenda-time {
    width: auto;
  }
  .agenda-going {
    flex-basis: 100%;
    text-align: left;
  }
  .rsvp-mine {
    display: inline;
    margin-left: 8px;
  }
  .req-list {
    grid-template-columns: minmax(0, 1fr);
  }
  .feed-row code.feed {
    flex-basis: 100%;
  }
}
