/**
 * Custom CSS for Restaurant Hub Theme
 * Version: 1.7.6
 */

/* Base Styles */
:root {
    --primary-color: #3b82f6;
    --secondary-color: #60a5fa;
    --accent-color: #2563eb;
    --light-bg: #ffffff;
    --light-text: #1f2937;
    --dark-bg: #111827;
    --dark-text: #f9fafb;
}

/* Dark mode styles */
html.dark {
    color-scheme: dark;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    transition: background-color 0.3s ease, color 0.3s ease;
}

html.dark body {
    background-color: var(--dark-bg) !important;
    color: var(--dark-text) !important;
}

/* Direct override for main background */
html.dark #primary.site-main,
html.dark .site-main {
    background-color: #111827 !important; /* Very dark background */
}

/* Dark mode overrides for Tailwind elements */
html.dark .dark\:bg-gray-800,
html.dark .bg-white,
html.dark .bg-gray-100,
html.dark .bg-gray-50 {
    background-color: #1f2937 !important;
}

html.dark .dark\:bg-gray-900,
html.dark .site-main,
html.dark #primary {
    background-color: #111827 !important;
}

html.dark .dark\:text-white,
html.dark .text-gray-900 {
    color: #ffffff !important;
}

html.dark .dark\:text-gray-300,
html.dark .text-gray-600,
html.dark .text-gray-700 {
    color: #d1d5db !important;
}

/* Additional dark mode overrides for specific elements */
html.dark .bg-white {
    background-color: #1f2937 !important;
}

html.dark .restaurant-card {
    background-color: #1f2937 !important;
}

html.dark .hero-section {
    background-color: #111827 !important;
}

/* Force dark mode for all sections */
html.dark section {
    background-color: #111827 !important;
}

/* Footer dark mode */
html.dark .site-footer {
    background-color: #1f2937 !important;
}

/* Additional elements to ensure full coverage */
html.dark .container,
html.dark .page-header,
html.dark .entry-header,
html.dark .entry-content {
    color: var(--dark-text) !important;
}

/* Ensure text in buttons is always readable in dark mode */
html.dark .bg-white,
html.dark .bg-gray-50,
html.dark .bg-gray-100,
html.dark .bg-gray-200,
html.dark .dark\:bg-gray-700,
html.dark .dark\:bg-gray-800,
html.dark .dark\:bg-gray-900 {
    color: var(--dark-text) !important;
}

/* Fix for state buttons and other UI elements in dark mode */
html.dark a div,
html.dark button div,
html.dark .text-gray-900 {
    color: var(--dark-text) !important;
}

