/*
Theme Name:   Book Reviews
Theme URI:    https://example.com
Description:  Child theme for a book review site — video rail, detailed listings, category filters.
Author:       —
Template:     generatepress
Version:      0.2.0
Text Domain:  sach-review
*/

/* =========================================================
   Tokens
   ========================================================= */
:root {
	--sr-bg: #ffffff;
	--sr-surface: #f6f6f4;
	--sr-border: #e2e2dd;
	--sr-text: #1a1a1a;
	--sr-muted: #6e6e6e;
	--sr-accent: #e0402e;
	--sr-accent-dark: #b92f20;
	--sr-star: #f0a500;
	--sr-radius: 4px;
	--sr-serif: "Playfair Display", Georgia, "Times New Roman", serif;
	--sr-sans: "Helvetica Neue", Helvetica, Arial, sans-serif;
}

body, .sr-home, .sr-archive, .sr-single, .sr-footer { font-family: var(--sr-sans); }

.sr-home, .sr-archive, .sr-single {
	color: var(--sr-text);
	width: 100%;
	max-width: 1080px;
	margin-inline: auto;
	padding-inline: 24px;
	box-sizing: border-box;
}
.sr-home > .content-area,
.sr-archive > .content-area,
.sr-single > .content-area { width: 100%; min-width: 0; }

.sr-section { margin-block: 3rem; }
.sr-section__head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; margin-bottom: 1.25rem; }
.sr-section__title { font-family: var(--sr-sans); font-size: 1.125rem; font-weight: 600; margin: 0; }
.sr-section__more { font-size: .9rem; color: var(--sr-accent); text-decoration: none; font-weight: 600; }
.sr-section__more:hover { text-decoration: underline; }
.sr-empty { color: var(--sr-muted); padding: 2rem 0; }

/* =========================================================
   Short video rail
   ========================================================= */
.sr-shorts { margin-block: 2rem 2.5rem; }
.sr-shorts__head { display: flex; align-items: baseline; gap: .75rem; margin-bottom: 1rem; flex-wrap: wrap; }
.sr-shorts__title { font-family: var(--sr-sans); font-size: 1.125rem; font-weight: 600; margin: 0; }
.sr-shorts__hint { color: var(--sr-muted); font-size: .85rem; margin: 0; }

.sr-shorts__track {
	display: flex;
	gap: 1rem;
	list-style: none;
	margin: 0;
	padding: 0 0 .75rem;
	overflow-x: auto;
	scroll-snap-type: x mandatory;
	scrollbar-width: thin;
	-webkit-overflow-scrolling: touch;
}
.sr-shorts__item { flex: 0 0 158px; scroll-snap-align: start; }
.sr-shorts__caption {
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
	margin-top: .5rem;
	font-size: .85rem;
	line-height: 1.35;
	font-weight: 600;
	color: var(--sr-text);
	text-decoration: none;
}
.sr-shorts__caption:hover { color: var(--sr-accent); }

/* =========================================================
   Video facade — iframe chỉ nạp khi bấm Play
   ========================================================= */
.sr-video { --sr-video-ratio: 9 / 16; width: 100%; }
.sr-video__facade {
	position: relative;
	display: block;
	width: 100%;
	/* Poster luôn là ẢNH BÌA, nên giữ tỉ lệ bìa 2:3. Chỉ khi bấm Play thì
	   iframe mới lấy tỉ lệ video (9:16 hoặc 16:9). */
	aspect-ratio: 2 / 3;
	padding: 0;
	border: 0;
	border-radius: var(--sr-radius);
	overflow: hidden;
	background: var(--sr-surface);
	cursor: pointer;
}
.sr-video__thumb { width: 100%; height: 100%; object-fit: cover; display: block; }
.sr-video__play {
	position: absolute;
	inset: 50% auto auto 50%;
	transform: translate(-50%, -50%);
	width: 50px; height: 50px;
	border-radius: 50%;
	background: rgba(0, 0, 0, .62);
	transition: background .15s ease, transform .15s ease;
}
.sr-video__play::after {
	content: "";
	position: absolute;
	inset: 50% auto auto 54%;
	transform: translate(-50%, -50%);
	border-style: solid;
	border-width: 9px 0 9px 15px;
	border-color: transparent transparent transparent #fff;
}
.sr-video__facade:hover .sr-video__play { background: var(--sr-accent); transform: translate(-50%, -50%) scale(1.06); }
.sr-video__facade:focus-visible { outline: 3px solid var(--sr-accent); outline-offset: 2px; }
.sr-video__iframe { width: 100%; aspect-ratio: var(--sr-video-ratio, 9 / 16); border: 0; border-radius: var(--sr-radius); }

