/* ============================================================================
   Events
   ============================================================================ */

/* Rows size themselves, equal heights leave short cards empty */
.events-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(21rem, 1fr));
  gap: 1.25rem;
}

/* "Expand event details" adds the rest */
.events-grid--compact .event-card-type,
.events-grid--compact .event-facts li:nth-child(n + 3),
.events-grid--compact .event-description,
.events-grid--compact .event-card-footer {
  display: none;
}

.events-grid--compact .event-facts {
  margin-bottom: 0;
}

/* Place without the venue */
.events-grid--compact .event-facts li:nth-child(2) .event-fact-sub {
  display: none;
}

/* Whole card is one link, so it carries the link states */
.event-card {
  padding: 1.125rem 1.25rem 1rem;
  display: flex;
  flex-direction: column;
  color: inherit;
  text-decoration: none;
}

/* main a:hover would underline the whole card */
.event-card:hover {
  text-decoration: none;
}

/* Category overline above the title */
.event-card-type {
  margin-bottom: 0.15rem;
  color: var(--clr-text-muted);
}

/* Card is the link, so the title takes the link colour */
.event-card-heading h2 {
  color: var(--clr-accent);
}

.event-card:hover .event-card-heading h2 {
  text-decoration: underline;
}

/* Badges and chips wrap under the title or in the footer */
.event-card-badges,
.event-card-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
}

.event-card-badges {
  margin-top: 0.45rem;
}

/* Event icon/logo. contain, not cover: logos are artwork, not photos */
.event-card-logo,
.event-logo {
  flex-shrink: 0;
  object-fit: contain;
  border-radius: var(--radius);
}

.event-card-logo {
  width: 2.75rem;
  height: 2.75rem;
}

/* Facts: date, place, organizations, photography types */
.event-facts {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-bottom: 0.75rem;
  font-size: var(--text-sm);
  color: var(--clr-text-muted);
}

/* Queue and profile cards: a tighter heading and facts */
.admin-card .event-heading,
.profile-event-card .event-heading {
  margin-bottom: 0.5rem;
}

.admin-card .event-facts,
.profile-event-card .event-facts {
  gap: 0.25rem;
  margin-bottom: 0;
}

.event-facts li {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  min-width: 0;
}

.event-fact-icon {
  width: 1rem;
  height: 1rem;
  flex-shrink: 0;
  margin-top: 0.15rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.event-fact-body {
  min-width: 0;
  overflow-wrap: anywhere;
}

/* When and where in full colour, the rest muted */
.event-facts li:nth-child(-n + 2) .event-fact-body {
  color: var(--clr-text);
}

.event-fact-sub,
.event-when {
  color: var(--clr-text-muted);
  white-space: nowrap;
}

/* Drops whole to the next line, wraps only when longer than a line */
.event-fact-sub {
  display: inline-block;
  max-width: 100%;
  white-space: normal;
}

.event-when--soon {
  color: var(--clr-text);
  font-weight: 600;
}

.event-when--now {
  color: var(--clr-success-text);
  font-weight: 600;
}

/* Two lines of description, then a cut */
.event-description {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  margin-bottom: 0.875rem;
  font-size: var(--text-sm);
  line-height: 1.5;
  color: var(--clr-text-muted);
  overflow-wrap: anywhere;
}

/* Footer: coverage on the left, access and credential chips on the right */
.event-card-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem 0.75rem;
  margin-top: auto;
  padding-top: 0.75rem;
  border-top: 1px solid var(--clr-border-light);
  font-size: var(--text-sm);
  color: var(--clr-text-muted);
}

.event-coverage strong {
  color: var(--clr-text);
}

.event-card-chips .access-chip {
  margin: 0;
}

/* ── Shared card pieces (events.js) ─────────────────────────────────────── */
/* Tile, category, title, badges, shared by every event card */
.event-card-header,
.event-heading {
  display: flex;
  align-items: flex-start;
  gap: 0.875rem;
}

.event-card-header {
  margin-bottom: 0.875rem;
}

