/* =====================================================================
   CONTACT PAGE (تواصل معنا): masthead, contact-detail cards, message form
   beside a dome-framed image, and a two-prompt feedback panel.
   Page-specific layout. Loaded only on pages/contact-us.html.
   Built entirely on the shared tokens + motifs (dome frame, gold echo,
   kicker/h-sec, gold chips). No new hues, no raw values, no box-shadows,
   logical properties only so RTL and the EN (LTR) toggle both read right.
   ===================================================================== */

/* ---------- 1. MASTHEAD ----------
   Reuses the shared `.page-hero` component (assets/css/base.css). No
   page-specific rules required. */

/* ---------- 2. CONTACT DETAILS (warm canvas, four floating cards) ----------
   Icon chip + label + value, start-aligned. White surfaces float on the
   warm-gray canvas and lift to a gold tint on hover, matching the about-us
   goals tiles so the page reads as one system. */
.ct-info-grid { display: grid; grid-template-columns: repeat(4, 1fr);
  gap: clamp(16px, 1.6vw, 24px); }
.ct-info-card { display: flex; flex-direction: column; align-items: flex-start;
  gap: var(--space-8); padding: clamp(22px, 2.1vw, 32px);
  background: var(--bg-surface); border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  transition: border-color var(--duration-base) var(--ease-standard),
              background var(--duration-base) var(--ease-standard); }
a.ct-info-card { width: 100%; text-decoration: none; color: inherit; }
.ct-info-grid > li { display: flex; }
.ct-info-card:hover { border-color: var(--aegold-300); background: var(--aegold-50); }
.ct-info-ic { position: relative; isolation: isolate; width: 56px; height: 56px; flex-shrink: 0; border-radius: var(--radius-lg);
  background: var(--aegold-50); border: 1px solid var(--aegold-200); color: var(--aegold-700);
  display: inline-flex; align-items: center; justify-content: center;
  transition: border-color var(--duration-base) var(--ease-standard),
              color var(--duration-base) var(--ease-standard); }
/* Gold fill rides a pseudo-element and cross-fades on hover. A solid-to-gradient
   background swap cannot be interpolated, so the gold would otherwise pop in. */
.ct-info-ic::before { content: ""; position: absolute; inset: -1px; z-index: -1; border-radius: inherit;
  background: var(--grad-gold); opacity: 0;
  transition: opacity var(--duration-base) var(--ease-standard); }
.ct-info-card:hover .ct-info-ic { border-color: transparent; color: var(--fg-on-gold); }
.ct-info-card:hover .ct-info-ic::before { opacity: 1; }
.ct-info-label { font-family: var(--font-heading-ar); font-weight: 700;
  font-size: clamp(17px, 1.4vw, 20px); line-height: var(--leading-snug); color: var(--ink); }
.ct-info-val { margin: 0; font-size: 15.5px; line-height: 1.8; color: var(--fg-secondary); }
.ct-info-link { color: var(--aegold-700); font-weight: var(--weight-semibold);
  transition: color var(--duration-fast) var(--ease-standard); }
.ct-info-link:hover { color: var(--aegold-800); text-decoration: underline; text-underline-offset: 3px; }
.ct-info-link bdi { unicode-bidi: isolate; }

/* ---------- 3. MESSAGE FORM (white card + dome-framed image) ----------
   Two-column split: the form card rides the inline-start (right) side, the
   council image rides the end (left) side. Mirrors the faq-intro proportions
   so the two image-splits on the site stay consistent. */
.ct-form-wrap { display: grid; grid-template-columns: 1.15fr .85fr;
  gap: clamp(32px, 4vw, 72px); align-items: stretch; }
.ct-form-card { background: var(--bg-surface); border: 1px solid var(--border-subtle);
  border-radius: var(--radius-2xl); padding: clamp(28px, 3vw, 48px); }
.ct-form-card .h-sec { margin-block-end: clamp(24px, 2.6vw, 36px); }
.ct-form { display: flex; flex-direction: column; gap: var(--space-10); }
.ct-form-row { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-9); }

/* floating-label field: the label rests inside the empty field and floats up
   to notch the top border on focus or once filled. The float is block-axis
   only (inset-block-start + font-size), so it survives the RTL flip; the gold
   on white passes AA. Requires placeholder=" " on the control so
   :placeholder-shown can detect the empty state. */
.ct-field { position: relative; }
.ct-field input,
.ct-field textarea { width: 100%; font: inherit; font-size: 16px; color: var(--fg-primary);
  background: var(--bg-surface); border: 1px solid var(--border-default);
  border-radius: var(--radius-md); padding: 16px var(--space-8); appearance: none;
  transition: border-color var(--duration-base) var(--ease-standard); }
.ct-field textarea { min-height: 148px; resize: vertical; line-height: 1.7; }
.ct-field input:hover,
.ct-field textarea:hover { border-color: var(--border-strong); }
.ct-field input:focus,
.ct-field textarea:focus { border-color: var(--aegold-400); }
.ct-field input::placeholder,
.ct-field textarea::placeholder { color: transparent; }

.ct-field label { position: absolute; inset-block-start: 50%; inset-inline-start: 12px;
  transform: translateY(-50%); padding-inline: var(--space-3); pointer-events: none;
  font-size: 16px; color: var(--fg-secondary); background: transparent;
  transition: inset-block-start var(--duration-base) var(--ease-standard),
              font-size var(--duration-base) var(--ease-standard),
              color var(--duration-base) var(--ease-standard); }
