/* medx.hr round 2 (26 Oct 2026): shared components for the pages that follow the Med&X app.
   A page links this file after r3.css and keeps its own page block for layout. Type as in the app (ROUND3-RULES §3):
   New York on Apple devices, Newsreader elsewhere (assets/fonts/fonts.css), weight 500, display text from 22 px up only.
   Figures sit in the UI face with tabular numerals. Motion only on hover, press and tap, never on scroll. */
:root { --font-display: ui-serif, "New York", "Newsreader", Georgia, serif; --r2-ease: cubic-bezier(.22, 1, .36, 1);
  --r2-ink: #191512; --r2-soft: #4a4239; --r2-cream: #f7f1e6; --r2-card: #fdfaf3; --r2-gold: #c9a962; --r2-gold-deep: #84652a;
  --r2-gold-text: #e2c27a; --r2-crimson: #9b1b22; --r2-line: rgba(25, 21, 18, .12); }

/* ---- type ---- */
:root .r2-h1 { font: 500 clamp(44px, 6vw, 84px)/1.02 var(--font-display); letter-spacing: -.018em; text-wrap: balance; }
:root .r2-h2 { margin: 0; font: 500 clamp(40px, 4.6vw, 66px)/1.06 var(--font-display); letter-spacing: -.02em; text-wrap: balance; }
:root .r2-h3 { margin: 0; font: 500 clamp(26px, 2.2vw, 32px)/1.1 var(--font-display); letter-spacing: -.01em; }
:root .r2-lead { margin: 18px 0 0; max-width: 44ch; font: 400 19px/1.55 var(--font-ui); color: var(--r2-soft); }
:root .r2-kicker { display: inline-flex; align-items: center; gap: 8px; margin: 0; font: 600 12px/1.2 var(--font-ui); letter-spacing: .12em; text-transform: uppercase; color: var(--r2-gold-deep); }
:root .r2-kicker::before { content: ""; flex: none; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
:root .r2-fig { font: 600 clamp(44px, 5vw, 72px)/1 var(--font-ui); letter-spacing: -.02em; font-variant-numeric: tabular-nums lining-nums; }

/* ---- buttons and links: sentence case, 16 px semibold, radius 14, as in the app ---- */
:root .r2-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 22px;
  border-radius: 14px; border: 1px solid transparent; font: 600 16px/1 var(--font-ui); letter-spacing: 0; text-transform: none;
  text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: transform .35s var(--r2-ease), background-color .35s var(--r2-ease), color .35s var(--r2-ease), border-color .35s var(--r2-ease); }
:root .r2-btn:active { transform: scale(.97); }
/* buttons: a white ring between two ink rings, visible on paper, crimson, green and photos alike (gi critic 4) */
:root .r2-btn:focus-visible { outline: 2px solid #fff; outline-offset: 2px; box-shadow: 0 0 0 6px #191512; }
:root .r2-link:focus-visible { outline: 2px solid currentColor; outline-offset: 3px; }
:root .r2-btn--crimson { background: var(--r2-crimson); color: #fff; }
:root .r2-btn--ink { background: var(--r2-ink); color: #fff; }
:root .r2-btn--light { background: #fff; color: #7e151b; }
:root .r2-btn--cream { background: var(--r2-cream); color: var(--r2-ink); }
:root .r2-btn--line { background: transparent; color: var(--r2-ink); border-color: rgba(25, 21, 18, .24); }
:root .r2-btn--line-light { background: transparent; color: #fff; border-color: rgba(255, 255, 255, .45); }
@media (hover: hover) {
  :root .r2-btn--crimson:hover { background: #7e151b; }
  :root .r2-btn--ink:hover { background: #3a302a; }
  :root .r2-btn--light:hover { background: #fbf1e2; }
  :root .r2-btn--cream:hover { background: #fff; }
  :root .r2-btn--line:hover { background: rgba(25, 21, 18, .05); border-color: rgba(25, 21, 18, .4); }
  :root .r2-btn--line-light:hover { background: rgba(255, 255, 255, .12); border-color: #fff; }
  :root .r2-link:hover span { transform: translateX(3px); }
}
:root .r2-link { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; font: 600 16px/1.25 var(--font-ui); color: var(--r2-crimson); text-decoration: none; }
:root .r2-link span { display: inline-block; transition: transform .35s var(--r2-ease); }
:root .r2-link--light { color: #fff; }
:root .r2-actions { display: flex; align-items: center; gap: 14px 22px; flex-wrap: wrap; }

/* ---- date plate: big figures, month in gold caps, a gold-to-crimson rule, then where and what ---- */
:root .r2-plate { display: inline-flex; align-items: center; gap: 12px; max-width: 100%; padding: 12px 16px 12px 14px; border-radius: 16px;
  background: rgba(20, 16, 14, .42); border: 1px solid rgba(255, 255, 255, .18); color: #fff;
  -webkit-backdrop-filter: blur(14px) saturate(140%); backdrop-filter: blur(14px) saturate(140%); }
:root .r2-dd { font: 600 34px/.9 var(--font-ui); letter-spacing: -.02em; font-variant-numeric: tabular-nums lining-nums; white-space: nowrap; }
:root .r2-mm { display: flex; flex-direction: column; gap: 4px; }
:root .r2-mm b { font: 700 12px/1 var(--font-ui); letter-spacing: .12em; text-transform: uppercase; color: var(--r2-gold-text); }
:root .r2-mm span { font: 500 13px/1 var(--font-ui); color: rgba(255, 255, 255, .78); font-variant-numeric: tabular-nums; }
:root .r2-rule { flex: none; align-self: stretch; width: 2px; margin: 0 2px; border-radius: 2px; background: linear-gradient(var(--r2-gold), var(--r2-crimson)); }
:root .r2-what { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
:root .r2-what b { font: 600 15px/1.25 var(--font-ui); }
:root .r2-what span { font: 400 14px/1.35 var(--font-ui); color: rgba(255, 255, 255, .78); }
/* the same plate on paper */
:root .r2-plate--paper { background: transparent; border: 0; padding: 0; color: var(--r2-ink); -webkit-backdrop-filter: none; backdrop-filter: none; }
:root .r2-plate--paper .r2-mm b { color: var(--r2-gold-deep); }
:root .r2-plate--paper .r2-mm span, :root .r2-plate--paper .r2-what span { color: var(--r2-soft); }

/* ---- photo tile: the app's Plexus Week tile, type on the photo ---- */
:root .r2-tile { position: relative; display: block; overflow: hidden; border-radius: 24px; background: var(--r2-ink); color: #fff;
  text-decoration: none; isolation: isolate; -webkit-tap-highlight-color: transparent; transition: transform .5s var(--r2-ease); }
:root .r2-tile > img { position: absolute; inset: 0; z-index: -2; width: 100%; height: 100%; object-fit: cover; transition: transform 1.2s var(--r2-ease); }
:root .r2-tile::after { content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: linear-gradient(to top, rgba(17, 13, 11, .9) 0%, rgba(17, 13, 11, .6) 30%, rgba(17, 13, 11, .12) 58%, rgba(17, 13, 11, 0) 72%); }
:root .r2-tile-body { position: absolute; left: 0; right: 0; bottom: 0; padding: 26px 28px 28px; display: flex; flex-direction: column; align-items: flex-start; }
:root .r2-tile .r2-kicker { color: rgba(255, 255, 255, .88); }
:root .r2-tile .r2-kicker::before { background: var(--r2-gold); }
:root .r2-tile-name { margin-top: 10px; font: 500 clamp(26px, 2.2vw, 32px)/1.06 var(--font-display); letter-spacing: -.01em; }
:root .r2-tile-line { margin-top: 8px; max-width: 36ch; font: 400 15px/1.4 var(--font-ui); color: rgba(255, 255, 255, .82); }
:root .r2-tile .r2-plate { margin-top: 16px; }
:root .r2-go { position: absolute; top: 20px; right: 20px; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%;
  background: rgba(255, 255, 255, .16); border: 1px solid rgba(255, 255, 255, .3); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  transition: transform .5s var(--r2-ease), background-color .5s var(--r2-ease); }
:root .r2-go svg { width: 18px; height: 18px; fill: none; stroke: #fff; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; transition: stroke .5s var(--r2-ease); }
@media (hover: hover) {
  :root a.r2-tile:hover > img { transform: scale(1.045); }
  :root a.r2-tile:hover .r2-go { background: #fff; transform: translateX(2px); }
  :root a.r2-tile:hover .r2-go svg { stroke: var(--r2-ink); }
}
:root a.r2-tile:active { transform: scale(.985); }
:root .r2-tile:focus-visible { outline: 3px solid var(--r2-crimson); outline-offset: 4px; }

/* ---- row: the app's "Later at Med&X" row, a date block, a title, one line and an action ---- */
:root .r2-row { display: grid; grid-template-columns: 112px minmax(0, 1fr) auto; gap: 24px; align-items: center; padding: 22px 0;
  border-top: 1px solid var(--r2-line); color: var(--r2-ink); text-decoration: none; }
:root .r2-row:last-child { border-bottom: 1px solid var(--r2-line); }
:root .r2-row-date { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }
:root .r2-row-date .r2-dd { font-size: 30px; }
:root .r2-row-date b { font: 700 12px/1 var(--font-ui); letter-spacing: .12em; text-transform: uppercase; color: var(--r2-gold-deep); }
:root .r2-row-title { margin: 0; font: 600 18px/1.3 var(--font-ui); letter-spacing: -.01em; }
:root .r2-row-line { margin: 4px 0 0; font: 400 15px/1.45 var(--font-ui); color: var(--r2-soft); }

/* ---- status chip: small, sentence case, a dot for the state ---- */
:root .r2-chip { display: inline-flex; align-items: center; gap: 7px; min-height: 28px; padding: 0 12px; border-radius: 999px;
  font: 600 13px/1 var(--font-ui); background: rgba(25, 21, 18, .06); color: var(--r2-ink); white-space: nowrap; }
:root .r2-chip::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--r2-gold-deep); }
:root .r2-chip--open::before { background: #2f8a4c; }
:root .r2-chip--done { color: var(--r2-soft); }
:root .r2-chip--done::before { background: rgba(25, 21, 18, .35); }

/* ---- expander: details stay one tap away ---- */
:root details.r2-more { margin-top: 18px; }
:root details.r2-more > summary { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; cursor: pointer; list-style: none;
  font: 600 16px/1 var(--font-ui); color: var(--r2-crimson); }
:root details.r2-more > summary::-webkit-details-marker { display: none; }
:root details.r2-more > summary::after { content: ""; width: 9px; height: 9px; margin-top: -4px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor;
  transform: rotate(45deg); transition: transform .35s var(--r2-ease), margin .35s var(--r2-ease); }
:root details.r2-more[open] > summary::after { transform: rotate(-135deg); margin-top: 4px; }
:root details.r2-more > summary:focus-visible { outline: 2px solid currentColor; outline-offset: 3px; border-radius: 4px; }
:root :is(.r2-btn, .r2-link, details.r2-more > summary) { -webkit-tap-highlight-color: transparent; }

@media (max-width: 620px) {
  :root .r2-h2 { font-size: 38px; }
  :root .r2-lead { font-size: 17px; }
  :root .r2-tile-body { padding: 20px; }
  :root .r2-go { top: 16px; right: 16px; }
  :root .r2-row { grid-template-columns: 76px minmax(0, 1fr); gap: 16px; }
  :root .r2-row > :last-child:not(:nth-child(2)) { grid-column: 2; justify-self: start; }
  :root .r2-row-date .r2-dd { font-size: 26px; }
}
@media (prefers-reduced-motion: reduce) {
  :root .r2-tile, :root .r2-tile > img, :root .r2-btn, :root .r2-go { transition: none; }
}

/* narrow phones (critic bridges-1): the plate puts its line under the date, buttons may wrap */
@media (max-width: 480px) {
  :root .r2-tile .r2-plate { display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: 12px; }
  :root .r2-tile .r2-rule { display: none; }
  :root .r2-tile .r2-what { grid-column: 1 / -1; margin-top: 10px; padding-top: 10px; border-top: 1px solid rgba(255, 255, 255, .18); }
}
@media (max-width: 380px) {
  :root .r2-btn { white-space: normal; text-align: center; line-height: 1.2; padding-block: 12px; }
}

/* add-to-calendar links (site.js markup): a 44 px tap height without changing the line */
:root .medx-cal .medx-cal-links a { display: inline-flex; align-items: center; min-height: 44px; border-bottom: 0; padding-bottom: 0;
  text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 4px; }
:root .medx-cal .medx-cal-lbl { opacity: .9; }

/* photos that open the shared lightbox are keyboard targets (site.js): a visible ring */
:root [data-lightbox][role="button"]:focus-visible { outline: 3px solid var(--r2-crimson); outline-offset: 3px; }
