/* Tokenized from original AxMaxBooks Blocksy Palette (#F4BC33, #102136, #4D5D6D, #E7EBEE) + Warm Sand Depth */
:root {
  --brand-yellow: #f4bc33;
  --brand-yellow-deep: #dfa51b;
  --brand-navy: #102136;
  --brand-navy-elevated: #172d47;
  --bg-sand: #eae3d5;
  --bg-stone: #dfe5eb;
  --card-surface: #f7f4ec;
  --ink: #102136;
  --ink-muted: #425263;
  --border: rgba(16, 33, 54, 0.14);
  --danger: #b71c1c;
  --danger-bg: #fdecea;
  --success: #188038;
  --radius: 12px;
}

html[data-theme="dark"] {
  --bg-sand: #0d1622;
  --bg-stone: #121e2e;
  --card-surface: #18273b;
  --ink: #f3f5f9;
  --ink-muted: #a6b4c4;
  --border: rgba(243, 245, 249, 0.14);
  --danger: #f28b82;
  --danger-bg: rgba(242, 139, 130, 0.14);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: "Plus Jakarta Sans", system-ui, -apple-system, sans-serif;
  background: var(--bg-sand);
  color: var(--ink);
  line-height: 1.6;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

.container {
  width: min(1200px, 92dvw);
  margin-inline: auto;
}

/* Signature Golden Yellow Header Bar (#F4BC33) */
.site-header {
  position: sticky;
  inset-block-start: 0;
  z-index: 50;
  background: var(--brand-yellow);
  color: #102136;
  border-block-end: 1px solid rgba(16, 33, 54, 0.18);
  box-shadow: 0 4px 18px rgba(16, 33, 54, 0.12);
}

.header-inner {
  width: min(1200px, 92dvw);
  margin-inline: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-block-size: 4.5rem;
}

.header-inner > * {
  flex-shrink: 0;
  white-space: nowrap;
}

.site-header.is-measuring * {
  transition: none !important;
}

.site-logo {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  text-decoration: none;
  color: #102136;
  font-weight: 700;
  font-size: 0.96rem;
  letter-spacing: 0.11em;
}

.site-logo img {
  inline-size: 46px;
  block-size: 46px;
  object-fit: contain;
  background: #ffffff;
  padding: 2px;
  border-radius: 9px;
  border: 1px solid rgba(16, 33, 54, 0.16);
  box-shadow: 0 2px 8px rgba(16, 33, 54, 0.14);
}

.site-nav {
  display: flex;
  align-items: center;
  margin-inline-start: auto;
}

.menu-button {
  anchor-name: --menu-button;
  padding: 0.48rem 0.95rem;
  border-radius: 999px;
  border: 1px solid rgba(16, 33, 54, 0.28);
  background: rgba(255, 255, 255, 0.45);
  color: #102136;
  font: inherit;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
}

.site-menu {
  position: fixed;
  inset: auto;
  inset-block-start: 4.75rem;
  inset-block-start: anchor(--menu-button bottom);
  inset-inline-end: 1rem;
  inline-size: min(80dvw, 20rem);
  max-inline-size: calc(100dvw - 2rem);
  block-size: fit-content;
  max-block-size: calc(100dvh - 6rem);
  margin-block-start: 0.5rem;
  padding: 0.75rem;
  list-style: none;
  background: #102136;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: var(--radius);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.28);
  overflow: auto;
}

.site-menu a {
  display: block;
  padding: 0.55rem 0.9rem;
  color: #f3f5f9;
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 600;
  border-radius: 8px;
}

.site-header.is-wide .menu-button {
  display: none;
}

.site-header.is-wide .site-menu {
  position: static;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  inline-size: auto;
  max-inline-size: none;
  block-size: auto;
  max-block-size: none;
  overflow: visible;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.site-header.is-wide .site-menu::backdrop {
  display: none;
}

.site-header.is-wide .site-menu a {
  color: #102136;
}

.site-header.is-wide .site-menu a:hover,
.site-header.is-wide .site-menu a:focus-visible {
  background: rgba(16, 33, 54, 0.1);
}

.site-header.is-wide .site-menu a.nav-cta,
.site-menu a.nav-cta {
  background: #102136;
  color: var(--brand-yellow);
}

.site-header.is-wide .site-menu a.nav-cta:hover {
  background: #1a3352;
}

.header-tools {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.lang-switch {
  display: inline-flex;
  border: 1px solid rgba(16, 33, 54, 0.24);
  border-radius: 999px;
  padding: 2px;
  background: rgba(255, 255, 255, 0.4);
}

.lang-btn {
  border: 0;
  background: transparent;
  color: #102136;
  font: inherit;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.28rem 0.58rem;
  border-radius: 999px;
  cursor: pointer;
}

.lang-btn.is-active {
  background: #102136;
  color: var(--brand-yellow);
}

.theme-btn {
  inline-size: 32px;
  block-size: 32px;
  border-radius: 999px;
  border: 1px solid rgba(16, 33, 54, 0.28);
  background: rgba(255, 255, 255, 0.45);
  display: grid;
  place-items: center;
  cursor: pointer;
}

.theme-dot {
  inline-size: 14px;
  block-size: 14px;
  border-radius: 50%;
  background: #102136;
}

/* Hero Stage (#102136 Deep Editorial Navy) */
.hero {
  background: radial-gradient(circle at 82% 28%, #1d395c 0%, var(--brand-navy) 64%);
  color: #f3f5f9;
  padding-block: clamp(2.75rem, 6dvh, 4.75rem);
  border-block-end: 3px solid var(--brand-yellow);
}

.hero-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: clamp(2rem, 4vw, 3.25rem);
  align-items: center;
}

.eyebrow {
  margin: 0 0 0.65rem;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--brand-yellow);
}

.eyebrow-dark {
  color: #7c5605;
}

html[data-theme="dark"] .eyebrow-dark {
  color: var(--brand-yellow);
}

h1 {
  margin: 0 0 1rem;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-weight: 700;
  font-size: clamp(2.4rem, 1.4rem + 3.6vw, 4.2rem);
  line-height: 1.04;
}

h2 {
  margin: 0 0 0.75rem;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-weight: 700;
  font-size: clamp(1.85rem, 1.25rem + 2.1vw, 2.9rem);
  line-height: 1.1;
}

.hero-lead {
  margin: 0 0 1.6rem;
  font-size: clamp(1rem, 0.92rem + 0.35vw, 1.1rem);
  color: rgba(243, 245, 249, 0.86);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
  margin-block-end: 1.85rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.78rem 1.45rem;
  border-radius: 999px;
  font: inherit;
  font-weight: 700;
  font-size: 0.92rem;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
}

.btn-gold {
  background: var(--brand-yellow);
  color: #102136;
}

.btn-gold:hover {
  background: var(--brand-yellow-deep);
}

.btn-ghost-light {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.32);
  color: #fff;
}

.btn-ghost-light:hover {
  background: rgba(255, 255, 255, 0.16);
}

.btn-navy {
  background: var(--brand-navy);
  color: var(--brand-yellow);
}

.btn-navy:hover {
  background: var(--brand-navy-elevated);
}

.btn-full {
  inline-size: 100%;
}

.hero-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  margin: 0;
  padding-block-start: 1.2rem;
  border-block-start: 1px solid rgba(255, 255, 255, 0.16);
}