/* =========================================================
   Detailed view — hàng sách
   ========================================================= */
.sr-rows { max-width: 760px; }
.sr-row {
	display: grid;
	grid-template-columns: 112px minmax(0, 1fr);
	gap: 1.25rem;
	padding: 1.75rem 0;
	border-bottom: 1px solid var(--sr-border);
}
.sr-rows > .sr-row:first-child { padding-top: .5rem; }

.sr-row__cover { position: relative; }
.sr-row__cover img { width: 100%; height: auto; display: block; border-radius: 2px; box-shadow: 0 1px 4px rgba(0,0,0,.18); }
.sr-row__cover-empty { display: block; width: 100%; aspect-ratio: 2 / 3; background: var(--sr-surface); border-radius: 2px; }

.sr-row__title { font-family: var(--sr-serif); font-size: 1.35rem; line-height: 1.2; font-weight: 900; margin: 0 0 .2rem; }
.sr-row__title a { color: var(--sr-text); text-decoration: none; }
.sr-row__title a:hover { color: var(--sr-accent); }
.sr-row__author { margin: 0 0 .3rem; font-size: .95rem; }
.sr-row__author a { color: var(--sr-muted); text-decoration: none; }
.sr-row__author a:hover { text-decoration: underline; }
.sr-row__excerpt { margin: .6rem 0 .8rem; font-size: .95rem; line-height: 1.6; color: #333; }
.sr-row__footer { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; margin-bottom: .9rem; }
.sr-row__more { font-size: .88rem; font-weight: 600; color: var(--sr-accent); text-decoration: none; }
.sr-row__more:hover { text-decoration: underline; }

/* Chips category kiểu BookBub: chữ đỏ nhỏ, phân tách bằng dấu phẩy */
.sr-cats { margin: 0; font-size: .82rem; line-height: 1.5; }
.sr-cats__item { color: var(--sr-accent); text-decoration: none; }
.sr-cats__item:hover { text-decoration: underline; }
.sr-cats__sep { color: var(--sr-muted); }

.sr-badge {
	position: absolute;
	top: .35rem; left: .35rem;
	font-size: .65rem;
	font-weight: 700;
	letter-spacing: .04em;
	text-transform: uppercase;
	padding: .18rem .45rem;
	border-radius: 2px;
	background: rgba(0, 0, 0, .78);
	color: #fff;
}

/* =========================================================
   Condensed view — lưới card
   ========================================================= */
.sr-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 1.75rem 1.5rem; }
.sr-grid--related { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }

