/*
 * Autoriah Apothecary: the plain look. Layout and nothing a theme would not want; every colour, edge and face reads a
 * custom property, so a theme sets these (on :root or on .apothecary-index and friends) and writes its own over the
 * top. `apothecary_default_styles` answered false keeps this file off altogether.
 *
 *   --apothecary-ink         words                         (the page's own colour)
 *   --apothecary-soft        quieter words                 (the ink, lighter)
 *   --apothecary-paper       a card's and a chip's ground  (none)
 *   --apothecary-line        hairlines                     (the ink at 18%)
 *   --apothecary-accent      a pressed chip, the focus ring (the ink)
 *   --apothecary-on-accent   words on the accent           (white)
 *   --apothecary-radius      corners                       (4px)
 *   --apothecary-gap         the grid's gap                (1rem)
 *   --apothecary-min         a card's narrowest in the grid (9.5rem: two across on a phone)
 *   --apothecary-plate-ratio the plate's shape             (3 / 4)
 *   --apothecary-display     the face of names and headings (the page's own)
 */

.apothecary-index, .apothecary-cards, .apothecary-single, .apothecary-line {
	--ap-ink: var(--apothecary-ink, currentColor);
	--ap-soft: var(--apothecary-soft, color-mix(in srgb, currentColor 72%, transparent));
	--ap-paper: var(--apothecary-paper, transparent);
	--ap-line: var(--apothecary-line, color-mix(in srgb, currentColor 18%, transparent));
	--ap-accent: var(--apothecary-accent, currentColor);
	--ap-on-accent: var(--apothecary-on-accent, #fff);
	--ap-radius: var(--apothecary-radius, 4px);
	--ap-gap: var(--apothecary-gap, 1rem);
	--ap-display: var(--apothecary-display, inherit);
}

/* A hidden item is hidden, whatever a theme says about list items. */
.apothecary-index [hidden] { display: none !important; }

/* ---- the filters ---- */
.apothecary-filters { display: grid; gap: .9rem; margin: 0 0 1.25rem; }
.apothecary-search { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin: 0; }
.apothecary-search__label { font-weight: 700; }
.apothecary-search__box { flex: 1 1 12rem; min-width: 0; max-width: 26rem; min-height: 44px; padding: .5rem .8rem; border: 1px solid var(--ap-line); border-radius: var(--ap-radius); background: var(--ap-paper); color: inherit; font: inherit; }
.apothecary-search__go { min-height: 44px; padding: .5rem 1rem; border: 1px solid var(--ap-line); border-radius: var(--ap-radius); background: var(--ap-paper); color: inherit; font: inherit; cursor: pointer; }
/* With the script on, the list answers as a word is typed: the button has nothing left to do. */
.apothecary-index.is-enhanced .apothecary-search__go { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.apothecary-chips { margin: 0; padding: 0; border: 0; min-width: 0; }
.apothecary-chips__legend { padding: 0; margin: 0 0 .35rem; font-size: .8125rem; font-weight: 700; }
.apothecary-chips__row { display: flex; flex-wrap: wrap; gap: .4rem; }
.apothecary-chip { min-height: 44px; padding: .45rem .95rem; border: 1px solid var(--ap-line); border-radius: 999px; background: var(--ap-paper); color: var(--ap-ink); font: inherit; font-size: .9375rem; line-height: 1.2; cursor: pointer; }
.apothecary-chip[aria-pressed="true"] { background: var(--ap-accent); border-color: var(--ap-accent); color: var(--ap-on-accent); }
.apothecary-chip:focus-visible, .apothecary-search__box:focus-visible, .apothecary-search__go:focus-visible, .apothecary-card:focus-visible { outline: 2px solid var(--ap-accent); outline-offset: 2px; }
.apothecary-count { margin: 0 0 1rem; font-size: .875rem; color: var(--ap-soft); }
.apothecary-none { margin: 1.5rem 0; }

/* ---- the grid and its cards ---- */
.apothecary-grid, .apothecary-cards, .apothecary-pairs { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--ap-gap); grid-template-columns: repeat(auto-fill, minmax(var(--apothecary-min, 9.5rem), 1fr)); }
.apothecary-grid > li, .apothecary-cards > li, .apothecary-pairs > li { margin: 0; min-width: 0; }
.apothecary-card { display: flex; flex-direction: column; height: 100%; box-sizing: border-box; border: 1px solid var(--ap-line); border-radius: var(--ap-radius); background: var(--ap-paper); color: var(--ap-ink); text-decoration: none; overflow: hidden; }
.apothecary-plate { display: block; aspect-ratio: var(--apothecary-plate-ratio, 3 / 4); overflow: hidden; background: color-mix(in srgb, currentColor 5%, transparent); }
.apothecary-plate__img { display: block; width: 100%; height: 100%; object-fit: cover; }
.apothecary-plate--drawn { display: grid; place-items: center; }
/* An index where nothing has a picture yet: the drawn labels are kept short. */
.apothecary-index--drawn .apothecary-plate { aspect-ratio: 5 / 3; }
.apothecary-plate__letter { font-family: var(--ap-display); font-size: 3rem; line-height: 1; opacity: .55; }
.apothecary-card__label { display: flex; flex-direction: column; gap: .2rem; padding: .75rem .85rem .9rem; flex: 1; }
.apothecary-card__name { font-family: var(--ap-display); font-size: 1.125rem; font-weight: 700; line-height: 1.2; overflow-wrap: anywhere; }
.apothecary-card__latin { font-style: italic; font-size: .875rem; color: var(--ap-soft); overflow-wrap: anywhere; }
.apothecary-card__line { font-size: .875rem; line-height: 1.45; color: var(--ap-soft); }
.apothecary-card__count { margin-top: auto; padding-top: .5rem; font-size: .75rem; color: var(--ap-soft); }

/* A pair: small, the plate beside the name. */
.apothecary-pairs { grid-template-columns: repeat(auto-fill, minmax(13rem, 1fr)); }
.apothecary-card--pair { flex-direction: row; align-items: center; }
.apothecary-card--pair .apothecary-plate { flex: 0 0 4rem; width: 4rem; }
.apothecary-card--pair .apothecary-plate__letter { font-size: 1.6rem; }

/* ---- an item's own page ---- */
.apothecary-single { display: grid; gap: 2rem; margin: 0 0 2rem; }
.apothecary-single__top { display: grid; gap: 1.5rem; }
.apothecary-single__plate { margin: 0; max-width: 26rem; }
.apothecary-single__plate .apothecary-plate { border: 1px solid var(--ap-line); border-radius: var(--ap-radius); }
.apothecary-single__plate .apothecary-plate__img { object-fit: contain; }
.apothecary-credit { margin-top: .4rem; font-size: .75rem; line-height: 1.4; color: var(--ap-soft); }
.apothecary-single__back { margin: 0 0 .4rem; font-size: .8125rem; }
.apothecary-single__name { margin: 0; font-family: var(--ap-display); }
.apothecary-single__latin { margin: .2rem 0 0; font-style: italic; }
.apothecary-single__line { margin: .8rem 0 0; }
.apothecary-facts { margin: 1.25rem 0 0; border-top: 1px solid var(--ap-line); }
.apothecary-facts__row { display: grid; grid-template-columns: minmax(7rem, 34%) 1fr; gap: .75rem; padding: .55rem 0; border-bottom: 1px solid var(--ap-line); }
.apothecary-facts dt { margin: 0; font-size: .8125rem; font-weight: 700; }
.apothecary-facts dd { margin: 0; }
.apothecary-single__words { display: grid; gap: 1.5rem; max-width: 42rem; }
.apothecary-single__story > :first-child { margin-top: 0; }
.apothecary-single__story > :last-child { margin-bottom: 0; }
.apothecary-single__note h2, .apothecary-single__pairs h2, .apothecary-single__products h2 { margin: 0 0 .5rem; font-family: var(--ap-display); font-size: 1.25rem; }
.apothecary-single__note p, .apothecary-single__count { margin: 0; }
@media (min-width: 48rem) {
	.apothecary-single__top { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 2.5rem; align-items: start; }
}

/* ---- the line of names ---- */
.apothecary-line { overflow: hidden; padding-block: 1rem; border-block: 1px solid var(--ap-line); }
.apothecary-line__track { display: flex; width: max-content; animation: apothecary-line 70s linear infinite; }
.apothecary-line:hover .apothecary-line__track, .apothecary-line:focus-within .apothecary-line__track { animation-play-state: paused; }
.apothecary-line__list { display: flex; list-style: none; margin: 0; padding: 0; }
.apothecary-line__list li { margin: 0; white-space: nowrap; font-family: var(--ap-display); }
.apothecary-line__list li::after { content: "\00B7"; margin-inline: 1.2rem; color: var(--ap-soft); }
.apothecary-line__list a { color: inherit; text-decoration: none; }
.apothecary-line__list a:hover { text-decoration: underline; }
@keyframes apothecary-line { to { transform: translateX(-50%); } }
@media (prefers-reduced-motion: reduce) {
	.apothecary-line__track { animation: none; width: auto; flex-wrap: wrap; justify-content: center; }
	.apothecary-line__list { flex-wrap: wrap; justify-content: center; }
	.apothecary-line__list[aria-hidden] { display: none; }
}
