/* Morshed website: "Sunlit Editorial".
   One stylesheet for both directions: logical properties only (inline = left/right
   depending on dir, block = top/bottom). Light theme only. No external resources. */

/* ---------- Fonts (self-hosted, Fontsource 5.3.0, SIL OFL 1.1; see CREDITS.md) ---------- */

@font-face {
  font-family: "DM Sans";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(/fonts/dm-sans-latin-400-normal.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "DM Sans";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url(/fonts/dm-sans-latin-500-normal.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "DM Sans";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url(/fonts/dm-sans-latin-700-normal.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Cairo";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url(/fonts/cairo-arabic-500-normal.woff2) format("woff2");
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC;
}

@font-face {
  font-family: "Cairo";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url(/fonts/cairo-arabic-700-normal.woff2) format("woff2");
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC;
}

/* ---------- Tokens ---------- */

:root {
  --bg: #FFFFFF;
  --ink: #222222;
  --muted: #6F6F6F;
  --hairline: #EEEEEE;
  --accent: #C2502E;
  --tint: #FBF4EE;

  --font: "DM Sans", "Cairo", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-ar: "Cairo", "DM Sans", system-ui, -apple-system, "Segoe UI", Tahoma, sans-serif;

  --page: 1200px;
  --gutter: clamp(16px, 4vw, 40px);
  --radius-lg: clamp(20px, 3vw, 32px);
  --radius: 18px;

  color-scheme: light;
}

/* ---------- Base ---------- */

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.6;
  text-align: start;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

:lang(ar) {
  font-family: var(--font-ar);
}

:lang(en) {
  font-family: var(--font);
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

a {
  color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

a:hover {
  text-decoration-thickness: 2px;
}

:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

h1,
h2,
h3 {
  line-height: 1.15;
  font-weight: 700;
}

/* Never letter-space Arabic: it breaks the joins between letters. */
:lang(ar) h1,
:lang(ar) h2,
:lang(ar) h3 {
  letter-spacing: 0;
  line-height: 1.35;
}

.skip-link {
  position: absolute;
  inset-inline-start: var(--gutter);
  inset-block-start: -100px;
  z-index: 10;
  padding-block: 10px;
  padding-inline: 16px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--bg);
  font-weight: 500;
  text-decoration: none;
}

.skip-link:focus {
  inset-block-start: 12px;
}

/* ---------- Page frame ---------- */

.site-header,
main,
.site-footer {
  width: min(100% - 2 * var(--gutter), var(--page));
  margin-inline: auto;
}

main {
  flex: 1 0 auto;
}

/* ---------- Header ---------- */

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-block: 18px;
}

.wordmark {
  color: var(--accent);
  font-family: var(--font);
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1;
  text-decoration: none;
}

.lang-switch {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding-inline: 16px;
  border: 1px solid var(--hairline);
  border-radius: 999px;
  color: var(--ink);
  font-size: 0.9375rem;
  font-weight: 500;
  text-decoration: none;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

.lang-switch:hover {
  background: var(--tint);
  border-color: var(--tint);
}

/* ---------- Home: hero ---------- */

.hero {
  position: relative;
  isolation: isolate;
  display: grid;
  align-items: end;
  min-height: clamp(440px, 64vh, 600px);
  overflow: hidden;
  border-radius: var(--radius-lg);
  background: #D6B78A; /* sand, shown while the photo loads */
  color: #FFFFFF;
}

.hero-media,
.hero-media img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.hero-media img {
  object-fit: cover;
  object-position: 50% 15%; /* keep the pyramid tips in wide crops */
}

/* Dark scrim from the bottom so white type stays readable over sand and sky. */
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to top,
    rgba(26, 17, 10, 0.78) 0%,
    rgba(26, 17, 10, 0.5) 32%,
    rgba(26, 17, 10, 0.12) 62%,
    rgba(26, 17, 10, 0) 80%
  );
}

.hero-copy {
  position: relative;
  z-index: 1;
  padding: clamp(24px, 5vw, 56px);
}

.hero-kicker {
  margin: 0 0 8px;
  font-size: 0.9375rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  opacity: 0.92;
}

:lang(ar) .hero-kicker {
  font-size: 1.125rem;
  letter-spacing: 0;
}

.hero h1 {
  max-width: 11ch;
  margin: 0;
  font-size: clamp(2.75rem, 8vw, 5.5rem);
  line-height: 1;
  letter-spacing: -0.035em;
  text-wrap: balance;
  text-shadow: 0 1px 24px rgba(0, 0, 0, 0.25);
}

:lang(ar) .hero h1 {
  font-size: clamp(2.75rem, 8vw, 5.25rem);
  line-height: 1.3;
}

.coming-soon {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 24px 0 0;
  padding-block: 10px;
  padding-inline: 16px 20px;
  border-radius: 999px;
  background: var(--bg);
  color: var(--ink);
  font-size: 0.9375rem;
  font-weight: 500;
  line-height: 1.3;
}

.coming-soon::before {
  content: "";
  flex: none;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
}

/* ---------- Home: three ideas ---------- */

.ideas {
  margin-block: clamp(16px, 3vw, 24px) clamp(32px, 5vw, 56px);
}

.ideas-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(12px, 2vw, 20px);
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: idea;
}

.idea {
  padding-block: 24px;
  padding-inline: 28px;
  border-radius: var(--radius);
  background: var(--tint);
  counter-increment: idea;
}

.idea::before {
  content: counter(idea, decimal-leading-zero);
  display: block;
  margin-block-end: 14px;
  color: var(--accent);
  font-family: var(--font);
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.1em;
}

.idea h2 {
  margin: 0;
  font-size: 1.5rem;
  letter-spacing: -0.02em;
}

.idea p {
  margin: 4px 0 0;
  font-size: 1.0625rem;
}

@media (max-width: 639.98px) {
  .ideas-list {
    grid-template-columns: minmax(0, 1fr);
  }

  .idea {
    padding-block: 20px;
    padding-inline: 22px;
  }
}

/* ---------- Inner pages: legal reading column (used by Tasks 3-6) ---------- */

.legal {
  max-width: 70ch;
  margin-inline: auto;
  padding-block: clamp(24px, 5vw, 56px) clamp(40px, 6vw, 80px);
  font-size: 1.0625rem;
  line-height: 1.7;
}

.legal h1 {
  margin: 0 0 8px;
  font-size: clamp(2rem, 5vw, 3rem);
  line-height: 1.1;
  letter-spacing: -0.025em;
}

.legal .updated {
  margin: 0 0 clamp(24px, 4vw, 40px);
  color: var(--muted);
  font-size: 0.9375rem;
}

.legal h2 {
  margin: 2.2em 0 0.6em;
  font-size: 1.375rem;
  letter-spacing: -0.015em;
}

.legal h2[id] {
  scroll-margin-block-start: 24px;
}

.legal h2 > a {
  color: inherit;
  text-decoration: none;
}

.legal h2 > a:hover {
  color: var(--accent);
}

.legal h3 {
  margin: 1.6em 0 0.4em;
  font-size: 1.125rem;
}

.legal p,
.legal ul,
.legal ol {
  margin-block: 0 1em;
}

.legal ul,
.legal ol {
  padding-inline-start: 1.4em;
}

.legal li + li {
  margin-block-start: 0.35em;
}

.legal a {
  overflow-wrap: anywhere;
}

.contact-block {
  margin-block: 0 1.25em;
  padding-block: 20px;
  padding-inline: 24px;
  border-radius: var(--radius);
  background: var(--tint);
  font-style: normal;
  overflow-wrap: anywhere;
}

.contact-block > :last-child {
  margin-block-end: 0;
}

/* FAQ disclosures: hanging indent so a wrapped question stays clear of the marker. */
.legal details {
  margin-block: 0 0.75em;
}

.legal summary {
  padding-inline-start: 1.1em;
  text-indent: -1.1em;
  cursor: pointer;
}

.legal details > :not(summary) {
  margin-inline-start: 1.1em;
}

.legal summary + * {
  margin-block-start: 0.5em;
}

table.retention {
  width: 100%;
  margin-block: 0 1.5em;
  border-collapse: collapse;
  font-size: 0.9375rem;
  line-height: 1.5;
}

table.retention th,
table.retention td {
  padding-block: 10px;
  padding-inline: 12px;
  border-block-end: 1px solid var(--hairline);
  text-align: start;
  vertical-align: top;
  overflow-wrap: anywhere;
}

table.retention caption {
  margin-block-end: 8px;
  color: var(--muted);
  text-align: start;
}

table.retention th {
  background: var(--tint);
  font-weight: 700;
}

/* ---------- Footer ---------- */

.site-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px 32px;
  padding-block: 28px 36px;
  border-block-start: 1px solid var(--hairline);
  font-size: 0.875rem;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.footer-links a {
  color: var(--ink);
  text-decoration: none;
}

.footer-links a:hover,
.footer-links a[aria-current="page"] {
  color: var(--accent);
}

/* Copyright and email are two flex items: the gap separates them, so no separator
   character can end up stranded at the start of a wrapped line (in RTL or LTR). */
.footer-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 16px;
  margin: 0;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.footer-meta a {
  color: var(--ink);
}

/* ---------- 404 (standalone, bilingual) ---------- */

.not-found {
  display: grid;
  gap: 40px;
  align-content: start;
  padding-block: clamp(32px, 8vw, 96px);
}

.not-found-block {
  max-width: 36rem;
}

/* The 404 footer stacks its English row, Arabic row and meta line, each full width,
   so the Arabic row starts at the inline-start edge of its own RTL context. */
.not-found + .site-footer {
  flex-direction: column;
  align-items: stretch;
}

.not-found-block[dir="rtl"] {
  padding-block-start: 40px;
  border-block-start: 1px solid var(--hairline);
}

.not-found-code {
  margin: 0;
  color: var(--accent);
  font-weight: 700;
  letter-spacing: 0.08em;
}

.not-found h1,
.not-found h2 {
  margin-block: 8px 12px;
  font-size: clamp(1.75rem, 4vw, 2.5rem);
}

.not-found p {
  margin-block: 0 8px;
}