.sr-card__link { text-decoration: none; color: inherit; display: flex; flex-direction: column; height: 100%; }
.sr-card__cover { position: relative; aspect-ratio: 2 / 3; overflow: hidden; background: var(--sr-surface); border-radius: 2px; box-shadow: 0 1px 4px rgba(0,0,0,.18); }
.sr-card__cover img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .25s ease; }
.sr-card__link:hover .sr-card__cover img { transform: scale(1.03); }
.sr-card__cover-empty { width: 100%; height: 100%; }
.sr-card__body { padding-top: .6rem; display: flex; flex-direction: column; flex: 1; }
.sr-card__title {
	font-family: var(--sr-serif);
	font-size: 1rem; line-height: 1.25; font-weight: 800; margin: 0 0 .2rem;
	display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.sr-card__link:hover .sr-card__title { color: var(--sr-accent); }
.sr-card__author { font-size: .84rem; color: var(--sr-muted); margin: 0 0 .45rem; }
.sr-card__body .sr-rating { margin-top: auto; }

/* =========================================================
   Rating
   ========================================================= */
.sr-rating { display: inline-flex; align-items: center; gap: .4rem; }
.sr-rating__stars {
	position: relative; display: inline-block; width: 76px; height: 14px;
	background: #d8d8d3;
	-webkit-mask: repeat-x left center / 15.2px 14px
		url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'><path d='M10 1l2.6 5.3 5.9.9-4.3 4.1 1 5.8L10 14.4 4.8 17.1l1-5.8L1.5 7.2l5.9-.9z'/></svg>");
	mask: repeat-x left center / 15.2px 14px
		url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'><path d='M10 1l2.6 5.3 5.9.9-4.3 4.1 1 5.8L10 14.4 4.8 17.1l1-5.8L1.5 7.2l5.9-.9z'/></svg>");
}
.sr-rating__fill { position: absolute; inset: 0 auto 0 0; background: var(--sr-star); }
.sr-rating__number { font-size: .82rem; font-weight: 700; color: var(--sr-muted); }

/* =========================================================
   Filters + toolbar
   ========================================================= */
.sr-filters {
	background: var(--sr-surface);
	border: 1px solid var(--sr-border);
	border-radius: var(--sr-radius);
	padding: 1.1rem;
	margin-block: 1.5rem;
}
.sr-filters__row { display: flex; flex-wrap: wrap; gap: .85rem; align-items: flex-end; }
.sr-filters__row--actions { margin-top: .9rem; justify-content: space-between; align-items: center; }
.sr-filters__field { display: flex; flex-direction: column; gap: .3rem; min-width: 150px; }
.sr-filters__field--grow { flex: 1 1 200px; }
.sr-filters__label { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--sr-muted); }
.sr-filters input[type="search"], .sr-filters select {
	padding: .5rem .6rem;
	border: 1px solid #ccc;
	border-radius: var(--sr-radius);
	background: var(--sr-bg);
	font-size: .9rem;
	width: 100%;
}
.sr-filters__check { display: flex; align-items: center; gap: .45rem; font-size: .88rem; }
.sr-filters__buttons { display: flex; gap: .5rem; }

