/* =====================================================================
 * Documents page (newsberg/template-documents.php).
 * Uses the --sc-* tokens from site-chrome.css.
 * ===================================================================== */
#content.dc { padding: 0 !important; }
.dc { background: #faf7fd; color: var(--sc-text); overflow-x: clip; }
.dc-wrap { max-width: var(--sc-max); margin: 0 auto; padding: 0 24px; }
.dc a { text-decoration: none; }
.dc a:focus-visible { outline: 2px solid var(--sc-purple); outline-offset: 4px; border-radius: 12px; }

/* ---------- Hero ---------- */
.dc-hero {
	position: relative;
	isolation: isolate;
	overflow: hidden;
	padding: 40px 0 96px;
	background: linear-gradient(180deg, #fff 0%, #fbf8fe 100%);
	border-bottom: 1px solid var(--sc-line);
}
.dc-hero::before {
	content: "";
	position: absolute;
	inset: -40% -10%;
	z-index: -1;
	background:
		radial-gradient(34% 50% at 8% 20%, rgba(168, 85, 247, .14), transparent 70%),
		radial-gradient(30% 45% at 94% 80%, rgba(245, 196, 81, .09), transparent 70%);
}
.dc-crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin-bottom: 22px; font-size: 13.5px !important; color: var(--sc-muted); }
.dc-crumbs a { color: var(--sc-muted) !important; font-weight: 600; }
.dc-crumbs a:hover { color: var(--sc-purple) !important; }
.dc-crumbs i { font-size: 9px !important; opacity: .6; }
.dc-crumbs span { color: var(--sc-ink); font-weight: 600; }
.dc .dc-eyebrow { display: inline-flex; align-items: center; gap: 8px; margin: 0 0 10px; font-size: 12.5px !important; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--sc-purple); }
.dc .dc-title { margin: 0; font-size: clamp(30px, 4vw, 46px) !important; font-weight: 800; line-height: 1.2; color: var(--sc-ink); }
.dc .dc-desc { max-width: 680px; margin: 12px 0 0; font-size: 16.5px !important; line-height: 1.75; }

.dc-body { position: relative; margin-top: -60px; padding-bottom: 88px; }

/* ---------- Book cover (shared) ---------- */
.dc-book {
	position: relative;
	display: block;
	overflow: hidden;
	aspect-ratio: 600 / 848;
	border-radius: 6px 14px 14px 6px;
	background: #ece3f5;
	box-shadow:
		inset 6px 0 10px -6px rgba(0, 0, 0, .35),
		0 18px 34px rgba(31, 18, 51, .22),
		0 4px 10px rgba(31, 18, 51, .12);
	transform: perspective(1200px) rotateY(0deg);
	transform-origin: left center;
	transition: transform .45s cubic-bezier(.2, .7, .2, 1), box-shadow .45s ease;
}
.dc-book img { display: block; width: 100%; height: 100%; object-fit: cover; }
/* Spine highlight */
.dc-book::before {
	content: "";
	position: absolute;
	inset: 0 auto 0 0;
	width: 14px;
	z-index: 1;
	background: linear-gradient(90deg, rgba(0, 0, 0, .25), rgba(255, 255, 255, .25) 40%, rgba(0, 0, 0, 0));
	pointer-events: none;
}
/* Gloss */
.dc-book::after {
	content: "";
	position: absolute;
	inset: 0;
	z-index: 1;
	background: linear-gradient(115deg, rgba(255, 255, 255, .28) 0%, rgba(255, 255, 255, 0) 38%);
	opacity: 0;
	transition: opacity .45s ease;
	pointer-events: none;
}

