/* ==========================================================================
   MSA Web App — Base Styles, Typography & Primitives
   ========================================================================== */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-height) + 18px);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.65;
  color: var(--text-primary);
  background-color: var(--bg-canvas);
  transition: background-color var(--transition-base), color var(--transition-base);
  overflow-x: hidden;
}

img,
svg {
  display: block;
  max-width: 100%;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

:focus-visible {
  outline: 2px solid var(--brand-gold);
  outline-offset: 3px;
  border-radius: 4px;
}

/* Skip Link for Accessibility */
.skip-link {
  position: fixed;
  top: -100px;
  left: 16px;
  z-index: 9999;
  background: var(--brand-primary);
  color: var(--text-on-brand);
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  transition: top var(--transition-fast);
}

.skip-link:focus {
  top: 16px;
}

/* Layout Containers */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 24px;
}

.section {
  position: relative;
  padding: 96px 0;
}

.section--alt {
  background: linear-gradient(180deg, var(--bg-subtle) 0%, var(--bg-canvas) 100%);
  border-top: 1px solid var(--border-subtle);
  border-bottom: 1px solid var(--border-subtle);
}

/* Subtle Islamic Geometric Tessellation Background */
.geo-pattern {
  background-image: url("data:image/svg+xml,%3Csvg width='72' height='72' viewBox='0 0 72 72' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' stroke='%230b4232' stroke-opacity='0.05' stroke-width='1'%3E%3Cpath d='M36 0L46.5 25.5L72 36L46.5 46.5L36 72L25.5 46.5L0 36L25.5 25.5Z'/%3E%3Crect x='18' y='18' width='36' height='36' transform='rotate(45 36 36)'/%3E%3C/g%3E%3C/svg%3E");
}

[data-theme='dark'] .geo-pattern {
  background-image: url("data:image/svg+xml,%3Csvg width='72' height='72' viewBox='0 0 72 72' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' stroke='%23dcb468' stroke-opacity='0.055' stroke-width='1'%3E%3Cpath d='M36 0L46.5 25.5L72 36L46.5 46.5L36 72L25.5 46.5L0 36L25.5 25.5Z'/%3E%3Crect x='18' y='18' width='36' height='36' transform='rotate(45 36 36)'/%3E%3C/g%3E%3C/svg%3E");
}

/* Section Headers */
.section-header {
  max-width: 740px;
  margin-bottom: 48px;
}

.section-header--center {
  text-align: center;
  margin-left: auto;
  margin-right: auto;
}

.section-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 0.76rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--brand-gold);
  margin-bottom: 14px;
}

.section-eyebrow::before,
.section-header--center .section-eyebrow::after {
  content: '';
  display: inline-block;
  width: 24px;
  height: 1.5px;
  background: var(--brand-gold);
  opacity: 0.8;
}

.section-title {
  margin: 0 0 16px;
  font-family: var(--font-display);
  font-size: clamp(2.1rem, 3.6vw, 3.1rem);
  font-weight: 700;
  line-height: 1.12;
  letter-spacing: 0.012em;
  color: var(--text-primary);
}

.section-subtitle {
  margin: 0;
  font-size: 1.04rem;
  color: var(--text-secondary);
  line-height: 1.74;
}

/* Arabic Typography Utility */
.arabic-text {
  font-family: var(--font-arabic);
  direction: rtl;
  unicode-bidi: isolate;
  line-height: 2.35;
  font-weight: 400;
  font-feature-settings: 'kern' 1, 'liga' 1;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 22px;
  border-radius: var(--radius-full);
  font-size: 0.91rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  line-height: 1.2;
  border: 1.5px solid transparent;
  cursor: pointer;
  transition: transform var(--transition-fast), background-color var(--transition-fast),
    border-color var(--transition-fast), color var(--transition-fast),
    box-shadow var(--transition-fast), filter var(--transition-fast);
  white-space: nowrap;
}

.btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--brand-gold-soft), 0 0 0 1.5px var(--brand-gold);
}

.btn:active {
  transform: translateY(1px) scale(0.99);
}

.btn--primary {
  background: var(--brand-primary-gradient);
  color: var(--text-on-brand);
  box-shadow: 0 6px 18px rgba(11, 66, 50, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

.btn--primary:hover {
  filter: brightness(1.07);
  transform: translateY(-1.5px);
  box-shadow: 0 10px 26px rgba(11, 66, 50, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.22);
}

.btn--gold {
  background: var(--brand-gold-gradient);
  color: #ffffff;
  box-shadow: var(--shadow-gold), inset 0 1px 0 rgba(255, 255, 255, 0.24);
}

.btn--gold:hover {
  filter: brightness(1.06);
  transform: translateY(-1.5px);
  box-shadow: 0 12px 28px rgba(182, 132, 56, 0.34);
}

.btn--outline {
  background: var(--bg-surface);
  color: var(--text-primary);
  border-color: var(--border-strong);
  box-shadow: var(--shadow-xs);
}

.btn--outline:hover {
  border-color: var(--brand-primary);
  color: var(--brand-primary);
  background: var(--brand-primary-soft);
  transform: translateY(-1px);
}

.btn--ghost {
  background: var(--brand-primary-soft);
  color: var(--brand-primary);
  border-color: transparent;
}

.btn--ghost:hover {
  background: var(--brand-primary);
  color: var(--text-on-brand);
  transform: translateY(-1px);
}

.btn--youtube {
  background: rgba(196, 48, 43, 0.1);
  color: #c4302b;
  border-color: rgba(196, 48, 43, 0.24);
}

[data-theme='dark'] .btn--youtube {
  background: rgba(255, 82, 77, 0.14);
  color: #ff7b76;
  border-color: rgba(255, 82, 77, 0.3);
}

.btn--youtube:hover {
  background: #c4302b;
  color: #fff;
  border-color: #c4302b;
}

.btn--sm {
  padding: 7px 14px;
  font-size: 0.83rem;
}

.btn--icon {
  width: 40px;
  height: 40px;
  padding: 0;
  border-radius: var(--radius-full);
}

/* Badges & Pills */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: var(--radius-full);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.03em;
}

.badge--confirmed {
  background: var(--status-confirmed-bg);
  color: var(--status-confirmed-text);
}

.badge--planning {
  background: var(--status-planning-bg);
  color: var(--status-planning-text);
}

.badge--flagship {
  background: var(--status-flagship-bg);
  color: var(--status-flagship-text);
}

.badge--gold {
  background: var(--brand-gold-soft);
  color: var(--brand-gold);
  border: 1px solid var(--brand-gold-border);
}

/* Filter Pill Bars */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 28px;
}

.filter-pill {
  padding: 8px 16px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface);
  color: var(--text-secondary);
  font-size: 0.86rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.filter-pill:hover {
  border-color: var(--brand-primary);
  color: var(--brand-primary);
}

.filter-pill.is-active {
  background: var(--brand-primary);
  color: var(--text-on-brand);
  border-color: var(--brand-primary);
}

/* Utilities */
.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;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

@media (max-width: 768px) {
  .section {
    padding: 72px 0;
  }
  .container {
    padding: 0 18px;
  }
}

