/* MAHPARA LONDON
   One stylesheet for every page.
   Three colours. One serif (the face of the wordmark) and one sans for small capitals.
   Type is sized in rem, so a visitor's own text-size setting is respected.
   "Phone" is below 700px; from 700px the page is set on a twelve-column grid. */

@font-face {
  font-family: "Cormorant Garamond";
  font-style: normal;
  font-weight: 400;
  font-display: block;
  src: url("/fonts/cormorant-garamond-latin-400-normal.woff2") format("woff2");
}
@font-face {
  font-family: "Cormorant Garamond";
  font-style: normal;
  font-weight: 500;
  font-display: block;
  src: url("/fonts/cormorant-garamond-latin-500-normal.woff2") format("woff2");
}
@font-face {
  font-family: "Cormorant Garamond";
  font-style: italic;
  font-weight: 500;
  font-display: swap;
  src: url("/fonts/cormorant-garamond-latin-500-italic.woff2") format("woff2");
}
@font-face {
  font-family: "Jost";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/fonts/jost-latin-400-normal.woff2") format("woff2");
}

:root {
  --paper: #F1EEE7;
  --oxblood: #5C1A24;
  --silver: #CFCAC0;

  --serif: "Cormorant Garamond", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --sans: Jost, "Avenir Next", "Century Gothic", Arial, sans-serif;

  --margin: 20px;
  --header: 64px;
  /* The wordmark gives way to the two words beside it, on a narrow phone or at a larger text size. */
  --mark: min(163px, calc(100vw - 40px - 10rem));
  --screen: 100vh;

  /* The four sizes of Latin type. */
  --small: 0.6875rem;   /* small capitals */
  --read: 1.25rem;      /* everything read */
  --say: 1.625rem;      /* one statement or lead per page */
  --name: 2.875rem;     /* names and page titles */

  /* The ground a block stands on and the colour of the type on it. */
  --ground: var(--paper);
  --ink: var(--oxblood);
}
@supports (height: 100svh) {
  :root { --screen: 100svh; }
}

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

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

html {
  background: var(--paper);
  color: var(--oxblood);
  -webkit-tap-highlight-color: transparent;
  color-scheme: only light;
  font-synthesis: none;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: var(--screen);
  display: flex;
  flex-direction: column;
  background: var(--paper);
  font-family: var(--serif);
  font-size: var(--read);
  line-height: 1.4;
  font-weight: 500;
  font-variant-numeric: lining-nums;
  font-kerning: normal;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-wrap: break-word;
}

/* The page behind takes the ground of the header, so pulling the page down
   on a phone shows the same colour above it. */
.top-silver { background: var(--silver); }
.top-oxblood { background: var(--oxblood); }

main { flex: 1 0 auto; }

h1, h2, p, ul, li, dl, dt, dd, figure { margin: 0; padding: 0; }
h1, h2 { font-size: inherit; font-weight: inherit; }
ul { list-style: none; }
img { display: block; max-width: 100%; height: auto; border: 0; }
i { font-style: italic; }
p { text-wrap: pretty; }

a { color: inherit; text-decoration: none; }

:focus { outline: 0; }
:focus-visible { outline: 1px solid currentColor; outline-offset: 4px; }

::selection { background: var(--oxblood); color: var(--paper); }
.on-oxblood ::selection, .on-oxblood::selection { background: var(--silver); color: var(--oxblood); }

.wrap {
  width: calc(100% - 2 * var(--margin));
  max-width: 1546px;
  margin-left: auto;
  margin-right: auto;
}

.together { white-space: nowrap; }

/* ---------- Grounds ---------- */

.on-paper { --ground: var(--paper); --ink: var(--oxblood); }
.on-silver { --ground: var(--silver); --ink: var(--oxblood); }
.on-oxblood { --ground: var(--oxblood); --ink: var(--silver); }
.on-paper, .on-silver, .on-oxblood { background: var(--ground); color: var(--ink); }

/* ---------- Type styles ---------- */

