/* Shams — site styles
   The SHAMS identity (Brand Guidelines 2026): olive on white, Alexandria throughout, the calligraphic
   logo, the engraved floral pattern, and the arch. Palette and type live in brand.css. */

:root {
  --gutter: clamp(1.25rem, 4.5vw, 3.5rem);
  --display-lh: 1.05;
  --display-track: -0.03em;
  --pat: url("/assets/brand/pattern.webp");
}

/* Tracking follows size: Latin display type tightens as it grows; Arabic is joined script and is never tracked. */
:root:lang(ar) {
  --display-lh: 1.4;
  --display-track: 0;
}

/* ---------- base ---------- */

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; -webkit-tap-highlight-color: transparent; }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--text);
  font-weight: var(--w-body);
  font-size: 1.0625rem;
  line-height: 1.65;
}
:lang(ar) body, body:lang(ar) { line-height: 1.9; }

img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
ul { list-style: none; margin: 0; padding: 0; }
h1, h2, h3, p, dl, dd { margin: 0; }
p { text-wrap: pretty; }

h1, h2 {
  font-family: var(--display);
  font-weight: var(--w-display);
  line-height: var(--display-lh);
  letter-spacing: var(--display-track);
}
h3 { font-weight: var(--w-sub); line-height: 1.3; }

:focus-visible { outline: 2px solid var(--green); outline-offset: 3px; border-radius: 2px; }
.hero :focus-visible, .teddy :focus-visible { outline-color: #fff; }

.skip {
  position: absolute; inset-inline-start: 1rem; top: -4rem; z-index: 10;
  background: var(--bark); color: #fff; padding: 0.6rem 1rem; border-radius: 999px;
}
.skip:focus { top: 1rem; }

/* ---------- header ---------- */

.top {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: 1rem var(--gutter);
}
/* the logo is never smaller than 120px wide on screen */
.brand { display: block; flex: none; padding-block: 0.25rem; }
.brand img { width: 7.5rem; height: auto; }
.top-nav { display: flex; align-items: center; gap: clamp(1rem, 2.4vw, 2.25rem); font-size: 0.98rem; font-weight: 400; }
.top-nav a { display: inline-flex; align-items: center; min-height: 2.75rem; text-decoration: none; transition: opacity 120ms ease-out; }
.top-nav a:active { opacity: 0.55; }
.top-nav a:hover { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 0.35em; text-decoration-color: var(--green); }
.top-nav .nav-lang {
  padding-inline: 1.1rem; border: 1px solid var(--olive-dust); border-radius: 999px;
  transition: opacity 120ms ease-out, background-color 150ms ease;
}
.top-nav .nav-lang:hover { background: var(--tint); text-decoration: none; }

/* ---------- hero ---------- */

/* A full-width band of Tree Bark under the white header. The content keeps the same 84rem measure as the rest of the page. */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) min(42vw, 31rem);
  gap: clamp(2rem, 6vw, 6rem);
  align-items: center;
  background: var(--bark); color: #fff;
  padding-block: clamp(2.5rem, 6vw, 5rem) clamp(3.5rem, 8vw, 6.5rem);
  padding-inline: max(var(--gutter), calc((100% - 84rem) / 2 + var(--gutter)));
}
.hero-text { max-width: 38rem; }
/* the slogan, in the Arabic display face; on the English page it sits at the start of the line, on the left */
.hero-slogan {
  font-family: var(--display-ar); font-weight: 700; color: var(--olive-dust);
  font-size: clamp(2.1rem, 4.2vw, 3.4rem); line-height: 1.4; margin-block-end: 1.25rem;
}
:root:lang(en) .hero-slogan { text-align: left; }
.hero h1 { font-size: clamp(2.5rem, 5.3vw, 4.5rem); text-wrap: balance; }
.hero-p { margin-block-start: 1.4rem; color: var(--olive-dust); font-size: 1.2rem; font-weight: 400; max-width: 32rem; }

.hero-branches { margin-block: 2rem 2.25rem; border-block-end: 1px solid var(--olive-branch); }
.hero-branches a {
  display: flex; align-items: baseline; justify-content: space-between; gap: 0.25rem 1rem; flex-wrap: wrap;
  padding-block: 0.85rem; border-block-start: 1px solid var(--olive-branch); text-decoration: none;
  transition: background-color 120ms ease-out;
}
.hb-name { font-weight: var(--w-sub); font-size: 1.25rem; line-height: 1.4; }
.hb-status { color: var(--olive-dust); font-size: 0.98rem; font-weight: 400; }
.hero-branches a:active { background: rgba(255, 255, 255, 0.08); }
.hero-branches a:hover .hb-name { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 0.3em; text-decoration-color: var(--olive-dust); }

