/* Production → Articles (docs/05-views.md, docs/mockup/oneshot_mockup.html "Artikel") */

/* Tabs (docs/design.md §4.9) */
.tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 20px;
  border-bottom: var(--border);
  overflow-x: auto;
}

.tabs [role="tab"] {
  padding: 10px 14px;
  border-bottom: 2px solid transparent;
  color: var(--fg);
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
}

.tabs [role="tab"][aria-selected="true"] {
  border-bottom-color: var(--blue);
  color: var(--blue);
}

.tabs [role="tab"]:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: -2px;
}

.articles__filter {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 16px;
}

/* Search (docs/design.md §4.8) */
.articles__search {
  display: flex;
  flex: 1 1 220px;
  align-items: center;
  gap: 6px;
  min-width: 0;
  max-width: 320px;
  height: 38px;
  padding: 0 10px;
  border: var(--border);
  border-radius: var(--radius);
}

.articles__search .ms {
  color: var(--muted);
  font-size: 20px;
}

.articles__search input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: none;
  color: var(--fg);
  font: inherit;
  font-size: 14px;
}

.articles__search:has(input:focus-visible) {
  outline: 2px solid var(--blue);
  outline-offset: -1px;
}

.articles__name {
  font-weight: 600;
}

.articles__code {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.articles__empty {
  color: var(--muted);
}

.articles__assortment {
  flex: 0 1 220px;
  min-width: 0;
  height: 38px;
  padding: 0 10px;
  border: var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--fg);
  font: inherit;
  font-size: 14px;
}

.articles__assortment:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: -1px;
}

/* Grid/list toggle (docs/design.md §4.10), at the end of the filter row. */
.articles__view {
  margin: 0 0 0 auto;
}

.articles__view button {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  cursor: pointer;
}

.articles__view .ms {
  font-size: 18px;
}

/* Grid view: cards as in the mockup (.pim, .card). */
.articles__grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin: 0 0 16px;
  padding: 0;
  list-style: none;
}

@container app (max-width: 1199px) {
  .articles__grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@container app (max-width: 899px) {
  .articles__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* All cards have the same height: a fixed image area, the title clamped to two lines (and always
   two lines high), key and EAN one line each at the bottom of the card. */
.articles__card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
  border: var(--border);
  border-radius: var(--radius);
  background: var(--bg);
}

/* The chosen first image, on white like the variants; a neutral frame without one. */
.articles__image {
  flex: none;
  aspect-ratio: 1;
  border-bottom: var(--border);
  background: var(--surface);
}

.articles__image img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: var(--white);
}

.articles__text {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-width: 0;
  padding: 12px 14px;
}

.articles__text p {
  margin: 0;
}

.articles__card .articles__name {
  display: -webkit-box;
  min-height: calc(2em * 1.35);
  margin-bottom: 6px;
  overflow: hidden;
  font-size: 14px;
  line-height: 1.35;
  overflow-wrap: anywhere;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
}

.articles__text .articles__meta {
  overflow: hidden;
  color: var(--muted);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.articles__text .articles__name + .articles__meta {
  margin-top: auto;
}

/* Tab "Assortments": a long rule wraps, so the three columns fit a phone (table.t.narrow); the article
   count is right-aligned like the mockup's number column. */
.articles__selection {
  overflow-wrap: anywhere;
}

.t .articles__count {
  font-variant-numeric: tabular-nums;
  text-align: right;
  white-space: nowrap;
}

/* Article detail: field and file names stay whole; source values and change summaries wrap, so the
   tables fit a phone (table.t.narrow). */
.article__field {
  white-space: nowrap;
}

.article__value {
  overflow-wrap: anywhere;
}

/* The line "claims substantiable" below the detail header's key line. */
.article__claims {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
}

/* Images of the article detail: image trio cards (docs/design.md §4.16) */
.image-cards__note {
  display: flex;
  gap: 8px;
  margin: 0 0 16px;
  color: var(--muted);
  font-size: 13px;
}

.image-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr));
  gap: 16px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.image-card {
  min-width: 0;
  overflow: hidden;
  border: var(--border);
  border-radius: 4px;
}

.image-card--excluded .image-card__trio {
  opacity: 0.45;
}

.image-card__trio {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  background: var(--line);
}

.image-card__trio form {
  display: contents;
}

.image-card__cell {
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: center;
  width: 100%;
  padding: 8px;
  border: 0;
  background: var(--bg);
  color: var(--muted);
  font: inherit;
  font-size: 12px;
}

.image-card__cell img,
.image-card__state {
  width: 100%;
  aspect-ratio: 1;
  border: var(--border);
  border-radius: 3px;
  background: #fff;
  object-fit: contain;
}

.image-card__state {
  display: grid;
  place-items: center;
  border-style: dashed;
  background: var(--bg);
}

.image-card__variant {
  cursor: pointer;
}

.image-card__variant[aria-pressed="true"],
.image-card__cell--chosen {
  background: var(--surface);
  box-shadow: inset 0 0 0 2px var(--blue);
  color: var(--fg);
  font-weight: 600;
}

