/**
 * Piscinas Rodríguez - Base Global Styles
 */

/* ==========================================================================
   Google Fonts Import
   ========================================================================== */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500&family=Outfit:wght@400;600;700&display=swap');

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

* {
  margin: 0;
  padding: 0;
}

/* ==========================================================================
   Document & Body
   ========================================================================== */
html {
  font-size: 100%;
  scroll-behavior: smooth;
  /* Prevent scrollbar from causing layout shifts when appearing */
  scrollbar-gutter: stable;
}

body {
  font-family: var(--font-body);
  font-size: var(--fs-base);
  line-height: var(--lh-base);
  color: var(--color-text);
  background-color: var(--color-cream);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  text-rendering: optimizeSpeed;
}

/* ==========================================================================
   Typography
   ========================================================================== */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  line-height: var(--lh-heading);
  font-weight: 700;
  color: var(--color-ocean-deep);
  text-wrap: balance; /* Prevents typographic orphans in headings */
  letter-spacing: var(--tracking-tight);
}

h1 { font-size: var(--fs-4xl); }
h2 { font-size: var(--fs-3xl); }
h3 { font-size: var(--fs-2xl); }
h4 { font-size: var(--fs-xl); }
h5 { font-size: var(--fs-lg); }
h6 { font-size: var(--fs-base); }

/* Remove default margin on paragraphs for better control */
p {
  margin-bottom: var(--space-md);
  max-width: 65ch; /* Optimal reading width */
}

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

strong, b {
  font-weight: 600;
  color: var(--color-ocean-deep);
}

/* ==========================================================================
   Links & Interactive Elements
   ========================================================================== */
a {
  color: var(--color-azure);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover, 
a:focus-visible {
  color: var(--color-ocean-deep);
}

/* Focus styles for accessibility */
:focus-visible {
  outline: 2px solid var(--color-azure);
  outline-offset: 4px;
  border-radius: 2px;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
}

/* ==========================================================================
   Media Elements
   ========================================================================== */
img, 
picture, 
video, 
canvas, 
svg {
  display: block;
  max-width: 100%;
  height: auto;
}

/* Ensure SVGs scale properly */

/* ==========================================================================
   Utility Classes
   ========================================================================== */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ==========================================================================
   Selection Highlighting
   ========================================================================== */
::selection {
  background-color: var(--color-azure);
  color: var(--color-white);
}

/* ==========================================================================
   Custom Scrollbar (Webkit)
   ========================================================================== */
::-webkit-scrollbar {
  width: 10px;
}

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

::-webkit-scrollbar-thumb {
  background-color: var(--color-sand-dark);
  border-radius: var(--radius-full);
  border: 2px solid var(--color-cream); /* Creates padding effect */
}

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