/*
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: 1.1.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
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; max-width: 820px; 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; }
}
