/* =========================================================
   Works (Произведения) — tabbed, filterable accordion
   Shared by the "по Жанрове" and "по Опусна Номерация" pages.
   Tabs filter the list by taxonomy term; rows expand in place.
   ========================================================= */

:root {
	--works-brand:    #b71f39;
	--works-shade:    #f8f8f8;
	--works-border:   #ebebeb;
	--works-tab-idle: #f3f3f3;
	--works-ink:      #141418;
}

.works {
	max-width: 100%;
	margin: 0 auto;
}

.works--empty {
	color: #666;
	padding: 24px 0;
}

/* ---- Tabs ---------------------------------------------------------------- */

.works__tabs {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: center;
	gap: 16px;
	background: #fff;
	border: 1px solid var(--works-brand);
	border-radius: 8px;
	padding: 16px 31px;
	margin-bottom: 32px;
}

.works__tabs .works__tab{
	appearance: none;
	-webkit-appearance: none;
	border: 0;
	cursor: pointer;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	height: 42px;
	padding: 0 19px;
	font-family: inherit;
	font-weight: 600;
	font-size: 14px;
	line-height: 1;
	white-space: nowrap;
	border-radius: 5px;
	background: var(--works-tab-idle);
	color: var(--works-ink);
	transition: background .15s ease, color .15s ease;
}

.works__tab:hover { background: #e9e9e9; }

.works__tab.is-active {
	background: var(--works-brand);
	color: #fff;
}

/* ---- Chamber sub-tabs (Камерна музика) — segmented control ---------------
   Rendered as <button>s inside an Elementor Shortcode widget, so the selectors
   are over-specific and reset hard to survive Elementor's global button styles;
   background/color carry !important because those are what Elementor overrides. */

.works__chamber { margin-top: 8px; }

.works .works__subtabs {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	width: fit-content;
	max-width: 100%;
	margin: 0 auto 24px;
	padding: 6px;
	background: var(--works-tab-idle);
}

.works .works__subtabs .works__subtab {
	appearance: none;
	-webkit-appearance: none;
	margin: 0;
	border: 0;
	outline: 0;
	box-shadow: none;
	cursor: pointer;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 40px;
	padding: 0 26px;
	font-family: inherit;
	font-weight: 600;
	font-size: 14px;
	letter-spacing: .01em;
	line-height: 1;
	text-transform: none;
	white-space: nowrap;
	background-color: transparent !important;
	color: #5b5b63 !important;
	transition: background-color .18s ease, color .18s ease, box-shadow .18s ease;
}

.works .works__subtabs .works__subtab:hover {
	background-color: #fff !important;
	color: var(--works-ink) !important;
}

.works .works__subtabs .works__subtab:focus-visible {
	outline: 2px solid var(--works-brand);
	outline-offset: 2px;
}

.works .works__subtabs .works__subtab.is-active {
	background-color: var(--works-brand) !important;
	color: #fff !important;
}

.works .works__subtabs .works__subtab.is-active:hover {
	background-color: #6e1414 !important;
	color: #fff !important;
}

.works__subpanel.is-hidden { display: none; }

/* ---- List + rows --------------------------------------------------------- */

.works__list {
	border: 1px solid var(--works-border);
	border-radius: 8px;
	overflow: hidden;
}

.works__item { border-top: 1px solid var(--works-border); }
.works__item:first-child { border-top: 0; }
.works__item.is-hidden { display: none; }
.works__item.is-shaded { background: var(--works-shade); }
.works__item.is-open   { background: var(--works-shade); }

/* ---- Row header ---------------------------------------------------------- */

.works__item button.works__head {
	width: 100%;
	display: flex;
	align-items: center;
	gap: 16px;
	padding: 20px 16px;
	background: transparent;
	border: 0;
	cursor: pointer;
	text-align: left;
	font-family: inherit;
}
.works__item button.works__head:hover, .works__item button.works__head:focus {
    background: unset;
}
.works__arrow {
	flex: 0 0 auto;
	width: 18px;
	height: 20px;
	display: inline-flex;
	align-items: center;
}

.works__titles {
	flex: 1 1 auto;
	min-width: 0;
	display: flex;
	flex-direction: column;
	gap: 2px;
}

.works__title {
	color: var(--works-brand);
	font-weight: 500;
	font-size: 20px;
	line-height: 1.25;
}

.works__sub {
	color: #111;
	font-weight: 400;
	font-size: 16px;
	line-height: 1.2;
}

.works__chevron {
	flex: 0 0 auto;
	width: 24px;
	height: 24px;
	display: inline-flex;
	color: var(--works-brand);
	transition: transform .2s ease;
}

.works__item.is-open .works__chevron { transform: rotate(180deg); }

.works__arrow svg   { display: block; width: 100%; height: 100%; }
.works__chevron svg { display: block; width: 100%; height: 100%; }

/* ---- Collapsible body (grid-rows technique) ------------------------------ */

.works__body {
	display: grid;
	grid-template-rows: 0fr;
	transition: grid-template-rows .25s ease;
}

.works__item.is-open .works__body { grid-template-rows: 1fr; }

.works__body-inner { overflow: hidden; }

.works__item.is-open .works__body-inner { padding: 0 32px 24px 32px; }

.works__body-inner,
.works__body-inner p {
	color: #111;
	font-size: 18px;
	line-height: 1.6;
}

.works__body-inner > :first-child { margin-top: 0; }
.works__body-inner > :last-child  { margin-bottom: 0; }
.works__body-inner p  { margin: 0 0 1em; }
.works__body-inner ol,
.works__body-inner ul { margin: 0 0 1em; padding-left: 1.4em; }
.works__body-inner li { margin: 0 0 .25em; }

/* ---- Responsive ---------------------------------------------------------- */

@media (max-width: 1100px) {
	.works { max-width: 100%; }
}

@media (max-width: 768px) {
	.works__tabs {
		flex-wrap: nowrap;
		justify-content: flex-start;
		overflow-x: auto;
		-webkit-overflow-scrolling: touch;
		gap: 10px;
		padding: 12px;
	}
	.works__tab { flex: 0 0 auto; }

	.works__head { padding: 16px 14px; gap: 12px; }
	.works__arrow { width: 16px; height: 18px; }
	.works__title { font-size: 17px; }
	.works__sub   { font-size: 14px; }

	.works__item.is-open .works__body-inner { padding: 0 16px 18px 16px; }
	.works__body-inner,
	.works__body-inner p { font-size: 16px; }
}
