/*
 * Al-Muassasa Al-Jami'iyya — London International Publisher Skin
 * تصميم دار النشر الأكاديمية الدولية — لندن
 * Inspired by: Oxford UP · Cambridge UP · I.B.Tauris · Bloomsbury Academic
 */

/* ═══════════════════════════════════════════════════
   GOOGLE FONTS — PRELOADED VIA functions.php
   Playfair Display (display serif)
   EB Garamond (body serif)
   IBM Plex Sans Arabic (Arabic UI)
   Amiri (Arabic academic)
═══════════════════════════════════════════════════ */

/* ═══════════════════════════════════════════════════
   DESIGN TOKENS — London Academic Publisher
═══════════════════════════════════════════════════ */
:root {
  /* Palette */
  --ox-blue:       #001F3F;   /* Oxford deep navy */
  --ox-blue-mid:   #003166;
  --ox-blue-lt:    #1A4A7A;
  --rule-gold:     #7A5C1E;   /* Muted academic gold */
  --rule-gold-lt:  #A8802E;
  --gold-line:     #C4973C;   /* Decorative rule lines */
  --parchment:     #F5F0E6;   /* Page background */
  --parchment-mid: #EDE5D6;
  --parchment-dk:  #E0D6C4;
  --burgundy:      #5C1A28;   /* Accent / series badges */
  --ink:           #1A1612;   /* Near-black for text */
  --ink-mid:       #3D3530;
  --ink-soft:      #5C544C;
  --muted:         #8A7F76;
  --border:        #D5CFC5;
  --border-lt:     #E8E2D8;
  --white:         #FFFFFF;
  --strip-bg:      #001226;   /* Top strip */

  /* Typography */
  --font-display:  'Playfair Display', 'EB Garamond', Georgia, serif;
  --font-serif:    'EB Garamond', Georgia, 'Times New Roman', serif;
  --font-arabic-h: 'Amiri', 'Scheherazade New', Georgia, serif;
  --font-arabic:   'IBM Plex Sans Arabic', 'Cairo', 'Tajawal', sans-serif;
  --font-ui:       'IBM Plex Sans', 'Source Sans 3', system-ui, sans-serif;

  /* Spacing rhythm */
  --rule-width:     1px;
  --rule-gold-w:    2px;
}

/* ═══════════════════════════════════════════════════
   BASE OVERRIDES
═══════════════════════════════════════════════════ */
body {
  background: var(--parchment);
  color: var(--ink);
  font-family: var(--font-arabic);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5 {
  font-family: var(--font-arabic-h);
  color: var(--ox-blue);
  font-weight: 700;
}

/* ═══════════════════════════════════════════════════
   HEADER — International Publisher Style
═══════════════════════════════════════════════════ */

.aw-header {
  background: var(--white);
  border-bottom: none;
  box-shadow: none;
  position: sticky;
  top: 0;
  z-index: 300;
}

/* Top strip — very thin, like OUP */
.aw-header__strip {
  background: var(--strip-bg);
  color: rgba(255,255,255,.55);
  font-family: var(--font-ui);
  font-size: 11.5px;
  font-weight: 400;
  letter-spacing: .06em;
  padding: 7px 0;
  text-align: center;
  border-bottom: 1px solid rgba(196,151,60,.3);
}
.aw-header__strip a {
  color: var(--gold-line);
  font-weight: 500;
  text-decoration: none;
  transition: opacity .15s;
}
.aw-header__strip a:hover { opacity: .8; }

/* Publisher identity row */
.aw-header__identity {
  background: var(--white);
  border-bottom: var(--rule-width) solid var(--border);
  padding: 0;
}

.aw-header__identity-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 18px 0 16px;
}

/* ── Logo / Publisher Name ── */
.aw-logo {
  display: flex;
  flex-direction: column;
  gap: 0;
  text-decoration: none;
  border-left: 3px solid var(--gold-line);
  padding-left: 14px;
}
.aw-logo:hover { opacity: .85; }

.aw-logo__name {
  font-family: var(--font-arabic-h);
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--ox-blue);
  letter-spacing: .01em;
  line-height: 1.2;
}

.aw-logo__sub {
  font-family: var(--font-ui);
  font-size: 9.5px;
  font-weight: 500;
  color: var(--rule-gold);
  letter-spacing: .22em;
  text-transform: uppercase;
  margin-top: 3px;
}

.aw-logo:hover .aw-logo__name { color: var(--rule-gold); }

