/*
Theme Name: CS Brand
Theme URI: https://crystalsafaritours.com
Author: Crystal Safari Tours
Description: Lightweight, brand-parameterized WordPress theme for Crystal Safari (Hurghada desert safaris) and the later Excursions/Bakun brand. Gutenberg-native, no page builder, mobile-first, Core Web Vitals budget in the design. Identity and palette come from brand.json, so one codebase serves every brand.
Version: 1.0.0
Requires at least: 6.5
Tested up to: 7.1
Requires PHP: 8.0
License: GPL-2.0-or-later
Text Domain: cs-safari
Tags: block-styles, custom-menu, custom-logo, featured-images, translation-ready
*/

/* ---------------------------------------------------------------- tokens
   Identity colours are injected at runtime from brand.json via
   wp_head (id="cs-brand-tokens"). The values below are ONLY the fallback
   for a brand.json that failed to load. */
:root {
  --cs-sand: #E8DCC8;
  --cs-dune: #C9A227;
  --cs-sunset: #E2725B;
  --cs-terracotta: #B4552D;
  --cs-night: #2A2118;
  --cs-ink: #1C1613;
  --cs-paper: #FBF8F3;

  --cs-radius: 14px;
  --cs-gap: clamp(1rem, 3vw, 2rem);
  --cs-maxw: 74rem;
  --cs-font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--cs-font);
  font-size: clamp(1rem, 0.95rem + 0.25vw, 1.075rem);
  line-height: 1.65;
  color: var(--cs-ink);
  background: var(--cs-paper);
  -webkit-font-smoothing: antialiased;
}

img, picture, video { max-width: 100%; height: auto; display: block; }

a { color: var(--cs-terracotta); text-underline-offset: 3px; }
a:hover, a:focus-visible { color: var(--cs-night); }

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

h1, h2, h3, h4 { line-height: 1.2; margin: 0 0 0.6em; font-weight: 700; letter-spacing: -0.015em; }
h1 { font-size: clamp(2rem, 1.4rem + 2.6vw, 3.4rem); }
h2 { font-size: clamp(1.5rem, 1.2rem + 1.4vw, 2.1rem); }
h3 { font-size: clamp(1.15rem, 1.05rem + 0.5vw, 1.4rem); }
p  { margin: 0 0 1.1em; }

/* ---------------------------------------------------------------- layout */
.cs-wrap { width: 100%; max-width: var(--cs-maxw); margin-inline: auto; padding-inline: var(--cs-gap); }
.cs-section { padding-block: clamp(2.5rem, 6vw, 5rem); }
.cs-section--alt { background: var(--cs-sand); }

.cs-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--cs-paper) 92%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid color-mix(in srgb, var(--cs-night) 12%, transparent);
}
.cs-header__inner { display: flex; align-items: center; justify-content: space-between; gap: var(--cs-gap); min-height: 4rem; }
.cs-logo { font-weight: 800; font-size: 1.15rem; text-decoration: none; color: var(--cs-night); letter-spacing: -0.02em; }
.cs-nav-list { display: flex; flex-wrap: wrap; gap: 0.35rem 1rem; list-style: none; margin: 0; padding: 0; }
.cs-nav-list a { text-decoration: none; color: var(--cs-night); font-weight: 600; padding: 0.4rem 0.1rem; }
.cs-nav-list a:hover, .cs-nav-list a:focus-visible { color: var(--cs-terracotta); }
.cs-nav-toggle { display: none; }

@media (max-width: 46rem) {
  .cs-nav-list { flex-direction: column; gap: 0; }
}

/* ---------------------------------------------------------------- hero */
.cs-hero { position: relative; isolation: isolate; background: var(--cs-night); color: var(--cs-paper); }
.cs-hero__media { position: absolute; inset: 0; z-index: -1; }
.cs-hero__media img { width: 100%; height: 100%; object-fit: cover; }
.cs-hero::after {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(180deg, rgba(42,33,24,.55) 0%, rgba(42,33,24,.78) 100%);
}
.cs-hero__inner { padding-block: clamp(3.5rem, 12vw, 8rem); }
.cs-hero h1 { color: var(--cs-paper); max-width: 18ch; }
.cs-hero p { max-width: 46ch; font-size: 1.1em; opacity: .92; }
.cs-hero__actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 1.5rem; }

