/*
 * Shared components. Uses CSS logical properties (inline/block) everywhere,
 * so Arabic pages flip automatically when <html dir="rtl">.
 */

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-block-start: calc(var(--header-h) + var(--s-4)); }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: var(--fs-base);
  line-height: var(--lh-body);
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-inline-size: 100%; block-size: auto; }
h1, h2, h3 { font-family: var(--font-display); font-weight: 400; line-height: var(--lh-tight); margin: 0; text-wrap: balance; }
h2 { font-size: var(--fs-xl); }
h3 { font-size: var(--fs-md); }
p { margin: 0; text-wrap: pretty; }
a { color: inherit; text-underline-offset: 0.2em; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: var(--r-sm); }
.container { inline-size: min(100% - 2 * var(--gutter), var(--container)); margin-inline: auto; }
.section { padding-block: var(--s-9); }
.visually-hidden { position: absolute; inline-size: 1px; block-size: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip-link { position: absolute; inset-inline-start: var(--s-4); inset-block-start: -100px; background: var(--accent); color: var(--on-accent); padding: var(--s-2) var(--s-4); z-index: var(--z-overlay); }
.skip-link:focus { inset-block-start: var(--s-2); }
.price { font-variant-numeric: tabular-nums; }
.muted { color: var(--text-muted); }

/* ---------- Icons (Phosphor web font) ---------- */
.ph { font-size: 1.25em; line-height: 1; flex-shrink: 0; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s-2);
  min-block-size: 48px; padding: var(--s-3) var(--s-5);
  border: 2px solid transparent; border-radius: var(--r-sm);
  font: 600 var(--fs-base)/1.2 var(--font-body); text-decoration: none; cursor: pointer;
  transition: transform var(--t-fast) var(--ease-out), background-color var(--t-base) var(--ease-out),
    box-shadow var(--t-base) var(--ease-out), color var(--t-base) var(--ease-out);
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }
.btn--accent { background: var(--accent); color: var(--on-accent); }
.btn--accent:hover { background: var(--accent-strong); box-shadow: var(--shadow-1); }
.btn--brand { background: var(--brand); color: var(--on-brand); }
.btn--brand:hover { background: var(--brand-strong); }
.btn--outline-light { border-color: var(--on-brand-muted); color: var(--on-brand); background: transparent; }
.btn--outline-light:hover { background: var(--indigo-700); }
.btn--outline { border-color: var(--line); color: var(--text); background: var(--bg); }
.btn--outline:hover { border-color: var(--brand); color: var(--brand); }
.btn--block { inline-size: 100%; }
.text-link { display: inline-flex; align-items: center; gap: var(--s-1); color: var(--brand); font-weight: 600; text-decoration: none; }
.text-link:hover .ph { transform: translateX(4px); }
.text-link .ph { transition: transform var(--t-base) var(--ease-out); }
[dir="rtl"] .text-link .ph-arrow-right { transform: scaleX(-1); }
[dir="rtl"] .text-link:hover .ph-arrow-right { transform: scaleX(-1) translateX(4px); }

/* ---------- Header ---------- */
.site-header { position: sticky; inset-block-start: 0; z-index: var(--z-sticky); background: var(--bg); border-block-end: 1px solid var(--line); }
.site-header__inner { display: flex; align-items: center; gap: var(--s-6); block-size: var(--header-h); }
.brand { display: block; flex-shrink: 0; }
.brand img { block-size: 32px; inline-size: auto; }
.nav { display: flex; gap: var(--s-5); margin-inline-start: auto; }
.nav a { position: relative; text-decoration: none; font-weight: 500; padding-block: var(--s-2); }
.nav a::after { content: ""; position: absolute; inset-inline: 0; inset-block-end: 0; block-size: 2px; background: var(--accent); transform: scaleX(0); transform-origin: left; transition: transform var(--t-base) var(--ease-out); }
.nav a:hover::after, .nav a[aria-current="page"]::after { transform: scaleX(1); }
.header-actions { display: flex; align-items: center; gap: var(--s-4); }
.lang-switch { font-weight: 600; text-decoration: none; padding: var(--s-2); }
.nav-mobile { display: none; margin-inline-start: auto; }
.nav-mobile summary { list-style: none; display: grid; place-items: center; inline-size: 48px; block-size: 48px; cursor: pointer; border-radius: var(--r-sm); }
.nav-mobile summary::-webkit-details-marker { display: none; }
.nav-mobile:not([open]) .nav-mobile__panel { display: none; } /* closed panel must not create horizontal overflow */
.nav-mobile__panel { position: absolute; inset-inline: 0; inset-block-start: var(--header-h); background: var(--bg); border-block-end: 1px solid var(--line); padding: var(--s-4) var(--gutter) var(--s-6); display: grid; gap: var(--s-1); box-shadow: var(--shadow-2); }
.nav-mobile__panel a { padding: var(--s-3) 0; text-decoration: none; font-size: var(--fs-md); border-block-end: 1px solid var(--line); }
@media (max-width: 1023px) {
  .nav, .header-actions .btn { display: none; }
  .site-header__inner { gap: var(--s-3); }
  .brand img { block-size: 26px; }
  .nav-mobile { display: block; order: 3; margin-inline-start: 0; }
  .header-actions { order: 2; margin-inline-start: auto; }
}