.is-open { color: var(--ink); }
.hero .is-open { color: #fff; }
.hero .is-open::before { background: var(--olive-dust); }
.is-open::before {
  content: ""; display: inline-block; width: 0.5em; height: 0.5em; border-radius: 50%;
  background: var(--green); margin-inline-end: 0.55em; transform: translateY(-0.08em);
}

.btn {
  display: inline-block; background: var(--bark); color: #fff;
  padding: 0.9rem 2.1rem; border-radius: 999px; text-decoration: none; font-weight: 500;
  transition: background-color 0.15s ease, transform 100ms ease-out;
}
.btn:hover { background: var(--verdant); }
.btn:active { transform: scale(0.97); }
.hero .btn { background: #fff; color: var(--bark); }
.hero .btn:hover { background: var(--tint-deep); }

/* The arch, with the pattern as its rim. The swatch is one picture, cropped to the shape and never repeated. */
.hero-photo, .teddy-art {
  position: relative; isolation: isolate;
  padding: clamp(0.55rem, 1.2vw, 0.9rem);
  border-radius: 999px 999px 0 0;
}
.hero-photo::before, .teddy-art::before {
  content: ""; position: absolute; inset: 0; z-index: -1; border-radius: inherit;
  background: var(--green); opacity: 0.45;
  -webkit-mask: var(--pat) center / cover no-repeat; mask: var(--pat) center / cover no-repeat;
}
.hero-photo::before { background: var(--olive-branch); opacity: 0.6; }
.hero-photo picture {
  display: block; border-radius: 999px 999px 0 0; overflow: hidden; aspect-ratio: 4 / 5; background: var(--verdant);
}
.hero-photo img { width: 100%; height: 100%; object-fit: cover; object-position: 42% 50%; }

/* ---------- photo strip ---------- */

.strip { background: var(--tint); padding-block: clamp(1.25rem, 3vw, 2.25rem); }
.strip ul {
  display: flex; gap: 0.75rem; overflow-x: auto; padding: 0 var(--gutter) 0.75rem;
  scroll-snap-type: x proximity; scrollbar-width: thin; scrollbar-color: var(--olive-dust) transparent;
}
.strip li { flex: none; scroll-snap-align: center; }
.strip img { height: clamp(13rem, 30vw, 22rem); width: auto; max-width: none; }

/* ---------- menu ---------- */

.menu { padding: clamp(3.5rem, 8vw, 7rem) var(--gutter); }
.menu-card {
  display: grid; grid-template-columns: 13rem minmax(0, 1fr); column-gap: clamp(2rem, 4vw, 4rem);
  max-width: 78rem; margin-inline: auto;
}
.menu-head {
  grid-column: 1 / -1; display: flex; align-items: end; justify-content: space-between; gap: 1rem 2rem; flex-wrap: wrap;
  padding-block-end: 1.5rem; margin-block-end: 2.5rem; border-block-end: 1px solid var(--rule);
}
.menu-head h2 { font-size: clamp(2.8rem, 6vw, 5rem); }
.menu-head p { color: var(--ink-soft); }

.menu-index ul { position: sticky; top: 1.5rem; display: grid; gap: 0.1rem; }
.menu-index a {
  display: block; padding: 0.3rem 0; padding-inline-start: 0.9rem; border-inline-start: 2px solid transparent;
  color: var(--ink-soft); text-decoration: none;
}
.menu-index a:hover { color: var(--ink); }
.menu-index a:active { opacity: 0.55; }
.menu-index a[aria-current] { color: var(--ink); font-weight: 500; border-inline-start-color: var(--green); }

.cat { scroll-margin-top: 1.5rem; }
.cat + .cat { margin-block-start: 3rem; }
.cat h3 { font-size: 1.75rem; color: var(--green); margin-block-end: 0.75rem; }

.items { columns: 2 17rem; column-gap: clamp(2rem, 4vw, 3.5rem); }
.items li { break-inside: avoid; padding-block: 0.42rem; }
.i-row { display: flex; align-items: baseline; gap: 0.6rem; }
.i-name { font-weight: 500; }
.i-dots { flex: 1; min-width: 1.5rem; border-block-end: 1px dotted var(--olive-branch); transform: translateY(-0.28em); }
.i-price { font-variant-numeric: tabular-nums; font-weight: 500; direction: ltr; }
.i-note { color: var(--ink-soft); font-size: 0.92rem; line-height: 1.55; max-width: 34rem; margin-block-start: 0.15rem; }

/* ---------- teddy: SUKKAR, on Tree Bark, standing on the bottom edge in his arch ---------- */

.teddy {
  background: var(--bark); color: #fff;
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); column-gap: clamp(2rem, 6vw, 6rem);
  align-items: end; padding: clamp(3.5rem, 8vw, 7rem) var(--gutter) 0;
}
.teddy-copy { padding-block-end: clamp(3rem, 7vw, 6rem); }
.teddy h2 { font-size: clamp(2.3rem, 4.6vw, 3.9rem); text-wrap: balance; max-width: 22ch; }
.teddy-text p { margin-block-start: 1.25rem; color: var(--olive-dust); font-size: 1.15rem; max-width: 27rem; }
.teddy-photos { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; max-width: 28rem; margin-block-start: clamp(2rem, 4vw, 3rem); }
.teddy-photos img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; }

