/* ==========================================================================
   Avilstron — Clean Static Site Stylesheet
   ========================================================================== */

/* ---------- Font Faces ---------- */
@font-face {
  font-family: Inter;
  font-style: normal;
  font-weight: 300 900;
  font-display: fallback;
  src: url('../fonts/Inter-VariableFont.woff2') format('woff2');
  font-stretch: normal;
}
@font-face {
  font-family: Cardo;
  font-style: normal;
  font-weight: 400;
  font-display: fallback;
  src: url('../fonts/cardo_normal_400.woff2') format('woff2');
}
@font-face {
  font-family: Cardo;
  font-style: italic;
  font-weight: 400;
  font-display: fallback;
  src: url('../fonts/cardo_italic_400.woff2') format('woff2');
}
@font-face {
  font-family: Cardo;
  font-style: normal;
  font-weight: 700;
  font-display: fallback;
  src: url('../fonts/cardo_normal_700.woff2') format('woff2');
}

/* ---------- Custom Properties ---------- */
:root {
  --color-base: #f9f9f9;
  --color-base-2: #ffffff;
  --color-contrast: #111111;
  --color-contrast-2: #636363;
  --color-contrast-3: #A4A4A4;
  --color-accent: #cfcabe;
  --color-accent-2: #c2a990;
  --color-accent-3: #d8613c;
  --color-accent-4: #b1c5a4;
  --color-accent-5: #b5bdbc;
  --color-header-bg: #b5bdbc9c;
  --color-primary: #0f766e;
  --color-primary-hover: #0d5f58;

  --font-body: "Inter", sans-serif;
  --font-heading: Cardo, serif;

  --fs-small: 0.9rem;
  --fs-medium: 1.125rem; /* 18px */
  --fs-large: clamp(1.39rem, 1.39rem + ((1vw - 0.2rem) * 0.767), 1.85rem);
  --fs-x-large: clamp(1.85rem, 1.85rem + ((1vw - 0.2rem) * 1.083), 2.5rem);
  --fs-xx-large: clamp(2.5rem, 2.5rem + ((1vw - 0.2rem) * 1.283), 3.27rem);

  --spacing-10: 1rem;
  --spacing-20: min(1.5rem, 2vw);
  --spacing-30: min(2.5rem, 3vw);
  --spacing-40: min(4rem, 5vw);
  --spacing-50: min(6.5rem, 8vw);
  --spacing-60: min(10.5rem, 13vw);

  --content-width: 620px;
  --wide-width: 1280px;

  --site-title-fs: clamp(16.293px, 1.018rem + ((1vw - 3.2px) * 0.907), 25px);
}

/* ---------- Reset / Base ---------- */
*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  background-color: var(--color-base);
  color: var(--color-contrast);
  font-family: var(--font-body);
  font-size: var(--fs-medium);
  font-weight: 400;
  line-height: 1.65;
  -webkit-text-size-adjust: 100%;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--color-contrast);
  text-decoration: underline;
}
a:hover { text-decoration: none; }

h1, h2, h3, h4, h5, h6 {
  color: var(--color-contrast);
  font-family: var(--font-body);
  font-weight: 600;
  line-height: 1.2;
  margin-top: var(--spacing-20);
  margin-bottom: 0.5rem;
}
h1 { font-size: var(--fs-xx-large); line-height: 1.15; }
h2 { font-size: var(--fs-x-large); }
h3 { font-size: var(--fs-large); }
h4 { font-size: clamp(1.1rem, 1.1rem + ((1vw - 0.2rem) * 0.767), 1.5rem); }
h5 { font-size: var(--fs-medium); }
h6 { font-size: var(--fs-small); }

p { margin: 0 0 1.2rem; }
ul, ol { padding-left: var(--spacing-10); }
hr {
  border: none;
  border-top: 1px solid var(--color-contrast);
  margin: var(--spacing-20) 0;
}
figure { margin: 0; }

.screen-reader-text {
  position: absolute;
  width: 1px; height: 1px;
  clip-path: inset(50%);
  overflow: hidden;
  white-space: nowrap;
}

/* ---------- Layout ---------- */
.site-wrapper {
  padding-top: 0;
  padding-bottom: 0;
}
.site-wrapper > * + * {
  margin-top: 0;
}

.constrained {
  max-width: var(--content-width);
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--spacing-50);
  padding-right: var(--spacing-50);
}

