/* The pages read from the top (scripts/read-pages.mjs, site/read.template.html): the home page, each occasion and each of
   its videos. The colours, type and buttons are app.css's (its variables, .cta, .facts, .faq, .ticks, .ideas); this adds
   the page's own layout. Every class here starts with r-. Phone first; wide screens put the sample video beside the words. */
.r-page { --r-wide: 1120px; --r-text: 720px; background: var(--bg); }
.r-page a { text-underline-offset: 3px; }

/* the top line: the name, and on wide screens the way in */
.r-head { max-width: var(--r-wide); margin: 0 auto; padding: max(14px, env(safe-area-inset-top)) 16px 6px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.r-logo { display: inline-flex; align-items: center; gap: 9px; font-size: 17px; font-weight: 800; letter-spacing: -.02em; text-decoration: none; color: var(--ink); white-space: nowrap; }
.r-logo img { width: 28px; height: 28px; border-radius: 8px; }
.r-head-nav { display: flex; align-items: center; gap: 18px; font-size: 15px; font-weight: 600; }
.r-head-nav a { color: var(--ink-2); text-decoration: none; }
.r-head-nav a:hover { color: var(--ink); }
.r-head-nav .r-create { display: none; }

.r-crumbs { max-width: var(--r-wide); margin: 0 auto; padding: 6px 16px 0; display: flex; flex-wrap: wrap; gap: 6px; font-size: 13px; color: var(--ink-3); }
.r-crumbs a { color: var(--ink-2); }

/* the first screen: the heading, one line, the button, and the sample video below it (beside it on a wide screen) */
.r-hero { max-width: var(--r-wide); margin: 0 auto; padding: 14px 16px 8px; display: grid; gap: 22px; }
.r-h1 { margin: 0; font-size: clamp(34px, 10.4vw, 60px); line-height: 1.02; font-weight: 800; letter-spacing: -.045em; text-wrap: balance; word-break: auto-phrase; }
.r-h1.r-long { font-size: clamp(29px, 8.4vw, 52px); }
.r-h1 .phrase { display: inline-block; }
:lang(ja) .r-h1, :lang(zh) .r-h1, :lang(ko) .r-h1 { font-size: clamp(25px, 7.2vw, 46px); letter-spacing: -.02em; line-height: 1.18; }
/* Russian and Ukrainian headings are long words (конструктор, фотомозаики): a size at which they stay within three lines on a phone */
:lang(ru) .r-h1, :lang(uk) .r-h1 { font-size: clamp(28px, 7.6vw, 56px); }
/* Devanagari and Thai marks reach above and below the line: more room between a heading's lines */
:lang(hi) .r-h1, :lang(th) .r-h1 { line-height: 1.3; }
:lang(hi) .r-h2, :lang(th) .r-h2 { line-height: 1.35; }
/* Line breaks: Japanese and Chinese short text breaks only at the <wbr> that build-pages puts after each phrase
   (read-pages.mjs typeset), and never before small kana or ー; Korean breaks between words, as it is written */
.r-page:lang(ja) { line-break: strict; }
:lang(ja) .r-page :is(h1, h2, h3, strong, summary, figcaption, .r-lead, .r-foot-nav a, .r-cards span),
:lang(zh) .r-page :is(h1, h2, h3, strong, summary, figcaption, .r-lead, .r-foot-nav a, .r-cards span) { word-break: keep-all; overflow-wrap: anywhere; }
.r-page:lang(ko) { word-break: keep-all; overflow-wrap: anywhere; }
.r-foot-nav a { text-wrap: pretty; }
.r-lead { margin: 12px 0 0; max-width: 34em; font-size: 17px; line-height: 1.55; color: var(--ink-2); text-wrap: pretty; }
.r-lead strong { color: var(--ink); font-weight: 600; }
.r-go { margin-top: 18px; display: grid; gap: 8px; max-width: 380px; }
.r-note { margin: 0; font-size: 13px; color: var(--ink-3); text-align: center; }
.r-create { padding: 15px 22px; }
/* "Free", as a small tag inside the button (the feed's .f-tag) */
.r-tag { display: inline-block; padding: 1px 8px; border-radius: 99px; background: #ffffff; color: var(--accent-ink); font-size: 12px; font-weight: 800; font-style: normal; line-height: 1.6; flex: none; }

/* the sample video: whole, in its own 9:16 frame, never cropped */
.r-stage { margin: 0; justify-self: center; width: min(100%, 300px); display: grid; gap: 10px; }
.r-frame { position: relative; aspect-ratio: 9 / 16; border-radius: 20px; overflow: hidden; background: #111111; box-shadow: 0 10px 30px rgba(0,0,0,.14); }
.r-frame video { display: block; width: 100%; height: 100%; object-fit: cover; }
.r-cap { display: grid; gap: 2px; justify-items: start; }
.r-cap strong { font-size: 15px; line-height: 1.3; }
.r-cap span { font-size: 13.5px; color: var(--ink-2); }
.r-cap-go { margin-top: 6px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; }
.r-cap-go:empty { display: none; }
.r-get { border: 0; border-radius: 99px; background: var(--soft); padding: 8px 14px; font-size: 13.5px; font-weight: 700; cursor: pointer; }
.r-get:hover { background: #e8e8e8; }
/* to the sample mosaic's own page, to zoom into it */
.r-zoom { display: inline-flex; align-items: center; gap: 6px; font-size: 13.5px; font-weight: 700; color: var(--accent-ink); }
.r-zoom::before { content: ""; width: 15px; height: 15px; flex: none; background: currentColor; -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.4' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='6'/%3E%3Cpath d='M20 20l-4.5-4.5M11 8v6M8 11h6'/%3E%3C/svg%3E") center / contain no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.4' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='6'/%3E%3Cpath d='M20 20l-4.5-4.5M11 8v6M8 11h6'/%3E%3C/svg%3E") center / contain no-repeat; }
/* an occasion's longer introduction, under its video */
.r-intro { max-width: var(--r-text); margin: 0 auto; padding: 28px 16px 0; }
.r-intro .r-text { font-size: 17px; }
.r-intro strong { color: var(--ink); }

/* the sections below: one column of text, as wide as reads comfortably */
.r-sec { max-width: var(--r-text); margin: 0 auto; padding: 44px 16px 0; display: grid; gap: 14px; scroll-margin-top: 12px; }
.r-sec-wide { max-width: var(--r-wide); }
.r-h2 { margin: 0; font-size: clamp(24px, 6.4vw, 30px); line-height: 1.12; font-weight: 800; letter-spacing: -.03em; text-wrap: balance; }
.r-h3, .r-sec .g-h4 { margin: 8px 0 0; font-size: 18px; font-weight: 800; letter-spacing: -.02em; }
.r-sec .g-h4 { margin: 0 0 6px; font-size: 16px; }
.r-text, .r-sec > p, .r-sec li { margin: 0; font-size: 16.5px; line-height: 1.62; color: var(--ink-2); }
.r-sec strong { color: var(--ink); }
.r-sec .ideas p { margin: 0; font-size: 15.5px; line-height: 1.55; color: var(--ink-2); }
.r-sec .faq details p { margin: 8px 0 0; font-size: 15.5px; line-height: 1.6; color: var(--ink-2); }
.r-more { font-weight: 700; color: var(--accent-ink); }

/* the three steps (the same words as the feed's side panel and the first-press window) */
.r-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.r-steps li { display: grid; grid-template-columns: 34px 1fr; gap: 12px; align-items: start; background: var(--card); border-radius: 16px; padding: 14px 16px; }
.r-steps b { display: flex; align-items: center; justify-content: center; width: 34px; height: 34px; border-radius: 50%; background: var(--warm); color: var(--accent-ink); font-size: 15px; }
.r-steps strong { display: block; font-size: 16.5px; color: var(--ink); }
.r-steps span { font-size: 14.5px; line-height: 1.5; color: var(--ink-2); }

/* the occasions: a picture of each one's mosaic, its name, and what its videos say */
.r-genres { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.r-genres a { display: grid; align-content: start; gap: 4px; height: 100%; padding: 8px 8px 12px; border-radius: 18px; background: var(--card); text-decoration: none; color: var(--ink); }
.r-genres a:hover { box-shadow: 0 0 0 2px var(--accent); }
.r-genres img { width: 100%; height: auto; aspect-ratio: 1; object-fit: cover; border-radius: 12px; background: var(--soft); margin-bottom: 4px; }
.r-genres strong { padding: 0 4px; font-size: 16px; }
.r-sec .r-genres span { padding: 0 4px; font-size: 13.5px; line-height: 1.4; color: var(--ink-2); }
/* two to a row on a phone; when that leaves one over, the first card takes the whole row, its picture beside its words */
.r-genres li:first-child:nth-last-child(odd) { grid-column: 1 / -1; }
.r-genres li:first-child:nth-last-child(odd) a { grid-template-columns: minmax(0, 44%) minmax(0, 1fr); column-gap: 10px; }
.r-genres li:first-child:nth-last-child(odd) img { grid-row: 1 / span 3; margin: 0; }
.r-genres li:first-child:nth-last-child(odd) strong { padding-top: 4px; }

/* what costs money, short (the full list is /pricing/) */
.r-prices { margin: 0; display: grid; gap: 1px; border-radius: 16px; overflow: hidden; background: var(--line); }
.r-prices div { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; padding: 12px 16px; background: var(--card); }
.r-prices dt { font-size: 15.5px; color: var(--ink); }
.r-prices dd { margin: 0; font-size: 15.5px; font-weight: 800; white-space: nowrap; }
.r-prices .r-free { color: var(--accent-ink); }

/* an occasion's videos: press one and it plays above (read.js); each is also a link to its own address */
.r-clips { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.r-clips a { display: grid; gap: 6px; text-decoration: none; color: var(--ink); }
.r-clips img { width: 100%; height: auto; aspect-ratio: 9 / 16; object-fit: cover; border-radius: 12px; background: #e4e4e4; }
.r-clips a[aria-current] img { outline: 3px solid var(--accent); outline-offset: 2px; }
.r-clips strong { font-size: 13px; line-height: 1.3; text-wrap: pretty; }
.r-clips small { display: none; }
.r-sec .r-clips li { font-size: inherit; }

.r-end { max-width: var(--r-text); margin: 0 auto; padding: 40px 16px 0; display: flex; justify-content: center; }
.r-end .r-go { margin: 0; width: 100%; }
.r-links { margin: 0; padding-inline-start: 1.2em; display: grid; gap: 8px; }

/* the footer: every occasion, guide and the prices, then the site's own links */
.r-foot { margin-top: 56px; }
.r-foot-nav { display: grid; gap: 10px; }
.r-foot-nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 16px; font-size: 13.5px; }
.r-foot-nav a { color: var(--ink-2); text-decoration: none; }
.r-foot-nav a:hover { color: var(--ink); text-decoration: underline; }

@media (min-width: 700px) {
  .r-head { padding: 20px 24px 6px; }
  .r-head-nav .r-create { display: inline-flex; width: auto; padding: 9px 16px; font-size: 14.5px; gap: 8px; box-shadow: none; }
  .r-crumbs, .r-hero { padding-left: 24px; padding-right: 24px; }
  .r-clips { grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 14px; }
  /* every card in one row */
  .r-genres { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 14px; }
  .r-genres li:first-child:nth-last-child(odd) { grid-column: auto; }
  .r-genres li:first-child:nth-last-child(odd) a { grid-template-columns: none; }
  .r-genres li:first-child:nth-last-child(odd) img { grid-row: auto; margin-bottom: 4px; }
  .r-genres li:first-child:nth-last-child(odd) strong { padding-top: 0; }
  .r-clips small { display: block; font-size: 12.5px; line-height: 1.35; color: var(--ink-2); }
  .r-go { grid-template-columns: auto; }
}
@media (min-width: 900px) {
  /* the words on the left, the video on the right, both on the first screen */
  .r-hero { grid-template-columns: minmax(0, 1fr) auto; align-items: center; column-gap: 64px; padding-top: 28px; }
  .r-stage { width: calc(min(68vh, 620px) * 9 / 16); }
  .r-sec { padding-top: 64px; }
}
@media (prefers-reduced-motion: reduce) { .r-page * { scroll-behavior: auto; } }
