/* =====================================================================
 * 05-style.css — стили раздела «Методические материалы»
 * Подключение в functions.php темы:
 *   wp_enqueue_style( 'mem-materials', get_stylesheet_directory_uri() . '/css/mem-materials.css', array(), '1.0' );
 * Палитра под мемориальный центр: тёмный графит + тёплый беж + брендовый акцент.
 * ===================================================================== */

:root {
	--mem-bg:         var(--color-background-light);     /* фон */
	--mem-card:       rgba(255,255,255,0.5);             /* карточка */
	--mem-card-hover: rgba(255,255,255,0.8);             /* карточка при наведении */
	--mem-line:       var(--color-primary);              /* границы */
	--mem-accent:     var(--color-primary);              /* тёплый акцент (золото/бронза) */
	--mem-text:       var(--color-secondary);            /* основной текст */
	--mem-muted:      var(--color-secondary-extralight); /* вторичный текст */
	--mem-radius:     0;
}

[data-theme="dark"] {
	--mem-bg:         var(--color-secondary); /* графит */
	--mem-card:       transparent;            /* карточка */
	--mem-card-hover: transparent;            /* карточка при наведении */
	--mem-line:       #3a322c;                /* границы */
	--mem-accent:     #b8894a;                /* тёплый акцент (золото/бронза) */
	--mem-text:       #efe8de;                /* основной текст */
	--mem-muted:      #a89a8b;                /* вторичный текст */
	--mem-radius:     14px;
}

/* ---------- Общая сетка карточек: 2 колонки (ТЗ) ---------- */
.mem-grid {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr)); /* 2 колонки */
	gap: 28px 32px;
	margin: 32px 0;
}

/* Карточка */
.mem-card {
	display: flex;
	flex-direction: column;
	background: var(--mem-card);
	border: 1px solid var(--mem-line);
	border-radius: var(--mem-radius);
	overflow: hidden;
	transition: transform .18s ease, border-color .18s ease;
}
.mem-card:hover {
	transform: translateY(-3px);
	border-color: var(--mem-accent);
}

.mem-card__media {
	position: relative;
	display: block;
	aspect-ratio: 16 / 10;
	background: #0f0d0b;
	overflow: hidden;
}
.mem-card__img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	transition: transform .35s ease;
}
.mem-card:hover .mem-card__img { transform: scale(1.04); }