/* ── Search ── */
.aw-search__form {
  background: var(--parchment);
  border: 1px solid var(--border);
  border-radius: 3px;
  overflow: hidden;
  transition: border-color .2s, box-shadow .2s;
}
.aw-search__form:focus-within {
  border-color: var(--rule-gold);
  background: var(--white);
  box-shadow: 0 0 0 3px rgba(122,92,30,.10);
}
.aw-search__input {
  background: transparent;
  font-family: var(--font-arabic);
  font-size: 13.5px;
  height: 40px;
  color: var(--ink);
}
.aw-search__input::placeholder { color: var(--muted); }
.aw-search__btn {
  background: var(--ox-blue);
  color: var(--white);
  width: 40px;
  height: 40px;
  transition: background .15s;
}
.aw-search__btn:hover { background: var(--ox-blue-lt); }

/* ── Nav icons ── */
.aw-nav__link {
  font-family: var(--font-arabic);
  font-size: 13px;
  color: var(--ink-soft);
  border-radius: 3px;
  padding: 7px 10px;
}
.aw-nav__link:hover {
  background: var(--parchment-mid);
  color: var(--ox-blue);
}
.aw-nav__link--cart {
  background: var(--ox-blue);
  color: var(--white) !important;
}
.aw-nav__link--cart:hover {
  background: var(--ox-blue-lt);
}
.aw-nav__cart-count {
  background: var(--gold-line);
}

/* ── Main nav (subnav) — horizontal rule style ── */
.aw-subnav {
  background: var(--ox-blue);
  border-top: none;
  border-bottom: 3px solid var(--gold-line);
}

.aw-subnav__inner {
  display: flex;
  gap: 0;
  padding: 0;
}

.aw-subnav__inner > a,
.aw-subnav__inner .menu-item > a,
.aw-subnav__link {
  font-family: var(--font-arabic);
  font-size: 13px;
  font-weight: 500;
  color: rgba(255,255,255,.75);
  padding: 12px 18px;
  letter-spacing: .03em;
  border-bottom: 3px solid transparent;
  margin-bottom: -3px;
  transition: color .15s, border-color .15s, background .15s;
  white-space: nowrap;
}

.aw-subnav__inner > a:hover,
.aw-subnav__inner .menu-item > a:hover,
.aw-subnav__inner .current-menu-item > a,
.aw-subnav__link:hover {
  color: var(--white);
  border-color: var(--gold-line);
  background: rgba(255,255,255,.07);
}

/* ─── Gold decorative top rule on entire header ─── */
.aw-header::before {
  content: '';
  display: block;
  height: 4px;
  background: linear-gradient(90deg, var(--ox-blue) 0%, var(--gold-line) 40%, var(--rule-gold) 70%, var(--ox-blue) 100%);
}

/* ═══════════════════════════════════════════════════
   FOOTER — Academic Publisher London Style
═══════════════════════════════════════════════════ */
.aw-footer {
  background: var(--ox-blue);
  color: rgba(255,255,255,.6);
  margin-top: 0;
  border-top: 4px solid var(--gold-line);
}

/* Publisher crest section */
.aw-footer__crest {
  text-align: center;
  padding: 40px 0 28px;
  border-bottom: 1px solid rgba(196,151,60,.2);
}

.aw-footer__crest-name {
  font-family: var(--font-arabic-h);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--white);
  letter-spacing: .02em;
  display: block;
  margin-bottom: 6px;
}

.aw-footer__crest-tagline {
  font-family: var(--font-ui);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .3em;
  text-transform: uppercase;
  color: var(--gold-line);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}
.aw-footer__crest-tagline::before,
.aw-footer__crest-tagline::after {
  content: '';
  width: 40px;
  height: 1px;
  background: var(--gold-line);
  opacity: .6;
}

/* Grid columns */
.aw-footer__main {
  display: grid;
  grid-template-columns: 2.2fr 1fr 1fr 1fr;
  gap: 40px;
  padding: 44px 0 36px;
}

.aw-footer__brand-name {
  font-family: var(--font-arabic-h);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--white);
  margin-bottom: 10px;
}

.aw-footer__brand-desc {
  font-size: 13px;
  line-height: 1.9;
  color: rgba(255,255,255,.45);
  margin-bottom: 18px;
}

.aw-footer__col-title {
  font-family: var(--font-ui);
  font-size: 10px;
  font-weight: 700;
  color: var(--gold-line);
  letter-spacing: .18em;
  text-transform: uppercase;
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(196,151,60,.2);
}

