/*
 * Tajalli — presentation layer shipped with the plugin.
 *
 * Lives here rather than in the theme so a single plugin upload delivers it.
 * Two jobs: retire the duplicated brand lockup, and warm the site up without
 * disturbing its calm.
 */

/* ---------------------------------------------------------------------------
 * 1. The hero lockup
 *
 * The header already carries the logo, so the large Arabic wordmark and the
 * repeated TAJALLI beneath it were saying the same thing a third time. The
 * ornament, tagline and button stay — the page now opens on the words.
 * ------------------------------------------------------------------------- */

.hero-ar,
.hero h1,
.page-404 .hero-ar {
  display: none !important;
}

.hero {
  padding-top: clamp(48px, 9vh, 104px);
}

.hero .ornament {
  margin-bottom: 1.6em;
}

.hero-tagline {
  max-width: 34ch;
  margin-left: auto;
  margin-right: auto;
}

/* ---------------------------------------------------------------------------
 * 2. Warmth
 *
 * A hint of gold and a slightly warmer paper. Deliberately restrained: the
 * artwork should still be the most colourful thing on any page.
 * ------------------------------------------------------------------------- */

:root {
  --taj-gold: #a9852f;
  --taj-gold-soft: rgba(169, 133, 47, 0.28);
  --taj-green: #1f5c43;
  --taj-warm: #fbf8f2;
}

body {
  background-color: var(--taj-warm);
}

/* A barely-there wash so long pages are not a flat slab of cream. */
.site-header {
  background-image: linear-gradient(180deg, rgba(169, 133, 47, 0.05), rgba(169, 133, 47, 0));
}

.ornament span,
.ornament::before,
.ornament::after {
  background-color: var(--taj-gold) !important;
}

.section-head .label {
  color: var(--taj-gold);
  letter-spacing: 0.24em;
}

/* Links and buttons pick up the gold on approach rather than sitting on it. */
.btn,
.taj-btn {
  transition: background-color 0.35s ease, color 0.35s ease, border-color 0.35s ease, transform 0.35s ease, box-shadow 0.35s ease;
}

.btn:hover,
.btn:focus-visible,
.taj-btn:hover,
.taj-btn:focus-visible {
  border-color: var(--taj-gold);
  box-shadow: 0 6px 22px -12px rgba(28, 25, 23, 0.55);
  transform: translateY(-1px);
}

.site-nav a {
  transition: color 0.3s ease;
}

.site-nav a:hover,
.site-nav a:focus-visible {
  color: var(--taj-gold);
}

/* ---------------------------------------------------------------------------
 * 3. Artwork cards
 *
 * A slow lift and a slow zoom. Long durations are the whole point — quick
 * motion would read as busy, which is the opposite of what this site is.
 * ------------------------------------------------------------------------- */

.work-card,
.taj-card,
.card {
  transition: transform 0.5s cubic-bezier(0.22, 0.61, 0.36, 1), box-shadow 0.5s ease;
}

.work-card:hover,
.taj-card:hover,
.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 22px 42px -30px rgba(28, 25, 23, 0.7);
}

.work-card img,
.card img,
.taj-basket-thumb img {
  transition: transform 1.1s cubic-bezier(0.22, 0.61, 0.36, 1), filter 0.6s ease;
  will-change: transform;
}

.work-card:hover img,
.card:hover img {
  transform: scale(1.035);
}

/* ---------------------------------------------------------------------------
 * 4. Scroll reveals
 *
 * The class is added by refresh.js only when IntersectionObserver exists, so
 * without JavaScript everything is simply visible — never a blank page.
 * ------------------------------------------------------------------------- */

.taj-reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.9s ease, transform 0.9s cubic-bezier(0.22, 0.61, 0.36, 1);
  will-change: opacity, transform;
}

.taj-reveal.taj-in {
  opacity: 1;
  transform: none;
}

/* Stagger siblings a little so a grid arrives as a wave, not a block. */
.taj-reveal:nth-child(2) { transition-delay: 0.07s; }
.taj-reveal:nth-child(3) { transition-delay: 0.14s; }
.taj-reveal:nth-child(4) { transition-delay: 0.21s; }
.taj-reveal:nth-child(5) { transition-delay: 0.28s; }
.taj-reveal:nth-child(6) { transition-delay: 0.35s; }

/* ---------------------------------------------------------------------------
 * 5. Pay now block in the basket
 * ------------------------------------------------------------------------- */

.taj-paynow {
  border: 1px solid var(--taj-gold-soft);
  background: rgba(169, 133, 47, 0.05);
  padding: 22px 24px;
  margin: 28px 0;
}

.taj-paynow-list {
  list-style: none;
  margin: 0 0 12px;
  padding: 0;
}

.taj-paynow-list li {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding: 7px 0;
  border-bottom: 1px solid rgba(28, 25, 23, 0.08);
}

.taj-paynow-total {
  text-align: right;
  font-size: 1.05rem;
  margin: 10px 0 16px;
}

