/* ==========================================================================
   Visual Dharma — Design tokens
   Pulled directly from the project's own styles.css (Tailwind/oklch theme):
   warm cream paper, deep Tibetan maroon primary, warm gold accent.
   Fonts: Cormorant Garamond (display) + Inter (body/UI). Radius 4px (rounded-sm).
   ========================================================================== */

:root {
  --radius: 4px;

  --background: oklch(0.975 0.012 80);
  --foreground: oklch(0.18 0.02 40);
  --card: oklch(0.99 0.008 80);

  --primary: oklch(0.38 0.12 25);
  --primary-foreground: oklch(0.97 0.012 80);
  --secondary: oklch(0.93 0.018 75);
  --muted-foreground: oklch(0.45 0.025 50);
  --accent: oklch(0.72 0.13 70);
  --border: oklch(0.88 0.02 70);

  --font-display: "Cormorant Garamond", "Iowan Old Style", Georgia, serif;
  --font-sans: "Inter", -apple-system, ui-sans-serif, system-ui, sans-serif;

  --container: 1280px;
  --gutter: clamp(20px, 4vw, 24px);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body.visual-dharma {
  margin: 0;
  background: var(--background);
  color: var(--foreground);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }

.container { max-width: var(--container); margin: 0 auto; padding: 0 var(--gutter); }

h1, h2, h3, h4, .font-display {
  font-family: var(--font-display);
  letter-spacing: -0.01em;
  font-weight: 600;
  line-height: 1.08;
  margin: 0;
  color: var(--foreground);
}
.text-center { 
    text-align: center; 
    font-size: 30px;
    font-weight: 700;
    color: #941100;
    margin:0;
}
.eyebrow {
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--accent);
}
.image-row {
    display: flex;
    gap: 20px;
    align-items: flex-start;
    flex-wrap: wrap;
}

.image-row img {
    max-width: 100%;
    height: auto;
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation: none !important; transition: none !important; }
}

a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 3px;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 500;
  padding: 12px 24px;
  border-radius: var(--radius);
  border: 1px solid transparent;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.btn-primary { background: var(--primary); color: var(--primary-foreground); }
.btn-primary:hover { background: color-mix(in oklab, var(--primary) 90%, white); }
.btn-outline { border-color: var(--border); background: var(--card); color: var(--foreground); }
.btn-outline:hover { border-color: var(--primary); color: var(--primary); }

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 50;
  border-bottom: 1px solid var(--border);
  background: color-mix(in oklab, var(--background) 85%, transparent);
  backdrop-filter: blur(8px);
}
.site-header .container { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding-top: 16px; padding-bottom: 16px; }
.site-branding { display: flex; flex-direction: column; line-height: 1.2; }
.site-branding .name { font-size: 24px; font-weight: 600; letter-spacing: -0.01em; color: var(--primary); }
.site-branding .tagline { font-family: var(--font-sans); font-size: 10.4px; letter-spacing: 0.25em; text-transform: uppercase; color: var(--muted-foreground); margin-top: 2px; }

.primary-nav { display: none; align-items: center; gap: 32px; }
@media (min-width: 768px) { .primary-nav { display: flex; } }
.primary-nav a { font-family: var(--font-sans); font-size: 14px; color: color-mix(in oklab, var(--foreground) 80%, transparent); }
.primary-nav a:hover, .primary-nav a.current { color: var(--primary); }

.nav-books { position: relative; display: flex; align-items: center; }
.nav-books .caret { width: 14px; height: 14px; margin-left: 4px; }
.books-dropdown { position: absolute; right: 0; top: 100%; padding-top: 12px; width: 22rem; display: none; }
.nav-books:hover .books-dropdown, .nav-books:focus-within .books-dropdown { display: block; }
.books-dropdown-inner { border-radius: var(--radius); border: 1px solid var(--border); background: var(--card); padding: 8px; box-shadow: 0 20px 40px -10px rgba(20,12,5,0.25); max-height: 60vh; overflow-y: auto; }
.books-dropdown-inner a { display: block; border-radius: var(--radius); padding: 8px 12px; font-size: 14px; color: color-mix(in oklab, var(--foreground) 85%, transparent); }
.books-dropdown-inner a:hover { background: var(--secondary); color: var(--primary); }
.books-dropdown-inner a .bd-sub { margin-left: 4px; font-size: 12px; color: var(--muted-foreground); }

