/* Digilib STT Texmaco — public Home (cool atrium glass & ink) */
:root {
	--dh-ink: #0b1f33;
	--dh-ink-soft: #143049;
	--dh-sky: #3ba7d6;
	--dh-sky-deep: #1f7fad;
	--dh-mist: #e6edf3;
	--dh-paper: #f7fafc;
	--dh-line: rgba(11, 31, 51, 0.12);
	--dh-muted: #5a7388;
	--dh-ok: #1b7a4a;
	--dh-shadow: 0 18px 40px rgba(11, 31, 51, 0.16);
	--dh-radius: 14px;
	--dh-font-display: "Archivo", "Segoe UI", sans-serif;
	--dh-font-body: "Source Sans 3", "Source Sans Pro", "Segoe UI", sans-serif;
}

*,
*::before,
*::after {
	box-sizing: border-box;
}

html {
	scroll-behavior: smooth;
}

body.dh-body {
	margin: 0;
	min-height: 100vh;
	font-family: var(--dh-font-body);
	font-size: 1.05rem;
	line-height: 1.55;
	color: var(--dh-ink);
	background:
		radial-gradient(1200px 520px at 12% -10%, rgba(59, 167, 214, 0.18), transparent 55%),
		radial-gradient(900px 480px at 92% 8%, rgba(11, 31, 51, 0.08), transparent 50%),
		linear-gradient(180deg, #dfeaf2 0%, var(--dh-mist) 28%, var(--dh-paper) 100%);
	-webkit-font-smoothing: antialiased;
}

::selection {
	background: rgba(59, 167, 214, 0.28);
	color: var(--dh-ink);
}

a {
	color: var(--dh-sky-deep);
	text-decoration-thickness: 0.08em;
	text-underline-offset: 0.18em;
}

a:hover {
	color: var(--dh-ink);
}

img {
	max-width: 100%;
	height: auto;
	display: block;
}

.dh-skip {
	position: absolute;
	left: -999px;
	top: 0;
	background: #fff;
	padding: 0.6rem 1rem;
	z-index: 1000;
}

.dh-skip:focus {
	left: 0.75rem;
	top: 0.75rem;
}

/* Top bar */
.dh-topbar {
	position: sticky;
	top: 0;
	z-index: 50;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
	padding: 0.7rem 1.25rem;
	background: rgba(247, 250, 252, 0.82);
	backdrop-filter: blur(12px);
	border-bottom: 1px solid var(--dh-line);
}

.dh-brand-link {
	display: inline-flex;
	align-items: center;
	gap: 0.75rem;
	color: inherit;
	text-decoration: none;
	min-width: 0;
}

.dh-brand-link img {
	width: 42px;
	height: 42px;
	object-fit: contain;
	flex-shrink: 0;
}

.dh-brand-text {
	display: flex;
	flex-direction: column;
	min-width: 0;
}

.dh-brand-text strong {
	font-family: var(--dh-font-display);
	font-weight: 700;
	font-size: 0.98rem;
	letter-spacing: 0.01em;
	line-height: 1.15;
}

.dh-brand-text span {
	font-size: 0.78rem;
	color: var(--dh-muted);
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	max-width: 42vw;
}

.dh-nav-actions {
	display: flex;
	align-items: center;
	gap: 0.55rem;
	flex-shrink: 0;
}

.dh-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.4rem;
	border: 0;
	border-radius: 999px;
	padding: 0.55rem 1.05rem;
	font-family: var(--dh-font-body);
	font-size: 0.92rem;
	font-weight: 600;
	cursor: pointer;
	text-decoration: none;
	transition: transform 0.2s cubic-bezier(0.22, 1, 0.36, 1), background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.dh-btn:hover {
	transform: translateY(-1px);
	text-decoration: none;
}

.dh-btn:focus-visible {
	outline: 2px solid var(--dh-sky);
	outline-offset: 3px;
}

.dh-btn-ghost {
	background: transparent;
	color: var(--dh-ink);
	border: 1px solid var(--dh-line);
}

.dh-btn-ghost:hover {
	background: #fff;
	color: var(--dh-ink);
}

.dh-btn-primary {
	background: var(--dh-sky);
	color: #fff;
	box-shadow: 0 10px 22px rgba(31, 127, 173, 0.28);
}

.dh-btn-primary:hover {
	background: var(--dh-sky-deep);
	color: #fff;
}

.dh-btn-ink {
	background: var(--dh-ink);
	color: #fff;
}

.dh-btn-ink:hover {
	background: var(--dh-ink-soft);
	color: #fff;
}

/* Hero — atrium */
.dh-hero {
	position: relative;
	isolation: isolate;
	overflow: hidden;
	margin: 0;
	padding: clamp(2.4rem, 6vw, 4.5rem) 1.25rem 3rem;
	color: #fff;
	background:
		linear-gradient(125deg, rgba(11, 31, 51, 0.94) 0%, rgba(20, 48, 73, 0.88) 48%, rgba(31, 127, 173, 0.55) 100%),
		radial-gradient(ellipse 80% 70% at 70% 20%, rgba(59, 167, 214, 0.35), transparent 60%),
		linear-gradient(180deg, var(--dh-ink) 0%, var(--dh-ink-soft) 100%);
}

.dh-hero::before {
	content: "";
	position: absolute;
	inset: 0;
	z-index: -1;
	background:
		linear-gradient(105deg, transparent 0%, rgba(255, 255, 255, 0.06) 42%, transparent 58%),
		linear-gradient(180deg, rgba(255, 255, 255, 0.05), transparent 55%);
	pointer-events: none;
}

.dh-hero::after {
	content: "";
	position: absolute;
	right: -8%;
	top: -20%;
	width: min(52vw, 520px);
	height: min(52vw, 520px);
	border-radius: 50%;
	background: radial-gradient(circle, rgba(59, 167, 214, 0.35), transparent 68%);
	z-index: -1;
	pointer-events: none;
	animation: dh-glow-pulse 7s ease-in-out infinite;
}

@keyframes dh-glow-pulse {
	0%, 100% { opacity: 0.7; transform: scale(1); }
	50% { opacity: 1; transform: scale(1.06); }
}

.dh-hero-inner {
	width: min(1100px, 100%);
	margin: 0 auto;
	display: grid;
	gap: 1.4rem;
	justify-items: start;
}

.dh-hero-brand {
	display: flex;
	align-items: center;
	gap: 0.9rem;
	animation: dh-rise 0.7s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.dh-hero-brand img {
	width: clamp(64px, 10vw, 88px);
	height: clamp(64px, 10vw, 88px);
	object-fit: contain;
	filter: drop-shadow(0 12px 24px rgba(0, 0, 0, 0.35));
}

.dh-hero h1 {
	margin: 0;
	font-family: var(--dh-font-display);
	font-weight: 700;
	font-size: clamp(2rem, 5.2vw, 3.35rem);
	line-height: 1.08;
	letter-spacing: -0.03em;
	max-width: 14ch;
	animation: dh-rise 0.75s 0.06s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.dh-hero-lead {
	margin: 0;
	max-width: 38ch;
	font-size: clamp(1.02rem, 2.2vw, 1.2rem);
	color: rgba(255, 255, 255, 0.86);
	animation: dh-rise 0.75s 0.12s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.dh-search {
	display: flex;
	width: min(560px, 100%);
	gap: 0.55rem;
	padding: 0.4rem;
	border-radius: 999px;
	background: rgba(255, 255, 255, 0.12);
	border: 1px solid rgba(255, 255, 255, 0.22);
	backdrop-filter: blur(8px);
	box-shadow: var(--dh-shadow);
	animation: dh-rise 0.8s 0.18s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.dh-search input[type="text"] {
	flex: 1;
	min-width: 0;
	border: 0;
	background: transparent;
	color: #fff;
	font: inherit;
	padding: 0.65rem 1rem;
	outline: none;
}

.dh-search input::placeholder {
	color: rgba(255, 255, 255, 0.62);
}

.dh-search .dh-btn {
	flex-shrink: 0;
}

@keyframes dh-rise {
	from {
		opacity: 0;
		transform: translateY(16px);
		filter: blur(4px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
		filter: blur(0);
	}
}

@media (prefers-reduced-motion: reduce) {
	.dh-hero::after,
	.dh-hero-brand,
	.dh-hero h1,
	.dh-hero-lead,
	.dh-search,
	.dh-book {
		animation: none !important;
	}
}

/* Main */
.dh-main {
	width: min(1100px, calc(100% - 2rem));
	margin: -1.5rem auto 0;
	position: relative;
	z-index: 2;
	padding-bottom: 3.5rem;
}

.dh-panel {
	background: #fff;
	border: 1px solid var(--dh-line);
	border-radius: calc(var(--dh-radius) + 4px);
	box-shadow: var(--dh-shadow);
	padding: clamp(1.25rem, 3vw, 1.85rem);
}

.dh-section-head {
	display: flex;
	flex-wrap: wrap;
	align-items: end;
	justify-content: space-between;
	gap: 0.75rem 1.25rem;
	margin-bottom: 1.35rem;
}

.dh-section-head h2 {
	margin: 0;
	font-family: var(--dh-font-display);
	font-size: clamp(1.35rem, 3vw, 1.75rem);
	letter-spacing: -0.02em;
	line-height: 1.2;
}

.dh-section-head p {
	margin: 0.35rem 0 0;
	color: var(--dh-muted);
	font-size: 0.95rem;
}

/* Book grid — collection as exhibit */
.dh-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
	gap: 1.15rem;
}

.dh-book {
	display: flex;
	flex-direction: column;
	gap: 0.7rem;
	color: inherit;
	text-decoration: none;
	border-radius: var(--dh-radius);
	padding: 0.55rem;
	margin: -0.55rem;
	transition: transform 0.25s cubic-bezier(0.22, 1, 0.36, 1), background 0.2s ease;
	animation: dh-rise 0.65s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.dh-book:nth-child(1) { animation-delay: 0.05s; }
.dh-book:nth-child(2) { animation-delay: 0.09s; }
.dh-book:nth-child(3) { animation-delay: 0.13s; }
.dh-book:nth-child(4) { animation-delay: 0.17s; }
.dh-book:nth-child(5) { animation-delay: 0.21s; }
.dh-book:nth-child(6) { animation-delay: 0.25s; }

.dh-book:hover {
	transform: translateY(-4px);
	background: rgba(59, 167, 214, 0.06);
	text-decoration: none;
	color: inherit;
}

.dh-book:focus-visible {
	outline: 2px solid var(--dh-sky);
	outline-offset: 3px;
}

.dh-cover {
	aspect-ratio: 3 / 4;
	border-radius: 10px;
	overflow: hidden;
	background: linear-gradient(160deg, #d5e4ef, #f0f5f9);
	box-shadow: 0 12px 28px rgba(11, 31, 51, 0.14);
	border: 1px solid rgba(11, 31, 51, 0.06);
}

.dh-cover img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

.dh-book:hover .dh-cover img {
	transform: scale(1.04);
}

.dh-book-meta {
	display: grid;
	gap: 0.25rem;
	padding: 0 0.15rem 0.35rem;
}

.dh-book-title {
	font-family: var(--dh-font-display);
	font-weight: 650;
	font-size: 0.95rem;
	line-height: 1.25;
	letter-spacing: -0.015em;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.dh-book-sub {
	font-size: 0.82rem;
	color: var(--dh-muted);
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.dh-badge {
	display: inline-flex;
	align-items: center;
	width: fit-content;
	padding: 0.15rem 0.5rem;
	border-radius: 999px;
	font-size: 0.72rem;
	font-weight: 700;
	letter-spacing: 0.02em;
	text-transform: uppercase;
	background: rgba(59, 167, 214, 0.14);
	color: var(--dh-sky-deep);
}

.dh-badge-soft {
	background: rgba(27, 122, 74, 0.12);
	color: var(--dh-ok);
}

.dh-empty {
	text-align: center;
	padding: 2.5rem 1rem;
	color: var(--dh-muted);
}

/* Pagination */
.dh-pagination {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 0.35rem;
	margin-top: 1.75rem;
}

.dh-pagination a,
.dh-pagination strong {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 2.35rem;
	height: 2.35rem;
	padding: 0 0.65rem;
	border-radius: 10px;
	font-weight: 600;
	font-size: 0.9rem;
	text-decoration: none;
	border: 1px solid var(--dh-line);
	color: var(--dh-ink);
	background: #fff;
}

.dh-pagination strong,
.dh-pagination a:hover {
	background: var(--dh-ink);
	border-color: var(--dh-ink);
	color: #fff;
}

/* Detail */
.dh-detail {
	display: grid;
	grid-template-columns: minmax(180px, 280px) 1fr;
	gap: clamp(1.25rem, 4vw, 2.5rem);
	align-items: start;
}

.dh-detail-cover {
	border-radius: 12px;
	overflow: hidden;
	box-shadow: var(--dh-shadow);
	background: var(--dh-mist);
}

.dh-detail-cover img {
	width: 100%;
	aspect-ratio: 3 / 4;
	object-fit: cover;
}

.dh-detail h1 {
	margin: 0 0 0.5rem;
	font-family: var(--dh-font-display);
	font-size: clamp(1.45rem, 3.5vw, 2rem);
	letter-spacing: -0.025em;
	line-height: 1.15;
}

.dh-dl {
	display: grid;
	gap: 0.65rem;
	margin: 1.25rem 0 0;
}

.dh-dl div {
	display: grid;
	grid-template-columns: 8.5rem 1fr;
	gap: 0.75rem;
	padding-bottom: 0.65rem;
	border-bottom: 1px solid var(--dh-line);
	font-size: 0.98rem;
}

.dh-dl dt {
	margin: 0;
	color: var(--dh-muted);
	font-weight: 600;
}

.dh-dl dd {
	margin: 0;
	color: var(--dh-ink);
}

.dh-abstract {
	margin-top: 1.25rem;
	padding: 1rem 1.1rem;
	border-radius: 12px;
	background: var(--dh-mist);
	color: var(--dh-ink);
}

.dh-abstract strong {
	display: block;
	margin-bottom: 0.35rem;
	font-family: var(--dh-font-display);
}

.dh-detail-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 0.55rem;
	margin-top: 1.35rem;
}

@media (max-width: 720px) {
	.dh-detail {
		grid-template-columns: 1fr;
	}

	.dh-detail-cover {
		max-width: 240px;
		margin: 0 auto;
	}

	.dh-dl div {
		grid-template-columns: 1fr;
		gap: 0.2rem;
	}

	.dh-search {
		flex-direction: column;
		border-radius: 18px;
	}

	.dh-search .dh-btn {
		width: 100%;
	}

	.dh-brand-text span {
		display: none;
	}
}

/* Footer */
.dh-footer {
	margin-top: auto;
	padding: 1.75rem 1.25rem 2.25rem;
	text-align: center;
	color: var(--dh-muted);
	font-size: 0.88rem;
}

.dh-footer strong {
	color: var(--dh-ink);
	font-family: var(--dh-font-display);
}
