/* ==========================================================================
   Base Styles — Baiona Natura
   Reset + foundational element styling using design tokens.
   ========================================================================== */

/* -- Reset ------------------------------------------------------------------ */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--bn-font-sans);
  font-size: var(--bn-text-base);
  line-height: var(--bn-leading-normal);
  color: var(--bn-color-text);
  background-color: var(--bn-color-bg);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

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

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

a {
  color: var(--bn-color-link);
  text-decoration: none;
  transition: color var(--bn-transition-fast);
}

a:hover {
  color: var(--bn-color-link-hover);
}

ul,
ol {
  list-style: none;
}

/* -- Typography ------------------------------------------------------------- */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--bn-font-heading);
  color: var(--bn-color-text-heading);
  line-height: var(--bn-leading-tight);
  letter-spacing: var(--bn-tracking-tight);
  font-weight: var(--bn-font-weight-bold);
  text-wrap: balance;
}

h1 { font-size: var(--bn-text-4xl); }
h2 { font-size: var(--bn-text-3xl); }
h3 { font-size: var(--bn-text-2xl); }
h4 { font-size: var(--bn-text-xl); }
h5 { font-size: var(--bn-text-lg); }
h6 { font-size: var(--bn-text-base); }

@media (min-width: 768px) {
  h1 { font-size: var(--bn-text-5xl); }
  h2 { font-size: var(--bn-text-4xl); }
  h3 { font-size: var(--bn-text-3xl); }
}

p {
  margin-bottom: var(--bn-space-4);
  line-height: var(--bn-leading-loose);
}

blockquote {
  border-left: 4px solid var(--bn-color-primary);
  padding: var(--bn-space-4) var(--bn-space-6);
  margin: var(--bn-space-6) 0;
  background: var(--bn-color-bg-muted);
  border-radius: 0 var(--bn-radius-md) var(--bn-radius-md) 0;
  font-style: italic;
  color: var(--bn-color-neutral-700);
}

code, pre {
  font-family: var(--bn-font-mono);
  font-size: var(--bn-text-sm);
}

pre {
  background: var(--bn-color-neutral-900);
  color: var(--bn-color-neutral-100);
  padding: var(--bn-space-6);
  border-radius: var(--bn-radius-lg);
  overflow-x: auto;
}

hr {
  border: none;
  border-top: var(--bn-border-width) solid var(--bn-color-border);
  margin: var(--bn-space-8) 0;
}

/* -- Layout Primitives ------------------------------------------------------ */
.bn-container {
  width: 100%;
  max-width: var(--bn-container-xl);
  margin-inline: auto;
  padding-inline: var(--bn-space-4);
}

@media (min-width: 768px) {
  .bn-container {
    padding-inline: var(--bn-space-6);
  }
}

@media (min-width: 1024px) {
  .bn-container {
    padding-inline: var(--bn-space-8);
  }
}

.bn-container--narrow {
  max-width: var(--bn-container-md);
}

.bn-container--wide {
  max-width: var(--bn-container-2xl);
}

.bn-section {
  padding-block: var(--bn-space-16);
}

.bn-section--alt {
  background-color: var(--bn-color-bg-alt);
}

.bn-section--muted {
  background-color: var(--bn-color-bg-muted);
}

.bn-section--dark {
  background-color: var(--bn-color-green-900);
  color: var(--bn-color-text-inverse);
}

.bn-section--dark h1,
.bn-section--dark h2,
.bn-section--dark h3,
.bn-section--dark h4 {
  color: var(--bn-color-text-inverse);
}

/* -- Grid System ------------------------------------------------------------ */
.bn-grid {
  display: grid;
  gap: var(--bn-space-6);
}

.bn-grid--2 { grid-template-columns: repeat(1, 1fr); }
.bn-grid--3 { grid-template-columns: repeat(1, 1fr); }
.bn-grid--4 { grid-template-columns: repeat(1, 1fr); }

@media (min-width: 640px) {
  .bn-grid--2 { grid-template-columns: repeat(2, 1fr); }
  .bn-grid--3 { grid-template-columns: repeat(2, 1fr); }
  .bn-grid--4 { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 1024px) {
  .bn-grid--3 { grid-template-columns: repeat(3, 1fr); }
  .bn-grid--4 { grid-template-columns: repeat(4, 1fr); }
}

/* -- Flex Utilities --------------------------------------------------------- */
.bn-flex {
  display: flex;
}

.bn-flex--center {
  align-items: center;
  justify-content: center;
}

.bn-flex--between {
  align-items: center;
  justify-content: space-between;
}

.bn-flex--col {
  flex-direction: column;
}

.bn-flex--wrap {
  flex-wrap: wrap;
}

.bn-gap-2 { gap: var(--bn-space-2); }
.bn-gap-4 { gap: var(--bn-space-4); }
.bn-gap-6 { gap: var(--bn-space-6); }
.bn-gap-8 { gap: var(--bn-space-8); }

/* -- Text Utilities --------------------------------------------------------- */
.bn-text-center { text-align: center; }
.bn-text-muted  { color: var(--bn-color-text-muted); }
.bn-text-sm     { font-size: var(--bn-text-sm); }
.bn-text-lg     { font-size: var(--bn-text-lg); }

.bn-section-header {
  text-align: center;
  max-width: 720px;
  margin-inline: auto;
  margin-bottom: var(--bn-space-12);
}

.bn-section-header h2 {
  margin-bottom: var(--bn-space-4);
}

.bn-section-header p {
  color: var(--bn-color-text-muted);
  font-size: var(--bn-text-lg);
}

.bn-section-header .bn-badge {
  margin-bottom: var(--bn-space-4);
  display: inline-block;
}

/* -- Accessibility ---------------------------------------------------------- */
.screen-reader-text {
  border: 0;
  clip: rect(1px, 1px, 1px, 1px);
  clip-path: inset(50%);
  height: 1px;
  margin: -1px;
  overflow: hidden;
  padding: 0;
  position: absolute;
  width: 1px;
  word-wrap: normal !important;
}

.screen-reader-text:focus {
  background-color: var(--bn-color-surface);
  clip: auto;
  clip-path: none;
  color: var(--bn-color-primary);
  display: block;
  font-size: var(--bn-text-sm);
  font-weight: var(--bn-font-weight-bold);
  height: auto;
  left: var(--bn-space-2);
  padding: var(--bn-space-3) var(--bn-space-6);
  top: var(--bn-space-2);
  width: auto;
  z-index: var(--bn-z-toast);
  border-radius: var(--bn-radius-md);
  box-shadow: var(--bn-shadow-lg);
}

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