/* COUNTRY PAGES
   One page per currency, each dressed like the app is for that country. The
   colours are the app's own: the top and bottom of each country's tab bar
   (app/(tabs)/_layout.tsx, BAR_THEMES), which were taken from its background,
   and the frame gold. The textures and the phone header are cut from the app's
   background images, so the leather or wood is the same material.

   On a phone the header shows the top of the app's carved panel, as the app
   does. On a wider screen the panel would have to be stretched past its 736 px
   and its carvings would sit behind the heading, so the header is framed in
   gold instead and the material carries the page. */

body[class*="country-"] {
  --frame: #c9a24a;
  --hi: #f5c518;
  background-color: var(--c-bottom);
  background-repeat: repeat;
  background-size: 512px 512px;
  background-attachment: scroll;
}

/* The site's generated grain and corner glow are for its own green; the real
   material replaces them here. A soft vignette stands in for the app's
   gradient over its background. */
body[class*="country-"]::after { display: none; }
body[class*="country-"]::before {
  background: radial-gradient(ellipse 110% 90% at 50% 30%, transparent 40%, var(--c-vignette) 100%);
}

body.country-au {
  --c-top: #0c1c10; --c-bottom: #061008; --c-vignette: rgba(3,8,4,0.55);
  --bg: #061008; --surface: rgba(8,20,11,0.9); --surface2: rgba(12,28,16,0.92);
  --border: #2b4331; --text: #ede0c4; --muted: #9fb2a4; --gold: #c9a24a;
  --nav-bg: rgba(6,16,8,0.94);
}
body.country-au { background-image: url('tile-au.jpg'); }

body.country-nz {
  --c-top: #181714; --c-bottom: #0a0a08; --c-vignette: rgba(0,0,0,0.6);
  --bg: #0a0a08; --surface: rgba(16,15,13,0.9); --surface2: rgba(24,23,20,0.92);
  --border: #3a3832; --text: #ede0c4; --muted: #aeaba2; --gold: #c9a24a;
  --nav-bg: rgba(10,10,8,0.94);
}
body.country-nz { background-image: url('tile-nz.jpg'); }

/* Canada's background is cream, so the page is light, with the app's dark
   brown text and deeper gold, as on its cream tab bar. */
body.country-ca {
  --c-top: #eae4d8; --c-bottom: #d6cec0; --c-vignette: rgba(120,100,70,0.18);
  --bg: #d6cec0; --surface: rgba(250,247,240,0.92); --surface2: rgba(243,238,228,0.95);
  --border: #c2b49c; --text: #2c1a08; --muted: #5e4636; --gold: #5c4106;
  --hi: #8a630c; --nav-bg: rgba(234,228,216,0.95);
  color-scheme: light;
}
body.country-ca { background-image: url('tile-ca.jpg'); }

body.country-uk {
  --c-top: #2a1b11; --c-bottom: #160e09; --c-vignette: rgba(8,4,2,0.55);
  --bg: #160e09; --surface: rgba(30,20,13,0.9); --surface2: rgba(42,27,17,0.92);
  --border: #4a3524; --text: #ede0c4; --muted: #bfa892; --gold: #c9a24a;
  --nav-bg: rgba(22,14,9,0.94);
}
body.country-uk { background-image: url('tile-uk.jpg'); }

body.country-us {
  --c-top: #281e15; --c-bottom: #140f0b; --c-vignette: rgba(8,5,3,0.55);
  --bg: #140f0b; --surface: rgba(28,21,15,0.9); --surface2: rgba(40,30,21,0.92);
  --border: #4a3a2a; --text: #ede0c4; --muted: #bba893; --gold: #c9a24a;
  --nav-bg: rgba(20,15,11,0.94);
}
body.country-us { background-image: url('tile-us.jpg'); }

body.country-eu {
  --c-top: #32302d; --c-bottom: #1e1d1b; --c-vignette: rgba(0,0,0,0.5);
  --bg: #1e1d1b; --surface: rgba(30,29,27,0.9); --surface2: rgba(44,42,39,0.92);
  --border: #4a4843; --text: #ede0c4; --muted: #b6b3ac; --gold: #d9b25a;
  --nav-bg: rgba(30,29,27,0.94);
}
body.country-eu { background-image: url('tile-eu.jpg'); }

