/*
Theme Name: parking.sa
Theme URI: https://parking.sa
Author: Losco
Description: Arabic (RTL) single-page landing theme for parking.sa — full-screen image-slider hero with a dark overlay and a contact form that mails through wp_mail().
Version: 1.1.0
Requires at least: 6.0
Tested up to: 6.7
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: parking-sa
Tags: one-column, rtl-language-support, custom-colors, translation-ready
*/

/* ---------------------------------------------------------------
   Design tokens — the palette carried over from the original design
   --------------------------------------------------------------- */
:root {
  --psa-ink: #10201a;
  --psa-muted: #5d7069;
  --psa-faint: #93a49d;
  --psa-hint: #9aaba3;

  --psa-brand: #00bf63;   /* the ".sa" in the wordmark */
  --psa-green: #1f8f5f;   /* accents, borders, focus rings */
  --psa-teal: #0d7d78;    /* links, active states */
  --psa-green-deep: #16704b;

  --psa-dark: #0d1210;    /* page ground behind the hero */
  --psa-footer: #10120f;
  --psa-footer-text: #6f7d76;

  --psa-card: #ffffff;
  --psa-field: #f9fbfa;
  --psa-line: #dde5e1;
  --psa-contact-bg: #f5f8f6;
  --psa-contact-glow: #e2f1ea;

  --psa-overlay: 0.58;    /* hero darkening */

  --psa-sans: 'IBM Plex Sans Arabic', 'Noto Kufi Arabic', system-ui, sans-serif;
  --psa-display: 'Noto Kufi Arabic', sans-serif;
  --psa-latin: Inter, system-ui, sans-serif;

  --psa-gut: 72px;        /* header + footer side padding */
}

/* ---------------------------------------------------------------
   Base
   --------------------------------------------------------------- */
* { margin: 0; padding: 0; box-sizing: border-box; }

html,
body {
  margin: 0;
  background: var(--psa-dark);
  color: var(--psa-ink);
  scroll-behavior: smooth;
}

body {
  font-family: var(--psa-sans);
  font-size: 15px;
  line-height: 1.7;
}

a { color: var(--psa-teal); text-decoration: none; }
a:hover { color: var(--psa-green); }