.nav-order-link { border-radius: var(--radius); border: 1px solid var(--border) !important; padding: 8px 16px; background: var(--card); }
.nav-order-link:hover { border-color: var(--primary) !important; }

.mobile-menu-toggle { display: inline-flex; background: none; border: 0; padding: 4px; color: var(--foreground); cursor: pointer; }
@media (min-width: 768px) { .mobile-menu-toggle { display: none; } }
.mobile-menu-toggle svg { width: 20px; height: 20px; }
.mobile-menu-toggle .icon-close { display: none; }

.mobile-nav { display: none; border-top: 1px solid var(--border); background: var(--background); }
.mobile-nav.is-open { display: block; }
@media (min-width: 768px) { .mobile-nav { display: none !important; } }
.mobile-nav .container { padding-top: 16px; padding-bottom: 16px; }
.mobile-nav a { display: block; padding: 8px 0; font-size: 14px; }
.mobile-nav .mobile-books-list { padding-left: 12px; margin-bottom: 8px; }
.mobile-nav .mobile-books-list a { padding: 6px 0; font-size: 14px; color: color-mix(in oklab, var(--foreground) 75%, transparent); }

/* Hero */
.hero { border-bottom: 1px solid var(--border); overflow: hidden; position: relative; }
.hero .container { display: grid; grid-template-columns: 1.1fr 1fr; gap: clamp(32px, 6vw, 64px); padding-top: clamp(56px, 9vw, 112px); padding-bottom: clamp(56px, 9vw, 112px); }
.hero-copy { display: flex; flex-direction: column; justify-content: center; }
.hero-copy h1 { margin-top: 20px; font-size: clamp(40px, 5.5vw, 72px); color: var(--primary); }
.hero-copy h1 em { font-style: normal; color: var(--foreground); }
.hero-copy p { margin-top: 24px; max-width: 42ch; color: color-mix(in oklab, var(--foreground) 80%, transparent); }
.hero-actions { margin-top: 32px; display: flex; flex-wrap: wrap; gap: 12px; }
.hero-image { position: relative; display: flex; align-items: center; justify-content: center; }
.hero-image img { max-height: 560px; width: auto; margin: 0 auto; filter: drop-shadow(0 25px 35px rgba(20,12,5,0.25)); }
@media (max-width: 860px) { .hero .container { grid-template-columns: 1fr; } }

/* Featured book */
.featured-book { border-bottom: 1px solid var(--border); background: color-mix(in oklab, var(--secondary) 30%, transparent); }
.featured-book .container { display: grid; grid-template-columns: 1fr 1.2fr; gap: clamp(32px, 6vw, 64px); align-items: center; padding-top: clamp(56px, 8vw, 80px); padding-bottom: clamp(56px, 8vw, 80px); }
.featured-book .plate-link { display: block; }
.featured-book .plate { border-radius: var(--radius); border: 1px solid var(--border); background: var(--background); padding: 32px; box-shadow: 0 20px 40px -15px rgba(20,12,5,0.25); }
.featured-book .plate img { max-height: 480px; width: auto; margin: 0 auto; }
.featured-book h2 { margin-top: 16px; font-size: clamp(28px, 3.5vw, 44px); color: var(--primary); }
.featured-book .book-sub { margin-top: 4px; font-family: var(--font-display); font-size: 20px; font-style: italic; color: color-mix(in oklab, var(--foreground) 80%, transparent); }
.featured-book .desc { margin-top: 24px; color: color-mix(in oklab, var(--foreground) 80%, transparent); }
.featured-book dl { margin-top: 24px; display: grid; grid-template-columns: 1fr 1fr; gap: 16px; font-size: 14px; }
.featured-book dt { font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted-foreground); }
.featured-book dd { margin: 4px 0 0; color: color-mix(in oklab, var(--foreground) 78%, transparent); }
.featured-book .inside-link { margin-top: 32px; display: inline-flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 500; color: var(--primary); }
.featured-book .inside-link svg { width: 16px; height: 16px; }
@media (max-width: 860px) { .featured-book .container { grid-template-columns: 1fr; } }

