/*
Theme Name: Travel Places Lite
Author: AloIT (generated by ChatGPT)
Description: Theme gọn nhẹ để hiển thị danh sách địa điểm (CPT: atm_place) với trang chủ hero search + grid card (desktop 4 cột, mobile 2 cột) và trang chi tiết có nút liên hệ/chỉ đường.
Version: 1.0.0
Requires at least: 6.0
Requires PHP: 7.4
License: GPLv2 or later
Text Domain: travel-places-lite
Tags: custom-menu, featured-images, responsive-layout
*/

:root {
    --tpl-bg: #ffffff;
    --tpl-text: #0f172a;
    --tpl-muted: #475569;
    --tpl-border: #e2e8f0;
    --tpl-card: #ffffff;
    --tpl-shadow: 0 8px 22px rgba(15, 23, 42, .08);
    --tpl-radius: 18px;
    --tpl-radius-sm: 14px;
    --tpl-max: 1180px;
    --tpl-primary: #0ea5e9;
    --tpl-primary-2: #0284c7;
}

* {
    box-sizing: border-box
}

html {
    scroll-behavior: smooth
}

body {
    margin: 0;
    font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji";
    color: var(--tpl-text);
    background: #f8fafc;
    line-height: 1.55;
}

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

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

a:hover {
    color: var(--tpl-primary-2)
}

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

.tpl-container {
    width: min(100% - 32px, var(--tpl-max));
    margin: 0 auto
}

.tpl-sr-only {
    position: absolute !important;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0
}

/* Header */
.tpl-header {
    background: rgba(255, 255, 255, .9);
    border-bottom: 1px solid var(--tpl-border);
    position: sticky;
    top: 0;
    z-index: 50;
    backdrop-filter: blur(10px);
}

.tpl-header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 0;
    gap: 14px
}

.tpl-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 180px
}

.tpl-brand .custom-logo {
    width: 36px;
    height: 36px;
    border-radius: 10px
}

.tpl-site-title {
    font-weight: 800;
    letter-spacing: -.02em;
    font-size: 18px
}

.tpl-site-tagline {
    font-size: 12px;
    color: var(--tpl-muted);
    margin-top: 2px
}

.tpl-nav {
    display: flex;
    align-items: center
}

.tpl-nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    align-items: center;
    gap: 16px;
}

.tpl-nav li {
    margin: 0;
    padding: 0
}

.tpl-nav a {
    color: var(--tpl-muted);
    font-weight: 700;
    padding: 8px 10px;
    border-radius: 12px;
    display: inline-block;
}

.tpl-nav a:hover {
    background: #f1f5f9;
    color: var(--tpl-text)
}

.tpl-nav-toggle {
    display: none;
    border: 1px solid var(--tpl-border);
    background: #fff;
    padding: 10px 12px;
    border-radius: 12px;
}

.tpl-nav-toggle:active {
    transform: translateY(1px)
}

@media (max-width:860px) {
    .tpl-nav-toggle {
        display: inline-flex;
        align-items: center;
        gap: 8px
    }

    .tpl-nav {
        display: none
    }

    body.tpl-nav-open .tpl-nav {
        display: block;
        position: fixed;
        top: 64px;
        right: 16px;
        left: 16px;
        background: #fff;
        border: 1px solid var(--tpl-border);
        border-radius: 16px;
        padding: 10px;
        box-shadow: var(--tpl-shadow);
    }

    body.tpl-nav-open .tpl-nav ul {
        flex-direction: column;
        align-items: stretch;
        gap: 0
    }

    body.tpl-nav-open .tpl-nav a {
        width: 100%
    }
}

/* Footer */
.tpl-footer {
    margin-top: 48px;
    border-top: 1px solid var(--tpl-border);
    background: #fff
}

.tpl-footer-inner {
    padding: 26px 0;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.tpl-footer small {
    color: var(--tpl-muted)
}

.tpl-footer nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 10px
}

.tpl-footer nav li {
    margin: 0
}

/* Hero Search */
.tpl-hero {
    padding: 26px 0 16px
}

.tpl-hero-card {
    background: linear-gradient(120deg, rgba(14, 165, 233, .10), rgba(2, 132, 199, .06));
    border: 1px solid rgba(2, 132, 199, .12);
    border-radius: 22px;
    padding: 20px;
    box-shadow: 0 10px 30px rgba(2, 132, 199, .10);
}

.tpl-hero h1 {
    margin: 0 0 6px;
    font-size: clamp(22px, 2.6vw, 36px);
    letter-spacing: -.02em
}

.tpl-hero p {
    margin: 0 0 14px;
    color: var(--tpl-muted);
    max-width: 70ch
}

.tpl-search {
    display: flex;
    gap: 10px;
    flex-wrap: wrap
}

.tpl-search input[type="text"] {
    flex: 1 1 280px;
    border: 1px solid var(--tpl-border);
    background: #fff;
    padding: 12px 14px;
    border-radius: 14px;
    outline: none;
}

