/*
 * Reference (справочник) glue. The v10 look comes from index.bundle.css
 * (colors.css / glossary.css); these rules only cover what the server emits
 * differently: filter links instead of JS buttons, WP <img> inside swatches,
 * a term inside the sidebar layout, and stored properties of a material.
 */

/* Filters are links with aria-current instead of aria-pressed buttons. */
.colors-filters .chip { text-decoration: none; color: var(--ink); }
.colors-filters .chip[aria-current="true"] { border-color: var(--primary); background: var(--accent-soft); color: var(--primary); }
.glossary-filters a { min-width: 38px; padding: 7px 10px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--ink); text-align: center; text-decoration: none; }
.glossary-filters a:hover,
.glossary-filters a.is-active { border-color: var(--primary); background: var(--primary); color: var(--primary-ink); }
.glossary-toolbar { margin-bottom: 0; }

/* WP attachment markup inside the colors.js swatch. */
.colors-swatch img { display: block; max-width: none; }
.colors-swatch--large.colors-swatch--photo { aspect-ratio: 3 / 4; min-height: 0; max-height: 36rem; }
.color-detail--text { grid-template-columns: minmax(0, 1fr); max-width: 46rem; }
.color-detail > div > p + p { margin-top: var(--s3); }
.material-hex { display: inline-flex; align-items: center; gap: .5rem; }
.material-hex__dot { width: 1.25rem; height: 1.25rem; flex: none; border: 1px solid var(--line); border-radius: 50%; background: var(--tone); }

/* Stored sample photos. */
.material-gallery__grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--s4); }
.material-gallery__grid figure { margin: 0; }
.material-gallery__grid img { width: 100%; height: auto; aspect-ratio: 3 / 4; object-fit: cover; border-radius: var(--r-sm); }
.material-gallery__grid figcaption { margin-top: .375rem; color: var(--muted); font-size: .8125rem; }
.glossary-term__figure--samples img { height: auto; }
.glossary-term__figure > img { height: auto; }

/* Material card properties (code / system / manufacturer). */
.material-props { display: grid; grid-template-columns: repeat(auto-fill, minmax(12rem, 1fr)); gap: var(--s4); margin: 0; }
.material-props dt { color: var(--muted); font-size: .8125rem; }
.material-props dd { margin: 4px 0 0; font-weight: 600; }
.material-card .glossary-term__definition p + p { margin-top: var(--s3); }

/* Term with a sidebar TOC: the article column owns the width. */
.article-layout > .glossary-term { width: auto; margin-inline: 0; padding-top: 0; }
.glossary-term .material-meta { margin-top: var(--s3); }

@media (max-width: 800px) {
	.material-gallery__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.colors-swatch--large.colors-swatch--photo { max-height: 26rem; }
}
.colors-head--slot { padding-top: 0; }
/* The imported colors page has a plain H1 before the slot; keep both in one container. */
.page-content--colors > .entry-content.wrap { width: min(calc(100% - 48px), 1320px); max-width: none; margin-inline: auto; padding: clamp(1.5rem, 3vw, 2.5rem) 0 0; }
.page-content--colors > .entry-content.wrap > .crumbs { margin: 0 0 1.5rem; }
.page-content--colors > .entry-content.wrap > h1 { margin: 0 0 1rem; }
.page-content--colors [data-colors-hub].wrap { width: 100%; }