/* Page wrapper — keeps the footer below the fold-height sections. */
.psa-site {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

input, textarea, button { font-family: inherit; }
::placeholder { color: var(--psa-faint); }
::selection { background: rgba(31, 143, 95, 0.20); }

input:focus-visible,
textarea:focus-visible,
button:focus-visible,
a:focus-visible {
  outline: 2px solid var(--psa-green);
  outline-offset: 2px;
}

/* Visible only to screen readers — WordPress's standard helper. */
.screen-reader-text {
  border: 0;
  clip: rect(1px, 1px, 1px, 1px);
  clip-path: inset(50%);
  height: 1px;
  width: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  position: absolute !important;
  word-wrap: normal !important;
}

/* Skip link, revealed on focus. */
.psa-skip-link {
  position: absolute;
  top: -100px;
  right: 16px;
  z-index: 100;
  padding: 10px 16px;
  border-radius: 4px;
  background: #ffffff;
  color: var(--psa-ink);
  font-size: 14px;
}
.psa-skip-link:focus { top: 16px; }

/* ---------------------------------------------------------------
   Hero
   --------------------------------------------------------------- */
.psa-hero {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.psa-hero__media { position: absolute; inset: 0; overflow: hidden; }

/* Slider ------------------------------------------------------- */
/* Every slide is stacked in the same box; only opacity moves, which the
   compositor can handle without repainting. */
.psa-slide {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
  opacity: 0;
  transition: opacity 1000ms ease-in-out;
  will-change: opacity;
}

.psa-slide.is-active { opacity: 1; }

/* Before the script runs, the first slide is the one marked active — so the
   hero is never blank, with or without JavaScript. */

.psa-dots {
  position: absolute;
  z-index: 3;
  bottom: 28px;
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  gap: 10px;
}

.psa-dot {
  width: 9px;
  height: 9px;
  padding: 0;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.75);
  background: transparent;
  cursor: pointer;
  transition: background 200ms ease, border-color 200ms ease, transform 200ms ease;
}

.psa-dot:hover { background: rgba(255, 255, 255, 0.45); }
.psa-dot.is-active {
  background: var(--psa-brand);
  border-color: var(--psa-brand);
  transform: scale(1.15);
}

.psa-hero__overlay {
  position: absolute;
  inset: 0;
  background: #000000;
  opacity: var(--psa-overlay);
  pointer-events: none;
}

/* Topbar ------------------------------------------------------- */
.psa-topbar {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22.4px;
  padding: 33.6px var(--psa-gut);
}

.psa-wordmark {
  font-family: var(--psa-latin);
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: #ffffff;
}
.psa-wordmark:hover { color: #ffffff; }
.psa-wordmark__tld { color: var(--psa-brand); }

/* Hero body ---------------------------------------------------- */
.psa-hero__body {
  position: relative;
  z-index: 2;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 33.6px;
  padding: 44px;
  pointer-events: none;
}

.psa-hero__title {
  font-family: var(--psa-latin);
  margin: 0;
  font-size: clamp(56px, 9vw, 128px);
  font-weight: 700;
  letter-spacing: -0.045em;
  line-height: 1;
  color: #ffffff;
}

/* Tagline and call to action travel together, so the line always
   sits directly above the button — including where the pair is
   repositioned on small screens. */
.psa-hero__actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 22.4px;
}

.psa-hero__tagline {
  font-family: var(--psa-latin);
  margin: 0;
  font-size: clamp(12.5px, 1.5vw, 16px);
  font-weight: 400;
  letter-spacing: 0.16em;
  color: rgba(255, 255, 255, 0.82);
  text-shadow: 0 1px 12px rgba(0, 0, 0, 0.35);
}
.psa-hero__sep {
  margin: 0 4px;
  color: var(--psa-green);
}

.psa-hero__cta {
  pointer-events: auto;
  padding: 14px 33.6px;
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.6);
  background: rgba(255, 255, 255, 0.06);
  color: #ffffff;
  font-size: 15.5px;
  cursor: pointer;
  backdrop-filter: blur(2px);
  transition: background 140ms ease, border-color 140ms ease;
}
.psa-hero__cta:hover {
  background: rgba(31, 143, 95, 0.24);
  border-color: var(--psa-green);
}
.psa-hero__cta:active { background: rgba(13, 125, 120, 0.36); }

/* ---------------------------------------------------------------
   Contact
   --------------------------------------------------------------- */
.psa-contact {
  min-height: 100vh;
  background:
    radial-gradient(100% 70% at 50% 0%, var(--psa-contact-glow) 0%, rgba(226, 241, 234, 0) 60%),
    var(--psa-contact-bg);
  color: var(--psa-ink);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 72px 44px;
}

.psa-card {
  width: 100%;
  max-width: 560px;
  border-radius: 14px;
  background: var(--psa-card);
  box-shadow: 0 0 0 1px var(--psa-line), 0 20px 50px rgba(16, 32, 26, 0.09);
  padding: 40px;
  position: relative;
  overflow: hidden;
}

/* The hairline of colour across the top of the card. */
.psa-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 2px;
  background: linear-gradient(
    to right,
    rgba(13, 125, 120, 0) 0,
    var(--psa-teal) 30%,
    var(--psa-green) 70%,
    rgba(31, 143, 95, 0) 100%
  );
}

.psa-card__title {
  font-family: var(--psa-display);
  font-size: 22px;
  font-weight: 500;
  margin: 0 0 22.4px;
}

/* Form --------------------------------------------------------- */
.psa-form { display: flex; flex-direction: column; gap: 16.8px; }

.psa-form__row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 11.2px;
}

.psa-field {
  display: flex;
  flex-direction: column;
  gap: 5.6px;
  font-size: 12.5px;
  color: var(--psa-muted);
  min-width: 0;
}
.psa-field__optional { color: var(--psa-hint); }

.psa-field input,
.psa-field textarea {
  padding: 10px 11.2px;
  border-radius: 8px;
  border: 1px solid var(--psa-line);
  background: var(--psa-field);
  color: var(--psa-ink);
  font-size: 14px;
  width: 100%;
  box-sizing: border-box;
  min-width: 0;
}
.psa-field input:focus,
.psa-field textarea:focus {
  border-color: var(--psa-green);
  background: #ffffff;
}

.psa-field input[type="email"] { text-align: right; }

.psa-field textarea {
  resize: vertical;
  min-height: 100px;
}