.sr-btn { display: inline-block; padding: .5rem 1.1rem; border-radius: var(--sr-radius); font-size: .88rem; font-weight: 700; text-decoration: none; border: 1px solid transparent; cursor: pointer; }
.sr-btn--primary { background: var(--sr-accent); color: #fff; }
.sr-btn--primary:hover { background: var(--sr-accent-dark); }
.sr-btn--ghost { background: transparent; color: var(--sr-muted); border-color: #ccc; }

.sr-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding-bottom: .75rem; border-bottom: 2px solid var(--sr-text); margin-bottom: .5rem; }
.sr-toolbar__count { margin: 0; font-size: .9rem; font-weight: 700; }
.sr-views { display: inline-flex; border: 1px solid #ccc; border-radius: var(--sr-radius); overflow: hidden; }
.sr-views__btn { padding: .35rem .8rem; font-size: .82rem; font-weight: 600; color: var(--sr-muted); text-decoration: none; background: var(--sr-bg); }
.sr-views__btn + .sr-views__btn { border-left: 1px solid #ccc; }
.sr-views__btn.is-active { background: var(--sr-text); color: #fff; }

/* =========================================================
   Single book
   ========================================================= */
.sr-archive__title { font-family: var(--sr-serif); font-size: 2.1rem; font-weight: 900; margin: 1.5rem 0 .3rem; }
.sr-archive__desc { color: var(--sr-muted); max-width: 60ch; }

.sr-hero { display: grid; grid-template-columns: minmax(0, 200px) minmax(0, 1fr); gap: 2.5rem; align-items: start; margin-block: 2rem 2.5rem; }
.sr-hero__cover img { width: 100%; border-radius: 2px; display: block; box-shadow: 0 2px 10px rgba(0,0,0,.2); }
.sr-hero__title { font-family: var(--sr-serif); font-size: 2.3rem; line-height: 1.12; font-weight: 900; margin: 0 0 .3rem; }
.sr-hero__author { color: var(--sr-muted); margin: 0 0 .5rem; font-size: 1rem; }
.sr-hero__author a { color: var(--sr-muted); }
.sr-hero__meta .sr-cats { margin-bottom: .7rem; }
.sr-hero__meta .sr-retailers { margin-top: 1.25rem; }

.sr-specs { display: flex; flex-wrap: wrap; gap: 1.75rem; margin: 1.25rem 0 0; padding: 1rem 0 0; border-top: 1px solid var(--sr-border); }
.sr-specs dt { font-size: .7rem; text-transform: uppercase; letter-spacing: .06em; color: var(--sr-muted); font-weight: 700; }
.sr-specs dd { margin: .2rem 0 0; font-weight: 600; font-size: .95rem; }

.sr-body { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 3rem; align-items: start; }
.sr-body__aside { position: sticky; top: 1.5rem; order: 2; }
.sr-body__aside .sr-section__title { font-size: 1.15rem; margin-bottom: .75rem; }

/* CTA nhận sách miễn phí */
.sr-cta { margin-top: 1.25rem; padding: 1rem; border: 1px dashed #ccc; border-radius: var(--sr-radius); background: var(--sr-surface); }
.sr-cta__label { margin: 0 0 .6rem; font-weight: 700; font-size: .9rem; }
.sr-cta__buttons { display: flex; flex-wrap: wrap; gap: .6rem; }
.sr-cta__btn { padding: .5rem 1.1rem; border-radius: var(--sr-radius); color: #fff; font-weight: 700; font-size: .85rem; text-decoration: none; }
.sr-cta__btn--whatsapp { background: #25d366; color: #04310f; }
.sr-cta__btn--telegram { background: #2aabee; }

/* Trong danh sách: bỏ khung, chỉ giữ hai nút cho gọn */
.sr-row .sr-cta { margin: 0 0 .9rem; padding: 0; border: 0; background: none; }
.sr-row .sr-cta__label { font-size: .78rem; font-weight: 600; color: var(--sr-muted); margin-bottom: .4rem; }
.sr-row .sr-cta__btn { padding: .42rem .9rem; font-size: .8rem; }

/* =========================================================
   Nội dung bài review (Gutenberg blocks)
   ========================================================= */
.sr-content { max-width: 66ch; font-size: 1.05rem; line-height: 1.75; }
.sr-content h2 { font-family: var(--sr-serif); font-size: 1.45rem; margin-top: 2.5rem; }
.sr-content h3 { font-family: var(--sr-serif); font-size: 1.15rem; margin-top: 1.8rem; }

.sr-content ul { padding-left: 0; list-style: none; }
.sr-content ul li { position: relative; padding-left: 1.5rem; margin-bottom: .55rem; }
.sr-content ul li::before { content: ""; position: absolute; left: .3rem; top: .72em; width: 6px; height: 6px; border-radius: 50%; background: var(--sr-accent); }

.sr-content blockquote {
	margin: 2rem 0;
	padding: 1.25rem 1.5rem;
	border: 0;
	border-left: 3px solid var(--sr-accent);
	background: var(--sr-surface);
	font-family: var(--sr-serif);
	font-size: 1.15rem;
	font-style: italic;
	line-height: 1.55;
}
.sr-content blockquote p:last-child { margin-bottom: 0; }
.sr-content blockquote cite { display: block; margin-top: .6rem; font-size: .82rem; font-style: normal; font-family: inherit; color: var(--sr-muted); }

/* =========================================================
   Mobile
   ========================================================= */
@media (max-width: 900px) {
	.sr-body { grid-template-columns: 1fr; gap: 2rem; }
	.sr-body__aside { position: static; order: 0; max-width: 300px; }
}

@media (max-width: 768px) {
	.sr-home, .sr-archive, .sr-single { padding-inline: 16px; }
	.sr-hero { grid-template-columns: 1fr; gap: 1.25rem; }
	.sr-hero__cover { max-width: 160px; }
	.sr-hero__title { font-size: 1.6rem; }
	.sr-row { grid-template-columns: 84px minmax(0, 1fr); gap: 1rem; padding: 1.25rem 0; }
	.sr-row__title { font-size: 1.15rem; }
	.sr-grid { grid-template-columns: repeat(auto-fill, minmax(135px, 1fr)); gap: 1.25rem 1rem; }
	.sr-shorts__item { flex: 0 0 138px; }
	.sr-filters__row--actions { flex-direction: column; align-items: stretch; gap: .75rem; }
}

@media (prefers-reduced-motion: reduce) {
	.sr-card__link:hover .sr-card__cover img,
	.sr-video__facade:hover .sr-video__play { transform: none; }
}

/* =========================================================
   Rail sách liên quan (cùng tác giả / cùng category)
   ========================================================= */
.sr-rail { margin-block: 2.5rem; padding-top: 1.75rem; border-top: 1px solid var(--sr-border); }
.sr-rail__head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; }
.sr-rail__title { font-family: var(--sr-sans); font-size: 1.125rem; font-weight: 600; margin: 0; }
.sr-rail__more { font-size: .85rem; font-weight: 600; color: var(--sr-accent); text-decoration: none; white-space: nowrap; }
.sr-rail__more:hover { text-decoration: underline; }

.sr-rail__track {
	display: flex;
	gap: 1.25rem;
	list-style: none;
	margin: 0;
	padding: 0 0 .75rem;
	overflow-x: auto;
	scroll-snap-type: x mandatory;
	scrollbar-width: thin;
	-webkit-overflow-scrolling: touch;
}
.sr-rail__item { flex: 0 0 124px; scroll-snap-align: start; }
.sr-rail__link { display: block; text-decoration: none; color: inherit; }
.sr-rail__cover { display: block; aspect-ratio: 2 / 3; background: var(--sr-surface); border-radius: 2px; overflow: hidden; box-shadow: 0 1px 4px rgba(0,0,0,.18); }
.sr-rail__cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.sr-rail__name {
	display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
	margin-top: .5rem; font-size: .85rem; line-height: 1.3; font-weight: 600;
}
.sr-rail__link:hover .sr-rail__name { color: var(--sr-accent); }
.sr-rail__item .sr-rating { margin-top: .25rem; }

/* =========================================================
   Footer
   ========================================================= */
.sr-footer { background: #2b2b2b; color: #cfcfcf; margin-top: 4rem; padding: 2.75rem 0 2rem; font-size: .85rem; }
.sr-footer__inner { max-width: 1080px; margin-inline: auto; padding-inline: 24px; }

.sr-footer__social { display: flex; flex-wrap: wrap; gap: 1.25rem; list-style: none; margin: 0 0 2rem; padding: 0 0 1.75rem; border-bottom: 1px solid #444; }
.sr-footer__social a { color: #cfcfcf; text-decoration: none; font-weight: 600; }
.sr-footer__social a:hover { color: #fff; }

.sr-footer__cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 2rem 1.5rem; }
.sr-footer__heading { font-family: var(--sr-sans); font-size: .72rem; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; color: #fff; margin: 0 0 .85rem; }
.sr-footer__col ul { list-style: none; margin: 0; padding: 0; }
.sr-footer__col li { margin-bottom: .5rem; line-height: 1.4; }
.sr-footer__col a { color: #cfcfcf; text-decoration: none; }
.sr-footer__col a:hover { color: #fff; text-decoration: underline; }

.sr-footer__legal { margin: 2.5rem 0 0; padding-top: 1.5rem; border-top: 1px solid #444; font-size: .78rem; color: #9a9a9a; }

@media (max-width: 768px) {
	.sr-footer__inner { padding-inline: 16px; }
	.sr-footer__cols { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 1.75rem 1rem; }
	.sr-rail__item { flex: 0 0 108px; }
}

/* Tên site trên header: cùng ngôn ngữ chữ với tiêu đề sách. */
.site-title, .site-title a, .main-title, .main-title a {
	font-family: var(--sr-serif);
	font-weight: 900;
	letter-spacing: -0.01em;
}
