/*
Theme Name:  Ali Bukhari Books
Theme URI:   https://alibukhariauthor.com
Author:      Ali Bukhari Books
Description: Custom author bookstore theme — clean, cover-led, literary.
Version:     1.0.0
Requires at least: 6.3
Tested up to: 6.7
Requires PHP: 8.1
License:     Proprietary
Text Domain: abb
*/

/* ─── Google Fonts ──────────────────────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,400;0,500;0,600;1,400;1,500&family=Inter:wght@300;400;500;600&display=swap');

/* ─── Tokens ─────────────────────────────────────────────────────────────────
   Light is the only mode — this is an author bookstore, covers bring color.
   ─────────────────────────────────────────────────────────────────────────── */
:root {
  --page:      #FFFFFF;
  --ink:       #18171C;
  --muted:     #5D5A66;
  --line:      #E6E4EA;
  --soft:      #F6F5F8;
  --accent:    #8B6120;    /* premium dark gold */
  --accent-lo: #C49A3C;    /* warm medium gold — hover states */
  --on-accent: #FFFFFF;

  --serif:  'Cormorant Garamond', Georgia, 'Times New Roman', serif;
  --sans:   'Inter', system-ui, -apple-system, sans-serif;

  --bar-h:  40px;   /* announcement bar */
  --nav-h:  72px;   /* main header */
}

/* ─── Reset ──────────────────────────────────────────────────────────────────*/
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--page);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }
button, input, select, textarea { font: inherit; }

/* ─── Utility ────────────────────────────────────────────────────────────────*/
.container {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding-left:  max(24px, env(safe-area-inset-left,  0px));
  padding-right: max(24px, env(safe-area-inset-right, 0px));
}
.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

/* ─── Announcement bar ───────────────────────────────────────────────────────*/
.abb-bar {
  position: sticky;
  top: 0;
  z-index: 200;
  background: var(--accent);
  color: var(--on-accent);
  height: var(--bar-h);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--sans);
  font-size: 0.8rem;
  letter-spacing: 0.06em;
  font-weight: 500;
  text-align: center;
}
.abb-bar a { color: var(--accent-lo); text-decoration: underline; }
.abb-bar .bar-close {
  position: absolute;
  right: 20px;
  background: none;
  border: none;
  color: rgba(255,255,255,0.6);
  cursor: pointer;
  font-size: 1.1rem;
  line-height: 1;
  padding: 4px;
}
.abb-bar .bar-close:hover { color: #fff; }

/* ─── Header ─────────────────────────────────────────────────────────────────*/
.abb-header {
  position: sticky;
  top: var(--bar-h);
  z-index: 100;
  background: var(--page);
  border-bottom: 1px solid var(--line);
  height: var(--nav-h);
}
.abb-header .container {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

/* Logo */
.abb-logo {
  flex-shrink: 0;
  display: flex;
  align-items: center;
}
.abb-logo img {
  height: 36px;
  width: auto;
}
.abb-logo-text {
  font-family: var(--serif);
  font-size: 1.45rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  color: var(--accent);
}

/* Nav */
.abb-nav {
  display: flex;
  align-items: center;
  gap: 36px;
}
.abb-nav a {
  font-size: 0.82rem;
  font-weight: 500;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--muted);
  transition: color 0.15s;
}
.abb-nav a:hover,
.abb-nav a.current { color: var(--ink); }

/* Cart icon */
.abb-cart-icon {
  position: relative;
  display: flex;
  align-items: center;
  color: var(--ink);
  cursor: pointer;
}
.abb-cart-icon svg { width: 22px; height: 22px; }
.abb-cart-count {
  position: absolute;
  top: -6px; right: -8px;
  background: var(--accent);
  color: #fff;
  font-size: 0.6rem;
  font-weight: 600;
  min-width: 16px; height: 16px;
  border-radius: 99px;
  display: flex; align-items: center; justify-content: center;
  padding: 0 3px;
}

/* Mobile menu toggle */
.abb-menu-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}
.abb-menu-toggle span {
  display: block;
  width: 22px; height: 1.5px;
  background: var(--ink);
  transition: transform 0.2s, opacity 0.2s;
}