/* Catalogue grid */
.catalogue { padding-top: clamp(56px, 8vw, 80px); padding-bottom: clamp(56px, 8vw, 80px); }
.catalogue-head { margin-bottom: 48px; display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.catalogue-head h2, .catalogue-head h1 { margin-top: 12px; font-size: clamp(28px, 3.5vw, 40px); color: var(--primary); }
.catalogue-head .view-all { font-size: 14px; color: var(--primary); }
.catalogue-head .view-all:hover { text-decoration: underline; }
.catalogue-intro { max-width: 60ch; margin-top: 20px; color: color-mix(in oklab, var(--foreground) 80%, transparent); }

.book-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 40px; }
@media (max-width: 980px) { .book-grid { grid-template-columns: repeat(2, 1fr); gap: 32px; } }
@media (max-width: 620px) { .book-grid { grid-template-columns: 1fr; } }

.book-card { display: block; }
.book-card .cover { aspect-ratio: 3 / 4; overflow: hidden; border-radius: var(--radius); border: 1px solid var(--border); background: color-mix(in oklab, var(--secondary) 40%, transparent); padding: 16px; }
.book-card .cover img { width: 100%; height: 100%; object-fit: contain; transition: transform 0.2s ease; }
.book-card:hover .cover img { transform: scale(1.03); }
.book-card .cover.no-image { display: flex; align-items: center; justify-content: center; color: var(--muted-foreground); font-size: 12px; text-transform: uppercase; letter-spacing: 0.08em; text-align: center; }
.book-card h3 { margin-top: 16px; font-size: 20px; }
.book-card:hover h3 { color: var(--primary); }
.book-card .book-sub { margin-top: 2px; font-size: 14px; font-style: italic; color: var(--muted-foreground); }

/* Single book */
.book-hero-section { border-bottom: 1px solid var(--border); background: color-mix(in oklab, var(--secondary) 30%, transparent); }
.book-hero-section .container { display: grid; grid-template-columns: 1fr 1.3fr; gap: clamp(32px, 6vw, 48px); align-items: center; padding-top: clamp(48px, 7vw, 80px); padding-bottom: clamp(48px, 7vw, 80px); }
.book-hero-section .plate { border-radius: var(--radius); border: 1px solid var(--border); background: var(--background); padding: 24px; box-shadow: 0 20px 40px -15px rgba(20,12,5,0.25); }
.book-hero-section .plate img { max-height: 520px; width: auto; margin: 0 auto; }
.book-hero-section h1 { margin-top: 16px; font-size: clamp(34px, 4.5vw, 60px); line-height: 1.05; color: var(--primary); }
.book-hero-section .book-sub { margin-top: 8px; font-family: var(--font-display); font-size: 24px; font-style: italic; color: color-mix(in oklab, var(--foreground) 80%, transparent); }
.book-hero-section .author-line { margin-top: 16px; font-size: 13px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--muted-foreground); }
.book-hero-section .desc { margin-top: 24px; color: color-mix(in oklab, var(--foreground) 85%, transparent); }

.spec-dl { margin-top: 32px; display: grid; grid-template-columns: 1fr 1fr; gap: 16px 24px; border-top: 1px solid var(--border); padding-top: 24px; font-size: 14px; }
.spec-dl .span-2 { grid-column: 1 / -1; }
.spec-dl dt { font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted-foreground); }
.spec-dl dd { margin: 4px 0 0; color: color-mix(in oklab, var(--foreground) 80%, transparent); }
.spec-dl ul { margin: 4px 0 0; padding-left: 20px; }

.order-btn { margin-top: 32px; }

.book-section { border-bottom: 1px solid var(--border); }
.book-section.no-border { border-bottom: none; }
.book-section .container { padding-top: 48px; padding-bottom: 48px; }
.book-section h2 { font-size: 28px; color: var(--primary); }
.section-head { margin-bottom: 24px; display: flex; align-items: baseline; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.section-head .note { font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted-foreground); }

.postage-table { width: 100%; border-collapse: collapse; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; font-size: 14px; }
.postage-table th { background: color-mix(in oklab, var(--secondary) 40%, transparent); text-align: left; padding: 12px 16px; font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted-foreground); }
.postage-table td { padding: 12px 16px; border-top: 1px solid var(--border); color: color-mix(in oklab, var(--foreground) 82%, transparent); }