/* Header Styles */
.site-header {
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* Ensure header has dark background in dark mode */
html.dark .site-header {
    background-color: #1f2937 !important;
    color: var(--dark-text) !important;
    border-bottom: 1px solid #374151 !important;
}

/* Ensure all containers have proper background */
html.dark .container {
    background-color: transparent !important;
}

/* Hero Section */
.hero-section {
    position: relative;
    height: 70vh;
    min-height: 500px;
    background-size: cover;
    background-position: center;
    color: #fff;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
}

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

/* Restaurant Cards */
.restaurant-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.restaurant-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

/* Restaurant Carousel */
.restaurant-carousel .slick-prev,
.restaurant-carousel .slick-next {
    z-index: 10;
    width: 40px;
    height: 40px;
    background: var(--primary-color);
    border-radius: 50%;
}

.restaurant-carousel .slick-prev:before,
.restaurant-carousel .slick-next:before {
    opacity: 1;
}

.restaurant-carousel .slick-prev {
    left: -20px;
}

.restaurant-carousel .slick-next {
    right: -20px;
}

/* Price Range */
.price-range {
    color: #10b981;
    font-weight: 600;
}

/* Taxonomy Pages */
.taxonomy-description {
    margin-bottom: 2rem;
}

/* Dark Mode Toggle */
.dark-mode-toggle {
    cursor: pointer;
    display: flex;
    align-items: center;
}

.dark-mode-toggle svg {
    width: 24px;
    height: 24px;
}

/* Restaurant Details */
.restaurant-detail-section {
    padding: 2rem 0;
}

.restaurant-detail-header {
    margin-bottom: 2rem;
}

.restaurant-detail-meta {
    margin-bottom: 1rem;
}

/* Google Map */
.restaurant-map {
    height: 400px;
    margin-top: 2rem;
    border-radius: 0.5rem;
    overflow: hidden;
}

/* Advertisement Styles */
.ad-728x90-container,
.ad-970x250-container,
.ad-300x250-container,
.ad-300x600-container,
.ad-sidebar-container {
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    margin: 1.5rem 0;
    width: 100%;
    clear: both;
}

.ad-728x90-container {
    min-height: 90px;
}

.ad-970x250-container {
    min-height: 250px;
}

.ad-300x250-container {
    min-height: 250px;
}

.ad-300x600-container {
    min-height: 600px;
}

/* Ensure ads are visible but don't affect layout too much on mobile */
@media (max-width: 768px) {
    .ad-728x90-container,
    .ad-970x250-container {
        overflow-x: auto;
    }
}

/* Media Queries */
@media (max-width: 640px) {
    .hero-section {
        height: 50vh;
        min-height: 400px;
    }
    
    .restaurant-carousel .slick-prev {
        left: 10px;
    }
    
    .restaurant-carousel .slick-next {
        right: 10px;
    }
}

/* Accessibility */
.screen-reader-text {
    border: 0;
    clip: rect(1px, 1px, 1px, 1px);
    clip-path: inset(50%);
    height: 1px;
    margin: -1px;
    overflow: hidden;
    padding: 0;
    position: absolute;
    width: 1px;
    word-wrap: normal !important;
}

/* Page and Post Content Spacing Improvements */
/* Only apply to regular pages and posts, not restaurant pages */
.page-template-default .entry-content,
.single-post .entry-content {
    line-height: 1.8;
}

.page-template-default .entry-content p,
.single-post .entry-content p {
    margin-bottom: 1.5rem;
    line-height: 1.8;
}

.page-template-default .entry-content h1,
.single-post .entry-content h1 {
    font-size: 2.5rem;
    margin-top: 2.5rem;
    margin-bottom: 1.5rem;
    line-height: 1.2;
}

.page-template-default .entry-content h2,
.single-post .entry-content h2 {
    font-size: 2rem;
    margin-top: 2rem;
    margin-bottom: 1.25rem;
    line-height: 1.3;
}

.page-template-default .entry-content h3,
.single-post .entry-content h3 {
    font-size: 1.5rem;
    margin-top: 1.75rem;
    margin-bottom: 1rem;
    line-height: 1.4;
}

.page-template-default .entry-content h4,
.single-post .entry-content h4 {
    font-size: 1.25rem;
    margin-top: 1.5rem;
    margin-bottom: 0.875rem;
    line-height: 1.5;
}

.page-template-default .entry-content ul,
.page-template-default .entry-content ol,
.single-post .entry-content ul,
.single-post .entry-content ol {
    margin-bottom: 1.5rem;
    padding-left: 2rem;
}

.page-template-default .entry-content li,
.single-post .entry-content li {
    margin-bottom: 0.5rem;
    line-height: 1.7;
}

.page-template-default .entry-content blockquote,
.single-post .entry-content blockquote {
    margin: 2rem 0;
    padding: 1rem 1.5rem;
    border-left: 4px solid #3b82f6;
    background-color: #f3f4f6;
}

html.dark .page-template-default .entry-content blockquote,
html.dark .single-post .entry-content blockquote {
    background-color: #374151;
    border-left-color: #60a5fa;
}

/* Override Tailwind prose compactness for pages and posts */
.page-template-default .prose,
.single-post .prose {
    max-width: none;
}

.page-template-default .prose :where(p):not(:where([class~="not-prose"] *)),
.single-post .prose :where(p):not(:where([class~="not-prose"] *)) {
    margin-top: 0;
    margin-bottom: 1.5rem;
}

.page-template-default .prose :where(h1):not(:where([class~="not-prose"] *)),
.single-post .prose :where(h1):not(:where([class~="not-prose"] *)) {
    margin-top: 2rem;
    margin-bottom: 1.5rem;
}

.page-template-default .prose :where(h2):not(:where([class~="not-prose"] *)),
.single-post .prose :where(h2):not(:where([class~="not-prose"] *)) {
    margin-top: 2rem;
    margin-bottom: 1.25rem;
}

.page-template-default .prose :where(h3):not(:where([class~="not-prose"] *)),
.single-post .prose :where(h3):not(:where([class~="not-prose"] *)) {
    margin-top: 1.75rem;
    margin-bottom: 1rem;
}

/* Privacy Policy and Legal Pages specific styling */
.page-template-default.privacy-policy .entry-content,
.page-template-default.page-id-10773 .entry-content,
body[class*="privacy"] .entry-content {
    font-size: 1.125rem;
    line-height: 1.9;
}