/*
 * #opencomm Journal List
 *
 * Black and white only. The three accents are the International Communication Association
 * (ICA) brand colors, sampled from the ICA logo on https://www.icahdq.org/
 * (https://cdn.ymaws.com/icahdq.site-ym.com/graphics/logo.png), October 2026.
 * They are used only for small status marks, always next to a word.
 */
:root {
  --black: #000;
  --white: #fff;
  --ica-yellow: #ffd573;
  --ica-red: #ee3350;
  --ica-green: #6ea094;
  --max-width: 1320px;
  --gutter: 1.5rem;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  background: var(--white);
  color: var(--black);
}

body {
  margin: 0;
  background: var(--white);
  color: var(--black);
  font-family: Arial, sans-serif;
  font-size: 1rem;
  line-height: 1.5;
}

a {
  color: var(--black);
  text-decoration: underline;
  text-underline-offset: 0.15em;
}

a:hover {
  text-decoration-thickness: 2px;
}

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

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.sr-only {
  position: absolute;
  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;
  top: 1rem;
  left: -9999px;
  z-index: 10;
  padding: 0.5rem 1rem;
  background: var(--white);
  border: 1px solid var(--black);
}

.skip-link:focus {
  left: 1rem;
}

/* Intro ------------------------------------------------------------------ */

.intro h1 {
  margin: 3.5rem 0 1rem;
  /* Sized so the full title fits on one line on desktop and tablet screens. */
  font-size: clamp(1.75rem, calc(3vw - 0.25rem), 2.375rem);
  line-height: 1.1;
}

.lead {
  margin: 0 0 2.5rem;
  font-size: 1.25rem;
  line-height: 1.45;
}

.intro-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 1rem 4rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--black);
}

.intro h2 {
  margin: 1.5rem 0 0.25rem;
  font-size: 1rem;
}

.intro-grid > div > h2:first-child {
  margin-top: 0;
}

.intro p {
  margin: 0 0 0.75rem;
}

.plain-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

/* Journals section -------------------------------------------------------- */

.journals {
  margin-top: 4rem;
  padding-top: 1.5rem;
  border-top: 2px solid var(--black);
}

.journals > h2 {
  margin: 0 0 0.5rem;
  font-size: 1.75rem;
}

.legend {
  margin: 0 0 1.5rem;
}

.legend p {
  margin: 0;
}

.mark {
  white-space: nowrap;
}

.mark.yes {
  font-weight: bold;
}

.dot {
  display: inline-block;
  width: 0.7em;
  height: 0.7em;
  margin-right: 0.3em;
  border: 1px solid var(--black);
  border-radius: 50%;
  vertical-align: -0.05em;
  background: var(--ica-green);
}

.mark.no .dot {
  background: var(--ica-red);
}

/* Controls ---------------------------------------------------------------- */

.controls {
  margin-bottom: 1.5rem;
  padding: 1.25rem 0;
  border-top: 1px solid var(--black);
  border-bottom: 1px solid var(--black);
}

.control-search label,
.filters legend {
  display: block;
  margin-bottom: 0.35rem;
  font-weight: bold;
}

.control-search {
  flex: 1 1 22rem;
}

.control-search input {
  width: 100%;
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--black);
  border-radius: 0;
  background: var(--white);
  color: var(--black);
  font: inherit;
}

.control-search input::placeholder {
  color: var(--black);
  opacity: 0.7;
}

.filters {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr));
  gap: 0.5rem 2rem;
  margin: 1.25rem 0 0;
  padding: 0;
  border: 0;
}

.filters legend {
  float: left;
  width: 100%;
  margin-bottom: 0.25rem;
}

.filter-group-label {
  margin: 0 0 0.15rem;
  font-size: 0.8125rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.check {
  display: flex;
  gap: 0.4rem;
  align-items: center;
  padding: 0.1rem 0;
  cursor: pointer;
}

input[type="checkbox"] {
  width: 1rem;
  height: 1rem;
  margin: 0;
  accent-color: var(--black);
}

.control-row {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 1.5rem;
  align-items: flex-end;
}

/* Search box, selects and button share one height so they line up. */
.control-row input,
.control-row select,
.control-row .button {
  height: 2.75rem;
}

.select {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-weight: bold;
}

select {
  min-width: 14rem;
  padding: 0.5rem 0.6rem;
  border: 1px solid var(--black);
  border-radius: 0;
  background: var(--white);
  color: var(--black);
  font: inherit;
  font-weight: normal;
}

.sort-select {
  display: none;
}

.button {
  padding: 0.5rem 0.9rem;
  border: 1px solid var(--black);
  border-radius: 0;
  background: var(--white);
  color: var(--black);
  font: inherit;
  cursor: pointer;
}

.button:hover {
  background: var(--black);
  color: var(--white);
}

.button-small {
  padding: 0.1rem 0.5rem;
  font-size: 0.875rem;
}

.status-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 2rem;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 0.75rem;
}

.status-bar p {
  margin: 0;
}

.result-count {
  font-weight: bold;
}

.data-status {
  font-size: 0.875rem;
}

.status-mark {
  font-weight: bold;
}

.status-error .dot {
  background: var(--ica-red);
}

.status-note .dot {
  background: var(--ica-yellow);
}

.empty {
  padding: 2rem 0;
  border-top: 1px solid var(--black);
  border-bottom: 1px solid var(--black);
}