.taj-btn-pay {
  background: #1c1917;
  color: #faf7f1;
  border-color: #1c1917;
}

.taj-btn-pay:hover,
.taj-btn-pay:focus-visible {
  background: var(--taj-green);
  border-color: var(--taj-green);
  color: #fff;
}

.taj-wallets {
  font-size: 12.5px;
  opacity: 0.75;
}

/* ---------------------------------------------------------------------------
 * 6. Donation appeal
 * ------------------------------------------------------------------------- */

.taj-donate .taj-h,
.taj-donate-card .taj-h {
  margin-bottom: 0.5em;
}

.taj-progress {
  margin: 26px 0;
}

.taj-progress-bar {
  height: 9px;
  background: rgba(28, 25, 23, 0.09);
  border-radius: 999px;
  overflow: hidden;
}

.taj-progress-bar span {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--taj-green), var(--taj-gold));
  /* Grows into place on first paint, so the number feels earned. */
  animation: taj-fill 1.6s cubic-bezier(0.22, 0.61, 0.36, 1) both;
}

@keyframes taj-fill {
  from { transform: scaleX(0); transform-origin: left; }
  to   { transform: scaleX(1); transform-origin: left; }
}

.taj-progress-label {
  margin: 10px 0 0;
  font-size: 14px;
  color: #57534e;
}

.taj-amounts {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 18px 0 6px;
}

.taj-amount input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.taj-amount span {
  display: inline-block;
  padding: 11px 20px;
  border: 1px solid rgba(28, 25, 23, 0.22);
  cursor: pointer;
  transition: border-color 0.3s ease, background-color 0.3s ease, color 0.3s ease;
}

.taj-amount span:hover {
  border-color: var(--taj-gold);
}

.taj-amount input:checked + span {
  background: #1c1917;
  border-color: #1c1917;
  color: #faf7f1;
}

.taj-amount input:focus-visible + span {
  outline: 2px solid var(--taj-gold);
  outline-offset: 2px;
}

/* The free-text box only matters once "Other amount" is chosen. */
.taj-other-field {
  display: none;
}

.taj-donate-form.taj-other .taj-other-field {
  display: block;
}

.taj-donate-card {
  border-left: 3px solid var(--taj-gold);
}

/* ---------------------------------------------------------------------------
 * 7. Respect the visitor
 * ------------------------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
  .taj-reveal,
  .taj-reveal.taj-in {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }

  .work-card,
  .card,
  .taj-card,
  .work-card img,
  .card img,
  .btn,
  .taj-btn,
  .taj-progress-bar span {
    transition: none !important;
    animation: none !important;
  }

  .work-card:hover,
  .card:hover,
  .taj-card:hover {
    transform: none;
  }
}

/* ---------------------------------------------------------------------------
 * 8. Quick buy on grid cards
 * ------------------------------------------------------------------------- */

.taj-card-buyable {
  display: flex;
  flex-direction: column;
}

.taj-card-buyable .taj-card-link {
  display: block;
  flex: 1 1 auto;
}

.taj-quickbuy {
  margin: 10px 0 0;
}

.taj-btn-quick {
  width: 100%;
  padding: 9px 12px;
  font-size: 13px;
  letter-spacing: 0.08em;
}

/* ---------------------------------------------------------------------------
 * 9. Digital size picker
 * ------------------------------------------------------------------------- */

.taj-sizes {
  display: grid;
  gap: 8px;
  margin: 6px 0 18px;
}

.taj-size input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.taj-size span {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 16px;
  border: 1px solid rgba(28, 25, 23, 0.18);
  cursor: pointer;
  transition: border-color 0.3s ease, background-color 0.3s ease;
}

.taj-size span em {
  font-style: normal;
  white-space: nowrap;
}

.taj-size span:hover {
  border-color: var(--taj-gold);
}

.taj-size input:checked + span {
  border-color: #1c1917;
  background: rgba(169, 133, 47, 0.07);
  box-shadow: inset 3px 0 0 var(--taj-gold);
}

.taj-size input:focus-visible + span {
  outline: 2px solid var(--taj-gold);
  outline-offset: 2px;
}

/* ---------------------------------------------------------------------------
 * 10. Apple Pay / Google Pay button
 *
 * Hidden until the script confirms the device can actually offer a wallet, so
 * there is never an empty box or a button that does nothing.
 * ------------------------------------------------------------------------- */

.taj-wallet-slot[hidden] {
  display: none;
}

.taj-wallet-slot {
  margin: 0 0 14px;
  max-width: 420px;
}

#taj-wallet-button {
  min-height: 46px;
}

.taj-wallet-slot .taj-wallet-error {
  color: #b32d2e;
  margin: 8px 0 0;
  font-size: 13px;
}

/* A quiet divider so the wallet button reads as the fast path, with the
   ordinary buttons underneath as the alternative. */
.taj-wallet-slot::after {
  content: "";
  display: block;
  height: 1px;
  margin: 14px 0 0;
  background: rgba(28, 25, 23, 0.1);
}
