/* HeartStrings — eBook archive & single styles */
:root {
	--hs-primary: #c1373d;
	--hs-primary-dark: #9d2a30;
	--hs-ink: #1a1a1f;
	--hs-muted: #6b6b76;
	--hs-line: #e9e9ee;
	--hs-bg: #fafafb;
	--hs-card-bg: #ffffff;
	--hs-shadow-sm: 0 1px 2px rgba(20,20,30,.04), 0 1px 3px rgba(20,20,30,.05);
	--hs-shadow-md: 0 4px 12px rgba(20,20,30,.06), 0 2px 4px rgba(20,20,30,.04);
	--hs-shadow-lg: 0 24px 48px rgba(20,20,30,.10), 0 8px 16px rgba(20,20,30,.06);
	--hs-radius: 14px;
}

.hs-wrap { max-width: 1180px; margin: 0 auto; padding: 0 24px; }

/* ===================== ARCHIVE ===================== */
.hs-ebooks-archive { background: var(--hs-bg); padding: 60px 0 80px; }

.hs-hero { text-align: center; max-width: 720px; margin: 0 auto 48px; }
.hs-hero .hs-eyebrow {
	display: inline-block; font-size: .8rem; font-weight: 700; letter-spacing: .12em;
	text-transform: uppercase; color: var(--hs-primary); background: rgba(193,55,61,.08);
	padding: 6px 14px; border-radius: 100px; margin-bottom: 18px;
}
.hs-hero h1 { font-size: clamp(2rem, 4vw, 3rem); line-height: 1.15; margin: 0 0 16px; color: var(--hs-ink); letter-spacing: -.02em; }
.hs-hero p { font-size: 1.1rem; line-height: 1.6; color: var(--hs-muted); margin: 0; }

/* Search */
.hs-search { max-width: 540px; margin: 28px auto 0; position: relative; }
.hs-search input {
	width: 100%; padding: 14px 18px 14px 46px; border: 1px solid var(--hs-line);
	border-radius: 100px; font-size: 1rem; background: #fff; outline: none;
	transition: border-color .15s, box-shadow .15s;
}
.hs-search input:focus { border-color: var(--hs-primary); box-shadow: 0 0 0 4px rgba(193,55,61,.10); }
.hs-search svg { position: absolute; left: 18px; top: 50%; transform: translateY(-50%); color: var(--hs-muted); }

/* Featured */
.hs-featured {
	display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr); gap: 36px;
	background: linear-gradient(135deg, #fff 0%, #fff7f7 100%);
	border: 1px solid var(--hs-line); border-radius: var(--hs-radius);
	padding: 36px; margin-bottom: 56px; align-items: center;
	box-shadow: var(--hs-shadow-md);
}
.hs-featured__cover {
	position: relative;
	aspect-ratio: 3/4; background: #f1f1f5;
	border-radius: 10px; box-shadow: var(--hs-shadow-lg);
	overflow: hidden;
}
.hs-featured__cover svg, .hs-featured__cover img { display: block; width: 100%; height: 100%; }
.hs-featured__body .hs-tag { display:inline-block; font-size:.75rem; font-weight:700; letter-spacing:.1em; text-transform:uppercase; color: var(--hs-primary); margin-bottom: 14px; }
.hs-featured__body h2 { font-size: clamp(1.5rem, 2.2vw, 2.1rem); line-height: 1.2; margin: 0 0 14px; color: var(--hs-ink); letter-spacing: -.01em; }
.hs-featured__body .hs-meta { color: var(--hs-muted); font-size: .92rem; margin: 0 0 16px; }
.hs-featured__body .hs-excerpt { color: #3a3a44; font-size: 1.02rem; line-height: 1.65; margin: 0 0 24px; }

/* Grid */
.hs-section-title {
	display: flex; align-items: baseline; justify-content: space-between;
	margin-bottom: 24px; padding-bottom: 14px; border-bottom: 1px solid var(--hs-line);
}
.hs-section-title h3 { font-size: 1.2rem; margin: 0; color: var(--hs-ink); letter-spacing: -.005em; }
.hs-section-title .hs-count { font-size: .88rem; color: var(--hs-muted); }

.hs-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 28px; }

