/*
Theme Name: IsHetDrinkbaar
Theme URI: https://ishetdrinkbaar.nl
Author: IsHetDrinkbaar Team
Author URI: https://ishetdrinkbaar.nl
Description: Clean, fast WordPress theme for water safety information for travelers
Version: 1.0.1
License: GPL v2 or later
Text Domain: ishetdrinkbaar
*/

/* Reset & Base */
*, *::before, *::after {
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 0;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: #1a202c;
    background-color: #ffffff;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6 {
    margin: 0 0 1rem;
    font-weight: 600;
    line-height: 1.2;
    color: #1a202c;
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }
h5 { font-size: 1.125rem; }
h6 { font-size: 1rem; }

p {
    margin: 0 0 1rem;
}

a {
    color: #3B82F6;
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: #2563eb;
    text-decoration: underline;
}

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

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
.site-header {
    background-color: #ffffff;
    border-bottom: 1px solid #e5e7eb;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
}

.site-branding {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1a202c;
}

.site-branding a {
    color: inherit;
    text-decoration: none;
}

/* Navigation */
.main-navigation ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    gap: 2rem;
}

.main-navigation a {
    color: #4b5563;
    font-weight: 500;
    transition: color 0.2s;
}

.main-navigation a:hover {
    color: #3B82F6;
    text-decoration: none;
}

/* Mobile Menu Toggle */
.menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
}

/* Hero Section */
.hero-section {
    background-color: #f3f4f6;
    padding: 4rem 0;
    text-align: center;
}

.hero-title {
    font-size: 3rem;
    margin-bottom: 1rem;
    color: #1a202c;
}

.hero-subtitle {
    font-size: 1.25rem;
    color: #6b7280;
    margin-bottom: 2rem;
}

/* Search Bar */
.search-container {
    max-width: 600px;
    margin: 0 auto;
    position: relative;
}

.search-form {
    position: relative;
    display: flex;
    background: #ffffff;
    border-radius: 50px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    align-items: stretch;
}

.search-form label {
    flex: 1;
    display: flex;
    align-items: center;
    position: relative;
}

.screen-reader-text {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.search-field {
    flex: 1;
    border: none;
    padding: 1rem 1.5rem;
    padding-right: 3rem; /* Space for clear button */
    font-size: 1.125rem;
    outline: none;
    background: transparent;
    width: 100%;
}

.search-field:focus {
    outline: none;
}

.search-clear {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #6b7280;
    cursor: pointer;
    padding: 0.5rem;
    font-size: 1.25rem;
    line-height: 1;
    display: none;
    z-index: 2;
}

.search-clear:hover {
    color: #1a202c;
}

.search-submit {
    background-color: #3B82F6;
    color: white;
    border: none;
    padding: 1rem 2rem;
    font-size: 1.125rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s;
    white-space: nowrap;
    flex-shrink: 0;
}

.search-submit:hover {
    background-color: #2563eb;
}

/* Search Results Dropdown */
.search-results {
    position: absolute;
    top: calc(100% + 0.5rem);
    left: 0;
    right: 0;
    background: white;
    border-radius: 0.5rem;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    max-height: 400px;
    overflow-y: auto;
    display: none;
    z-index: 1000;
}

.search-result-item {
    display: flex;
    padding: 1rem;
    border-bottom: 1px solid #e5e7eb;
    transition: background-color 0.2s;
    cursor: pointer;
    color: #1a202c;
    text-decoration: none;
    align-items: center;
}

.search-result-item:last-child {
    border-bottom: none;
}

.search-result-item:hover,
.search-result-item.active {
    background-color: #f9fafb;
    text-decoration: none;
}

.search-result-item img {
    width: 60px;
    height: 45px;
    object-fit: cover;
    border-radius: 0.25rem;
    margin-right: 1rem;
    flex-shrink: 0;
}

.search-result-content {
    flex: 1;
    min-width: 0;
}

.search-result-content h4 {
    margin: 0 0 0.25rem;
    font-size: 1rem;
    font-weight: 600;
    color: #1a202c;
}

.search-result-content p {
    margin: 0;
    font-size: 0.875rem;
    color: #6b7280;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.no-results,
.search-error {
    padding: 1.5rem;
    text-align: center;
    color: #6b7280;
}

/* Search form loading state */
.search-form.searching::after {
    content: '';
    position: absolute;
    right: calc(2rem + 120px); /* Account for button width */
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    border: 2px solid #3B82F6;
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: translateY(-50%) rotate(360deg); }
}

/* Content Layout - Improved Sidebar Width */
.site-content {
    display: flex;
    gap: 3rem;
    margin: 3rem 0;
}

.content-area {
    flex: 1;
    min-width: 0; /* Prevents flex overflow */
}

.widget-area {
    flex: 0 0 380px; /* Increased from 300px to 380px for better content display */
}

/* Country Card */
.country-card {
    background: white;
    border-radius: 0.5rem;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s, box-shadow 0.2s;
}

.country-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.country-card-image {
    aspect-ratio: 4/3;
    overflow: hidden;
    background-color: #f3f4f6;
}

.country-card-content {
    padding: 1.5rem;
}

.country-card-title {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
}

.country-card-excerpt {
    color: #6b7280;
    margin-bottom: 1rem;
}

.country-card-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: #3B82F6;
    font-weight: 500;
}