/* ─── Hero (homepage featured book) ─────────────────────────────────────────*/
.abb-hero {
  padding: 80px 0 72px;
  background: var(--page);
}
.abb-hero .container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 80px;
  align-items: center;
}
.abb-hero-text { order: 1; }
.abb-hero-image { order: 2; }

.abb-hero-eyebrow {
  display: inline-block;
  font-family: var(--sans);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 20px;
}
.abb-hero-title {
  font-family: var(--serif);
  font-size: clamp(2.8rem, 5vw, 4.2rem);
  font-weight: 500;
  line-height: 1.1;
  color: var(--ink);
  margin-bottom: 16px;
  text-wrap: balance;
}
.abb-hero-title em { font-style: italic; }
.abb-hero-byline {
  font-family: var(--serif);
  font-size: 1.05rem;
  color: var(--muted);
  margin-bottom: 24px;
  font-style: italic;
}
.abb-hero-desc {
  font-size: 0.97rem;
  color: var(--muted);
  line-height: 1.75;
  max-width: 44ch;
  margin-bottom: 36px;
}
.abb-hero-actions {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  align-items: center;
}

/* Book cover */
.abb-hero-image {
  display: flex;
  justify-content: center;
}
.abb-hero-cover {
  width: 100%;
  max-width: 340px;
  aspect-ratio: 2/3;
  object-fit: cover;
  box-shadow: 12px 20px 60px rgba(62,52,112,0.18), 0 4px 16px rgba(0,0,0,0.1);
  border-radius: 3px;
}
.abb-hero-cover-placeholder {
  width: 100%;
  max-width: 340px;
  aspect-ratio: 2/3;
  background: var(--soft);
  border: 2px dashed var(--line);
  border-radius: 3px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 0.8rem;
  text-align: center;
  padding: 24px;
}

/* ─── Buttons ────────────────────────────────────────────────────────────────*/
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 13px 28px;
  border-radius: 3px;
  font-family: var(--sans);
  font-size: 0.83rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  border: 1.5px solid transparent;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  line-height: 1;
}
.btn-primary {
  background: var(--accent);
  color: var(--on-accent);
  border-color: var(--accent);
}
.btn-primary:hover {
  background: #2e2557;
  border-color: #2e2557;
}
.btn-outline {
  background: transparent;
  color: var(--ink);
  border-color: var(--line);
}
.btn-outline:hover {
  border-color: var(--ink);
}

/* ─── Section headings ───────────────────────────────────────────────────────*/
.abb-section { padding: 72px 0; }
.abb-section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 40px;
  gap: 16px;
}
.abb-section-title {
  font-family: var(--serif);
  font-size: clamp(1.7rem, 3vw, 2.4rem);
  font-weight: 500;
  color: var(--ink);
}
.abb-section-link {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  white-space: nowrap;
  border-bottom: 1px solid var(--accent-lo);
  padding-bottom: 1px;
  transition: border-color 0.15s;
}
.abb-section-link:hover { border-color: var(--accent); }

/* ─── Book grid (shop archive) ───────────────────────────────────────────────*/
.abb-books-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 36px 28px;
}

.abb-book-card {
  display: flex;
  flex-direction: column;
}
.abb-book-card:hover .abb-book-cover { transform: translateY(-4px); box-shadow: 8px 20px 48px rgba(62,52,112,0.18); }

