/* The website on a laptop or desktop: a real news site across the screen, not a phone column.
   A top bar instead of the bottom tabs, the lead story across the page (photo beside the text), the other stories
   in a 3-column grid, and reading pages in a comfortable centred column. Phones and the installed app are untouched.
   `:root:root` outranks both looks' own rules ([data-skin="modern"] …) without !important. */
@media (min-width: 1000px) {
  :root:root { --nav-h: 64px; --wide: 1180px; }

  /* ---- the top bar (the phone's bottom tabs) ---- */
  :root:root .nav {
    top: 0; bottom: auto; left: 0; right: 0; height: 64px; padding: 0 max(24px, calc((100vw - var(--wide)) / 2));
    border: 0; border-bottom: 1px solid var(--rule); border-radius: 0; box-shadow: 0 6px 24px -18px rgba(0, 0, 0, .5);
    justify-content: flex-start; gap: 6px;
    background: color-mix(in srgb, var(--paper-2) 92%, transparent); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  }
  :root:root .nav a { flex: 0 0 auto; max-width: none; flex-direction: row; gap: 8px; padding: 0 14px; font: 600 15px var(--sans); border-radius: 12px; }
  :root:root .nav a:hover { background: color-mix(in srgb, var(--accent) 10%, transparent); }
  :root:root .nav a svg { width: 20px; height: 20px; }
  :root:root .nav a.add { order: 9; margin-inline-start: auto; }
  :root:root .nav a.add span.circle { width: auto; height: 40px; margin: 0; padding: 0 18px 0 14px; border-radius: 20px; border: 0; box-shadow: none; gap: 6px;
                                      display: inline-flex; align-items: center; }
  :root:root .nav a.add span.circle::after { content: "أضف إعلاناً"; font: 700 14px var(--sans); }
  :root:root.en .nav a.add span.circle::after { content: "Post an ad"; }
  :root:root .nav a.add { font-size: 0; }   /* the pill carries the words */
  :root:root .getapp { display: none; }      /* the Android download bar is for phones */
  :root:root .nav a.langlink { display: flex; order: 10; font: 700 14px var(--sans); color: var(--ink-2);
                               border: 1px solid var(--rule); height: 38px; align-self: center; }

  /* ---- page frame ---- */
  :root:root #app { max-width: var(--wide); padding: calc(64px + 18px) 32px 48px; }
  :root:root .page { padding: 0; }
  :root:root .mast, :root:root .head { top: 64px; margin-left: 0; margin-right: 0; padding-left: 0; padding-right: 0; }
  :root:root .mast h1.brand img { height: 64px; }
  :root:root .mast.compact h1.brand img { height: 34px; }
  :root:root .strip { justify-content: center; }
  /* reading and form pages: a centred column of a comfortable width */
  :root:root .page:not(:has(#feed)) { max-width: 820px; margin: 0 auto; }
  :root:root .page:has(.mast):not(:has(#feed)) { max-width: none; }
  :root:root .page:has(.mast):not(:has(#feed)) > :not(.mast) { max-width: 820px; margin-left: auto; margin-right: auto; }

  /* ---- the front page: the lead across, the rest in a grid ---- */
  :root:root #feed { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px; grid-auto-flow: dense; align-items: start; margin-top: 18px; }
  :root:root #feed > * { margin: 0; }
  :root:root .lead { grid-column: 1 / -1; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); column-gap: 32px; align-items: start; }
  :root:root .lead > * { grid-column: 1; }
  :root:root .lead > .kicker { justify-self: start; }
  :root:root .lead > .photo { grid-column: 2; grid-row: 1 / span 8; margin: 0; }
  :root:root .lead h2 { font-size: 34px; line-height: 1.35; }
  :root:root .lead .cols { columns: 1; font-size: 16px; }
  :root:root .lead .photo img, :root:root .lead .photo > div { max-height: 560px; }
  /* every card in the grid gets the same photo shape, so the rows line up */
  :root:root .story .photo img { aspect-ratio: 16 / 10; height: auto; max-height: none; object-fit: cover; }
  :root:root .story h3 { font-size: 19px; }
  :root:root .story p { -webkit-line-clamp: 3; }
  :root:root .feed-end { grid-column: 1 / -1; }
  :root:root .sponsor img { aspect-ratio: 16 / 10; }

  /* ---- article: a big photo and a reading column ---- */
  :root:root .article h1 { font-size: 38px; }
  :root:root .article .body p { font-size: 18px; line-height: 1.95; }
  :root:root .article .photo img { max-height: 620px; }
  :root:root .gallery { grid-auto-columns: 70%; margin: 12px 0 0; padding: 0; }

  /* ---- toasts and sheets: a centred message and a centred dialog ---- */
  :root:root .toast { bottom: 28px; border-radius: 10px; }
  :root:root .sheet-bg { align-items: center; }
  :root:root .sheet { max-width: 480px; border-radius: 18px; padding: 22px 22px 24px; }
}

/* a very wide screen: four columns of stories */
@media (min-width: 1500px) {
  :root:root { --wide: 1400px; }
  :root:root #feed { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