.event-card-heading h2,
.event-heading-title {
  font-size: var(--text-lg);
  line-height: 1.3;
  overflow-wrap: anywhere;
}

/* Dense lists: a smaller tile and title */
.event-heading--compact {
  gap: 0.75rem;
}

.event-heading--compact .event-date-tile {
  min-width: 3.75rem;
}

.event-heading--compact .event-date-month {
  padding: 0.2rem 0 0.15rem;
  font-size: 0.6875rem;
}

.event-heading--compact .event-date-day {
  padding: 0.3rem 0.3125rem 0.35rem;
  font-size: var(--text-lg);
  line-height: 1rem;
}

.event-heading--compact .event-date-day--range {
  font-size: var(--text-md);
}

.event-heading--compact .event-heading-title {
  font-size: var(--text-base);
  font-weight: 600;
}

.event-heading--compact .event-card-badges {
  margin-top: 0.3rem;
}

/* Top of a card or roster row: avatar, name, badges, note */
.request-lead,
.assignment-header {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
}

.request-lead-name {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem 0.6rem;
  font-size: var(--text-lg);
  font-weight: 600;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.request-lead-line {
  margin-top: 0.2rem;
  font-size: var(--text-sm);
  color: var(--clr-text-muted);
  overflow-wrap: anywhere;
}

.request-lead-line .assignment-wiki-handle {
  display: inline;
  margin: 0 0.35rem 0 0;
}

.request-lead .assignment-notes {
  margin-top: 0.5rem;
}

.request-lead--compact .request-lead-name {
  font-size: var(--text-base);
}

/* Fact line without an icon, indented to the text column */
.event-fact-note {
  padding-left: 1.5rem;
}

/* An .empty-state with its retry button stacked under the message */
.event-load-error {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.875rem;
}

/* ── Events list: table view ──────────────────────────────────────────────── */

.events-table {
  min-width: 52rem;
}

.events-table td:nth-child(2) {
  min-width: 13rem;
}

.events-table td {
  vertical-align: top;
}

/* The title and the place may wrap, other cells do not */
.events-table td:not(:nth-child(2)):not(:nth-child(3)) {
  white-space: nowrap;
}

.events-table td:nth-child(3) {
  min-width: 12rem;
}

/* Two chips stack rather than widen the column */
.events-table .event-card-chips {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.25rem;
}

.events-table-title {
  font-weight: 600;
}

/* A quieter second line in a cell: timing, type, venue */
.events-table-sub {
  display: block;
  font-size: var(--text-sm);
  color: var(--clr-text-muted);
}

/* ── Event Detail: two-column layout ──────────────────────────────────────── */

/* The header's action buttons: Join/Request first, then Edit and Delete */
#eventActions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  /* A long title wraps before the buttons stack */
  flex-shrink: 0;
  max-width: 100%;
}

/* Logo and title read as one unit in the page header */
.page-title-row {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  min-width: 0;
}

.event-title-tile {
  flex-shrink: 0;
}

/* Actions stay level with the title */
.event-header {
  align-items: flex-start;
}

/* The page's one large date: sized to stand beside the three-row block */
.event-title-tile .event-date-tile {
  min-width: 5rem;
}

.event-title-tile .event-date-month {
  padding: 0.45rem 0 0.4rem;
}

.event-title-tile .event-date-day {
  padding: 0.6rem 0.375rem 0.55rem;
  font-size: 1.625rem;
  line-height: 1.625rem;
}

.event-title-tile .event-date-day--range {
  font-size: var(--text-2xl);
}

.event-title-tile .event-date-year {
  margin-top: -0.2rem;
  padding-bottom: 0.6rem;
  font-size: var(--text-sm);
}

.event-header-body {
  min-width: 0;
}

.event-header-title {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.375rem 0.75rem;
}

.event-facts--header {
  margin: 0.5rem 0 0;
  font-size: var(--text-base);
}

.event-facts--header .event-fact-icon {
  margin-top: 0.25rem;
}