.abb-book-cover-wrap {
  position: relative;
  margin-bottom: 16px;
  overflow: visible;
}
.abb-book-cover {
  width: 100%;
  aspect-ratio: 2/3;
  object-fit: cover;
  border-radius: 3px;
  box-shadow: 4px 8px 28px rgba(0,0,0,0.12);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.abb-book-cover-placeholder {
  width: 100%;
  aspect-ratio: 2/3;
  background: var(--soft);
  border-radius: 3px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 0.75rem;
}
.abb-book-badge {
  position: absolute;
  top: 10px; left: 10px;
  background: var(--accent);
  color: #fff;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 2px;
}

.abb-book-series {
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 4px;
}
.abb-book-title {
  font-family: var(--serif);
  font-size: 1.15rem;
  font-weight: 500;
  line-height: 1.25;
  color: var(--ink);
  margin-bottom: 6px;
}
.abb-book-genres {
  font-size: 0.72rem;
  color: var(--muted);
  margin-bottom: 10px;
}
.abb-book-price {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 2px;
}
.abb-book-formats {
  font-size: 0.68rem;
  color: var(--muted);
  letter-spacing: 0.03em;
}

/* ─── About strip ────────────────────────────────────────────────────────────*/
.abb-about-strip {
  background: var(--soft);
  padding: 72px 0;
}
.abb-about-strip .container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 80px;
  align-items: center;
}
.abb-about-photo {
  width: 100%;
  max-width: 420px;
  aspect-ratio: 4/5;
  object-fit: cover;
  border-radius: 3px;
}
.abb-about-photo-placeholder {
  width: 100%;
  max-width: 420px;
  aspect-ratio: 4/5;
  background: var(--line);
  border-radius: 3px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 0.8rem;
  text-align: center;
  padding: 24px;
}
.abb-about-eyebrow {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 16px;
}
.abb-about-title {
  font-family: var(--serif);
  font-size: clamp(1.8rem, 2.5vw, 2.6rem);
  font-weight: 500;
  line-height: 1.2;
  margin-bottom: 20px;
}
.abb-about-title em { font-style: italic; }
.abb-about-body {
  font-size: 0.97rem;
  color: var(--muted);
  line-height: 1.8;
  margin-bottom: 28px;
  max-width: 52ch;
}

/* ─── Series section ─────────────────────────────────────────────────────────*/
.abb-series {
  background: var(--accent);
  color: #fff;
  padding: 72px 0;
}
.abb-series .abb-section-title { color: #fff; }
.abb-series .abb-section-link { color: var(--accent-lo); border-color: rgba(188,178,244,0.4); }
.abb-series .abb-section-link:hover { border-color: var(--accent-lo); }
.abb-series-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 28px;
}
.abb-series-card { position: relative; }
.abb-series-card .abb-book-cover {
  box-shadow: 4px 12px 36px rgba(0,0,0,0.28);
}
.abb-series-num {
  font-family: var(--serif);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent-lo);
  margin-bottom: 4px;
  margin-top: 14px;
}
.abb-series-title {
  font-family: var(--serif);
  font-size: 1.05rem;
  font-weight: 500;
  color: #fff;
}

/* ─── Newsletter strip ───────────────────────────────────────────────────────*/
.abb-newsletter {
  padding: 80px 0;
  text-align: center;
  border-top: 1px solid var(--line);
}
.abb-newsletter-title {
  font-family: var(--serif);
  font-size: clamp(1.6rem, 2.5vw, 2.4rem);
  font-weight: 500;
  margin-bottom: 10px;
}
.abb-newsletter-sub {
  font-size: 0.95rem;
  color: var(--muted);
  margin-bottom: 32px;
  max-width: 48ch;
  margin-left: auto;
  margin-right: auto;
}
.abb-newsletter-form {
  display: flex;
  gap: 10px;
  max-width: 420px;
  margin: 0 auto;
}
.abb-newsletter-form input[type="email"] {
  flex: 1;
  padding: 13px 18px;
  border: 1.5px solid var(--line);
  border-radius: 3px;
  font-size: 0.9rem;
  background: var(--page);
  color: var(--ink);
  outline: none;
  transition: border-color 0.15s;
}
.abb-newsletter-form input[type="email"]:focus { border-color: var(--accent); }
.abb-newsletter-privacy {
  font-size: 0.7rem;
  color: var(--muted);
  margin-top: 12px;
}

