/* =========================================================================
   CONTACT PAGE — page-specific styles only (contact.css)
   Global rules (reset, colors, fonts, .container, .btn, .card, .hero,
   .section, .section-head, navbar, footer) live in /style.css.
   Only this page's own layout belongs here. Colors/fonts come only from the
   §6/§7 variables — no new colors; --dusty-denim is the only accent.
   Load + scroll reveals are AOS (data-aos in the HTML); hovers are pure CSS.
   Identical in /pages/en/ and /pages/ar/ — RTL tweaks use html[dir="rtl"].
   ========================================================================= */

/* Offset in-page anchors so the sticky navbar never covers a heading */
#locations,
#departments,
#enquiry,
#visit,
#faq {
  scroll-margin-top: calc(var(--navbar-height) + 1rem);
}

/* Small uppercase label with an optional leading icon (reused across sections) */
.label {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--color-secondary);
  margin-bottom: 0.6rem;
}
.label svg { width: 16px; height: 16px; }
html[lang="ar"] .label {
  letter-spacing: normal;
  text-transform: none;
  font-size: 0.9rem;
}

/* Shared image-zoom wrapper (hover scale on the child media) */
.img-zoom { overflow: hidden; }
.img-zoom img { transition: transform 0.6s ease; }

/* Buttons with a leading Lucide icon */
.btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
}
.btn-icon svg { width: 18px; height: 18px; }

/* ------------------------------------------------------------------ 1 · HERO */
.page-hero {
  min-height: 78vh;
}
.page-hero .container {
  padding-bottom: 5rem; /* room for the overlapping stats bar */
}

/* ------------------------------------------------------------- 2 · STATS BAR */
.stats-wrap {
  position: relative;
  z-index: 3;
  margin-top: -4.5rem;
}
.stats-bar {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1px; /* hairline dividers come from the background showing through */
  background: rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-card);
  overflow: hidden;
  box-shadow: 0 24px 50px rgba(36, 58, 94, 0.28);
}
@media (min-width: 1024px) {
  .stats-bar { grid-template-columns: repeat(4, 1fr); }
}
.stat-item {
  position: relative;
  background: var(--color-primary);
  padding: 2.25rem 1.25rem;
  text-align: center;
  transition: all 0.25s ease;
}
.stat-item::before {
  content: "";
  position: absolute;
  top: 0;
  inset-inline: 0;
  height: 3px;
  background: var(--color-accent);
  transform: scaleX(0);
  transition: transform 0.25s ease;
}
.stat-item:hover::before { transform: scaleX(1); }
.stat-num {
  display: block;
  font-family: var(--font-heading-en);
  font-size: clamp(2.1rem, 4.5vw, 3.2rem);
  font-weight: 700;
  line-height: 1.05;
  color: var(--color-text-invert);
}
.stat-num small {
  font-size: 0.45em;
  font-weight: 500;
  color: var(--color-accent);
  vertical-align: 0.35em;
}
html[lang="ar"] .stat-num { font-family: var(--font-heading-ar); }
.stat-label {
  display: block;
  margin-top: 0.6rem;
  font-size: 0.82rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-surface-alt);
}
html[lang="ar"] .stat-label {
  letter-spacing: normal;
  text-transform: none;
  font-size: 0.95rem;
}

/* ------------------------------------------------------------ 3 · LOCATIONS */
.loc-grid {
  display: grid;
  gap: 2rem;
}
@media (min-width: 1024px) {
  .loc-grid {
    grid-template-columns: 1fr 1fr;
    gap: 2.5rem;
  }
}
.loc-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: #fff;
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  border-top: 3px solid transparent;
  overflow: hidden;
  transition: all 0.25s ease;
}
.loc-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-card-hover);
  border-top-color: var(--color-secondary);
}
.loc-media {
  position: relative;
  aspect-ratio: 16 / 9;
  background: linear-gradient(135deg, var(--midnight-blue), var(--dusty-denim));
}
.loc-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.loc-card:hover .loc-media img { transform: scale(1.04); }
/* Badge sits after the media in the flex column, pulled up to straddle its edge */
.loc-badge {
  position: relative;
  z-index: 1;
  align-self: flex-start;
  margin-top: -29px;
  margin-inline-start: 2rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 58px;
  height: 58px;
  border-radius: 12px;
  background: var(--color-primary);
  color: var(--color-text-invert);
  border: 3px solid #fff;
  box-shadow: var(--shadow-card);
  transition: all 0.25s ease;
}
.loc-badge svg { width: 26px; height: 26px; }
.loc-card:hover .loc-badge { background: var(--color-secondary); }