.wide {
  max-width: var(--wide-width);
  margin-left: auto;
  margin-right: auto;
}

.full-width {
  width: 100%;
}

.global-padding {
  padding-left: var(--spacing-50);
  padding-right: var(--spacing-50);
}

/* ---------- Header ---------- */
.site-header {
  background-color: var(--color-header-bg);
  padding: 0 var(--spacing-50);
  position: static;
  width: 100%;
  z-index: 9999;
  transition: background-color 0.3s, box-shadow 0.3s;
}
.site-header.sticky {
  position: fixed;
  top: 0;
  left: 0;
  background-color: #f7f5e7;
  box-shadow: 0 2px 6px rgba(0,0,0,0.08);
}
.header-inner {
  max-width: var(--wide-width);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0;
  min-height: 66px;
}
.header-brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
}
.header-brand img {
  width: 66px;
  height: 66px;
}
.header-brand .site-title {
  font-family: var(--font-body);
  font-size: var(--site-title-fs);
  font-weight: 600;
  color: var(--color-contrast);
  text-decoration: none;
  margin: 0;
}
.header-brand .site-title a {
  text-decoration: none;
  color: inherit;
}

/* Header Nav */
.header-nav {
  display: flex;
  align-items: center;
  gap: 0;
  list-style: none;
  margin: 0;
  padding: 0;
}
.header-nav a {
  text-decoration: none;
  font-weight: 500;
  padding: 0.5em 1em;
  display: block;
}
.header-nav a:hover {
  text-decoration: underline;
}

.header-login {
  font-size: var(--fs-small);
}
.header-login a {
  text-decoration: none;
  cursor: pointer;
}

/* Hamburger */
.hamburger {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  color: currentColor;
}
.hamburger svg {
  width: 24px;
  height: 24px;
  fill: currentColor;
}

/* Mobile nav overlay */
.mobile-nav-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: var(--color-base);
  color: var(--color-contrast);
  z-index: 100000;
  flex-direction: column;
  padding: 2rem var(--spacing-50);
  overflow: auto;
}
.mobile-nav-overlay.open {
  display: flex;
}
.mobile-nav-close {
  align-self: flex-end;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  margin-bottom: 2rem;
}
.mobile-nav-close svg {
  width: 24px;
  height: 24px;
  fill: currentColor;
}
.mobile-nav-links {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
}
.mobile-nav-links a {
  font-weight: 500;
  text-decoration: none;
  font-size: var(--fs-large);
}

/* Responsive header */
@media (max-width: 599px) {
  .header-nav, .header-login { display: none; }
  .hamburger { display: flex; }
}

/* Header spacer for sticky */
.header-spacer {
  display: none;
}
.header-spacer.active {
  display: block;
}

/* ---------- Main Content ---------- */
main {
  margin-top: 0;
}
.page-content {
  padding: var(--spacing-50);
  max-width: var(--wide-width);
  margin: 0 auto;
}
.page-content > * + * {
  margin-top: 1.2rem;
}
.page-content > :first-child {
  margin-top: 0;
}

/* Constrained content pages (legal text, etc.) */
.page-content.narrow {
  max-width: var(--content-width);
}

/* ---------- Sections ---------- */
.section {
  padding: var(--spacing-20) var(--spacing-50);
}
.section.bg-white {
  background-color: var(--color-base-2);
}
.section.bg-base {
  background-color: var(--color-base);
}
.section.section-hero {
  padding-top: var(--spacing-40);
  padding-bottom: var(--spacing-40);
}
.section.section-standard {
  padding-top: var(--spacing-40);
  padding-bottom: var(--spacing-40);
}
.section.section-revenue {
  background-color: var(--color-base-2);
}
.section-inner {
  max-width: var(--wide-width);
  margin: 0 auto;
}

/* ---------- Columns / Flex ---------- */
.columns {
  display: flex;
  flex-wrap: wrap;
  gap: var(--spacing-30) var(--spacing-40);
}
.columns.nowrap {
  flex-wrap: nowrap;
}
.columns.no-gap {
  gap: 0 var(--spacing-50);
}
.column {
  flex: 1;
  min-width: 0;
}
.columns.align-center { align-items: center; }
.column.top { align-self: flex-start; }

