/* =========================================================
   Bet Your Bud — Base Styles (Royal Badge)
   File: /assets/css/base.css
   Purpose: Reset/normalize, typography defaults, accessible focus,
            base elements (links, images, forms), utility helpers.
   Notes:
   - Updated to match the logo-driven "royal badge" look.
   - Keeps existing class helpers used by your pages (.h2, .h3, .lead, .p, .fine, .u-gradient).
   ========================================================= */

/* ---------- Modern reset / normalize-ish ---------- */
*,
*::before,
*::after{ box-sizing: border-box; }

html{
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce){
  html{ scroll-behavior: auto; }
}

body{
  margin: 0;
  min-height: 100dvh;

  /* Use themed page background when available (themes.css) */
  background: var(--bg-page, var(--c-bg));
  color: var(--c-text);

  font-family: var(--font-sans);
  font-size: var(--fs-16);
  line-height: var(--lh-normal);
  letter-spacing: var(--ls-normal);

  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;

  /* Subtle depth/noise-like feel without images */
  background-attachment: fixed;
}

/* Respect smooth scrolling on iOS */
@supports (-webkit-touch-callout: none){
  body{ background-attachment: scroll; }
}

img,
picture,
video,
canvas,
svg{
  display: block;
  max-width: 100%;
  height: auto;
}

input,
button,
textarea,
select{
  font: inherit;
  color: inherit;
}

button{
  cursor: pointer;
}

/* ---------- Links ---------- */
a{
  color: inherit;
  text-decoration: none;
  text-underline-offset: 0.22em;
  text-decoration-thickness: 2px;
}

a.link{
  color: var(--c-text);
  text-decoration: underline;
  text-decoration-color: rgba(245,200,76,0.55);
}

a.link:hover{
  text-decoration-color: rgba(245,200,76,0.9);
}

a:hover{
  text-decoration: none;
}

p{ margin: 0; }

/* ---------- Headings ---------- */
h1, h2, h3, h4, h5, h6{
  margin: 0;
  font-family: var(--font-display);
  letter-spacing: var(--ls-tight);
  color: var(--c-text);
}

/* ---------- Lists ---------- */
ul, ol{
  margin: 0;
  padding: 0;
  list-style: none;
}

/* ---------- HR ---------- */
hr{
  border: 0;
  border-top: var(--bw-1) solid var(--c-border);
  margin: var(--sp-24) 0;
}

/* ---------- Focus ---------- */
:focus{ outline: none; }

:focus-visible{
  box-shadow: var(--ring);
  border-radius: var(--r-12);
}

/* Better default focus on inputs/buttons that already have radii */
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible{
  box-shadow: var(--ring-strong);
}

/* ---------- Selection ---------- */
::selection{
  background: rgba(245,200,76,0.22);
  color: rgba(255,255,255,0.98);
}

/* ---------- Accessible skip link ---------- */
.skip-link{
  position: absolute;
  left: var(--sp-16);
  top: var(--sp-16);
  transform: translateY(-140%);

  background: rgba(255,255,255,0.94);
  color: rgba(0,0,0,0.90);

  padding: var(--sp-10) var(--sp-14);
  border-radius: var(--r-12);
  box-shadow: var(--sh-md);
  z-index: var(--z-modal);

  transition: transform var(--dur-2) var(--ease-out);
}

.skip-link:focus{
  transform: translateY(0);
}

/* ---------- Typography helpers used by pages ---------- */
.h2{
  font-size: clamp(var(--fs-28), 2.8vw, var(--fs-48));
  line-height: var(--lh-tight);
}

.h3{
  font-size: clamp(var(--fs-18), 1.6vw, var(--fs-24));
  line-height: var(--lh-snug);
}

.lead{
  margin-top: var(--sp-12);
  color: var(--c-text-2);
  font-size: clamp(var(--fs-16), 1.2vw, var(--fs-18));
  line-height: var(--lh-relaxed);
}

.p{
  margin-top: var(--sp-10);
  color: var(--c-text-2);
  line-height: var(--lh-relaxed);
}

.fine{
  font-size: var(--fs-13);
  color: var(--c-text-3);
  line-height: var(--lh-relaxed);
}

.hint{
  margin-top: var(--sp-8);
  font-size: var(--fs-13);
  color: var(--c-text-3);
  line-height: var(--lh-relaxed);
}

/* ---------- Utility ---------- */
.sr-only{
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

/* Gradient text utility used in hero title */
.u-gradient{
  background: var(--g-brand);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* Emphasis utility (optional) */
.u-gold{
  color: var(--c-primary);
}

/* Small inline code / emphasis */
code{
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 0.95em;
  background: rgba(255,255,255,0.08);
  padding: 0.12em 0.35em;
  border-radius: var(--r-10);
  border: var(--bw-1) solid var(--c-border);
}

/* ---------- Form element baseline (enhanced in components.css) ---------- */
input,
select,
textarea{
  background: transparent;
  border: none;
  outline: none;
}

label{ display: inline-block; }

/* ---------- Reduce tap highlight ---------- */
a, button{
  -webkit-tap-highlight-color: transparent;
}

/* ---------- Better button text rendering ---------- */
button, input, textarea, select{
  -webkit-font-smoothing: inherit;
}

/* ---------- Optional: improve readability on large screens ---------- */
@media (min-width: 1200px){
  body{ font-size: 1.02rem; }
}
