/* Arizona Real Country reader. Brand colours arrive as CSS variables from index.html. */
:root {
  --bar: #211912; --bar-text: #fbf7f0; --accent: #e0a458; --accent-text: #211912;
  --panel: #fbf7f0; --panel-text: #2b2118; --stage-bg: #3b2a20;
  --ui: "Public Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --display: "Fraunces", Georgia, "Times New Roman", serif;
  --bar-h: 56px; --foot-h: 56px;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; }
body.arc-reader { background: var(--stage-bg); color: var(--bar-text); font-family: var(--ui); overflow: hidden; -webkit-text-size-adjust: 100%; }
.arc-boot { position: fixed; inset: var(--bar-h) 0 var(--foot-h); display: grid; place-items: center; }
.arc-boot img { max-width: 92vw; max-height: calc(100% - 32px); box-shadow: 0 10px 40px rgba(0,0,0,.45); }
.arc-noscript { position: fixed; inset: auto 16px 16px; background: var(--panel); color: var(--panel-text); padding: 12px 16px; border-radius: 8px; }
.arc-noscript a { color: inherit; }

.rb { position: fixed; inset: 0; display: grid; grid-template-rows: auto 1fr auto; grid-template-columns: minmax(0, 1fr); /* never wider than the screen */ height: 100vh; height: 100dvh; }
.rb-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- top bar */
.rb-bar {
  display: flex; align-items: center; gap: 16px; min-height: var(--bar-h);
  padding: 6px max(12px, env(safe-area-inset-right)) 6px max(12px, env(safe-area-inset-left));
  padding-top: max(6px, env(safe-area-inset-top));
  background: var(--bar); color: var(--bar-text); z-index: 20; box-shadow: 0 1px 0 rgba(255,255,255,.06), 0 2px 12px rgba(0,0,0,.25);
}
.rb-logo { display: flex; align-items: center; flex: 0 0 auto; color: inherit; text-decoration: none; border-radius: 4px; }
.rb-logo img { display: block; height: 36px; max-width: 180px; width: auto; object-fit: contain; }
.rb-wordmark { font-family: var(--display); font-weight: 800; font-size: 18px; letter-spacing: .02em; text-transform: uppercase; }
.rb-title { min-width: 0; flex: 1 1 auto; display: flex; flex-direction: column; line-height: 1.2; border-left: 1px solid color-mix(in srgb, var(--bar-text) 25%, transparent); padding-left: 16px; }
.rb-title strong { font-family: var(--display); font-weight: 600; font-size: 17px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rb-title span { font-size: 12px; opacity: .78; letter-spacing: .06em; text-transform: uppercase; }
.rb-tools { display: flex; align-items: center; gap: 2px; flex: 0 1 auto; min-width: 0; margin-left: auto; }

.rb-btn {
  display: inline-flex; align-items: center; gap: 6px; min-height: 44px; min-width: 44px; padding: 0 10px; justify-content: center;
  border: 0; border-radius: 8px; background: transparent; color: inherit; font: 600 13px/1 var(--ui); cursor: pointer; text-decoration: none;
}
.rb-btn:hover { background: color-mix(in srgb, currentColor 12%, transparent); }
.rb-btn:disabled { opacity: .35; cursor: default; background: transparent; }
.rb-btn svg { flex: 0 0 auto; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

/* ---------- stage */
.rb-stage { position: relative; min-height: 0; overflow: hidden; }
.rb-viewport { position: absolute; inset: 0; overflow: hidden; touch-action: pan-y; outline: none; }
.rb-is-zoomed .rb-viewport { overflow: auto; touch-action: pan-x pan-y; -webkit-overflow-scrolling: touch; cursor: grab; overscroll-behavior: contain; }
.rb-viewport.rb-grabbing { cursor: grabbing; }
.rb-sizer { min-width: 100%; min-height: 100%; display: flex; align-items: center; justify-content: center; }
.rb-sizer.rb-zoomed { width: max-content; height: max-content; padding: 24px; }
.rb-spread { position: relative; flex: 0 0 auto; perspective: 2600px; }
.rb-is-spread .rb-spread::after { /* the gutter shadow down the spine */
  content: ""; position: absolute; top: 0; bottom: 0; left: calc(50% - 30px); width: 60px; pointer-events: none; z-index: 3;
  background: linear-gradient(90deg, rgba(0,0,0,0) 0%, rgba(0,0,0,.10) 42%, rgba(0,0,0,.22) 50%, rgba(0,0,0,.10) 58%, rgba(0,0,0,0) 100%);
}
.rb-is-spread .rb-spread.rb-solo-right::after, .rb-is-spread .rb-spread.rb-solo-left::after { display: none; }
.rb-page { position: absolute; background: #fff; box-shadow: 0 6px 28px rgba(0,0,0,.38); overflow: hidden; user-select: none; -webkit-user-select: none; }
.rb-page::before { content: ""; position: absolute; inset: 0; background: linear-gradient(110deg, #f1ece4 30%, #faf7f2 50%, #f1ece4 70%); background-size: 300% 100%; animation: rb-shimmer 1.4s linear infinite; }
.rb-page.rb-loaded::before { display: none; }
.rb-page img { position: absolute; inset: 0; width: 100%; height: 100%; display: block; -webkit-user-drag: none; }
@keyframes rb-shimmer { to { background-position: -150% 0; } }

/* links and search highlights share the page's coordinate system, so they stay aligned at any size */
.rb-links, .rb-hls { position: absolute; inset: 0; }
.rb-hls { pointer-events: none; }
.rb-link { position: absolute; display: block; border-radius: 3px; transition: background-color .15s, box-shadow .15s; -webkit-tap-highlight-color: transparent; }
.rb-link:hover, .rb-link:focus-visible { background: color-mix(in srgb, var(--accent) 22%, transparent); box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 80%, transparent); outline: none; }
.rb-link:active { background: color-mix(in srgb, var(--accent) 40%, transparent); }
.rb-flash .rb-link { animation: rb-flash 1.2s ease-out; }
@keyframes rb-flash { 0%, 30% { background: color-mix(in srgb, var(--accent) 30%, transparent); } 100% { background: transparent; } }
.rb-hl { position: absolute; background: rgba(255, 214, 0, .38); mix-blend-mode: multiply; border-radius: 2px; }

/* page curl: the turning sheet, its back, and the shadows along the fold */
.rb-cface { position: absolute; left: 0; top: 0; transform-origin: 0 0; overflow: hidden; background: #fff; }
.rb-cface img { display: block; width: 100%; height: 100%; -webkit-user-drag: none; }
.rb-cblank { background: linear-gradient(90deg, #ece6dc, #f7f3ec 60%, #efe9e0); }
.rb-cflap { position: absolute; inset: 0; z-index: 6; pointer-events: none; filter: drop-shadow(0 0 7px rgba(0,0,0,.32)); }
.rb-cshade { position: absolute; left: 0; top: 0; transform-origin: 0 0; pointer-events: none; z-index: 1; }
.rb-cshade-f { z-index: 7; }
.rb-cstrip { position: absolute; left: 0; top: 0; transform-origin: 0 0; }
.rb-cstrip-u { background: linear-gradient(to bottom, rgba(0,0,0,.34), rgba(0,0,0,.1) 40%, rgba(0,0,0,0)); }
.rb-cstrip-f { background: linear-gradient(to bottom, rgba(0,0,0,.2), rgba(255,255,255,.22) 16%, rgba(0,0,0,.05) 55%, rgba(0,0,0,0)); }
.rb-viewport.rb-corner { cursor: pointer; }
.rb-viewport.rb-dragging { cursor: grabbing; }
@media (pointer: coarse) { .rb-cflap { filter: none; } }
/* side arrows */
.rb-side { position: absolute; top: 50%; transform: translateY(-50%); z-index: 6; width: 48px; height: 72px; color: var(--bar-text);
  background: color-mix(in srgb, var(--bar) 55%, transparent); border-radius: 10px; }
.rb-side:hover { background: color-mix(in srgb, var(--bar) 85%, transparent); }
.rb-side .rb-lbl { display: none; }
.rb-side-prev { left: 8px; } .rb-side-next { right: 8px; }
.rb-is-zoomed .rb-side { opacity: .55; }

/* ---------- footer */
/* Three fixed zones: "Read as text" | page navigation (always centred) | zoom.
   The side zones are the same width, so the centre never moves when a button appears. */
.rb-foot {
  display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 8px; min-height: var(--foot-h);
  padding: 6px max(12px, env(safe-area-inset-right)) max(6px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left));
  background: var(--bar); color: var(--bar-text); z-index: 20; position: relative;
}
.rb-foot-left { justify-self: start; min-width: 0; }
.rb-foot-nav { justify-self: center; display: flex; align-items: center; gap: 8px; }
.rb-foot-right { justify-self: end; display: flex; }
.rb-foot .rb-lbl { display: none; }
.rb-pageform { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.rb-pagelbl { opacity: .8; }
.rb-page-input { width: 78px; height: 36px; text-align: center; font: 600 15px var(--ui); color: var(--panel-text); background: var(--panel); border: 0; border-radius: 6px; }
.rb-of { opacity: .8; white-space: nowrap; }
.rb-textlink { display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 12px; border-radius: 18px; background: var(--accent); color: var(--accent-text); font: 600 13px var(--ui); text-decoration: none; white-space: nowrap; transition: opacity .2s ease, visibility .2s; }
/* when there is no article for the page the button keeps its place but is invisible and untouchable */
.rb-textlink.rb-off { opacity: 0; visibility: hidden; pointer-events: none; }
.rb-zoomgroup { display: flex; align-items: center; gap: 2px; }
.rb-zoomlbl { font-size: 12px; min-width: 40px; text-align: center; opacity: .8; font-variant-numeric: tabular-nums; }

/* ---------- panel */
.rb-scrim { position: fixed; inset: 0; background: rgba(0,0,0,.35); z-index: 30; }
.rb-panel {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(420px, 100vw); z-index: 31; display: flex; flex-direction: column;
  background: var(--panel); color: var(--panel-text); box-shadow: -8px 0 30px rgba(0,0,0,.3);
  padding-top: env(safe-area-inset-top); padding-bottom: env(safe-area-inset-bottom);
  animation: rb-in .22s ease-out;
}
@keyframes rb-in { from { transform: translateX(24px); opacity: 0; } }
.rb-panel-head { display: flex; align-items: center; gap: 8px; padding: 8px 8px 0 12px; border-bottom: 1px solid color-mix(in srgb, var(--panel-text) 14%, transparent); }
.rb-tabs { display: flex; gap: 2px; flex: 1; overflow-x: auto; }
.rb-tab { border: 0; background: none; color: inherit; font: 600 14px var(--ui); padding: 12px 10px; border-bottom: 3px solid transparent; cursor: pointer; white-space: nowrap; }
.rb-tab[aria-selected="true"] { border-bottom-color: var(--accent); }
.rb-close { color: var(--panel-text); }
.rb-close .rb-lbl { display: none; }
.rb-panel-body { overflow-y: auto; padding: 16px 16px 24px; flex: 1; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; }
.rb-ph { font-family: var(--display); font-weight: 600; font-size: 24px; margin: 0 0 4px; line-height: 1.15; }
.rb-pmeta { font-size: 13px; opacity: .75; margin: 0 0 12px; }
.rb-empty { opacity: .8; }
.rb-toc, .rb-results, .rb-artlist { list-style: none; margin: 0 0 16px; padding: 0; }
.rb-row, .rb-result { display: flex; gap: 12px; align-items: baseline; padding: 11px 6px; color: inherit; text-decoration: none; border-bottom: 1px solid color-mix(in srgb, var(--panel-text) 10%, transparent); border-radius: 4px; }
.rb-row:hover, .rb-result:hover { background: color-mix(in srgb, var(--accent) 14%, transparent); }
.rb-row-t { flex: 1; font-family: var(--display); font-size: 17px; }
.rb-row-p { font-weight: 600; font-size: 13px; opacity: .75; font-variant-numeric: tabular-nums; flex: 0 0 auto; min-width: 34px; }
.rb-snip { font-size: 14px; line-height: 1.4; }
.rb-snip mark { background: rgba(255, 214, 0, .5); color: inherit; padding: 0 1px; }
.rb-search { width: 100%; height: 46px; font: 16px var(--ui); padding: 0 14px; border-radius: 8px; border: 1px solid color-mix(in srgb, var(--panel-text) 30%, transparent); background: #fff; color: #111; margin-bottom: 10px; }
.rb-thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 14px 10px; }
.rb-thumb { display: flex; flex-direction: column; align-items: center; gap: 4px; color: inherit; text-decoration: none; font-size: 12px; font-weight: 600; padding: 4px; border-radius: 6px; }
.rb-thumb img { width: 100%; height: auto; background: #eee; box-shadow: 0 1px 4px rgba(0,0,0,.25); }
.rb-thumb.rb-on { background: color-mix(in srgb, var(--accent) 28%, transparent); }
.rb-thumb:hover img { box-shadow: 0 0 0 2px var(--accent); }
.rb-artlist li { display: flex; align-items: center; gap: 10px; border-bottom: 1px solid color-mix(in srgb, var(--panel-text) 10%, transparent); }
.rb-art { flex: 1; display: flex; flex-direction: column; padding: 12px 4px; color: inherit; text-decoration: none; }
.rb-art strong { font-family: var(--display); font-weight: 600; font-size: 17px; }
.rb-art span { font-size: 13px; opacity: .75; }
.rb-art-p { font-size: 13px; font-weight: 600; color: inherit; padding: 8px; white-space: nowrap; }
.rb-more { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.rb-pill { display: inline-flex; align-items: center; min-height: 40px; padding: 0 16px; border-radius: 20px; border: 0; background: var(--accent); color: var(--accent-text); font: 600 14px var(--ui); text-decoration: none; cursor: pointer; }

.rb-toast {
  position: fixed; left: 50%; bottom: calc(var(--foot-h) + 16px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 40;
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap; justify-content: center; max-width: calc(100vw - 32px);
  background: var(--panel); color: var(--panel-text); padding: 10px 14px; border-radius: 10px; box-shadow: 0 8px 30px rgba(0,0,0,.35); font-size: 14px; word-break: break-all;
}
.rb-toast[hidden] { display: none; }

/* ---------- narrow screens (phones) */
@media (max-width: 760px) {
  :root { --bar-h: 50px; }
  .rb-bar { gap: 8px; }
  .rb-title { display: none; }
  .rb-logo img { height: 28px; max-width: 130px; }
  .rb-wordmark { font-size: 14px; }
  .rb-tools .rb-lbl { display: none; }
  .rb-btn { padding: 0 8px; }
  .rb-wide-only { display: none; }
  .rb-side { display: none; }
  .rb-foot { gap: 4px; padding-left: max(8px, env(safe-area-inset-left)); padding-right: max(8px, env(safe-area-inset-right)); }
  .rb-foot-nav { gap: 2px; }
  .rb-foot .rb-btn { min-width: 40px; padding: 0 4px; }
  .rb-zoomgroup { gap: 0; }
  .rb-pagelbl { display: none; }
  .rb-page-input { width: 56px; }
  .rb-zoomlbl { display: none; }
  .rb-textlink span { display: none; }
  .rb-textlink { padding: 0 10px; }
  .rb-panel { top: auto; width: 100vw; height: min(78vh, 640px); border-radius: 16px 16px 0 0; animation-name: rb-up; }
  @keyframes rb-up { from { transform: translateY(40px); opacity: 0; } }
}
@media (max-width: 380px) { .rb-zoomgroup { display: none; } }
@media (max-width: 360px) {
  .rb-bar { gap: 4px; padding-left: max(8px, env(safe-area-inset-left)); padding-right: max(8px, env(safe-area-inset-right)); }
  .rb-logo { min-width: 0; flex: 0 1 auto; }
  .rb-logo img { max-width: 104px; height: 24px; }
  .rb-wordmark { font-size: 12px; }
  .rb-tools .rb-btn { min-width: 40px; padding: 0 4px; }
}
@media (min-width: 761px) and (max-width: 1100px) { .rb-tools .rb-lbl { display: none; } }
@media (max-height: 480px) and (orientation: landscape) { :root { --bar-h: 44px; --foot-h: 44px; } .rb-btn { min-height: 38px; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
  .rb-page::before { animation: none; }
}
@media (forced-colors: active) { .rb-link:focus-visible, .rb-link:hover { outline: 2px solid LinkText; } }
@media print { .rb-bar, .rb-foot, .rb-side { display: none; } }

/* Subscribe button (accent pill in the toolbar) and the advertiser index */
.rb-subscribe { background: var(--accent); color: var(--accent-text); border-radius: 20px; padding: 0 14px; margin: 0 4px; }
.rb-subscribe:hover { background: var(--accent); filter: brightness(1.08); }
.rb-advlist .rb-art { gap: 2px; }
.rb-adv-links { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 13px; }
.rb-adv-links a { color: inherit; text-decoration: underline; text-decoration-color: color-mix(in srgb, var(--accent) 80%, currentColor); text-underline-offset: 2px; }
@media (max-width: 760px) { .rb-subscribe { padding: 0 8px; margin: 0; } }

/* small links at the bottom of the Contents panel */
.rb-panel-foot { display: flex; flex-wrap: wrap; gap: 4px 18px; padding: 10px 16px max(12px, env(safe-area-inset-bottom)); border-top: 1px solid color-mix(in srgb, var(--panel-text) 14%, transparent); font: 600 13px var(--ui); }
.rb-panel-foot a, .rb-panel-foot button { color: inherit; background: none; border: 0; padding: 6px 0; font: inherit; cursor: pointer; text-decoration: underline; text-decoration-color: color-mix(in srgb, var(--accent) 80%, currentColor); text-underline-offset: 3px; }