.hero-metrics dt {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 1.65rem;
  font-weight: 700;
  color: var(--brand-yellow);
}

.hero-metrics dd {
  margin: 0;
  font-size: 0.8rem;
  color: rgba(243, 245, 249, 0.8);
}

/* 7-Slide Accessible Looping Carousel (carousel + motion guides) */
.carousel {
  position: relative;
}

.carousel-controls {
  position: absolute;
  inset-block-start: calc(50% - 1.75rem);
  inset-inline: 0.65rem;
  z-index: 5;
  display: flex;
  justify-content: space-between;
  pointer-events: none;
}

.carousel-arrow {
  pointer-events: auto;
  touch-action: manipulation;
  inline-size: 40px;
  block-size: 40px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: rgba(16, 33, 54, 0.82);
  color: var(--brand-yellow);
  font-size: 1.45rem;
  line-height: 1;
  display: grid;
  place-items: center;
  cursor: pointer;
}

.carousel-arrow:hover {
  background: var(--brand-yellow);
  color: #102136;
}

.carousel-arrow:focus-visible,
.carousel-markers button:focus-visible,
.carousel-pause:focus-visible {
  outline: 2px solid var(--brand-yellow);
  outline-offset: 2px;
}

.carousel-track-frame {
  border-radius: 16px;
  overflow: hidden;
  border: 2px solid rgba(244, 188, 51, 0.45);
  box-shadow: 0 24px 52px rgba(0, 0, 0, 0.38);
}