.hs-card {
	background: var(--hs-card-bg); border: 1px solid var(--hs-line); border-radius: var(--hs-radius);
	overflow: hidden; display: flex; flex-direction: column;
	box-shadow: var(--hs-shadow-sm);
	transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.hs-card:hover { transform: translateY(-4px); box-shadow: var(--hs-shadow-lg); border-color: #ddd; }
.hs-card__cover {
	position: relative;
	aspect-ratio: 3/4; background: #f1f1f5;
	display: block; overflow: hidden;
	border-bottom: 1px solid var(--hs-line);
}
.hs-card__cover svg, .hs-card__cover img { display: block; width: 100%; height: 100%; }

/* Price pill — pinned corner of cover */
.hs-price-pill {
	position: absolute; top: 12px; right: 12px;
	z-index: 2;
	display: inline-flex; align-items: center;
	padding: 6px 12px;
	background: rgba(255,255,255,.96);
	color: var(--hs-ink);
	border-radius: 100px;
	font: 700 .82rem/1 -apple-system, system-ui, sans-serif;
	font-variant-numeric: tabular-nums;
	box-shadow: 0 2px 6px rgba(0,0,0,.10), 0 1px 2px rgba(0,0,0,.06);
	backdrop-filter: saturate(180%) blur(4px);
}
.hs-price-pill--free {
	background: #0a7d2c; color: #fff;
}
.hs-card__body { padding: 18px 20px 20px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.hs-card__title { font-size: 1.05rem; line-height: 1.35; margin: 0; }
.hs-card__title a { color: var(--hs-ink); text-decoration: none; }
.hs-card__title a:hover { color: var(--hs-primary); }
.hs-card__meta { font-size: .82rem; color: var(--hs-muted); display: flex; gap: 8px; align-items: center; }
.hs-card__meta .dot { width: 3px; height: 3px; background: var(--hs-muted); border-radius: 50%; opacity: .5; }
.hs-card__excerpt { font-size: .92rem; line-height: 1.55; color: #4a4a55; margin: 0; flex: 1; }
.hs-card__cta {
	margin-top: 6px; align-self: flex-start; display: inline-flex; align-items: center; gap: 6px;
	color: var(--hs-primary); font-weight: 600; font-size: .9rem; text-decoration: none;
}
.hs-card__cta:hover { color: var(--hs-primary-dark); }
.hs-card__cta::after { content: "→"; transition: transform .15s; }
.hs-card__cta:hover::after { transform: translateX(3px); }

.hs-empty { text-align: center; padding: 80px 20px; color: var(--hs-muted); }

/* Pagination */
.hs-pagination { margin-top: 48px; display: flex; justify-content: center; }
.hs-pagination .nav-links { display: flex; gap: 8px; }
.hs-pagination a, .hs-pagination span {
	padding: 10px 14px; border-radius: 8px; border: 1px solid var(--hs-line);
	background: #fff; color: var(--hs-ink); text-decoration: none; font-size: .9rem;
}
.hs-pagination .current { background: var(--hs-primary); color: #fff; border-color: var(--hs-primary); }
.hs-pagination a:hover { border-color: var(--hs-primary); color: var(--hs-primary); }

/* ===================== SINGLE ===================== */
.hs-ebook-single { padding: 50px 0 80px; background: var(--hs-bg); }

.hs-back { font-size: .9rem; color: var(--hs-muted); text-decoration: none; display: inline-flex; align-items: center; gap: 6px; margin-bottom: 24px; }
.hs-back:hover { color: var(--hs-primary); }

.hs-single-grid { display: grid; grid-template-columns: minmax(0, 320px) minmax(0, 1fr); gap: 48px; align-items: start; }

.hs-sidebar { position: sticky; top: 24px; }
.hs-sidebar__cover {
	position: relative;
	aspect-ratio: 3/4; background: #f1f1f5; border-radius: 12px;
	box-shadow: var(--hs-shadow-lg); margin-bottom: 22px;
	overflow: hidden;
}
.hs-sidebar__cover svg, .hs-sidebar__cover img { display: block; width: 100%; height: 100%; }
.hs-btn {
	display: flex; align-items: center; justify-content: center; gap: 10px;
	background: var(--hs-primary); color: #fff; padding: 14px 22px; border-radius: 10px;
	text-decoration: none; font-weight: 700; font-size: 1rem; width: 100%; box-sizing: border-box;
	transition: background .15s, transform .1s;
	border: 0; cursor: pointer;
}
.hs-btn:hover { background: var(--hs-primary-dark); }
.hs-btn:active { transform: scale(.98); }
.hs-btn--ghost { background: #fff; color: var(--hs-primary); border: 1.5px solid var(--hs-primary); }
.hs-btn--ghost:hover { background: var(--hs-primary); color: #fff; }

.hs-meta-list { margin: 24px 0 0; padding: 20px; background: #fff; border: 1px solid var(--hs-line); border-radius: 10px; }
.hs-meta-list dt { font-size: .78rem; text-transform: uppercase; letter-spacing: .08em; color: var(--hs-muted); margin: 0; }
.hs-meta-list dd { margin: 4px 0 14px; font-size: .98rem; color: var(--hs-ink); font-weight: 500; }
.hs-meta-list dd:last-child { margin-bottom: 0; }

.hs-main h1 { font-size: clamp(1.8rem, 3vw, 2.6rem); line-height: 1.15; margin: 0 0 18px; color: var(--hs-ink); letter-spacing: -.02em; }
.hs-main .hs-lede { color: var(--hs-muted); font-size: 1.1rem; line-height: 1.6; margin: 0 0 28px; }
.hs-main .hs-content { color: #2a2a35; font-size: 1.05rem; line-height: 1.7; }
.hs-main .hs-content p { margin: 0 0 18px; }

.hs-preview { margin-top: 40px; }
.hs-preview h2 { font-size: 1.3rem; margin: 0 0 14px; color: var(--hs-ink); }
.hs-preview__frame {
	border: 1px solid var(--hs-line); border-radius: 12px; overflow: hidden;
	background: #2a2a35; box-shadow: var(--hs-shadow-md);
}
.hs-preview__frame iframe { width: 100%; height: 760px; border: 0; display: block; }
.hs-preview__note { font-size: .85rem; color: var(--hs-muted); margin-top: 10px; }
.hs-preview__note a { color: var(--hs-primary); }

/* ===================== RESPONSIVE ===================== */
@media (max-width: 900px) {
	.hs-featured { grid-template-columns: 1fr; padding: 24px; }
	.hs-featured__cover { max-width: 240px; margin: 0 auto; }
	.hs-single-grid { grid-template-columns: 1fr; }
	.hs-sidebar { position: static; max-width: 360px; margin: 0 auto; }
	.hs-preview__frame iframe { height: 560px; }
}
@media (max-width: 520px) {
	.hs-grid { grid-template-columns: repeat(2, 1fr); gap: 16px; }
	.hs-card__body { padding: 14px 14px 16px; }
	.hs-card__title { font-size: .95rem; }
	.hs-card__excerpt { display: none; }
}