.loc-body {
  flex: 1;
  padding: 1.25rem 2rem 1.5rem;
}
@media (min-width: 768px) {
  .loc-body { padding: 1.5rem 2.5rem 1.5rem; }
}
.loc-body h3 {
  font-size: clamp(1.5rem, 2.6vw, 2rem);
  margin-bottom: 0.9rem;
}
.loc-desc {
  color: var(--color-secondary);
  margin-bottom: 1.5rem;
}
.loc-meta {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  padding-top: 1.25rem;
  border-top: 1px solid rgba(36, 58, 94, 0.1);
  font-size: 0.95rem;
}
.loc-meta li {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
}
.loc-meta svg {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  margin-top: 0.25rem;
  color: var(--color-secondary);
}
.loc-meta a {
  transition: color 0.25s ease;
  font-weight: 500;
}
.loc-meta a:hover { color: var(--color-secondary); }
.loc-meta .sep {
  margin-inline: 0.35rem;
  color: var(--color-accent);
}

.loc-map {
  margin: 0 2rem;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid rgba(36, 58, 94, 0.1);
  background: var(--color-surface);
}
@media (min-width: 768px) {
  .loc-map { margin: 0 2.5rem; }
}
.loc-map iframe {
  display: block;
  width: 100%;
  height: 240px;
  border: 0;
}
.loc-actions { padding: 1.5rem 2rem 2rem; }
@media (min-width: 768px) {
  .loc-actions { padding: 1.5rem 2.5rem 2.5rem; }
}

/* ---------------------------------------------------------- 4 · DEPARTMENTS */
.dept-grid {
  display: grid;
  gap: 3rem;
}
@media (min-width: 1024px) {
  .dept-grid {
    grid-template-columns: 1.4fr 1fr;
    gap: 4rem;
    align-items: start;
  }
}
.dept-grid h2 { margin-bottom: 0.9rem; }
.dept-intro {
  color: var(--color-secondary);
  margin-bottom: 2rem;
  max-width: 56ch;
}
.dept-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.dept-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.25rem;
  border-radius: var(--radius-card);
  background: #fff;
  border: 1px solid rgba(36, 58, 94, 0.08);
  box-shadow: 0 2px 8px rgba(36, 58, 94, 0.05);
  transition: all 0.25s ease;
}
.dept-row:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-card-hover);
  border-color: var(--color-secondary);
}
.dept-icon {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: var(--color-surface);
  color: var(--color-primary);
  transition: all 0.25s ease;
}
.dept-icon svg { width: 20px; height: 20px; }
.dept-row:hover .dept-icon {
  background: var(--color-primary);
  color: var(--color-text-invert);
}
.dept-text {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start; /* keeps LTR emails on the start side in RTL too */
}
.dept-text strong {
  font-weight: 600;
  overflow-wrap: anywhere;
  transition: color 0.25s ease;
}
.dept-text span {
  font-size: 0.88rem;
  color: var(--color-secondary);
}
html[lang="ar"] .dept-text span { font-size: 0.98rem; }
.dept-row:hover strong { color: var(--color-secondary); }
.dept-arrow {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  color: var(--color-accent);
  transition: all 0.25s ease;
}
.dept-row:hover .dept-arrow {
  color: var(--color-primary);
  transform: translate(2px, -2px);
}
html[dir="rtl"] .dept-arrow { transform: scaleX(-1); }
html[dir="rtl"] .dept-row:hover .dept-arrow { transform: scaleX(-1) translate(2px, -2px); }

