/*
 * Basserli Global Theme
 * Loaded on every page after the Vite/Tailwind bundle.
 * Overrides dark CSS variables → light purple/paper theme.
 * Also contains navbar and footer component CSS.
 */

@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Sans+Arabic:wght@300;400;500;600;700&family=Noto+Kufi+Arabic:wght@400;500;600;700;800&family=Raleway:wght@300;400;500&family=Cormorant+Garamond:ital,wght@0,300;0,400;1,300;1,400&display=swap');

/* ─── CSS Variable Overrides ──────────────────────────────────────────────── */
/* Tailwind v4 utilities (bg-basserli-*, text-basserli-*, etc.) reference
   these custom properties, so overriding them here re-themes every utility. */
:root {
  --color-basserli-bg:        #f6eef9;
  --color-basserli-surface:   rgba(255, 250, 245, 0.92);
  --color-basserli-border:    rgba(76, 27, 108, 0.16);
  --color-basserli-text:      #2d123d;
  --color-basserli-muted:     #65536f;
  --color-basserli-gold:      #f1b74d;
  --color-basserli-gold-lt:   #ffd98e;
  --color-basserli-purple:    #35104f;
  --color-basserli-purple-lt: #531977;
  --color-basserli-navy:      #35104f;

  /* Homepage design tokens used by navbar/footer components */
  --bg:          #f6eef9;
  --paper:       rgba(255, 250, 245, 0.82);
  --paper-solid: #fff8f1;
  --ink:         #2d123d;
  --muted:       #65536f;
  --purple:      #35104f;
  --purple2:     #531977;
  --purple3:     #7c57a6;
  --gold:        #f1b74d;
  --gold2:       #d69225;
  --line:        rgba(76, 27, 108, 0.16);
  --shadow:      0 22px 64px rgba(56, 14, 81, 0.16);
  --shadow-soft: 0 12px 28px rgba(56, 14, 81, 0.10);
  --radius:      28px;
}

/* ─── Body ────────────────────────────────────────────────────────────────── */
body {
  color:       var(--ink);
  font-family: 'IBM Plex Sans Arabic', system-ui, sans-serif;
  background-color:     var(--bg);
  background-image:
    linear-gradient(rgba(255, 248, 241, 0.72), rgba(245, 236, 249, 0.80)),
    url('/assets/basserli/images/page-cloud-pattern.png');
  background-size:     auto, 1400px auto;
  background-repeat:   repeat, repeat-y;
  background-position: center top, center top;
  background-attachment: fixed;
  overflow-x:  hidden;
}

/* ─── Typography ──────────────────────────────────────────────────────────── */
/*
 * Specificity strategy:
 *   per-page CSS uses  body {}           → specificity 0,0,1
 *   global rules use   [dir] body {}     → specificity 0,1,1  (always wins)
 * This means no per-page body font-family can ever override these rules,
 * no matter which file loads last.
 */

/* Arabic — body + headings */
:lang(ar)              { font-family: 'IBM Plex Sans Arabic', system-ui, sans-serif; }
[dir="rtl"] body,
:lang(ar) body         { font-family: 'IBM Plex Sans Arabic', system-ui, sans-serif; }

h1, h2, h3, h4,
:lang(ar) h1, :lang(ar) h2, :lang(ar) h3, :lang(ar) h4 {
  font-family: 'Noto Kufi Arabic', 'IBM Plex Sans Arabic', sans-serif;
  color: var(--purple);
}

/* Latin — body: Raleway 400 / headings: Cormorant Garamond 300 */
[dir="ltr"]      { font-family: 'Raleway', system-ui, sans-serif; font-weight: 400; }
[dir="ltr"] body { font-family: 'Raleway', system-ui, sans-serif; font-weight: 400; }
[dir="ltr"] h1, [dir="ltr"] h2,
[dir="ltr"] h3, [dir="ltr"] h4 { font-family: 'Cormorant Garamond', Georgia, serif; font-weight: 300; }

/* ─── Container (used by footer component) ────────────────────────────────── */
.container {
  width: min(1220px, calc(100% - 46px));
  margin-inline: auto;
}

/* ─── Component overrides ─────────────────────────────────────────────────── */

.card-spiritual {
  background: rgba(255, 250, 245, 0.88) !important;
  border: 1px solid rgba(76, 27, 108, 0.16) !important;
  border-radius: 1.25rem;
  backdrop-filter: blur(6px);
}
.card-spiritual:hover {
  border-color: rgba(241, 183, 77, 0.45) !important;
  box-shadow: 0 12px 32px rgba(56, 14, 81, 0.12) !important;
}

