/*
 * Comicbook Theme — Supplemental CSS
 *
 * theme.json is the single source of truth for all design tokens.
 * This file contains ONLY rules theme.json cannot express:
 * hover/focus transitions, pseudo-element textures, sticky positioning,
 * and custom block style variants.
 * Every value references a CSS custom property generated from theme.json.
 */

/* ── Global: Enforce 0 px radius everywhere ─────────────────────────────── */

:root {
	--wp--custom--radius: 0px;
}

img,
.wp-block-image img,
.wp-block-post-featured-image img,
.wp-block-avatar img,
.wp-block-cover img,
input,
textarea,
select,
.wp-block-button__link,
.wp-element-button {
	border-radius: 0 !important;
}

/* ── Sticky header ───────────────────────────────────────────────────────── */

header.wp-block-template-part {
	position: sticky;
	top: 0;
	z-index: 100;
	box-shadow: 4px 4px 0 var(--wp--preset--color--on-background);
}

.comicbook-nav-wrapper {
	height: 5rem;
	display: flex;
	align-items: center;
	padding-left: var(--wp--preset--spacing--6) !important;
	padding-right: var(--wp--preset--spacing--6) !important;
}
.comicbook-nav-wrapper > .wp-block-group {
	width: 100%;
	max-width: 100% !important;
}

/* ── Navigation links: translate hover ──────────────────────────────────── */

.wp-block-navigation a {
	display: inline-block;
	transition: transform 80ms linear;
	color: var(--wp--preset--color--secondary) !important;
}

.wp-block-navigation a:hover {
	transform: translate(-1px, -1px);
	color: var(--wp--preset--color--primary) !important;
}

.wp-block-navigation .current-menu-item > a {
	color: var(--wp--preset--color--primary) !important;
	text-decoration: underline;
	text-decoration-thickness: 4px;
	text-underline-offset: 4px;
}

.wp-block-navigation ul {
	list-style: none;
	margin: 0;
	padding: 0;
}

/* ── Specific Nav Subscribe Button ── */
.nav-subscribe-button .wp-block-button__link {
	box-shadow: 2px 2px 0 var(--wp--preset--color--on-background);
}
.nav-subscribe-button .wp-block-button__link:hover {
	transform: translate(-1px, -1px);
	box-shadow: 3px 3px 0 var(--wp--preset--color--on-background);
}
.nav-subscribe-button .wp-block-button__link:active {
	transform: translate(0, 0);
	box-shadow: 2px 2px 0 var(--wp--preset--color--on-background);
}

/* ── Buttons: transition + Block Shadow hover ────────────────────────────── */

.wp-block-button__link,
.wp-element-button {
	transition: transform 80ms linear, box-shadow 80ms linear;
	border-radius: 0 !important;
}

.wp-block-button__link:hover,
.wp-element-button:hover {
	transform: translate(-2px, -2px);
	box-shadow: 4px 4px 0 var(--wp--preset--color--on-background);
}

/* ── Comic panel style (heavier — matches Stitch card treatment) ─────────── */
/* Apply .is-style-comic-panel to any group or column block */
/* Updated to 6px border for home page mockup alignment */

.is-style-comic-panel {
	border: 6px solid var(--wp--preset--color--on-background) !important;
	box-shadow: 4px 4px 0 var(--wp--preset--color--on-background);
	border-radius: 0 !important;
	transition: transform 80ms linear, box-shadow 80ms linear;
}

.is-style-comic-panel:hover {
	transform: translate(-1px, -1px);
	box-shadow: 6px 6px 0 var(--wp--preset--color--on-background);
}

/* ── Halftone grain overlays ─────────────────────────────────────────────── */
/* Generic: applied to colored section panels */

.is-style-halftone {
	position: relative;
	isolation: isolate;
}

.is-style-halftone::after {
	content: '';
	position: absolute;
	inset: 0;
	z-index: 0;
	pointer-events: none;
	background-image: radial-gradient(
		circle,
		currentColor 1px,
		transparent 1px
	);
	background-size: 6px 6px;
	opacity: 0.12;
	border-radius: 0;
}

/* Ensure inner content sits above the halftone layer */
.is-style-halftone > * {
	position: relative;
	z-index: 1;
}

/* Auto halftone on primary-container and secondary-container blocks */
.has-primary-container-background-color,
.has-secondary-container-background-color {
	position: relative;
	isolation: isolate;
}

.has-primary-container-background-color::after,
.has-secondary-container-background-color::after {
	content: '';
	position: absolute;
	inset: 0;
	z-index: 0;
	pointer-events: none;
	background-image: radial-gradient(
		circle,
		var(--wp--preset--color--on-background) 0.8px,
		transparent 0.8px
	);
	background-size: 6px 6px;
	opacity: 0.08;
}

