/* ==========================================================================
   Novus Life Care - Main Stylesheet
   Optimized, mobile-first, professional CSS
   ========================================================================== */

/* Self-Hosted Open Sans Fonts - Latin Subset Only (WOFF2) */
/* Regular (400) */
@font-face {
  font-family: 'Open Sans';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/open-sans-400.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* Regular Italic (400) */
@font-face {
  font-family: 'Open Sans';
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/open-sans-400-italic.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* Semi-Bold (600) */
@font-face {
  font-family: 'Open Sans';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('../fonts/open-sans-600.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* Semi-Bold Italic (600) */
@font-face {
  font-family: 'Open Sans';
  font-style: italic;
  font-weight: 600;
  font-display: swap;
  src: url('../fonts/open-sans-600-italic.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* Bold (700) */
@font-face {
  font-family: 'Open Sans';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('../fonts/open-sans-700.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* Bold Italic (700) */
@font-face {
  font-family: 'Open Sans';
  font-style: italic;
  font-weight: 700;
  font-display: swap;
  src: url('../fonts/open-sans-700-italic.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ==========================================================================
   CSS Custom Properties (Variables)
   ========================================================================== */

:root {
  /* Brand Colors */
  --color-primary: #B6552A;
  --color-primary-light: #fff6ef;
  --color-primary-dark: #8a3f1f;
  --color-text: #222222;
  --color-text-light: #555555;
  --color-bg: #f5f5f5;
  --color-white: #ffffff;
  --color-error: #dc3545;
  --color-success: #28a745;

  /* Typography */
  --font-base: "Open Sans", sans-serif;
  --font-size-base: 16px;
  --font-size-sm: 0.875rem;
  --font-size-lg: 1.125rem;
  --line-height-base: 1.6;
  --line-height-heading: 1.2;
  --font-weight-normal: 400;
  --font-weight-medium: 600;
  --font-weight-bold: 700;

  /* Spacing Scale */
  --space-xs: 0.25rem;    /* 4px */
  --space-sm: 0.5rem;     /* 8px */
  --space-md: 1rem;       /* 16px */
  --space-lg: 1.5rem;     /* 24px */
  --space-xl: 2rem;       /* 32px */
  --space-2xl: 3rem;      /* 48px */
  --space-3xl: 4rem;      /* 64px */

  /* Layout */
  --max-width: 1200px;
  --max-width-sm: 850px;
  --header-height: 80px;
  --logo-height: 60px;
  --submenu-width: 200px;

  /* Border Radius */
  --radius-sm: 0.25rem;
  --radius: 0.5rem;
  --radius-lg: 1rem;
  --radius-pill: 50px;
  --radius-round: 4rem;

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 10px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.15);

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

  /* Z-Index Scale */
  --z-dropdown: 100;
  --z-sticky: 1000;
  --z-modal: 2000;
}

/* ==========================================================================
   Reset & Base Styles
   ========================================================================== */

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

html {
  font-size: var(--font-size-base);
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-base);
  font-size: 1rem;
  line-height: var(--line-height-base);
  color: var(--color-text);
  background-color: var(--color-bg);
  font-weight: var(--font-weight-normal);
  overflow-x: hidden;
}

/* ==========================================================================
   Typography
   ========================================================================== */

h1,
h2,
h3,
h4,
h5,
h6 {
  margin-bottom: var(--space-md);
  line-height: var(--line-height-heading);
  font-weight: var(--font-weight-bold);
  color: var(--color-text);
}

h1 {
  font-size: clamp(1.75rem, 5vw, 2.5rem);
}

h2 {
  font-size: clamp(1.5rem, 4vw, 2rem);
}

h3 {
  font-size: clamp(1.25rem, 3vw, 1.5rem);
}

h4 {
  font-size: 1.2rem;
}

p {
  margin-bottom: var(--space-md);
  color: var(--color-text);
}

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

a:hover {
  color: var(--color-primary);
}

a:focus {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

li {
  list-style: none;
}

/* ==========================================================================
   Accessibility
   ========================================================================== */

/* Skip to main content link */
.skip-to-content {
  position: absolute;
  top: -100px;
  left: 0;
  background: var(--color-primary);
  color: var(--color-white);
  padding: var(--space-sm) var(--space-md);
  text-decoration: none;
  z-index: var(--z-modal);
  border-radius: 0 0 var(--radius) 0;
}

.skip-to-content:focus {
  top: 0;
  outline: none;
}

/* Focus visible styles for keyboard navigation */
:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

/* ==========================================================================
   Layout Components
   ========================================================================== */

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: var(--space-md);
  width: 100%;
}

.small-container {
  max-width: var(--max-width-sm);
  margin: 0 auto;
}

.grid {
  display: grid;
  gap: var(--space-xl);
  grid-template-columns: 1fr;
  align-items: center;
}

.container-gap {
  display: grid;
  gap: var(--space-xl);
}

/* Sections */
section {
  padding: var(--space-xl) 0;
}

.services-intro {
  text-align: center;
  margin-bottom: var(--space-lg);
}

/* ==========================================================================
   Header & Navigation (Mobile-First)
   ========================================================================== */

header {
  background-color: var(--color-white);
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: 0;
  z-index: var(--z-sticky);
}

.nav-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: var(--space-xs) !important;
  padding-bottom: var(--space-xs) !important;
  position: relative;
}

.nav-bar .btn {
  padding: var(--space-xs) var(--space-md);
}

.logo {
  height: var(--logo-height);
  width: auto;
  border-radius: 0;
  box-shadow: none;
}

/* Mobile Menu Toggle (Hidden Checkbox Hack) */
.mobile-menu-toggle {
  display: none;
}

/* Hamburger Icon */
.hamburger {
  display: flex;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  padding: var(--space-sm);
  z-index: calc(var(--z-sticky) + 10);
}

.hamburger span {
  width: 25px;
  height: 3px;
  background-color: var(--color-text);
  transition: all var(--transition-base);
  border-radius: var(--radius-sm);
}

/* Hamburger animation when menu is open */
.mobile-menu-toggle:checked ~ .hamburger span:first-child {
  transform: rotate(45deg) translate(7px, 7px);
}

.mobile-menu-toggle:checked ~ .hamburger span:nth-child(2) {
  opacity: 0;
}

.mobile-menu-toggle:checked ~ .hamburger span:last-child {
  transform: rotate(-45deg) translate(7px, -7px);
}

/* Navigation Menu (Mobile) */
.nav-menu {
  position: fixed;
  top: 0;
  right: -100%;
  width: 80%;
  max-width: 300px;
  height: 100vh;
  background-color: var(--color-white);
  box-shadow: var(--shadow-lg);
  padding: var(--space-3xl) var(--space-lg) var(--space-lg);
  transition: right var(--transition-base);
  overflow-y: auto;
  z-index: calc(var(--z-sticky) + 5);
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.mobile-menu-toggle:checked ~ .nav-menu {
  right: 0;
}

.nav-menu li {
  position: relative;
}

.nav-menu > li > a {
  color: var(--color-text);
  padding: var(--space-sm) 0;
  display: block;
  font-weight: var(--font-weight-medium);
}

.nav-menu > li > a.active {
  color: var(--color-primary);
  font-weight: var(--font-weight-bold);
}

.nav-menu > li > a:hover {
  color: var(--color-primary);
}

/* Submenu (Mobile) - Always visible for better UX */
.submenu {
  display: block;
  padding-left: var(--space-md);
  margin-top: var(--space-sm);
  border-left: 2px solid var(--color-primary-light);
}

.submenu li {
  margin-bottom: var(--space-xs);
}

.submenu a {
  color: var(--color-text-light);
  font-size: var(--font-size-sm);
  padding: var(--space-xs) 0;
  display: block;
}

.submenu a:hover,
.submenu a.active {
  color: var(--color-primary);
}

/* ==========================================================================
   Buttons
   ========================================================================== */

.btn {
  background-color: var(--color-primary);
  color: var(--color-white) !important;
  padding: var(--space-sm) var(--space-lg);
  border-radius: var(--radius-pill);
  cursor: pointer;
  display: inline-block;
  line-height: normal;
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-base);
  font-weight: var(--font-weight-medium);
  border: 2px solid transparent;
  text-align: center;
}

.btn:hover {
  background-color: var(--color-primary-dark);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.btn:active {
  transform: translateY(0);
}

.btn:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(182, 85, 42, 0.3);
}

/* ==========================================================================
   Images
   ========================================================================== */

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

section img,
.hero-sec img,
.service-card img {
  border-radius: var(--radius-round);
  box-shadow: var(--shadow-md);
}

/* ==========================================================================
   Cards & Components
   ========================================================================== */

/* Our Cards */
.our-card-container {
  display: grid;
  gap: var(--space-md);
  grid-template-columns: 1fr;
}

.our-card {
  background-color: var(--color-primary-light);
  padding: var(--space-lg);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  transition: transform var(--transition-base);
}

.our-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

/* Service Cards */
.service-card {
  background-color: var(--color-primary-light);
  padding: var(--space-lg);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: flex-start;
  transition: transform var(--transition-base);
}

.service-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.service-card h3 {
  margin-bottom: var(--space-md);
}

.card-space {
  gap: var(--space-lg) !important;
}

/* ==========================================================================
   Service Pages
   ========================================================================== */

.services-page {
  padding-top: 0px !important;
}

.services-page h3 {
  margin-top: var(--space-lg);
}

.services-list li {
  margin-bottom: var(--space-md);
  line-height: 1.4;
  list-style-type: "✓  ";
  margin-left: var(--space-xl);
  color: var(--color-text);
}

.services-page .grid {
  align-items: start;
}

.second-row {
  margin-top: var(--space-3xl);
}

/* ==========================================================================
   Contact Page
   ========================================================================== */

.contact {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.contact h3 {
  margin-bottom: var(--space-sm);
  font-size: 1rem;
  color: var(--color-primary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.contact p {
  margin-bottom: 0;
}

/* Contact Form Styles */
.contact-form {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}

.form-group label {
  font-weight: var(--font-weight-medium);
  color: var(--color-text);
  font-size: var(--font-size-sm);
}

.form-group input,
.form-group textarea {
  padding: var(--space-sm) var(--space-md);
  border: 2px solid #ddd;
  border-radius: var(--radius);
  font-family: var(--font-base);
  font-size: 1rem;
  transition: border-color var(--transition-fast);
}

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

.form-group input.error,
.form-group textarea.error {
  border-color: var(--color-error);
}

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

.error-message {
  display: none;
  color: var(--color-error);
  font-size: var(--font-size-sm);
  margin-top: var(--space-xs);
}

form button {
  margin-top: var(--space-md);
}

/* Careers Page */
.vacancy {
  margin-top: var(--space-xl);
  font-style: italic;
  text-align: center;
  color: var(--color-text-light);
}

/* ==========================================================================
   Footer
   ========================================================================== */

footer {
  background-color: var(--color-primary);
  color: var(--color-white);
  padding: var(--space-2xl) 0 var(--space-lg);
  margin-top: var(--space-3xl);
}

footer a {
  color: var(--color-white);
  transition: opacity var(--transition-fast);
}

footer a:hover {
  opacity: 0.8;
  color: var(--color-white);
}

footer a:focus {
  outline-color: var(--color-white);
}

footer p {
  color: var(--color-white);
}

footer h3 {
  margin-bottom: var(--space-md);
  color: var(--color-primary-light);
  font-size: 1.1rem;
  font-weight: var(--font-weight-bold);
}

footer ul li {
  margin-bottom: var(--space-sm);
}

.footer-grid {
  grid-template-columns: 1fr;
  gap: var(--space-xl);
  margin-bottom: var(--space-lg);
}

.foot-p {
  text-align: center;
  margin-top: var(--space-xl);
  padding-top: var(--space-lg);
  border-top: 1px solid rgba(255, 255, 255, 0.2);
  font-size: var(--font-size-sm);
}

/* ==========================================================================
   Responsive Design - Mobile First Approach
   ========================================================================== */

/* Small tablets and large phones (576px and up) */
@media (min-width: 576px) {
  .container {
    padding: var(--space-lg);
  }
  
  .grid {
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  }
  
  .our-card-container {
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  }
}

/* Tablets (768px and up) */
@media (min-width: 768px) {
  :root {
    --font-size-base: 17px;
    --logo-height: 70px;
  }
  
  .container {
    padding: var(--space-xl);
  }
  
  section {
    padding: var(--space-2xl) 0;
  }
  
  /* Hide hamburger menu on desktop */
  .hamburger {
    display: none;
  }
  
  /* Desktop Navigation */
  .nav-menu {
    position: static;
    width: auto;
    max-width: none;
    height: auto;
    background: transparent;
    box-shadow: none;
    padding: 0;
    flex-direction: row;
    gap: var(--space-xl);
    overflow: visible;
    align-items: center;
  }
  
  .nav-menu > li > a {
    padding: var(--space-xs) 0;
  }
  
  /* Desktop Submenu - Dropdown on hover */
  .submenu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    width: var(--submenu-width);
    background-color: var(--color-white);
    box-shadow: var(--shadow-md);
    border-radius: var(--radius);
    padding: var(--space-md);
    margin-top: 0px;
    border-left: none;
    z-index: var(--z-dropdown);
  }

  .has-submenu:hover .submenu,
  .has-submenu:focus-within .submenu {
    display: block;
  }
  
  .submenu li {
    margin-bottom: var(--space-sm);
  }
  
  .submenu li:last-child {
    margin-bottom: 0;
  }
  
  .footer-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Desktop (1024px and up) */
@media (min-width: 1024px) {
  :root {
    --logo-height: 80px;
  }
  
  .nav-bar {
    padding-top: var(--space-md);
    padding-bottom: var(--space-md);
  }
  
  .grid {
    gap: var(--space-3xl);
  }
  
  .footer-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* Large desktops (1280px and up) */
@media (min-width: 1280px) {
  .container {
    padding: var(--space-xl) var(--space-2xl);
  }
}

/* ==========================================================================
   Entrance Animations - Subtle & Performant
   ========================================================================== */

/* Keyframe Animations */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* Base animation for sections */
section,
.hero-section {
  animation: fadeInUp 0.5s ease-out backwards;
}

/* Header entrance */
header {
  animation: fadeIn 0.4s ease-out;
}

/* Stagger animation for grid items */
.grid > *:nth-child(1) {
  animation: fadeInUp 0.5s ease-out 0.1s backwards;
}

.grid > *:nth-child(2) {
  animation: fadeInUp 0.5s ease-out 0.2s backwards;
}

.grid > *:nth-child(3) {
  animation: fadeInUp 0.5s ease-out 0.3s backwards;
}

.grid > *:nth-child(4) {
  animation: fadeInUp 0.5s ease-out 0.4s backwards;
}

.grid > *:nth-child(5) {
  animation: fadeInUp 0.5s ease-out 0.5s backwards;
}

.grid > *:nth-child(6) {
  animation: fadeInUp 0.5s ease-out 0.6s backwards;
}

/* Service cards stagger */
.service-card {
  animation: fadeInUp 0.5s ease-out backwards;
}

.service-card:nth-child(1) {
  animation-delay: 0.15s;
}

.service-card:nth-child(2) {
  animation-delay: 0.25s;
}

.service-card:nth-child(3) {
  animation-delay: 0.35s;
}

.service-card:nth-child(4) {
  animation-delay: 0.45s;
}

/* Footer entrance */
footer {
  animation: fadeIn 0.4s ease-out 0.2s backwards;
}

/* Respect user's motion preferences */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ==========================================================================
   Breadcrumb Navigation
   ========================================================================== */

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  list-style: none;
  padding: var(--space-md) 0;
  margin: 0;
  font-size: var(--font-size-sm);
  color: var(--color-text-light);
}

.breadcrumb li {
  display: flex;
  align-items: center;
}

.breadcrumb li:not(:last-child)::after {
  content: "›";
  margin: 0 var(--space-sm);
  color: var(--color-text-light);
  font-weight: var(--font-weight-normal);
}

.breadcrumb a {
  color: var(--color-primary);
  text-decoration: none;
  transition: color 0.2s ease;
}

.breadcrumb a:hover,
.breadcrumb a:focus {
  color: var(--color-primary-dark);
  text-decoration: underline;
}

.breadcrumb li:last-child span {
  color: var(--color-text);
  font-weight: var(--font-weight-medium);
}

/* ==========================================================================
   Print Styles
   ========================================================================== */

@media print {
  header,
  footer,
  .btn,
  .hamburger,
  .skip-to-content {
    display: none !important;
  }
  
  body {
    background: white;
    color: black;
  }
  
  a {
    text-decoration: underline;
  }
  
  img {
    max-width: 100%;
    page-break-inside: avoid;
  }
}