.tpl-search input[type="text"]:focus {
    border-color: rgba(14, 165, 233, .6);
    box-shadow: 0 0 0 4px rgba(14, 165, 233, .15);
}

.tpl-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border-radius: 14px;
    padding: 12px 14px;
    border: 1px solid var(--tpl-border);
    background: #fff;
    font-weight: 800;
}

.tpl-btn-primary {
    border-color: rgba(2, 132, 199, .25);
    background: linear-gradient(180deg, rgba(14, 165, 233, .95), rgba(2, 132, 199, .95));
    color: #fff;
}

.tpl-btn:active {
    transform: translateY(1px)
}

.tpl-kicker {
    margin-top: 10px;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    color: var(--tpl-muted);
    font-size: 13px
}

/* Grid Cards */
.tpl-section {
    padding: 10px 0 0
}

.tpl-section-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin: 10px 0 12px
}

.tpl-section-title {
    margin: 0;
    font-size: 18px;
    letter-spacing: -.01em
}

.tpl-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    /* mobile: 2 cột */
    gap: 14px;
}

@media (min-width:1024px) {
    .tpl-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    /* desktop: 4 cột */
}

.tpl-card {
    background: var(--tpl-card);
    border: 1px solid var(--tpl-border);
    border-radius: var(--tpl-radius);
    overflow: hidden;
    box-shadow: 0 8px 26px rgba(15, 23, 42, .06);
    transition: transform .18s ease, box-shadow .18s ease;
    display: flex;
    flex-direction: column;
    min-height: 100%;
}

.tpl-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 36px rgba(15, 23, 42, .10)
}

.tpl-card-cover {
    aspect-ratio: 16/9;
    background: #e2e8f0;
    position: relative
}

.tpl-card-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover
}

.tpl-card-body {
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex: 1 1 auto
}

.tpl-card-title {
    margin: 0;
    font-size: 15px;
    font-weight: 900;
    letter-spacing: -.01em;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 44px;
}

.tpl-meta {
    display: flex;
    flex-direction: column;
    gap: 6px;
    color: var(--tpl-muted);
    font-size: 13px
}

.tpl-meta-row {
    display: flex;
    gap: 8px;
    align-items: flex-start
}

.tpl-meta-row svg {
    flex: 0 0 auto;
    margin-top: 2px
}

.tpl-card-actions {
    margin-top: auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px
}

.tpl-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border-radius: 999px;
    border: 1px solid var(--tpl-border);
    background: #fff;
    color: var(--tpl-muted);
    font-size: 12px;
    font-weight: 800;
}

.tpl-link {
    font-weight: 900;
    color: var(--tpl-primary-2)
}

.tpl-link:hover {
    color: var(--tpl-primary)
}

/* Detail */
.tpl-detail {
    padding: 18px 0 0
}

.tpl-detail-grid {
    display: grid;
    gap: 18px;
    grid-template-columns: 1fr
}

@media (min-width:1024px) {
    .tpl-detail-grid {
        grid-template-columns: 1.15fr .85fr
    }
}

.tpl-detail-card {
    background: #fff;
    border: 1px solid var(--tpl-border);
    border-radius: 22px;
    padding: 16px;
    box-shadow: var(--tpl-shadow);
}

.tpl-detail h1 {
    margin: 10px 0 8px;
    letter-spacing: -.02em
}

.tpl-detail .tpl-sub {
    color: var(--tpl-muted);
    margin: 0 0 10px
}

.tpl-cta {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin: 12px 0 4px
}

.tpl-cta .tpl-btn {
    padding: 10px 12px
}

.tpl-gallery {
    display: flex;
    gap: 10px;
    overflow: auto;
    scroll-snap-type: x mandatory;
    padding-bottom: 6px
}

.tpl-gallery a {
    flex: 0 0 auto;
    width: 180px;
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid var(--tpl-border);
    scroll-snap-align: start
}

.tpl-gallery img {
    width: 100%;
    height: 120px;
    object-fit: cover
}

.tpl-map {
    border: 0;
    width: 100%;
    aspect-ratio: 16/10;
    border-radius: 18px;
    overflow: hidden
}

.tpl-prose {
    color: #0f172a
}

.tpl-prose p {
    margin: 0 0 1em
}

.tpl-prose h2,
.tpl-prose h3 {
    margin: 1.2em 0 .4em
}

.tpl-prose ul {
    padding-left: 1.1em
}

.tpl-prose li {
    margin: .35em 0
}

.tpl-badges {
    display: flex;
    gap: 8px;
    flex-wrap: wrap
}

/* Pagination */
.tpl-pagination {
    margin: 18px 0 0;
    display: flex;
    justify-content: center
}

.tpl-pagination .page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 38px;
    height: 38px;
    border-radius: 12px;
    border: 1px solid var(--tpl-border);
    background: #fff;
    margin: 0 4px;
    font-weight: 800;
    color: var(--tpl-muted);
}

.tpl-pagination .page-numbers.current {
    background: rgba(14, 165, 233, .12);
    border-color: rgba(14, 165, 233, .35);
    color: var(--tpl-text);
}