.has-primary-container-background-color > *,
.has-secondary-container-background-color > * {
	position: relative;
	z-index: 1;
}

/* ── Action lines: diagonal texture (product hero, special panels) ───────── */

.is-style-action-lines {
	background-image: repeating-linear-gradient(
		45deg,
		transparent,
		transparent 10px,
		rgba(0, 0, 0, 0.03) 10px,
		rgba(0, 0, 0, 0.03) 11px
	);
}

/* ── Speech bubble (dialogue pull-quote) ─────────────────────────────────── */
/* Apply .is-style-speech-bubble to a core/quote or core/group block */

.is-style-speech-bubble {
	position: relative;
	border: 3px solid var(--wp--preset--color--on-background) !important;
	background-color: var(--wp--preset--color--surface) !important;
	border-radius: 0 !important;
	margin-bottom: 1.75rem;
}

/* Outer border triangle */
.is-style-speech-bubble::before {
	content: '';
	position: absolute;
	bottom: -20px;
	left: 18px;
	border-width: 18px 18px 0;
	border-style: solid;
	border-color: var(--wp--preset--color--on-background) transparent;
	display: block;
	width: 0;
	pointer-events: none;
}

/* Inner fill triangle */
.is-style-speech-bubble::after {
	content: '';
	position: absolute;
	bottom: -14px;
	left: 21px;
	border-width: 14px 14px 0;
	border-style: solid;
	border-color: var(--wp--preset--color--surface) transparent;
	display: block;
	width: 0;
	z-index: 1;
	pointer-events: none;
}

.is-style-speech-bubble blockquote,
.is-style-speech-bubble p {
	margin: 0;
	font-style: italic;
	font-weight: 700;
	text-transform: uppercase;
	font-family: var(--wp--preset--font-family--epilogue);
	line-height: 1.3;
	color: var(--wp--preset--color--on-background);
}

/* ── Caption Box (tertiary container with downward tail) ─────────────────── */
/* Apply .is-style-caption-box to a core/group block */

.wp-block-group.is-style-caption-box {
	position: relative;
	background-color: var(--wp--preset--color--tertiary-container) !important;
	border: 2px solid var(--wp--preset--color--on-background) !important;
	border-radius: 0 !important;
	margin-bottom: 1.75rem;
}

.wp-block-group.is-style-caption-box::after {
	content: '';
	position: absolute;
	bottom: -14px;
	left: 28px;
	width: 0;
	height: 0;
	border-left: 10px solid transparent;
	border-right: 10px solid transparent;
	border-top: 12px solid var(--wp--preset--color--on-background);
	pointer-events: none;
}

.wp-block-group.is-style-caption-box::before {
	content: '';
	position: absolute;
	bottom: -10px;
	left: 30px;
	z-index: 1;
	width: 0;
	height: 0;
	border-left: 8px solid transparent;
	border-right: 8px solid transparent;
	border-top: 10px solid var(--wp--preset--color--tertiary-container);
	pointer-events: none;
}

/* ── Skewed category badge ───────────────────────────────────────────────── */
/* Apply .is-style-skewed-badge to a paragraph or heading block */

.is-style-skewed-badge {
	display: inline-block;
	transform: skewX(-12deg);
	background-color: var(--wp--preset--color--on-background);
	color: var(--wp--preset--color--surface) !important;
	font-size: var(--wp--preset--font-size--xs) !important;
	font-weight: 700 !important;
	text-transform: uppercase !important;
	letter-spacing: 0.1em !important;
	padding: 0.2rem 0.75rem;
	font-family: var(--wp--preset--font-family--epilogue) !important;
}

/* ── Label utility ───────────────────────────────────────────────────────── */

.is-style-label,
.is-style-label p {
	font-family: var(--wp--preset--font-family--epilogue) !important;
	font-size: var(--wp--preset--font-size--xs) !important;
	font-weight: 700 !important;
	text-transform: uppercase !important;
	letter-spacing: 0.1em !important;
	color: var(--wp--preset--color--on-surface-variant) !important;
}

/* ── Comic Code Authority stamp ──────────────────────────────────────────── */
/* Apply .is-style-stamp to a core/group block */

.is-style-stamp {
	display: inline-block;
	transform: rotate(-2deg);
	border: 4px solid currentColor !important;
	font-family: var(--wp--preset--font-family--epilogue);
	font-weight: 900;
	font-style: italic;
	text-transform: uppercase;
	letter-spacing: 0.04em;
}

