/* ========================================
   1. CSS Variables & Reset (The "Vibe" Check)
   ======================================== */
:root {
  /* Colors: Warm, Earthy, and Creative */
  --color-bg: #FDFCF8; /* Creamy paper */
  --color-bg-alt: #F0EDE6; /* Slightly darker paper */
  --color-primary: #4A6D5C; /* Sage Green - Grounding */
  --color-secondary: #C05746; /* Terracotta/Rust - Creative Energy */
  --color-accent: #E6B89C; /* Soft Peach - Comfort */
  --color-text: #2E2E2E; /* Soft Black */
  --color-text-light: #5A5A5A;
  --color-white: #ffffff;

  /* Typography */
  --font-heading: 'Fraunces', serif;
  --font-body: 'DM Sans', sans-serif;

  /* Spacing & Sizing */
  --spacing-sm: 1rem;
  --spacing-md: 2rem;
  --spacing-lg: 5rem;
  --max-width: 1200px;
  
  /* Border Radius - Organic & Soft */
  --radius-soft: 8px;
  --radius-round: 30px; 
  --radius-blob: 60% 40% 30% 70% / 60% 30% 70% 40%;
}

/* Reset */
* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-body);
  line-height: 1.7;
  color: var(--color-text);
  background-color: var(--color-bg);
  /* Subtle texture overlay for 'paper' feel */
  background-image: radial-gradient(#E6E2DA 1px, transparent 1px);
  background-size: 20px 20px;
}

/* All images get rounded corners for consistent style */
img {
  max-width: 100%;
  height: auto;
  display: block;
  border-radius: var(--radius-soft);
}
a { text-decoration: none; color: inherit; }
ul { list-style: none; }

/* ========================================
   2. Typography (Playful & Serious)
   ======================================== */
h1, h2, h3, h4 {
  font-family: var(--font-heading);
  font-weight: 700;
  line-height: 1.1;
  color: var(--color-primary);
  margin-bottom: var(--spacing-sm);
}

h1 { font-size: 3.5rem; } /* Big, warm welcome */
h2 { font-size: 2.5rem; margin-bottom: var(--spacing-md); }
h3 { font-size: 1.8rem; }

p {
  margin-bottom: 1.5rem;
  color: var(--color-text-light);
  font-size: 1.05rem;
}

.container {
  width: 90%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--spacing-sm);
}

.section-padding { padding: var(--spacing-lg) 0; }
.text-center { text-align: center; }

/* ========================================
   3. Navigation (Friendly & Floating)
   ======================================== */
.header {
  position: sticky;
  top: 20px; /* Floats slightly off top */
  z-index: 1000;
  margin: 20px auto;
  width: 95%;
  max-width: var(--max-width);
}

.nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(10px);
  padding: 15px 30px;
  border-radius: var(--radius-round);
  box-shadow: 0 4px 20px rgba(74, 109, 92, 0.1);
  border: 1px solid rgba(74, 109, 92, 0.1);
}

.nav__logo {
  font-family: var(--font-heading);
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--color-secondary);
  display: flex;
  align-items: center;
  gap: 8px;
  line-height: 1;
}

.nav__logo img {
  height: 32px;
  width: 32px;
  object-fit: contain;
  border-radius: 4px;
}

.nav__menu {
  display: flex;
  gap: var(--spacing-md);
}

.nav__link {
  font-weight: 500;
  font-size: 0.95rem;
  transition: color 0.2s;
  position: relative;
}

.nav__link:hover, .nav__link.active {
  color: var(--color-secondary);
}

/* Underline hover effect */
.nav__link::after {
  content: '';
  position: absolute;
  width: 0;
  height: 2px;
  bottom: -4px;
  left: 0;
  background-color: var(--color-accent);
  transition: width 0.3s;
}

.nav__link:hover::after { width: 100%; }

.nav__toggle { display: none; cursor: pointer; }

/* ========================================
   4. Hero Section (Artistic Asymmetry)
   ======================================== */
