/*
Theme Name: Biblunio Afterlight
Author: Biblunio
Description: An interactive editorial bookstore theme with WooCommerce support, book previews, a genre finder, and a reading journal.
Version: 1.0.0
Requires at least: 6.4
Requires PHP: 7.4
Text Domain: biblunio-afterlight
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
*/

:root {
  --ink: #17121e;
  --deep: #21172d;
  --paper: #f6f2ea;
  --muted: #655e6a;
  --lime: #e2fa83;
  --lilac: #d3b8ff;
  --rule: #d9d0d8;
  --serif: "Baskerville", Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: ui-monospace, "SFMono-Regular", Consolas, monospace;
}
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; color: var(--ink); background: var(--paper); font: 1rem/1.6 var(--sans); }
[hidden] { display: none !important; }
a { color: inherit; text-underline-offset: .22em; }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
img { display: block; max-width: 100%; height: auto; }
:focus-visible { outline: 3px solid #8559ce; outline-offset: 4px; }
section[id] { scroll-margin-top: 1rem; }
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { line-height: 1.07; }
.wrap { width: min(100% - 112px, 1280px); margin-inline: auto; }
.screen-reader-text, .skip-link:not(:focus) { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip-link:focus { position: fixed; z-index: 100001; top: .65rem; left: .65rem; color: var(--ink); background: var(--lime); padding: .65rem 1rem; }

.site-header { color: var(--paper); background: #1b1227; border-bottom: 1px solid #ffffff26; }
.header-inner, .footer-inner { display: flex; justify-content: space-between; align-items: center; gap: 1.4rem; min-height: 74px; }
.wordmark { display: inline-flex; align-items: center; gap: 9px; font: bold 1.62rem/1 var(--serif); text-decoration: none; letter-spacing: -.06em; white-space: nowrap; }
.wordmark-period { color: var(--lime); margin-inline-start: -8px; }
.brand-mark { display: inline-flex; gap: 3px; align-items: center; transform: rotate(-13deg); margin-inline-end: 2px; }
.brand-mark i { display: block; width: 4px; height: 19px; background: var(--lime); border-radius: 1px; }
.brand-mark i:nth-child(2) { height: 16px; opacity: .8; }
.brand-mark i:nth-child(3) { height: 13px; opacity: .66; }
.custom-logo { width: auto; max-width: 155px; max-height: 54px; }
.main-nav ul, .site-footer ul { display: flex; flex-wrap: wrap; align-items: center; gap: clamp(.9rem, 3vw, 2.6rem); padding: 0; margin: 0; list-style: none; }
.main-nav a, .site-footer nav a { color: #e0d5eb; font-size: .89rem; text-decoration: none; }
.main-nav a:hover, .site-footer nav a:hover { color: var(--lime); }
.bag { text-decoration: none; border: 1px solid #c2a0dd66; border-radius: 999px; color: var(--lime); padding: 7px 15px; font-size: .85rem; white-space: nowrap; }
.bag span, .quiet-link span, .button span { margin-inline-start: .35em; }
.bag:hover { color: var(--deep); background: var(--lime); }

.hero { position: relative; isolation: isolate; display: grid; align-items: stretch; overflow: hidden; background: #201329; color: #fff8f1; }
.hero-image { position: absolute; z-index: -2; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center 58%; }
.hero::after { content: ""; position: absolute; z-index: -1; inset: 0; background: linear-gradient(90deg, #190f22e8 2%, #190f22b8 31%, #190f223d 62%, transparent 82%); pointer-events: none; }
.hero-inner { position: relative; display: flex; min-height: clamp(480px, 48vw, 620px); align-items: center; padding-block: 54px; }
.hero-copy { max-width: min(650px, 73%); }
.eyebrow { display: flex; align-items: center; gap: .7em; font: 600 .71rem/1.4 var(--mono); text-transform: uppercase; letter-spacing: .13em; }
.hero .eyebrow { color: var(--lime); margin-bottom: 21px; }
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; flex: 0 0 7px; }
.hero h1 { font: 400 clamp(3rem, 7.25vw, 7.1rem)/.87 var(--serif); letter-spacing: -.083em; }
.hero h1 em { color: var(--lilac); font-weight: 400; }
.hero-intro { max-width: 360px; margin-block: 25px 28px; color: #eee4f2; font-size: clamp(.99rem, 1.45vw, 1.16rem); }
.hero-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 24px; }
.button { display: inline-flex; justify-content: center; align-items: center; gap: 10px; border: 1px solid transparent; border-radius: 999px; padding: .7em 1.24em; font-size: .9rem; font-weight: 700; text-decoration: none; transition: background-color .18s, color .18s; }
.button-lime { background: var(--lime); color: #20172a; }
.button-lime:hover { background: #f5ffb8; color: #20172a; }
.quiet-link { display: inline-flex; gap: 4px; align-items: center; font-size: .87rem; font-weight: 650; }
.quiet-link:hover { text-decoration-thickness: 2px; }
.spotlight { position: absolute; bottom: 34px; inset-inline-end: 0; display: flex; align-items: center; gap: 13px; max-width: min(100%, 300px); background: #251a34e8; border: 1px solid #d6b6fa55; border-radius: 10px; padding: 10px 14px 10px 10px; color: #fff8f1; text-decoration: none; }
.spotlight:hover { border-color: var(--lime); }
.spotlight img { width: 35px; height: 49px; object-fit: cover; border-radius: 2px; }
.spotlight small, .spotlight strong { display: block; }
.spotlight small { font: .63rem/1.5 var(--mono); letter-spacing: .11em; color: var(--lilac); text-transform: uppercase; }
.spotlight strong { font-size: .9rem; }
.spot-arrow { color: var(--lime); margin-inline-start: 5px; }

.shelf, .journal { padding-block: 60px 72px; }
.section-head { display: flex; justify-content: space-between; align-items: end; flex-wrap: wrap; gap: 12px; margin-bottom: 24px; }
.section-head .eyebrow { margin-bottom: 10px; color: #634081; }
.section-head h2, .finder h2 { font: 400 clamp(2.9rem, 5.7vw, 5.7rem)/.89 var(--serif); letter-spacing: -.075em; }
.section-head h2 em { font-style: normal; color: #774e94; }
.catalog-controls { display: flex; align-items: start; flex-wrap: wrap; justify-content: space-between; gap: 12px; margin-block: 8px 19px; }
.filters, .finder-options { display: flex; flex-wrap: wrap; gap: 7px; }
.filters button, .finder-options button { border: 1px solid var(--rule); border-radius: 999px; background: transparent; padding: 8px 14px; color: var(--ink); font-size: .82rem; line-height: 1.25; }
.filters button:hover { border-color: var(--deep); }
.filters button[aria-pressed="true"] { color: var(--paper); background: var(--deep); border-color: var(--deep); }
.catalog-search { display: flex; align-items: center; gap: 8px; width: min(100%, 225px); min-height: 36px; padding: 0 12px; border: 1px solid var(--rule); border-radius: 999px; }
.catalog-search > span:first-child { font-size: 1.15rem; line-height: 1; }
.catalog-search input { border: 0; outline: none; background: transparent; width: 100%; font-size: .82rem; color: var(--ink); }
.catalog-search:focus-within { outline: 2px solid #8559ce; }
.sample-note { margin-bottom: 14px; color: var(--muted); font-size: .8rem; }
.book-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); column-gap: clamp(12px, 2vw, 28px); row-gap: 30px; }
.book-card { min-width: 0; }
.book-art { position: relative; display: flex; align-items: center; justify-content: center; aspect-ratio: 1.02; background: #e8ddef; border-radius: 10px; isolation: isolate; }
.book-card:nth-child(4n+2) .book-art { background: #f0d5c7; }
.book-card:nth-child(4n+3) .book-art { background: #e0e7bc; }
.book-card:nth-child(4n+4) .book-art { background: #dfd9f2; }
.book-art img { display: block; width: auto; max-width: 70%; height: 79%; aspect-ratio: 2/3; object-fit: cover; border-radius: 2px 4px 4px 2px; box-shadow: 7px 10px 19px #22133461, -2px 1px 0 #21162a5e; transform: perspective(650px) rotateX(var(--turn-x, 0deg)) rotateY(var(--turn-y, 0deg)) rotateZ(-5deg); transition: transform .22s ease; }
.book-card:nth-child(even) .book-art img { transform: perspective(650px) rotateX(var(--turn-x, 0deg)) rotateY(var(--turn-y, 0deg)) rotateZ(5deg); }
.book-art:hover img, .book-art:focus-visible img { transform: perspective(650px) rotateX(var(--turn-x, 0deg)) rotateY(var(--turn-y, 0deg)) scale(1.045); }
.book-art > span { position: absolute; inset-inline-end: 9px; bottom: 9px; width: 28px; height: 28px; display: grid; place-items: center; border-radius: 50%; background: var(--paper); font: .95rem/1 var(--sans); }
.book-meta { padding: 13px 1px 0; overflow-wrap: anywhere; }
.book-category { color: #674778; font: 650 .66rem/1.45 var(--mono); letter-spacing: .085em; text-transform: uppercase; margin-bottom: .34rem; }
.book-category:empty { display: none; }
.book-meta h3 { font: 400 clamp(1.24rem, 2vw, 1.8rem)/1.04 var(--serif); letter-spacing: -.035em; }
.book-author, .book-description { color: var(--muted); font-size: .84rem; margin-top: .3rem; }
.book-price { font-weight: 700; margin-top: .3rem; }
.book-price del { font-weight: 400; }
.book-link { margin-top: .35rem; }
.empty-shelf { padding: 1rem 0; }

.finder { background: #e5edba; padding-block: clamp(42px, 7vw, 90px); border-block: 1px solid #b1bc82; }
.finder-inner { display: grid; grid-template-columns: 1.12fr 1fr; align-items: center; gap: clamp(20px, 6vw, 90px); }
.finder .eyebrow { margin-bottom: 13px; }
.finder h2 { max-width: 600px; }
.finder-panel { background: #fbfbe9; border: 1px solid #19231546; padding: clamp(17px, 3vw, 36px); border-radius: 13px; }
.finder-panel > p { margin-bottom: 14px; }
.finder-options button { border-color: #67724b81; }
.finder-options button:hover { border-color: #2b3823; }
.finder-options button[aria-pressed="true"] { color: #f7f9e8; background: #2b3823; border-color: #2b3823; }
.recommendation { display: flex; justify-content: space-between; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 16px; border-top: 1px solid #67724b44; padding-top: 10px; }
.recommendation p { min-height: 1.4em; font-family: var(--serif); font-size: 1.35rem; }
.journal-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.journal-card { border: 1px solid var(--rule); border-radius: 12px; overflow: hidden; background: #f1e9f2; }
.journal-card a { display: block; height: 100%; text-decoration: none; }
.journal-card a:hover h3 { text-decoration: underline; }
.journal-card img { width: 100%; aspect-ratio: 16/9; object-fit: cover; }
.journal-card div { padding: 19px; }
.journal-card h3 { font: 400 1.65rem/1.13 var(--serif); margin-block: 10px; }

.site-footer { background: var(--deep); color: #f9f0fa; padding-block: 20px; }
.site-footer small { color: #dbcede; }
.preview { padding: 0; border: 0; border-radius: 15px; background: var(--paper); color: var(--ink); width: min(670px, 100% - 28px); max-height: calc(100dvh - 28px); }
.preview::backdrop { background: #140c20c9; backdrop-filter: blur(5px); }
.preview-inner { position: relative; display: grid; grid-template-columns: minmax(108px, .65fr) 1fr; align-items: center; gap: clamp(12px, 3vw, 32px); padding: clamp(17px, 4vw, 40px); }
.preview-inner > img { width: 100%; max-width: 230px; border-radius: 3px; box-shadow: 4px 6px 13px #20132944; }
.preview h2 { font: 400 clamp(1.5rem, 4vw, 3.2rem)/.98 var(--serif); letter-spacing: -.035em; margin: .3em 1rem .12em 0; }
.preview p { margin-bottom: .62em; }
.preview-close { position: absolute; top: 7px; inset-inline-end: 8px; width: 35px; height: 35px; border: 1px solid var(--rule); border-radius: 50%; background: var(--paper); color: var(--ink); font-size: 1.45rem; line-height: 1; }
.preview-close:hover { background: var(--lilac); }

.content-area, .home-editor { padding-block: clamp(35px, 7vw, 84px); min-height: 45vh; }
.content-area > h1, .entry h1 { font: 400 clamp(2.4rem, 6vw, 5rem)/1 var(--serif); letter-spacing: -.055em; margin-bottom: 1.2rem; }
.entry { max-width: 850px; overflow-wrap: anywhere; }
.entry + .entry { margin-block: 2rem; border-top: 1px solid var(--rule); padding-top: 1.5rem; }
.entry h2, .entry h3 { font: 400 clamp(1.45rem, 3.5vw, 2.6rem)/1.15 var(--serif); }
.entry p, .entry ul, .entry ol, .entry figure, .entry blockquote, .entry h2, .entry h3 { margin-block: .85em; }
.entry table { display: block; max-width: 100%; overflow-x: auto; }
.entry .aligncenter { margin-inline: auto; }
.entry .alignleft { float: left; margin-inline-end: 1rem; }
.entry .alignright { float: right; margin-inline-start: 1rem; }
.entry::after { content: ""; display: block; clear: both; }
.comments-area { max-width: 850px; margin-top: 2rem; }
.comments-area input:not([type="checkbox"]), .comments-area textarea { max-width: 100%; }
.woocommerce div.product .product_title, .woocommerce .woocommerce-products-header__title { font: 400 clamp(2.1rem, 5vw, 4.4rem)/1 var(--serif); letter-spacing: -.04em; }
.woocommerce ul.products li.product a img { border-radius: 8px; }
.woocommerce div.product .woocommerce-product-details__short-description { margin-block: .9rem; }
.woocommerce .woocommerce-ordering select { max-width: 100%; }
.woocommerce .button.alt, .woocommerce button.button.alt, .woocommerce a.button.alt, .wc-block-components-button:not(.is-link) { background: var(--deep); color: #fff8f1; }
.woocommerce .button.alt:hover, .woocommerce button.button.alt:hover, .woocommerce a.button.alt:hover, .wc-block-components-button:not(.is-link):hover { background: #533966; color: #fff8f1; }
.woocommerce .widget_shopping_cart .buttons a { margin-bottom: .5rem; }

@media (max-width: 900px) {
  .wrap { width: calc(100% - 56px); }
  .hero-inner { min-height: 510px; }
  .hero-image { object-position: 61% center; }
}
@media (max-width: 660px) {
  .wrap { width: calc(100% - 34px); }
  .header-inner { display: grid; grid-template-columns: 1fr auto; min-height: 0; gap: 10px; padding-block: 13px 9px; }
  .main-nav { grid-column: 1/-1; grid-row: 2; }
  .header-inner .bag { grid-column: 2; grid-row: 1; }
  .hero-inner { min-height: 565px; align-items: start; padding-block: 42px 86px; }
  .hero-copy { max-width: 100%; }
  .hero h1 { font-size: clamp(2.85rem, 11vw, 4.7rem); }
  .hero-image { object-position: 66% center; }
  .hero::after { background: linear-gradient(180deg, #190f22f0 1%, #190f22af 48%, #190f2211 87%), linear-gradient(90deg, #190f2244, transparent); }
  .spotlight { bottom: 17px; }
  .shelf, .journal { padding-block: 42px 47px; }
  .book-grid, .journal-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .finder-inner { grid-template-columns: 1fr; }
  .footer-inner { flex-wrap: wrap; }
  .woocommerce .woocommerce-ordering { float: none; }
}
@media (max-width: 360px) {
  .preview-inner { grid-template-columns: 1fr; }
  .preview-inner > img { width: 95px; }
  .journal-grid { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .book-art img, .button { transition: none; }
  .book-art:hover img, .book-art:focus-visible img { transform: none; }
}