/* ---------------------------------------------------------------- buttons */
.cs-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  padding: 0.85rem 1.5rem; min-height: 48px;              /* touch target */
  border-radius: 999px; border: 2px solid transparent;
  font-weight: 700; text-decoration: none; cursor: pointer;
  transition: transform .12s ease, background-color .12s ease, color .12s ease;
}
.cs-btn:hover, .cs-btn:focus-visible { transform: translateY(-1px); }
.cs-btn--primary { background: var(--cs-dune); color: var(--cs-night); }
.cs-btn--primary:hover { background: var(--cs-sunset); color: var(--cs-paper); }
.cs-btn--ghost { border-color: currentColor; color: inherit; background: transparent; }
.cs-btn--ghost:hover { background: rgba(255,255,255,.12); }
.cs-btn--whatsapp { background: #25D366; color: #0b3d1f; }
.cs-btn--whatsapp:hover { background: #128C4A; color: #fff; }

/* ---------------------------------------------------------------- cards */
.cs-grid { display: grid; gap: var(--cs-gap); grid-template-columns: repeat(auto-fit, minmax(min(100%, 17rem), 1fr)); }
.cs-card {
  background: #fff; border-radius: var(--cs-radius); overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--cs-night) 10%, transparent);
  display: flex; flex-direction: column;
  transition: transform .14s ease, box-shadow .14s ease;
}
.cs-card:hover { transform: translateY(-3px); box-shadow: 0 12px 30px rgba(42,33,24,.12); }
.cs-card__body { padding: 1.1rem; display: flex; flex-direction: column; gap: .5rem; flex: 1; }
.cs-card h3 { margin: 0; }
.cs-card__meta { font-size: .875rem; opacity: .75; margin: 0; }
.cs-card__cta { margin-top: auto; }

/* ---------------------------------------------------------------- trust */
.cs-trust { list-style: none; margin: 0; padding: 0; display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 13rem), 1fr)); }
.cs-trust li { background: #fff; border-radius: var(--cs-radius); padding: 1rem 1.1rem; border: 1px solid color-mix(in srgb, var(--cs-night) 10%, transparent); font-weight: 600; }

/* ---------------------------------------------------------------- steps */
.cs-steps { counter-reset: cs-step; list-style: none; margin: 0; padding: 0; display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr)); }
.cs-steps li { counter-increment: cs-step; position: relative; padding-left: 3rem; min-height: 2.5rem; }
.cs-steps li::before {
  content: counter(cs-step); position: absolute; left: 0; top: 0;
  width: 2.1rem; height: 2.1rem; border-radius: 50%;
  background: var(--cs-terracotta); color: #fff;
  display: grid; place-items: center; font-weight: 800;
}

/* ---------------------------------------------------------------- FAQ */
.cs-faq-q { margin-bottom: .25em; }
.cs-faq-a { margin-bottom: 1.2em; opacity: .9; }

/* ---------------------------------------------------------------- CTA */
.cs-cta { margin-block: 2rem; }
.cs-cta__pending { color: var(--cs-terracotta); font-weight: 600; }
.cs-cta__slot { min-height: 3rem; }

/* ---------------------------------------------------------------- footer */
.cs-footer { background: var(--cs-night); color: var(--cs-sand); padding-block: 2.5rem; margin-top: 3rem; }
.cs-footer a { color: var(--cs-dune); }
.cs-footer h2, .cs-footer h3 { color: var(--cs-paper); }
.cs-footer__grid { display: grid; gap: 1.5rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr)); }
.cs-footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: .35rem; }

/* Only shown when the operator data is actually present — never a placeholder. */
.cs-muted { opacity: .65; font-size: .9rem; }

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

@media (prefers-contrast: more) {
  :root { --cs-ink: #000; }
  .cs-btn { border-color: currentColor; }
}

.screen-reader-text {
  position: absolute !important; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* Lazy-load below the fold is on by default in WP; this is the safety net. */
img:not([alt]) { background: var(--cs-sand); }
