/* ==========================================================================
   AmenityTech Design System & Global Styles
   ========================================================================== */

/* Google Fonts & Font Awesome are loaded via <link> tags in HTML <head> for performance.
   Do NOT add @import here — it causes duplicate downloads and waterfall delays. */

:root {
  /* Brand Colors */
  --color-primary: #7EA449;
  --color-primary-dark: #4A7B03;
  --color-primary-light: #6EB30A;
  --color-accent-lime: #97FF00;
  --color-accent-purple: #8762FF;
  --color-accent-green: #99BE47;
  --color-blue: #0052B4;
  --color-dark: #000000;
  --color-text: #212121;
  --color-text-muted: #6D6D6D;
  --color-light-bg: #F9F9F9;
  --color-border: #DBDBDB;
  --color-white: #FFFFFF;

  /* Typography */
  --font-primary: 'DM Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-secondary: 'Open Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-base-size: 16px;
  --line-height-base: 1.6;

  /* Spacing */
  --spacing-xs: 4px;
  --spacing-sm: 8px;
  --spacing-md: 16px;
  --spacing-lg: 24px;
  --spacing-xl: 32px;
  --spacing-2xl: 48px;
  --spacing-3xl: 64px;

  /* Breakpoints (for reference) */
  --bp-mobile: 480px;
  --bp-tablet: 768px;
  --bp-laptop: 1024px;
  --bp-desktop: 1280px;
  --bp-wide: 1440px;

  /* Container */
  --container-max-width: 1140px;
  /* Must match .header-inner height in header.css, or a white strip shows under the fixed header */
  --header-height: 85px;
  --header-height-mobile: 70px;
  /* Gap between the header and the first content on every page: 40px on phones, 72px at 1440, 80px max */
  --page-top-space: clamp(40px, 5vw, 80px);

  /* Shadows & Radius */
  --shadow-header: 0px 2px 6px 2px rgba(0, 0, 0, 0.08);
  --shadow-card: 0 4px 20px rgba(0, 0, 0, 0.06);
  --shadow-card-hover: 0 8px 30px rgba(126, 164, 73, 0.15);
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;

  /* Transitions */
  --transition-fast: 0.2s ease;
  --transition-normal: 0.3s ease;
  --transition-slow: 0.5s ease;
}

/* CSS Reset & Box Sizing */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: var(--font-base-size);
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  overflow-x: hidden;
}

body {
  font-family: var(--font-secondary);
  color: var(--color-text);
  background-color: var(--color-white);
  line-height: var(--line-height-base);
  overflow-x: hidden;
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main.page-content {
  flex: 1 0 auto;
  padding-top: var(--header-height);
  width: 100%;
  overflow-x: hidden;
}

/* Blog posts reset #main-content padding inline; keep the header offset */
main#main-content.page-content {
  padding-top: var(--header-height);
}

@media (max-width: 768px) {
  main.page-content,
  main#main-content.page-content {
    padding-top: var(--header-height-mobile);
  }
}

/* Globally remove the massive Elementor default top margin on the first section */
main.page-content > .elementor > .elementor-element.e-parent:first-child {
  --margin-top: 0px !important;
  margin-top: 0px !important;
}

/* --------------------------------------------------------------------------
   Page top spacing: every page's first section starts --page-top-space below
   the header. Page-level paddings/margins on the first section are reset so
   only this one value controls the gap. The home (.hp) and awards heroes are
   full-height, vertically centred designs and are left alone.
   -------------------------------------------------------------------------- */
main.page-content > .elementor > .elementor-element.e-parent:first-child {
  --padding-top: var(--page-top-space) !important;
  padding-top: var(--page-top-space) !important;
}

main.page-content > .elementor > .elementor-element.e-parent:first-child > .e-con-inner,
main.page-content > .elementor > .elementor-element.e-parent:first-child > .e-con-inner > .e-con,
main.page-content > .elementor > .elementor-element.e-parent:first-child > .e-con {
  --padding-top: 0px !important;
  padding-top: 0 !important;
}

main.page-content > .elementor > .elementor-element.e-parent:first-child > .e-con-inner > :first-child,
main.page-content > .elementor > .elementor-element.e-parent:first-child > .e-con-inner > :first-child > :first-child,
main.page-content > .elementor > .elementor-element.e-parent:first-child > .e-con-inner > :first-child > :first-child > .elementor-widget-container {
  --margin-top: 0px !important;
  margin-top: 0 !important;
}

/* Blog posts, blog listing, case-study listing */
main.page-content > .single-post-wrapper:first-child,
main.page-content > section.insights-section:first-child,
main.page-content > section.case-studies-section:first-child {
  padding-top: var(--page-top-space) !important;
}

/* Base Headings & Typography */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-primary);
  color: var(--color-dark);
  font-weight: 700;
  line-height: 1.25;
  margin-bottom: 0.5em;
}

h1 { font-size: clamp(2rem, 4vw + 1rem, 3.5rem); }
h2 { font-size: clamp(1.75rem, 3vw + 0.75rem, 2.5rem); }
h3 { font-size: clamp(1.35rem, 2vw + 0.5rem, 2rem); }
h4 { font-size: clamp(1.15rem, 1.5vw + 0.4rem, 1.5rem); }
h5 { font-size: 1.2rem; }
h6 { font-size: 1rem; }

p {
  margin-bottom: 1rem;
}

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

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

img, svg {
  max-width: 100%;
  height: auto;
  display: inline-block;
  vertical-align: middle;
}

ul, ol {
  list-style: none;
}

button, input, select, textarea {
  font-family: inherit;
  font-size: inherit;
  outline: none;
  border: none;
}

button {
  cursor: pointer;
  background: none;
}

/* Accessibility & Tap Targets */
button, a, input[type="submit"] {
  min-height: 44px;
  touch-action: manipulation;
}

.screen-reader-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

/* Containers */
.container {
  width: 100%;
  max-width: var(--container-max-width);
  margin-left: auto;
  margin-right: auto;
  padding-left: 16px;
  padding-right: 16px;
}

@media (min-width: 480px) {
  .container { padding-left: 20px; padding-right: 20px; }
}

@media (min-width: 768px) {
  .container { padding-left: 32px; padding-right: 32px; }
}

@media (min-width: 1024px) {
  .container { padding-left: 40px; padding-right: 40px; }
}

@media (min-width: 1280px) {
  .container { max-width: 1140px; padding-left: 0; padding-right: 0; }
}

@media (min-width: 1440px) {
  .container-wide { max-width: 1360px; }
}

/* Layout Utilities */
.flex { display: flex; }
.flex-col { display: flex; flex-direction: column; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.flex-wrap { flex-wrap: wrap; }
.gap-sm { gap: var(--spacing-sm); }
.gap-md { gap: var(--spacing-md); }
.gap-lg { gap: var(--spacing-lg); }
.gap-xl { gap: var(--spacing-xl); }

.grid { display: grid; gap: var(--spacing-md); }
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }
