/* Components: reusable across every page template */

/* ---------- Buttons ---------- */
.btn {
  --btn-bg: var(--saffron); --btn-fg: var(--indigo); --btn-bd: var(--saffron);
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s-2);
  min-height: 48px; padding: 0 var(--s-5);
  border: 1.5px solid var(--btn-bd); border-radius: var(--r-pill);
  background: var(--btn-bg); color: var(--btn-fg);
  font-weight: 700; font-size: var(--fs-sm); letter-spacing: .01em; text-decoration: none;
  cursor: pointer; white-space: nowrap;
  transition: background var(--t-fast), color var(--t-fast), border-color var(--t-fast), transform var(--t-fast);
}
.btn:hover { --btn-bg: #e09a12; --btn-bd: #e09a12; color: var(--btn-fg); }
.btn:active { transform: translateY(1px); }
.btn svg { width: 18px; height: 18px; flex: none; }
.btn--dark { --btn-bg: var(--indigo); --btn-fg: var(--white); --btn-bd: var(--indigo); }
.btn--dark:hover { --btn-bg: var(--indigo-2); --btn-bd: var(--indigo-2); }
.btn--ghost { --btn-bg: transparent; --btn-fg: var(--indigo); --btn-bd: var(--indigo); }
.btn--ghost:hover { --btn-bg: var(--indigo); --btn-fg: var(--white); --btn-bd: var(--indigo); }
.btn--ghost-light { --btn-bg: transparent; --btn-fg: var(--white); --btn-bd: rgb(255 255 255 / .55); }
.btn--ghost-light:hover { --btn-bg: var(--white); --btn-fg: var(--indigo); --btn-bd: var(--white); }
.btn--whatsapp { --btn-bg: #1f8f4e; --btn-fg: var(--white); --btn-bd: #1f8f4e; }
.btn--whatsapp:hover { --btn-bg: #18733f; --btn-bd: #18733f; }
.btn--sm { min-height: 40px; padding: 0 var(--s-4); }

.link-arrow {
  display: inline-flex; align-items: center; gap: var(--s-2);
  font-weight: 700; font-size: var(--fs-sm); color: var(--indigo); text-decoration: none;
  border-bottom: 1.5px solid var(--saffron); padding-bottom: 2px;
}
.link-arrow:hover { color: var(--henna); }
.section--night .link-arrow { color: var(--white); }

/* ---------- Badges & chips ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px; border-radius: var(--r-pill);
  font-size: var(--fs-xs); font-weight: 700; letter-spacing: .04em;
  background: var(--white); color: var(--indigo);
}
.badge--saffron { background: var(--saffron); color: var(--indigo); }
.badge--outline { background: transparent; border: 1px solid var(--line); color: var(--stone); }

.chip {
  display: inline-flex; align-items: center; min-height: 38px; padding: 0 var(--s-4);
  border: 1.5px solid var(--line); border-radius: var(--r-pill); background: var(--white);
  font-size: var(--fs-sm); font-weight: 600; color: var(--indigo); cursor: pointer;
  transition: border-color var(--t-fast), background var(--t-fast);
}
.chip:hover { border-color: var(--saffron); }
.chip[aria-pressed="true"] { background: var(--indigo); border-color: var(--indigo); color: var(--white); }

/* ---------- Logo lockup ---------- */
.logo { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; color: var(--indigo); }
.logo__mark { width: 40px; height: auto; flex: none; }
.logo__text { display: grid; line-height: 1; }
.logo__top { font-family: var(--font-body); font-size: .62rem; font-weight: 800; letter-spacing: .32em; text-transform: uppercase; }
.logo__name { font-family: var(--font-display); font-size: 1.55rem; letter-spacing: -.01em; margin-top: 3px; }
.logo--light { color: var(--white); }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 50;
  background: rgb(253 251 247 / .94);
  backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--line);
}
.site-header__bar { display: flex; align-items: center; justify-content: space-between; gap: var(--s-5); min-height: 76px; }
.nav { display: flex; align-items: center; gap: var(--s-6); }
.nav__list { display: flex; gap: var(--s-5); list-style: none; }
.nav__list a {
  position: relative; display: inline-block; padding-block: var(--s-2);
  font-size: var(--fs-sm); font-weight: 600; color: var(--indigo); text-decoration: none;
}
.nav__list a::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 2px;
  background: var(--saffron); transform: scaleX(0); transform-origin: left; transition: transform var(--t-med) var(--ease);
}
.nav__list a:hover::after, .nav__list a[aria-current="page"]::after { transform: scaleX(1); }
.nav__actions { display: flex; align-items: center; gap: var(--s-3); }