/* ── Grayscale image reveal on hover ─────────────────────────────────────── */
/* Apply .is-style-grayscale-reveal to a column or group containing an image */

.is-style-grayscale-reveal img,
.is-style-grayscale-reveal .wp-block-post-featured-image img,
.is-style-grayscale-reveal .wp-block-cover__image-background {
	filter: grayscale(100%) contrast(1.2);
	transition: filter 400ms ease;
}

.is-style-grayscale-reveal:hover img,
.is-style-grayscale-reveal:hover .wp-block-post-featured-image img,
.is-style-grayscale-reveal:hover .wp-block-cover__image-background {
	filter: grayscale(0%) contrast(1);
}

/* ── Hero cover: position speech bubble top, POW button bottom-right ─────── */

.hero-cover .wp-block-cover__inner-container {
	display: flex !important;
	flex-direction: column;
	justify-content: space-between;
	align-items: flex-start;
	min-height: inherit;
	padding: var(--wp--preset--spacing--8);
	box-sizing: border-box;
	width: 100%;
}

/* Hero CTA group: POW button + read label, aligned bottom-right as a unit */
.hero-cta {
	align-self: flex-end;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: var(--wp--preset--spacing--2);
}

/* POW button: rotated, oversized */
.wp-block-button.is-style-pow .wp-block-button__link {
	font-size: var(--wp--preset--font-size--4xl);
	font-weight: 900;
	font-style: italic;
	text-transform: uppercase;
	letter-spacing: -0.02em;
	padding: var(--wp--preset--spacing--6) var(--wp--preset--spacing--12);
	border: 4px solid var(--wp--preset--color--on-background) !important;
	box-shadow: 6px 6px 0 var(--wp--preset--color--on-background);
	transform: rotate(-5deg);
	display: inline-block;
}

.wp-block-button.is-style-pow .wp-block-button__link:hover {
	transform: rotate(0deg) scale(1.1);
	box-shadow: 10px 10px 0 var(--wp--preset--color--on-background);
}

/* ── Sidebar: sticky positioning ─────────────────────────────────────────── */

.sidebar-sticky {
	position: sticky;
	top: calc(5rem + var(--wp--preset--spacing--8));
}

/* ── Input / Search fields ───────────────────────────────────────────────── */

input[type="text"],
input[type="search"],
input[type="email"],
input[type="url"],
input[type="tel"],
input[type="number"],
input[type="password"],
textarea,
select {
	border: 2px solid var(--wp--preset--color--on-background) !important;
	border-radius: 0 !important;
	background-color: var(--wp--preset--color--surface-container-lowest);
	font-family: var(--wp--preset--font-family--epilogue);
	font-size: var(--wp--preset--font-size--md);
	color: var(--wp--preset--color--on-background);
	padding: 0.5rem 0.75rem;
	transition: border-color 80ms linear, background-color 80ms linear;
}

input[type="text"]:focus,
input[type="search"]:focus,
input[type="email"]:focus,
input[type="url"]:focus,
input[type="tel"]:focus,
input[type="number"]:focus,
input[type="password"]:focus,
textarea:focus,
select:focus {
	border-color: var(--wp--preset--color--primary) !important;
	background-color: var(--wp--preset--color--surface-bright);
	outline: none;
	box-shadow: none;
}

.wp-block-search__button {
	border-radius: 0 !important;
	border: 2px solid var(--wp--preset--color--on-background) !important;
	background-color: var(--wp--preset--color--secondary);
	color: var(--wp--preset--color--on-secondary);
	font-family: var(--wp--preset--font-family--epilogue);
	font-size: var(--wp--preset--font-size--sm);
	font-weight: 900;
	font-style: italic;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	padding: 0.5rem 1rem;
	cursor: pointer;
	transition: transform 80ms linear, box-shadow 80ms linear;
}

.wp-block-search__button:hover {
	transform: translate(-2px, -2px);
	box-shadow: 4px 4px 0 var(--wp--preset--color--on-background);
}

/* ── Navigation: Frosted Vellum mobile overlay ───────────────────────────── */

.wp-block-navigation__responsive-container.is-menu-open {
	background-color: color-mix(in srgb, var(--wp--preset--color--surface) 90%, transparent);
	-webkit-backdrop-filter: blur(12px);
	backdrop-filter: blur(12px);
}

/* ── Post/query pagination ───────────────────────────────────────────────── */

.wp-block-query-pagination a,
.wp-block-query-pagination-numbers a,
.wp-block-query-pagination-previous a,
.wp-block-query-pagination-next a {
	text-decoration: none;
	color: var(--wp--preset--color--on-background);
	border: 2px solid var(--wp--preset--color--on-background);
	padding: 0.25rem 0.5rem;
	font-weight: 900;
	font-style: italic;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	transition: transform 80ms linear, box-shadow 80ms linear;
	display: inline-block;
}