.hero-section {
  position: relative;
  padding: var(--spacing-lg) 0;
  overflow: visible;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: var(--spacing-lg);
  align-items: center;
}

.hero-content {
  position: relative;
  z-index: 2;
}

.hero-title {
  font-size: 3.8rem;
  color: var(--color-primary);
  margin-bottom: var(--spacing-md);
  /* Quirky margin for asymmetry */
  margin-left: -10px; 
}

.hero-subtitle {
  font-size: 1.2rem;
  color: var(--color-text-light);
  margin-bottom: var(--spacing-md);
  max-width: 500px;
}

.hero-image-wrapper {
  position: relative;
  z-index: 1;
}

/* The main image with organic shape */
.hero-image {
  width: 100%;
  max-width: 500px;
  border-radius: var(--radius-blob);
  box-shadow: 20px 20px 0px var(--color-accent);
  transition: transform 0.5s ease;
}

.hero-image:hover {
  transform: rotate(-2deg) scale(1.01);
}

/* Decorative blob behind image */
.hero-decoration {
  position: absolute;
  top: -50px;
  right: -50px;
  width: 400px;
  height: 400px;
  background-color: var(--color-bg-alt);
  border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%;
  z-index: -1;
  opacity: 0.7;
}

/* ========================================
   5. Content Layouts (Warm & Textured)
   ======================================== */
.page-header {
  background-color: var(--color-primary);
  color: var(--color-white);
  padding: 6rem 0 3rem;
  text-align: center;
  margin-bottom: var(--spacing-lg);
  /* Organic bottom edge */
  border-radius: 0 0 100% 100% / 0 0 40px 40px;
}

.page-header h1 { color: var(--color-white); font-size: 3rem; }

.content-section {
  background-color: var(--color-bg-alt);
  border-radius: 50px;
  margin: 0 1rem;
  padding: var(--spacing-lg);
  margin-bottom: var(--spacing-lg);
}

/* ========================================
   Hero images - full width on inner pages
   ======================================== */
.page-hero {
  padding: 0;
}

.page-hero img {
  width: 100%;
  max-height: 400px;
  object-fit: cover;
  border-radius: 0;
}

/* About Page - Overlapping Image Layout */
.about-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--spacing-lg);
  align-items: center;
}

.about-image-frame {
  position: relative;
}

/* Polaroid-style photo frame */
.photo-frame {
  background: var(--color-white);
  padding: 15px 15px 40px 15px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.1);
  transform: rotate(-3deg);
  transition: transform 0.3s;
}

.photo-frame:hover { transform: rotate(0deg) scale(1.02); }

.photo-frame img {
  width: 100%;
  height: auto;
  border-radius: var(--radius-soft);
}

/* ========================================
   6. Cards & Services (Organic Blocks)
   ======================================== */
.services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: var(--spacing-md);
}

.service-card {
  background: var(--color-white);
  padding: var(--spacing-md);
  border-radius: var(--radius-soft);
  transition: all 0.3s ease;
  border: 2px solid transparent;
  position: relative;
  overflow: hidden;
}

/* Funky corner accent */
.service-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 50px;
  height: 50px;
  background: var(--color-accent);
  border-radius: 0 0 100% 0;
  opacity: 0;
  transition: opacity 0.3s;
}

.service-card:hover {
  transform: translateY(-5px);
  border-color: var(--color-primary);
  box-shadow: 10px 10px 0px var(--color-accent);
}

.service-card:hover::before { opacity: 1; }

/* ========================================
   7. Testimonials (Chat Bubbles)
   ======================================== */
.testimonials {
  display: grid;
  gap: var(--spacing-md);
  margin-top: var(--spacing-md);
}

.testimonial {
  background: var(--color-white);
  padding: var(--spacing-md);
  border-radius: 25px;
  border-bottom-left-radius: 5px; /* Speech bubble tail hint */
  position: relative;
  box-shadow: 0 5px 15px rgba(0,0,0,0.05);
  border-left: 5px solid var(--color-secondary);
}