/* Single Country Page */
.country-hero {
    position: relative;
    height: 400px;
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: flex-end;
}

.country-hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, transparent, rgba(0, 0, 0, 0.6));
}

.country-hero-content {
    position: relative;
    z-index: 1;
    width: 100%;
    padding: 3rem 0;
    color: white;
}

.country-title {
    font-size: 3rem;
    margin-bottom: 0.5rem;
    color: white;
}

.country-meta {
    font-size: 1.125rem;
    opacity: 0.9;
}

/* Water Safety Badge */
.water-safety-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border-radius: 2rem;
    font-weight: 600;
    margin: 2rem 0;
}

.water-safety-badge.safe {
    background-color: #10b981;
    color: white;
}

.water-safety-badge.unsafe {
    background-color: #ef4444;
    color: white;
}

.water-safety-badge.sometimes {
    background-color: #f59e0b;
    color: white;
}

/* Content Sections */
.content-section {
    margin-bottom: 3rem;
    padding-bottom: 3rem;
    border-bottom: 1px solid #e5e7eb;
}

.content-section:last-child {
    border-bottom: none;
}

.section-title {
    font-size: 1.75rem;
    margin-bottom: 1.5rem;
    color: #1a202c;
}

/* Tips List */
.tips-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.tips-list li {
    position: relative;
    padding-left: 2rem;
    margin-bottom: 1rem;
}

.tips-list li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0.2rem;
    width: 1rem;
    height: 1rem;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%2310b981'%3E%3Cpath d='M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z'/%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
}

/* Product Card */
.product-card {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    display: flex;
    gap: 1.5rem;
}

.product-image {
    flex: 0 0 150px;
}

.product-content {
    flex: 1;
}

.product-title {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
}

.product-rating {
    display: flex;
    gap: 0.25rem;
    margin-bottom: 0.5rem;
    color: #f59e0b;
}

.product-description {
    color: #6b7280;
    margin-bottom: 1rem;
}

.pros-cons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1rem;
}

.pros, .cons {
    font-size: 0.875rem;
}

.pros h4, .cons h4 {
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
    color: #4b5563;
}

.pros ul, .cons ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.pros li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0.2rem;
    width: 0.875rem;
    height: 0.875rem;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%2310b981'%3E%3Cpath d='M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z'/%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
}

.cons li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0.2rem;
    width: 0.875rem;
    height: 0.875rem;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23ef4444'%3E%3Cpath d='M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z'/%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
}

.product-link {
    display: inline-block;
    background-color: #3B82F6;
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 0.375rem;
    font-weight: 600;
    transition: background-color 0.2s;
}

.product-link:hover {
    background-color: #2563eb;
    text-decoration: none;
}

