/* ==========================================================================
   Rule 34 hub — scoped under .r34-hub / .r34-single to avoid leaking styles.
   Booru-style masonry, media-type aware cards, dark-mode aware.
   ========================================================================== */

.r34-hub, .r34-single {
	--r34-accent: #ff2d6b;
	--r34-accent2: #7c3aed;
	--r34-radius: 12px;
	--r34-gap: 14px;
	max-width: 1320px;
	margin: 0 auto;
	padding: 8px 6px 40px;
}

/* ---- Header / intro ---- */
.r34-breadcrumb { font-size: .82rem; opacity: .6; margin-bottom: .5rem; }
.r34-breadcrumb a { color: inherit; text-decoration: none; }
.r34-breadcrumb span { margin: 0 .35rem; }
.r34-title {
	font-size: clamp(1.5rem, 3vw, 2.25rem);
	font-weight: 800; line-height: 1.15; margin: 0 0 .5rem;
	background: linear-gradient(90deg, var(--r34-accent), var(--r34-accent2));
	-webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.r34-intro { font-size: .98rem; opacity: .82; max-width: 70ch; margin: 0 0 1.2rem; }

/* ---- Section heads ---- */
.r34-section-head { display: flex; align-items: baseline; gap: .6rem; margin: 1.4rem 0 .8rem; }
.r34-section-title { font-size: 1.25rem; font-weight: 700; margin: 0; }
.r34-section-sub { font-size: .85rem; opacity: .6; }

/* ---- Day nav / type tabs / chips ---- */
.r34-days, .r34-types { display: flex; flex-wrap: wrap; gap: .45rem; margin: 0 0 1rem; }
.r34-day, .r34-type, .r34-chip {
	cursor: pointer; border: 1px solid rgba(128,128,128,.28);
	background: transparent; color: inherit;
	padding: .42rem .85rem; border-radius: 999px; font-size: .85rem; font-weight: 600;
	transition: all .15s ease; line-height: 1; white-space: nowrap;
}
.r34-day:hover, .r34-type:hover, .r34-chip:hover { border-color: var(--r34-accent); color: var(--r34-accent); }
.r34-day.is-active, .r34-type.is-active {
	background: linear-gradient(90deg, var(--r34-accent), var(--r34-accent2));
	border-color: transparent; color: #fff;
}
.r34-chip.is-active { background: var(--r34-accent); border-color: transparent; color: #fff; }
.r34-day--all { margin-left: auto; }

.r34-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem; margin: 0 0 1rem; }
.r34-field { display: inline-flex; align-items: center; gap: .4rem; font-size: .8rem; }
.r34-field__label { opacity: .6; font-weight: 600; }
.r34-sort {
	padding: .42rem .7rem; border-radius: 8px; border: 1px solid rgba(128,128,128,.3);
	background: transparent; color: inherit; font-size: .85rem; cursor: pointer;
}
.r34-chips { display: flex; flex-wrap: wrap; gap: .4rem; margin: 0 0 1.2rem; }

.r34-status { font-size: .82rem; opacity: .6; min-height: 1em; margin-bottom: .4rem; }
.r34-status.is-loading::before { content: "Loading…"; }

/* ---- Masonry grid (CSS columns) ---- */
.r34-grid {
	column-gap: var(--r34-gap);
	column-width: 220px;
}
.r34-grid--hero { column-width: 260px; }
@media (max-width: 600px) { .r34-grid { column-width: 46vw; --r34-gap: 10px; } }

.r34-card {
	break-inside: avoid;
	margin: 0 0 var(--r34-gap);
	border-radius: var(--r34-radius);
	overflow: hidden;
	background: rgba(128,128,128,.08);
	box-shadow: 0 1px 3px rgba(0,0,0,.18);
	transition: transform .18s ease, box-shadow .18s ease;
}
.r34-card:hover { transform: translateY(-3px); box-shadow: 0 8px 22px rgba(0,0,0,.3); }
.r34-card__link { display: block; color: inherit; text-decoration: none; }
/* Fixed aspect-ratio box (ratio set inline per card). ALL media is absolutely
   filled so adding a hover preview never changes layout -> no masonry reflow,
   no hover flicker. */
.r34-card__media { position: relative; width: 100%; background: #111; line-height: 0; overflow: hidden; }
.r34-card__img, .r34-card__media .r34-hover-media {
	position: absolute; inset: 0; width: 100%; height: 100%;
	object-fit: cover; display: block;
}
.r34-card__media .r34-hover-media {
	z-index: 1; opacity: 0; transition: opacity .18s ease;
}
.r34-card__media.is-hovering .r34-hover-media { opacity: 1; }
.r34-card__title {
	font-size: .8rem; font-weight: 600; margin: 0; padding: .5rem .6rem .6rem;
	line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
	overflow: hidden;
}

/* badges + score overlay */
.r34-badge {
	position: absolute; top: 8px; left: 8px; z-index: 2;
	font-size: .68rem; font-weight: 800; letter-spacing: .03em;
	padding: .2rem .45rem; border-radius: 6px; color: #fff;
	background: rgba(0,0,0,.66); backdrop-filter: blur(3px);
}
.r34-badge--video { background: rgba(255,45,107,.92); padding: .15rem .5rem; font-size: .85rem; }
.r34-badge--gif { background: rgba(124,58,237,.92); }
.r34-card__score {
	position: absolute; bottom: 8px; right: 8px; z-index: 2;
	font-size: .72rem; font-weight: 700; color: #fff;
	padding: .15rem .45rem; border-radius: 6px; background: rgba(0,0,0,.6);
}
.r34-card__score .fa-fire, .r34-card__score .fas { color: #ff7a3d; }

/* ---- Pagination (reuses .ch-pagination markup from the hub helper) ---- */
.r34-pagination-wrap, .r34-hub .ch-pagination, .r34-hub .pagination,
.page-template .r34-pagination-wrap .page-numbers { margin-top: 1.6rem; }
.ch-pagination, .r34-pagination-wrap > .page-numbers { display: flex; }
.r34-pagination-wrap { display: flex; justify-content: center; flex-wrap: wrap; gap: .35rem; }
.ch-page, .r34-pagination-wrap .page-numbers {
	cursor: pointer; min-width: 38px; height: 38px; padding: 0 .5rem;
	display: inline-flex; align-items: center; justify-content: center;
	border: 1px solid rgba(128,128,128,.3); background: transparent; color: inherit;
	border-radius: 8px; font-weight: 600; font-size: .85rem; text-decoration: none;
}
.ch-page:hover, .r34-pagination-wrap a.page-numbers:hover { border-color: var(--r34-accent); color: var(--r34-accent); }
.ch-page.is-current, .r34-pagination-wrap .page-numbers.current {
	background: var(--r34-accent); border-color: transparent; color: #fff;
}
.ch-page-gap { display: inline-flex; align-items: center; padding: 0 .25rem; opacity: .5; }

.r34-empty { opacity: .6; padding: 2rem 0; text-align: center; }

/* ---- Single ---- */
.r34-single__title { font-size: clamp(1.3rem, 2.6vw, 2rem); font-weight: 800; margin: .4rem 0 1rem; }
.r34-single__stage {
	display: flex; justify-content: center; background: #0c0c0c;
	border-radius: var(--r34-radius); overflow: hidden; margin-bottom: 1rem;
}
.r34-single__img, .r34-single__video {
	max-width: 100%; max-height: 82vh; width: auto; height: auto; display: block;
}
.r34-single__imglink { display: block; line-height: 0; max-width: 100%; }
.r34-single__meta { display: flex; flex-wrap: wrap; gap: 1rem; font-size: .85rem; opacity: .8; margin-bottom: 1rem; }
.r34-single__score .fa-fire, .r34-single__score .fas { color: #ff7a3d; }
.r34-single__type { padding: .1rem .5rem; border-radius: 6px; background: var(--r34-accent); color: #fff; font-weight: 700; }

.r34-single__tags { margin: 1.2rem 0; }
.r34-taxrow { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; margin-bottom: .6rem; }
.r34-taxrow__label { font-weight: 700; font-size: .82rem; opacity: .7; margin-right: .2rem; }
.r34-tagpill {
	font-size: .8rem; padding: .28rem .6rem; border-radius: 999px; text-decoration: none;
	border: 1px solid rgba(128,128,128,.28); color: inherit; transition: all .15s ease;
}
.r34-tagpill:hover { border-color: var(--r34-accent); color: var(--r34-accent); }
.r34-related { margin-top: 2rem; }
.r34-related .r34-section-title { margin-bottom: .9rem; }

/* ---- Dark mode parity (theme toggles body.dark) ---- */
body.dark .r34-card { background: rgba(255,255,255,.05); }
body.dark .r34-sort, body.dark .r34-day, body.dark .r34-type, body.dark .r34-chip, body.dark .r34-tagpill { border-color: rgba(255,255,255,.18); }

/* ---- a11y ---- */
.r34-card__link:focus-visible, .r34-day:focus-visible, .r34-type:focus-visible,
.r34-chip:focus-visible, .ch-page:focus-visible, .r34-tagpill:focus-visible {
	outline: 2px solid var(--r34-accent); outline-offset: 2px;
}
