/*
 * TheHistoryOfArt.org shared editorial page modules
 * Version 1.0.0 — 2026-08-30
 * Artist-independent. Content and dates belong in page HTML, not this file.
 */

:root {
  --thoa-module-ink: #353535;
  --thoa-module-muted: #6f6b64;
  --thoa-module-blue: #287486;
  --thoa-module-blue-dark: #185463;
  --thoa-module-blue-soft: #eaf4f5;
  --thoa-module-paper: #f5f1e8;
  --thoa-module-line: #ded7c9;
  --thoa-module-row: #fafbfb;
  --thoa-module-shadow: 0 6px 18px rgba(42, 49, 50, .08);
}

.thoa-module,
.thoa-module * {
  box-sizing: border-box;
}

.thoa-module {
  margin-bottom: 30px;
  color: var(--thoa-module-ink);
}

.thoa-module button,
.thoa-module input,
.thoa-module select {
  font: inherit;
}

.thoa-module [hidden] {
  display: none !important;
}

/* Tabbed timeline / Artist Journey Map v2 */
.thoa-tabset {
  border: 1px solid var(--thoa-module-line);
  border-radius: 4px;
  background: #fff;
}

.thoa-tablist {
  display: grid;
  grid-template-columns: repeat(var(--thoa-tab-count, 3), minmax(0, 1fr));
  gap: 8px;
  padding: 14px 14px 0;
}

.thoa-tab {
  display: flex;
  min-height: 58px;
  padding: 11px 14px;
  align-items: flex-start;
  justify-content: center;
  flex-direction: column;
  border: 1px solid var(--thoa-module-line);
  border-top: 4px solid #a9b0ae;
  border-radius: 4px;
  background: #fafafa;
  color: var(--thoa-module-ink);
  cursor: pointer;
  text-align: left;
}

.thoa-tab strong {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 17px;
  line-height: 1.25;
}

.thoa-tab small {
  display: block;
  margin-top: 3px;
  color: var(--thoa-module-muted);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.3;
}

.thoa-tab:hover,
.thoa-tab:focus-visible,
.thoa-tab.is-active {
  border-color: var(--thoa-module-blue);
  border-top-color: var(--thoa-module-blue);
  background: var(--thoa-module-blue-soft);
  color: var(--thoa-module-blue-dark);
  outline: 0;
}

.thoa-tab:focus-visible {
  box-shadow: 0 0 0 3px rgba(40, 116, 134, .2);
}

.thoa-tabpanel {
  padding: 22px 20px 20px;
}

.thoa-tabset--single .thoa-tablist {
  display: none;
}

.thoa-timeline {
  overflow: hidden;
}

.thoa-timeline-axis,
.thoa-timeline-row {
  display: grid;
  grid-template-columns: minmax(130px, 190px) minmax(0, 1fr);
  gap: 14px;
}

.thoa-timeline-axis {
  align-items: end;
  margin-bottom: 8px;
  color: var(--thoa-module-muted);
  font-size: 11px;
  font-weight: 800;
}

.thoa-timeline-axis-values {
  display: flex;
  justify-content: space-between;
}

.thoa-timeline-row {
  align-items: center;
  min-height: 58px;
  border-top: 1px solid #ece6dc;
}

.thoa-timeline-label {
  min-width: 0;
  padding: 8px 0;
}

.thoa-timeline-label h3 {
  margin: 0 0 2px;
  font-size: 15px;
  line-height: 1.25;
}

.thoa-timeline-label h3 a,
.thoa-timeline-drilldown {
  color: var(--thoa-module-ink) !important;
}

.thoa-timeline-drilldown {
  appearance: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  font: inherit;
  font-weight: inherit;
  line-height: inherit;
  text-align: left;
  text-decoration: underline;
  cursor: pointer;
}

.thoa-timeline-drilldown:focus-visible {
  border-radius: 2px;
  outline: 3px solid rgba(40, 116, 134, .24);
  outline-offset: 2px;
}

.thoa-timeline-label p,
.thoa-timeline-label span {
  display: block;
  margin: 0;
  color: var(--thoa-module-muted);
  font-size: 11px;
  line-height: 1.35;
}

