/* ============================================================================
   Hanamaru.ai rebuild — base styles
   Reset, document defaults, typography, links, focus, utilities.
   Requires: tokens.css loaded first.
   ============================================================================ */

/* ----------------------------------------------------------------------------
   1. Reset
   ---------------------------------------------------------------------------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

* {
  margin: 0;
  padding: 0;
}

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

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

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

button {
  background: none;
  border: 0;
  cursor: pointer;
}

ul,
ol {
  list-style-position: inside;
}

/* Nav-style lists opt out of bullets via class (components.css). */

/* ----------------------------------------------------------------------------
   2. Body defaults (spec §1: Manrope 16px, --sumi on --white)
   ---------------------------------------------------------------------------- */
body {
  min-height: 100vh;
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.5;
  color: var(--sumi);
  background: var(--white);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* ----------------------------------------------------------------------------
   3. Headings (pine = primary heading color, spec §1; pages size them
      precisely via classes — these are sensible fallbacks)
   ---------------------------------------------------------------------------- */
h1,
h2,
h3,
h4,
h5,
h6 {
  color: var(--pine);
  line-height: 1.25;
  overflow-wrap: break-word;
}

h1 {
  font-size: 26px;
  font-weight: 800;
}

h2 {
  font-size: 22px;
  font-weight: 700;
}

h3 {
  font-size: 18px;
  font-weight: 700;
}

h4,
h5,
h6 {
  font-size: 16px;
  font-weight: 700;
}

/* ----------------------------------------------------------------------------
   4. Links — vermilion accent (spec §1). In-flow prose links get underlines
      via .post-body / .legal-body (pages.css); nav and card links stay clean.
   ---------------------------------------------------------------------------- */
a {
  color: var(--vermilion);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* ----------------------------------------------------------------------------
   5. Focus styles — visible keyboard focus everywhere
   ---------------------------------------------------------------------------- */
:focus {
  outline: none;
}

:focus-visible {
  outline: 2px solid var(--indigo);
  outline-offset: 2px;
  border-radius: 2px;
}

/* ----------------------------------------------------------------------------
   6. Utilities
   ---------------------------------------------------------------------------- */

/* Screen-reader-only content */
.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  border: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

/* Generic centered wrapper */
.container {
  width: 100%;
  max-width: var(--content-max);
  margin-inline: auto;
  padding-inline: var(--space-5);
}

/* Multi-line ellipsis clamps (used by cards, ranked rows, sidebar trending) */
.clamp-2,
.clamp-3 {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.clamp-2 {
  -webkit-line-clamp: 2;
}

.clamp-3 {
  -webkit-line-clamp: 3;
}

/* ----------------------------------------------------------------------------
   7. Reduced motion
   ---------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}

/* The [hidden] attribute must always win — author display rules on classes
   (e.g. .btn-pill { display:inline-flex }) otherwise override the UA default. */
[hidden] {
  display: none !important;
}