body[class*="country-"] nav { background: var(--nav-bg); }
body[class*="country-"] .nav-tabs a:hover { background: color-mix(in srgb, var(--text) 6%, transparent); }
body[class*="country-"] .nav-tabs a.active { color: var(--gold); background: color-mix(in srgb, var(--gold) 12%, transparent); }
body.country-ca .nav-tabs a { color: var(--muted); }

/* HEADER */
.c-hero {
  position: relative;
  z-index: 1;
  max-width: 1040px;
  margin: 40px auto 0;
  padding: 64px 48px 56px;
  text-align: center;
  border: 2px solid var(--frame);
  border-radius: 4px;
  outline: 1px solid color-mix(in srgb, var(--frame) 55%, transparent);
  outline-offset: -12px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--c-top) 55%, transparent), color-mix(in srgb, var(--c-bottom) 80%, transparent));
}

.c-crumb { font-size: 13px; color: var(--muted); margin-bottom: 18px; }
.c-crumb a { color: var(--muted); text-decoration: underline; text-underline-offset: 3px; }
.c-crumb a:hover { color: var(--text); }

.c-hero h1 {
  font-family: var(--display);
  font-size: clamp(32px, 5.6vw, 56px);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: 0.01em;
  color: var(--text);
  max-width: 820px;
  margin: 0 auto 20px;
  text-wrap: balance;
}

.c-hero p { font-size: 17px; color: var(--text); max-width: 620px; margin: 0 auto 14px; line-height: 1.7; }
.c-hero .c-scope { font-size: 14px; color: var(--muted); margin-bottom: 28px; }
.c-hero .cta-group { display: flex; gap: 16px; flex-wrap: wrap; justify-content: center; align-items: center; }

/* On a phone the header is the top of the app's own panel. */
@media (max-width: 640px) {
  .c-hero {
    margin: 0;
    padding: 56px 22px 48px;
    border: none;
    outline: none;
    border-radius: 0;
    background-size: 100% auto;
    background-position: top center;
    background-repeat: no-repeat;
  }
  .country-au .c-hero { background-image: linear-gradient(180deg, rgba(6,16,8,0.35) 0%, rgba(6,16,8,0.62) 55%, var(--c-bottom) 100%), url('panel-au.jpg'); }
  .country-nz .c-hero { background-image: linear-gradient(180deg, rgba(10,10,8,0.35) 0%, rgba(10,10,8,0.62) 55%, var(--c-bottom) 100%), url('panel-nz.jpg'); }
  .country-ca .c-hero { background-image: linear-gradient(180deg, rgba(234,228,216,0.35) 0%, rgba(234,228,216,0.7) 55%, var(--c-bottom) 100%), url('panel-ca.jpg'); }
  .country-uk .c-hero { background-image: linear-gradient(180deg, rgba(22,14,9,0.35) 0%, rgba(22,14,9,0.62) 55%, var(--c-bottom) 100%), url('panel-uk.jpg'); }
  .country-us .c-hero { background-image: linear-gradient(180deg, rgba(20,15,11,0.35) 0%, rgba(20,15,11,0.62) 55%, var(--c-bottom) 100%), url('panel-us.jpg'); }
  .country-eu .c-hero { background-image: linear-gradient(180deg, rgba(30,29,27,0.35) 0%, rgba(30,29,27,0.62) 55%, var(--c-bottom) 100%), url('panel-eu.jpg'); }
  .c-hero p { font-size: 16px; }
}

/* CONTENTS */
.c-toc {
  position: relative; z-index: 1;
  max-width: 760px; margin: 32px auto 0; padding: 0 32px;
  display: flex; flex-wrap: wrap; gap: 8px; justify-content: center;
}
.c-toc a {
  font-size: 14px; color: var(--text); text-decoration: none;
  padding: 6px 14px; border-radius: 100px;
  border: 1px solid var(--border); background: var(--surface);
}
.c-toc a:hover { border-color: var(--gold); }