.aw-footer__col ul { display: grid; gap: 9px; }

.aw-footer__col ul li a {
  font-size: 13px;
  color: rgba(255,255,255,.5);
  font-weight: 400;
  transition: color .15s, padding-right .15s;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.aw-footer__col ul li a::before {
  content: '›';
  color: var(--gold-line);
  opacity: 0;
  transition: opacity .15s;
}
.aw-footer__col ul li a:hover {
  color: rgba(255,255,255,.9);
}
.aw-footer__col ul li a:hover::before { opacity: 1; }

/* London address block */
.aw-footer__address {
  display: grid;
  gap: 5px;
  font-size: 12px;
  color: rgba(255,255,255,.38);
  font-style: normal;
  margin-top: 12px;
  line-height: 1.7;
}

/* Social */
.aw-footer__social { display: flex; gap: 8px; margin-top: 16px; }
.aw-footer__social a {
  width: 32px;
  height: 32px;
  border-radius: 3px;
  border: 1px solid rgba(196,151,60,.3);
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255,255,255,.5);
  transition: background .15s, border-color .15s, color .15s;
}
.aw-footer__social a:hover {
  background: var(--gold-line);
  border-color: var(--gold-line);
  color: var(--white);
}

/* Bottom bar */
.aw-footer__bottom {
  border-top: 1px solid rgba(255,255,255,.07);
  padding: 16px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  font-size: 11.5px;
  color: rgba(255,255,255,.28);
  font-family: var(--font-ui);
  letter-spacing: .02em;
}
.aw-footer__bottom a {
  color: rgba(255,255,255,.4);
  transition: color .15s;
}
.aw-footer__bottom a:hover { color: var(--gold-line); }

@media (max-width: 900px) {
  .aw-footer__main { grid-template-columns: 1fr 1fr; gap: 28px; }
}
@media (max-width: 560px) {
  .aw-footer__main { grid-template-columns: 1fr; gap: 24px; padding: 32px 0 24px; }
}

/* ═══════════════════════════════════════════════════
   PRODUCT CARDS — Editorial catalogue style
═══════════════════════════════════════════════════ */
.aw-product-card,
.aw-product-card__inner,
li.product.type-product {
  border-radius: 4px !important;
}

/* Category / Series badge */
.aw-cat-badge {
  display: inline-block;
  font-family: var(--font-ui);
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--white);
  background: var(--ox-blue);
  padding: 3px 9px;
  border-radius: 2px;
}

/* ═══════════════════════════════════════════════════
   TYPOGRAPHY — Academic editorial style
═══════════════════════════════════════════════════ */

/* Page / section titles */
.aw-section-header__title,
.waad-hero__heading,
h2.aw-section-title {
  font-family: var(--font-arabic-h);
  color: var(--ox-blue);
}

/* Decorative ruled headings (like OUP chapter headings) */
.majd-ruled-heading {
  display: flex;
  align-items: center;
  gap: 14px;
  font-family: var(--font-arabic-h);
  font-size: 1.05rem;
  color: var(--ox-blue);
  margin-bottom: 20px;
}
.majd-ruled-heading::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(to left, transparent, var(--border));
}
.majd-ruled-heading::before {
  content: '';
  width: 28px;
  height: 3px;
  background: var(--gold-line);
  flex-shrink: 0;
  border-radius: 1px;
}

/* ═══════════════════════════════════════════════════
   PRODUCT PAGE — Academic monograph style
═══════════════════════════════════════════════════ */

/* Override product page background */
body.single-product {
  background: var(--parchment);
}

.waad-sp__title,
.aw-product__title {
  font-family: var(--font-arabic-h) !important;
  color: var(--ox-blue) !important;
}

/* "Tàlif:" author label — academic style */
.waad-sp__author span:first-child,
.aw-product__author-label {
  font-family: var(--font-ui);
  font-size: 10px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--rule-gold);
  font-weight: 700;
}

/* Spec cards — override colors to match publisher palette */
.majd-spec-card {
  background: var(--white);
  border-color: var(--border-lt);
  border-radius: 4px !important;
}
.majd-spec-card:hover {
  border-color: var(--parchment-dk);
  box-shadow: 0 4px 16px rgba(0,31,63,.08);
}

.majd-specs-list__row {
  background: var(--white);
  border-color: var(--border-lt);
  border-radius: 4px !important;
}
.majd-specs-list__row:hover {
  box-shadow: 0 3px 12px rgba(0,31,63,.07);
}