/* Related Countries */
.related-countries {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1.5rem;
}

/* Widgets */
.widget {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.widget-title {
    font-size: 1.25rem;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid #3B82F6;
}

/* Land-Specific Sidebar Styling */
.land-sidebar {
    background: #f9fafb;
    border-radius: 0.5rem;
    padding: 1.25rem;
}

.land-sidebar .widget {
    background: white;
    margin-bottom: 1.5rem;
    border-radius: 0.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.land-sidebar .widget:last-child {
    margin-bottom: 0;
}

/* Footer */
.site-footer {
    background-color: #1a202c;
    color: #e5e7eb;
    padding: 3rem 0 1.5rem;
    margin-top: 4rem;
}

.footer-widgets {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-widget h4 {
    color: white;
    margin-bottom: 1rem;
}

.footer-widget a {
    color: #9ca3af;
}

.footer-widget a:hover {
    color: white;
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid #374151;
    color: #9ca3af;
}

/* Archive Page */
.archive-header {
    background-color: #f3f4f6;
    padding: 3rem 0;
    margin-bottom: 3rem;
}

.archive-title {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.archive-description {
    font-size: 1.125rem;
    color: #6b7280;
}

.countries-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 3rem;
}

.pagination a,
.pagination span {
    display: inline-block;
    padding: 0.5rem 1rem;
    border: 1px solid #e5e7eb;
    border-radius: 0.375rem;
    transition: all 0.2s;
}

.pagination a:hover {
    background-color: #3B82F6;
    color: white;
    border-color: #3B82F6;
    text-decoration: none;
}

.pagination .current {
    background-color: #3B82F6;
    color: white;
    border-color: #3B82F6;
}

/* Adsense Slots */
.adsense-slot {
    background-color: #f3f4f6;
    border: 1px dashed #d1d5db;
    text-align: center;
    padding: 2rem;
    margin: 2rem 0;
    min-height: 250px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Responsive */
@media (max-width: 1024px) {
    .widget-area {
        flex: 0 0 320px; /* Slightly smaller on tablets but still generous */
    }
}

@media (max-width: 768px) {
    .menu-toggle {
        display: block;
    }

    .main-navigation {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: white;
        border-top: 1px solid #e5e7eb;
        display: none;
    }

    .main-navigation.toggled {
        display: block;
    }

    .main-navigation ul {
        flex-direction: column;
        gap: 0;
    }

    .main-navigation li {
        border-bottom: 1px solid #e5e7eb;
    }

    .main-navigation a {
        display: block;
        padding: 1rem;
    }

    .site-content {
        flex-direction: column;
        gap: 2rem;
    }

    .widget-area {
        flex: 1; /* Full width on mobile */
    }

    .land-sidebar {
        padding: 1rem;
    }

    .hero-title {
        font-size: 2rem;
    }

    .country-title {
        font-size: 2rem;
    }

    .product-card {
        flex-direction: column;
    }

    .product-image {
        flex: 1;
        max-width: 200px;
        margin: 0 auto;
    }

    .pros-cons {
        grid-template-columns: 1fr;
    }

    .countries-grid {
        grid-template-columns: 1fr;
    }

    .related-countries {
        grid-template-columns: 1fr;
    }

    .footer-widgets {
        grid-template-columns: 1fr;
    }

    /* Search form responsive */
    .search-form {
        flex-direction: column;
        border-radius: 0.5rem;
    }

    .search-field {
        padding-right: 3rem;
    }

    .search-submit {
        width: 100%;
        border-radius: 0 0 0.5rem 0.5rem;
    }

    .search-form.searching::after {
        right: 1rem;
    }
}

/* Print Styles */
@media print {
    .site-header,
    .site-footer,
    .widget-area,
    .adsense-slot,
    .search-form,
    .product-link {
        display: none;
    }

    body {
        font-size: 12pt;
        line-height: 1.5;
    }

    a {
        color: inherit;
        text-decoration: none;
    }

    .content-area {
        max-width: 100%;
    }
}