.wp-block-query-pagination a:hover,
.wp-block-query-pagination-numbers a:hover,
.wp-block-query-pagination-previous a:hover,
.wp-block-query-pagination-next a:hover {
	transform: translate(-2px, -2px);
	box-shadow: 4px 4px 0 var(--wp--preset--color--on-background);
}

.wp-block-query-pagination-numbers .page-numbers.current {
	border: 2px solid var(--wp--preset--color--primary);
	background-color: var(--wp--preset--color--primary);
	color: var(--wp--preset--color--on-primary);
	padding: 0.25rem 0.5rem;
	font-weight: 900;
}

/* ── Post navigation links ───────────────────────────────────────────────── */

.wp-block-post-navigation-link a {
	font-family: var(--wp--preset--font-family--epilogue);
	font-size: var(--wp--preset--font-size--sm);
	font-weight: 900;
	font-style: italic;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	text-decoration: none;
	color: var(--wp--preset--color--on-background);
	transition: color 80ms linear;
}

.wp-block-post-navigation-link a:hover {
	color: var(--wp--preset--color--primary);
}

/* ── Editorial header large type ─────────────────────────────────────────── */
/* On the blog archive editorial header, the issue label has a left border rule */

.editorial-label {
	border-left: 4px solid var(--wp--preset--color--primary);
	padding-left: var(--wp--preset--spacing--4);
	font-weight: 700;
	font-size: var(--wp--preset--font-size--md);
	line-height: 1.5;
}

/* ── Product page: spec panel icons ─────────────────────────────────────── */

.spec-panel {
	text-align: center;
}

.spec-panel .spec-value {
	font-family: var(--wp--preset--font-family--epilogue);
	font-size: var(--wp--preset--font-size--xs);
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.1em;
	color: var(--wp--preset--color--on-surface-variant);
}

/* ── Drop-cap for article body ───────────────────────────────────────────── */

.has-drop-cap > p:first-of-type::first-letter,
.article-drop-cap::first-letter {
	font-size: 5rem;
	font-weight: 900;
	font-style: italic;
	color: var(--wp--preset--color--primary);
	float: left;
	line-height: 0.8;
	margin-right: 0.15em;
	margin-top: 0.05em;
	font-family: var(--wp--preset--font-family--epilogue);
}

/* ── Remove WP default list styles in navigation ─────────────────────────── */

.wp-block-navigation ul {
	list-style: none;
	margin: 0;
	padding: 0;
}

/* ── Category cards: hover translate + middle card offset ────────────────── */

.category-card {
	transition: transform 100ms linear, box-shadow 100ms linear;
}

.category-card:hover {
	transform: translate(-1px, -1px);
}

/* Middle category card drops down to match Stitch stagger (md:translate-y-6) */
@media (min-width: 782px) {
	.category-card-mid {
		margin-top: var(--wp--preset--spacing--6);
	}
}

/* Separator between category card image area and text area */
.category-card .wp-block-cover,
.category-card .wp-block-image img {
	border-bottom: 4px solid var(--wp--preset--color--on-background);
}

/* ── Home page section spacing ───────────────────────────────────────────── */

/* Outer sections: vertical rhythm */
.home-section {
	padding-top: var(--wp--preset--spacing--12);
	padding-bottom: var(--wp--preset--spacing--12);
}
.home-section:first-child {
	padding-top: 0;
}

/* Section 1 — right editorial panel inner content */
.home-hero-right {
	padding: var(--wp--preset--spacing--12) var(--wp--preset--spacing--8);
	display: flex;
	flex-direction: column;
	gap: var(--wp--preset--spacing--6);
}

/* Section 2 — gap between heading and columns */
.home-categories {
	display: flex;
	flex-direction: column;
	gap: var(--wp--preset--spacing--6);
}

/* Category card text block padding */
.category-card-text {
	padding: var(--wp--preset--spacing--6);
	display: flex;
	flex-direction: column;
	gap: var(--wp--preset--spacing--2);
}

/* Section 3 — featured story: no gap between joined columns */
.home-featured .wp-block-columns {
	gap: 0;
}
.home-featured .wp-block-column:last-child {
	border-top: 4px solid var(--wp--preset--color--on-background);
}
@media (min-width: 782px) {
	.home-featured .wp-block-column:last-child {
		border-top: none;
		border-left: 4px solid var(--wp--preset--color--on-background);
	}
}