/* Tab navigation — journal style */
.waad-sp__tabs {
  border-bottom: 2px solid var(--ox-blue) !important;
}
.waad-sp__tab[aria-selected="true"],
.waad-sp__tab.is-active {
  background: var(--ox-blue) !important;
  color: var(--white) !important;
  border-color: var(--ox-blue) !important;
}
.waad-sp__tab:hover {
  background: var(--parchment-mid) !important;
  color: var(--ox-blue) !important;
}

/* Buy card */
.waad-sp__buycard {
  border-radius: 4px !important;
  border: 1px solid var(--border) !important;
  background: var(--white) !important;
}
.waad-sp__buy-status.is-instock {
  background: rgba(26,110,64,.08) !important;
  color: #1a6e40 !important;
  border-radius: 3px !important;
}

/* Add to cart button */
.single_add_to_cart_button,
.button.alt {
  background: var(--ox-blue) !important;
  border-radius: 3px !important;
  font-family: var(--font-arabic) !important;
  letter-spacing: .02em;
  border: none !important;
}
.single_add_to_cart_button:hover,
.button.alt:hover {
  background: var(--ox-blue-lt) !important;
}

/* ═══════════════════════════════════════════════════
   BUTTONS — academic press style
═══════════════════════════════════════════════════ */
.aw-btn,
.button,
.wp-element-button,
a.button {
  border-radius: 3px !important;
  font-family: var(--font-arabic) !important;
}

.aw-btn--primary {
  background: var(--ox-blue) !important;
}
.aw-btn--primary:hover {
  background: var(--ox-blue-lt) !important;
}

/* ═══════════════════════════════════════════════════
   DECORATIVE HORIZONTAL RULE (publisher divider)
═══════════════════════════════════════════════════ */
.majd-publisher-rule {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 24px 0;
}
.majd-publisher-rule::before,
.majd-publisher-rule::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}
.majd-publisher-rule__ornament {
  width: 6px;
  height: 6px;
  border: 1.5px solid var(--gold-line);
  transform: rotate(45deg);
  flex-shrink: 0;
}

/* ═══════════════════════════════════════════════════
   SERIES / IMPRINT BADGE
═══════════════════════════════════════════════════ */
.majd-series-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px 4px 10px;
  background: rgba(0,31,63,.06);
  border: 1px solid rgba(0,31,63,.14);
  border-radius: 3px;
  font-family: var(--font-ui);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--ox-blue);
}
.majd-series-badge::before {
  content: '';
  width: 3px;
  height: 14px;
  background: var(--gold-line);
  border-radius: 1px;
}

/* ═══════════════════════════════════════════════════
   ROMANIZATION — publisher style
   (more subtle, footnote-like)
═══════════════════════════════════════════════════ */
.majd-product-romanize {
  font-family: var(--font-serif) !important;
  color: var(--rule-gold) !important;
  font-size: 0.78em !important;
  letter-spacing: .03em;
  border-top: 1px solid var(--border-lt);
  padding-top: 3px;
  margin-top: 5px;
}

.majd-romanize-badge {
  font-family: var(--font-serif);
  background: rgba(122,92,30,.07);
  border-color: rgba(122,92,30,.18);
  color: var(--rule-gold);
}

/* ═══════════════════════════════════════════════════
   PAGINATION
═══════════════════════════════════════════════════ */
.woocommerce-pagination ul li .page-numbers,
.page-numbers {
  border-radius: 3px !important;
  font-family: var(--font-ui);
}
.woocommerce-pagination ul li .page-numbers.current,
.page-numbers.current {
  background: var(--ox-blue) !important;
  color: var(--white) !important;
}

/* ═══════════════════════════════════════════════════
   WOOCOMMERCE BREADCRUMB
═══════════════════════════════════════════════════ */
.woocommerce-breadcrumb {
  font-family: var(--font-ui);
  font-size: 12px;
  letter-spacing: .04em;
  color: var(--muted);
}
.woocommerce-breadcrumb a {
  color: var(--rule-gold);
  text-decoration: none;
}
.woocommerce-breadcrumb a:hover { text-decoration: underline; }

/* ═══════════════════════════════════════════════════
   RESPONSIVE
═══════════════════════════════════════════════════ */
@media (max-width: 860px) {
  .aw-header__identity-inner {
    grid-template-columns: 1fr auto;
    grid-template-rows: auto auto;
  }
  .aw-search { grid-column: 1 / -1; order: 3; }
  .aw-footer__crest { padding: 28px 0 20px; }
}