/* ARTICLE */
.c-article { position: relative; z-index: 1; max-width: 760px; margin: 0 auto; padding: 24px 32px 16px; }
.c-section { padding-top: 56px; scroll-margin-top: calc(var(--nav-h) + 16px); }
.c-section > h2 {
  font-family: var(--display);
  font-size: clamp(26px, 4vw, 38px);
  font-weight: 700;
  letter-spacing: 0.01em;
  line-height: 1.15;
  color: var(--text);
  margin-bottom: 16px;
  text-wrap: balance;
}
.c-section h3 {
  font-family: var(--display);
  font-size: 21px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--text);
  margin: 28px 0 8px;
}
.c-section p, .c-section li { font-size: 16px; color: var(--text); line-height: 1.75; }
.c-section p + p { margin-top: 12px; }
.c-section ul { margin: 10px 0 0 20px; display: flex; flex-direction: column; gap: 6px; }
.c-section a { color: var(--gold); text-underline-offset: 3px; }
.c-note { font-size: 14px !important; color: var(--muted) !important; }

.c-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 22px 24px;
}
.c-card + .c-card { margin-top: 14px; }
.c-card h3 { margin-top: 0; }

.c-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr)); gap: 14px; margin-top: 18px; }
.c-grid .c-card + .c-card { margin-top: 0; }

/* SERIAL GRAPHICS
   Made-up serials set as text, never a picture of a note. Each one is checked
   against Picave's catalogue so it is a serial that could exist. */
.serial {
  display: inline-flex; flex-wrap: wrap; align-items: flex-start; gap: 4px;
  margin: 10px 0 6px;
  font-family: 'Barlow', sans-serif;
  font-variant-numeric: tabular-nums;
}
.serial span { display: inline-flex; flex-direction: column; align-items: center; }
.serial b {
  font-weight: 600; font-size: 22px; letter-spacing: 0.12em;
  color: var(--text);
  padding: 4px 8px 4px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface2);
}
.serial small { font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); margin-top: 4px; }
.serial .yr b { color: var(--muted); }
.serial mark { background: none; color: var(--hi); }

/* TABLES */
.c-table-wrap { overflow-x: auto; margin-top: 14px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); }
.c-table { width: 100%; border-collapse: collapse; font-size: 15px; font-variant-numeric: tabular-nums; }
.c-table th, .c-table td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--border); color: var(--text); vertical-align: top; }
.c-table th { font-family: var(--display); font-size: 14px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--gold); white-space: nowrap; }
.c-table tr:last-child td { border-bottom: none; }

/* STEPS, TAGS, THE FEATURE CARD */
.c-steps { margin: 0 0 0 22px; display: flex; flex-direction: column; gap: 10px; }
.c-steps li { font-size: 16px; color: var(--text); line-height: 1.7; }
.c-steps strong, .c-section li strong { color: var(--text); font-weight: 600; }
.c-tag {
  display: inline-block; vertical-align: middle; margin-left: 6px;
  font-family: 'Barlow', sans-serif; font-size: 11px; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase;
  padding: 2px 9px; border-radius: 100px;
  color: var(--gold); border: 1px solid color-mix(in srgb, var(--gold) 45%, transparent);
}
.c-feature { border-color: color-mix(in srgb, var(--frame) 60%, transparent); box-shadow: 0 0 36px color-mix(in srgb, var(--frame) 10%, transparent); }

/* FAQ */
.c-faq .c-card h3 { font-size: 19px; }

/* OTHER CURRENCIES */
.c-others { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.c-others a, .c-others span {
  font-size: 15px; text-decoration: none; color: var(--text);
  padding: 8px 16px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface);
}
.c-others a:hover { border-color: var(--gold); }

.c-cta { text-align: center; padding: 56px 32px 72px; position: relative; z-index: 1; }
.c-cta .cta-group { display: flex; gap: 16px; flex-wrap: wrap; justify-content: center; margin-top: 20px; }
.c-cta p { color: var(--muted); max-width: 520px; margin: 0 auto; }

.c-sources { font-size: 14px; color: var(--muted); }
.c-sources li { font-size: 14px !important; color: var(--muted) !important; }

@media (max-width: 420px) {
  .c-article, .c-toc { padding-left: 16px; padding-right: 16px; }
  .c-card { padding: 18px 16px; }
  .serial b { font-size: 19px; letter-spacing: 0.08em; }
  .c-cta { padding-left: 16px; padding-right: 16px; }
}

.footer-nav { flex-wrap: wrap; }
