/*!
 * Meterizi Traditional Guesthouses - Optimized Styles
 * Modern, accessible, and performance-focused CSS
 * Works with Bootstrap 5.2.3
 */

/* CSS Custom Properties for better performance */
:root {
  /* Brand Colors */
  --primary-color: #64a19d;
  --primary-dark: #50817e;
  --secondary-color: #7464a1;
  --accent-color: #e4c662;
  --success-color: #67c29c;
  --warning-color: #e4c662;
  --danger-color: #a16468;

  /* Neutral Colors */
  --white: #ffffff;
  --black: #000000;
  --gray-100: #f8f9fa;
  --gray-200: #e9ecef;
  --gray-300: #dee2e6;
  --gray-400: #ced4da;
  --gray-500: #adb5bd;
  --gray-600: #6c757d;
  --gray-700: #495057;
  --gray-800: #343a40;
  --gray-900: #212529;

  /* Typography */
  --font-family-primary: "Varela Round", system-ui, -apple-system, "Segoe UI",
    Roboto, sans-serif;
  --font-size-base: 1rem;
  --font-size-sm: 0.875rem;
  --font-size-lg: 1.125rem;
  --line-height-base: 1.6;

  /* Spacing */
  --spacing-xs: 0.25rem;
  --spacing-sm: 0.5rem;
  --spacing-md: 1rem;
  --spacing-lg: 1.5rem;
  --spacing-xl: 3rem;

  /* Border Radius */
  --border-radius-sm: 0.25rem;
  --border-radius-md: 0.375rem;
  --border-radius-lg: 0.5rem;
  --border-radius-xl: 1rem;

  /* Shadows */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1),
    0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1),
    0 4px 6px -2px rgba(0, 0, 0, 0.05);

  /* Transitions */
  --transition-fast: 150ms ease-in-out;
  --transition-normal: 300ms ease-in-out;
  --transition-slow: 500ms ease-in-out;

  /* Z-index scale */
  --z-dropdown: 1000;
  --z-sticky: 1020;
  --z-fixed: 1030;
  --z-modal-backdrop: 1040;
  --z-modal: 1050;
  --z-popover: 1060;
  --z-tooltip: 1070;
}

/* Enhanced Bootstrap Integration */
html {
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

body {
  font-family: var(--font-family-primary);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/* Skip Link for Accessibility */
.skip-link {
  position: absolute;
  top: -40px;
  left: 6px;
  background: var(--primary-color);
  color: var(--white);
  padding: 8px;
  text-decoration: none;
  border-radius: var(--border-radius-sm);
  z-index: var(--z-tooltip);
  transition: top var(--transition-fast);
}

.skip-link:focus {
  top: 6px;
}

/* Enhanced Typography */
h1,
h2,
h3,
h4,
h5,
h6 {
  font-weight: 600;
}

a {
  color: var(--primary-color);
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--primary-dark);
}

a:focus {
  outline: 2px solid var(--primary-color);
  outline-offset: 2px;
}

/* Enhanced Button Styles */
.btn-primary {
  background-color: var(--primary-color);
  border-color: var(--primary-color);
}

.btn-primary:hover {
  background-color: var(--primary-dark);
  border-color: var(--primary-dark);
}

.btn-primary:focus {
  box-shadow: 0 0 0 3px rgba(100, 161, 157, 0.25);
}

/* Enhanced Navigation */
.navbar {
  background-color: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--gray-200);
  transition: all var(--transition-normal);
}

.navbar-shrink {
  background-color: rgba(255, 255, 255, 0.98);
  box-shadow: var(--shadow-md);
}

.navbar-brand img {
  height: 80px;
  width: auto;
  transition: height var(--transition-normal);
}

.navbar-shrink .navbar-brand img {
  height: 60px;
}

.navbar-nav .nav-link {
  color: var(--gray-700);
  font-weight: 500;
  transition: color var(--transition-fast);
}

.navbar-nav .nav-link:hover,
.navbar-nav .nav-link:focus {
  color: var(--primary-color);
}

/* Header/Masthead */
.masthead {
  position: relative;
  width: 100%;
  height: 100vh;
  min-height: 35rem;
  padding: 15rem 0;
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0.3), rgba(0, 0, 0, 0.7)),
    url("../assets/img/a0.jpg") center/cover no-repeat;
  background-attachment: fixed;
}

