/**
 * @file
 * Base resets and utilities for Gutenberg Base theme.
 */

/* --- Box sizing --- */

*,
*::before,
*::after {
  box-sizing: border-box;
}

/* --- Document --- */

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

body {
  margin: 0;
  overflow-wrap: break-word;
  word-wrap: break-word;
}

/* --- Element margin resets --- */

/*
 * Reset default browser margins on block-level elements. Spacing between
 * Gutenberg blocks is handled by block-gap (see structural.css * + *).
 * Without these resets, browser defaults double up with block-gap.
 */
p,
h1,
h2,
h3,
h4,
h5,
h6,
ul,
ol,
figure,
blockquote,
pre,
hr,
dl,
address {
  margin: 0;
  margin-block: 0;
  margin-inline: 0;
}

/* --- Focus styles --- */

:focus-visible {
  outline: 2px solid var(--wp--preset--color--primary, #0073aa);
  outline-offset: 2px;
}

/* --- Visually hidden (accessible) --- */

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

.visually-hidden.focusable:active,
.visually-hidden.focusable:focus {
  position: static !important;
  width: auto;
  height: auto;
  padding: 0.5em 1em;
  margin: 0;
  overflow: visible;
  clip: auto;
  clip-path: none;
  white-space: normal;
  background: var(--wp--preset--color--primary, #0073aa);
  color: #fff;
  z-index: 1000;
}

/* --- Skip link --- */

.skip-link {
  left: 0;
  top: 0;
  z-index: 10000;
}