/* Long venue names wrap mid-phrase here rather than dropping whole */
.event-facts--header .event-fact-sub {
  display: inline;
  white-space: normal;
}

.event-logo {
  width: 3rem;
  height: 3rem;
}

/* Logo preview, row layout is .avatar-upload (forms.css) */
.logo-preview {
  flex-shrink: 0;
}

.logo-preview img,
.logo-placeholder {
  width: 6.25rem;
  height: 6.25rem;
  border-radius: var(--radius);
  border: 1px solid var(--clr-border);
  object-fit: contain;
}

.logo-placeholder {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-sm);
  color: var(--clr-text-muted);
  background: var(--clr-bg);
}

.event-detail {
  display: grid;
  grid-template-columns: 1fr 22.5rem;
  grid-template-areas: "main sidebar";
  gap: 1.25rem;
  align-items: start;
}

.event-main,
.event-sidebar {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.event-main {
  grid-area: main;
  min-width: 0;
}

.event-sidebar {
  grid-area: sidebar;
}

.detail-section {
  padding: var(--pad-card);
}

.detail-section h3 {
  margin: 1rem 0 0.4rem;
}

/* Category beside the title, in the cards' overline style */
.detail-label {
  color: var(--clr-text-muted);
}

/* ── Overview: description, then a fact sheet ────────────────────────────── */

.detail-description {
  margin-bottom: 1.25rem;
}

.fact-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.fact-list > div {
  display: grid;
  grid-template-columns: 9.5rem minmax(0, 1fr);
  gap: 0.25rem 1rem;
}

.fact-list dt {
  font-size: var(--text-sm);
  color: var(--clr-text-muted);
  padding-top: 0.125rem;
}

.fact-list dd {
  font-size: var(--text-base);
  min-width: 0;
  overflow-wrap: anywhere;
}

.fact-list dd p + p {
  margin-top: 0.375rem;
}

/* A quieter second line inside a fact value (the press application window) */
.fact-sub {
  font-size: var(--text-sm);
  color: var(--clr-text-muted);
}

.fact-list dd p + .fact-sub {
  margin-top: 0.125rem;
}

.fact-prose {
  white-space: pre-wrap;
  line-height: 1.6;
  max-width: 70ch;
}

/* Audit metadata, last in the management panel */
.detail-provenance {
  margin-top: 1.25rem;
  padding-top: 0.625rem;
  border-top: 1px solid var(--clr-border-light);
  font-size: var(--text-sm);
  color: var(--clr-text-muted);
}

.detail-notes {
  margin-top: 1rem;
}

/* Public notes are prose, internal notes are admin only */
.detail-notes--public,
.detail-notes--internal {
  padding: 0.625rem 0.875rem;
  border-radius: var(--radius);
}

.detail-notes--public {
  background: var(--clr-bg);
}

.detail-notes--internal {
  background: var(--clr-warn-bg);
  border: 1px solid var(--clr-warn-border);
}

.detail-notes--public h3,
.detail-notes--internal h3 {
  margin-top: 0;
}

.detail-notes--internal h3 {
  color: var(--clr-warn-text);
}

/* Assignments */
.assignment-item {
  padding: 0.75rem 0.875rem;
  margin-bottom: 0.5rem;
}

/* Your own row among the photographers */
.assignment-item--mine {
  border-color: var(--clr-accent);
}

.assignment-you {
  color: var(--clr-accent);
}

/* ── Comments ─────────────────────────────────────────────────────────────── */

.comment-list {
  display: flex;
  flex-direction: column;
  gap: 0.875rem;
}

.comment {
  display: flex;
  gap: 0.625rem;
  align-items: flex-start;
}

.comment-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.25rem 0.6rem;
  font-size: var(--text-sm);
}

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

/* A text button, so the row stays quiet */
.comment-delete {
  margin-left: auto;
  padding: 0;
  font: inherit;
  font-size: var(--text-sm);
  color: var(--clr-text-muted);
}