.dept-aside {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}
.aside-card {
  background: var(--color-primary);
  color: var(--color-text-invert);
  border-radius: var(--radius-card);
  padding: 2rem;
  box-shadow: 0 18px 40px rgba(36, 58, 94, 0.2);
}
.aside-card h3 { margin: 1rem 0 0.4rem; }
.aside-card p { color: var(--color-surface-alt); font-size: 0.95rem; }
html[lang="ar"] .aside-card p { font-size: 1.05rem; }
.aside-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.1);
  color: var(--color-accent);
}
.aside-icon svg { width: 24px; height: 24px; }
.social-row {
  display: flex;
  gap: 0.75rem;
  margin-top: 1.25rem;
}
.social-row a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: var(--color-text-invert);
  transition: all 0.25s ease;
}
.social-row a:hover {
  background: var(--color-accent);
  border-color: var(--color-accent);
  color: var(--color-primary);
  transform: translateY(-2px);
}
.social-row svg { width: 18px; height: 18px; }

/* --------------------------------------------------------- 5 · ENQUIRY FORM */
.form-layout {
  display: grid;
  gap: 3rem;
  align-items: start;
}
@media (min-width: 1024px) {
  .form-layout {
    grid-template-columns: 0.85fr 1.15fr;
    gap: 4rem;
  }
  .form-copy {
    position: sticky;
    top: calc(var(--navbar-height) + 2rem);
  }
}
.form-copy h2 { margin-bottom: 1rem; }
.form-copy > p { color: var(--color-secondary); }
.assure-list {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  margin-top: 2rem;
}
.assure-list li {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
}
.assure-icon {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--color-surface);
  color: var(--color-primary);
  transition: all 0.25s ease;
}
.assure-icon svg { width: 20px; height: 20px; }
.assure-list li:hover .assure-icon {
  background: var(--color-primary);
  color: var(--color-text-invert);
}
.assure-list h4 { font-size: 1.05rem; }
.assure-list p { color: var(--color-secondary); font-size: 0.93rem; }
html[lang="ar"] .assure-list h4 { font-size: 1.3rem; }
html[lang="ar"] .assure-list p { font-size: 1rem; }

.form-card {
  position: relative;
  background: #fff;
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  border: 1px solid rgba(36, 58, 94, 0.06);
  border-top: 4px solid var(--color-primary);
  padding: 2rem 1.5rem;
}
@media (min-width: 768px) {
  .form-card { padding: 2.75rem; }
}
.contact-form fieldset {
  border: none;
  margin-bottom: 1.75rem;
}
.contact-form legend {
  width: 100%;
  padding-bottom: 0.6rem;
  margin-bottom: 1.1rem;
  border-bottom: 1px solid rgba(36, 58, 94, 0.1);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--color-secondary);
}
html[lang="ar"] .contact-form legend {
  letter-spacing: normal;
  font-size: 0.95rem;
}
.form-grid {
  display: grid;
  gap: 1.1rem 1.25rem;
  grid-template-columns: 1fr;
}
@media (min-width: 640px) {
  .form-grid { grid-template-columns: 1fr 1fr; }
  .form-grid .full { grid-column: 1 / -1; }
}
.field {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.field label,
.field-label {
  font-size: 0.88rem;
  font-weight: 500;
}
html[lang="ar"] .field label,
html[lang="ar"] .field-label { font-size: 0.98rem; }
.req { color: var(--color-secondary); font-weight: 700; }
.optional { color: var(--color-secondary); font-weight: 400; }
.field input[type="text"],
.field input[type="email"],
.field input[type="tel"],
.field select,
.field textarea {
  width: 100%;
  padding: 0.75rem 0.9rem;
  border: 1.5px solid rgba(36, 58, 94, 0.18);
  border-radius: 6px;
  background: #fff;
  font: inherit;
  font-size: 0.95rem;
  color: var(--color-text);
  transition: all 0.2s ease;
}
.field textarea {
  resize: vertical;
  min-height: 140px;
}
.field input::placeholder,
.field textarea::placeholder { color: var(--color-accent); }
.field input:hover,
.field select:hover,
.field textarea:hover { border-color: var(--color-accent); }
.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--color-secondary);
  box-shadow: 0 0 0 3px rgba(95, 134, 166, 0.2);
}
/* Arabic pages keep phone/email LTR, but align them with the RTL layout */
html[dir="rtl"] .field input[type="tel"],
html[dir="rtl"] .field input[type="email"] { text-align: right; }