/* Honeypot — bots fill it, people never see it. */
.psa-hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.psa-submit {
  margin-top: 5.6px;
  width: 100%;
  padding: 12px 16.8px;
  border-radius: 8px;
  border: 1px solid var(--psa-green);
  background: transparent;
  color: var(--psa-green-deep);
  font-size: 14.5px;
  font-weight: 500;
  cursor: pointer;
  transition: background 120ms ease, color 120ms ease;
}
.psa-submit:hover { background: rgba(31, 143, 95, 0.09); }
.psa-submit:active { background: rgba(13, 125, 120, 0.16); color: var(--psa-teal); }
.psa-submit[disabled] { opacity: 0.55; cursor: default; }

.psa-form__error {
  margin: 0;
  font-size: 12.5px;
  color: #b3261e;
}
.psa-form__error:empty { display: none; }

/* Sent state --------------------------------------------------- */
.psa-sent {
  min-height: 400px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 11.2px;
}

.psa-sent__mark {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid var(--psa-green);
  color: var(--psa-green);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}

.psa-sent__title {
  font-family: var(--psa-display);
  font-size: 23px;
  font-weight: 500;
  margin: 11.2px 0 0;
}

.psa-sent__body {
  color: var(--psa-muted);
  margin: 0;
  max-width: 40ch;
}
.psa-sent__email { color: var(--psa-teal); }

.psa-sent__again {
  margin-top: 16.8px;
  padding: 8px 14px;
  border-radius: 8px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--psa-teal);
  font-size: 13.5px;
  cursor: pointer;
}
.psa-sent__again:hover { background: rgba(13, 125, 120, 0.08); }

[hidden] { display: none !important; }

/* ---------------------------------------------------------------
   Footer
   --------------------------------------------------------------- */
.psa-footer {
  background: var(--psa-footer);
  color: #cbd6d0;
  padding: 28px var(--psa-gut);
  position: relative;
  overflow: hidden;
}

.psa-footer__line {
  padding: 0;
  font-size: 12px;
  color: var(--psa-footer-text);
  text-align: center;
  position: relative;
  z-index: 1;
}

/* ---------------------------------------------------------------
   Breakpoints — same steps as the original
   --------------------------------------------------------------- */
@media (max-width: 900px) {
  :root { --psa-gut: 44px; }
  .psa-footer { padding: 24px var(--psa-gut); }
}

@media (max-width: 620px) {
  :root { --psa-gut: 28px; }
  .psa-topbar { padding: 22.4px var(--psa-gut); }
  .psa-contact { padding: 44px 16px; }
  .psa-card { padding: 24px 20px; border-radius: 12px; }
  .psa-form__row { grid-template-columns: 1fr; gap: 16.8px; }

  /* Drop the tagline and button out of the centred stack and sit
     them low on the screen, clear of the dots. The title keeps the
     centre to itself. */
  .psa-hero__actions {
    position: absolute;
    bottom: 15%;
    left: 50%;
    transform: translateX(-50%);
    gap: 16.8px;
    width: max-content;
    max-width: calc(100% - 2 * var(--psa-gut));
  }
  .psa-hero__tagline {
    font-size: 11px;
    letter-spacing: 0.1em;
    white-space: nowrap;
  }
  .psa-hero__sep { margin: 0 2px; }
  .psa-hero__cta { white-space: nowrap; }
  .psa-footer { padding: 20px var(--psa-gut); }
}

@media (max-width: 620px) {
  .psa-dots { bottom: 18px; }
}

/* Respect a reduced-motion preference: no crossfade, no auto-advance
   (the script checks the same query), but the dots still work. */
@media (prefers-reduced-motion: reduce) {
  html, body { scroll-behavior: auto; }
  .psa-slide { transition: none; }
}


/* Contact Form 7 ----------------------------------------------- */
/* CF7 renders the form now. These rules dress its own markup —
   the autop <p> wrappers, labels, controls and messages — in the
   card's look, so the form is styled whether or not the CF7 form
   editor uses this theme's classes. Everything is scoped to
   .psa-contact so other CF7 forms on the site are left alone. */

/* CF7 stamps dir="ltr" on the wrapper when the form's own locale is
   English. The card is Arabic, so turn it back around. */
.psa-contact .wpcf7 {
  direction: rtl;
  text-align: right;
}