@media (prefers-reduced-motion: reduce) {
  .masthead {
    background-attachment: scroll;
  }
}

.masthead h1 {
  font-size: clamp(2.5rem, 6vw, 4rem);
  font-weight: 700;
  color: var(--white);
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.masthead h2 {
  font-size: clamp(1.25rem, 3vw, 1.75rem);
  font-weight: 400;
  color: var(--white);
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
}

/* Sections */
section {
  padding: var(--spacing-xl) 0;
}

.guesthouses-section {
  background-color: var(--gray-100);
}

.contact-section {
  background-color: var(--gray-900);
  color: var(--white);
}

/* Enhanced Cards */
.card {
  border-radius: var(--border-radius-lg);
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-normal);
  overflow: hidden;
}

.card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
}

.card-title {
  font-weight: 600;
  color: var(--gray-900);
}

/* Enhanced Carousel */
.carousel-inner {
  border-radius: var(--border-radius-lg) var(--border-radius-lg) 0 0;
}

.carousel-item img {
  height: 250px;
  object-fit: cover;
}

.carousel-control-prev,
.carousel-control-next {
  width: 40px;
  height: 40px;
  background-color: rgba(0, 0, 0, 0.5);
  border-radius: 50%;
  transition: background-color var(--transition-fast);
}

.carousel-control-prev:hover,
.carousel-control-next:hover {
  background-color: rgba(0, 0, 0, 0.7);
}

/* Contact Cards */
.contact-section .card {
  background-color: var(--white);
  border: none;
  box-shadow: var(--shadow-md);
}

.contact-section .card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.contact-section .text-primary {
  color: var(--primary-color) !important;
}

/* Social Links */
.social a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 50px;
  height: 50px;
  background-color: var(--primary-color);
  color: var(--white);
  border-radius: 50%;
  font-size: 1.25rem;
  transition: all var(--transition-normal);
}

.social a:hover {
  background-color: var(--primary-dark);
  color: var(--white);
  transform: translateY(-2px);
  text-decoration: none;
}

/* Footer */
.footer {
  background-color: var(--black);
  color: var(--gray-400);
  padding: var(--spacing-lg) 0;
}

.footer time {
  font-weight: 500;
}

/* Utility Classes */
.text-white {
  color: var(--white) !important;
}
.text-white-50 {
  color: rgba(255, 255, 255, 0.5) !important;
}
.text-dark {
  color: var(--gray-900) !important;
}
.text-black-50 {
  color: rgba(0, 0, 0, 0.5) !important;
}
.text-primary {
  color: var(--primary-color) !important;
}

.bg-light {
  background-color: var(--gray-100) !important;
}
.bg-black {
  background-color: var(--black) !important;
}

/* Responsive Design */
@media (max-width: 768px) {
  .masthead {
    padding: 8rem 0;
    min-height: 25rem;
  }

  .navbar-brand img {
    height: 60px;
  }

  .navbar-shrink .navbar-brand img {
    height: 50px;
  }
}

@media (max-width: 576px) {
  .masthead {
    padding: 6rem 0;
    min-height: 20rem;
  }

  .navbar-brand img {
    height: 50px;
  }

  .carousel-item img {
    height: 200px;
  }
}

/* Keyboard Navigation */
.keyboard-navigation *:focus {
  outline: 2px solid var(--primary-color);
  outline-offset: 2px;
}

/* Print Styles */
@media print {
  .navbar,
  .social,
  .carousel-control-prev,
  .carousel-control-next {
    display: none !important;
  }

  .masthead {
    background: none !important;
    color: var(--black) !important;
    height: auto !important;
    padding: var(--spacing-md) 0 !important;
  }

  .card {
    box-shadow: none !important;
    border: 1px solid var(--gray-300) !important;
  }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
  :root {
    --primary-color: #0066cc;
    --primary-dark: #004499;
    --gray-900: #000000;
    --gray-700: #333333;
  }

  .card {
    border: 2px solid var(--gray-900);
  }

  .btn-primary {
    border: 2px solid var(--primary-color);
  }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
  .card:hover {
    transform: none;
  }

  .social a:hover {
    transform: none;
  }

  .navbar-shrink .navbar-brand img {
    height: 80px;
  }
}