.plates-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; }
@media (max-width: 860px) { .plates-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 560px) { .plates-grid { grid-template-columns: repeat(2, 1fr); } }
.plates-grid .plate-cell { aspect-ratio: 3/4; overflow: hidden; border-radius: var(--radius); border: 1px solid var(--border); background: var(--background); padding: 6px; }
.plates-grid .plate-cell img { width: 100%; height: 100%; object-fit: contain; transition: transform 0.2s ease; }
.plates-grid .plate-cell:hover img { transform: scale(1.03); }

.related-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 28px; }
@media (max-width: 860px) { .related-grid { grid-template-columns: repeat(2, 1fr); } }
.related-grid .cover { aspect-ratio: 3/4; overflow: hidden; border-radius: var(--radius); background: var(--background); padding: 12px; }
.related-grid .cover img { width: 100%; height: 100%; object-fit: contain; }
.related-grid h3 { margin-top: 12px; font-size: 17px; }
.related-grid a:hover h3 { color: var(--primary); }

/* Generic page content (non-Elementor pages) */
.page-content { padding-top: clamp(56px, 8vw, 96px); padding-bottom: clamp(56px, 8vw, 96px); }
.page-content .container { max-width: 720px; }
.page-content h1 { margin-top: 16px; font-size: clamp(34px, 4.5vw, 60px); color: var(--primary); }
.page-content .entry-content { margin-top: 40px; font-size: 18px; line-height: 1.7; color: color-mix(in oklab, var(--foreground) 85%, transparent); }
.page-content .entry-content > * + * { margin-top: 1.3em; }

/* Inside the book — plate viewer */
.inside-header { border-bottom: 1px solid var(--border); background: color-mix(in oklab, var(--secondary) 30%, transparent); }
.inside-header .container { padding-top: 48px; padding-bottom: 48px; }
.back-link { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--muted-foreground); }
.back-link:hover { color: var(--primary); }
.inside-header-row { margin-top: 24px; display: grid; grid-template-columns: auto 1fr; gap: 24px; align-items: end; }
.inside-cover { width: 96px; height: 128px; overflow: hidden; border-radius: var(--radius); border: 1px solid var(--border); background: var(--background); padding: 8px; box-shadow: 0 8px 20px -8px rgba(20,12,5,0.3); }
.inside-cover img { width: 100%; height: 100%; object-fit: contain; }
.inside-header-row h1 { margin-top: 8px; font-size: clamp(30px, 4vw, 44px); color: var(--primary); }
.inside-header-row .book-sub { margin-top: 4px; font-family: var(--font-display); font-size: 19px; font-style: italic; color: color-mix(in oklab, var(--foreground) 78%, transparent); }
.inside-header-row .author-line { margin-top: 10px; font-size: 12px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--muted-foreground); }
@media (max-width: 560px) { .inside-header-row { grid-template-columns: 1fr; } .inside-cover { width: 80px; height: 106px; } }

.inside-gallery { padding-top: 48px; padding-bottom: 48px; }
.gallery-count { text-align: right; margin-bottom: 16px; font-size: 11px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--muted-foreground); }

.plate-viewer { position: relative; border-radius: var(--radius); border: 1px solid var(--border); background: color-mix(in oklab, var(--secondary) 30%, transparent); overflow: hidden; }
.plate-frame { aspect-ratio: 4 / 3; display: flex; align-items: center; justify-content: center; padding: clamp(24px, 5vw, 48px); }
.plate-frame img { max-height: 100%; max-width: 100%; object-fit: contain; box-shadow: 0 16px 32px -10px rgba(20,12,5,0.35); }
.plate-nav { position: absolute; top: 50%; transform: translateY(-50%); border-radius: 999px; border: 1px solid var(--border); background: color-mix(in oklab, var(--background) 90%, transparent); padding: 10px; box-shadow: 0 6px 16px -6px rgba(20,12,5,0.3); cursor: pointer; color: var(--foreground); }
.plate-nav:hover { background: var(--primary); color: var(--primary-foreground); border-color: var(--primary); }
.plate-prev { left: 12px; }
.plate-next { right: 12px; }

.plate-caption { margin-top: 20px; text-align: center; font-family: var(--font-display); font-size: 19px; font-style: italic; color: color-mix(in oklab, var(--foreground) 85%, transparent); }