.comment-delete:hover {
  color: var(--clr-error-text);
  text-decoration: underline;
}

.comment-text {
  margin-top: 0.2rem;
  white-space: pre-line;
  overflow-wrap: anywhere;
}

.comment-form {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--clr-border-light);
}

.comment-form .form-group {
  margin-bottom: 0;
}

.comment-form-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  margin-top: 0.5rem;
}

.comment-form-row .help-text {
  margin: 0;
}

/* Right end, with or without the counter beside it */
.comment-form-row .button {
  margin-left: auto;
}

/* Bare list of links (e.g. event reference links) */
.links-list {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}

/* Links side by side when they follow the description */
.links-list--inline {
  flex-direction: row;
  flex-wrap: wrap;
  gap: 0.25rem 1rem;
}

/* Link text falls back to the raw URL with no label */
.links-list a,
#eventCommonsCategory {
  overflow-wrap: anywhere;
}

/* Coordinator list, room reserved while it loads */
.coordinator-list {
  display: flex;
  flex-direction: column;
  min-height: 3rem;
}

.coordinator-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.625rem;
  margin-bottom: 0.375rem;
}

.coordinator-item a {
  flex: 1;
  font-size: var(--text-base);
  font-weight: 500;
  min-width: 0;
}

/* Pending offer: chip and buttons wrap under the name */
.coordinator-item--pending {
  flex-wrap: wrap;
  gap: 0.375rem 0.5rem;
}

.coordinator-item--pending a {
  min-width: 8rem;
  color: var(--clr-text-muted);
}

/* Under a sidebar list: an add row or its action buttons */
.sidebar-add-row,
.sidebar-actions {
  display: flex;
  gap: 0.375rem;
  margin-top: 0.625rem;
}

.sidebar-add-row {
  align-items: center;
}

.sidebar-add-row input,
.sidebar-add-row select {
  padding: 0.375rem 0.5rem;
  font-size: var(--text-md);
}

.sidebar-actions {
  flex-wrap: wrap;
}

/* Roster groups: the heading carries the status, so rows have no pill */
.detail-section h3.roster-group {
  margin: 1rem 0 0.5rem;
  color: var(--clr-text-muted);
}

.detail-section h3.roster-group:first-child {
  margin-top: 0;
}

.roster-group-count {
  font-weight: 400;
}

/* A row's only action, level with the name */
.roster-inline-action {
  flex-shrink: 0;
  margin-left: auto;
}

/* Phone: name and note keep the width, the action drops below */
@media (max-width: 600px) {
  .assignment-header {
    flex-wrap: wrap;
  }

  .roster-inline-action {
    flex-basis: 100%;
    text-align: right;
  }
}

/* What the photographer wrote, under their name */
.roster-note {
  margin-top: 0.375rem;
  font-size: var(--text-md);
  color: var(--clr-text);
}

.assignment-name {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.assignment-wiki-handle {
  font-size: var(--text-sm);
  color: var(--clr-text-muted);
  margin-top: 0.1rem;
  display: block;
}

/* Row footer: routine buttons left, the destructive text action right */
.assignment-actions,
.coverage-actions {
  display: flex;
  gap: 0.375rem 0.75rem;
  flex-wrap: wrap;
  align-items: center;
  margin-top: 0.75rem;
}

.assignment-actions {
  padding-top: 0.625rem;
  border-top: 1px solid var(--clr-border-light);
}

.assignment-actions .button-text--danger,
.coverage-actions .button-text--danger,
.assignment-card-footer .button-text--danger {
  margin-left: auto;
}

.assignment-notes {
  font-size: var(--text-md);
  color: var(--clr-text-muted);
  background: var(--clr-bg);
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius);
  margin-top: 0.625rem;
}

/* Its class already makes it a wrapping flex row */
#assignmentActions:not(:empty) {
  padding-top: 0.75rem;
  border-top: 1px solid var(--clr-border-light);
  gap: 0.5rem;
  margin-top: 0.75rem;
}

/* ============================================================================
   Photographers
   ============================================================================ */