.psa-contact .wpcf7-form {
  display: flex;
  flex-direction: column;
  gap: 16.8px;
}

/* wpautop wraps each field in a paragraph; those become the rows. */
.psa-contact .wpcf7-form > p {
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 5.6px;
  font-size: 12.5px;
  color: var(--psa-muted);
}
.psa-contact .wpcf7-form > p br { display: none; }

.psa-contact .wpcf7-form label {
  display: flex;
  flex-direction: column;
  gap: 5.6px;
  font-size: 12.5px;
  color: var(--psa-muted);
  min-width: 0;
}

.psa-contact .wpcf7-form-control-wrap { display: block; }
.psa-contact .wpcf7-form-hidden-fields { display: none; }

.psa-contact .wpcf7-form input[type="text"],
.psa-contact .wpcf7-form input[type="email"],
.psa-contact .wpcf7-form input[type="tel"],
.psa-contact .wpcf7-form input[type="url"],
.psa-contact .wpcf7-form input[type="number"],
.psa-contact .wpcf7-form input[type="date"],
.psa-contact .wpcf7-form select,
.psa-contact .wpcf7-form textarea {
  width: 100%;
  box-sizing: border-box;
  min-width: 0;
  padding: 10px 11.2px;
  border: 1px solid var(--psa-line);
  border-radius: 8px;
  background: var(--psa-field);
  color: var(--psa-ink);
  font-family: inherit;
  font-size: 14px;
  line-height: 1.5;
  transition: border-color 120ms ease, background 120ms ease;
}

.psa-contact .wpcf7-form input:focus,
.psa-contact .wpcf7-form select:focus,
.psa-contact .wpcf7-form textarea:focus {
  outline: none;
  border-color: var(--psa-green);
  background: #ffffff;
}

/* CF7 tags cannot carry a dir attribute, so addresses are turned
   around here instead. */
.psa-contact .wpcf7-form input[type="email"],
.psa-contact .wpcf7-form input[type="tel"],
.psa-contact .wpcf7-form input[type="url"] {
  direction: ltr;
  text-align: right;
}

.psa-contact .wpcf7-form textarea {
  resize: vertical;
  min-height: 100px;
}

/* Submit — matches .psa-submit, with or without the class. */
.psa-contact .wpcf7-form input[type="submit"],
.psa-contact .wpcf7-form button[type="submit"] {
  width: 100%;
  margin-top: 5.6px;
  padding: 12px 16.8px;
  border: 1px solid var(--psa-green);
  border-radius: 8px;
  background: transparent;
  color: var(--psa-green-deep);
  font-family: inherit;
  font-size: 14.5px;
  font-weight: 500;
  cursor: pointer;
  transition: background 120ms ease, color 120ms ease;
}
.psa-contact .wpcf7-form input[type="submit"]:hover,
.psa-contact .wpcf7-form button[type="submit"]:hover {
  background: rgba(31, 143, 95, 0.09);
}
.psa-contact .wpcf7-form input[type="submit"]:active,
.psa-contact .wpcf7-form button[type="submit"]:active {
  background: rgba(13, 125, 120, 0.16);
  color: var(--psa-teal);
}
.psa-contact .wpcf7-form input[type="submit"]:disabled {
  opacity: 0.55;
  cursor: default;
}

/* Validation and status messages. */
.psa-contact .wpcf7-not-valid { border-color: #b3261e; }
.psa-contact .wpcf7-not-valid-tip {
  margin-top: 4px;
  font-size: 12.5px;
  color: #b3261e;
}

.psa-contact .wpcf7-response-output {
  margin: 8px 0 0;
  padding: 10px 12px;
  border: 1px solid var(--psa-line);
  border-radius: 8px;
  font-size: 12.5px;
  color: var(--psa-muted);
}
.psa-contact .sent .wpcf7-response-output {
  border-color: var(--psa-green);
  color: var(--psa-green-deep);
}
.psa-contact .invalid .wpcf7-response-output,
.psa-contact .failed .wpcf7-response-output,
.psa-contact .spam .wpcf7-response-output {
  border-color: #b3261e;
  color: #b3261e;
}

.psa-contact .wpcf7-spinner {
  display: block;
  margin: 8px auto 0;
}

/* Two fields side by side when the form editor asks for it. */
.psa-contact .psa-form__row > p { margin: 0; }
