/*
Theme Name: Metaphysical Store Finder Theme
Description: A modern, responsive WordPress theme for metaphysical store directory website
Version: 1.0
Author: Custom Theme
*/

/* Reset and Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  -ms-text-size-adjust: 100%;
}

body {
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  line-height: 1.6;
  color: #333;
  background-color: #f8f9fa;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  position: relative;
}

body.menu-open {
  overflow: hidden;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Header Styles */
.site-header {
  background: #fff;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  position: sticky;
  top: 0;
  z-index: 1000;
  will-change: transform;
  backface-visibility: hidden;
}

.header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 0;
}

.site-logo img {
  max-height: 90px;
  width: auto;
}

.main-navigation ul {
  display: flex;
  list-style: none;
  gap: 2rem;
}

.main-navigation a {
  text-decoration: none;
  color: #333;
  font-weight: 500;
  transition: color 0.3s ease;
}

.main-navigation a:hover {
  color: #6f42c1;
}

/* Mobile Menu Styles */
.mobile-menu-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  flex-direction: column;
  gap: 4px;
  z-index: 1001;
}

.hamburger-line {
  width: 25px;
  height: 3px;
  background: #333;
  transition: all 0.3s ease;
  border-radius: 2px;
}

.mobile-menu-toggle.active .hamburger-line:nth-child(2) {
  transform: rotate(45deg) translate(5px, 5px);
}

.mobile-menu-toggle.active .hamburger-line:nth-child(3) {
  opacity: 0;
}

.mobile-menu-toggle.active .hamburger-line:nth-child(4) {
  transform: rotate(-45deg) translate(7px, -6px);
}