/* ---------- Section heading row ---------- */
.section-head { display: flex; align-items: end; justify-content: space-between; gap: var(--s-5); margin-block-end: var(--s-7); flex-wrap: wrap; }
.section-head p { max-inline-size: 52ch; margin-block-start: var(--s-3); color: var(--text-muted); }

/* ---------- Tour card ---------- */
.tour-card { position: relative; display: flex; flex-direction: column; border-radius: var(--r-lg); overflow: hidden; background: var(--navy-900); color: var(--n-0); text-decoration: none; isolation: isolate; min-block-size: 280px; }
.tour-card img { position: absolute; inset: 0; inline-size: 100%; block-size: 100%; object-fit: cover; z-index: -2; transition: transform var(--t-slow) var(--ease-out); }
.tour-card::before { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(to top, oklch(0.2 0.08 265 / 0.92), oklch(0.2 0.08 265 / 0.1) 62%); }
.tour-card:hover img { transform: scale(1.04); }
.tour-card__body { margin-block-start: auto; padding: var(--s-5); display: grid; gap: var(--s-2); }
.tour-card__days { justify-self: start; background: var(--accent); color: var(--on-accent); font-weight: 700; font-size: var(--fs-sm); padding: var(--s-1) var(--s-2); border-radius: var(--r-sm); }
.tour-card h3 { font-size: var(--fs-md); }
.tour-card__price { font-size: var(--fs-sm); color: var(--indigo-100); }
.tour-card__price strong { font-size: var(--fs-base); color: var(--n-0); }
.tour-card--large h3 { font-size: var(--fs-lg); }

/* ---------- Forms ---------- */
.form { display: grid; gap: var(--s-4); }
.form__row { display: grid; gap: var(--s-4); grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.field { display: grid; gap: var(--s-1); }
.field label { font-weight: 600; font-size: var(--fs-sm); }
.field input, .field select {
  min-block-size: 48px; padding: var(--s-2) var(--s-3); font: 400 1rem/1.4 var(--font-body);
  color: var(--text); background: var(--bg); border: 1px solid var(--n-300); border-radius: var(--r-sm);
  transition: border-color var(--t-base) var(--ease-out), box-shadow var(--t-base) var(--ease-out);
}
.field input::placeholder { color: var(--n-600); }
.field input:hover, .field select:hover { border-color: var(--n-500); }
.field input:focus-visible, .field select:focus-visible { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--indigo-200); }
.field__hint { font-size: var(--fs-sm); color: var(--text-muted); }
.form__note { font-size: var(--fs-sm); color: var(--text-muted); }

/* ---------- Footer ---------- */
.site-footer { background: var(--navy-900); color: var(--indigo-100); padding-block: var(--s-8) var(--s-7); }
.site-footer a { color: var(--n-0); }
.footer-grid { display: grid; gap: var(--s-7); grid-template-columns: 1.4fr 1fr 1fr 1fr; }
.footer-grid h3 { font-family: var(--font-body); font-size: var(--fs-base); font-weight: 600; color: var(--n-0); margin-block-end: var(--s-3); }
.footer-grid ul { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s-2); }
.footer-grid a { text-decoration: none; }
.footer-grid a:hover { text-decoration: underline; }
.footer-brand img { block-size: 32px; inline-size: auto; margin-block-end: var(--s-4); }
.footer-brand p + p { margin-block-start: var(--s-3); }
.footer-legal { margin-block-start: var(--s-7); padding-block-start: var(--s-5); border-block-start: 1px solid oklch(1 0 0 / 0.14); font-size: var(--fs-sm); display: flex; flex-wrap: wrap; gap: var(--s-4); justify-content: space-between; }
.footer-grid > * { min-inline-size: 0; overflow-wrap: anywhere; }
@media (max-width: 900px) { .footer-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .footer-brand { grid-column: 1 / -1; } }
@media (max-width: 560px) { .footer-grid { grid-template-columns: minmax(0, 1fr); } }

/* ---------- Mobile contact bar (touchpoint) ---------- */
.contact-bar { display: none; }
@media (max-width: 1023px) {
  .contact-bar {
    position: fixed; inset-inline: 0; inset-block-end: 0; z-index: var(--z-sticky);
    display: grid; grid-template-columns: 1fr 1fr 1.4fr; gap: var(--s-2);
    padding: var(--s-2) var(--s-3) calc(var(--s-2) + env(safe-area-inset-bottom));
    background: var(--bg); border-block-start: 1px solid var(--line); box-shadow: var(--shadow-2);
  }
  .contact-bar .btn { min-block-size: 48px; padding-inline: var(--s-2); font-size: var(--fs-sm); }
  body { padding-block-end: 72px; }
}

/* ---------- Motion safety ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
}
