/*
Theme Name: Battle King Press — Bibliophile's Archive
Theme URI: https://battlekingpress.com
Author: Battle King Press
Author URI: https://battlekingpress.com
Description: A quiet, scholarly block theme for Battle King Press, built from the "Bibliophile's Archive" Stitch design system — parchment surfaces, espresso ink, oxblood and forest "leather" accents, aged-brass gilding, and a Libre Caslon Text / Literata pairing. Tactile skeuomorphism meets classical editorial design.
Requires at least: 6.5
Tested up to: 7.0
Requires PHP: 7.4
Version: 1.0.2
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: bkp-bibliophile
Tags: block-theme, full-site-editing, custom-colors, editor-style, one-column
*/

/* ---------------------------------------------------------------------------
 * Tactile layer: paper grain, linen, book covers, fleurons, blind debossing.
 * Structural styling lives in theme.json; this file holds what JSON can't.
 * ------------------------------------------------------------------------ */

/* Paper grain across the whole page — a whisper of tooth, not noise */
body {
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3CfeColorMatrix values='0 0 0 0 0.11 0 0 0 0 0.08 0 0 0 0 0.05 0 0 0 0.05 0'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23g)'/%3E%3C/svg%3E");
}

/* Linen texture overlay for "leather" surfaces (buttons, book covers) */
.bkp-linen {
	position: relative;
}

.bkp-linen::before {
	content: "";
	position: absolute;
	inset: 0;
	pointer-events: none;
	border-radius: inherit;
	opacity: 0.5;
	background-image:
		repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.045) 0 1px, transparent 1px 3px),
		repeating-linear-gradient(90deg, rgba(0, 0, 0, 0.05) 0 1px, transparent 1px 3px);
}

/* Cataloging label — Literata, uppercase, generous tracking */
.bkp-label {
	font-family: var(--wp--preset--font-family--body);
	font-size: 0.75rem;
	font-weight: 600;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	color: var(--wp--preset--color--burgundy);
}

.bkp-label--muted {
	color: var(--wp--preset--color--ink-muted);
}

.bkp-label--wide {
	letter-spacing: 0.3em;
}

/* Fleuron section break: hairline rule with a centered ❧ */
.bkp-gilt-rule {
	position: relative;
	overflow: visible;
	height: auto;
	max-width: 320px;
	margin-left: auto;
	margin-right: auto;
	border: none;
	border-top: 1px solid var(--wp--preset--color--outline-soft);
}

.bkp-gilt-rule::after {
	content: "\2767";
	position: absolute;
	top: 0;
	left: 50%;
	transform: translate(-50%, -58%);
	padding: 0 0.75rem;
	background: var(--wp--preset--color--paper);
	color: var(--wp--preset--color--burgundy);
	font-size: 1.375rem;
	line-height: 1;
}

.bkp-gilt-rule--on-low::after {
	background: var(--wp--preset--color--surface-low);
}

