/*
Theme Name: City Portal
Theme URI: https://example.com/city-portal
Author: City Portal
Author URI: https://example.com
Description: A modern, fast, accessible WordPress theme for city portals and local business directories. Built for Elementor (full Theme Builder support: header, footer, single, archive) and the companion "City Portal Directory" plugin. Includes a hero-ready front page, news, city administration sections, offers and video areas, plus a one-click demo importer in the plugin.
Version: 2.84.0
Requires at least: 6.0
Tested up to: 6.7
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: city-portal
Domain Path: /languages
Tags: elementor, directory, business, news, full-width-template, custom-menu, featured-images, threaded-comments, translation-ready
*/

/* ==========================================================================
   Design tokens
   ========================================================================== */
:root {
	--cp-accent: #4f46e5;
	--cp-accent-2: #7c3aed;
	--cp-accent-dark: #3730a3;
	--cp-ink: #0b1220;
	--cp-muted: #667085;
	--cp-line: #eaecf2;
	--cp-bg: #ffffff;
	--cp-bg-soft: #f6f7fb;
	--cp-radius: 18px;
	--cp-radius-sm: 12px;
	--cp-shadow: 0 1px 2px rgba(16,24,40,.05), 0 8px 24px rgba(16,24,40,.06);
	--cp-shadow-lg: 0 18px 48px rgba(16,24,40,.16);
	--cp-maxw: 1200px;
	--cp-font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
body {
	margin: 0; font-family: var(--cp-font); color: var(--cp-ink);
	background: var(--cp-bg); line-height: 1.65; -webkit-font-smoothing: antialiased;
	letter-spacing: -.005em;
}
a { color: var(--cp-accent); }
img { max-width: 100%; height: auto; }
h1, h2, h3, h4 { line-height: 1.15; color: var(--cp-ink); letter-spacing: -.02em; }

.cp-container { max-width: var(--cp-maxw); margin: 0 auto; padding: 0 20px; }
.cp-section { padding: clamp(2.8rem, 6vw, 5.5rem) 0; }
.cp-section--soft { background: var(--cp-bg-soft); }
.cp-section__head { text-align: center; max-width: 680px; margin: 0 auto 3rem; }
.cp-section__eyebrow {
	display: inline-block; font-size: .72rem; font-weight: 700; letter-spacing: .12em;
	text-transform: uppercase; color: var(--cp-accent); margin-bottom: .7rem;
}
.cp-section__head h2 { font-size: clamp(1.7rem, 3.2vw, 2.6rem); margin: 0 0 .6rem; }
.cp-section__head p { color: var(--cp-muted); margin: 0; font-size: 1.05rem; }

.screen-reader-text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(1px,1px,1px,1px); white-space: nowrap; }
.skip-link { position: absolute; left: -9999px; top: 0; background: #fff; padding: .8rem 1.2rem; z-index: 1000; border-radius: 0 0 8px 0; }
.skip-link:focus { left: 0; }

/* ==========================================================================
   Header
   ========================================================================== */
.site-header {
	position: sticky; top: 0; z-index: 100; background: rgba(255,255,255,.8);
	backdrop-filter: saturate(180%) blur(14px); border-bottom: 1px solid transparent;
	transition: border-color .2s ease, box-shadow .2s ease, background .2s ease;
}
.site-header.is-scrolled { border-bottom-color: var(--cp-line); box-shadow: var(--cp-shadow); background: rgba(255,255,255,.92); }
.site-header__inner { display: flex; align-items: center; justify-content: space-between; padding: 1rem 20px; max-width: var(--cp-maxw); margin: 0 auto; gap: 1rem; }
.site-branding a { font-weight: 800; font-size: 1.35rem; text-decoration: none; color: var(--cp-ink); display: inline-flex; flex-direction: column; }
.site-branding .site-description { display: block; font-size: .75rem; color: var(--cp-muted); font-weight: 500; letter-spacing: 0; }
.main-nav ul { list-style: none; display: flex; gap: 1.6rem; margin: 0; padding: 0; align-items: center; }
.main-nav a { text-decoration: none; color: var(--cp-ink); font-weight: 600; padding: .4rem 0; position: relative; font-size: .96rem; }
.main-nav a::after { content: ""; position: absolute; left: 0; bottom: -2px; width: 0; height: 2px; background: linear-gradient(90deg, var(--cp-accent), var(--cp-accent-2)); transition: width .2s ease; border-radius: 2px; }
.main-nav a:hover { color: var(--cp-accent); }
.main-nav a:hover::after, .main-nav .current-menu-item > a::after { width: 100%; }
.main-nav .current-menu-item > a { color: var(--cp-accent); }
.nav-toggle { display: none; background: none; border: 0; cursor: pointer; font-size: 1.6rem; color: var(--cp-ink); }

/* ==========================================================================
   Front page sections
   ========================================================================== */
.cp-hero-fallback {
	position: relative; overflow: hidden; color: #fff; padding: clamp(3.5rem,9vw,8rem) 20px; text-align: center; border-radius: 28px;
	background:
		radial-gradient(1000px 460px at 12% -10%, rgba(124,58,237,.55), transparent 60%),
		linear-gradient(135deg, var(--cp-accent), var(--cp-accent-dark));
}
.cp-hero-fallback h1 { color: #fff; font-size: clamp(2.2rem,5.5vw,3.8rem); margin: 0 0 .6rem; }
.cp-hero-fallback p { font-size: 1.2rem; opacity: .94; }

.cp-grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.8rem; }
.cp-news-card {
	background: #fff; border: 1px solid var(--cp-line); border-radius: var(--cp-radius);
	overflow: hidden; box-shadow: var(--cp-shadow); transition: transform .22s cubic-bezier(.2,.8,.2,1), box-shadow .22s ease;
	display: flex; flex-direction: column;
}
.cp-news-card:hover { transform: translateY(-6px); box-shadow: var(--cp-shadow-lg); }
.cp-news-card__img { aspect-ratio: 16 / 10; overflow: hidden; }
.cp-news-card__img img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s ease; }
.cp-news-card:hover .cp-news-card__img img { transform: scale(1.06); }
.cp-news-card__body { padding: 1.2rem 1.3rem 1.5rem; display: flex; flex-direction: column; gap: .55rem; }
.cp-news-card__date { font-size: .8rem; color: var(--cp-muted); font-weight: 600; }
.cp-news-card__title { margin: 0; font-size: 1.2rem; }
.cp-news-card__title a { color: var(--cp-ink); text-decoration: none; }
.cp-news-card__title a:hover { color: var(--cp-accent); }