@media (max-width: 781px) {
  .columns:not(.nowrap-mobile) {
    flex-direction: column;
  }
  .columns:not(.nowrap-mobile) > .column {
    flex-basis: 100% !important;
  }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-block;
  background-color: var(--color-primary);
  color: #fff;
  font-family: inherit;
  font-size: var(--fs-small);
  font-weight: 500;
  line-height: inherit;
  padding: 0.6rem 1rem;
  border: 0;
  border-radius: 0.33rem;
  text-decoration: none;
  cursor: pointer;
  text-align: center;
}
.btn:hover {
  background-color: var(--color-primary-hover);
  color: #fff;
  text-decoration: none;
}

.btn-hero {
  font-size: 1.1rem;
  padding: 0.85rem 2rem;
  margin-top: 1.2rem;
}

.btn-outline {
  background: transparent;
  color: currentColor;
  border: 2px solid currentColor;
  padding: 0.667em 1.333em;
}
.btn-outline:hover {
  background-color: var(--color-contrast-2);
  color: var(--color-base);
  border-color: var(--color-contrast-2);
}

.btn-center {
  display: flex;
  justify-content: center;
}

/* ---------- Images ---------- */
.rounded-img {
  border-radius: var(--spacing-20);
  overflow: hidden;
}
.rounded-img img {
  width: 100%;
  height: auto;
  object-fit: cover;
}

.img-cover {
  object-fit: cover;
}

/* ---------- Text alignment ---------- */
.text-center { text-align: center; }
.text-left { text-align: left; }

/* ---------- Footer ---------- */
.site-footer {
  background-color: var(--color-header-bg);
  padding: var(--spacing-50) var(--spacing-50);
}
.footer-inner {
  max-width: var(--wide-width);
  margin: 0 auto;
}

/* Footer Grid */
.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1fr;
  gap: var(--spacing-30);
}

.footer-col {
  display: flex;
  flex-direction: column;
}

/* Brand Column */
.brand-col .footer-brand-link {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  margin-bottom: 1rem;
}
.brand-col .footer-brand-link img {
  width: 50px;
  height: 50px;
}
.brand-col .footer-title {
  font-family: var(--font-body);
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--color-contrast);
}
.footer-copy {
  font-size: 0.85rem;
  color: var(--color-contrast-2);
  text-align: center;
  margin-top: var(--spacing-40);
  padding-top: var(--spacing-20);
  border-top: 1px solid rgba(0, 0, 0, 0.08);
}
.footer-copy a {
  color: inherit;
  text-decoration: none;
}

/* Footer Nav */
.footer-heading {
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-contrast-2);
  margin-top: 0;
  margin-bottom: 1.2rem;
  font-weight: 600;
}

.footer-nav-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.footer-nav-list a {
  font-size: 0.95rem;
  text-decoration: none;
  color: var(--color-contrast);
  transition: color 0.2s;
}
.footer-nav-list a:hover {
  color: var(--color-accent-3);
  text-decoration: none;
}

@media (max-width: 900px) {
  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing-40) var(--spacing-30);
  }
  .brand-col {
    grid-column: 1 / -1;
    margin-bottom: 1rem;
  }
}

@media (max-width: 500px) {
  .footer-grid {
    grid-template-columns: 1fr;
  }
}

/* ---------- Login Modal (dialog) ---------- */
.login-dialog {
  border: none;
  border-radius: 8px;
  padding: 0;
  max-width: 400px;
  width: 90vw;
  box-shadow: 0 8px 30px rgba(0,0,0,0.2);
}
.login-dialog::backdrop {
  background: rgba(0,0,0,0.45);
}
.login-dialog-inner {
  padding: 2rem;
  position: relative;
}
.login-dialog-title {
  font-family: var(--font-body);
  font-size: var(--fs-x-large);
  margin: 0 0 1.5rem;
}
.login-dialog .close-btn {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  line-height: 1;
  padding: 0.25rem;
  color: var(--color-contrast-2);
}
.login-dialog .close-btn:hover {
  color: var(--color-contrast);
}