/* Gold-foil text (use on a short span only) */
.bkp-goldfoil {
	background: linear-gradient(135deg, #C5A059 0%, #EBD9A8 45%, #D8B978 50%, #EBD9A8 55%, #C5A059 100%);
	-webkit-background-clip: text;
	background-clip: text;
	-webkit-text-fill-color: transparent;
	color: transparent;
}

/* Blind debossing: a pressed-in hairline (dark line + light highlight) */
.bkp-deboss-top {
	border-top: 1px solid var(--wp--preset--color--outline-soft);
	box-shadow: inset 0 1px 0 #FFFFFF;
}

.bkp-deboss-bottom {
	border-bottom: 1px solid var(--wp--preset--color--outline-soft);
	box-shadow: 0 1px 0 #FFFFFF;
}

/* Header hairline */
.bkp-foil-edge-bottom {
	border-bottom: 1px solid var(--wp--preset--color--outline-soft);
}

/* Red section-title underline bar */
.bkp-title-bar {
	display: block;
	width: 6rem;
	height: 3px;
	margin-top: 1rem;
	background: var(--wp--preset--color--burgundy);
	border: none;
}

/* -------------------------------------------------------------------------
 * Hero: quiet title page with faint compass-ring décor.
 * ---------------------------------------------------------------------- */

.bkp-hero-rings {
	position: relative;
	overflow: hidden;
}

.bkp-hero-rings::before,
.bkp-hero-rings::after {
	content: "";
	position: absolute;
	border: 1px solid var(--wp--preset--color--outline-soft);
	border-radius: 50%;
	pointer-events: none;
}

.bkp-hero-rings::before {
	width: 16rem;
	height: 16rem;
	top: 50%;
	left: 0;
	transform: translate(-50%, -50%);
	opacity: 0.5;
}

.bkp-hero-rings::after {
	width: 24rem;
	height: 24rem;
	bottom: -8rem;
	right: -8rem;
	opacity: 0.35;
}

/* Underlined quiet link (the mock's "Our Craftsmanship" treatment) */
.bkp-quiet-link a {
	font-family: var(--wp--preset--font-family--body);
	font-size: 0.75rem;
	font-weight: 600;
	letter-spacing: 0.15em;
	text-transform: uppercase;
	color: var(--wp--preset--color--ink);
	text-decoration: none;
	padding-bottom: 0.4rem;
	border-bottom: 1px solid var(--wp--preset--color--outline);
	transition: border-color 0.3s ease, color 0.3s ease;
}

.bkp-quiet-link a:hover {
	color: var(--wp--preset--color--burgundy);
	border-bottom-color: var(--wp--preset--color--burgundy);
}

/* -------------------------------------------------------------------------
 * Bento grid + typographic book covers (Featured Releases).
 * ---------------------------------------------------------------------- */

.bkp-bento {
	display: grid;
	grid-template-columns: repeat(12, 1fr);
	gap: 2.5rem;
}

.bkp-span-4 { grid-column: span 4; }
.bkp-span-5 { grid-column: span 5; }
.bkp-span-7 { grid-column: span 7; }
.bkp-span-8 { grid-column: span 8; }

@media (max-width: 781px) {
	.bkp-span-4, .bkp-span-5, .bkp-span-7, .bkp-span-8 {
		grid-column: span 12;
	}
}

/* A book resting on the desk */
.bkp-cover {
	position: relative;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	text-align: center;
	border-radius: 0.25rem;
	padding: 2.5rem;
	box-shadow: 10px 10px 20px rgba(0, 0, 0, 0.15), inset -2px 0 5px rgba(0, 0, 0, 0.1);
	transition: transform 0.7s cubic-bezier(0.4, 0, 0.2, 1);
}

a:hover > .bkp-cover,
.bkp-cover:hover {
	transform: translateY(-0.5rem);
}

.bkp-cover--landscape { aspect-ratio: 4 / 3; }
.bkp-cover--portrait { aspect-ratio: 3 / 4; }
.bkp-cover--square { aspect-ratio: 1 / 1; }

.bkp-cover--espresso {
	background: var(--wp--preset--color--espresso);
}

.bkp-cover--espresso .bkp-cover__frame {
	border: 12px double var(--wp--preset--color--taupe);
}

.bkp-cover--oxblood {
	background: var(--wp--preset--color--burgundy);
}

.bkp-cover--oxblood .bkp-cover__frame {
	border: 4px solid var(--wp--preset--color--burgundy-deep);
}

.bkp-cover--forest {
	background: var(--wp--preset--color--forest-deep);
}

.bkp-cover--forest .bkp-cover__frame {
	border: 1px solid var(--wp--preset--color--sage);
}

.bkp-cover__frame {
	width: 100%;
	height: 100%;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 1rem;
	padding: 2rem 1.5rem;
}

/* Cover lettering never inherits page link styling */
.bkp-cover a,
a .bkp-cover {
	text-decoration: none;
}

.bkp-cover__title {
	font-family: var(--wp--preset--font-family--display);
	font-weight: 700;
	color: #FFFFFF;
	line-height: 1.2;
	margin: 0;
}

.bkp-cover--espresso .bkp-cover__title { font-size: clamp(1.6rem, 3vw, 2.5rem); }
.bkp-cover--oxblood .bkp-cover__title { font-size: clamp(1.4rem, 2.5vw, 2rem); }
.bkp-cover--forest .bkp-cover__title { font-size: clamp(1.2rem, 2vw, 1.5rem); }

.bkp-cover__byline {
	font-family: var(--wp--preset--font-family--body);
	font-size: 0.75rem;
	font-weight: 600;
	letter-spacing: 0.15em;
	text-transform: uppercase;
	margin: 0;
}

.bkp-cover--espresso .bkp-cover__byline { color: var(--wp--preset--color--taupe); }
.bkp-cover--oxblood .bkp-cover__byline { color: #FFDADA; }
.bkp-cover--forest .bkp-cover__byline { color: var(--wp--preset--color--sage); }

.bkp-cover__rule {
	width: 4rem;
	height: 1px;
	border: none;
	margin: 0.5rem 0;
}

.bkp-cover--espresso .bkp-cover__rule { background: var(--wp--preset--color--taupe); }
.bkp-cover--oxblood .bkp-cover__rule { background: #FFDADA; }
.bkp-cover--forest .bkp-cover__rule { background: var(--wp--preset--color--sage); }

/* Meta line beneath each cover */
.bkp-cover-meta {
	margin-top: 1.5rem;
}

.bkp-cover-meta a {
	text-decoration: none;
}

.bkp-cover-meta a:hover {
	text-decoration: underline;
	text-underline-offset: 0.25em;
}

/* CTA / plate card (bookplate on the desk) */
.bkp-card {
	background: var(--wp--preset--color--surface-highest);
	border: 1px solid var(--wp--preset--color--outline-soft);
	border-radius: 0.25rem;
	transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.bkp-card:hover {
	border-color: var(--wp--preset--color--gold);
	box-shadow: 0 20px 40px -20px rgba(44, 30, 26, 0.35);
}

.bkp-fleuron {
	display: block;
	text-align: center;
	font-size: 2rem;
	line-height: 1;
	color: var(--wp--preset--color--burgundy);
}

/* -------------------------------------------------------------------------
 * Imprints section: pressed plate + Roman-numeral index.
 * ---------------------------------------------------------------------- */

.bkp-plate {
	position: relative;
	background: var(--wp--preset--color--surface-high);
	border-radius: 0.25rem;
	box-shadow: 10px 10px 20px rgba(0, 0, 0, 0.15), inset -2px 0 5px rgba(0, 0, 0, 0.1);
	display: flex;
	align-items: center;
	justify-content: center;
	aspect-ratio: 4 / 5;
	padding: 3rem;
}

.bkp-plate svg {
	width: min(60%, 16rem);
	height: auto;
	opacity: 0.9;
}

.bkp-plate__badge {
	position: absolute;
	bottom: -2rem;
	right: -1rem;
	width: 10rem;
	height: 10rem;
	background: var(--wp--preset--color--burgundy);
	border-radius: 0.25rem;
	box-shadow: 0 25px 50px -12px rgba(19, 8, 5, 0.4);
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 0.25rem;
	padding: 1rem;
	text-align: center;
}

.bkp-plate__badge > span:first-child {
	font-family: var(--wp--preset--font-family--display);
	font-style: italic;
	font-size: 2rem;
	color: #FFFFFF;
}

.bkp-plate__badge > span:last-child {
	font-size: 0.6875rem;
	font-weight: 600;
	letter-spacing: 0.2em;
	text-transform: uppercase;
	color: #FFDADA;
}

@media (max-width: 781px) {
	.bkp-plate__badge {
		right: 0.5rem;
	}
}

/* Roman-numeral index entries */
.bkp-roman {
	display: flex;
	gap: 1.5rem;
}

.bkp-roman__numeral {
	font-family: var(--wp--preset--font-family--display);
	font-style: italic;
	font-size: 1.5rem;
	line-height: 1.33;
	color: var(--wp--preset--color--burgundy);
	flex: none;
	min-width: 2.25rem;
}

/* Monogram roundel — kept for author cards */
.bkp-monogram {
	width: 7rem;
	height: 7rem;
	margin-left: auto;
	margin-right: auto;
	display: flex;
	align-items: center;
	justify-content: center;
	border: 1px solid var(--wp--preset--color--gold);
	outline: 1px solid var(--wp--preset--color--gold);
	outline-offset: -6px;
	border-radius: 50%;
	font-family: var(--wp--preset--font-family--display);
	font-size: 2.25rem;
	font-weight: 700;
	color: var(--wp--preset--color--burgundy);
	background: var(--wp--preset--color--paper);
}

/* -------------------------------------------------------------------------
 * Navigation: uppercase serif catalog tags, oxblood active underline.
 * ---------------------------------------------------------------------- */

.wp-block-navigation a {
	text-decoration: none;
	padding-bottom: 0.35rem;
	border-bottom: 2px solid transparent;
	transition: color 0.3s ease, border-color 0.3s ease;
}

.wp-block-navigation a:hover {
	color: var(--wp--preset--color--burgundy);
	text-decoration: none;
}

.wp-block-navigation a[aria-current="page"] {
	color: var(--wp--preset--color--burgundy);
	border-bottom-color: var(--wp--preset--color--burgundy);
}

/* Cart glyph in the header */
.bkp-cart a {
	display: flex;
	align-items: center;
	color: var(--wp--preset--color--burgundy);
	transition: opacity 0.3s ease;
}

.bkp-cart a:hover {
	opacity: 0.75;
}

.bkp-cart svg {
	width: 22px;
	height: 22px;
	display: block;
}

/* Footer (espresso) */
.bkp-on-dark,
.bkp-on-dark a {
	color: #F4F1E6;
}

.bkp-on-dark a {
	text-decoration: none;
	opacity: 0.85;
	transition: opacity 0.3s ease, color 0.3s ease;
}

.bkp-on-dark a:hover {
	opacity: 1;
	color: #FFB3B5;
}

.bkp-on-dark .bkp-footer-soft {
	color: var(--wp--preset--color--taupe);
}

/* -------------------------------------------------------------------------
 * WooCommerce: matted plates on parchment — photography leads.
 * ---------------------------------------------------------------------- */

.woocommerce ul.products li.product {
	background: var(--wp--preset--color--white);
	border: 1px solid var(--wp--preset--color--outline-soft);
	border-radius: 0.25rem;
	padding: 1.25rem 1.25rem 1.5rem;
	text-align: center;
	transition: border-color 0.3s ease, box-shadow 0.3s ease, transform 0.3s ease;
}

.woocommerce ul.products li.product:hover {
	border-color: var(--wp--preset--color--gold);
	box-shadow: 0 20px 40px -20px rgba(44, 30, 26, 0.35);
	transform: translateY(-0.25rem);
}

.woocommerce ul.products li.product img {
	border-radius: 0.125rem;
	margin-bottom: 1rem;
}

.woocommerce ul.products li.product .woocommerce-loop-product__title {
	font-family: var(--wp--preset--font-family--display);
	font-size: 1.25rem;
	font-weight: 700;
	color: var(--wp--preset--color--ink);
}

.woocommerce ul.products li.product .price {
	font-family: var(--wp--preset--font-family--display);
	font-style: italic;
	color: var(--wp--preset--color--ink-muted);
}

.woocommerce ul.products li.product a {
	text-decoration: none;
}

.woocommerce ul.products li.product .button,
.woocommerce a.button,
.woocommerce button.button,
.woocommerce input.button,
.wc-block-components-button {
	background: var(--wp--preset--color--burgundy);
	color: var(--wp--preset--color--white);
	border: none;
	border-radius: 0.25rem;
	font-family: var(--wp--preset--font-family--display);
	font-size: 0.75rem;
	font-weight: 700;
	letter-spacing: 0.15em;
	text-transform: uppercase;
}

.woocommerce ul.products li.product .button:hover,
.woocommerce a.button:hover,
.woocommerce button.button:hover,
.woocommerce input.button:hover {
	background: var(--wp--preset--color--burgundy-deep);
	color: var(--wp--preset--color--white);
}

/* Shop author filter row */
.bkp-shop-filter a {
	text-decoration: none;
	color: var(--wp--preset--color--ink-muted);
	padding-bottom: 0.3rem;
	border-bottom: 2px solid transparent;
	transition: color 0.3s ease, border-color 0.3s ease;
}

.bkp-shop-filter a:hover,
.bkp-shop-filter a[aria-current="page"] {
	color: var(--wp--preset--color--burgundy);
	border-bottom-color: var(--wp--preset--color--burgundy);
}

/* Inputs: sunken parchment with brass focus underline */
.woocommerce input.input-text,
.woocommerce textarea,
input[type="search"].wp-block-search__input,
.wp-block-search__input {
	background: var(--wp--preset--color--surface-low);
	border: 1px solid var(--wp--preset--color--outline-soft);
	border-radius: 0.125rem;
	box-shadow: inset 0 2px 4px rgba(44, 30, 26, 0.08);
	font-family: var(--wp--preset--font-family--body);
	font-style: italic;
	padding: 0.6rem 0.9rem;
}

.woocommerce input.input-text:focus,
.woocommerce textarea:focus,
.wp-block-search__input:focus {
	outline: none;
	border-bottom: 2px solid var(--wp--preset--color--gold);
}

/* Woo notices inherit the palette */
.woocommerce-message,
.woocommerce-info {
	border-top-color: var(--wp--preset--color--gold);
	background: var(--wp--preset--color--parchment);
	color: var(--wp--preset--color--ink);
}

.woocommerce-message::before,
.woocommerce-info::before {
	color: var(--wp--preset--color--gold);
}