.thoa-timeline-track {
  position: relative;
  min-height: 22px;
  border-radius: 999px;
  background: repeating-linear-gradient(90deg, #f0ece4 0, #f0ece4 calc(25% - 1px), #ded7ca calc(25% - 1px), #ded7ca 25%);
}

.thoa-timeline-band {
  position: absolute;
  top: 2px;
  left: var(--thoa-start, 0%);
  width: max(var(--thoa-span, 10%), 18px);
  height: 18px;
  border-radius: 999px;
  background: var(--thoa-module-blue);
  box-shadow: 0 0 0 2px rgba(40, 116, 134, .12);
}

.thoa-timeline-band--context {
  background: #af9d73;
  box-shadow: none;
}

.thoa-timeline-band--focus {
  background: var(--thoa-module-blue);
}

/* Four career stages */
.thoa-stage-explorer {
  padding: 24px;
  border: 1px solid var(--thoa-module-line);
  border-radius: 4px;
  background: #fff;
}

.thoa-stage-tabs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 7px;
  margin-bottom: 22px;
}

.thoa-stage-tab {
  min-height: 72px;
  padding: 10px;
  border: 1px solid var(--thoa-module-line);
  border-top: 4px solid #a9b0ae;
  border-radius: 3px;
  background: #fafafa;
  color: var(--thoa-module-ink);
  cursor: pointer;
  text-align: left;
}

.thoa-stage-tab span,
.thoa-stage-tab strong {
  display: block;
}