.mem-card__placeholder {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	color: var(--mem-muted);
	font: italic 600 1.1rem/1.3 Georgia, serif;
	letter-spacing: .06em;
	background: repeating-linear-gradient(45deg, #17130f, #17130f 12px, #1c1712 12px, #1c1712 24px);
}

/* Дата — бейдж поверх изображения */
.mem-card__date {
	position: absolute;
	top: 14px;
	left: 14px;
	padding: 5px 12px;
	background: rgba(20, 17, 15, .82);
	color: var(--mem-text);
	font-size: .78rem;
	letter-spacing: .04em;
	border-radius: 999px;
	border: 1px solid var(--mem-line);
}

.mem-card__body {
	display: flex;
	flex-direction: column;
	flex: 1;
	padding: 20px 22px 22px;
}

.mem-card__title {
	margin: 0 0 10px;
	font-size: 1.22rem;
	line-height: 1.32;
}
.mem-card__title a {
	color: var(--mem-text);
	text-decoration: none;
}
.mem-card__title a:hover { color: var(--mem-accent); }

.mem-card__desc {
	color: var(--mem-muted);
	font-size: .95rem;
	line-height: 1.55;
	margin-bottom: 18px;
}

.mem-card__footer { margin-top: auto; }

.mem-card__more {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	color: var(--mem-accent);
	font-weight: 600;
	text-decoration: none;
	font-size: .95rem;
}
.mem-card__more:hover { text-decoration: underline; }

.mem-card__badge {
	padding: 2px 9px;
	background: rgba(184, 137, 74, .16);
	color: var(--mem-accent);
	border-radius: 999px;
	font-size: .74rem;
	font-weight: 700;
}

/* ---------- Баннер/описание раздела ---------- */
.mem-section-hero {
	display: grid;
	grid-template-columns: 1fr;
	gap: 24px;
	margin: 8px 0 12px;
}
.mem-section-hero__media img {
	width: 100%;
	height: auto;
	border-radius: var(--mem-radius);
	border: 1px solid var(--mem-line);
	display: block;
}
.mem-section-hero__title {
	margin: 0 0 12px;
	font-size: clamp(1.6rem, 3vw, 2.4rem);
	color: var(--mem-text);
}
.mem-section-hero__desc {
	color: var(--mem-muted);
	line-height: 1.65;
	max-width: 70ch;
}

/* Навигация по разделам */
.mem-section-nav {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	margin: 14px 0 4px;
}
.mem-section-nav__item {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 9px 16px;
	border: 1px solid var(--mem-line);
	border-radius: 999px;
	color: var(--mem-text);
	text-decoration: none;
	font-size: .9rem;
}
.mem-section-nav__item:hover {
	border-color: var(--mem-accent);
	color: var(--mem-accent);
}
.mem-section-nav__count {
	font-size: .72rem;
	color: var(--mem-muted);
}

/* ---------- Одна запись ---------- */
.mem-single { max-width: 960px; margin: 0 auto; padding: 12px 0 40px; }

.mem-single__crumbs {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	font-size: .85rem;
	color: var(--mem-muted);
	margin-bottom: 18px;
}
.mem-single__crumbs a { color: var(--mem-muted); text-decoration: none; }
.mem-single__crumbs a:hover { color: var(--mem-accent); }

.mem-single__section {
	display: inline-block;
	padding: 3px 11px;
	font-size: .76rem;
	letter-spacing: .06em;
	text-transform: uppercase;
	color: var(--mem-accent);
	background: rgba(184, 137, 74, .12);
	border-radius: 999px;
	margin-bottom: 12px;
}
.mem-single__title {
	margin: 0 0 10px;
	font-size: clamp(1.7rem, 3.4vw, 2.6rem);
	line-height: 1.2;
	color: var(--mem-text);
}
.mem-single__date { color: var(--mem-muted); font-size: .95rem; }

.mem-single__figure { margin: 26px 0; }
.mem-single__img {
	width: 100%;
	height: auto;
	border-radius: var(--mem-radius);
	border: 1px solid var(--mem-line);
	display: block;
}

.mem-single__content { line-height: 1.7; color: var(--mem-text); }

/* ---------- Прикреплённые файлы ---------- */
.mem-files {
	margin: 36px 0 12px 0;
	padding: 24px;
	background: var(--mem-bg);
	border: 1px solid var(--mem-line);
	border-radius: var(--mem-radius);
}
.mem-files:not([data-theme="dark"]) {
	margin-left: -30px;
	margin-right: -30px;
	margin-bottom: 0;
	border: 0;
}
.mem-files__heading {
	margin: 0 0 16px;
	font-size: 1.15rem;
	color: var(--mem-text);
	font-family: var(--font-secondary);
}

.mem-files__list {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.mem-file__link {
	display: flex;
	align-items: center;
	gap: 14px;
	text-decoration: none;
	transition: border-color .16s ease, background .16s ease;
}

a.mem-file__link[href$='.xls'],
a.mem-file__link[href$='.xlsx'],
a.mem-file__link[href$='.doc'],
a.mem-file__link[href$='.docx'],
a.mem-file__link {
    background-image: unset;
	background-color: var(--mem-card);
	color: var(--mem-text);
	border: 1px solid var(--mem-line);
	border-radius: 5px;
    display: flex;
    padding: 12px 14px;
    min-height: auto;
    padding-top: 12px;
	font-weight: normal;
}

a.mem-file__link[href$='.xls']:hover,
a.mem-file__link[href$='.xlsx']:hover,
a.mem-file__link[href$='.doc']:hover,
a.mem-file__link[href$='.docx']:hover,
a.mem-file__link:hover {
    border-color: var(--mem-accent);
	background-color: var(--mem-card-hover);
}

/* иконка слева */
.mem-file__icon {
	flex: 0 0 auto;
	width: 34px;
	height: 42px;
	display: inline-flex;
	color: var(--mem-accent);
}
.mem-file__icon svg { width: 100%; height: 100%; }

/* правая часть: название + формат + размер */
.mem-file__meta {
	display: flex;
	flex-direction: column;
	gap: 4px;
	min-width: 0;
}
.mem-file__title {
	font-weight: 600;
	font-size: .98rem;
	line-height: 1.3;
	overflow: hidden;
	text-overflow: ellipsis;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
}
.mem-file__bottom {
	display: flex;
	gap: 12px;
	font-size: .8rem;
	color: var(--mem-muted);
}
.mem-file__format {
	text-transform: uppercase;
	letter-spacing: .05em;
	font-weight: 700;
	color: var(--mem-accent);
}
.mem-file__size::before { content: "· "; }

/* Общая ссылка на облако */
.mem-files__cloud {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	margin-top: 18px;
	padding: 12px 20px;
	background: var(--mem-accent);
	color: var(--color-secondary);
	font-weight: 700;
	text-decoration: none;
	border-radius: 5px;
}
:not([data-theme="dark"]) .mem-files__cloud {
	color: #fff;
}
.mem-files__cloud:hover { background: var(--color-primary); color: var(--color-secondary); }
:not([data-theme="dark"]) .mem-files__cloud:hover { background: var(--color-links-hover); color: #fff; }
.mem-files__cloud-icon, .mem-files__cloud i.bi { font-size: 1.15rem; margin-bottom: -2px; }

/* Пагинация / служебное */
.mem-pagination { margin: 30px 0; }
.mem-empty { color: var(--mem-muted); padding: 40px 0; }
.mem-related { margin-top: 44px; }
.mem-related__title { font-size: 1.35rem; margin-bottom: 8px; color: var(--mem-text); }

/* ---------- Адаптив: 1 колонка на мобильных ---------- */
@media (max-width: 760px) {
	.mem-grid { grid-template-columns: 1fr; gap: 22px; }
	.mem-files { padding: 18px; }
	.mem-files__cloud { width: 100%; justify-content: center; }
}