/* City administration */
.cp-admin-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.4rem; }
.cp-admin-card {
	background: #fff; border: 1px solid var(--cp-line); border-radius: var(--cp-radius);
	padding: 1.6rem 1.4rem; text-align: center; text-decoration: none; color: var(--cp-ink);
	transition: border-color .2s ease, transform .2s ease, box-shadow .2s ease; box-shadow: var(--cp-shadow);
}
.cp-admin-card:hover { border-color: transparent; transform: translateY(-5px); box-shadow: var(--cp-shadow-lg); }
.cp-admin-card__icon {
	display: inline-flex; align-items: center; justify-content: center; width: 60px; height: 60px;
	font-size: 1.8rem; border-radius: 16px; margin-bottom: .9rem;
	background: linear-gradient(135deg, rgba(79,70,229,.12), rgba(124,58,237,.12));
}
.cp-admin-card__title { font-weight: 700; display: block; margin-bottom: .3rem; font-size: 1.05rem; }
.cp-admin-card__desc { color: var(--cp-muted); font-size: .88rem; }

/* ==========================================================================
   Content / single / archive
   ========================================================================== */
.cp-content { padding: clamp(2.2rem, 5vw, 3.8rem) 0; }
.cp-layout { display: grid; grid-template-columns: 1fr 320px; gap: 2.6rem; }
.cp-layout--full { grid-template-columns: 1fr; margin: 0 auto; }
.entry-title { font-size: clamp(1.9rem, 4vw, 2.8rem); margin: 0 0 .8rem; }
.entry-meta { color: var(--cp-muted); font-size: .92rem; margin-bottom: 1.5rem; font-weight: 500; }
.entry-content { font-size: 1.08rem; }
.entry-content > * + * { margin-top: 1.15rem; }
.post-thumbnail img { border-radius: var(--cp-radius); margin-bottom: 1.8rem; }