.thumb-strip { margin-top: 28px; display: flex; flex-wrap: wrap; gap: 8px; }
.thumb-strip .thumb { width: 56px; height: 56px; overflow: hidden; border-radius: var(--radius); border: 1px solid var(--border); background: var(--background); padding: 0; cursor: pointer; }
.thumb-strip .thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb-strip .thumb.is-active { border-color: var(--primary); box-shadow: 0 0 0 2px color-mix(in oklab, var(--primary) 30%, transparent); }

.inside-cta { border-top: 1px solid var(--border); background: color-mix(in oklab, var(--secondary) 30%, transparent); }
.inside-cta .container { padding-top: 48px; padding-bottom: 48px; text-align: center; }
.inside-cta p { font-family: var(--font-display); font-size: 22px; font-style: italic; color: color-mix(in oklab, var(--foreground) 80%, transparent); }
.inside-cta .btn { margin-top: 24px; }

/* Contact / Order page */
.contact-page { padding-top: clamp(56px, 8vw, 96px); padding-bottom: clamp(56px, 8vw, 96px); }
.contact-page .container { max-width: 760px; }
.contact-page h1 { margin-top: 16px; font-size: clamp(38px, 5vw, 60px); color: var(--primary); }
.contact-page .intro { margin-top: 24px; font-size: 18px; line-height: 1.7; color: color-mix(in oklab, var(--foreground) 85%, transparent); }

.contact-cards { margin-top: 48px; display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
@media (max-width: 620px) { .contact-cards { grid-template-columns: 1fr; } }
.contact-card { display: block; border-radius: var(--radius); border: 1px solid var(--border); background: var(--card); padding: 24px; transition: border-color 0.15s ease; }
a.contact-card:hover { border-color: var(--primary); }
.contact-card svg { color: var(--accent); }
.contact-card h2 { margin-top: 16px; font-size: 24px; color: var(--primary); }
.contact-card p { margin-top: 8px; color: color-mix(in oklab, var(--foreground) 80%, transparent); line-height: 1.6; }
a.contact-card:hover p { color: var(--primary); }

.postage-box { margin-top: 48px; border-radius: var(--radius); border: 1px solid var(--border); background: color-mix(in oklab, var(--secondary) 40%, transparent); padding: 24px; }
.postage-box h3 { font-size: 20px; color: var(--primary); }
.postage-box-grid { margin-top: 12px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px 16px; font-size: 14px; color: color-mix(in oklab, var(--foreground) 82%, transparent); }
@media (max-width: 560px) { .postage-box-grid { grid-template-columns: repeat(2, 1fr); } }
.postage-box-grid .rate-label { display: block; color: var(--muted-foreground); }

.site-footer { border-top: 1px solid var(--border); background: color-mix(in oklab, var(--secondary) 40%, transparent); }
.footer-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 48px; padding-top: 64px; padding-bottom: 64px; }
.footer-grid h3.brand { font-size: 20px; color: var(--primary); }
.footer-about p { margin-top: 12px; max-width: 32ch; font-size: 14px; color: var(--muted-foreground); }
.footer-grid h4 { font-family: var(--font-sans); font-size: 11px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--muted-foreground); font-weight: 500; }
.footer-links ul { list-style: none; margin: 16px 0 0; padding: 0; }
.footer-links li { margin-bottom: 8px; font-size: 14px; }
.footer-links a { color: color-mix(in oklab, var(--foreground) 80%, transparent); }
.footer-links a:hover { color: var(--primary); }
.footer-links .view-all { color: var(--primary); }
address { font-style: normal; font-size: 14px; line-height: 1.7; margin-top: 16px; color: color-mix(in oklab, var(--foreground) 80%, transparent); }
address a { color: var(--primary); }
.footer-bottom { border-top: 1px solid var(--border); padding: 24px 0; text-align: center; font-size: 12px; color: var(--muted-foreground); }
@media (max-width: 780px) { .footer-grid { grid-template-columns: 1fr; } }
.nav-links {
    display: flex;
    justify-content: center;
    gap: 12px;
    padding-top: clamp(56px, 8vw, 80px);
}

.nav-links a,
.nav-links span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 42px;
    height: 42px;
    padding: 0 14px;
    border: 1px solid #d6d1c4;
    /* color: #4a4238; */
    text-decoration: none;
    transition: .25s;
}

.nav-links a:hover {
    background: var(--primary);
    color: #fff;
}

.nav-links .current {
    background: var(--primary);
   
    color: #fff;
}
