/* TicketsNile theme — standalone marketing pages + injected nav/footer.
   Loaded as a same-origin stylesheet (CSP style-src 'self' safe). RTL is handled
   with CSS logical properties so the same rules work for ar (rtl) and en (ltr).
   NOTE: brand colors are placeholders (gold matches the current control theme);
   swap --ts-primary / --ts-secondary when real brand colors arrive. */
:root {
  --ts-primary: #c9a227;
  --ts-primary-dark: #a8861a;
  --ts-secondary: #1f2a44;
  --ts-ink: #1c1c1c;
  --ts-muted: #6b6b6b;
  --ts-line: #e6e6e6;
  --ts-bg: #ffffff;
  --ts-bg-alt: #f7f6f2;
  --ts-radius: 12px;
  --ts-maxw: 1140px;
}
* { box-sizing: border-box; }
.ts-body {
  margin: 0;
  font-family: "Cairo", "Tajawal", "Almarai", -apple-system, "Segoe UI", Tahoma, sans-serif;
  color: var(--ts-ink);
  background: var(--ts-bg);
  line-height: 1.65;
}
.ts-container { max-width: var(--ts-maxw); margin-inline: auto; padding-inline: 20px; }
.ts-main { min-height: 50vh; }
a { color: var(--ts-primary-dark); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { line-height: 1.25; }

/* Buttons */
.ts-btn {
  display: inline-block; border: 1px solid transparent; border-radius: 8px;
  padding: 10px 20px; font: inherit; font-weight: 700; cursor: pointer;
  text-align: center;
}
.ts-btn:hover { text-decoration: none; }
.ts-btn-primary { background: var(--ts-primary); color: #fff; }
.ts-btn-primary:hover { background: var(--ts-primary-dark); color: #fff; }
.ts-btn-ghost { background: transparent; color: var(--ts-secondary); border-color: var(--ts-line); }
.ts-btn-ghost:hover { border-color: var(--ts-primary); color: var(--ts-primary-dark); }
.ts-btn-lg { padding: 14px 28px; font-size: 1.05rem; }
.ts-btn-block { display: block; width: 100%; }

/* Nav */
.ts-nav { background: #fff; border-bottom: 1px solid var(--ts-line); position: sticky; top: 0; z-index: 50; }
.ts-nav-inner { display: flex; align-items: center; gap: 20px; min-height: 64px; }
.ts-brand { display: inline-flex; align-items: center; }
.ts-brand-mark { font-weight: 800; font-size: 1.3rem; color: var(--ts-secondary); letter-spacing: .3px; }
.ts-brand-mark::first-letter { color: var(--ts-primary); }
/* Fixed height, auto width, contain => never stretched or cropped (the SVG has a
   ticket shape whose side edges were being clipped). */
.ts-logo { height: 34px; width: auto; max-width: 190px; object-fit: contain; display: block; }
.ts-footer-logo { height: 40px; }
/* Everything after the logo sits on ONE trailing-aligned row that never wraps. */
.ts-nav-collapse { display: flex; align-items: center; gap: 18px; margin-inline-start: auto; flex-wrap: nowrap; }
.ts-nav-links { display: flex; gap: 14px; flex-wrap: nowrap; }
.ts-nav-links a { color: var(--ts-ink); font-weight: 600; white-space: nowrap; }
.ts-nav-actions { display: flex; align-items: center; gap: 10px; flex-wrap: nowrap; }
.ts-nav-actions .ts-btn { white-space: nowrap; }
/* Language toggle: a clear pill (globe + language name), not a lone cryptic glyph. */
.ts-lang { display: inline-flex; align-items: center; gap: 5px; border: 1px solid var(--ts-line); border-radius: 999px; padding: 4px 10px; color: var(--ts-secondary); white-space: nowrap; }
.ts-lang:hover { border-color: var(--ts-primary); }
.ts-lang-ico { flex: 0 0 auto; color: var(--ts-secondary); }
.ts-lang a { font-weight: 700; color: var(--ts-secondary); }
.ts-lang a:hover { text-decoration: none; color: var(--ts-primary-dark); }

/* Login dropdown (CSS-only <details>, CSP-safe) */
.ts-dropdown { position: relative; }
.ts-dropdown-toggle { list-style: none; display: inline-flex; align-items: center; gap: 6px; user-select: none; }
.ts-dropdown-toggle::-webkit-details-marker { display: none; }
.ts-caret { width: 0; height: 0; border-inline-start: 4px solid transparent; border-inline-end: 4px solid transparent; border-top: 5px solid currentColor; }
.ts-dropdown[open] .ts-caret { transform: rotate(180deg); }
.ts-dropdown-menu { position: absolute; inset-inline-end: 0; top: calc(100% + 6px); min-width: 190px; background: #fff; border: 1px solid var(--ts-line); border-radius: 10px; box-shadow: 0 12px 28px rgba(0,0,0,.12); padding: 6px; z-index: 60; }
.ts-dropdown-menu a { display: block; padding: 10px 12px; border-radius: 8px; color: var(--ts-ink); font-weight: 600; white-space: nowrap; }
.ts-dropdown-menu a:hover { background: var(--ts-bg-alt); color: var(--ts-primary-dark); text-decoration: none; }
/* CSS-only hamburger */
.ts-nav-toggle { display: none; }
.ts-burger { display: none; margin-inline-start: auto; cursor: pointer; width: 40px; height: 40px; border: 1px solid var(--ts-line); border-radius: 8px; padding: 9px 8px; flex-direction: column; justify-content: space-between; }
.ts-burger span { display: block; height: 2px; background: var(--ts-secondary); border-radius: 2px; }

/* Hero — two columns: copy + SVG illustration (stacks on mobile). */
.ts-hero { background: linear-gradient(160deg, var(--ts-bg-alt), #fff); padding: 64px 0 56px; }
.ts-hero-inner { display: flex; align-items: center; gap: 48px; }
.ts-hero-copy { flex: 1 1 55%; min-width: 0; }
.ts-hero-art { flex: 1 1 45%; min-width: 0; display: flex; justify-content: center; }
.ts-hero-art svg { width: 100%; max-width: 440px; height: auto; }
.ts-hero h1 { font-size: 2.6rem; margin: 0 0 16px; color: var(--ts-secondary); }
.ts-hero-sub { font-size: 1.2rem; color: var(--ts-muted); max-width: 640px; margin: 0 0 28px; }
.ts-hero-cta { display: flex; gap: 12px; flex-wrap: wrap; }
.ts-pay-row { margin-top: 26px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.ts-pay-label { color: var(--ts-muted); font-size: .9rem; }
.ts-pay-chip { background: #fff; border: 1px solid var(--ts-line); border-radius: 999px; padding: 4px 12px; font-size: .85rem; font-weight: 600; }

/* Sections */
.ts-section { padding: 56px 0; }
.ts-section-alt { background: var(--ts-bg-alt); }
.ts-section-title { text-align: center; font-size: 1.9rem; color: var(--ts-secondary); margin: 0 0 32px; }
.ts-lead { font-size: 1.15rem; color: var(--ts-muted); }
.ts-center { text-align: center; }
.ts-muted { color: var(--ts-muted); }

/* Grids & cards */
.ts-grid { display: grid; gap: 20px; }
.ts-grid-2 { grid-template-columns: repeat(2, 1fr); }
.ts-grid-3 { grid-template-columns: repeat(3, 1fr); }
.ts-card { background: #fff; border: 1px solid var(--ts-line); border-radius: var(--ts-radius); padding: 24px; }
.ts-card h3 { margin: 0 0 8px; color: var(--ts-secondary); }
.ts-card p { margin: 0; color: var(--ts-muted); }

/* Steps */
.ts-step { text-align: center; padding: 20px; }
.ts-step-n { display: inline-flex; width: 44px; height: 44px; border-radius: 50%; background: var(--ts-primary); color: #fff; font-weight: 800; align-items: center; justify-content: center; margin-bottom: 12px; }

/* Sustainability strip */
.ts-sustain { background: linear-gradient(120deg, #123a2e, #1f5c47); color: #fff; padding: 40px 0; }
.ts-sustain-card { border-radius: var(--ts-radius); margin-top: 40px; }
.ts-sustain-inner { max-width: var(--ts-maxw); margin-inline: auto; padding-inline: 20px; display: flex; gap: 24px; align-items: center; }
.ts-sustain h2 { margin: 0 0 8px; }
.ts-sustain p { margin: 0; opacity: .92; }
.ts-sustain-badge { background: rgba(255,255,255,.15); border: 1px solid rgba(255,255,255,.3); border-radius: 999px; padding: 8px 16px; font-weight: 700; white-space: nowrap; }

/* Events */
.ts-event-card { display: flex; flex-direction: column; gap: 6px; background: #fff; border: 1px solid var(--ts-line); border-radius: var(--ts-radius); padding: 20px; color: var(--ts-ink); }
.ts-event-card:hover { border-color: var(--ts-primary); text-decoration: none; box-shadow: 0 4px 16px rgba(0,0,0,.06); }
.ts-event-name { font-weight: 700; color: var(--ts-secondary); }
.ts-event-org, .ts-event-meta { color: var(--ts-muted); font-size: .9rem; }

/* Testimonials */
.ts-placeholder-note { text-align: center; color: var(--ts-muted); font-style: italic; margin-top: -18px; margin-bottom: 24px; }
.ts-quote { background: #fff; border: 1px solid var(--ts-line); border-radius: var(--ts-radius); padding: 22px; margin: 0; }
.ts-quote cite { display: block; margin-top: 12px; color: var(--ts-muted); font-size: .9rem; }

/* Stats */
.ts-stats { text-align: center; }
.ts-stat-n { display: block; font-size: 2.4rem; font-weight: 800; color: var(--ts-primary); }
.ts-stat-l { color: var(--ts-muted); }

/* Pricing */
.ts-pricing { max-width: 820px; margin-inline: auto; }
.ts-price-card { position: relative; background: #fff; border: 1px solid var(--ts-line); border-radius: var(--ts-radius); padding: 28px; }
.ts-price-featured { border-color: var(--ts-primary); box-shadow: 0 6px 24px rgba(201,162,39,.15); }
.ts-price-badge { position: absolute; inset-block-start: -12px; inset-inline-end: 20px; background: var(--ts-primary); color: #fff; border-radius: 999px; padding: 4px 14px; font-size: .8rem; font-weight: 700; }
.ts-price-name { color: var(--ts-secondary); margin: 0 0 6px; }
.ts-price-fee { font-size: 1.25rem; font-weight: 800; margin-bottom: 16px; }
.ts-price-features { list-style: none; padding: 0; margin: 0 0 22px; }
.ts-price-features li { padding: 8px 0; border-bottom: 1px solid var(--ts-line); }
.ts-price-features li::before { content: "✓"; color: var(--ts-primary); font-weight: 800; margin-inline-end: 8px; }

/* Fine print */
.ts-fineprint { max-width: 820px; margin: 32px auto 0; color: var(--ts-muted); font-size: .82rem; border-top: 1px solid var(--ts-line); padding-top: 16px; }
.ts-fineprint p { margin: 6px 0; }

/* FAQ */
.ts-faq { max-width: 800px; }
.ts-faq details { background: #fff; border: 1px solid var(--ts-line); border-radius: 8px; padding: 14px 18px; margin-bottom: 10px; }
.ts-faq summary { font-weight: 700; cursor: pointer; color: var(--ts-secondary); }
.ts-faq details p { margin: 10px 0 0; color: var(--ts-muted); }

/* CTA banner */
.ts-cta-banner { background: var(--ts-secondary); color: #fff; text-align: center; padding: 56px 0; }
.ts-cta-banner h2 { margin: 0 0 22px; font-size: 1.8rem; }

/* Contact */
.ts-contact-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 40px; }
.ts-field { margin-bottom: 16px; }
.ts-field label { display: block; font-weight: 600; margin-bottom: 6px; }
.form-control, .ts-field input, .ts-field textarea, .ts-field select {
  width: 100%; padding: 10px 12px; border: 1px solid var(--ts-line); border-radius: 8px; font: inherit;
}
.ts-errors { list-style: none; padding: 0; margin: 6px 0 0; color: #b00020; font-size: .88rem; }
.ts-contact-info { background: var(--ts-bg-alt); border-radius: var(--ts-radius); padding: 24px; }
.ts-contact-list { list-style: none; padding: 0; margin: 0; }
.ts-contact-list li { padding: 6px 0; }

/* Honeypot — off-screen, empty for humans */
.ts-hp, .ts-hp-wrap { position: absolute !important; left: -5000px !important; width: 1px; height: 1px; overflow: hidden; }

/* Social icons */
.ts-social { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 8px; }
.ts-social-ico { display: block; }

/* Footer */
.ts-footer { background: var(--ts-secondary); color: #e9e9ee; margin-top: 40px; }
.ts-footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 28px; padding: 44px 20px; }
.ts-footer-brand { color: #fff; }
.ts-footer-tag { color: #b9c0cc; margin: 8px 0 0; }
.ts-footer-about .ts-footer-tag { max-width: 42ch; line-height: 1.7; }
.ts-footer-col h4 { color: #fff; margin: 0 0 12px; font-size: 1rem; }
.ts-footer-col ul { list-style: none; padding: 0; margin: 0; }
.ts-footer-col li { padding: 5px 0; }
.ts-footer-col a { color: #cfd5df; }
/* Contact details sit below the social icons inside the "Follow us" column. */
.ts-footer-contact { margin-top: 16px; }
.ts-footer-contact li { color: #cfd5df; padding: 4px 0; font-size: .92rem; }
.ts-footer-contact a { color: #cfd5df; }
.ts-footer-bottom { border-top: 1px solid rgba(255,255,255,.12); padding: 16px 0; color: #aab2c0; font-size: .85rem; }

/* Alerts */
.ts-alert { padding: 12px 16px; border-radius: 8px; margin: 20px 0; }
.ts-alert-success { background: #e7f6ec; color: #1a7a3c; border: 1px solid #b7e2c6; }
.ts-alert-error { background: #fdecec; color: #b00020; border: 1px solid #f3b5b5; }
.ts-alert-info { background: #eef3fb; color: #274b78; border: 1px solid #c4d6ef; }

/* Narrow single-column form pages (organizer signup, etc.) */
.ts-form-narrow { max-width: 720px; margin-inline: auto; }
.ts-pending-tick { width: 64px; height: 64px; border-radius: 50%; background: var(--ts-primary); color: #fff; font-size: 34px; line-height: 64px; margin: 0 auto 18px; text-align: center; }
.ts-form-narrow h1 { color: var(--ts-secondary); }
.ts-form-narrow .helptext { display: block; color: var(--ts-muted); font-size: .85rem; margin-top: 4px; }

/* Feature cards (homepage teaser) */
.ts-feature-card { text-align: center; }
.ts-feature-ico { display: block; margin: 0 auto 12px; }
.ts-more { margin-top: 28px; }

/* Payment marks */
.ts-pay-mark { display: inline-flex; align-items: center; background: #fff; border: 1px solid var(--ts-line); border-radius: 8px; padding: 6px 12px; }
.ts-pay-mark img { display: block; }

/* Features page */
.ts-features-list { max-width: 860px; margin: 32px auto 0; display: flex; flex-direction: column; gap: 20px; }
.ts-feature-row { display: flex; gap: 22px; align-items: flex-start; background: #fff; border: 1px solid var(--ts-line); border-radius: var(--ts-radius); padding: 24px; }
.ts-feature-row-ico { flex: 0 0 auto; }
.ts-feature-row-body h3 { margin: 0 0 6px; color: var(--ts-secondary); }
.ts-feature-row-body p { margin: 0; color: var(--ts-muted); }
.ts-feature-link { margin-top: 8px !important; }
.ts-feature-link a { font-weight: 700; color: var(--ts-primary-dark); }

/* Legal / info pages (about, privacy, terms, fair-use) */
.ts-legal { max-width: 820px; margin-inline: auto; }
.ts-legal-title { font-size: 2rem; color: var(--ts-secondary); margin: 0 0 8px; }
.ts-legal-lead { font-size: 1.15rem; color: var(--ts-muted); margin: 0 0 24px; }
.ts-legal-updated { color: var(--ts-muted); font-size: .9rem; margin: 0 0 24px; }
.ts-legal-body h2 { font-size: 1.25rem; color: var(--ts-secondary); margin: 28px 0 8px; }
.ts-legal-body p { margin: 0 0 12px; color: #333; }
.ts-legal-body ul { margin: 0 0 12px; padding-inline-start: 22px; color: #333; }
.ts-legal-body li { padding: 4px 0; }

/* Event card image */
.ts-event-img { display: block; height: 140px; border-radius: 8px; overflow: hidden; margin-bottom: 12px; background: var(--ts-bg-alt); }
.ts-event-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ts-event-img-ph { display: flex; align-items: center; justify-content: center; font-size: 2.4rem; font-weight: 800; color: var(--ts-primary); }

/* Responsive */
@media (max-width: 900px) {
  .ts-grid-3 { grid-template-columns: 1fr 1fr; }
  .ts-contact-grid { grid-template-columns: 1fr; }
  .ts-footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 820px) {
  /* Mobile navigation: hamburger reveals the collapsed menu */
  .ts-nav-inner { position: relative; }
  .ts-burger { display: flex; }
  .ts-nav-collapse {
    display: none;
    position: absolute; inset-inline: 0; top: 100%;
    flex-direction: column; align-items: stretch; gap: 0;
    background: #fff; border-bottom: 1px solid var(--ts-line);
    padding: 8px 20px 16px; box-shadow: 0 10px 24px rgba(0,0,0,.08);
  }
  .ts-nav-toggle:checked ~ .ts-nav-collapse { display: flex; flex-wrap: wrap; }
  .ts-nav-links { flex-direction: column; gap: 0; flex-wrap: wrap; }
  .ts-nav-links a { padding: 12px 0; border-bottom: 1px solid var(--ts-line); }
  .ts-nav-actions { flex-direction: column; align-items: stretch; gap: 10px; padding-top: 12px; flex-wrap: wrap; }
  /* In the mobile menu the login dropdown opens in-flow, not as an overlay. */
  .ts-dropdown { width: 100%; }
  .ts-dropdown-toggle { justify-content: center; width: 100%; }
  .ts-dropdown-menu { position: static; inset-inline-end: auto; box-shadow: none; margin-top: 8px; min-width: 0; }
  .ts-lang { justify-content: center; }
  .ts-feature-row { flex-direction: column; align-items: center; text-align: center; }
  /* Hero stacks: copy first, illustration below. */
  .ts-hero-inner { flex-direction: column; text-align: center; gap: 32px; }
  .ts-hero-sub { margin-inline: auto; }
  .ts-hero-cta, .ts-pay-row { justify-content: center; }
  .ts-hero-art { order: 2; }
  .ts-hero-art svg { max-width: 340px; }
}
@media (max-width: 640px) {
  .ts-grid-2, .ts-grid-3, .ts-footer-grid { grid-template-columns: 1fr; }
  .ts-hero h1 { font-size: 2rem; }
  .ts-sustain-inner { flex-direction: column; text-align: center; }
}

/* ---------------------------------------------------------------------------
   Help Center (§5) — appended. Reuses ts-section/ts-container/ts-legal chrome;
   only the list/pager/audience blocks below are help-specific. RTL-safe (logical
   properties + dir-agnostic flex).
--------------------------------------------------------------------------- */
.ts-help-audience { margin-block: 2.5rem 0; }
.ts-help-audience-title {
  font-size: 1.6rem;
  margin-block: 0 1rem;
  padding-block-end: .5rem;
  border-block-end: 2px solid var(--ts-border, #e5e7eb);
}
.ts-help-cat { margin-block-end: 1.75rem; }
.ts-help-cat-title { font-size: 1.15rem; margin-block: 0 .6rem; opacity: .85; }
.ts-help-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .5rem; }
.ts-help-list > li > a {
  display: block;
  padding: .8rem 1rem;
  border: 1px solid var(--ts-border, #e5e7eb);
  border-radius: 10px;
  text-decoration: none;
  transition: border-color .15s ease, transform .15s ease;
}
.ts-help-list > li > a:hover {
  border-color: var(--ts-primary, #0ea5a5);
  transform: translateX(-2px);
}
html[dir="ltr"] .ts-help-list > li > a:hover { transform: translateX(2px); }

.ts-help-breadcrumb { font-size: .95rem; opacity: .8; margin-block-end: 1rem; }
.ts-help-breadcrumb a { text-decoration: none; }
.ts-help-breadcrumb span { margin-inline: .4rem; opacity: .5; }

.ts-help-body { margin-block-start: 1.25rem; }
.ts-help-body h2 { font-size: 1.2rem; margin-block: 1.4rem .5rem; }
.ts-help-body ol, .ts-help-body ul { padding-inline-start: 1.4rem; line-height: 1.9; }
.ts-help-body li { margin-block-end: .35rem; }

.ts-help-video { margin-block: 1rem 1.5rem; }
.ts-help-video video { border-radius: 12px; display: block; }

.ts-help-pager {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem;
  justify-content: space-between;
  margin-block: 2rem 0;
}
