/* Reusable components. Logical properties only (RTL/LTR from one stylesheet). */

/* ---------- Icons ---------- */
.icon { width: 1em; height: 1em; display: inline-block; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
[dir="ltr"] .icon--flip { transform: scaleX(-1); }

/* ---------- Pill buttons (circular arrow chip at the inline-end) ---------- */
.btn {
	--btn-icon-bg: var(--c-pink);
	--btn-icon-color: var(--c-burgundy-deep);
	display: inline-flex; align-items: center; gap: .85rem;
	padding: 6px 22px 6px 7px; padding-inline: 22px 7px;
	min-height: 46px; border-radius: var(--r-pill);
	background: var(--c-btn); color: var(--c-on-dark);
	font-weight: 600; font-size: .95rem; line-height: 1.2; white-space: nowrap;
	border: 1px solid transparent;
	transition: background-color .25s var(--ease), color .25s;
	box-shadow: 0 1px 0 rgba(255, 255, 255, .15) inset;
}
.btn:has(> .btn__icon):hover { background: var(--btn-icon-bg); color: var(--btn-icon-color); }
.btn__icon { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--btn-icon-bg); color: var(--btn-icon-color); font-size: 1rem; }
.btn--light { --btn-icon-bg: var(--c-burgundy-deep); --btn-icon-color: #fff; background: #fff; color: var(--c-burgundy-deep); box-shadow: var(--shadow-soft); }
.btn--chip { --btn-icon-bg: #7a1f24; --btn-icon-color: #fff; background: rgba(255, 255, 255, .75); color: var(--c-text); }
.btn--outline { background: rgba(255, 255, 255, .35); color: var(--c-text); border-color: var(--c-line); }
.btn--sm { min-height: 40px; font-size: .88rem; padding-inline: 18px 6px; }
.btn--sm .btn__icon { width: 28px; height: 28px; }
.btn--block { width: 100%; justify-content: space-between; }
.btn[disabled], .btn.is-loading { opacity: .65; pointer-events: none; }

/* Text link with arrow */
.link-arrow { display: inline-flex; align-items: center; gap: .6rem; font-weight: 600; font-size: .95rem; color: var(--c-text); }
.link-arrow .icon { font-size: .95rem; }

.btn-row { display: flex; flex-wrap: wrap; align-items: center; gap: 18px 28px; }

/* ---------- Section heads ---------- */
.eyebrow { display: block; font-size: .92rem; color: var(--c-burgundy); margin-bottom: .45rem; font-weight: 500; }
.section-head { text-align: center; max-width: 760px; margin: 0 auto clamp(24px, 4vw, 40px); }
.section-head .section-title, .section-title { font-size: var(--fs-h2); line-height: 1.3; margin-bottom: .4em; }
.section-lead { color: var(--c-text); opacity: .85; margin-inline: auto; max-width: 62ch; }
.section-head .btn { margin-top: .6rem; }

/* ---------- Badges ---------- */
.badge { display: inline-block; padding: 2px 14px; border-radius: var(--r-pill); font-size: .8rem; font-weight: 600; background: var(--c-rose); color: #fff; line-height: 1.7; }
.badge--lit { background: var(--c-gold-cover); }

/* ---------- Tabs (filter bar) ---------- */
.tabs { display: flex; gap: 6px; padding: 6px; background: var(--c-rose); border-radius: var(--r-pill); width: min(100%, 720px); margin: 0 auto clamp(24px, 4vw, 40px); box-shadow: var(--shadow-soft); }
.tabs__item { flex: 1; text-align: center; padding: 12px 14px; border-radius: var(--r-pill); color: #fff; font-weight: 600; font-size: .95rem; transition: background .25s, color .25s; }
.tabs__item:hover { background: rgba(255, 255, 255, .15); color: #fff; }
.tabs__item[aria-selected="true"], .tabs__item.is-active { background: var(--c-cream); color: var(--c-burgundy); }
.is-loading-grid { opacity: .45; pointer-events: none; transition: opacity .2s; }

/* ---------- Book cover (CSS fallback + images) ---------- */
.book-cover { position: relative; display: block; aspect-ratio: 8 / 9; border-radius: 12px 6px 6px 12px; overflow: hidden; background: var(--c-rose); color: #f3e3dc; box-shadow: 0 14px 26px -16px rgba(60, 20, 20, .55); }
[dir="rtl"] .book-cover { border-radius: 6px 12px 12px 6px; }
.book-cover img { width: 100%; height: 100%; object-fit: cover; }
.book-cover--lit { background: var(--c-gold-cover); }

/* ---------- Book card ---------- */
.book-card { display: flex; flex-direction: column; gap: 12px; background: rgba(255, 255, 255, .42); border-radius: var(--r-lg); padding: 14px 14px 20px; height: 100%; transition: transform .3s var(--ease), box-shadow .3s; }
.book-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-soft); }
.book-card__body { display: flex; flex-direction: column; gap: 6px; flex: 1; padding-inline: 4px; }
.book-card .badge { align-self: flex-start; margin-top: 4px; }
.book-card__title { font-size: 1.12rem; line-height: 1.5; margin: 4px 0 0; font-weight: 700; }
.book-card__excerpt { font-size: .86rem; color: var(--c-muted); line-height: 1.75; margin: 0; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.book-card__more { margin-top: auto; padding-top: 10px; text-align: end; }
.book-card__price { color: var(--c-burgundy); font-weight: 700; font-family: var(--f-head); }

/* ---------- Post card (date + chip + circle arrow) ---------- */
.post-card { display: flex; flex-direction: column; background: rgba(255, 255, 255, .42); border-radius: var(--r-lg); overflow: hidden; height: 100%; transition: transform .3s var(--ease); }
.post-card:hover { transform: translateY(-4px); }
.post-card__media { display: block; aspect-ratio: 16 / 10; overflow: hidden; background: var(--c-gold-cover); }
.post-card__media img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s var(--ease); }
.post-card:hover .post-card__media img { transform: scale(1.05); }
.post-card__body { padding: 18px 20px 22px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.post-card__meta { display: flex; align-items: center; gap: 10px; font-family: var(--f-serif-accent); font-size: .85rem; color: var(--c-burgundy); }
.post-card__title { font-size: 1.12rem; line-height: 1.55; margin: 0; font-weight: 700; }
.post-card__excerpt { font-size: .86rem; color: var(--c-muted); margin: 0; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.circle-btn { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 50%; background: #7a1f24; color: #fff; transition: background-color .25s, color .25s; flex: none; }
.circle-btn:hover { background: var(--c-burgundy-deep); color: #fff; }
.post-card .circle-btn { margin-top: auto; }

/* Overlay tile used in blog grid / related */
.post-tile { position: relative; display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; min-height: 330px; border-radius: var(--r-md); overflow: hidden; color: #fff; padding: 28px; isolation: isolate; background: var(--c-rose); }
.post-tile__bg { position: absolute; inset: 0; z-index: -2; }
.post-tile__bg img { width: 100%; height: 100%; object-fit: cover; transition: transform .8s var(--ease); }
.post-tile::before { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(180deg, rgba(94, 30, 34, .15), rgba(60, 14, 18, .72)); }
.post-tile:hover .post-tile__bg img { transform: scale(1.06); }
.post-tile__title { color: #fff; font-size: 1.3rem; margin-bottom: .4rem; }
.post-tile__excerpt { font-size: .85rem; opacity: .9; margin: 0; max-width: 32ch; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.post-tile__date { position: absolute; inset-block-start: 14px; inset-inline-start: 14px; font-family: var(--f-serif-accent); font-size: .78rem; background: rgba(255, 255, 255, .85); color: var(--c-burgundy-deep); padding: 2px 12px; border-radius: var(--r-pill); }
.post-tile:hover { color: #fff; }

/* ---------- Research card ---------- */
.research-card { background: var(--c-card-soft); border-radius: var(--r-md); padding: 26px 28px 24px; display: flex; flex-direction: column; gap: 10px; height: 100%; box-shadow: var(--shadow-card); }
.research-card__title { font-size: 1.22rem; line-height: 1.6; margin: 0; color: #14151f; font-weight: 700; }
.research-card__title a:hover { color: var(--c-burgundy); }
.research-card__abstract { font-size: .88rem; color: var(--c-muted); margin: 0; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.research-card__meta { display: flex; flex-wrap: wrap; gap: 6px 18px; align-items: baseline; font-size: .82rem; color: #3a3a40; }
.research-card__journal { font-family: var(--f-serif-accent); font-style: normal; color: var(--c-burgundy); font-weight: 500; }
.research-card__year { font-family: var(--f-serif-accent); color: var(--c-muted); }
.research-card .btn { align-self: flex-start; margin-top: 4px; }

/* ---------- Accordion ---------- */
.accordion { display: grid; gap: 12px; }
.accordion__item { background: var(--c-card-soft); border-radius: 16px; overflow: hidden; transition: background .25s; }
.accordion__item.is-open { background: var(--c-card); }
.accordion__q { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 16px; text-align: start; padding: 20px 24px; font-family: var(--f-head); font-weight: 700; font-size: 1.1rem; line-height: 1.6; color: var(--c-text); }
.acc-icon { position: relative; flex: none; width: 28px; height: 28px; border-radius: 50%; background: #fff; box-shadow: 0 1px 4px rgba(0, 0, 0, .15); order: -1; }
[dir="rtl"] .acc-icon { order: 2; }
.acc-icon::before, .acc-icon::after { content: ""; position: absolute; inset: 50% auto auto 50%; width: 12px; height: 2px; background: var(--c-text); transform: translate(-50%, -50%); transition: transform .3s var(--ease), background .25s; border-radius: 2px; }
.acc-icon::after { transform: translate(-50%, -50%) rotate(90deg); }
.accordion__item.is-open .acc-icon { background: var(--c-burgundy); }
.accordion__item.is-open .acc-icon::before { background: #fff; }
.accordion__item.is-open .acc-icon::after { transform: translate(-50%, -50%) rotate(0); background: #fff; }
.accordion__panel { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .35s var(--ease); }
.accordion__item.is-open .accordion__panel { grid-template-rows: 1fr; }
.accordion__panel > div { overflow: hidden; }
.accordion__a { padding: 0 24px 22px; color: var(--c-muted); font-size: .98rem; }
.accordion__a p:last-child { margin: 0; }
html:not(.js) .accordion__panel { grid-template-rows: 1fr; }

/* ---------- Pagination ---------- */
.pagination { display: flex; justify-content: center; margin-top: clamp(28px, 4vw, 44px); }
.pagination ul { list-style: none; display: inline-flex; align-items: center; gap: 8px; padding: 6px 10px; border-radius: var(--r-pill); background: rgba(255, 255, 255, .45); }
.pagination .page-numbers { display: grid; place-items: center; min-width: 34px; height: 34px; border-radius: 50%; font-size: .85rem; font-weight: 600; color: var(--c-text); transition: background .2s, color .2s; }
.pagination a.page-numbers:hover { background: var(--c-pink); }
.pagination .page-numbers.current { background: var(--c-rose); color: #fff; }
.pagination .page-numbers.prev, .pagination .page-numbers.next { background: #fff; box-shadow: 0 1px 4px rgba(0, 0, 0, .12); }
.pagination .dots { min-width: auto; }

/* ---------- Carousel ---------- */
.carousel { position: relative; }
.carousel__track { display: flex; gap: 20px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; padding-block: 6px 10px; -webkit-overflow-scrolling: touch; }
.carousel__track::-webkit-scrollbar { display: none; }
.carousel__item { flex: 0 0 calc((100% - 40px) / 3); scroll-snap-align: start; min-width: 0; }
.carousel--4 .carousel__item { flex-basis: calc((100% - 60px) / 4); }
.carousel__controls { display: flex; align-items: center; justify-content: center; gap: 18px; margin-top: 26px; }
.carousel__btn { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; background: #fff; color: var(--c-burgundy-deep); box-shadow: 0 2px 8px rgba(0, 0, 0, .1); transition: background-color .2s, opacity .2s; }
.carousel__btn:hover { background: var(--c-pink); }
.carousel__btn[disabled] { opacity: .45; pointer-events: none; }
.carousel__bar { position: relative; width: min(400px, 52vw); height: 12px; border-radius: var(--r-pill); background: var(--c-pink-deep); overflow: hidden; }
.carousel__thumb { position: absolute; inset-block: 0; inset-inline-start: 0; width: 40%; border-radius: var(--r-pill); background: var(--c-rose); transition: inset-inline-start .15s linear, width .15s; }
@media (max-width: 900px) { .carousel__item, .carousel--4 .carousel__item { flex-basis: calc((100% - 20px) / 2); } }
@media (max-width: 560px) { .carousel__item, .carousel--4 .carousel__item { flex-basis: 84%; } }

/* ---------- Page hero band (listing pages) ---------- */
.page-hero { position: relative; isolation: isolate; text-align: center; color: #fff; background: radial-gradient(120% 140% at 50% 0%, #7a3238 0%, var(--c-burgundy-hero) 45%, var(--c-burgundy-deep) 100%); padding: clamp(56px, 8vw, 96px) 0 clamp(90px, 11vw, 150px); border-radius: 0 0 50% 50% / 0 0 44px 44px; overflow: hidden; margin-bottom: 0; }
.page-hero::before { content: ""; position: absolute; inset: 0; z-index: -1; background: repeating-linear-gradient(115deg, rgba(255, 255, 255, .035) 0 120px, transparent 120px 260px); }
.page-hero__art { position: absolute; z-index: -1; inset-inline: 0; bottom: 0; margin-inline: auto; width: min(560px, 80%); opacity: .38; mix-blend-mode: luminosity; pointer-events: none; }
.page-hero__art img { width: 100%; }
.page-hero h1 { color: #fff; font-size: var(--fs-h2); max-width: 20ch; margin-inline: auto; }
.page-hero p { max-width: 62ch; margin-inline: auto; opacity: .92; }
.page-hero .eyebrow { color: #f0d2cf; }
.page-hero--books { padding-bottom: clamp(40px, 6vw, 70px); }

/* Search bar */
.search-bar { position: relative; display: flex; align-items: center; background: var(--c-cream-2); border-radius: var(--r-pill); width: min(100%, 760px); margin: clamp(20px, 3vw, 32px) auto 0; padding: 4px 22px; box-shadow: 0 10px 30px -14px rgba(0, 0, 0, .5); }
.search-bar input[type="search"] { flex: 1; min-width: 0; border: 0; background: transparent; padding: 16px 6px; color: var(--c-text); font-size: 1rem; outline: none; }
.search-bar input::placeholder { color: #8d8680; }
.search-bar button { display: grid; place-items: center; width: 40px; height: 40px; color: var(--c-muted); border-radius: 50%; }
.search-bar:focus-within { outline: 3px solid rgba(255, 255, 255, .55); outline-offset: 2px; }
.search-bar--light { background: #fff; box-shadow: var(--shadow-soft); }

/* ---------- CTA panels ---------- */
.cta-panel { position: relative; isolation: isolate; overflow: hidden; border-radius: var(--r-lg); background: radial-gradient(140% 160% at 80% 0%, #74282e 0%, var(--c-burgundy-deep) 55%, #4d171b 100%); color: #fff; display: grid; grid-template-columns: 1.3fr 1fr; align-items: center; gap: 24px; padding: clamp(28px, 5vw, 56px) clamp(24px, 5vw, 56px); min-height: 360px; }
.cta-panel::before { content: ""; position: absolute; inset: 0; z-index: -1; background: repeating-linear-gradient(115deg, rgba(255, 255, 255, .04) 0 90px, transparent 90px 220px); }
.cta-panel__art { align-self: end; justify-self: center; margin-block: calc(-1 * clamp(28px, 5vw, 56px)); max-height: 100%; }
.cta-panel__art img { max-height: 380px; width: auto; object-fit: contain; filter: drop-shadow(0 20px 20px rgba(0, 0, 0, .35)); }
.cta-panel .eyebrow { color: #ecd0cc; }
.cta-panel h2 { color: #fff; font-size: clamp(1.7rem, 1.2rem + 1.8vw, 2.6rem); line-height: 1.4; }
.cta-panel p { opacity: .93; max-width: 56ch; }
@media (max-width: 800px) { .cta-panel { grid-template-columns: 1fr; text-align: center; } .cta-panel__art { order: 3; margin-block: 0 -30px; } .cta-panel__art img { max-height: 220px; } .cta-panel p { margin-inline: auto; } .cta-panel .btn { margin-inline: auto; } }

/* Newsletter pill form */
.newsletter-form { display: flex; align-items: center; background: var(--c-cream-2); border-radius: var(--r-pill); padding: 6px; border: 3px solid rgba(255, 255, 255, .35); max-width: 560px; position: relative; }
.newsletter-form input[type="email"] { flex: 1; min-width: 0; border: 0; background: transparent; padding: 10px 18px; color: var(--c-text); outline: none; }
.newsletter-form input::placeholder { color: #8d8680; }
.newsletter-form .btn { flex: none; padding-inline: 18px 6px; }
.form-note { margin: .7rem 0 0; font-size: .9rem; min-height: 1.4em; }
.form-note.is-ok { color: #cfe9d2; }
.form-note.is-error { color: #ffd0cc; }
.hp-field { position: absolute !important; inset-inline-start: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* ---------- Generic form controls ---------- */
.field { display: grid; gap: 8px; margin-bottom: 18px; }
.field label, .field .label { font-weight: 600; font-size: .9rem; }
.input, .select, .textarea, .form-row input.input-text, .form-row textarea, .form-row select, .woocommerce-input-wrapper input, .woocommerce-input-wrapper select, .woocommerce-input-wrapper textarea, .coupon-box__panel input {
	width: 100%; background: #fffdf9; border: 1px solid transparent; border-radius: var(--r-pill); padding: 14px 22px; font-size: .95rem; color: var(--c-text); transition: border-color .2s, box-shadow .2s; outline: none; -webkit-appearance: none; appearance: none;
}
.textarea, .form-row textarea { border-radius: var(--r-md); min-height: 170px; resize: vertical; }
.input:focus, .select:focus, .textarea:focus, .form-row input.input-text:focus, .form-row textarea:focus, .form-row select:focus { border-color: var(--c-burgundy); box-shadow: 0 0 0 3px rgba(122, 42, 46, .15); }
.select, .form-row select, .woocommerce-input-wrapper select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%232b2b2b' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: left 20px center; padding-inline-end: 22px; }
[dir="ltr"] .select, [dir="ltr"] .form-row select { background-position: right 20px center; }

/* ---------- Notices ---------- */
.notice, .woocommerce-message, .woocommerce-error, .woocommerce-info { list-style: none; margin: 0 0 20px; padding: 16px 22px; border-radius: var(--r-sm); background: var(--c-card); border-inline-start: 4px solid var(--c-burgundy); font-size: .95rem; display: flex; flex-wrap: wrap; align-items: center; gap: 12px; justify-content: space-between; }
.woocommerce-error { border-color: #b3261e; background: #f7e0dc; }
.woocommerce-message .button, .woocommerce-info .button { order: 2; }

/* Back-to-top-free; decorative divider */
.divider { height: 1px; background: var(--c-line); border: 0; margin-block: 28px; }
