/*
Theme Name: Kamianets Online
Theme URI: https://kamianets.online
Author: Professional City Portal Development
Description: Професійна тема міського порталу Кам'янець-Подільський у стилі сучасного каталогу бізнесу, новин, афіші та послуг. Повністю адаптивна.
Version: 2.0.0
Requires at least: 6.0
Tested up to: 6.7
Requires PHP: 7.4
License: GNU General Public License v2 or later
Text Domain: kamianets-online
Tags: city-portal, directory, news, events, business, responsive
*/

/* ==========================================================================
   CSS Variables
   ========================================================================== */
:root {
    --primary: #0d1b2a;
    --primary-light: #1b2d45;
    --accent: #e8a317;
    --accent-hover: #d4920f;
    --accent-light: #f5c542;
    --text: #1a1a1a;
    --text-light: #555;
    --text-muted: #888;
    --bg: #f5f7fa;
    --card: #ffffff;
    --border: #e8ecf1;
    --radius: 14px;
    --radius-sm: 10px;
    --shadow: 0 4px 20px rgba(13, 27, 42, 0.07);
    --shadow-hover: 0 12px 32px rgba(13, 27, 42, 0.12);
    --container: 1240px;
    --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --transition: 0.25s ease;
}

/* ==========================================================================
   Base
   ========================================================================== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
    font-family: var(--font);
    font-size: 16px;
    line-height: 1.6;
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; transition: color var(--transition); }
ul { list-style: none; }

.container {
    width: 100%;
    max-width: var(--container);
    margin: 0 auto;
    padding: 0 20px;
}

/* ==========================================================================
   Buttons
   ========================================================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    font-weight: 600;
    font-size: 0.95rem;
    border-radius: var(--radius-sm);
    border: none;
    cursor: pointer;
    transition: all var(--transition);
    white-space: nowrap;
}

.btn-accent {
    background: var(--accent);
    color: #fff;
}

.btn-accent:hover {
    background: var(--accent-hover);
    color: #fff;
}

.btn-outline {
    background: transparent;
    border: 1.5px solid var(--border);
    color: var(--text);
}

.btn-outline:hover {
    border-color: var(--accent);
    color: var(--accent);
}

/* ==========================================================================
   HEADER
   ========================================================================== */
.site-header {
    background: var(--primary);
    position: sticky;
    top: 0;
    z-index: 1000;
}

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

.site-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #fff;
    font-weight: 700;
    font-size: 1.15rem;
    letter-spacing: -0.02em;
    white-space: nowrap;
}

.site-logo .logo-icon {
    width: 32px;
    height: 32px;
    background: var(--accent);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
}

.site-logo span {
    color: var(--accent);
}

.main-nav {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.main-nav a {
    color: rgba(255,255,255,0.85);
    font-size: 0.9rem;
    font-weight: 500;
    padding: 8px 12px;
    border-radius: 8px;
    transition: all var(--transition);
}

.main-nav a:hover,
.main-nav .current-menu-item a {
    color: #fff;
    background: rgba(255,255,255,0.1);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.header-search-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255,255,255,0.1);
    border: none;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background var(--transition);
}

.header-search-btn:hover {
    background: rgba(255,255,255,0.2);
}

/* ==========================================================================
   HERO
   ========================================================================== */
.hero {
    position: relative;
    min-height: 480px;
    display: flex;
    align-items: center;
    background: var(--primary);
    overflow: hidden;
}

.hero-bg {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(13,27,42,0.85) 0%, rgba(13,27,42,0.65) 50%, rgba(13,27,42,0.8) 100%),
                url('https://upload.wikimedia.org/wikipedia/commons/thumb/8/8e/Kamianets-Podilskyi_Castle_at_night.jpg/1280px-Kamianets-Podilskyi_Castle_at_night.jpg') center/cover no-repeat;
    z-index: 1;
}

.hero-content {
    position: relative;
    z-index: 2;
    width: 100%;
    padding: 60px 0 80px;
    text-align: center;
    color: #fff;
}

.hero h1 {
    font-size: clamp(2.2rem, 6vw, 3.4rem);
    font-weight: 800;
    line-height: 1.15;
    letter-spacing: -0.03em;
    margin-bottom: 16px;
    text-transform: uppercase;
}