/* Dropdown under "Morocco Tours" (opens on hover, keyboard focus or the arrow button) */
.nav__has-sub { position: relative; display: flex; align-items: center; gap: 2px; }
.nav__sub-toggle { display: grid; place-items: center; width: 24px; height: 28px; padding: 0; border: 0; background: none; color: var(--indigo); cursor: pointer; }
.nav__sub-toggle svg { width: 10px; height: 8px; transition: transform var(--t-fast); }
.nav__sub-toggle[aria-expanded="true"] svg { transform: rotate(180deg); }
.nav__sub {
  position: absolute; top: 100%; left: -16px; z-index: 60; min-width: 230px;
  display: grid; gap: 0; padding: var(--s-2); list-style: none;
  background: var(--white); border: 1px solid var(--line); border-radius: var(--r-md); box-shadow: var(--shadow-2);
  opacity: 0; visibility: hidden; transform: translateY(6px);
  transition: opacity var(--t-fast), transform var(--t-fast), visibility var(--t-fast);
}
.nav__sub::before { content: ""; position: absolute; left: 0; right: 0; top: -12px; height: 12px; }  /* hover bridge */
.nav__has-sub:hover .nav__sub, .nav__has-sub:focus-within .nav__sub, .nav__has-sub.is-open .nav__sub { opacity: 1; visibility: visible; transform: none; }
.nav__list .nav__sub a { display: block; padding: var(--s-2) var(--s-3); border-radius: var(--r-sm); font-weight: 500; white-space: nowrap; }
.nav__list .nav__sub a::after { display: none; }
.nav__list .nav__sub a:hover, .nav__list .nav__sub a[aria-current="page"] { background: var(--dune); color: var(--henna); }
.nav__sub-all { border-top: 1px solid var(--line); margin-top: var(--s-1); padding-top: var(--s-1); }
.nav__list .nav__sub-all a { font-weight: 700; }
.nav-toggle {
  display: none; width: 46px; height: 46px; border: 1.5px solid var(--line); border-radius: 50%;
  background: var(--white); cursor: pointer; place-items: center;
}
.nav-toggle span, .nav-toggle span::before, .nav-toggle span::after {
  display: block; width: 18px; height: 2px; background: var(--indigo); border-radius: 2px; position: relative; content: "";
  transition: transform var(--t-fast);
}
.nav-toggle span::before { position: absolute; top: -6px; }
.nav-toggle span::after { position: absolute; top: 6px; }
.nav-toggle[aria-expanded="true"] span { background: transparent; }
.nav-toggle[aria-expanded="true"] span::before { transform: translateY(6px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span::after { transform: translateY(-6px) rotate(-45deg); }

@media (max-width: 960px) {
  /* backdrop-filter would make the fixed menu panel size itself to the header bar */
  .site-header { backdrop-filter: none; background: var(--chalk); }
  .nav-toggle { display: grid; }
  .nav {
    position: fixed; inset: 76px 0 0 0; z-index: 49;
    flex-direction: column; align-items: stretch; gap: var(--s-6);
    padding: var(--s-6) var(--gutter-r) var(--s-7) var(--gutter);
    background: var(--chalk) var(--lattice); overflow-y: auto;
    transform: translateX(100%); visibility: hidden; transition: transform var(--t-med) var(--ease), visibility var(--t-med);
  }
  .nav.is-open { transform: none; visibility: visible; }
  .nav__list { flex-direction: column; gap: 0; }
  .nav__list a { display: block; padding-block: var(--s-4); font-family: var(--font-display); font-size: 1.75rem; font-weight: 400; border-bottom: 1px solid var(--line); }
  .nav__list a::after { display: none; }
  .nav__actions { flex-direction: column; align-items: stretch; }
  /* Mobile: the city list sits under "Morocco Tours", opened with the arrow */
  .nav__has-sub { flex-wrap: wrap; border-bottom: 1px solid var(--line); }
  .nav__has-sub > a { flex: 1; border-bottom: 0; }
  .nav__sub-toggle { width: 46px; height: 46px; }
  .nav__sub-toggle svg { width: 14px; height: 10px; }
  .nav__sub { position: static; flex-basis: 100%; min-width: 0; display: none; padding: 0 0 var(--s-3) var(--s-4); background: none; border: 0; box-shadow: none; opacity: 1; visibility: visible; transform: none; }
  .nav__has-sub:hover .nav__sub, .nav__has-sub:focus-within .nav__sub { display: none; }
  .nav__has-sub.is-open .nav__sub { display: grid; }
  .nav__list .nav__sub a { font-family: var(--font-body); font-size: var(--fs-base); padding: var(--s-2) 0; border-bottom: 0; }
  .nav__sub-all { border-top: 0; }
}
@media (min-width: 961px) {
  .nav__has-sub:hover .nav__sub { transition-delay: 0s; }
}

/* ---------- Arch card (destinations) ---------- */
.arch-card { display: grid; gap: var(--s-3); text-decoration: none; color: inherit; }
.arch-card__frame {
  position: relative; aspect-ratio: 3 / 4; max-width: 100%;
  border-radius: var(--arch); overflow: hidden; background: var(--dune);
  box-shadow: inset 0 0 0 1px rgb(0 0 0 / .04);
}
.arch-card__frame img { width: 100%; height: 100%; object-fit: cover; transition: transform 1.2s var(--ease); }
.arch-card:hover .arch-card__frame img { transform: scale(1.06); }
.arch-card__frame .badge { position: absolute; left: 50%; bottom: var(--s-4); transform: translateX(-50%); white-space: nowrap; }
.arch-card__title { font-family: var(--font-display); font-size: var(--fs-xl); color: var(--indigo); line-height: 1.1; }
.arch-card__meta { display: grid; gap: 2px; font-size: var(--fs-sm); color: var(--muted); }
.arch-card__meta b { color: var(--fg); font-weight: 600; }

/* ---------- Tour card ---------- */
.tour-card {
  display: grid; grid-template-rows: auto 1fr; background: var(--white);
  border: 1px solid var(--line); border-radius: var(--r-md); overflow: hidden;
  text-decoration: none; color: inherit;
  transition: box-shadow var(--t-med) var(--ease), transform var(--t-med) var(--ease);
}
.tour-card:hover { box-shadow: var(--shadow-2); transform: translateY(-3px); }
.tour-card__media { position: relative; aspect-ratio: 4 / 3; overflow: hidden; }
.tour-card__media img { width: 100%; height: 100%; object-fit: cover; }
.tour-card__media .badge { position: absolute; top: var(--s-3); left: var(--s-3); }
.tour-card__days {
  position: absolute; right: var(--s-4); bottom: 0;
  display: grid; place-items: center; align-content: center; gap: 2px; width: 58px; height: 64px; padding-top: 6px;
  border-radius: 29px 29px 0 0; background: var(--white); color: var(--indigo); line-height: 1;
}
.tour-card__days b { font-family: var(--font-display); font-size: 1.6rem; font-weight: 400; }
.tour-card__days span { font-size: .62rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--stone); }
.tour-card__body { display: grid; grid-template-rows: auto auto 1fr auto; gap: var(--s-3); padding: var(--s-5); }
.route { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: var(--fs-xs); font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--henna); }
.route i { width: 14px; height: 1.5px; background: currentColor; opacity: .5; }
.tour-card__title { font-family: var(--font-display); font-size: 1.45rem; line-height: 1.15; color: var(--indigo); }
.tour-card__text { font-size: var(--fs-sm); color: var(--muted); }
.tour-card__foot { display: flex; align-items: end; justify-content: space-between; gap: var(--s-3); padding-top: var(--s-4); border-top: 1px dashed var(--line); }
.price { display: grid; line-height: 1.1; }
.price small { font-size: var(--fs-xs); color: var(--muted); }
.price b { font-family: var(--font-display); font-weight: 400; font-size: 1.6rem; color: var(--indigo); font-variant-numeric: tabular-nums; }
.price span { font-size: var(--fs-xs); color: var(--muted); }