/* Custom select arrow (native arrow hidden so it mirrors cleanly in RTL) */
.select-wrap { position: relative; }
.select-wrap select {
  appearance: none;
  -webkit-appearance: none;
  padding-inline-end: 2.5rem;
  cursor: pointer;
}
.select-wrap svg {
  position: absolute;
  top: 50%;
  inset-inline-end: 0.85rem;
  width: 18px;
  height: 18px;
  transform: translateY(-50%);
  color: var(--color-secondary);
  pointer-events: none;
}
.select-wrap select:invalid { color: var(--color-accent); }
.select-wrap select option { color: var(--color-text); }

/* Custom file drop zone — the real <input type="file"> is visually hidden
   inside the label, so clicking/keyboard still use the native picker */
.file-drop {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
  min-height: 118px;
  padding: 1.25rem 1rem;
  border: 1.5px dashed rgba(36, 58, 94, 0.25);
  border-radius: 8px;
  background: var(--color-surface);
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
}
.file-drop svg {
  width: 24px;
  height: 24px;
  color: var(--color-secondary);
}
.file-drop:hover,
.file-drop:focus-within {
  border-color: var(--color-secondary);
  background: var(--color-surface-alt);
}
.file-drop:focus-within { box-shadow: 0 0 0 3px rgba(95, 134, 166, 0.2); }
.file-drop input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  overflow: hidden;
}
.file-name {
  font-weight: 600;
  font-size: 0.92rem;
  word-break: break-all;
}
.file-hint {
  font-size: 0.78rem;
  color: var(--color-secondary);
}
.file-drop.has-file {
  border-style: solid;
  border-color: var(--color-secondary);
}

/* Validation state — palette has no red, so errors use a heavier midnight
   border + bold message instead of introducing a new color (§13) */
.field-error {
  display: none;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--color-primary);
}
.field.is-invalid .field-error { display: block; }
.field.is-invalid .field-error::before { content: "⚠ "; }
.field.is-invalid input,
.field.is-invalid select,
.field.is-invalid textarea,
.field.is-invalid .file-drop {
  border-color: var(--color-primary);
  border-width: 2px;
  background: var(--color-surface);
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem 1.5rem;
}
.btn-submit {
  padding: 0.85rem 2rem;
  box-shadow: 0 8px 20px rgba(36, 58, 94, 0.2);
}
.btn-submit:hover { box-shadow: 0 12px 26px rgba(36, 58, 94, 0.28); }
.btn-submit svg { transition: transform 0.25s ease; }
.btn-submit:hover svg { transform: translateX(3px); }
html[dir="rtl"] .btn-submit svg { transform: scaleX(-1); }
html[dir="rtl"] .btn-submit:hover svg { transform: scaleX(-1) translateX(3px); }
.form-note { font-size: 0.85rem; color: var(--color-secondary); }

/* Brief highlight when "Request a Visit" pre-fills the form */
.form-card.is-prefilled { animation: prefill-pulse 1.2s ease; }
@keyframes prefill-pulse {
  0% { box-shadow: 0 0 0 0 rgba(95, 134, 166, 0.45); }
  100% { box-shadow: 0 0 0 16px rgba(95, 134, 166, 0); }
}

.form-success {
  text-align: center;
  padding: 2rem 1rem;
}
.form-success:focus { outline: none; }
.form-success .card-icon {
  margin-inline: auto;
  margin-bottom: 1.25rem;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--color-surface);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--color-primary);
}
.form-success .card-icon svg { width: 30px; height: 30px; }
.form-success h3 { margin-bottom: 0.5rem; }
.form-success p { color: var(--color-secondary); margin-bottom: 1.75rem; }