/* ---------- Forms ---------- */
.form-field {
  margin-bottom: 1rem;
}
.form-field label {
  display: block;
  font-size: 1rem;
  font-weight: 400;
  margin-bottom: 0.35rem;
  color: rgba(0,0,0,0.85);
}
.form-field .required {
  color: var(--color-accent-3);
}
.form-field input[type="text"],
.form-field input[type="password"],
.form-field input[type="email"],
.form-field input[type="tel"],
.form-field select,
.form-field textarea {
  width: 100%;
  height: 43px;
  padding: 0 14px;
  font-family: inherit;
  font-size: 1rem;
  line-height: 19px;
  border: 1px solid rgba(0,0,0,0.25);
  border-radius: 3px;
  background: #fff;
  color: rgba(0,0,0,0.7);
}
.form-field textarea {
  height: auto;
  min-height: 120px;
  padding: 14px;
  resize: vertical;
}
.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus {
  outline: 2px solid var(--color-contrast);
  outline-offset: 1px;
  border-color: var(--color-contrast);
}
.form-field .field-desc {
  font-size: 0.875rem;
  color: rgba(0,0,0,0.55);
  margin-top: 0.35rem;
}
.form-field .field-error {
  font-size: 0.875rem;
  color: #d63637;
  margin-top: 0.35rem;
  display: none;
}
.form-field.has-error input,
.form-field.has-error select,
.form-field.has-error textarea {
  border-color: #d63637;
}
.form-field.has-error .field-error {
  display: block;
}

.form-link {
  margin-bottom: 1rem;
}
.form-link a {
  font-size: var(--fs-small);
}

.form-submit button {
  background-color: #066aab;
  color: #fff;
  border: none;
  border-radius: 3px;
  padding: 0.6rem 1.5rem;
  font-size: 1.0625rem;
  font-family: inherit;
  cursor: pointer;
  line-height: 1.4;
}
.form-submit button:hover {
  background-color: #055a91;
}

/* Contact form */
.contact-form {
  max-width: 600px;
}
.contact-form .columns {
  gap: 1rem;
}
.contact-form .honeypot {
  position: absolute;
  left: -9999px;
  height: 0;
  overflow: hidden;
}
.contact-form .form-message {
  padding: 1rem;
  border-radius: 3px;
  margin-bottom: 1.5rem;
  font-size: 1rem;
  line-height: 1.5;
}
.contact-form .form-message.success {
  background-color: #d4edda;
  color: #155724;
  border: 1px solid #c3e6cb;
}
.contact-form .form-message.error {
  background-color: #f8d7da;
  color: #721c24;
  border: 1px solid #f5c6cb;
}
.form-submit button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* ---------- Page-specific ---------- */

/* Hero banner on homepage */
.hero-banner {
  position: relative;
  background-size: 125% auto;
  background-position: 35% 35%;
  background-repeat: no-repeat;
  min-height: 520px;
  display: flex;
  align-items: center;
}
.hero-banner::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
}
.hero-banner-inner {
  position: relative;
  max-width: var(--wide-width);
  margin: 0 auto;
  padding: var(--spacing-60) var(--spacing-50);
  color: #fff;
  max-width: 680px;
  margin-left: var(--spacing-50);
}
.hero-banner .hero-title {
  color: #fff;
  font-family: var(--font-body);
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.3);
}
.hero-banner p {
  color: rgba(255, 255, 255, 0.9);
  font-size: 1.15rem;
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.3);
}
@media (max-width: 781px) {
  .hero-banner {
    min-height: 400px;
    background-size: cover;
    background-position: 60% center;
  }
  .hero-banner-inner {
    margin-left: auto;
    margin-right: auto;
    text-align: center;
  }
}

/* Feature card sections */
.feature-section {
  padding: var(--spacing-20) var(--spacing-50);
}
.feature-section.bg-white {
  background-color: var(--color-base-2);
}
.feature-section .section-title {
  text-align: center;
}
.feature-section.section-standard {
  padding-top: var(--spacing-40);
  padding-bottom: var(--spacing-40);
}
.feature-section .section-subtitle {
  text-align: center;
}
.feature-section-inner {
  max-width: var(--wide-width);
  margin: 0 auto;
}
.feature-img {
  max-width: 380px;
  margin: 0 auto;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

/* Lightbox */
.lightbox-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(255,255,255,0.92);
  z-index: 200000;
  cursor: zoom-out;
  justify-content: center;
  align-items: center;
}
.lightbox-overlay.active {
  display: flex;
}
.lightbox-overlay img {
  max-width: 90vw;
  max-height: 90vh;
  object-fit: contain;
}
.lightbox-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 2rem;
  min-width: 40px;
  min-height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Uganda clinic page */
.uganda-content img {
  border-radius: var(--spacing-20);
  margin: 1rem 0;
}

/* Separator */
.separator {
  border: none;
  border-top: 1px solid var(--color-contrast);
  margin: var(--spacing-20) auto;
  max-width: var(--spacing-60);
}
