/*
 * ALIMUSAEV Core — каталог и страница программы.
 * Цвета и шрифты — из токенов темы ALIMUSAEV (--am-*); запасные значения на случай другой темы.
 */

/* ---------- Кнопки администратора (видят только редакторы) ---------- */

.am-admin-btn {
	display: inline-flex;
	align-items: center;
	min-height: 32px;
	padding: 0 10px;
	border: 1px dashed var(--am-fg, #0A0A0A);
	font: 500 13px var(--am-font-mono, monospace);
	text-decoration: none;
	white-space: nowrap;
}
.am-admin-btn:hover { opacity: 1; background: var(--am-surface, #F4F4F4); }
.am-softtable__name .am-admin-btn { margin-top: 8px; min-height: 28px; }

/* ---------- Каталог ---------- */

.am-catalog { display: flex; flex-direction: column; gap: 20px; }
.am-catalog__bar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; }
.am-catalog__search { flex: 1 1 360px; margin: 0; }
.am-catalog__table table { min-width: 640px; }
.am-catalog__table tr[hidden] { display: none; }
.am-catalog__desc {
	display: block;
	margin-top: 4px;
	font: 400 14px/1.5 var(--am-font-sans, sans-serif);
	color: var(--am-muted, #555);
}
.am-catalog .am-softtable__name a { text-decoration: none; }
.am-catalog .am-softtable__name a:hover { text-decoration: underline; }
.am-catalog .am-softtable td { vertical-align: top; }
.am-catalog__note { margin: 0; max-width: 820px; font-size: 14px; color: var(--am-muted, #555); }

button.am-chip { background: transparent; color: var(--am-fg, #0A0A0A); cursor: pointer; border-radius: 0; }
button.am-chip:hover, button.am-chip:focus { background: transparent; color: var(--am-fg, #0A0A0A); }
button.am-chip.is-active, button.am-chip.is-active:hover { background: var(--am-inv, #0A0A0A); color: var(--am-inv-fg, #FFF); }

/* ---------- Страница программы ---------- */

.am-soft .am-label a { text-decoration: none; }
.am-soft__ver { font-weight: 400; color: var(--am-muted, #555); }
.am-soft__title::after { content: none; }
.am-soft__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.am-soft__btn {
	display: inline-flex;
	align-items: center;
	min-height: 52px;
	padding: 0 28px;
	background: var(--am-inv, #0A0A0A);
	color: var(--am-inv-fg, #FFF);
	border: 1px solid var(--am-inv, #0A0A0A);
	font: 700 16px var(--am-font-mono, monospace);
	text-decoration: none;
}
.am-soft__btn--outline { background: transparent; color: var(--am-fg, #0A0A0A); border-color: var(--am-fg, #0A0A0A); }
/* Наведение: кнопки меняются местами — сплошная становится контурной и наоборот.
   (Общее правило ссылок «color: inherit» иначе красило текст в цвет фона.) */
body .am-soft .am-soft__btn:visited { color: var(--am-inv-fg, #FFF); }
body .am-soft .am-soft__btn--outline:visited { color: var(--am-fg, #0A0A0A); }
body .am-soft .am-soft__btn:hover,
body .am-soft .am-soft__btn:focus-visible { background: transparent; color: var(--am-fg, #0A0A0A); border-color: var(--am-fg, #0A0A0A); opacity: 1; }
body .am-soft .am-soft__btn--outline:hover,
body .am-soft .am-soft__btn--outline:focus-visible { background: var(--am-inv, #0A0A0A); color: var(--am-inv-fg, #FFF); border-color: var(--am-inv, #0A0A0A); }

/* Копирование SHA-256 — значок, как у блоков кода */
body .am-soft__hash .am-soft__copy {
	display: inline-flex; align-items: center; justify-content: center;
	width: 30px; height: 30px; min-height: 0; padding: 0;
	background: transparent !important; color: inherit !important;
	border: 1px solid transparent; border-radius: 0; box-shadow: none;
	cursor: pointer; opacity: .75;
}
body .am-soft__hash .am-soft__copy:hover,
body .am-soft__hash .am-soft__copy:focus-visible { border-color: currentColor; opacity: 1; outline: none; }
body .am-soft__hash .am-soft__copy svg { width: 16px; height: 16px; display: block; }
.am-soft__hash-head .am-soft__copied { font-weight: 400; opacity: .8; }

.am-soft__grid { display: flex; flex-wrap: wrap; gap: 40px 56px; align-items: flex-start; }
.am-soft__meta { flex: 1 1 300px; min-width: 0; display: flex; flex-direction: column; gap: 20px; }
.am-soft__body { flex: 999 1 520px; min-width: 0; }
.am-soft__body .am-article > :first-child { margin-top: 0; }

.am-soft__meta dl { margin: 0; border: 1px solid var(--am-fg, #0A0A0A); font-family: var(--am-font-mono, monospace); font-size: 14px; }
.am-soft__row { display: flex; gap: 16px; padding: 12px 16px; border-top: 1px solid var(--am-line, #DADADA); }
.am-soft__row:first-child { border-top: 0; }
.am-soft__row dt { flex: 0 0 96px; color: var(--am-muted, #555); }
.am-soft__row dd { margin: 0; flex: 1 1 auto; min-width: 0; font-weight: 700; overflow-wrap: anywhere; }

.am-soft__hash { border: 1px solid var(--am-fg, #0A0A0A); font-family: var(--am-font-mono, monospace); }
.am-soft__hash-head {
	display: flex;
	justify-content: space-between;
	align-items: center;
	min-height: 36px;
	padding: 0 6px 0 14px;
	background: var(--am-inv, #0A0A0A);
	color: var(--am-inv-fg, #FFF);
	font-size: 13px;
	font-weight: 700;
}
.am-soft__hash .am-code__copy {
	min-height: 30px;
	padding: 0 10px;
	background: transparent;
	color: inherit;
	border: 1px solid currentColor;
	border-radius: 0;
	font: inherit;
	cursor: pointer;
}
.am-soft__hash > code { display: block; padding: 14px 16px; font-size: 13px; line-height: 1.6; word-break: break-all; background: var(--am-surface, #F4F4F4); }
.am-soft__howto { padding: 0 16px 14px; background: var(--am-surface, #F4F4F4); font-size: 13px; }
.am-soft__howto summary { cursor: pointer; padding: 4px 0; }
.am-soft__howto p { margin: 8px 0 0; }
.am-soft__howto code { font-size: 12px; }
.am-soft__note { margin: 0; padding: 14px 16px; border: 1px dashed var(--am-fg, #0A0A0A); font-size: 14px; color: var(--am-muted, #555); }
.am-soft__back { margin-top: 40px; font-family: var(--am-font-mono, monospace); }
.am-soft__back a { text-decoration: none; }

/* ---------- Оглавление каталога: окна «C:\> dir /soft» и «/drivers» ---------- */

.am-dir {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
	border: 1px solid var(--am-fg, #0A0A0A);
	font-family: var(--am-font-mono, monospace);
	font-size: 15px;
}
.am-dir__col { padding: 20px 22px 18px; min-width: 0; }
.am-dir__col + .am-dir__col { border-left: 1px solid var(--am-line, #DADADA); }
@media (max-width: 680px) {
	.am-dir__col + .am-dir__col { border-left: 0; border-top: 1px solid var(--am-line, #DADADA); }
}
.am-dir__cmd { margin-bottom: 10px; color: var(--am-muted, #555); }
.am-dir__row {
	display: grid;
	grid-template-columns: max-content minmax(0, 1fr) max-content;
	gap: 16px;
	padding: 5px 8px;
	margin: 0 -8px;
	text-decoration: none;
}
.am-dir__row:hover { opacity: 1; background: var(--am-surface, #F4F4F4); }
.am-dir__row.is-current { background: var(--am-inv, #0A0A0A); color: var(--am-inv-fg, #FFF); }
.am-dir__tag { color: var(--am-muted, #555); }
.am-dir__row.is-current .am-dir__tag { color: inherit; opacity: .7; }
.am-dir__name { font-weight: 700; overflow-wrap: anywhere; }
.am-dir__row.is-empty .am-dir__name,
.am-dir__row.is-empty .am-dir__n { font-weight: 400; color: var(--am-muted, #555); }
.am-dir__row.is-current.is-empty .am-dir__name,
.am-dir__row.is-current.is-empty .am-dir__n { color: inherit; }
.am-dir__sum { margin-top: 10px; color: var(--am-muted, #555); }

/* ---------- Группы каталога ---------- */

.am-catalog__groups { display: flex; flex-direction: column; gap: 40px; }
.am-group[hidden] { display: none; }
/* Заголовок группы — одна строка терминала одного размера: «C:\> dir \soft\1c — 1С · 1 файл» */
.am-group__title {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	gap: 4px 10px;
	margin: 0 0 12px;
	font-family: var(--am-font-mono, monospace);
	font-size: 16px;
	font-weight: 400;
	line-height: 1.5;
}
.am-group__prompt { color: var(--am-muted, #555); }
.am-group__title a { font-weight: 700; text-decoration: none; }
.am-group__title a:hover { text-decoration: underline; }
.am-group__name { color: var(--am-muted, #555); }
.am-group__name::before { content: "— "; }

/* Переключатель разделов и ссылки в заголовках колонок «C:\> dir \soft» */
.am-catalog__tabs { margin-bottom: 24px; }
.am-dir__cmd a { color: var(--am-fg, #0A0A0A); text-decoration: none; border-bottom: 1px dotted currentColor; }
.am-dir__cmd a:hover { opacity: 1; border-bottom-style: solid; }