/* ------------------------------------------------------ 6 · SHIPYARD VISIT */
.visit-box {
  display: grid;
  border-radius: var(--radius-card);
  overflow: hidden;
  background: var(--color-primary);
  color: var(--color-text-invert);
  box-shadow: 0 24px 50px rgba(36, 58, 94, 0.22);
  transition: all 0.25s ease;
}
.visit-box:hover {
  transform: translateY(-4px);
  box-shadow: 0 30px 60px rgba(36, 58, 94, 0.3);
}
@media (min-width: 900px) {
  .visit-box { grid-template-columns: 0.9fr 1.1fr; }
}
.visit-media { overflow: hidden; }
.visit-media img {
  width: 100%;
  height: 100%;
  min-height: 260px;
  object-fit: cover;
  transition: transform 0.6s ease;
}
.visit-box:hover .visit-media img { transform: scale(1.04); }
.visit-body { padding: 2.5rem 1.75rem; }
@media (min-width: 768px) {
  .visit-body { padding: 3.5rem 3rem; }
}
.visit-body .label { color: var(--color-accent); }
.visit-body h2 { margin-bottom: 1rem; }
.visit-body p { color: var(--color-surface-alt); }
.visit-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem 1.75rem;
  margin-top: 2rem;
}

.link-arrow {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-weight: 600;
  color: var(--color-secondary);
  transition: all 0.25s ease;
}
.link-arrow svg { width: 18px; height: 18px; transition: transform 0.25s ease; }
.link-arrow:hover { color: var(--color-primary); }
.link-arrow:hover svg { transform: translateX(4px); }
.link-arrow--light { color: var(--color-text-invert); }
.link-arrow--light:hover { color: var(--color-accent); }
html[dir="rtl"] .link-arrow svg { transform: scaleX(-1); }
html[dir="rtl"] .link-arrow:hover svg { transform: scaleX(-1) translateX(4px); }

/* ----------------------------------------------------------------- 7 · FAQ */
.faq-wrap { max-width: 860px; }
.faq-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.faq-item {
  background: #fff;
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  border-inline-start: 3px solid transparent;
  transition: all 0.25s ease;
}
.faq-item:hover,
.faq-item[open] { border-inline-start-color: var(--color-secondary); }
.faq-item:hover { box-shadow: var(--shadow-card-hover); }
.faq-item summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.35rem 1.5rem;
  cursor: pointer;
  list-style: none;
  font-weight: 600;
  font-size: 1.05rem;
  color: var(--color-primary);
  transition: color 0.25s ease;
}
html[lang="ar"] .faq-item summary { font-size: 1.15rem; }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary:hover { color: var(--color-secondary); }
.faq-item summary:focus-visible {
  outline: 2px solid var(--color-secondary);
  outline-offset: 4px;
  border-radius: var(--radius-card);
}
.faq-item .chev {
  flex: 0 0 auto;
  width: 20px;
  height: 20px;
  transition: transform 0.25s ease;
}
.faq-item[open] .chev { transform: rotate(180deg); }
.faq-item[open] .faq-body { animation: faq-in 0.25s ease; }
@keyframes faq-in {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}
.faq-body { padding: 0 1.5rem 1.5rem; }
.faq-body p { color: var(--color-secondary); }
.faq-body a:not(.link-arrow) {
  color: var(--color-primary);
  font-weight: 600;
  border-bottom: 1px solid var(--color-accent);
}
.faq-body .link-arrow {
  display: flex;
  width: fit-content;
  margin-top: 0.9rem;
}

/* ------------------------------------------------------------ Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .img-zoom img,
  .visit-media img,
  .loc-card,
  .dept-row,
  .visit-box { transition: none; }
  .loc-card:hover,
  .dept-row:hover,
  .visit-box:hover { transform: none; }
  .faq-item[open] .faq-body,
  .form-card.is-prefilled { animation: none; }
}