/* Glossary hub: search, letters, section hub cards, term cards. */
.gl-hub .glossary-head { padding-bottom: var(--s4); }
.gl-search { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s3); margin-top: var(--s5); }
.gl-search__field { position: relative; display: block; flex: 1 1 22rem; max-width: 40rem; }
.gl-search__field .icon { position: absolute; inset-block: 0; left: 1rem; margin-block: auto; color: var(--muted); pointer-events: none; }
.gl-search__field input[type="search"] { width: 100%; min-height: 3rem; padding: .625rem 1rem .625rem 2.75rem; border: 1px solid var(--outline); border-radius: 999px; background: var(--surface); color: var(--ink); font: inherit; }
.gl-search__field input[type="search"]:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.gl-search__submit { min-height: 3rem; }
.gl-count { color: var(--muted); font-size: .9375rem; }
.gl-letters { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: var(--s4); }
.gl-letters a { display: grid; place-items: center; min-width: 44px; min-height: 44px; padding: 0 .875rem; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--ink); text-decoration: none; font-weight: 600; }
.gl-letters a:hover { border-color: var(--outline); }
.gl-letters a.is-active { border-color: var(--primary); background: var(--primary); color: var(--primary-ink); }
.gl-hubs { display: grid; gap: var(--s3); margin-top: var(--s5); }
.gl-hubs[hidden], .gl-hubcard[hidden], .gl-card[hidden], .gl-list[hidden], .gl-empty[hidden] { display: none; }
.gl-hubcard { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .25rem var(--s4); align-items: center; padding: var(--s4) var(--s5); border: 1px solid var(--primary); border-radius: var(--r); background: var(--accent-soft); color: var(--ink); text-decoration: none; }
.gl-hubcard b { font: 400 1.375rem/1.2 var(--display); }
.gl-hubcard small { grid-column: 1; color: var(--muted); }
.gl-hubcard__tag { grid-column: 1; color: var(--accent-text); font: 600 .75rem/1 var(--sans); letter-spacing: .08em; text-transform: uppercase; }
.gl-hubcard__go { grid-column: 2; grid-row: 1 / span 3; font-size: 1.5rem; color: var(--primary); }
.gl-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s4); margin-top: var(--s5); }
.gl-card { display: flex; flex-direction: column; gap: .5rem; min-width: 0; padding: var(--s5); border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); color: var(--ink); text-decoration: none; transition: border-color .15s; }
.gl-card:hover { border-color: var(--outline); }
.gl-card:focus-visible, .gl-hubcard:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.gl-card b { font: 400 1.375rem/1.2 var(--display); overflow-wrap: anywhere; }
.gl-card small { color: var(--muted); font-size: .9375rem; line-height: 1.5; }
.gl-card__tag { align-self: flex-start; padding: .1875rem .625rem; border-radius: 999px; background: var(--surface-2); color: var(--accent-text); font: 600 .75rem/1.3 var(--sans); }
.gl-empty { margin-top: var(--s5); }
@media (max-width: 1000px) { .gl-list { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 620px) { .gl-list { grid-template-columns: 1fr; } .gl-search__field { flex-basis: 100%; } }

/* «Подборки в каталоге» на карточке справочника и материала: отдельная белая карточка, как блоки дизайн-системы. */
.glossary-term__catalog { margin-top: var(--s7); padding: var(--s5) var(--s6); border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); box-shadow: var(--shadow); }
.glossary-term__catalog h2 { margin-top: 0; }
.glossary-term__catalog-intro { margin: var(--s2) 0 var(--s4); color: var(--muted); }
.glossary-term__catalog a { background: var(--surface-2); border-color: transparent; }
.glossary-term__catalog a:hover { border-color: var(--outline); }
.glossary-term__catalog small { color: var(--muted); font-size: .8125rem; font-weight: 400; }
@media (max-width: 800px) {
	.glossary-term__catalog { padding: var(--s4); }
}

/* Подпись-атрибуция под фото с открытой лицензией. */
.figure-attribution a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }

.reference-catalog-section{margin-block:2.5rem}
.reference-catalog-section .glossary-term__catalog>div{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:.75rem}
.reference-catalog-section .glossary-term__catalog a{display:block;padding:1rem;border:1px solid var(--line);border-radius:var(--r-sm);text-decoration:none}
.reference-catalog-section .glossary-term__catalog a span{display:grid;gap:.375rem}
@media(max-width:900px){.reference-catalog-section .glossary-term__catalog>div{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:600px){.reference-catalog-section .glossary-term__catalog>div{grid-template-columns:minmax(0,1fr)}}