.testimonial p { font-style: italic; font-size: 1rem; }
.testimonial cite {
  display: block;
  margin-top: 1rem;
  font-weight: 700;
  color: var(--color-primary);
  font-style: normal;
}

/* ========================================
   8. Announcements (Sticky Note Style)
   ======================================== */
.announcements {
  margin: 0 auto;
  max-width: 800px;
  padding: var(--spacing-md);
  transform: rotate(-1deg);
}

.announcement-card {
  background-color: #fff9c4; /* Sticky note yellow */
  padding: 20px;
  border-radius: 2px;
  box-shadow: 2px 4px 10px rgba(0,0,0,0.1);
  position: relative;
  margin-bottom: 1rem;
  transform: rotate(1deg);
  font-family: 'Courier New', Courier, monospace; /* Handwritten feel */
}

.announcement-card p { margin: 0; font-size: 0.95rem; }

/* Tape effect */
.announcement-card::after {
  content: '';
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 25px;
  background-color: rgba(230, 184, 156, 0.6);
  opacity: 0.7;
}

/* ========================================
   9. Buttons & Links
   ======================================== */
.btn {
  display: inline-block;
  padding: 14px 32px;
  border-radius: 100px; /* Pill shape */
  font-weight: 600;
  font-family: var(--font-body);
  transition: all 0.3s;
  cursor: pointer;
  border: 2px solid transparent;
}

.btn--primary {
  background-color: var(--color-secondary);
  color: var(--color-white);
  border-color: var(--color-secondary);
}

.btn--primary:hover {
  background-color: transparent;
  color: var(--color-secondary);
  transform: translateY(-2px);
  box-shadow: 5px 5px 0px var(--color-primary);
}

.btn--outline {
  background-color: transparent;
  color: var(--color-primary);
  border: 2px solid var(--color-primary);
}

.btn--outline:hover {
  background-color: var(--color-primary);
  color: var(--color-white);
}

/* ========================================
   10. Footer
   ======================================== */
.footer {
  background-color: var(--color-primary);
  color: var(--color-white);
  padding: var(--spacing-lg) 0 var(--spacing-md);
  margin-top: var(--spacing-lg);
  /* Organic top edge */
  border-radius: 100% 100% 0 0 / 40px 40px 0 0;
}

.footer a { color: var(--color-accent); }
.footer a:hover { color: var(--color-white); }

/* Footer logo styling */
.footer__logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--color-white);
}

.footer__logo img {
  height: 40px;
  width: 40px;
  border-radius: 4px;
}

/* ========================================
   Announcements with button links
   ======================================== */
.announcement-item {
  display: flex;
  align-items: center;
  gap: 15px;
  margin-bottom: 1.5rem;
}

.announcement-thumb {
  flex-shrink: 0;
  width: 60px;
  height: 60px;
  object-fit: cover;
  border-radius: var(--radius-soft);
}

.announcement-content {
  flex: 1;
}

.announcement-btn {
  display: inline-block;
  padding: 8px 20px;
  margin-top: 8px;
  background-color: var(--color-secondary);
  color: var(--color-white);
  border-radius: 20px;
  font-size: 0.9rem;
  font-weight: 500;
  transition: all 0.3s;
}

.announcement-btn:hover {
  background-color: var(--color-primary);
  transform: translateY(-2px);
}

/* ========================================
   Section divider image
   ======================================== */
.section-divider {
  width: 100%;
  max-height: 200px;
  object-fit: cover;
  border-radius: var(--radius-soft);
  margin: var(--spacing-md) 0;
}

/* ========================================
   Clickable service cards
   ======================================== */
.service-card a.card-link {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
}

.service-card .card-link-text {
  position: relative;
  z-index: 2;
  display: inline-block;
  margin-top: 1rem;
  color: var(--color-secondary);
  font-weight: 600;
}

/* ========================================
   About page - image with text wrapping
   ======================================== */
.about-section {
  margin-bottom: 3rem;
}

.about-section-image {
  float: left;
  width: 250px;
  margin-right: 2rem;
  margin-bottom: 1rem;
}