/* ---------- Experience tile (square, caption over image) ---------- */
.exp-tile { position: relative; display: block; border-radius: var(--r-md); overflow: hidden; aspect-ratio: 1; max-width: 100%; color: var(--white); text-decoration: none; }
.exp-tile img { width: 100%; height: 100%; object-fit: cover; transition: transform 1.2s var(--ease); }
.exp-tile:hover img { transform: scale(1.05); }
.exp-tile::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 40%, rgb(12 18 32 / .85)); }
.exp-tile__cap { position: absolute; left: var(--s-5); right: var(--s-5); bottom: var(--s-5); z-index: 1; display: grid; gap: 4px; }
.exp-tile__cap b { font-family: var(--font-display); font-weight: 400; font-size: 1.4rem; line-height: 1.15; }
.exp-tile__cap span { font-size: var(--fs-sm); color: rgb(255 255 255 / .8); }

/* ---------- Form fields ---------- */
.field { display: grid; gap: 6px; min-width: 0; }
.field label, .field .label { font-size: var(--fs-xs); font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--stone); }
.input, .select, .textarea {
  width: 100%; min-height: 50px; padding: 0 var(--s-4);
  border: 1.5px solid var(--line); border-radius: var(--r-sm); background: var(--white);
  font-size: var(--fs-base); color: var(--ink);
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
.textarea { padding-block: var(--s-3); min-height: 130px; resize: vertical; }
.select {
  appearance: none; padding-right: 42px; cursor: pointer;
  background: var(--white) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%2317223a' stroke-width='1.8' fill='none'/%3E%3C/svg%3E") no-repeat right 16px center;
}
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--indigo); box-shadow: 0 0 0 3px rgb(207 138 0 / .3); }
.field--error .input, .field--error .select, .field--error .textarea { border-color: var(--clay); }
.field__error { font-size: var(--fs-sm); color: var(--clay); font-weight: 600; }
.field__hint { font-size: var(--fs-sm); color: var(--muted); }