/* Small capitals: navigation, labels, action words. */
.label,
.word,
.act {
  font-family: var(--sans);
  font-size: var(--small);
  line-height: 1.45;
  font-weight: 400;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

/* The larger reading size: one statement or lead per page. */
.display {
  font-size: var(--say);
  line-height: 1.22;
  font-weight: 400;
  letter-spacing: -0.005em;
  text-wrap: balance;
}

/* Names and page titles. Sentences never take this size. */
.title {
  font-size: var(--name);
  line-height: 1;
  font-weight: 400;
  letter-spacing: -0.012em;
}

.prose p { max-width: 21em; }
.prose p + p { margin-top: 0.7em; }

/* Navigation words: the underline is there in the colour of the ground and
   takes the colour of the type on hover or on the current page. */
.word {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 5px;
  text-decoration-color: var(--ground);
  transition: text-decoration-color 0.2s ease;
}
.word[aria-current="page"] { text-decoration-color: currentColor; }

/* Action words and contact values: always underlined. */
.act,
.line {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 5px;
  transition: text-underline-offset 0.2s ease;
}
.act {
  display: inline-block;
  padding: 14px 0;
  margin: -14px 0;
}
.actions, .prose .actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 28px;
  margin-top: 28px;
}

@media (hover: hover) {
  .word:hover { text-decoration-color: currentColor; }
  .act:hover, .line:hover { text-underline-offset: 3px; }
}

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

/* The header stands on the ground of the block that opens the page:
   silver-grey on Home, oxblood on Eid 2027, paper elsewhere. */
.head-row {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  height: var(--header);
}
.head-left { display: flex; justify-self: start; gap: 36px; }
.head-right { display: flex; justify-self: end; margin-right: -0.12em; }
.head .wide { display: none; }

.mark { display: block; width: var(--mark); }
.mark img { width: 100%; }

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

/* When the menu is open the whole header becomes a panel fixed over the screen,
   so Close is always in reach and the page behind cannot be dragged into view. */
.menu {
  padding: 48px 0 40px;
  opacity: 0;
  transition: opacity 0.2s ease;
}
.menu[hidden] { display: none; }
.menu-open .head {
  position: fixed;
  z-index: 10;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
}
.menu-open, .menu-open body { overflow: hidden; }
.menu-shown .menu { opacity: 1; }

.menu-pages a {
  display: block;
  padding: 9px 0;
  font-size: 2rem;
  line-height: 1.125;
  font-weight: 400;
  letter-spacing: -0.008em;
}
/* The page the visitor is on is underlined, as it is in the header of a wide screen. */
.menu-pages a[aria-current="page"] {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}
.menu-pages { margin: -9px 0; }
.menu .routes { margin-top: 64px; }

/* ---------- Contact routes (footer, phone menu, Enquiries) ---------- */

.routes { display: grid; row-gap: 22px; justify-items: start; }
.routes .label { display: block; margin-bottom: 2px; }
.routes li { max-width: 100%; }
.routes a {
  display: inline-block;
  padding: 9px 0;
  margin: -9px 0;
  overflow-wrap: anywhere;
}
.routes-quiet a {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 5px;
  text-decoration-color: var(--ground);
  transition: text-decoration-color 0.2s ease;
}
@media (hover: hover) {
  .routes-quiet a:hover { text-decoration-color: currentColor; }
}

/* ---------- Urdu lettering ---------- */

/* Each file's box is the ink of the word, in thousandths of the type size (--u). */
.urdu { display: block; height: auto; max-width: none; }
.urdu-mah { width: calc(var(--u) * 0.687); }
.urdu-para { width: calc(var(--u) * 1.163); }
.urdu-name { width: calc(var(--u) * 2.014); }

/* ---------- Home ---------- */

/* The cover. With the header it fills the first screen of a phone in a browser,
   and stops growing on a taller screen so the statement never drifts far from the name. */
.cover {
  display: flex;
  min-height: min(calc(var(--screen) - var(--header)), 660px);
  padding: 16px 0 30px;
}
/* Space, the name, more space, the statement. */
.cover-in {
  display: grid;
  grid-template-rows: minmax(20px, 1fr) auto minmax(44px, 1.5fr) auto;
}
.cover-name { grid-row: 2; }
/* The name hangs from the right margin, as Urdu does. */
.cover-name img { width: min(77%, 300px); margin-left: auto; }
.cover-name p { margin-top: 14px; text-align: right; }
.cover-say { grid-row: 4; }
.cover-say .display { max-width: 13em; }
.cover-say .actions { margin-top: 24px; }

/* The announcement: the one piece of news the house has. */
.announce { padding-top: 72px; padding-bottom: 88px; }
.announce .title { font-size: 4.25rem; letter-spacing: -0.02em; margin-left: -0.04em; white-space: nowrap; }
.announce-text { margin-top: 28px; }
.announce-text .display { max-width: 15em; }

/* ---------- Text pages ---------- */

.page { padding-top: 32px; padding-bottom: 80px; }

