/*
Theme Name: Tourism Office
Theme URI:
Author: Oleg Medvedev
Author URI:
Description: A custom classic WordPress theme for a Tourism Office website. Features activities and accommodations listings for a geographic destination.
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.9
Requires PHP: 8.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: tourism-office
*/

/* ==========================================================================
   CSS Reset (Josh W Comeau)
   ========================================================================== */

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

* {
    margin: 0;
}

body {
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

img, picture, video, canvas, svg {
    display: block;
    max-width: 100%;
}

input, button, textarea, select {
    font: inherit;
}

p, h1, h2, h3, h4, h5, h6 {
    overflow-wrap: break-word;
}

/* ==========================================================================
   Base Styles
   ========================================================================== */

body {
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    font-size: 1rem;
    color: #333;
    background-color: #fff;
}

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

a:hover {
    text-decoration: underline;
    color: #1d4ed8;
}

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

.site-wrapper {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* ==========================================================================
   Header
   ========================================================================== */

.site-header {
    padding: 1rem 0;
    border-bottom: 2px solid #e5e7eb;
    background-color: #fff;
}

.site-header .site-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.site-branding .custom-logo {
    max-height: 60px;
    width: auto;
}

.site-title {
    font-size: 1.5rem;
    margin: 0;
}

.site-title a {
    color: #111;
    text-decoration: none;
}

.site-title a:hover {
    color: #2563eb;
    text-decoration: none;
}

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

.main-navigation a {
    color: #333;
    font-weight: 500;
    padding: 0.25rem 0;
}

.main-navigation a:hover {
    color: #2563eb;
    text-decoration: none;
}

.main-navigation .current-menu-item a {
    color: #2563eb;
    border-bottom: 2px solid #2563eb;
}

/* Hamburger Menu Toggle — hidden on desktop */
.menu-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    flex-direction: column;
    gap: 5px;
}

.hamburger-line {
    display: block;
    width: 24px;
    height: 2px;
    background-color: #111;
    transition: transform 0.3s, opacity 0.3s;
}

/* Animate hamburger to X when active */
.menu-toggle.is-active .hamburger-line:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.menu-toggle.is-active .hamburger-line:nth-child(2) {
    opacity: 0;
}

.menu-toggle.is-active .hamburger-line:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

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

.site-footer {
    padding: 2.5rem 0;
    margin-top: 4rem;
    border-top: 2px solid #e5e7eb;
    background-color: #f9fafb;
}

.footer-navigation ul {
    list-style: none;
    padding: 0;
    display: flex;
    gap: 2rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.footer-navigation a {
    color: #555;
}

.footer-navigation a:hover {
    color: #2563eb;
}

.site-info {
    color: #888;
    font-size: 0.875rem;
}

/* ==========================================================================
   Hero Section (banner with background image)
   ========================================================================== */

.hero {
    padding: 0;
    margin: 0;
}

.hero-banner {
    width: 100%;
    min-height: 480px;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-color: #1e293b;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hero-overlay {
    width: 100%;
    min-height: 480px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(to bottom, rgba(0,0,0,0.35) 0%, rgba(0,0,0,0.5) 100%);
    padding: 3rem 1.5rem;
}

.hero-content {
    text-align: center;
    max-width: 700px;
}

.hero h1,
.hero-banner h1 {
    font-size: 3rem;
    margin-bottom: 0.75rem;
    color: #fff;
    text-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.hero .hero-subtitle {
    font-size: 1.2rem;
    color: rgba(255,255,255,0.9);
    margin-bottom: 2rem;
    line-height: 1.6;
}

/* Hero CTA Button */
.hero-cta {
    display: inline-block;
    padding: 0.875rem 2.5rem;
    background-color: #2563eb;
    color: #fff;
    border-radius: 0.375rem;
    font-weight: 600;
    font-size: 1.05rem;
    transition: background-color 0.2s, transform 0.2s;
}

.hero-cta:hover {
    background-color: #1d4ed8;
    text-decoration: none;
    color: #fff;
    transform: translateY(-1px);
}

/* ==========================================================================
   Sections
   ========================================================================== */

.section {
    padding: 2.5rem 0;
}

.section + .section {
    border-top: 1px solid #e5e7eb;
}

.section-title {
    font-size: 2rem;
    margin-bottom: 1.5rem;
    color: #111;
}

.section-link {
    margin-top: 1.5rem;
    text-align: center;
}

.section-link a {
    font-weight: 500;
    font-size: 1rem;
}

/* ==========================================================================
   About Section (Homepage)
   ========================================================================== */

.about {
    display: flex;
    gap: 2.5rem;
    align-items: center;
}

.about .about-text {
    flex: 1;
}

.about .about-content {
    color: #555;
    line-height: 1.7;
}

.about .about-content p {
    margin-bottom: 1rem;
}

.about .about-image {
    flex-shrink: 0;
    width: 45%;
    border-radius: 0.5rem;
    overflow: hidden;
}

.about .about-image img {
    width: 100%;
    height: 280px;
    object-fit: cover;
}

/* ==========================================================================
   Cards (Activities / Accommodations)
   ========================================================================== */

.cards-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}

.card {
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    overflow: hidden;
    background-color: #fff;
    transition: box-shadow 0.2s, transform 0.2s;
}

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

.card-thumbnail img {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.card-content {
    padding: 1rem 1.25rem;
}

.card-category {
    font-size: 0.75rem;
    color: #2563eb;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 600;
    margin-bottom: 0.375rem;
}

.card-title {
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
    line-height: 1.3;
}

.card-title a {
    color: #111;
}

.card-title a:hover {
    color: #2563eb;
    text-decoration: none;
}

.card-excerpt {
    color: #555;
    font-size: 0.9rem;
    line-height: 1.5;
}

/* ==========================================================================
   Single CPT (Activity / Accommodation)
   ========================================================================== */

.single-content {
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem 0;
}

.single-content h1 {
    font-size: 2.25rem;
    margin-bottom: 0.5rem;
    color: #111;
}

.single-excerpt {
    font-size: 1.1rem;
    color: #555;
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

.single-content .card-category {
    margin-bottom: 1rem;
}

/* ACF Meta Fields Block */
.single-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    margin: 1.5rem 0 2rem;
    padding: 1.25rem;
    background-color: #f9fafb;
    border-radius: 0.5rem;
    border: 1px solid #e5e7eb;
}

.single-meta > div {
    flex: 1;
    min-width: 120px;
}

.single-meta dt {
    font-weight: 600;
    font-size: 0.75rem;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.25rem;
}

.single-meta dd {
    margin: 0;
    font-size: 0.95rem;
    color: #333;
}

/* Entry Content */
.entry-content {
    line-height: 1.8;
    font-size: 1.05rem;
}

.entry-content p {
    margin-bottom: 1.25rem;
}

.entry-content p:last-child {
    margin-bottom: 0;
}

/* Post Navigation (prev/next) */
.post-navigation {
    display: flex;
    justify-content: space-between;
    padding: 1.5rem 0;
    margin-top: 2.5rem;
    border-top: 1px solid #e5e7eb;
    gap: 1rem;
}

.post-navigation a {
    font-weight: 500;
}

.back-to-archive {
    margin-top: 1rem;
}

.back-to-archive a {
    font-weight: 500;
    color: #555;
}

.back-to-archive a:hover {
    color: #2563eb;
}

/* ==========================================================================
   Archive Pages
   ========================================================================== */

.archive-header {
    padding: 2rem 0 1rem;
}

.archive-header h1 {
    font-size: 2rem;
    color: #111;
}

/* ==========================================================================
   Generic Page
   ========================================================================== */

.page-content {
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem 0;
}

/* Page Header (fallback when no featured image) */
.page-header {
    padding: 3rem 0;
    background-color: #1e293b;
}

.page-header h1 {
    color: #fff;
    font-size: 2.25rem;
}

/* ==========================================================================
   404 Page
   ========================================================================== */

.error-404 {
    text-align: center;
    padding: 5rem 0;
}

.error-404 h1 {
    font-size: 4rem;
    margin-bottom: 1rem;
    color: #111;
}

.error-404 p {
    font-size: 1.15rem;
    color: #555;
    margin-bottom: 1rem;
}

.error-404 a {
    font-weight: 500;
}

/* ==========================================================================
   Responsive (Mobile-First Breakpoints)
   ========================================================================== */

/* Tablet and below (768px) */
@media (max-width: 768px) {
    /* Header: logo + hamburger in row, nav drops below */
    .site-header .site-wrapper {
        flex-wrap: wrap;
    }

    .site-branding {
        flex: 1;
    }

    /* Show hamburger button */
    .menu-toggle {
        display: flex;
    }

    /* Hide nav by default on mobile */
    .main-navigation {
        display: none;
        width: 100%;
        border-top: 1px solid #e5e7eb;
    }

    /* Show nav when toggled */
    .main-navigation.is-open {
        display: block;
    }

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

    .main-navigation a {
        display: block;
        padding: 0.75rem 0;
        border-bottom: 1px solid #e5e7eb;
    }

    .main-navigation .current-menu-item a {
        border-bottom: 1px solid #2563eb;
    }

    /* Hero */
    .hero-banner,
    .hero-overlay {
        min-height: 320px;
    }

    .hero h1 {
        font-size: 1.75rem;
    }

    .hero .hero-subtitle {
        font-size: 1rem;
    }

    /* About: stack vertically */
    .about {
        flex-direction: column;
    }

    .about .about-image {
        width: 100%;
    }

    /* Cards: 1 column */
    .cards-grid {
        grid-template-columns: 1fr;
        gap: 1.25rem;
    }

    /* Section */
    .section-title {
        font-size: 1.5rem;
    }

    /* Single CPT */
    .single-content h1 {
        font-size: 1.75rem;
    }

    .single-meta {
        flex-direction: column;
        gap: 1rem;
    }

    /* Post navigation: stack */
    .post-navigation {
        flex-direction: column;
    }

    /* Page header */
    .page-header h1 {
        font-size: 1.75rem;
    }

    /* 404 */
    .error-404 h1 {
        font-size: 2.5rem;
    }

    /* Footer */
    .footer-navigation ul {
        flex-direction: column;
        gap: 0.75rem;
    }
}

/* Tablet landscape (769px - 1024px) */
@media (min-width: 769px) and (max-width: 1024px) {
    /* Cards: 2 columns */
    .cards-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .hero-banner,
    .hero-overlay {
        min-height: 400px;
    }
}