/* Two cards from about 560px up */
.photographers-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr));
  gap: 0.75rem;
}

.photographer-card {
  overflow: hidden;
}

.photographer-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
}

.photographer-avatar {
  flex-shrink: 0;
}

.photographer-info {
  min-width: 0;
}

.photographer-info h2 {
  margin-bottom: 0.1rem;
  font-size: var(--text-base);
  overflow-wrap: anywhere;
  transition: color var(--transition);
}

.photographer-card:hover h2 {
  color: var(--clr-accent);
}

.photographer-username {
  font-size: var(--text-sm);
  color: var(--clr-text-muted);
  margin-bottom: 0.25rem;
  overflow-wrap: anywhere;
}

.photographer-facts {
  gap: 0.2rem;
  margin: 0.25rem 0 0;
}

/* Both facts are secondary here: the name is the point */
.photographer-facts li .event-fact-body {
  color: var(--clr-text-muted);
}

/* ── Admin log ───────────────────────────────────────────────────────────── */
/* Full width under the two-column detail grid. Rows match the admin dashboard */

.event-log {
  margin-top: 1rem;
}

.event-log .help-text {
  margin: -0.25rem 0 0.75rem;
}

.activity-item {
  display: flex;
  gap: 1rem;
  align-items: start;
  padding: 0.375rem 0;
  border-bottom: 1px solid var(--clr-border-light);
}

.activity-item:last-child {
  border-bottom: none;
}

.activity-time {
  min-width: 5.625rem;
  padding-top: 0.15rem;
  font-size: var(--text-xs);
  color: var(--clr-text-muted);
  white-space: nowrap;
}

.activity-description {
  flex: 1;
  font-size: var(--text-sm);
  line-height: 1.5;
  overflow-wrap: anywhere;
}

/* ── Event page odds and ends ─────────────────────────────────────────────── */

/* Reserve room for the roster while it loads */
.assignments-list {
  min-height: 3rem;
}

/* Your Coverage card (its heading row is layout.css's .card-heading-row) */
#myCoverageNote {
  margin-bottom: 0.75rem;
}

#myCoverageDetails .assignment-notes {
  margin-top: 0;
}

/* The upload button in Your Coverage, between the note and the actions */
.coverage-upload {
  margin-top: 0.75rem;
}

/* The group's last field drops its margin, so the group carries it */
#accessSettingsGroup {
  margin-bottom: 1rem;
}

/* Save at the foot of the management form */
.management-footer {
  margin-top: 0.25rem;
}

/* Delete at the foot of the management panel */
.management-danger {
  margin-top: 1rem;
}

/* Management panel and request card spacing */
.request-desc {
  margin-bottom: 0.875rem;
}

.sidebar-block {
  margin-bottom: 1rem;
}

/* ============================================================================
   Responsive: Events & Photographers
   ============================================================================ */

/* The nav rail takes 15rem from 961px up */
@media (max-width: 1100px) {
  /* One column, the event first */
  .event-detail {
    grid-template-columns: 1fr;
    grid-template-areas:
      "main"
      "sidebar";
  }
}

/* Solo view: one column, after the media rule so the cap holds */
.event-detail--solo {
  grid-template-columns: minmax(0, 52rem);
  grid-template-areas: "main";
}

@media (max-width: 768px) {
  .fact-list > div {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .activity-item {
    flex-direction: column;
    gap: 0.125rem;
  }

  .activity-time {
    min-width: auto;
  }
}

/* Series box: the parent's children, or the child's parent link */
.series-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.series-list li {
  display: flex;
  gap: 1rem;
  padding: 0.35rem 0;
  border-bottom: 1px solid var(--clr-border);
}

/* The title takes the room; the date and photos link keep to the right */
.series-list li > a:first-child {
  flex: 1;
}

.series-list li:last-child {
  border-bottom: none;
}

.series-list-when,
.series-list-photos {
  white-space: nowrap;
}

.series-list-when {
  color: var(--clr-text-muted);
}
