/* ============================================================
   ONE4ALL — Base Styles
   Minimal reset + semantic defaults using design tokens.
   No class-based styling here — only element selectors.
   ============================================================ */

/* ----------------------------------------------------------
   Box Model & Reset
---------------------------------------------------------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  font-size: 100%; /* Respect user browser preference — do NOT set px */
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  padding: 0;
  font-family: var(--o4all-font-body);
  font-size: var(--o4all-type-body);
  line-height: var(--o4all-leading-body);
  color: var(--o4all-text-primary);
  background-color: var(--o4all-bg-page);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ----------------------------------------------------------
   Headings
   Font families + weights + letter spacing from design system.
---------------------------------------------------------- */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--o4all-font-heading);
  font-weight: 700;
  line-height: var(--o4all-leading-heading);
  letter-spacing: var(--o4all-tracking-heading);
  color: var(--o4all-text-primary);
  margin-top: 0;
  margin-bottom: 0.5em;
}

h1 { font-size: var(--o4all-type-h1); }
h2 { font-size: var(--o4all-type-h2); }
h3 { font-size: var(--o4all-type-h3); font-weight: 600; }
h4 { font-size: var(--o4all-type-h4); font-weight: 600; }
h5 { font-size: var(--o4all-type-body-lg); font-weight: 600; }
h6 { font-size: var(--o4all-type-body); font-weight: 600; }

/* ----------------------------------------------------------
   Body Text
---------------------------------------------------------- */
p {
  margin-top: 0;
  margin-bottom: 1em;
}

p:last-child {
  margin-bottom: 0;
}

/* ----------------------------------------------------------
   Links
---------------------------------------------------------- */
a {
  color: var(--o4all-color-steel);
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color var(--o4all-transition);
}

a:hover,
a:focus-visible {
  color: var(--o4all-color-accent);
  text-decoration: none;
}

/* Visible focus for keyboard users — required for accessibility */
:focus-visible {
  outline: 3px solid var(--o4all-color-accent);
  outline-offset: 3px;
  border-radius: var(--o4all-radius-sm);
}

/* Remove default focus outline for mouse users only */
:focus:not(:focus-visible) {
  outline: none;
}

/* ----------------------------------------------------------
   Images & Media
---------------------------------------------------------- */
img,
picture,
video,
canvas,
svg {
  display: block;
  max-width: 100%;
}

img {
  height: auto;
}

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

/* Reset list style for nav/utility lists — content lists keep defaults */
nav ul,
nav ol {
  list-style: none;
}

/* ----------------------------------------------------------
   Forms
---------------------------------------------------------- */
input,
button,
textarea,
select {
  font: inherit;
}

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

/* ----------------------------------------------------------
   Address
---------------------------------------------------------- */
address {
  font-style: normal;
}

/* ----------------------------------------------------------
   Horizontal Rule
---------------------------------------------------------- */
hr {
  border: none;
  border-top: 1px solid var(--o4all-border);
  margin: 2em 0;
}

/* ----------------------------------------------------------
   Accessibility — Screen Reader Utilities
---------------------------------------------------------- */
.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 {
  clip: auto !important;
  clip-path: none;
  display: block;
  font-size: var(--o4all-type-body);
  font-weight: 700;
  height: auto;
  left: 5px;
  padding: 15px 23px 14px;
  top: 5px;
  width: auto;
  z-index: var(--o4all-z-toast);
  background: var(--o4all-bg-white);
  color: var(--o4all-text-primary);
  border-radius: var(--o4all-radius-btn);
  box-shadow: var(--o4all-shadow-nav);
}

/* ----------------------------------------------------------
   WordPress Core Alignment Helpers (used by blocks/editor)
---------------------------------------------------------- */
.alignleft  { float: left;  margin: 0 1.5em 1em 0; }
.alignright { float: right; margin: 0 0 1em 1.5em; }
.aligncenter { text-align: center; margin: 0 auto 1em; }

/* Clear floats */
.clearfix::after {
  content: '';
  display: table;
  clear: both;
}

/* ----------------------------------------------------------
   WordPress Required Body Classes
   (WordPress adds these classes to body automatically)
---------------------------------------------------------- */
.admin-bar .site-header {
  top: 32px;
}

@media (max-width: 782px) {
  .admin-bar .site-header {
    top: 46px;
  }
}