/* ─── Footer ─────────────────────────────────────────────────────────────────*/
.abb-footer {
  background: var(--ink);
  color: rgba(255,255,255,0.6);
  padding: 56px 0 32px;
}
.abb-footer-grid {
  display: grid;
  grid-template-columns: 1.8fr 1fr 1fr;
  gap: 48px;
  margin-bottom: 48px;
}
.abb-footer-logo img { height: 28px; width: auto; filter: brightness(0) invert(1); margin-bottom: 14px; }
.abb-footer-logo-text {
  font-family: var(--serif);
  font-size: 1.3rem;
  font-weight: 400;
  color: rgba(255,255,255,0.9);
  margin-bottom: 12px;
}
.abb-footer-tagline {
  font-size: 0.82rem;
  font-style: italic;
  color: rgba(255,255,255,0.45);
  margin-bottom: 20px;
}
.abb-footer-social {
  display: flex;
  gap: 14px;
}
.abb-footer-social a {
  color: rgba(255,255,255,0.45);
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.05em;
  transition: color 0.15s;
}
.abb-footer-social a:hover { color: rgba(255,255,255,0.9); }

.abb-footer-col-title {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.9);
  margin-bottom: 16px;
}
.abb-footer-links { display: flex; flex-direction: column; gap: 10px; }
.abb-footer-links a {
  font-size: 0.84rem;
  color: rgba(255,255,255,0.5);
  transition: color 0.15s;
}
.abb-footer-links a:hover { color: rgba(255,255,255,0.9); }

.abb-footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.1);
  padding-top: 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  font-size: 0.72rem;
  color: rgba(255,255,255,0.35);
}
.abb-footer-ntn { color: rgba(188,178,244,0.6); font-weight: 500; }

/* ─── Shop archive page ──────────────────────────────────────────────────────*/
.abb-shop-header {
  padding: 56px 0 40px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 56px;
}
.abb-shop-title {
  font-family: var(--serif);
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 500;
  margin-bottom: 10px;
}
.abb-shop-filters {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 24px;
}
.abb-filter-pill {
  padding: 7px 18px;
  border-radius: 99px;
  border: 1.5px solid var(--line);
  font-size: 0.77rem;
  font-weight: 500;
  color: var(--muted);
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
  background: var(--page);
}
.abb-filter-pill:hover,
.abb-filter-pill.active {
  border-color: var(--accent);
  color: var(--accent);
}
.abb-filter-pill.active { background: rgba(62,52,112,0.06); }

/* ─── Single product page ────────────────────────────────────────────────────*/
.abb-product {
  padding: 64px 0 80px;
}
.abb-product-inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 80px;
  align-items: start;
}
.abb-product-gallery {}
.abb-product-cover {
  width: 100%;
  max-width: 400px;
  margin: 0 auto;
  aspect-ratio: 2/3;
  object-fit: cover;
  border-radius: 3px;
  box-shadow: 12px 20px 60px rgba(62,52,112,0.18);
}
.abb-product-series-tag {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 10px;
}
.abb-product-title {
  font-family: var(--serif);
  font-size: clamp(1.8rem, 3vw, 2.8rem);
  font-weight: 500;
  line-height: 1.15;
  margin-bottom: 8px;
}
.abb-product-byline {
  font-family: var(--serif);
  font-size: 1rem;
  font-style: italic;
  color: var(--muted);
  margin-bottom: 20px;
}
.abb-product-price {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 28px;
}
.abb-product-desc {
  font-size: 0.95rem;
  color: var(--muted);
  line-height: 1.8;
  margin-bottom: 32px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 32px;
}

/* Format tabs */
.abb-format-label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 10px;
}
.abb-format-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 24px;
}
.abb-format-tab {
  padding: 9px 20px;
  border: 1.5px solid var(--line);
  border-radius: 3px;
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  background: var(--page);
  color: var(--muted);
  transition: border-color 0.15s, color 0.15s;
}
.abb-format-tab:hover { border-color: var(--ink); color: var(--ink); }
.abb-format-tab.selected { border-color: var(--accent); color: var(--accent); background: rgba(62,52,112,0.04); }

