/* ==========================================================================
   Infrito Insights - Base
   Reset, body typography, links, focus, skip link, layout shell, WordPress
   core classes and reduced motion. Element selectors stay generic; every
   designed component is styled by its inf- class in components.css.
   ========================================================================== */

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

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

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--inf-paper);
  color: var(--inf-ink);
  font-family: var(--inf-font-body);
  font-size: var(--inf-text-base);
  font-weight: var(--inf-weight-regular);
  line-height: var(--inf-leading-normal);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  margin: 0;
  font-family: var(--inf-font-body);
  font-weight: var(--inf-weight-bold);
  line-height: var(--inf-leading-snug);
  text-wrap: balance;
}

p,
figure,
blockquote,
dl,
dd {
  margin: 0;
}

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

img,
video {
  height: auto;
}

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

button {
  cursor: pointer;
}

[hidden] {
  display: none;
}

/* ---- Links ----
   Designed links (anything with a class) inherit their colour like the
   concept; plain links (post content, widgets, notes, plugin output) stay
   recognisable: blue and underlined. */
a {
  color: inherit;
  text-decoration: none;
}

a:not([class]) {
  color: var(--inf-blue);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

a:not([class]):hover {
  color: var(--inf-orange-strong);
}

/* ---- Focus ---- */
:focus-visible {
  outline: var(--inf-focus-width) solid var(--inf-focus);
  outline-offset: var(--inf-focus-offset);
}

/* Programmatic focus targets (main, headings) never show a ring. */
[tabindex="-1"]:focus {
  outline: none;
}

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

.screen-reader-text:focus {
  width: auto;
  height: auto;
  margin: 0;
  overflow: visible;
  clip-path: none;
  white-space: normal;
}

.inf-skip-link:focus {
  position: fixed;
  top: var(--inf-space-4);
  left: var(--inf-space-4);
  z-index: var(--inf-z-skip);
  padding: var(--inf-space-3) var(--inf-space-4);
  background: var(--inf-surface);
  color: var(--inf-blue);
  border: 1px solid var(--inf-line);
  border-radius: var(--inf-radius-sm);
  box-shadow: var(--inf-shadow-md);
  font-size: var(--inf-text-sm);
  font-weight: var(--inf-weight-bold);
  text-decoration: none;
}

/* ---- Layout shell ---- */
.inf-shell {
  width: 100%;
  max-width: var(--inf-shell-max);
  margin-inline: auto;
  padding-inline: var(--inf-gutter);
}

.inf-main {
  display: block;
  flex: 1 0 auto;
}

/* ---- Icons (markup from infrito_icon()) ---- */
.inf-icon {
  display: inline-block;
  flex: none;
  width: 16px;
  height: 16px;
  vertical-align: middle;
  overflow: visible;
}

.inf-icon-sprite {
  display: none;
}

/* ---- WordPress core classes ---- */
.alignleft {
  float: left;
  margin: 0.3em var(--inf-space-6) var(--inf-space-4) 0;
}

.alignright {
  float: right;
  margin: 0.3em 0 var(--inf-space-4) var(--inf-space-6);
}

.aligncenter {
  display: block;
  clear: both;
  margin-inline: auto;
}

.alignwide,
.alignfull {
  clear: both;
}

.alignfull {
  width: auto;
  max-width: none;
}

.wp-caption {
  max-width: 100%;
}

.wp-caption img {
  margin-inline: auto;
}

.wp-caption-text,
.wp-element-caption,
.gallery-caption {
  margin-top: var(--inf-space-2);
  color: var(--inf-quiet);
  font-size: var(--inf-text-sm);
  line-height: 1.45;
}

.gallery-caption {
  display: block;
}

/* Classes WordPress requires themes to support; the design gives them no
   special treatment (min-width: 0 only keeps them safe as grid/flex items). */
.sticky,
.bypostauthor {
  min-width: 0;
}

@media (max-width: 540px) {
  .alignleft,
  .alignright {
    float: none;
    margin-inline: 0;
  }
}

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

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

/* ---- Print ---- */
@media print {
  body {
    background: #fff;
  }

  .inf-header__actions,
  .inf-mobile-nav,
  .inf-topics,
  .inf-cta-band,
  .inf-footer__art,
  .inf-search-dialog {
    display: none;
  }
}