/* textarea label rests near the top, not vertically centered */
.ct-field-area label { inset-block-start: 18px; transform: none; }
.ct-field input:focus ~ label,
.ct-field input:not(:placeholder-shown) ~ label,
.ct-field textarea:focus ~ label,
.ct-field textarea:not(:placeholder-shown) ~ label {
  inset-block-start: 0; transform: translateY(-50%); font-size: 12.5px;
  color: var(--aegold-700); background: var(--bg-surface); }
.ct-req { color: var(--aegold-600); margin-inline-start: 2px; }

/* file attach: a quiet inline link, not a loud zone. The input is
   visually hidden but focusable; the label triggers it and shows the chosen
   file name once picked. A small clear button (appears only when filled)
   removes it. The format/size note sits small on its own line beneath. */
.ct-file { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3) var(--space-7); }
.ct-file-input { position: absolute; width: 1px; height: 1px; padding: 0;
  margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.ct-file-link { display: inline-flex; align-items: center; gap: var(--space-4); cursor: pointer;
  color: var(--aegold-700); font-weight: var(--weight-semibold); font-size: 15px;
  transition: color var(--duration-fast) var(--ease-standard); }
.ct-file-link .ic { width: 18px; height: 18px; }
.ct-file-link:hover { color: var(--aegold-800); text-decoration: underline; text-underline-offset: 3px; }
.ct-file-input:focus-visible + .ct-file-link { outline: 2px solid var(--focus-ring);
  outline-offset: 3px; border-radius: var(--radius-xs); }
/* when a file is chosen the label shows its name, in quiet ink rather than a link colour */
.ct-file.is-filled .ct-file-link { color: var(--ink); font-weight: var(--weight-medium); }
.ct-file-clear { display: inline-flex; align-items: center; justify-content: center; cursor: pointer;
  width: 22px; height: 22px; flex-shrink: 0; padding: 0; border: 0; border-radius: var(--radius-full);
  background: transparent; color: var(--fg-tertiary);
  transition: color var(--duration-fast) var(--ease-standard), background var(--duration-fast) var(--ease-standard); }
/* keep the hidden attribute effective despite the display rule above */
.ct-file-clear[hidden] { display: none; }
.ct-file-clear .ic { width: 15px; height: 15px; }
.ct-file-clear:hover { color: var(--ink); background: var(--aeblack-50); }
.ct-file-clear:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 2px; }
.ct-note { flex-basis: 100%; margin: 0; font-size: 13px; line-height: 1.6; color: var(--fg-tertiary); }

/* the submit uses the shared .btnx.btnx-gold; keep it content-width in the column */
.ct-submit { align-self: flex-start; margin-block-start: var(--space-2); }

@media (prefers-reduced-motion: reduce) {
  .ct-file-link, .ct-file-clear { transition: none; }
}

.ct-form-media { display: flex; width: 100%; min-height: 0; }
.ct-form-media .framed { display: flex; flex: 1; width: 100%; min-height: 0; }
.ct-form-media .shot {
  flex: 1;
  width: 100%;
  min-height: 0;
  border-radius: var(--radius-2xl);
  overflow: hidden;
}

/* ---------- 4. FEEDBACK (warm canvas, two-prompt panel) ----------
   One white panel split into two prompts by a thin neutral rule. */
.ct-fb-panel { display: grid; grid-template-columns: 1fr 1fr;
  background: var(--bg-surface); border: 1px solid var(--border-subtle);
  border-radius: var(--radius-2xl); overflow: hidden; }
.ct-fb-card { display: flex; flex-direction: column; align-items: flex-start;
  gap: var(--space-8); padding: clamp(28px, 3vw, 48px); }
.ct-fb-card + .ct-fb-card { border-inline-start: 1px solid var(--border-subtle); }
.ct-fb-q { font-family: var(--font-heading-ar); font-weight: 700;
  font-size: clamp(19px, 1.7vw, 24px); line-height: var(--leading-snug); color: var(--ink); margin: 0; }
.ct-fb-text { margin: 0; font-size: 15.5px; line-height: 1.75; color: var(--fg-secondary); max-width: 46ch; }
/* feedback actions reuse the shared .btnx (btnx-line btnx-sm) button component */
.ct-fb-actions { display: flex; flex-wrap: wrap; gap: var(--space-8); margin-block-start: var(--space-3); }

/* =====================================================================
   RESPONSIVE: contact sections
   ===================================================================== */
@media (max-width: 1080px) {
  .ct-info-grid { grid-template-columns: repeat(2, 1fr); }
  /* split folds: form leads, the council image follows below it */
  .ct-form-wrap { grid-template-columns: 1fr; gap: clamp(32px, 5vw, 48px); align-items: stretch; }
  .ct-form-media { display: block; max-width: 560px; }
  .ct-form-media .framed { display: block; }
  .ct-form-media .shot { flex: none; aspect-ratio: 16 / 10; }
}
@media (max-width: 768px) {
  .ct-form-row { grid-template-columns: 1fr; }
  .ct-fb-panel { grid-template-columns: 1fr; }
  .ct-fb-card + .ct-fb-card { border-inline-start: 0; border-block-start: 1px solid var(--border-subtle); }
}
@media (max-width: 640px) {
  .ct-info-grid { grid-template-columns: 1fr; max-width: 460px; margin-inline: auto; }
  .ct-file-clear {
    inline-size: 44px;
    block-size: 44px;
  }
}

/* Reduced motion: the label float is decorative, drop its transition. */
@media (prefers-reduced-motion: reduce) {
  .ct-field label { transition: none; }
}