/* Dedication field */
.abb-dedication-wrap {
  display: none;
  margin-bottom: 24px;
}
.abb-dedication-wrap.visible { display: block; }
.abb-dedication-wrap label {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--ink);
  margin-bottom: 6px;
}
.abb-dedication-wrap .field-note {
  font-size: 0.7rem;
  color: var(--muted);
  margin-bottom: 8px;
  font-style: italic;
}
.abb-dedication-wrap input,
.abb-dedication-wrap textarea {
  width: 100%;
  padding: 11px 14px;
  border: 1.5px solid var(--line);
  border-radius: 3px;
  font-size: 0.9rem;
  color: var(--ink);
  background: var(--page);
  outline: none;
  transition: border-color 0.15s;
}
.abb-dedication-wrap input:focus,
.abb-dedication-wrap textarea:focus { border-color: var(--accent); }
.abb-dedication-wrap textarea { resize: vertical; min-height: 80px; margin-top: 10px; }

/* ─── Breadcrumb ─────────────────────────────────────────────────────────────*/
.abb-breadcrumb {
  padding: 18px 0;
  font-size: 0.75rem;
  color: var(--muted);
  display: flex;
  gap: 8px;
  align-items: center;
  border-bottom: 1px solid var(--line);
}
.abb-breadcrumb a { color: var(--muted); }
.abb-breadcrumb a:hover { color: var(--ink); }
.abb-breadcrumb-sep { color: var(--line); }

/* ─── WooCommerce overrides ──────────────────────────────────────────────────*/
.woocommerce-notices-wrapper { margin-bottom: 24px; }
.woocommerce-message,
.woocommerce-info {
  background: var(--soft);
  border-left: 3px solid var(--accent);
  padding: 14px 18px;
  font-size: 0.88rem;
  border-radius: 0 3px 3px 0;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.woocommerce-error {
  background: #FEF2F2;
  border-left: 3px solid #DC2626;
  padding: 14px 18px;
  font-size: 0.88rem;
  border-radius: 0 3px 3px 0;
}

/* ─── Responsive ─────────────────────────────────────────────────────────────*/
@media (max-width: 1024px) {
  .abb-books-grid { grid-template-columns: repeat(3, 1fr); }
  .abb-series-grid { grid-template-columns: repeat(3, 1fr); }
  .abb-footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 768px) {
  :root { --bar-h: 36px; --nav-h: 60px; }
  .abb-nav { display: none; }
  .abb-nav.open {
    display: flex;
    flex-direction: column;
    position: fixed;
    inset: 0;
    background: var(--page);
    z-index: 300;
    align-items: center;
    justify-content: center;
    gap: 32px;
  }
  .abb-nav.open a { font-size: 1.2rem; letter-spacing: 0.08em; }
  .abb-menu-toggle { display: flex; }
  .abb-hero .container { grid-template-columns: 1fr; gap: 40px; }
  .abb-hero-image { order: -1; }
  .abb-hero-cover { max-width: 220px; margin: 0 auto; }
  .abb-hero-text { text-align: center; }
  .abb-hero-desc { max-width: none; }
  .abb-hero-actions { justify-content: center; }
  .abb-books-grid { grid-template-columns: repeat(2, 1fr); gap: 24px 16px; }
  .abb-series-grid { grid-template-columns: repeat(2, 1fr); }
  .abb-about-strip .container { grid-template-columns: 1fr; gap: 40px; }
  .abb-about-photo, .abb-about-photo-placeholder { max-width: 100%; }
  .abb-product-inner { grid-template-columns: 1fr; gap: 40px; }
  .abb-product-cover { max-width: 260px; }
  .abb-footer-grid { grid-template-columns: 1fr; gap: 32px; }
  .abb-newsletter-form { flex-direction: column; }
}

@media (max-width: 480px) {
  .abb-books-grid { grid-template-columns: repeat(2, 1fr); gap: 16px 12px; }
  .abb-series-grid { grid-template-columns: repeat(2, 1fr); }
}