.hero p {
    font-size: 1.15rem;
    opacity: 0.9;
    max-width: 560px;
    margin: 0 auto 32px;
}

/* Search box */
.hero-search {
    display: flex;
    max-width: 680px;
    margin: 0 auto;
    background: #fff;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 8px 40px rgba(0,0,0,0.25);
}

.hero-search input {
    flex: 1;
    border: none;
    padding: 18px 22px;
    font-size: 1rem;
    outline: none;
    color: var(--text);
}

.hero-search input::placeholder {
    color: #aaa;
}

.hero-search .location-select {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 0 16px;
    border-left: 1px solid var(--border);
    color: var(--text-light);
    font-size: 0.95rem;
    white-space: nowrap;
}

.hero-search .btn {
    border-radius: 0;
    padding: 0 28px;
    height: 100%;
}

/* ==========================================================================
   CATEGORIES STRIP
   ========================================================================== */
.categories-strip {
    margin-top: -40px;
    position: relative;
    z-index: 10;
    margin-bottom: 20px;
}

.categories-grid {
    display: grid;
    grid-template-columns: repeat(9, 1fr);
    gap: 12px;
    background: var(--card);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow);
}

.cat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 14px 8px;
    border-radius: var(--radius-sm);
    text-align: center;
    transition: all var(--transition);
    cursor: pointer;
}

.cat-item:hover {
    background: var(--bg);
}

.cat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: #f8f1e3;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    color: var(--accent);
}

.cat-item span {
    font-size: 0.78rem;
    font-weight: 500;
    color: var(--text);
    line-height: 1.3;
}

/* ==========================================================================
   SECTIONS
   ========================================================================== */
.section {
    padding: 50px 0;
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 28px;
}

.section-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text);
    letter-spacing: -0.02em;
}

.section-link {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--accent);
    display: flex;
    align-items: center;
    gap: 6px;
}

.section-link:hover {
    color: var(--accent-hover);
}

/* ==========================================================================
   NEWS CARDS
   ========================================================================== */
.news-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

.news-card {
    background: var(--card);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: transform var(--transition), box-shadow var(--transition);
    display: flex;
    flex-direction: column;
}

.news-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
}

.news-card .thumb {
    aspect-ratio: 16/10;
    overflow: hidden;
    background: #e8ecf1;
}

.news-card .thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.news-card:hover .thumb img {
    transform: scale(1.05);
}

.news-card-body {
    padding: 18px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.news-card .date {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.news-card h3 {
    font-size: 0.98rem;
    font-weight: 600;
    line-height: 1.4;
    margin-bottom: 12px;
    flex: 1;
}

.news-card h3 a:hover {
    color: var(--accent);
}

.news-card .tag {
    display: inline-block;
    font-size: 0.72rem;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 50px;
    background: #f0f4f8;
    color: var(--text-light);
}

/* ==========================================================================
   BUSINESS CARDS
   ========================================================================== */
.business-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 16px;
}

.business-card {
    background: var(--card);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: transform var(--transition), box-shadow var(--transition);
}

.business-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
}

.business-card .thumb {
    position: relative;
    aspect-ratio: 1/1;
    overflow: hidden;
    background: #e8ecf1;
}

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

.business-card .rating {
    position: absolute;
    top: 10px;
    left: 10px;
    background: rgba(0,0,0,0.7);
    color: #fff;
    font-size: 0.8rem;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.business-card .rating::before {
    content: "★";
    color: var(--accent);
}

.business-card-body {
    padding: 14px;
}

.business-card h3 {
    font-size: 0.95rem;
    font-weight: 700;
    margin-bottom: 2px;
}

.business-card .type {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.business-card .address {
    font-size: 0.78rem;
    color: var(--text-light);
    margin-bottom: 12px;
    display: flex;
    align-items: flex-start;
    gap: 4px;
}

.business-card .btn {
    width: 100%;
    padding: 8px;
    font-size: 0.85rem;
}

/* ==========================================================================
   EVENTS (Афіша)
   ========================================================================== */
.events-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 16px;
}

.event-card {
    background: var(--card);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: transform var(--transition), box-shadow var(--transition);
}

.event-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
}

.event-card .thumb {
    position: relative;
    aspect-ratio: 16/11;
    overflow: hidden;
    background: #e8ecf1;
}

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