.teddy-art { width: min(100%, 30rem); justify-self: center; padding-block-end: 0; }
.teddy-art::before { background: var(--olive-branch); opacity: 0.6; }
.sukkar-arch {
  display: flex; align-items: flex-end; justify-content: center;
  aspect-ratio: 4 / 5; overflow: hidden; border-radius: 999px 999px 0 0; background: var(--verdant);
}
.sukkar-arch img { width: 92%; height: auto; flex: none; min-height: 15rem; }

/* ---------- branches ---------- */

.branches { padding: clamp(3.5rem, 8vw, 7rem) var(--gutter); }
.branches h2 { font-size: clamp(2.5rem, 5.2vw, 4.4rem); max-width: 84rem; margin-inline: auto; margin-block-end: clamp(2rem, 4vw, 3.5rem); text-wrap: balance; }
.branch-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); row-gap: 3rem; max-width: 84rem; margin-inline: auto; }
.branch-grid[data-count="1"] { grid-template-columns: minmax(0, 28rem); }
.branch-grid[data-count="2"] { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.branch { padding-inline: clamp(1.25rem, 3vw, 2.75rem); border-inline-start: 1px solid var(--rule); scroll-margin-top: 2rem; }
.branch:nth-child(3n + 1) { padding-inline-start: 0; border-inline-start: 0; }
.branch-grid[data-count="2"] .branch:nth-child(odd) { padding-inline-start: 0; border-inline-start: 0; }
.branch-grid[data-count="2"] .branch:nth-child(even) { padding-inline-start: clamp(1.25rem, 3vw, 2.75rem); border-inline-start: 1px solid var(--rule); }
.branch h3 { font-size: 1.9rem; }
.b-address { color: var(--ink-soft); margin-block-start: 0.3rem; }
.b-live { margin-block-start: 1.1rem; font-weight: 500; }
.b-live.is-closed { color: var(--ink-soft); }
.branch dl { margin-block-start: 1.1rem; }
.branch dt { color: var(--green); font-weight: 500; font-size: 0.95rem; }
:root:lang(en) .branch dt { font-size: 0.75rem; letter-spacing: 0.14em; text-transform: uppercase; }
.b-actions { display: grid; justify-items: start; margin-block-start: 1rem; }
.b-actions a {
  padding-block: 0.55rem; /* a full-height tap target; the link text stays inline */
  color: var(--green); font-weight: 500;
  text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 0.3em; text-decoration-color: rgba(99, 119, 82, 0.45);
}
.b-actions a:hover { text-decoration-color: currentColor; }
.b-actions a:active { opacity: 0.55; }

/* ---------- footer: Tree Bark, with the white logo (provisional in the guidelines) ---------- */

.foot { background: var(--bark); color: #fff; padding: clamp(2rem, 4vw, 3.25rem) var(--gutter) 1.25rem; }
.foot :focus-visible { outline-color: #fff; }
.foot-top {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 1.25rem 1rem; flex-wrap: wrap;
  max-width: 84rem; margin-inline: auto; padding-block-end: clamp(1.25rem, 3vw, 2rem);
}
/* The logo and the Instagram link are one column at the end; the contact block is at the start. */
.foot-brand { display: flex; flex-direction: column; align-items: flex-end; justify-content: space-between; align-self: stretch; gap: 1rem; margin-inline-start: auto; } /* logo at the top, Instagram at the bottom, next to the last number */
.foot-brand img { width: clamp(5.5rem, 14vw, 7rem); height: auto; }
.foot-contact { flex: 1 1 0; min-width: 11rem; }
.foot-contact h2 { font-family: inherit; font-size: 0.85rem; font-weight: 500; line-height: 1.4; color: var(--olive-dust); margin-block-end: 0.35rem; }
:root:lang(en) .foot-contact h2 { font-size: 0.75rem; letter-spacing: 0.14em; text-transform: uppercase; }
.foot-contact ul { display: flex; flex-wrap: wrap; gap: 0.5rem 2.5rem; }
.foot-contact li { display: grid; justify-items: start; }
.foot-contact li span { color: var(--olive-dust); font-size: 0.85rem; }
.foot-contact a {
  padding-block: 0.35rem; /* a full-height tap target; the number stays inline */
  font-size: 1.1rem; font-weight: 400; color: #fff;
  text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 0.3em; text-decoration-color: var(--olive-dust);
}
.foot-contact a:hover { text-decoration-color: #fff; }
.foot-contact a:active { opacity: 0.6; }
.foot-bottom {
  display: flex; align-items: center; justify-content: space-between; gap: 0.5rem 2rem; flex-wrap: wrap;
  max-width: 84rem; margin-inline: auto; padding-block-start: 1.1rem; border-block-start: 1px solid var(--olive-branch);
  color: var(--olive-dust); font-size: 0.9rem;
}
.foot-ig {
  display: inline-flex; align-items: center; gap: 0.55rem; min-height: 2.75rem; padding-block: 0.4rem; padding-inline: 0.9rem 1rem;
  border: 1px solid var(--olive-dust); border-radius: 999px; color: #fff; text-decoration: none;
  transition: background-color 150ms ease, border-color 150ms ease, opacity 120ms ease-out;
}
.foot-ig svg { flex: none; }
.foot-ig:hover { background: rgba(255, 255, 255, 0.08); border-color: #fff; }
.foot-ig:active { opacity: 0.6; }

/* ---------- footer on a computer: logo at the start, contact at the end, the Instagram line under a rule ---------- */

.foot-ig-bottom { display: none; }
@media (min-width: 56.01rem) {
  .foot { padding: clamp(3rem, 6vw, 5rem) var(--gutter) 1.25rem; }
  .foot-top { align-items: center; gap: 2rem 3rem; padding-block-end: clamp(2rem, 4vw, 3rem); }
  .foot-brand { order: -1; align-items: flex-start; align-self: auto; margin-inline-start: 0; }
  .foot-brand img { width: 9rem; }
  .foot-ig-brand { display: none; }
  .foot-ig-bottom { display: inline-flex; }
  .foot-contact { flex: none; min-width: 0; }
  .foot-contact h2 { font-size: 0.95rem; margin-block-end: 0.35rem; }
  :root:lang(en) .foot-contact h2 { font-size: 0.75rem; }
  .foot-contact li span { font-size: 0.95rem; }
  .foot-contact a { padding-block: 0.35rem; font-size: 1.5rem; font-weight: 500; }
  .foot-bottom { padding-block-start: 1.1rem; font-size: 0.95rem; }
}

/* ---------- small screens ---------- */

@media (max-width: 56rem) {
  .top-nav .nav-ig { display: none; }

  .hero { grid-template-columns: minmax(0, 1fr); gap: 2rem; padding-block: 2rem 3rem; }
  .hero-photo { order: -1; width: min(82%, 24rem); justify-self: center; }
  .hero-photo picture { aspect-ratio: 5 / 6; }
  .hero-text { max-width: none; }

  .menu { padding-inline: 0; }
  .menu-card { display: block; padding-inline: var(--gutter); }
  .menu-head { margin-block-end: 0; border-block-end: 0; padding-block-end: 0.75rem; }
  .menu-index {
    position: sticky; top: 0; z-index: 5;
    background: rgba(255, 255, 255, 0.88); -webkit-backdrop-filter: blur(16px) saturate(160%); backdrop-filter: blur(16px) saturate(160%);
    margin-inline: calc(-1 * var(--gutter)); margin-block-end: 1.75rem; border-block-end: 1px solid var(--rule);
  }
  .menu-index ul {
    position: relative; top: auto; display: flex; gap: 0.25rem; overflow-x: auto; padding: 0.3rem var(--gutter);
    scrollbar-width: none;
  }
  .menu-index ul::-webkit-scrollbar { display: none; }
  .menu-index a { display: flex; align-items: center; min-height: 2.75rem; white-space: nowrap; padding: 0 0.95rem; border: 0; border-radius: 999px; }
  .menu-index a[aria-current] { background: var(--bark); color: #fff; font-weight: 500; }
  .cat { scroll-margin-top: 4.5rem; }
  .cat h3 { font-size: 1.6rem; }

  .teddy { grid-template-columns: minmax(0, 1fr); row-gap: 0; }
  .teddy-copy { padding-block-end: 2.5rem; }
  .teddy-art { width: min(86%, 26rem); }

  .branch-grid, .branch-grid[data-count] { grid-template-columns: minmax(0, 1fr); row-gap: 0; }
  .branch-grid .branch:nth-child(n) { padding: 1.75rem 0; border-inline-start: 0; border-block-start: 1px solid var(--rule); }
  .branch-grid .branch:first-child { padding-block-start: 0; border-block-start: 0; }

  .foot-contact ul { gap: 0.5rem 1.5rem; }
}

@media (min-width: 56.01rem) {
  .brand img { width: 9rem; }
}

/* ---------- motion ----------
   One orchestrated moment when the page opens: the arch rises, then the slogan, headline and branches follow.
   Below the fold, a few things ease in as they arrive (browsers that cannot do scroll-driven animation just show them).
   The logo never moves. Nothing here runs for people who ask for less. */

@media (prefers-reduced-motion: no-preference) {
  @keyframes arch-rise {
    from { clip-path: inset(100% 0 0 0); }
    to { clip-path: inset(0 0 0 0); }
  }
  @keyframes arch-settle { from { transform: scale(1.08); } to { transform: scale(1); } }
  @keyframes ease-up { from { opacity: 0; transform: translateY(1.1rem); } to { opacity: 1; transform: none; } }

  .hero-photo { animation: arch-rise 1000ms cubic-bezier(0.22, 0.8, 0.2, 1) both; }
  .hero-photo img { animation: arch-settle 1400ms cubic-bezier(0.22, 0.8, 0.2, 1) both; }
  .hero-text > * { animation: ease-up 750ms cubic-bezier(0.22, 0.8, 0.2, 1) both; }
  .hero-text > :nth-child(1) { animation-delay: 250ms; }
  .hero-text > :nth-child(2) { animation-delay: 360ms; }
  .hero-text > :nth-child(3) { animation-delay: 470ms; }
  .hero-text > :nth-child(4) { animation-delay: 560ms; }
  .hero-text > :nth-child(5) { animation-delay: 650ms; }

  @supports (animation-timeline: view()) {
    @keyframes rise-from-edge { from { transform: translateY(16%); } to { transform: none; } }

    .menu-head, .cat h3, .teddy-text, .branch {
      animation: ease-up linear both; animation-timeline: view(); animation-range: entry 0% entry 70%;
    }
    /* SUKKAR climbs up from the bottom edge of his arch; the arch clips him, so he is always standing on it */
    .teddy-art { view-timeline: --sukkar block; }
    .sukkar-arch img { animation: rise-from-edge linear both; animation-timeline: --sukkar; animation-range: entry 0% entry 100%; }
  }
}

/* ---------- people who ask for less ---------- */

@media (prefers-reduced-motion: reduce) {
  .btn, .top-nav a, .hero-branches a { transition: none; }
  .btn:active { transform: none; opacity: 0.8; }
}
@media (prefers-reduced-transparency: reduce) {
  .menu-index { background: var(--paper); -webkit-backdrop-filter: none; backdrop-filter: none; }
}
@media (prefers-contrast: more) {
  :root { --rule: rgba(52, 53, 36, 0.55); --ink-soft: var(--bark); }
  .hero-photo::before, .teddy-art::before { opacity: 0.3; }
  .teddy-text p, .foot-bottom, .foot-contact h2, .foot-contact li span, .hero-p, .hb-status { color: #fff; }
  .menu-index a { color: var(--ink); }
}