/* The name */
.name-lead .display { margin-top: 24px; max-width: 14em; }
/* The Urdu is as large as the row allows while "a piece of the moon" stays on one line. */
.gloss { margin-top: 48px; display: grid; row-gap: 30px; --u: min(76px, calc((100vw - 40px - 11rem) / 2.014)); }
.gloss li {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  column-gap: 16px;
}
.gloss-pair span, .gloss-pair i { display: block; white-space: nowrap; }
.name-text { margin-top: 52px; }
.name-text .actions { margin-top: 32px; }

/* Eid 2027 */
/* The title card. With the header it takes six tenths of a phone's first screen,
   so the page's first words are seen without scrolling. */
.eid-cover {
  display: flex;
  min-height: calc(var(--screen) * 0.6 - var(--header));
  padding: 48px 0 26px;
}
.eid-cover .wrap {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}
/* Sized to the width of the screen and kept on one line, so it can never break in two. */
.eid-cover .title {
  font-size: min(26vw, 104px);
  line-height: 0.88;
  letter-spacing: -0.025em;
  margin-left: -0.045em;
  white-space: nowrap;
}
.eid-cover .label { margin-top: 14px; }
.eid-text { padding-top: 44px; padding-bottom: 80px; }
.eid-prose .prose { margin-top: 18px; }
.facts { margin-top: 40px; display: grid; row-gap: 24px; }
.facts dt { margin-bottom: 2px; }
.facts dd { max-width: 21em; }
.facts a { padding: 11px 0; }

/* Enquiries */
.enquiries-lead p { margin-top: 20px; max-width: 16em; }
.enquiries-routes { margin-top: 48px; }
.routes-large { row-gap: 26px; }
.routes-large a {
  font-size: var(--say);
  line-height: 1.22;
  font-weight: 400;
  letter-spacing: -0.005em;
  padding: 6px 0;
  margin: -6px 0;
}
.routes-large .first a { font-size: 2.25rem; line-height: 1.1; letter-spacing: -0.012em; }
.enquiries-routes p { margin-top: 44px; max-width: 21em; }

/* Page not found */
.lost p { margin-top: 20px; }

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

.foot { padding: 56px 0 20px; }
.foot-mark { display: block; width: 163px; max-width: 100%; }
.foot-mark img { width: 100%; }
.foot .routes { margin-top: 40px; }
.foot-pages { display: flex; flex-wrap: wrap; column-gap: 28px; margin-top: 40px; }

/* ---------- From 700: the grid ---------- */