.carousel-track-frame:focus-within {
  outline: 2px solid var(--brand-yellow);
  outline-offset: 3px;
}

.carousel-track {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  overscroll-behavior-x: contain;
  scrollbar-width: none;
  touch-action: manipulation;
}

.carousel-track::-webkit-scrollbar {
  display: none;
}

@media (prefers-reduced-motion: no-preference) {
  .carousel-track {
    scroll-behavior: smooth;
  }
}

.carousel-slide {
  flex: 0 0 100%;
  scroll-snap-align: center;
  position: relative;
  background: #0b1726;
}

/* CSS order parking for endless looping without DOM cloning */
.carousel-track > :first-child {
  order: clamp(0, var(--current) - (var(--children-count, sibling-count()) - 3), 1);
}

.carousel-track > :last-child {
  order: calc(-1 * clamp(0, 2 - var(--current), 1));
}

.carousel-slide img {
  inline-size: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
}

.slide-caption {
  position: absolute;
  inset-inline: 0;
  inset-block-end: 0;
  padding: 0.85rem 1.15rem;
  background: linear-gradient(to top, rgba(11, 23, 38, 0.92), rgba(11, 23, 38, 0));
  display: flex;
  align-items: center;
  gap: 0.65rem;
  font-size: 0.88rem;
}

.slide-caption span {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--brand-yellow);
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  background: rgba(244, 188, 51, 0.16);
}

.carousel-bar {
  margin-block-start: 0.8rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.carousel-markers {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

/* >=24x24px target size (WCAG 2.5.8) + shape change so active state isn't color alone */
.carousel-markers button {
  touch-action: manipulation;
  inline-size: 26px;
  block-size: 26px;
  padding: 0;
  border: 8px solid transparent;
  border-radius: 999px;
  background-color: rgba(255, 255, 255, 0.38);
  background-clip: padding-box;
  cursor: pointer;
  transition: inline-size 180ms ease, background-color 180ms ease;
}

.carousel-markers button[aria-current="true"] {
  inline-size: 42px;
  background-color: var(--brand-yellow);
}

.carousel-pause {
  touch-action: manipulation;
  min-block-size: 28px;
  padding: 0.25rem 0.75rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  background: rgba(255, 255, 255, 0.08);
  color: #f3f5f9;
  font: inherit;
  font-size: 0.76rem;
  font-weight: 600;
  cursor: pointer;
}

/* Layered Non-White Sections */
.section {
  padding-block: clamp(3.25rem, 6vw, 5rem);
}

.section-stone {
  background: var(--bg-stone);
  border-block: 1px solid var(--border);
}

.section-sand {
  background: var(--bg-sand);
}

.section-navy {
  background: var(--brand-navy);
  color: #f3f5f9;
  border-block: 2px solid var(--brand-yellow);
}

.section-head {
  max-inline-size: 42rem;
  margin-block-end: 2rem;
}

.imprints-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 1.25rem;
}

.imprint-card {
  background: var(--card-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.45rem;
}

.imprint-num {
  display: inline-block;
  font-size: 0.76rem;
  font-weight: 700;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  background: var(--brand-yellow);
  color: #102136;
  margin-block-end: 0.55rem;
}

.imprint-card h3,
.service-card h3 {
  margin: 0 0 0.45rem;
  font-size: 1.1rem;
}

.imprint-card p {
  margin: 0;
  font-size: 0.92rem;
  color: var(--ink-muted);
}

/* Catalog */
.catalog-header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1.25rem;
  margin-block-end: 2rem;
}

.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.filter-btn {
  padding: 0.5rem 1rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--card-surface);
  color: var(--ink);
  font: inherit;
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
}