/* Section 3 — featured text inner padding and gap */
.home-featured-text {
	padding: var(--wp--preset--spacing--12) var(--wp--preset--spacing--8);
	display: flex;
	flex-direction: column;
	gap: var(--wp--preset--spacing--6);
}
.home-featured-quote {
	max-width: 320px;
}

/* Section 4 — news grid panel padding and gap */
.home-news-panel {
	padding: var(--wp--preset--spacing--8);
	display: flex;
	flex-direction: column;
	gap: var(--wp--preset--spacing--4);
	height: 100%;
}
.home-news-quote {
	border-left: 4px solid var(--wp--preset--color--on-background);
	padding-left: var(--wp--preset--spacing--4);
}

/* Dispatch panel hover behavior */
.has-hover-secondary.wp-block-column {
	transition: background-color 300ms ease, transform 100ms linear, box-shadow 100ms linear;
	cursor: pointer;
}
.has-hover-secondary.wp-block-column:hover {
	background-color: var(--wp--preset--color--secondary) !important;
}

/* Merch Panel expand behavior */
.merch-panel {
	position: relative;
	overflow: hidden;
}
.merch-panel::before {
	content: '';
	position: absolute;
	top: 0;
	right: 0;
	width: 3rem;
	height: 3rem;
	background-color: var(--wp--preset--color--secondary);
	background-image: radial-gradient(circle, var(--wp--preset--color--on-background) 0.8px, transparent 0.8px);
	background-size: 6px 6px;
	opacity: 0.2;
	transition: all 400ms ease-out;
	z-index: 0;
}
.merch-panel:hover::before {
	width: 100%;
	height: 100%;
}
.merch-panel > * {
	position: relative;
	z-index: 1;
}

/* Section 5 — archive heading + query spacing */
.home-archive {
	display: flex;
	flex-direction: column;
	gap: var(--wp--preset--spacing--8);
}
.home-archive-header {
	display: flex;
	flex-wrap: wrap;
	justify-content: space-between;
	align-items: flex-end;
	gap: var(--wp--preset--spacing--4);
	padding-bottom: var(--wp--preset--spacing--6);
	border-bottom: 4px solid var(--wp--preset--color--on-background);
}

/* Post card inner text padding */
.post-card-text {
	padding: var(--wp--preset--spacing--6);
	display: flex;
	flex-direction: column;
	gap: var(--wp--preset--spacing--3);
}

/* ── 6px Border variant (for mockup styling, no shadows) ────────────────────── */

.has-6px-border {
	border: 6px solid var(--wp--preset--color--on-background) !important;
	border-radius: 0 !important;
}

.has-6px-border:hover {
	transform: translate(-1px, -1px);
}

/* ── Featured images: ensure proper display and sizing ──────────────────────── */

.wp-block-post-featured-image {
	display: block;
	width: 100%;
	margin: 0;
	padding: 0;
}

.wp-block-post-featured-image img {
	display: block;
	width: 100%;
	height: auto;
	max-width: 100%;
}

/* Featured image in comic panel container */
.is-style-comic-panel .wp-block-post-featured-image {
	display: block;
	width: 100%;
}

/* Ensure alignwide featured images stretch full width of parent */
.alignwide.wp-block-post-featured-image {
	width: 100%;
}

/* ── Container Max Width Constraint ─────────────────────────────────────── */

main.wp-block-group {
	max-width: 1440px;
	margin-left: auto;
	margin-right: auto;
	width: 100%;
	padding-left: var(--wp--preset--spacing--4);
	padding-right: var(--wp--preset--spacing--4);
}
@media (min-width: 782px) {
	main.wp-block-group {
		padding-left: var(--wp--preset--spacing--8);
		padding-right: var(--wp--preset--spacing--8);
	}
}

/* ── Mobile Floating Action Button (FAB) ────────────────────────────────── */

.fab-mobile {
	position: fixed;
	bottom: 2rem;
	right: 2rem;
	z-index: 50;
}
@media (min-width: 782px) {
	.fab-mobile {
		display: none;
	}
}
.fab-button {
	width: 4rem;
	height: 4rem;
	background-color: var(--wp--preset--color--tertiary);
	border: 4px solid var(--wp--preset--color--on-background);
	border-radius: 50% !important;
	display: flex;
	align-items: center;
	justify-content: center;
	box-shadow: 4px 4px 0 var(--wp--preset--color--on-background);
	transition: transform 100ms ease, box-shadow 100ms linear;
	cursor: pointer;
	padding: 0;
}
.fab-button:active {
	transform: scale(0.95);
	box-shadow: 2px 2px 0 var(--wp--preset--color--on-background);
}