.mobile-navigation {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  background: rgba(0, 0, 0, 0.8);
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.mobile-navigation.active {
  display: block;
  opacity: 1;
  visibility: visible;
}

.mobile-menu-content {
  position: absolute;
  top: 0;
  right: 0;
  width: 280px;
  height: 100vh;
  background: #fff;
  padding: 2rem 0;
  transform: translateX(100%);
  transition: transform 0.3s ease;
  overflow-y: auto;
}

.mobile-navigation.active .mobile-menu-content {
  transform: translateX(0);
}

.mobile-navigation ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.mobile-navigation li {
  border-bottom: 1px solid #e9ecef;
}

.mobile-navigation li:last-child {
  border-bottom: none;
}

.mobile-navigation a {
  display: block;
  padding: 1rem 2rem;
  text-decoration: none;
  color: #333;
  font-weight: 500;
  transition: all 0.3s ease;
}

.mobile-navigation a:hover,
.mobile-navigation a:focus {
  background-color: #f8f9fa;
  color: #6f42c1;
}

/* Screen Reader Only */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Hero Section */
.hero-section {
  height: 200px;
  background: linear-gradient(rgba(111, 66, 193, 0.7), rgba(111, 66, 193, 0.7)),
    url("assets/hero-section.png");
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: white;
}

.hero-content h1 {
  font-size: 3.5rem;
  margin-bottom: 1rem;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.hero-content p {
  font-size: 1.2rem;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}

/* Card Layouts */
.cards-grid {
  display: grid;
  gap: 2rem;
  margin: 2rem 0;
}

.cards-grid.four-columns {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.cards-grid.three-columns {
  grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
}

.cards-grid.two-columns {
  grid-template-columns: repeat(auto-fit, minmax(450px, 1fr));
}

.card {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.card-image {
  width: 100%;
  height: 200px;
  object-fit: cover;
}

.card-content {
  padding: 1.5rem;
}

.card-title {
  font-size: 1.2rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: #333;
}

.card-title a {
  text-decoration: none;
  color: inherit;
}

.card-title a:hover {
  color: #6f42c1;
}

.card-meta {
  font-size: 0.9rem;
  color: #666;
  margin-bottom: 1rem;
}

.card-description {
  color: #555;
  line-height: 1.5;
}

/* Rating Styles */
.rating {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0.5rem 0;
}

.stars {
  color: #ffc107;
}

.rating-text {
  font-size: 0.9rem;
  color: #666;
}

/* Work Hours Styles */
.work-hours {
  background: #f8f9fa;
  border-radius: 8px;
  padding: 1rem;
  margin: 1rem 0;
}

.work-hours h4 {
  margin-bottom: 0.5rem;
  color: #333;
}

.hours-list {
  list-style: none;
}

.hours-list li {
  display: flex;
  justify-content: space-between;
  padding: 0.25rem 0;
  border-bottom: 1px solid #e9ecef;
}

.hours-list li:last-child {
  border-bottom: none;
}

.day {
  font-weight: 500;
  text-transform: capitalize;
}

.time {
  color: #666;
}

/* Contact Info Styles */
.contact-info {
  background: #f8f9fa;
  border-radius: 8px;
  padding: 1rem;
  margin: 1rem 0;
}

.contact-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.contact-item:last-child {
  margin-bottom: 0;
}

.contact-icon {
  width: 20px;
  height: 20px;
  color: #6f42c1;
}

/* Attributes Styles */
.attributes {
  margin: 1rem 0;
}

.attributes h4 {
  margin-bottom: 0.5rem;
  color: #333;
}

.attribute-group {
  margin-bottom: 1rem;
}

.attribute-group h5 {
  color: #6f42c1;
  margin-bottom: 0.5rem;
  text-transform: capitalize;
}

.attribute-list {
  list-style: none;
  padding-left: 1rem;
}

.attribute-list li {
  position: relative;
  padding: 0.25rem 0;
  color: #555;
}

.attribute-list li:before {
  content: "✓";
  position: absolute;
  left: -1rem;
  color: #28a745;
  font-weight: bold;
}

/* Review Topics Styles */
.review-topics {
  background: #f8f9fa;
  border-radius: 8px;
  padding: 1rem;
  margin: 1rem 0;
}

.topics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.topic-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #fff;
  padding: 0.5rem;
  border-radius: 6px;
  border-left: 3px solid #6f42c1;
}

.topic-name {
  font-weight: 500;
  text-transform: capitalize;
}

.topic-count {
  background: #6f42c1;
  color: white;
  padding: 0.2rem 0.5rem;
  border-radius: 12px;
  font-size: 0.8rem;
}

/* Dropdown Styles */
.search-section {
  background: #fff;
  padding: 3rem 0;
  margin: 2rem 0;
}

.dropdown-container {
  display: flex;
  gap: 1rem;
  max-width: 600px;
  margin: 2rem auto;
}

.dropdown-wrapper {
  flex: 1;
}

.dropdown-wrapper label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
  color: #333;
}

.dropdown-wrapper select {
  width: 100%;
  padding: 0.75rem;
  border: 2px solid #e9ecef;
  border-radius: 8px;
  font-size: 1rem;
  background: #fff;
  transition: border-color 0.3s ease;
}

.dropdown-wrapper select:focus {
  outline: none;
  border-color: #6f42c1;
}

/* Breadcrumbs */
.breadcrumbs {
  background: #fff;
  padding: 1rem 0;
  border-bottom: 1px solid #e9ecef;
}

.breadcrumb-list {
  display: flex;
  list-style: none;
  gap: 0.5rem;
  align-items: center;
}

.breadcrumb-list li:not(:last-child):after {
  content: "›";
  margin-left: 0.5rem;
  color: #666;
}

.breadcrumb-list a {
  text-decoration: none;
  color: #6f42c1;
}

.breadcrumb-list a:hover {
  text-decoration: underline;
}

/* Footer Styles */
.site-footer {
  background: #333;
  color: #fff;
  padding: 3rem 0 1rem;
  margin-top: 4rem;
}

.footer-content {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
  margin-bottom: 2rem;
}

.footer-logo img {
  max-height: 80px;
  width: auto;
  margin-bottom: 1rem;
}

.footer-menu ul {
  list-style: none;
}

.footer-menu a {
  color: #ccc;
  text-decoration: none;
  transition: color 0.3s ease;
}

.footer-menu a:hover {
  color: #fff;
}

.footer-bottom {
  text-align: center;
  padding-top: 2rem;
  border-top: 1px solid #555;
  color: #ccc;
}

/* Section Styles */
.section {
  padding: 3rem 0;
}

.section-title {
  text-align: center;
  margin-bottom: 2rem;
  color: #333;
  font-size: 2.5rem;
}

.section h3 {
  text-align: center;
  margin-bottom: 2rem;
  color: #333;
  font-size: 2rem;
}

/* Navigation Links */
.nav-link {
  display: inline-block;
  background: #6f42c1;
  color: #fff;
  padding: 0.75rem 1.5rem;
  text-decoration: none;
  border-radius: 6px;
  margin: 1rem 0;
  transition: background-color 0.3s ease;
}

.nav-link:hover {
  background: #5a2d91;
  color: #fff;
}

/* Single Post Styles */
.single-post-header {
  background: #fff;
  padding: 2rem 0;
  margin-bottom: 2rem;
}

.single-post-content {
  background: #fff;
  padding: 2rem;
  border-radius: 12px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  margin-bottom: 2rem;
}

.post-image {
  width: 100%;
  max-width: 600px;
  height: 400px;
  object-fit: cover;
  border-radius: 8px;
  margin: 1rem 0;
}

/* Featured Image Styles for Single Posts */
.featured-image {
  margin: 2rem 0;
  text-align: center;
}

.featured-image img {
  width: 100%;
  max-width: 400px;
  height: auto;
  border-radius: 12px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.featured-image-single {
  width: 100%;
  max-width: 400px;
  height: auto;
  border-radius: 12px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  display: block;
  margin: 0 auto;
}

/* Responsive Design */
@media (max-width: 768px) {
  /* Header Mobile Styles */
  .header-content {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
  }

  .site-logo img {
    max-height: 50px;
  }

  /* Hide desktop navigation on mobile */
  .main-navigation {
    display: none;
  }

  /* Show mobile menu toggle on mobile */
  .mobile-menu-toggle {
    display: flex;
  }

  /* Hero Section Mobile */
  .hero-section {
    height: 150px;
    background-attachment: scroll;
  }

  .hero-content h1 {
    font-size: 2.5rem;
  }

  .hero-content p {
    font-size: 1.1rem;
  }

  /* Search Section Mobile */
  .dropdown-container {
    flex-direction: column;
    max-width: 100%;
  }

  /* Cards Grid Mobile */
  .cards-grid.four-columns,
  .cards-grid.three-columns,
  .cards-grid.two-columns {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .cards-grid.four-columns {
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  }

  /* Section Titles Mobile */
  .section-title {
    font-size: 2rem;
  }

  .section h3 {
    font-size: 1.5rem;
  }

  /* Section Padding Mobile */
  .section {
    padding: 2rem 0;
  }

  /* Single Post Mobile */
  .single-post-content {
    padding: 1.5rem;
  }

  /* Footer Mobile */
  .footer-content {
    grid-template-columns: 1fr;
    gap: 2rem;
    text-align: center;
  }

  .footer-section {
    margin-bottom: 1rem;
  }

  /* Breadcrumbs Mobile */
  .breadcrumb-list {
    flex-wrap: wrap;
    gap: 0.25rem;
  }

  .breadcrumb-list li {
    font-size: 0.9rem;
  }
}

@media (max-width: 480px) {
  /* Container Mobile */
  .container {
    padding: 0 15px;
  }

  /* Header Extra Small */
  .site-logo img {
    max-height: 50px;
  }

  .header-content {
    padding: 0.75rem 0;
  }

  /* Hero Extra Small */
  .hero-section {
    height: 120px;
  }

  .hero-content h1 {
    font-size: 1.8rem;
    margin-bottom: 0.5rem;
  }

  .hero-content p {
    font-size: 1rem;
  }

  /* Cards Extra Small */
  .card-content {
    padding: 1rem;
  }

  .card-title {
    font-size: 1.1rem;
  }

  .card-meta {
    font-size: 0.85rem;
  }

  /* Section Titles Extra Small */
  .section-title {
    font-size: 1.75rem;
  }

  .section h3 {
    font-size: 1.25rem;
  }

  /* Section Padding Extra Small */
  .section {
    padding: 1.5rem 0;
  }

  /* Single Post Extra Small */
  .single-post-content {
    padding: 1rem;
  }

  /* Navigation Links Extra Small */
  .nav-link {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
  }

  /* Topics Grid Extra Small */
  .topics-grid {
    grid-template-columns: 1fr;
  }

  /* Work Hours Extra Small */
  .hours-list li {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.25rem;
  }

  /* Contact Info Extra Small */
  .contact-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.25rem;
  }
}

/* Landscape Mobile Devices */
@media (max-width: 768px) and (orientation: landscape) {
  .hero-section {
    height: 100px;
  }

  .hero-content h1 {
    font-size: 2rem;
  }

  .hero-content p {
    font-size: 1rem;
  }
}

/* Utility Classes */
.text-center {
  text-align: center;
}

.mb-1 {
  margin-bottom: 0.5rem;
}
.mb-2 {
  margin-bottom: 1rem;
}
.mb-3 {
  margin-bottom: 1.5rem;
}
.mb-4 {
  margin-bottom: 2rem;
}

.mt-1 {
  margin-top: 0.5rem;
}
.mt-2 {
  margin-top: 1rem;
}
.mt-3 {
  margin-top: 1.5rem;
}
.mt-4 {
  margin-top: 2rem;
}

.hidden {
  display: none;
}

/* Additional Mobile Optimizations */
@media (max-width: 768px) {
  /* Fix touch targets */
  button,
  input,
  select,
  textarea,
  a {
    min-height: 44px;
    min-width: 44px;
  }

  /* Improve form elements */
  input,
  select,
  textarea {
    font-size: 16px; /* Prevents zoom on iOS */
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
  }

  /* Fix sticky header issues */
  .site-header {
    position: -webkit-sticky;
    position: sticky;
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
  }

  /* Improve card hover on mobile */
  .card:hover {
    transform: none;
  }

  .card:active {
    transform: scale(0.98);
  }

  /* Better mobile navigation */
  .main-navigation {
    max-height: calc(100vh - 80px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  /* Fix viewport issues */
  .hero-section {
    min-height: 120px;
    height: 30vh;
    max-height: 200px;
  }

  /* Improve text readability */
  body {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
  }

  /* Fix image loading */
  img {
    max-width: 100%;
    height: auto;
    display: block;
  }

  /* Improve button accessibility */
  .nav-link,
  button {
    touch-action: manipulation;
  }

  /* Fix horizontal scrolling */
  .container {
    max-width: 100%;
    overflow-x: hidden;
  }

  /* Better spacing for mobile */
  .cards-grid {
    margin: 1rem 0;
    gap: 1rem;
  }

  /* Optimize animations for mobile */
  * {
    -webkit-tap-highlight-color: transparent;
  }

  /* Fix iOS Safari bottom bar issue */
  .hero-section {
    height: calc(var(--vh, 1vh) * 30);
  }
}

/* High DPI displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
  .site-logo img {
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
  }
}

/* Reduce motion for accessibility */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
  /* Keep light theme for now, but structure is ready */
}

/* Print styles */
@media print {
  .site-header,
  .mobile-menu-toggle,
  .nav-link,
  .site-footer {
    display: none !important;
  }

  body {
    background: white !important;
    color: black !important;
  }

  .card {
    box-shadow: none !important;
    border: 1px solid #ccc !important;
  }
}