@media (min-width: 700px) {
  :root {
    --margin: max(32px, 4vw);
    --header: 88px;
    --mark: 177px;
    --read: 1.3125rem;
    --say: 2.125rem;
    --name: 4.5rem;
  }

  body { line-height: 1.43; }

  .display { line-height: 1.18; }
  .title { line-height: 0.97; letter-spacing: -0.018em; }

  .grid {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    column-gap: 24px;
  }

  /* Header */
  .head .wide { display: inline-flex; }
  .head .menu-word { display: none; }
  .menu { display: none; }
  .head-left { gap: 32px; }

  /* Home, the cover */
  .cover {
    min-height: min(calc(var(--screen) - var(--header)), 920px);
    padding: 24px 0 56px;
  }
  .cover-in {
    grid-template-columns: repeat(12, minmax(0, 1fr));
    grid-template-rows: minmax(16px, 1fr) auto minmax(24px, 1.35fr) auto;
    column-gap: 24px;
  }
  .cover-name {
    grid-column: 5 / 13;
    grid-row: 2;
    justify-self: end;
    /* The last term keeps the name, its caption and the statement inside a short screen
       (488px is the header's neighbours: paddings, caption, statement and the two gaps). */
    width: min(100%, 46vw, max(252px, (var(--screen) - var(--header) - 488px) * 1.647));
  }
  .cover-name img { width: 100%; }
  .cover-name p { margin-top: 18px; }
  /* On a tablet the statement sits under the name; on a wide screen beside it. */
  .cover-say { grid-column: 1 / 9; grid-row: 4; }
  .cover-say .display { max-width: 12em; }
  .cover-say .actions { margin-top: 32px; }

  /* Home, the announcement */
  .announce { padding-top: 112px; padding-bottom: 136px; align-items: start; }
  .announce .title { grid-column: 1 / 7; font-size: 6rem; line-height: 0.9; }
  .announce-text { grid-column: 7 / 13; margin-top: 10px; }
  .announce-text .display { max-width: 15em; }
  .announce-text .actions { margin-top: 32px; }

  /* Text pages */
  .page { padding-top: 48px; padding-bottom: 120px; align-items: start; }

  /* The name */
  .name { grid-template-rows: auto 1fr; }
  .name-lead { grid-column: 1 / 7; grid-row: 1; }
  .name-lead .display { margin-top: 36px; }
  .name-text { grid-column: 1 / 6; grid-row: 2; margin-top: 56px; }
  /* The gloss ends on the right margin, where the header and footer end. */
  .gloss {
    grid-column: 7 / 13;
    grid-row: 1 / span 2;
    justify-self: end;
    width: min(100%, 460px);
    margin-top: 14px;
    row-gap: 36px;
    --u: 56px;
  }
  .gloss li { column-gap: 20px; }

  /* Eid 2027 */
  .eid-cover { min-height: calc(var(--screen) * 0.62 - var(--header)); padding: 72px 0 44px; }
  .eid-cover .title { font-size: clamp(104px, 10vw, 168px); line-height: 0.9; margin-left: -0.04em; }
  .eid-cover .label { margin-top: 24px; }
  .eid-text { padding-top: 88px; padding-bottom: 120px; align-items: start; }
  .eid-prose { grid-column: 1 / 7; }
  .eid-prose .prose { margin-top: 24px; }
  .facts { grid-column: 8 / 13; margin-top: 6px; }
  .facts dd { max-width: none; }

  /* Enquiries */
  .enquiries-lead { grid-column: 1 / 7; }
  .enquiries-lead p { margin-top: 28px; }
  .enquiries-routes { grid-column: 7 / 13; margin-top: 12px; }
  .routes-large { row-gap: 30px; }
  .routes-large a { font-size: 1.75rem; }
  .routes-large .first a { font-size: 2.5rem; }

  /* Page not found */
  .lost > * { grid-column: 1 / 8; }
  .lost p { margin-top: 28px; }

  /* Footer */
  .foot { padding: 56px 0 28px; }
  .foot-mark { grid-column: 1 / 6; width: 177px; }
  .foot .routes { grid-column: 7 / 13; margin-top: 4px; }
  .foot-pages { column-gap: 32px; margin-top: 56px; }
  /* Where the footer has no contact routes its page links take their place. */
  .foot-top > nav { grid-column: 7 / 13; align-self: center; }
  .foot-top > nav .foot-pages { margin-top: 0; }
  .foot-top:has(> nav) { padding-bottom: 28px; }
}

@media (min-width: 900px) {
  .gloss { --u: 72px; }
}

/* ---------- From 1100: the wide page ---------- */

@media (min-width: 1100px) {
  :root { --mark: 195px; }

  .head-left { gap: 36px; }
  .cover-name { grid-column: 6 / 13; width: min(100%, 39vw, 720px, (var(--screen) - var(--header)) * 0.8); }
  .cover-in { grid-template-rows: minmax(16px, 1fr) auto minmax(40px, 1.35fr); }
  .cover-say { grid-column: 1 / 6; grid-row: 2 / 4; align-self: end; }
  .announce .title { grid-column: 1 / 6; font-size: 7.5rem; }
  .announce-text { grid-column: 6 / 12; margin-top: 16px; }
  .gloss { grid-column: 8 / 13; --u: 96px; row-gap: 44px; }
  .facts, .enquiries-routes { grid-column: 8 / 13; }
  .routes-large a { font-size: 1.875rem; }
  .routes-large .first a { font-size: 2.75rem; }
  .foot-top > nav { grid-column: 8 / 13; }
  .foot-mark { width: 195px; }
  .foot .routes {
    grid-column: 7 / 13;
    grid-auto-flow: column;
    justify-content: space-between;
    column-gap: 32px;
  }
  .foot-pages { column-gap: 36px; margin-top: 72px; }
}

/* ---------- From 1600: a large screen reads from further away ---------- */

@media (min-width: 1600px) {
  :root {
    --small: 0.75rem;
    --read: 1.4375rem;
    --say: 2.5rem;
    --name: 5.5rem;
  }
  .announce .title { font-size: 9rem; }
  .gloss { --u: 108px; width: min(100%, 520px); }
}

/* ---------- Motion ---------- */

@media (prefers-reduced-motion: no-preference) {
  @view-transition { navigation: auto; }
  ::view-transition-old(root),
  ::view-transition-new(root) { animation-duration: 0.25s; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

/* ---------- Print ---------- */

@media print {
  .menu, .menu-word { display: none; }
}