.btn-primary {
  background: linear-gradient(135deg, #2f0948, #68208f) !important;
  color: #fff !important;
  border: 0 !important;
}
.btn-primary:hover:not(:disabled) {
  background: linear-gradient(135deg, #3f0a64, #7e28a8) !important;
  opacity: 1 !important;
}

.btn-ghost {
  color: #65536f !important;
  border-color: rgba(76, 27, 108, 0.25) !important;
}
.btn-ghost:hover {
  color: #35104f !important;
  border-color: rgba(83, 25, 118, 0.50) !important;
}

.input-base {
  background: rgba(255, 250, 245, 0.95) !important;
  border-color: rgba(76, 27, 108, 0.25) !important;
  color: #2d123d !important;
}
.input-base::placeholder { color: #65536f !important; }
.input-base:focus {
  border-color: #f1b74d !important;
  box-shadow: 0 0 0 3px rgba(241, 183, 77, 0.18) !important;
}

/* Tailwind inline input classes used across pages */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="tel"],
input[type="date"],
textarea,
select {
  background-color: rgba(255, 250, 245, 0.95);
  border-color: rgba(76, 27, 108, 0.25);
  color: #2d123d;
}
input[type="text"]::placeholder,
input[type="email"]::placeholder,
input[type="password"]::placeholder,
textarea::placeholder { color: #65536f; }

/* Alert blocks that were dark-themed */
.bg-red-900\/20   { background-color: rgba(254, 226, 226, 0.6) !important; }
.bg-red-900\/60   { background-color: rgba(254, 226, 226, 0.8) !important; }
.border-red-500\/30 { border-color: rgba(220, 38, 38, 0.35) !important; }
.text-red-200     { color: #991b1b !important; }
.text-red-400     { color: #dc2626 !important; }
.bg-emerald-900\/60  { background-color: rgba(209, 250, 229, 0.8) !important; }
.border-emerald-500\/40 { border-color: rgba(16, 185, 129, 0.4) !important; }
.text-emerald-200 { color: #065f46 !important; }
.bg-emerald-900\/40 { background-color: rgba(209, 250, 229, 0.6) !important; }
.border-emerald-500\/30 { border-color: rgba(16, 185, 129, 0.35) !important; }
.text-emerald-400 { color: #059669 !important; }

/* ─── Navbar ──────────────────────────────────────────────────────────────── */

.site-header {
  position:        sticky;
  top:             14px;
  z-index:         60;
  width:           min(1236px, calc(100% - 28px));
  margin:          14px auto 0;
  background:      rgba(255, 255, 255, 0.72);
  border:          1px solid rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(14px);
  box-shadow:      0 14px 36px rgba(50, 15, 72, 0.12);
  border-radius:   28px;
}
.nav {
  min-height: 78px;
  display:    grid;
  grid-template-columns: 190px 1fr auto;
  gap:        20px;
  align-items: center;
  padding:    8px 18px;
}
.logo img {
  height:     74px;
  width:      auto;
  object-fit: contain;
}
.logo-fallback {
  font-size:   34px;
  font-weight: 500;
  display:     none;
}
.nav-links {
  display:         flex;
  align-items:     center;
  justify-content: center;
  gap:             42px;
  font-weight:     400;
}
.nav-links a {
  position: relative;
  color:    #2d1a37;
}
.nav-links a.active { color: var(--purple2); }
.nav-links a.active::after {
  content:    "";
  position:   absolute;
  right:      50%;
  transform:  translateX(50%);
  bottom:     -18px;
  width:      58px;
  height:     2px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
}
.nav-links a.active::before {
  content:   "✦";
  position:  absolute;
  right:     50%;
  transform: translateX(50%);
  bottom:    -29px;
  color:     var(--gold);
  font-size: 12px;
}
.nav-actions {
  display:         flex;
  direction:       ltr;
  align-items:     center;
  justify-content: flex-end;
  gap:             14px;
}

/* Buttons used in navbar */
.btn {
  display:         inline-flex;
  align-items:     center;
  justify-content: center;
  gap:             8px;
  min-height:      48px;
  padding:         0 24px;
  border-radius:   15px;
  border:          0;
  font-weight: 500;
  cursor:          pointer;
  transition:      .2s ease;
  white-space:     nowrap;
  font-family:     inherit;
}
.btn:hover { transform: translateY(-2px); }
.btn-primary {
  color:      #fff;
  background: linear-gradient(135deg, #2f0948, #68208f);
  box-shadow: 0 10px 22px rgba(56, 12, 85, 0.24);
}
.btn-soft {
  color:      var(--purple);
  background: rgba(255, 255, 255, 0.64);
  border:     1px solid rgba(83, 25, 118, 0.22);
}

/* ─── Hamburger & mobile nav ─────────────────────────────────────────────── */
.hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  background: rgba(255, 255, 255, 0.64);
  border: 1px solid rgba(83, 25, 118, 0.22);
  border-radius: 10px;
  padding: 8px 10px;
  cursor: pointer;
  flex-shrink: 0;
}
.hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: #35104f;
  border-radius: 2px;
  transition: .2s;
}
.hamburger.active span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.active span:nth-child(2) { opacity: 0; }
.hamburger.active span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.mobile-nav {
  display: none;
  flex-direction: column;
  padding: 8px 20px 16px;
  border-top: 1px solid rgba(76, 27, 108, 0.1);
}
.mobile-nav.open { display: flex; }
.mobile-nav a {
  padding: 12px 6px;
  font-weight: 500;
  color: #2d123d;
  font-size: 15px;
  border-bottom: 1px solid rgba(76, 27, 108, 0.07);
}
.mobile-nav a:last-child { border-bottom: 0; }

/* Responsive navbar */
@media (max-width: 1050px) {
  .nav {
    grid-template-columns: 1fr;
    justify-items: center;
    gap: 10px;
  }
  .nav-links {
    flex-wrap: wrap;
    gap: 18px;
  }
  .nav-actions {
    justify-content: center;
  }
}
@media (max-width: 700px) {
  html, body   { max-width: 100%; overflow-x: hidden; }
  .site-header { width: calc(100% - 20px); top: 8px; }
  .nav-links   { display: none; }
  .hamburger   { display: flex; }
  .nav-actions { width: 100%; justify-content: center; flex-wrap: wrap; gap: 8px; }
  .btn         { min-height: 40px; padding: 0 14px; font-size: 13px; }
  .logo img    { height: 60px; }
}

/* ─── Footer ──────────────────────────────────────────────────────────────── */

.footer {
  margin-top: 14px;
  padding:    34px 0 20px;
  color:      #fff;
  background: linear-gradient(180deg, #2d0742, #180221);
}
.footer-grid {
  display:               grid;
  grid-template-columns: 1.3fr repeat(3, 1fr);
  gap:         32px;
  align-items: start;
}
.footer-logo {
  height:      72px;
  width:       auto;
  object-fit:  contain;
  margin-bottom: 12px;
}
.footer p, .footer li, .footer a {
  color:       rgba(255, 255, 255, 0.72);
  line-height: 1.9;
}
.footer ul    { list-style: none; padding: 0; margin: 0; }
.footer h4    { margin: 0 0 10px; color: #ffd36f; }
.socials {
  display:    flex;
  gap:        10px;
  margin-top: 14px;
}
.social-link {
  width:         38px;
  height:        38px;
  border-radius: 50%;
  display:       grid;
  place-items:   center;
  border:        1px solid rgba(255, 255, 255, 0.24);
  color:         #ffffff;
  transition:    .2s ease;
}
.social-link:hover {
  transform:  translateY(-2px);
  background: rgba(255, 255, 255, 0.08);
}
.social-link svg {
  width:  18px;
  height: 18px;
  fill:   currentColor;
}
.copy {
  margin-top: 22px;
  text-align: center;
  color:      rgba(255, 255, 255, 0.56);
  font-size:  13px;
}

/* Responsive footer */
@media (max-width: 1050px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 700px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-grid > div:first-child { grid-column: 1 / -1; }
  .footer-logo { height: 58px; }
}

/* ─── Flash messages ──────────────────────────────────────────────────────── */
.flash-success {
  background: rgba(209, 250, 229, 0.7);
  border:     1px solid rgba(16, 185, 129, 0.4);
  border-radius: 14px;
  color:      #065f46;
  padding:    12px 18px;
  font-size:  14px;
  display:    flex;
  align-items: center;
  gap:        10px;
}
.flash-error {
  background: rgba(254, 226, 226, 0.7);
  border:     1px solid rgba(220, 38, 38, 0.35);
  border-radius: 14px;
  color:      #7f1d1d;
  padding:    12px 18px;
  font-size:  14px;
  display:    flex;
  align-items: center;
  gap:        10px;
}