.notice { padding: var(--s-4) var(--s-5); border-radius: var(--r-sm); font-weight: 600; font-size: var(--fs-sm); }
.notice--ok { background: #e3f1ea; color: #1d4f3a; border: 1px solid #b9dcc9; }
.notice--err { background: #f8e6e0; color: #7c2f19; border: 1px solid #ecc4b6; }

/* ---------- Trip finder (hero search) ---------- */
.finder {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)) auto; gap: var(--s-4); align-items: end;
  padding: var(--s-5); background: var(--white); border-radius: var(--r-md); box-shadow: var(--shadow-2);
}
.finder .btn { min-height: 50px; }
@media (max-width: 1000px) { .finder { grid-template-columns: repeat(2, minmax(0, 1fr)); } .finder .btn { grid-column: 1 / -1; } }
@media (max-width: 520px) { .finder { grid-template-columns: minmax(0, 1fr); } }

/* ---------- Accordion (FAQ, day-by-day) ---------- */
.accordion { border-top: 1px solid var(--line); }
.accordion details { border-bottom: 1px solid var(--line); }
.accordion summary {
  display: flex; justify-content: space-between; gap: var(--s-4); align-items: center;
  padding-block: var(--s-5); cursor: pointer; list-style: none;
  font-family: var(--font-display); font-size: var(--fs-lg); color: var(--indigo);
}
.accordion summary::-webkit-details-marker { display: none; }
.accordion summary::after {
  content: "+"; flex: none; display: grid; place-items: center; width: 34px; height: 34px;
  border: 1.5px solid var(--line); border-radius: 50%; font-family: var(--font-body); font-size: 1.2rem; transition: transform var(--t-fast);
}
.accordion details[open] summary::after { transform: rotate(45deg); border-color: var(--saffron); }
.accordion .accordion__body { padding-bottom: var(--s-5); color: var(--muted); max-width: var(--wrap-text); }