.filter-btn.is-active {
  background: var(--brand-navy);
  color: var(--brand-yellow);
  border-color: var(--brand-navy);
}

html[data-theme="dark"] .filter-btn.is-active {
  background: var(--brand-yellow);
  color: #102136;
}

.books-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 1.35rem;
}

.book-card {
  background: var(--card-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

@media (prefers-reduced-motion: no-preference) {
  .book-card {
    transition: transform 200ms ease, box-shadow 200ms ease;
  }
  .book-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 14px 28px rgba(16, 33, 54, 0.14);
  }
}

.book-media img {
  inline-size: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

.book-body {
  padding: 1.15rem;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.book-cat {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #8a5e00;
  margin-block-end: 0.35rem;
}

html[data-theme="dark"] .book-cat {
  color: var(--brand-yellow);
}

.book-body h3 {
  margin: 0 0 0.45rem;
  font-size: 1.05rem;
  line-height: 1.3;
}

.book-body p {
  margin: 0 0 1rem;
  font-size: 0.88rem;
  color: var(--ink-muted);
  flex: 1;
}

.book-link {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  padding: 0.42rem 0.9rem;
  border-radius: 999px;
  background: var(--brand-yellow);
  color: #102136;
  font-size: 0.82rem;
  font-weight: 700;
  text-decoration: none;
}

.book-link:hover {
  background: var(--brand-yellow-deep);
}

/* Services in Navy Band */
.services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.25rem;
}

.service-card {
  background: var(--brand-navy-elevated);
  border: 1px solid rgba(244, 188, 51, 0.28);
  border-radius: var(--radius);
  padding: 1.5rem;
}

.service-card h3 {
  color: var(--brand-yellow);
}

.service-card p {
  margin: 0;
  font-size: 0.92rem;
  color: rgba(243, 245, 249, 0.86);
}

/* Contact */
.contact-split {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2.5rem;
  align-items: start;
}

.direct-mail {
  display: inline-block;
  margin-block-start: 0.75rem;
  font-weight: 700;
  color: var(--ink);
  background: var(--brand-yellow);
  padding: 0.45rem 1rem;
  border-radius: 999px;
  text-decoration: none;
}

.contact-form {
  background: var(--card-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
}

.field {
  margin-block-end: 1rem;
}

.field label {
  display: block;
  font-weight: 600;
  font-size: 0.88rem;
  margin-block-end: 0.28rem;
}

.hint {
  display: block;
  color: var(--ink-muted);
  font-size: 0.8rem;
  margin-block-end: 0.3rem;
}

.field input,
.field textarea {
  inline-size: 100%;
  padding: 0.65rem 0.8rem;
  font: inherit;
  font-size: 0.94rem;
  color: var(--ink);
  background: var(--bg-sand);
  border: 1px solid var(--border);
  border-radius: 8px;
}

.error-msg {
  display: none;
  color: var(--danger);
  font-size: 0.83rem;
  margin-block-start: 0.3rem;
}

:is(input, textarea):is(:user-invalid, .user-invalid-fallback) {
  border-color: var(--danger);
  background-color: var(--danger-bg);
}

:is(input, textarea):is(:user-invalid, .user-invalid-fallback) + .error-msg {
  display: block;
}

:is(input, textarea):is(:user-valid, .user-valid-fallback) {
  border-color: var(--success);
}

.form-status {
  margin: 0.85rem 0 0;
  font-size: 0.9rem;
  font-weight: 600;
}

.visually-hidden:where(:not(:focus-within, :active)) {
  position: absolute !important;
  clip-path: inset(50%) !important;
  overflow: hidden !important;
  width: 1px !important;
  height: 1px !important;
  margin: -1px !important;
  padding: 0 !important;
  border: 0 !important;
  white-space: nowrap !important;
}

.site-footer {
  background: #0b1726;
  color: rgba(243, 245, 249, 0.8);
  padding-block: 1.5rem;
  font-size: 0.86rem;
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.footer-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
}

.footer-brand img {
  inline-size: 32px;
  block-size: 32px;
  object-fit: contain;
  background: #ffffff;
  padding: 2px;
  border-radius: 6px;
}