.image-card__variant:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: -4px;
}

.image-card__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  padding: 10px 12px 0;
  font-size: 13px;
}

.image-card__who {
  margin: 4px 12px 0;
  color: var(--muted);
  font-size: 12px;
}

/* Why a failed image failed (#1240): the card has no actions below it. */
.image-card .image-card__failure {
  margin-bottom: 12px;
}

.image-card__acts {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 10px 12px 12px;
}

/* "View images large" (#818): the images one at a time in a modal, previous and next beside it. */
.image-viewer__stage {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
}

.image-viewer__nav {
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border-radius: 50%;
}

.image-viewer__slide {
  margin: 0;
}

.image-viewer__img {
  display: block;
  width: 100%;
  max-width: min(70vh, 640px);
  margin: 0 auto;
  padding: 0;
  overflow: hidden;
  aspect-ratio: 1;
  border: var(--border);
  border-radius: var(--radius);
  background: #fff;
  cursor: pointer;
}

.image-viewer__img img,
.image-viewer__img .image-card__state {
  display: grid;
  width: 100%;
  height: 100%;
  border: 0;
  object-fit: contain;
}

.image-viewer__img:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}

.image-viewer__slide--excluded .image-viewer__img {
  opacity: 0.45;
}

.image-viewer__slide figcaption {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
  align-items: center;
  justify-content: center;
  margin-top: 12px;
  font-size: 13px;
  text-align: center;
}

.image-viewer__pos,
.image-viewer__slide .small {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

@media (max-width: 599px) {
  .image-viewer__stage {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }

  .image-viewer__slides {
    grid-column: 1 / -1;
    grid-row: 1;
  }

  .image-viewer__nav {
    justify-self: center;
  }
}

/* Article detail → Webshop preview (mockup "artikel-detail"): the audience and language dropdowns in
   a row, then the shop page with the webshop texts in the shop's type. */
.shop-preview__choice {
  max-width: 640px;
}

/* With images: the main image and its thumbnails beside the texts, stacked on narrow screens. */
.shoppage:has(.shoppage__gallery) {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr);
  gap: 24px;
  align-items: start;
}

@container app (max-width: 699px) {
  .shoppage:has(.shoppage__gallery) {
    grid-template-columns: minmax(0, 1fr);
  }
}

.shoppage__main img,
.shoppage__thumbs img {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  object-fit: contain;
  background: var(--white);
  border: var(--border);
  border-radius: 4px;
}

.shoppage__thumbs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin: 8px 0 0;
  padding: 0;
  list-style: none;
}

.shoppage__texts {
  max-width: 72ch;
}

.shoppage__texts h3 {
  margin: 0 0 10px;
  font-family: var(--f-display);
  font-size: 1.25rem;
  font-weight: 600;
}

.shoppage__texts h4 {
  margin: 14px 0 4px;
  font-family: var(--f-display);
  font-size: 1rem;
  font-weight: 600;
}

.shoppage__texts p {
  margin: 0 0 8px;
  font-size: 15px;
}

.shoppage__texts ul {
  margin: 8px 0 12px;
  padding-left: 18px;
  font-size: 14px;
}

.shoppage__texts li {
  margin-bottom: 4px;
}

.shoppage__empty {
  margin: 0;
  color: var(--muted);
}

/* Article detail → Texts (docs/05-views.md, "Article (detail)"; mockup "artikel-detail") */
/* The three dropdowns in one row as wide as the text below it (components.css, choice-row). */
.article-texts__choice {
  max-width: 72ch;
}

.choice-row.article-texts__choice .field {
  flex-basis: 150px;
}

.article-texts__text {
  max-width: 72ch;
  padding: 16px 18px;
  border: var(--border);
  border-radius: var(--radius);
  font-size: 15px;
  line-height: 1.6;
  overflow-wrap: anywhere;
}

.article-texts__text h3,
.article-texts__text h4 {
  margin: 0 0 8px;
  font-family: var(--f-display);
  font-weight: 600;
}

.article-texts__text p {
  margin: 0 0 8px;
}

.article-texts__text ul {
  margin: 0;
  padding-left: 18px;
}

.article-texts__thin {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.article-texts__state {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  align-items: center;
  max-width: 72ch;
  margin-top: 12px;
}

.article-texts__mark {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--blue);
  font-size: 13px;
  font-weight: 600;
}

.article-texts__mark .ms {
  font-size: 20px;
}

.article-texts__mark.empco {
  color: var(--green);
}

.article-texts__meta {
  margin-left: auto;
  color: var(--muted);
  font-size: 13px;
}

.article-texts__empco {
  max-width: 72ch;
  margin-top: 16px;
}

.article-texts__empco h3 {
  display: flex;
  gap: 8px;
  align-items: center;
  margin: 0 0 8px;
  font-size: 14px;
  font-weight: 600;
}

.article-texts__empco ul {
  margin: 0;
  padding-left: 18px;
  font-size: 14px;
  line-height: 1.6;
}

.article-texts__rule {
  color: var(--muted);
  font-size: 13px;
}
