/* =====================================================
   NAMIREMBE GUESTHOUSE -- CSS RESET & NORMALIZE
   ===================================================== */

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

/* Prevent font size inflation on iOS */
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  /* Offset anchors below the sticky header (80px header + 8px breathing room) */
  scroll-padding-top: 88px;
  font-size: 16px;
  /* Lock browser chrome (inputs, scrollbars) to light mode */
  color-scheme: light;
}

/* Core body defaults — visible immediately, no JS required */
body {
  min-height: 100vh;
  line-height: var(--leading-normal);
  font-family: var(--font-body);
  font-size: var(--text-base);
  color: var(--color-earth);
  background-color: var(--bg-body);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
  /* Body is visible from the start. Scroll animations are
   * progressive enhancements applied by animations.js. */
  opacity: 1;
}

/* Remove default list styles */
ul,
ol {
  list-style: none;
}

/* Reset link styles */
a {
  color: inherit;
  text-decoration: none;
}

/* Makes media easier to work with */
img,
picture,
video,
canvas,
svg {
  display: block;
  max-width: 100%;
}

/* Avoid text overflows */
p,
h1,
h2,
h3,
h4,
h5,
h6 {
  overflow-wrap: break-word;
}

/* Remove built-in form typography */
input,
button,
textarea,
select {
  font: inherit;
  color: inherit;
}

/* Remove all animations, transitions and smooth scroll
   for people that prefer not to see them */
@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;
  }
}

/* Heading reset */
h1, h2, h3, h4, h5, h6 {
  font-weight: var(--weight-normal);
}

/* Table reset */
table {
  border-collapse: collapse;
  border-spacing: 0;
}

/* Button reset */
button {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
}

/* Fieldset reset */
fieldset {
  border: none;
}

/* Remove number spinners */
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
  -webkit-appearance: none;
  appearance: none;
}

/* Remove search cancel button */
input[type="search"]::-webkit-search-cancel-button,
input[type="search"]::-webkit-search-decoration {
  -webkit-appearance: none;
  appearance: none;
}

/* Remove input autofill yellow background */
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
textarea:-webkit-autofill,
select:-webkit-autofill {
  -webkit-box-shadow: 0 0 0 1000px var(--color-ivory-warm) inset;
  -webkit-text-fill-color: var(--color-earth);
  transition: background-color 5000s ease-in-out 0s;
}

/* Scrollbar customization */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--color-ivory-dark);
}

::-webkit-scrollbar-thumb {
  background: var(--color-ochre);
  border-radius: var(--radius-full);
  border: 2px solid var(--color-ivory-dark);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--color-ochre-dark);
}

/* Selection color */
::selection {
  background-color: rgba(193, 127, 36, 0.25);
  color: var(--color-earth);
}

/* Focus visible ring */
:focus-visible {
  outline: 2px solid var(--color-ochre);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}

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

/* Lazy load images — always visible by default.
   JS (initLazyImages) only adds the fade transition for images
   that are genuinely still loading when the script runs.
   Images that are already complete are never hidden. */
img[loading="lazy"] {
  opacity: 1;
  transition: opacity 0.4s var(--ease-out);
}

/* JS adds .js-lazy only to images that were not yet loaded */
img[loading="lazy"].js-lazy:not(.loaded) {
  opacity: 0;
}

img.loaded,
img[loading="lazy"].loaded {
  opacity: 1;
}



