/* ==========================================================================
   ClearMedUk - Base Styles, Reset, Typography & Layout Utilities
   ========================================================================== */

/* ==========================================================================
   1. CSS Reset & Global Base
   ========================================================================== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-size-adjust: 100%;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-main);
  color: var(--text-main);
  font-size: var(--fs-body, 0.875rem);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  position: relative;
  width: 100%;
  transition: background-color var(--transition-smooth), color var(--transition-smooth);
}

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

a {
  color: inherit;
  text-decoration: none;
  transition: color var(--transition-fast);
  -webkit-tap-highlight-color: transparent;
}

button, input, select, textarea {
  font: inherit;
  color: inherit;
  -webkit-tap-highlight-color: transparent;
}

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

ul, ol {
  list-style: none;
}

/* ==========================================================================
   2. Fluid Typography & Headings
   ========================================================================== */
h1, h2, h3, h4, .font-display {
  font-family: var(--font-display);
  font-weight: 500;
  letter-spacing: -0.015em;
  color: var(--text-main);
  line-height: 1.2;
  word-break: break-word;
  overflow-wrap: break-word;
}

h1 { font-size: var(--fs-h1, clamp(1.65rem, 2.8vw + 0.45rem, 2.65rem)); }
h2 { font-size: var(--fs-h2, clamp(1.35rem, 2vw + 0.35rem, 1.95rem)); }
h3 { font-size: var(--fs-h3, clamp(1.05rem, 1.2vw + 0.25rem, 1.3rem)); }
h4 { font-size: var(--fs-h4, clamp(0.95rem, 0.8vw + 0.2rem, 1.1rem)); font-weight: 600; }

p {
  color: var(--text-muted);
  font-size: var(--fs-body, clamp(0.875rem, 0.25vw + 0.8rem, 0.95rem));
}

.text-gradient {
  background: var(--brand-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  display: inline;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: var(--text-xs, 0.75rem);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--primary-color);
}

.eyebrow::before {
  content: "";
  display: inline-block;
  width: 1.5rem;
  height: 1.5px;
  background-color: var(--primary-color);
}

.eyebrow.centered { justify-content: center; }
.eyebrow.centered::before { display: none; }

/* ==========================================================================
   3. Layout Containers & Section Utilities
   ========================================================================== */
.container {
  width: 100%;
  max-width: 1240px;
  margin-left: auto;
  margin-right: auto;
  padding-left: 1.5rem;
  padding-right: 1.5rem;
}

.container-narrow { max-width: 860px; }
.container-wide { max-width: 1380px; }

.section-padding {
  padding-top: clamp(3.5rem, 5vw + 1rem, 5.5rem);
  padding-bottom: clamp(3.5rem, 5vw + 1rem, 5.5rem);
}

.section-padding-sm {
  padding-top: clamp(2.5rem, 3.5vw + 0.5rem, 3.5rem);
  padding-bottom: clamp(2.5rem, 3.5vw + 0.5rem, 3.5rem);
}

.section-header {
  max-width: 680px;
  margin-left: auto;
  margin-right: auto;
  text-align: center;
  margin-bottom: clamp(2.25rem, 4vw, 3.5rem);
}

.section-header p {
  margin-top: 0.875rem;
}

.bg-secondary-section {
  background-color: var(--bg-secondary);
}

.bg-card-section {
  background-color: var(--bg-card);
}

/* Homepage section visibility (ACF desktop / mobile toggles) */
.cm-hide-all {
  display: none !important;
}

@media (min-width: 769px) {
  .cm-hide-desktop {
    display: none !important;
  }
}

@media (max-width: 768px) {
  .cm-hide-mobile {
    display: none !important;
  }
}