.widget-area .widget { background: var(--cp-bg-soft); border: 1px solid var(--cp-line); border-radius: var(--cp-radius); padding: 1.4rem; margin-bottom: 1.5rem; }
.widget-area .widget-title { margin-top: 0; font-size: 1.05rem; }

/* ==========================================================================
   Footer
   ========================================================================== */
.site-footer { background: #0b1220; color: #aeb6c6; padding: 3.5rem 0 1.6rem; margin-top: 3.5rem; }
.site-footer a { color: #e2e8f0; text-decoration: none; }
.site-footer a:hover { color: #fff; }
.site-footer__widgets { display: grid; grid-template-columns: repeat(4, 1fr); gap: 2.2rem; margin-bottom: 2.2rem; }
.site-footer__widgets .widget-title { color: #fff; margin-top: 0; }
.site-footer__bottom { border-top: 1px solid rgba(255,255,255,.1); padding-top: 1.3rem; text-align: center; font-size: .85rem; color: #8a93a6; }

/* ==========================================================================
   Buttons
   ========================================================================== */
.cp-btn {
	display: inline-flex; align-items: center; gap: .5rem; padding: .85rem 1.6rem; border-radius: 999px;
	background: linear-gradient(135deg, var(--cp-accent), var(--cp-accent-2)); color: #fff; text-decoration: none;
	font-weight: 600; border: 0; cursor: pointer; box-shadow: 0 6px 18px rgba(79,70,229,.35);
	transition: transform .18s cubic-bezier(.2,.8,.2,1), filter .18s ease;
}
.cp-btn:hover { transform: translateY(-2px); filter: brightness(1.06); color: #fff; }
.cp-btn--ghost { background: transparent; color: var(--cp-accent); border: 1.5px solid var(--cp-accent); box-shadow: none; }
.cp-btn--ghost:hover { background: var(--cp-accent); color: #fff; }

/* ==========================================================================
   Search form
   ========================================================================== */
.search-form { display: flex; gap: .5rem; max-width: 440px; margin: 1rem auto; }
.search-form input[type="search"] { flex: 1; padding: .8rem 1.1rem; border: 1px solid var(--cp-line); border-radius: 999px; }
.search-form button { padding: .8rem 1.4rem; border: 0; border-radius: 999px; background: linear-gradient(135deg, var(--cp-accent), var(--cp-accent-2)); color: #fff; cursor: pointer; font-weight: 600; }

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 980px) {
	.cp-grid-3 { grid-template-columns: repeat(2, 1fr); }
	.cp-admin-grid { grid-template-columns: repeat(2, 1fr); }
	.cp-layout { grid-template-columns: 1fr; }
	.site-footer__widgets { grid-template-columns: repeat(2, 1fr); }
	.main-nav { display: none; }
	.main-nav.is-open { display: block; position: absolute; top: 100%; left: 0; right: 0; background: #fff; border-bottom: 1px solid var(--cp-line); padding: 1rem 20px; box-shadow: var(--cp-shadow); }
	.main-nav.is-open ul { flex-direction: column; gap: 1rem; align-items: flex-start; }
	.nav-toggle { display: block; }
}
@media (max-width: 600px) {
	.cp-grid-3, .cp-admin-grid, .site-footer__widgets { grid-template-columns: 1fr; }
}

/* Designed footer menus */
.footer-menu { list-style: none; padding: 0; margin: 0; display: grid; gap: .6rem; }
.footer-menu a { color: #aeb6c6; text-decoration: none; }
.footer-menu a:hover { color: #fff; }
.footer-col--brand p { color: #8a93a6; max-width: 28ch; }

/* Allow full-bleed sections (e.g. full-width slider) without a horizontal scrollbar */
.site-main { overflow-x: clip; }

/* ==========================================================================
   Header layouts (4 variants)
   ========================================================================== */
.site-header__inner { display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; }
.header-search { display: flex; align-items: center; background: var(--cp-bg-soft, #f1f5f9); border-radius: 999px; overflow: hidden; }
.header-search input { border: 0; background: transparent; padding: .55rem .9rem; font: inherit; min-width: 150px; }
.header-search button { border: 0; background: transparent; padding: 0 .8rem; cursor: pointer; font-size: 1rem; }

/* Centered: logo on top, nav centered below */
.site-header--centered .site-header__inner { flex-direction: column; gap: .6rem; text-align: center; }
.site-header--centered .main-nav { width: 100%; }
.site-header--centered .main-nav ul { justify-content: center; }
.site-header--centered .nav-toggle { position: absolute; right: 1.2rem; top: 1.2rem; }

/* Topbar: slim utility strip above the main row */
.site-topbar { background: var(--cp-ink, #0b1220); color: #fff; font-size: .82rem; }
.site-topbar__inner { max-width: var(--cp-maxw, 1200px); margin: 0 auto; padding: .4rem 1.2rem; display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.site-topbar__msg { opacity: .9; }
.site-topbar__meta { opacity: .65; }

/* Search header: search box sits at the end of the row */
.site-header--search .header-search { flex: 0 1 280px; }

@media (max-width: 880px) {
	.site-header--search .header-search { display: none; }
	.site-header--centered .main-nav ul { justify-content: flex-start; }
	.site-topbar__meta { display: none; }
}

/* Blog / Posts page (home.php) */
.cp-blog { padding: 3rem 0; }
.cp-blog .cp-section__head { margin-bottom: 2rem; }
.cp-pagination { margin-top: 2.5rem; }
.cp-pagination .page-numbers { display: inline-block; padding: .5rem .9rem; margin: 0 .2rem; border: 1px solid var(--cp-line, #e2e8f0); border-radius: 8px; text-decoration: none; }
.cp-pagination .page-numbers.current { background: var(--cp-accent, #2563eb); color: #fff; border-color: transparent; }

/* ==========================================================================
   v2.6 polish: sticky header, back-to-top, headings, footer, links
   ========================================================================== */
/* Sticky header (toggle in Customizer adds .is-sticky) */
.site-header.is-sticky { position: sticky; top: 0; z-index: 999; }
.site-header { background: #fff; transition: box-shadow .25s ease, padding .25s ease; }
.site-header.is-scrolled { box-shadow: 0 8px 30px rgba(16, 24, 40, .1); }
.site-header.is-scrolled .site-header__inner { padding-top: .55rem; padding-bottom: .55rem; }
.site-header__inner { transition: padding .25s ease; }

/* Back to top */
.cp-backtotop {
	position: fixed; right: 22px; bottom: 22px; z-index: 998;
	width: 46px; height: 46px; border-radius: 50%; border: 0; cursor: pointer;
	background: var(--cp-accent, #2563eb); color: #fff; font-size: 1.15rem;
	box-shadow: 0 10px 26px rgba(37, 99, 235, .4);
	opacity: 0; transform: translateY(14px); pointer-events: none;
	transition: opacity .25s ease, transform .25s ease, background .2s ease;
}
.cp-backtotop.is-visible { opacity: 1; transform: none; pointer-events: auto; }
.cp-backtotop:hover { background: var(--cp-accent-dark, #1d4ed8); }
.cp-backtotop:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }

/* Section headings: accent underline flourish */
.cp-section__head h1, .cp-section__head h2 { position: relative; padding-bottom: .55rem; }
.cp-section__head h1::after, .cp-section__head h2::after {
	content: ""; position: absolute; left: 0; bottom: 0; width: 46px; height: 4px;
	border-radius: 2px; background: linear-gradient(90deg, var(--cp-accent, #2563eb), transparent);
}

/* Nav link underline slide */
.main-nav a { position: relative; }
.main-nav > ul > li > a::after {
	content: ""; position: absolute; left: 12%; right: 88%; bottom: 4px; height: 2px;
	background: var(--cp-accent, #2563eb); border-radius: 2px; transition: right .22s ease;
}
.main-nav > ul > li > a:hover::after, .main-nav > ul > li.current-menu-item > a::after { right: 12%; }

/* Footer link + button hovers */
.site-footer a { transition: color .18s ease, opacity .18s ease; }
.site-footer a:hover { opacity: .85; }

/* Content images fade-in on load */
.site-main img { transition: opacity .3s ease; }

/* Reduced motion / toggle guard */
@media (prefers-reduced-motion: reduce) {
	.site-header, .site-header__inner, .cp-backtotop, .main-nav a::after { transition: none !important; }
}
body.cp-no-anim .cp-backtotop { display: none; }
body.cp-no-anim .main-nav > ul > li > a::after { transition: none; }

/* ==========================================================================
   v2.13 Dark mode (html.cp-dark)
   ========================================================================== */
.cp-scheme-toggle {
	border: 1px solid var(--cp-line); background: transparent; color: var(--cp-ink);
	width: 38px; height: 38px; border-radius: 50%; cursor: pointer; font-size: 1.05rem;
	line-height: 1; flex: 0 0 auto; transition: background .2s ease, transform .2s ease;
}
.cp-scheme-toggle:hover { background: var(--cp-bg-soft); transform: rotate(12deg); }

.cp-dark {
	--cp-ink: #e6e9f2;
	--cp-muted: #98a2b8;
	--cp-line: #263042;
	--cp-bg: #0b111d;
	--cp-bg-soft: #141c2b;
	--cp-shadow: 0 1px 2px rgba(0,0,0,.4), 0 8px 24px rgba(0,0,0,.45);
	--cp-shadow-lg: 0 18px 48px rgba(0,0,0,.6);
	color-scheme: dark;
}
.cp-dark body { background: var(--cp-bg); color: var(--cp-ink); }
.cp-dark .site-header { background: #101827; }
.cp-dark .site-header.is-scrolled { box-shadow: 0 8px 30px rgba(0,0,0,.5); }
.cp-dark .site-branding a, .cp-dark .main-nav a { color: var(--cp-ink); }
.cp-dark .header-search { background: var(--cp-bg-soft); }
.cp-dark .header-search input { color: var(--cp-ink); }
.cp-dark .site-footer { background: #0a0f1a; }
.cp-dark .cp-news-card, .cp-dark .cp-card { background: #131b2a; border-color: var(--cp-line); }
.cp-dark .cp-news-card__title a { color: var(--cp-ink); }
.cp-dark .cp-pagination .page-numbers { border-color: var(--cp-line); color: var(--cp-ink); }
.cp-dark img { opacity: .94; }
.cp-dark ::selection { background: var(--cp-accent); color: #fff; }

/* v2.15.2 dark-mode audit fixes (theme) */
.cp-dark .skip-link { background: #131b2a; color: var(--cp-ink); }
.cp-dark .cp-admin-card { background: #131b2a; border-color: var(--cp-line); }
.cp-dark .cp-admin-card__title { color: var(--cp-ink); }
.cp-dark .cp-admin-card__desc { color: var(--cp-muted); }
.cp-dark .main-nav.is-open { background: #101827; box-shadow: 0 18px 40px rgba(0,0,0,.55); }
.cp-dark .main-nav ul ul { background: #101827; border-color: var(--cp-line); }
.cp-dark .site-main { color: var(--cp-ink); }
.cp-dark h1, .cp-dark h2, .cp-dark h3, .cp-dark h4, .cp-dark h5, .cp-dark h6 { color: var(--cp-ink); }
.cp-dark .cp-section__head p { color: var(--cp-muted); }

/* ==========================================================================
   v2.17 Block-page components (About / Contact demo pages)
   ========================================================================== */
.cp-block-panel {
	background: var(--cp-bg-soft, #f6f8fb);
	border: 1px solid var(--cp-line, #e2e8f0);
	border-radius: 16px;
	padding: 2rem;
}
.wp-block-column.cp-block-panel { padding: 1.5rem; }
.cp-lead { font-size: 1.15rem; color: var(--cp-muted, #5b6472); max-width: 62ch; }
.cp-stats { text-align: center; }
.cp-stat__num { font-size: 2.4rem; margin: 0; color: var(--cp-accent, #4f46e5); }
.cp-stat__label { margin-top: .25rem; color: var(--cp-muted, #5b6472); }
.wp-block-button__link { border-radius: 999px; }
.wp-block-button.is-style-outline .wp-block-button__link { border-color: var(--cp-accent, #4f46e5); color: var(--cp-accent, #4f46e5); }
.wp-block-button:not(.is-style-outline) .wp-block-button__link { background: var(--cp-accent, #4f46e5); }
@media (max-width: 700px) { .cp-block-panel { padding: 1.25rem; } }

/* Dark mode */
.cp-dark .cp-block-panel { background: #131b2a; border-color: var(--cp-line); }
.cp-dark .cp-lead, .cp-dark .cp-stat__label { color: var(--cp-muted); }
.cp-dark .wp-block-button.is-style-outline .wp-block-button__link { border-color: #8ab1ff; color: #8ab1ff; }
