/* ============================================================================
 * Base elements — default styling for native HTML elements.
 * Anything not covered by reset or typography lives here.
 * ========================================================================== */

main {
  display: block;
  min-height: 50vh;
}

section {
  position: relative;
}

img {
  font-style: italic;        /* visible alt text on broken images */
  background-repeat: no-repeat;
  background-size: cover;
  shape-margin: 1rem;
}

iframe {
  max-width: 100%;
  border: 0;
}

figure {
  margin: 0;
}

figcaption {
  font-size: var(--wb-text-sm);
  color: var(--wb-color-text-muted);
  margin-top: var(--wb-space-2);
}

/* Forms — neutral baseline; full styling deferred to Phase 2 component layer */
input,
textarea,
select {
  width: 100%;
  padding: var(--wb-space-3) var(--wb-space-4);
  background: var(--wb-color-surface);
  border: var(--wb-border-width) solid var(--wb-color-border);
  border-radius: var(--wb-radius-md);
  color: var(--wb-color-ink);
  transition: border-color var(--wb-duration-base) var(--wb-ease),
              box-shadow var(--wb-duration-base) var(--wb-ease);
}

input::placeholder,
textarea::placeholder {
  color: var(--wb-color-text-soft);
}

input:focus,
textarea:focus,
select:focus {
  outline: 0;
  border-color: var(--wb-color-brand);
  box-shadow: 0 0 0 4px var(--wb-color-focus-ring);
}

label {
  display: inline-block;
  font-size: var(--wb-text-sm);
  font-weight: var(--wb-fw-medium);
  color: var(--wb-color-ink-2);
  margin-bottom: var(--wb-space-2);
}

/* Tables */
table {
  width: 100%;
  font-size: var(--wb-text-sm);
}

th, td {
  padding: var(--wb-space-3) var(--wb-space-4);
  text-align: left;
  border-bottom: var(--wb-border-width) solid var(--wb-color-border-soft);
}

th {
  font-weight: var(--wb-fw-semibold);
  color: var(--wb-color-ink);
  background: var(--wb-color-bg-soft);
}

/* WordPress core compatibility */
.alignwide   { max-width: var(--wb-container-xl); margin-inline: auto; }
.alignfull   { width: 100%; }
.alignleft   { float: left; margin-right: var(--wb-space-5); }
.alignright  { float: right; margin-left: var(--wb-space-5); }
.aligncenter { display: block; margin-inline: auto; }

.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(--wb-color-surface);
  clip: auto !important;
  clip-path: none;
  color: var(--wb-color-ink);
  display: block;
  font-size: 0.875rem;
  height: auto;
  left: 5px;
  line-height: normal;
  padding: 15px 23px 14px;
  text-decoration: none;
  top: 5px;
  width: auto;
  z-index: 100000;
}

/* Skip link — off-screen by default, revealed on keyboard focus.
 * Self-contained (no .wb-sr-only) so :focus reliably brings it back. */
.wb-skip-link {
  position: absolute;
  top: -100vh;
  left: var(--wb-space-2);
  z-index: var(--wb-z-toast);
  background: var(--wb-color-ink);
  color: var(--wb-color-white);
  padding: var(--wb-space-3) var(--wb-space-4);
  border-radius: var(--wb-radius-md);
  text-decoration: none;
  transition: top var(--wb-duration-fast) var(--wb-ease);
}
.wb-skip-link:focus,
.wb-skip-link:focus-visible {
  top: var(--wb-space-2);
  color: var(--wb-color-white);
  outline: var(--wb-focus-width) solid var(--wb-color-focus-ring);
  outline-offset: 2px;
}

/* Selection / focus polish on interactive elements */
:focus-visible {
  outline: var(--wb-focus-width) solid var(--wb-color-focus-ring);
  outline-offset: 2px;
}