/* ---------- Steps (real sequence) ---------- */
.steps { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--s-5); list-style: none; counter-reset: step; }
.steps li { counter-increment: step; display: grid; gap: var(--s-3); align-content: start; padding-top: var(--s-5); border-top: 2px solid var(--line); position: relative; }
.steps li::before {
  content: counter(step); position: absolute; top: -19px; left: 0;
  display: grid; place-items: center; width: 36px; height: 36px;
  border-radius: 18px 18px 4px 4px; background: var(--saffron); color: var(--indigo);
  font-family: var(--font-display); font-size: 1.15rem;
}
.steps h3 { font-size: var(--fs-lg); margin-top: var(--s-3); }
.steps p { font-size: var(--fs-sm); color: var(--muted); }
@media (max-width: 900px) { .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: var(--s-7); } }
@media (max-width: 520px) { .steps { grid-template-columns: minmax(0, 1fr); } }

/* ---------- Breadcrumbs ---------- */
.breadcrumbs ol { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; font-size: var(--fs-sm); color: var(--muted); }
.breadcrumbs li + li::before { content: "/"; margin-right: 6px; color: var(--line); }
.breadcrumbs a { color: var(--muted); text-decoration: none; }
.breadcrumbs a:hover { color: var(--indigo); text-decoration: underline; }

/* ---------- Footer ---------- */
.site-footer { background: var(--indigo) var(--lattice-light); color: rgb(255 255 255 / .75); font-size: var(--fs-sm); }
.amazigh-band { display: grid; grid-template-rows: repeat(3, 4px); }
.amazigh-band i:nth-child(1) { background: var(--amazigh-blue); }
.amazigh-band i:nth-child(2) { background: var(--amazigh-green); }
.amazigh-band i:nth-child(3) { background: var(--amazigh-yellow); }
.site-footer__grid { display: grid; grid-template-columns: 1.4fr repeat(3, minmax(0, 1fr)); gap: var(--s-7); padding-block: var(--s-8) var(--s-7); }
.site-footer h3 { font-family: var(--font-body); font-size: var(--fs-xs); font-weight: 800; letter-spacing: var(--tracking-label); text-transform: uppercase; color: var(--saffron); margin-bottom: var(--s-4); }
.site-footer ul { list-style: none; display: grid; gap: var(--s-2); }
.site-footer a { color: rgb(255 255 255 / .8); text-decoration: none; }
.site-footer a:hover { color: var(--white); text-decoration: underline; }
.site-footer__about { display: grid; gap: var(--s-4); align-content: start; max-width: 22rem; }
.site-footer__contact li { display: grid; gap: 0; }
.site-footer__contact small { font-size: var(--fs-xs); letter-spacing: .08em; text-transform: uppercase; color: rgb(255 255 255 / .5); }
.site-footer__bottom {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--s-4);
  padding-block: var(--s-5); border-top: 1px solid rgb(255 255 255 / .12); font-size: var(--fs-xs);
}
.azul { display: inline-flex; align-items: center; gap: var(--s-2); }
.yaz { font-family: var(--font-tifinagh); color: var(--amazigh-red); font-size: 1.3rem; line-height: 1; }
@media (max-width: 900px) { .site-footer__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .site-footer__about { grid-column: 1 / -1; } }
@media (max-width: 480px) { .site-footer__grid { grid-template-columns: minmax(0, 1fr); } }

/* ---------- WhatsApp float ---------- */
.wa-float {
  position: fixed; z-index: 40;
  right: calc(var(--s-5) + env(safe-area-inset-right, 0px));
  bottom: calc(var(--s-5) + env(safe-area-inset-bottom, 0px));
  display: inline-flex; align-items: center; gap: var(--s-2);
  min-height: 54px; padding: 0 var(--s-5) 0 var(--s-4); border-radius: var(--r-pill);
  background: #1f8f4e; color: var(--white); font-weight: 700; font-size: var(--fs-sm); text-decoration: none;
  box-shadow: 0 10px 24px -8px rgb(12 60 32 / .55);
}
.wa-float:hover { background: #18733f; color: var(--white); }
.wa-float svg { width: 24px; height: 24px; }
@media (max-width: 520px) { .wa-float span { display: none; } .wa-float { padding: 0; width: 56px; justify-content: center; } }