.empty p {
  margin: 0 0 1rem;
  font-size: 1.125rem;
}

/* Table ------------------------------------------------------------------- */

.journal-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.875rem;
}

.journal-table thead {
  position: sticky;
  top: 0;
  z-index: 2;
}

.journal-table thead th {
  padding: 0.4rem 0.5rem;
  background: var(--white);
  font-weight: bold;
  text-align: left;
  vertical-align: bottom;
  border-bottom: 1px solid var(--black);
}

.journal-table .group-row th[scope="colgroup"] {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.journal-table .group-start {
  border-left: 1px solid var(--black);
}

.journal-table .col-row th {
  line-height: 1.25;
}

.sort {
  display: inline;
  padding: 0;
  border: 0;
  background: none;
  color: var(--black);
  font: inherit;
  text-align: inherit;
  cursor: pointer;
}

.sort:hover {
  text-decoration: underline;
}

.sort-icon {
  display: none;
  font-size: 0.75em;
  white-space: nowrap;
}

.js .sort-icon {
  display: inline;
}

.journal-table th[aria-sort] .sort {
  text-decoration: underline;
  text-decoration-thickness: 2px;
}

.journal-table tbody th,
.journal-table tbody td {
  padding: 0.6rem 0.5rem;
  vertical-align: top;
  border-bottom: 1px solid var(--black);
}

.journal-table td.col-number,
.journal-table th.col-number {
  text-align: right;
}

.col-name {
  min-width: 15rem;
  text-align: left;
}

tbody .col-name {
  font-weight: normal;
}

.journal-name {
  display: block;
  font-size: 1rem;
  font-weight: bold;
  line-height: 1.3;
}

.publisher {
  display: block;
  margin-top: 0.15rem;
}

.row-actions {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  margin-top: 0.4rem;
}

.toggle {
  display: none;
  padding: 0.05rem 0.45rem;
  border: 1px solid var(--black);
  border-radius: 0;
  background: var(--white);
  color: var(--black);
  font: inherit;
  font-size: 0.8125rem;
  cursor: pointer;
}

.js .toggle {
  display: inline-block;
}

.toggle[aria-expanded="true"],
.toggle:hover {
  background: var(--black);
  color: var(--white);
}

.website {
  font-size: 0.8125rem;
}

.entry-link {
  margin: 0.75rem 0 0;
  font-size: 0.8125rem;
}

.journal:target .journal-name {
  text-decoration: underline;
  text-decoration-thickness: 3px;
}

/* Details rows are visible without JavaScript and collapsed with it. */
.js .details:not(.open) {
  display: none;
}

html:not(.js) .journal-table tr.journal > *,
.journal-table tr.journal:has(+ .details.open) > * {
  border-bottom: 0;
}

.details > td {
  padding: 0.25rem 0.5rem 1rem;
}

.details dl {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr));
  gap: 0.75rem 2rem;
  max-width: 72rem;
  margin: 0;
}

.detail dt {
  font-weight: bold;
}

.detail dd {
  margin: 0;
}

/* Footer ------------------------------------------------------------------ */

.site-footer {
  margin-top: 4rem;
  padding: 1.5rem 0 3rem;
  border-top: 1px solid var(--black);
  font-size: 0.875rem;
}

.site-footer p {
  margin: 0;
}

/* Medium screens: tighter table ------------------------------------------- */

@media (max-width: 1180px) {
  :root {
    --gutter: 1rem;
  }

  .journal-table {
    font-size: 0.8125rem;
  }

  .journal-table thead th,
  .journal-table tbody th,
  .journal-table tbody td {
    padding-left: 0.35rem;
    padding-right: 0.35rem;
  }

  .col-name {
    min-width: 12rem;
  }
}

/* Narrow screens: one card per journal ------------------------------------ */

@media (max-width: 960px) {
  .intro h1 {
    margin-top: 2rem;
  }

  .lead {
    font-size: 1.125rem;
  }

  .intro-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .intro-col + .intro-col {
    padding-top: 1rem;
    border-top: 1px solid var(--black);
  }

  .sort-select {
    display: flex;
  }

  .journal-table,
  .journal-table tbody,
  .journal-table tr,
  .journal-table tbody th,
  .journal-table tbody td {
    display: block;
  }

  .journal-table thead {
    display: none;
  }

  .journal-table {
    font-size: 0.875rem;
  }

  .journal-table tr.journal {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.35rem 1.5rem;
    margin-top: 1rem;
    padding: 1rem;
    border: 1px solid var(--black);
  }

  .journal-table tr.journal > th {
    grid-column: 1 / -1;
    padding: 0 0 0.5rem;
    border: 0;
  }

  .journal-table tr.journal > td {
    display: flex;
    gap: 0.75rem;
    justify-content: space-between;
    padding: 0.2rem 0 0;
    border: 0;
    border-top: 1px solid var(--black);
    text-align: right;
  }

  .journal-table tr.journal > td::before {
    content: attr(data-label);
    text-align: left;
  }

  .journal-table tr.details {
    padding: 1rem;
    border: 1px solid var(--black);
    border-top: 0;
  }

  .journal-table tr.details > td {
    padding: 0;
    border: 0;
  }

  .details dl {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 520px) {
  .journal-table tr.journal {
    grid-template-columns: minmax(0, 1fr);
  }
}