/* ---------- Featured (latest) ---------- */
.dc-feature {
	position: relative;
	isolation: isolate;
	overflow: hidden;
	display: grid;
	grid-template-columns: 260px minmax(0, 1fr);
	gap: 48px;
	align-items: center;
	margin-bottom: 56px;
	padding: 40px 48px;
	border-radius: 28px;
	background: linear-gradient(125deg, #3a0766 0%, #4b0880 40%, var(--sc-purple) 100%);
	color: #fff;
	box-shadow: 0 24px 50px rgba(75, 8, 128, .28);
}
.dc-feature::before {
	content: "";
	position: absolute;
	inset: 0;
	z-index: -1;
	background:
		radial-gradient(40% 70% at 95% 0%, rgba(214, 140, 255, .45), transparent 70%),
		radial-gradient(30% 60% at 0% 100%, rgba(245, 196, 81, .18), transparent 70%);
}
.dc-feature-cover { transform: perspective(1200px) rotateY(-14deg); box-shadow: 18px 24px 40px rgba(0, 0, 0, .4), inset 6px 0 10px -6px rgba(0, 0, 0, .35); }
.dc-feature:hover .dc-feature-cover { transform: perspective(1200px) rotateY(-4deg) translateY(-4px); }
.dc .dc-feature-label { display: inline-flex; align-items: center; gap: 10px; margin: 0 0 10px; font-size: 12.5px !important; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: #e4c9ff; }
.dc-pulse { position: relative; width: 9px; height: 9px; border-radius: 50%; background: #f5c451; }
.dc-pulse::after { content: ""; position: absolute; inset: -5px; border-radius: 50%; border: 2px solid rgba(245, 196, 81, .6); animation: dc-pulse 1.8s ease-out infinite; }
@keyframes dc-pulse { from { transform: scale(.6); opacity: 1; } to { transform: scale(1.6); opacity: 0; } }
.dc .dc-feature h2 { margin: 0; font-size: clamp(24px, 2.8vw, 34px) !important; font-weight: 800; line-height: 1.3; color: #fff; }
.dc .dc-feature-year { margin: 4px 0 14px; font-family: 'Playfair Display', 'Noto Sans Thai', serif !important; font-size: clamp(30px, 3.6vw, 46px) !important; font-weight: 600; line-height: 1.1; color: #f5c451; }
.dc .dc-feature-desc { max-width: 520px; margin: 0 0 24px; font-size: 16px !important; line-height: 1.75; color: rgba(255, 255, 255, .85); }
.dc-feature-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; }
.dc-btn { display: inline-flex; align-items: center; gap: 10px; padding: 13px 24px; border-radius: 999px; font-size: 15px !important; font-weight: 700; transition: transform .2s ease, box-shadow .2s ease; }
.dc-btn-primary { background: #fff; color: var(--sc-purple) !important; }
.dc-btn-primary:hover { transform: translateY(-2px); box-shadow: 0 12px 26px rgba(0, 0, 0, .22); }
.dc-feature .dc-badge { background: rgba(255, 255, 255, .14); color: #fff; border-color: rgba(255, 255, 255, .25); }

/* ---------- Badges ---------- */
.dc-badge { display: inline-flex; align-items: center; gap: 6px; width: max-content; padding: 4px 11px; border-radius: 999px; border: 1px solid transparent; font-size: 12px !important; font-weight: 700; line-height: 1.5; }
.dc-badge i { font-size: 11px !important; }
.dc-badge.is-pdf { background: #fdecec; color: #b42318; }
.dc-badge.is-ebook { background: #e9f3ff; color: #1d4ed8; }

/* ---------- Shelf ---------- */
.dc-section + .dc-section { margin-top: 56px; }
.dc-section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 26px; }
.dc .dc-section-head h2 { margin: 0; font-size: clamp(22px, 2.4vw, 28px) !important; font-weight: 700; color: var(--sc-ink); }
.dc-count { font-size: 14px !important; font-weight: 600; color: var(--sc-muted); }
.dc-shelf { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 32px 26px; list-style: none; margin: 0; padding: 0; }
.dc-card { display: flex; flex-direction: column; gap: 16px; color: inherit !important; }
.dc-card:hover .dc-book,
.dc-card:focus-visible .dc-book {
	transform: perspective(1200px) rotateY(-12deg) translateY(-6px);
	box-shadow: inset 6px 0 10px -6px rgba(0, 0, 0, .35), 16px 26px 40px rgba(31, 18, 51, .3), 0 4px 10px rgba(31, 18, 51, .12);
}
.dc-card:hover .dc-book::after { opacity: 1; }
.dc-book-hover {
	position: absolute;
	left: 50%;
	bottom: 16px;
	z-index: 2;
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 9px 16px;
	border-radius: 999px;
	background: rgba(255, 255, 255, .95);
	color: var(--sc-purple);
	font-size: 13.5px;
	font-weight: 700;
	white-space: nowrap;
	box-shadow: 0 8px 20px rgba(0, 0, 0, .2);
	opacity: 0;
	transform: translate(-50%, 8px);
	transition: opacity .3s ease, transform .3s ease;
}
.dc-card:hover .dc-book-hover,
.dc-card:focus-visible .dc-book-hover { opacity: 1; transform: translate(-50%, 0); }
.dc-card-text { display: flex; flex-direction: column; gap: 4px; }
.dc-card-year { font-family: 'Playfair Display', 'Noto Sans Thai', serif !important; font-size: 22px !important; font-weight: 600; line-height: 1.2; color: var(--sc-purple); }
.dc-card-title { margin-bottom: 6px; font-size: 14.5px !important; font-weight: 700; color: var(--sc-ink); }
.dc-card:hover .dc-card-title { color: var(--sc-purple); }

/* ---------- Other documents ---------- */
.dc-others { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; list-style: none; margin: 0; padding: 0; }
.dc-other {
	display: flex;
	gap: 22px;
	align-items: center;
	height: 100%;
	padding: 18px;
	border-radius: 22px;
	background: #fff;
	border: 1px solid var(--sc-line);
	color: inherit !important;
	transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
}
.dc-other:hover { transform: translateY(-3px); border-color: #e2d3f4; box-shadow: 0 18px 40px rgba(31, 18, 51, .1); }
.dc-other-cover { flex-shrink: 0; width: 104px; aspect-ratio: 600 / 848; overflow: hidden; border-radius: 4px 10px 10px 4px; box-shadow: 0 10px 22px rgba(31, 18, 51, .18); }
.dc-other-cover img { width: 100%; height: 100%; object-fit: cover; }
.dc-other-text { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.dc-other-title { font-size: 16px !important; font-weight: 700; line-height: 1.55; color: var(--sc-ink); }
.dc-other-meta { font-size: 13.5px !important; line-height: 1.6; color: var(--sc-muted); }
.dc-other-cta { display: inline-flex; align-items: center; gap: 8px; font-size: 13.5px !important; font-weight: 700; color: var(--sc-purple); }
.dc-other-cta i { font-size: 11px !important; }

.dc-extra { margin-top: 48px; padding: 28px 32px; border-radius: 20px; background: #fff; border: 1px solid var(--sc-line); }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
	.dc-shelf { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
	.dc-feature { grid-template-columns: 200px minmax(0, 1fr); gap: 32px; padding: 32px; }
	.dc-shelf { grid-template-columns: repeat(3, minmax(0, 1fr)); }
	.dc-others { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
	.dc-wrap { padding: 0 16px; }
	.dc-hero { padding: 26px 0 80px; }
	.dc-body { margin-top: -52px; padding-bottom: 56px; }
	.dc-feature { grid-template-columns: 1fr; justify-items: center; gap: 24px; padding: 28px 22px; text-align: center; border-radius: 22px; margin-bottom: 40px; }
	.dc-feature-cover { width: 180px; transform: none; }
	.dc-feature-actions { justify-content: center; }
	.dc-shelf { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px 16px; }
	.dc-card-year { font-size: 19px !important; }
	.dc-other { gap: 16px; padding: 14px; }
	.dc-other-cover { width: 80px; }
	.dc-other-title { font-size: 14.5px !important; }
}
@media (hover: none) {
	.dc-book-hover { display: none; }
}
@media (prefers-reduced-motion: reduce) {
	.dc *, .dc *::before, .dc *::after { transition: none !important; animation: none !important; }
	.dc-feature-cover, .dc-card:hover .dc-book { transform: none !important; }
}