.about-section-image img {
  width: 100%;
  border-radius: var(--radius-soft);
}

.about-section:after {
  content: "";
  display: table;
  clear: both;
}

/* ========================================
   Resources page - button links
   ======================================== */
.resource-btn {
  display: inline-block;
  padding: 12px 24px;
  background-color: var(--color-secondary);
  color: var(--color-white);
  border-radius: 25px;
  font-weight: 500;
  margin-top: 10px;
  transition: all 0.3s;
}

.resource-btn:hover {
  background-color: var(--color-primary);
  transform: translateY(-2px);
  box-shadow: 3px 3px 0 var(--color-accent);
}

/* Diabetes resources link hover */
.diabetes-resources a:hover {
  color: var(--color-secondary);
  text-decoration: underline;
}

/* Resource section with image */
.resource-section {
  margin-bottom: 2rem;
  clear: both;
}

.resource-section-image {
  float: left;
  width: 150px;
  margin-right: 1.5rem;
  margin-bottom: 1rem;
}

.resource-section-image img {
  width: 100%;
  border-radius: var(--radius-soft);
}

.resource-section:after {
  content: "";
  display: table;
  clear: both;
}

/* ========================================
   Contact page - form styling
   ======================================== */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--spacing-lg);
  align-items: start;
}

.contact-form {
  background: var(--color-white);
  padding: var(--spacing-md);
  border-radius: var(--radius-soft);
  box-shadow: 0 5px 20px rgba(0,0,0,0.1);
}

.contact-form input,
.contact-form textarea {
  width: 100%;
  padding: 15px;
  margin-bottom: 1rem;
  border: 2px solid var(--color-bg-alt);
  border-radius: var(--radius-soft);
  font-family: var(--font-body);
  font-size: 1rem;
  transition: border-color 0.3s;
}

.contact-form input:focus,
.contact-form textarea:focus {
  outline: none;
  border-color: var(--color-primary);
}

.contact-form textarea {
  min-height: 150px;
  resize: vertical;
}

.contact-form button[type="submit"] {
  width: 100%;
  padding: 15px;
  background-color: var(--color-secondary);
  color: var(--color-white);
  border: none;
  border-radius: var(--radius-soft);
  font-size: 1.1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
}

.contact-form button[type="submit"]:hover {
  background-color: var(--color-primary);
  transform: translateY(-2px);
  box-shadow: 5px 5px 0 var(--color-accent);
}

/* Contact vertical image */
.contact-vertical-image {
  width: 100%;
  max-height: 600px;
  object-fit: cover;
  border-radius: var(--radius-soft);
}

@media (max-width: 768px) {
  .contact-grid {
    grid-template-columns: 1fr;
  }
  
  .about-section-image {
    float: none;
    width: 100%;
    margin-right: 0;
    margin-bottom: 1rem;
  }
  
  .resource-section-image {
    float: none;
    width: 100%;
    margin-right: 0;
    margin-bottom: 1rem;
  }
}

/* ========================================
   11. Mobile Responsiveness
   ======================================== */
@media (max-width: 768px) {
  h1 { font-size: 2.5rem; }
  h2 { font-size: 2rem; }
  
  .nav__menu {
      position: fixed;
      top: 0;
      left: 0;
      width: 100%;
      height: 100vh;
      background: var(--color-bg);
      flex-direction: column;
      align-items: center;
      justify-content: center;
      gap: 2rem;
      transform: translateX(-100%);
      transition: transform 0.4s ease;
      z-index: 999;
  }

  .nav__menu.active { transform: translateX(0); }
  
  .nav__toggle {
      display: block;
      z-index: 1001;
      background: var(--color-white);
      padding: 10px;
      border-radius: 8px;
  }

  .hero-grid, .about-grid {
      grid-template-columns: 1fr;
      text-align: center;
  }

  .hero-title { margin-left: 0; }
  
  .hero-image { margin: 0 auto; }

  .content-section { padding: var(--spacing-md); border-radius: 30px; }
}