.event-card .date-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    background: var(--card);
    border-radius: 10px;
    text-align: center;
    padding: 6px 10px;
    min-width: 48px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.15);
}

.event-card .date-badge .day {
    font-size: 1.2rem;
    font-weight: 800;
    line-height: 1;
    color: var(--text);
}

.event-card .date-badge .month {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--accent);
}

.event-card-body {
    padding: 14px;
}

.event-card .time {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 6px;
}

.event-card h3 {
    font-size: 0.92rem;
    font-weight: 600;
    line-height: 1.35;
    margin-bottom: 8px;
}

.event-card .place {
    font-size: 0.78rem;
    color: var(--text-light);
}

/* ==========================================================================
   MAP SECTION
   ========================================================================== */
.map-section {
    background: var(--card);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    display: grid;
    grid-template-columns: 320px 1fr;
    min-height: 380px;
}

.map-info {
    padding: 40px 32px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.map-info h2 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 12px;
}

.map-info p {
    color: var(--text-light);
    margin-bottom: 24px;
    font-size: 0.95rem;
}

.map-embed {
    background: #e8ecf1;
    position: relative;
}

.map-embed iframe {
    width: 100%;
    height: 100%;
    border: 0;
    min-height: 380px;
}

/* ==========================================================================
   CTA BANNER
   ========================================================================== */
.cta-banner {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    border-radius: var(--radius);
    padding: 40px 48px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 30px;
    color: #fff;
    margin: 50px 0;
}

.cta-banner h3 {
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 6px;
}

.cta-banner p {
    opacity: 0.85;
    font-size: 0.95rem;
}

/* ==========================================================================
   FOOTER
   ========================================================================== */
.site-footer {
    background: var(--primary);
    color: rgba(255,255,255,0.8);
    padding: 60px 0 0;
}

.footer-grid {
    display: grid;
    grid-template-columns: 1.4fr 1fr 1fr 1fr;
    gap: 40px;
    padding-bottom: 50px;
}

.footer-brand .site-logo {
    margin-bottom: 16px;
}

.footer-brand p {
    font-size: 0.9rem;
    line-height: 1.6;
    max-width: 260px;
}

.footer-col h4 {
    color: #fff;
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 18px;
}

.footer-col a {
    display: block;
    font-size: 0.9rem;
    padding: 5px 0;
    color: rgba(255,255,255,0.7);
}

.footer-col a:hover {
    color: var(--accent);
}

.footer-col p {
    font-size: 0.9rem;
    line-height: 1.7;
}

.socials {
    display: flex;
    gap: 10px;
    margin-top: 12px;
}

.socials a {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255,255,255,0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    transition: background var(--transition);
}

.socials a:hover {
    background: var(--accent);
    color: #fff;
}

.footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.1);
    padding: 20px 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
    color: rgba(255,255,255,0.5);
    flex-wrap: wrap;
    gap: 12px;
}

.footer-bottom a {
    color: rgba(255,255,255,0.5);
}

.footer-bottom a:hover {
    color: var(--accent);
}

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */
@media (max-width: 1100px) {
    .categories-grid { grid-template-columns: repeat(5, 1fr); }
    .news-grid { grid-template-columns: repeat(2, 1fr); }
    .business-grid { grid-template-columns: repeat(3, 1fr); }
    .events-grid { grid-template-columns: repeat(3, 1fr); }
    .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 768px) {
    .header-inner { flex-wrap: wrap; }
    .main-nav { display: none; } /* mobile menu can be added later */
    .hero { min-height: 420px; }
    .hero-search { flex-direction: column; }
    .hero-search .location-select { border-left: none; border-top: 1px solid var(--border); padding: 12px 22px; }
    .hero-search .btn { padding: 14px; border-radius: 0 0 14px 14px; }
    .categories-grid { grid-template-columns: repeat(3, 1fr); }
    .news-grid,
    .business-grid,
    .events-grid { grid-template-columns: 1fr 1fr; }
    .map-section { grid-template-columns: 1fr; }
    .cta-banner { flex-direction: column; text-align: center; padding: 32px 24px; }
    .footer-grid { grid-template-columns: 1fr; gap: 30px; }
}

@media (max-width: 480px) {
    .categories-grid { grid-template-columns: repeat(3, 1fr); gap: 8px; }
    .news-grid,
    .business-grid,
    .events-grid { grid-template-columns: 1fr; }
}