.thoa-stage-tab span {
  margin-bottom: 4px;
  color: var(--thoa-module-muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .7px;
  text-transform: uppercase;
}

.thoa-stage-tab strong {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 15px;
  line-height: 1.25;
}

.thoa-stage-tab:hover,
.thoa-stage-tab:focus-visible,
.thoa-stage-tab.is-active {
  border-color: var(--thoa-module-blue);
  border-top-color: var(--thoa-module-blue);
  background: var(--thoa-module-blue-soft);
  color: var(--thoa-module-blue-dark);
  outline: 0;
}

.thoa-stage-tab:focus-visible {
  box-shadow: 0 0 0 3px rgba(40, 116, 134, .2);
}

.thoa-stage-panel {
  display: grid;
  grid-template-columns: minmax(110px, 140px) minmax(0, 1fr);
  gap: 24px;
  min-height: 160px;
  padding: 22px;
  background: var(--thoa-module-paper);
}

.thoa-stage-date {
  color: var(--thoa-module-blue-dark);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 29px;
  line-height: 1.08;
}

.thoa-stage-copy h3 {
  margin-bottom: 8px;
  font-size: 23px;
}

.thoa-stage-copy p:last-child {
  margin-bottom: 0;
}

.thoa-stage-gallery {
  display: grid;
  grid-column: 1 / -1;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 2px;
}

.thoa-stage-thumbnail {
  position: relative;
  display: block;
  overflow: hidden;
  aspect-ratio: 1;
  border: 2px solid rgba(255, 255, 255, .82);
  border-radius: 3px;
  background: #ddd;
  box-shadow: 0 3px 10px rgba(56, 48, 36, .12);
}

.thoa-stage-thumbnail .grid-inner {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

.thoa-stage-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .2s ease;
}

.thoa-stage-thumbnail:hover img,
.thoa-stage-thumbnail:focus-visible img {
  transform: scale(1.04);
}

.thoa-stage-thumbnail:focus-visible {
  outline: 3px solid var(--thoa-module-blue);
  outline-offset: 2px;
}

/* Essential works */
.thoa-essential-works {
  display: grid;
  gap: 12px;
}

.thoa-essential-work {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  gap: 18px;
  align-items: center;
  min-height: 128px;
  padding: 10px;
  border: 1px solid var(--thoa-module-line);
  border-radius: 4px;
  background: #fff;
}

.thoa-essential-work:hover,
.thoa-essential-work:focus-within {
  border-color: #99bdc5;
  background: #f7fbfc;
}

.thoa-essential-work-image,
.thoa-essential-work-image .grid-inner {
  position: relative;
  display: block;
  width: 180px;
  height: 108px;
  overflow: hidden;
}

.thoa-essential-work-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.thoa-essential-work-copy h3 {
  margin: 0 0 5px;
  font-size: 21px;
}

.thoa-essential-work-copy h3 a {
  color: var(--thoa-module-ink) !important;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.thoa-essential-work-copy p {
  margin: 0;
  color: var(--thoa-module-muted);
  font-size: 13px;
  line-height: 1.45;
}

/* All-known-artworks directory */
.thoa-directory {
  margin-bottom: 30px;
}

.thoa-directory-controls {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(170px, 220px) auto;
  gap: 8px;
  margin-bottom: 12px;
}

.thoa-directory-controls--search-only {
  grid-template-columns: minmax(220px, 1fr) auto;
}

.thoa-directory-controls label {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.thoa-directory-controls input,
.thoa-directory-controls select,
.thoa-directory-reset {
  min-height: 42px;
  margin: 0;
  padding: 8px 10px;
  border: 1px solid #c9c0af;
  border-radius: 4px;
  background: #fff;
  color: var(--thoa-module-ink);
}

.thoa-directory-reset {
  padding-right: 16px;
  padding-left: 16px;
  border-color: var(--thoa-module-blue);
  color: var(--thoa-module-blue-dark);
  cursor: pointer;
  font-weight: 700;
}

.thoa-directory-reset:hover,
.thoa-directory-reset:focus-visible {
  background: var(--thoa-module-blue);
  color: #fff;
  outline: 0;
}

.thoa-directory-meta {
  margin: 0 0 14px;
  color: var(--thoa-module-muted);
  font-size: 13px;
}

.thoa-directory-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--thoa-module-line);
  border-radius: 4px;
  background: #fff;
  -webkit-overflow-scrolling: touch;
}

.thoa-directory-table {
  width: 100%;
  min-width: 610px;
  margin: 0 !important;
  border-collapse: collapse;
  background: #fff;
}

.thoa-directory-table th,
.thoa-directory-table td {
  padding: 11px 12px;
  border-bottom: 1px solid #ece6dc;
  text-align: left;
  vertical-align: top;
}

.thoa-directory-table th {
  background: #f6f2ea;
  font-size: 12px;
  letter-spacing: .7px;
  text-transform: uppercase;
}

.thoa-directory-table tbody tr:nth-child(even) {
  background: var(--thoa-module-row);
}

.thoa-directory-table tbody tr:hover {
  background: #f3f8f9;
}

.thoa-directory-table tbody tr:last-child td {
  border-bottom: 0;
}

.thoa-directory-title,
.thoa-directory-title a {
  font-size: 14px;
  font-weight: 700;
  line-height: 21px;
}

.thoa-medium-pill {
  display: inline-block;
  padding: 3px 8px;
  border: 1px solid #bad8de;
  border-radius: 999px;
  background: var(--thoa-module-blue-soft);
  color: #007185;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.thoa-directory-empty {
  padding: 14px;
  border: 1px solid var(--thoa-module-line);
  border-top: 0;
  background: #fff;
  color: var(--thoa-module-muted);
}

.thoa-directory-pagination {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
  margin: 18px 0 0;
}

.thoa-directory-page {
  min-width: 42px;
  min-height: 36px;
  padding: 6px 10px;
  border: 1px solid #bad8de;
  border-radius: 3px;
  background: #fff;
  color: #007185;
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
}

.thoa-directory-page:hover,
.thoa-directory-page:focus-visible,
.thoa-directory-page.is-active {
  border-color: var(--thoa-module-blue);
  background: var(--thoa-module-blue);
  color: #fff;
  outline: 0;
}

.thoa-directory-page[disabled] {
  cursor: default;
  opacity: .45;
}

@media (max-width: 767px) {
  .thoa-tablist {
    grid-template-columns: 1fr;
  }

  .thoa-tab {
    min-height: 50px;
  }

  .thoa-timeline-axis,
  .thoa-timeline-row {
    grid-template-columns: 112px minmax(0, 1fr);
    gap: 9px;
  }

  .thoa-stage-explorer {
    padding: 18px 12px;
  }

  .thoa-stage-tabs {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .thoa-stage-panel {
    grid-template-columns: 1fr;
    gap: 10px;
    padding: 18px;
  }

  .thoa-stage-gallery {
    grid-column: 1;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .thoa-directory-controls,
  .thoa-directory-controls--search-only {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 575px) {
  .thoa-tabpanel {
    padding: 18px 12px 16px;
  }

  .thoa-timeline-axis,
  .thoa-timeline-row {
    grid-template-columns: 96px minmax(0, 1fr);
  }

  .thoa-timeline-axis {
    font-size: 9px;
  }

  .thoa-essential-work {
    grid-template-columns: 105px minmax(0, 1fr);
    gap: 12px;
  }

  .thoa-essential-work-image,
  .thoa-essential-work-image .grid-inner {
    width: 105px;
    height: 105px;
  }

  .thoa-essential-work-copy h3 {
    font-size: 18px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .thoa-module *,
  .thoa-module *::before,
  .thoa-module *::after {
    scroll-behavior: auto !important;
    transition-duration: .01ms !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
  }
}

@media print {
  .thoa-tablist,
  .thoa-stage-tabs,
  .thoa-directory-controls,
  .thoa-directory-pagination {
    display: none !important;
  }

  .thoa-module .thoa-tabpanel[hidden],
  .thoa-module .thoa-stage-panel[hidden] {
    display: block !important;
  }

  .thoa-module .thoa-directory-table tbody tr[hidden] {
    display: table-row !important;
  }
}
