/* ==========================================================================
   FREEDOM KITCHENS & BATHS — Base Styles & Reset
   css/base.css
   ========================================================================== */

/* --------------------------------------------------------------------------
   MODERN CSS RESET
   -------------------------------------------------------------------------- */

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

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

body {
  font-family: var(--font-body);
  font-size: var(--font-size-body);
  font-weight: var(--font-weight-regular);
  line-height: var(--line-height-normal);
  color: var(--color-text);
  background-color: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

/* Remove list styles when list items have a role attribute */
ul[role='list'],
ol[role='list'] {
  list-style: none;
}

/* --------------------------------------------------------------------------
   TYPOGRAPHY — Headings
   -------------------------------------------------------------------------- */

h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--font-heading);
  font-weight: var(--font-weight-bold);
  line-height: var(--line-height-tight);
  color: var(--color-text);
  letter-spacing: var(--letter-spacing-tight);
}

h1 { font-size: var(--font-size-h1); }
h2 { font-size: var(--font-size-h2); }
h3 { font-size: var(--font-size-h3); }
h4 { font-size: var(--font-size-h4); }

h5,
h6 {
  font-size: var(--font-size-body);
  font-weight: var(--font-weight-semibold);
}

/* --------------------------------------------------------------------------
   TYPOGRAPHY — Body & Inline
   -------------------------------------------------------------------------- */

p {
  max-width: 70ch; /* Comfortable reading line length */
  color: var(--color-text);
}

p + p {
  margin-top: var(--space-sm);
}

strong,
b {
  font-weight: var(--font-weight-semibold);
}

em,
i {
  font-style: italic;
}

small {
  font-size: var(--font-size-small);
}

/* --------------------------------------------------------------------------
   LINKS
   -------------------------------------------------------------------------- */

a {
  color: var(--color-primary);
  text-decoration: none;
  transition: color var(--transition);
}

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

a:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}

/* --------------------------------------------------------------------------
   IMAGES & MEDIA
   -------------------------------------------------------------------------- */

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

img {
  height: auto;
}

/* --------------------------------------------------------------------------
   FORM ELEMENTS — Baseline Reset
   -------------------------------------------------------------------------- */

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

button {
  border: none;
  background: none;
  cursor: pointer;
}

/* --------------------------------------------------------------------------
   MISC RESETS
   -------------------------------------------------------------------------- */

table {
  border-collapse: collapse;
  border-spacing: 0;
}

hr {
  border: none;
  border-top: 1px solid var(--color-border);
  margin: var(--space-lg) 0;
}

blockquote {
  border-left: 4px solid var(--color-accent);
  padding-left: var(--space-md);
  margin: var(--space-md) 0;
  font-style: italic;
  color: var(--color-text-muted);
}

/* --------------------------------------------------------------------------
   TEXT SELECTION
   -------------------------------------------------------------------------- */

::selection {
  background-color: var(--color-primary);
  color: var(--color-text-inverse);
}

::-moz-selection {
  background-color: var(--color-primary);
  color: var(--color-text-inverse);
}

/* --------------------------------------------------------------------------
   SCROLLBAR STYLING (WebKit)
   -------------------------------------------------------------------------- */

::-webkit-scrollbar {
  width: 8px;
}

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

::-webkit-scrollbar-thumb {
  background: var(--color-text-muted);
  border-radius: var(--radius-full);
}

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

/* --------------------------------------------------------------------------
   LAYOUT UTILITIES
   -------------------------------------------------------------------------- */

/* Centered content wrapper */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin-inline: auto;
  padding-inline: var(--container-padding);
}

/* Generous section vertical rhythm */
.section-padding {
  padding-block: var(--space-xl);
}

.section-padding-sm {
  padding-block: var(--space-lg);
}

/* --------------------------------------------------------------------------
   ACCESSIBILITY UTILITIES
   -------------------------------------------------------------------------- */

/* Screen-reader only — visually hidden but accessible to AT */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Focus visible styles — skip to main content link */
.skip-link {
  position: absolute;
  top: -100%;
  left: var(--space-sm);
  background: var(--color-accent);
  color: var(--color-text);
  padding: var(--space-xs) var(--space-sm);
  border-radius: var(--radius-md);
  font-weight: var(--font-weight-semibold);
  z-index: var(--z-toast);
  transition: top var(--transition-fast);
}

.skip-link:focus {
  top: var(--space-sm);
}

/* --------------------------------------------------------------------------
   LEGAL CONTENT (privacy.html, terms.html)
   -------------------------------------------------------------------------- */

.legal-content {
  overflow-wrap: break-word;
  word-wrap: break-word;
  word-break: break-word;
}

.legal-content h2 {
  margin-top: 2rem;
  margin-bottom: 0.75rem;
  font-size: clamp(1.25rem, 4vw, 1.75rem);
}

.legal-content h3 {
  margin-top: 1.5rem;
  margin-bottom: 0.5rem;
}

.legal-content ul,
.legal-content ol {
  padding-left: 1.5rem;
  margin-bottom: 1rem;
}

.legal-content li {
  margin-bottom: 0.5rem;
  line-height: 1.7;
}

@media (max-width: 480px) {
  .legal-content {
    font-size: 0.95rem;
  }

  .legal-content h2 {
    font-size: clamp(1.125rem, 5vw, 1.5rem);
  }
}


/* --------------------------------------------------------------------------
   PRINT STYLES
   -------------------------------------------------------------------------- */

@media print {
  *,
  *::before,
  *::after {
    background: transparent !important;
    color: #000 !important;
    box-shadow: none !important;
    text-shadow: none !important;
  }

  a,
  a:visited {
    text-decoration: underline;
  }

  img {
    page-break-inside: avoid;
  }

  h2,
  h3 {
    page-break-after: avoid;
  }
}
