/*
Theme Name: Gorod Portal
Theme URI: https://example.com/gorod-portal
Author: Cursor
Author URI: https://example.com
Description: City portal theme for local news, announcements, events, places, and advertising slots.
Version: 1.0.0
Requires at least: 6.5
Tested up to: 6.8
Requires PHP: 7.4
Text Domain: gorod-portal
*/

:root {
  --portal-bg: #f5f7fb;
  --portal-surface: #ffffff;
  --portal-text: #1d2433;
  --portal-muted: #5b6475;
  --portal-border: #d8dfeb;
  --portal-accent: #0f62fe;
  --portal-accent-dark: #0a46b8;
  --portal-warning: #d97706;
  --portal-success: #137333;
  --portal-shadow: 0 18px 50px rgba(13, 24, 48, 0.08);
  --portal-radius: 18px;
  --portal-max-width: 1200px;
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: "Segoe UI", Arial, sans-serif;
  color: var(--portal-text);
  background: var(--portal-bg);
  line-height: 1.6;
}

a {
  color: var(--portal-accent);
  text-decoration: none;
}

a:hover,
a:focus {
  color: var(--portal-accent-dark);
}

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

.screen-reader-text {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.portal-shell {
  max-width: var(--portal-max-width);
  margin: 0 auto;
  padding: 0 20px;
}

.site-header {
  background: #09162a;
  color: #f7f9fd;
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.18);
}

.site-header__bar {
  display: flex;
  gap: 24px;
  align-items: center;
  justify-content: space-between;
  padding: 18px 0;
}

.site-branding {
  min-width: 0;
}

.site-branding__title {
  margin: 0;
  font-size: 1.5rem;
  line-height: 1.2;
}

.site-branding__title a,
.site-branding__tagline {
  color: inherit;
}

.site-branding__tagline {
  margin: 6px 0 0;
  color: rgba(247, 249, 253, 0.75);
  font-size: 0.95rem;
}

.site-nav ul,
.footer-nav ul,
.portal-taxonomies {
  margin: 0;
  padding: 0;
  list-style: none;
}

.site-nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.site-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0 16px;
  border-radius: 999px;
  color: #f7f9fd;
  background: rgba(255, 255, 255, 0.08);
}

.site-nav a:hover,
.site-nav a:focus {
  background: rgba(255, 255, 255, 0.16);
  color: #ffffff;
}

.site-search {
  display: flex;
  gap: 10px;
  align-items: center;
  margin: 18px 0 0;
  padding-bottom: 20px;
}

.site-search input[type="search"],
.portal-form-control,
.portal-meta-box input[type="text"],
.portal-meta-box input[type="date"],
.portal-meta-box input[type="time"],
.portal-meta-box input[type="url"],
.portal-meta-box input[type="number"],
.portal-meta-box textarea {
  width: 100%;
  border: 1px solid var(--portal-border);
  border-radius: 12px;
  padding: 12px 14px;
  font: inherit;
  background: #fff;
}

.site-search input[type="search"] {
  max-width: 360px;
}

.portal-button,
.wp-element-button,
button,
input[type="submit"] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 12px;
  padding: 12px 18px;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  background: var(--portal-accent);
  color: #fff;
}

.portal-button:hover,
.portal-button:focus,
.wp-element-button:hover,
.wp-element-button:focus,
button:hover,
button:focus,
input[type="submit"]:hover,
input[type="submit"]:focus {
  background: var(--portal-accent-dark);
  color: #fff;
}

.portal-main {
  padding: 32px 0 48px;
}

.portal-grid {
  display: grid;
  gap: 24px;
}

.portal-grid--2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.portal-grid--3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.portal-grid--sidebar {
  grid-template-columns: minmax(0, 2fr) minmax(280px, 0.9fr);
  align-items: start;
}

.portal-section {
  margin-bottom: 32px;
}

.portal-section__header {
  display: flex;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}

.portal-section__title,
.entry-title,
.archive-title {
  margin: 0;
  line-height: 1.2;
}

.portal-section__title {
  font-size: 1.9rem;
}

.portal-card,
.portal-ad,
.portal-hero,
.entry-content-wrap,
.portal-sidebar-card,
.portal-meta-list,
.portal-empty {
  background: var(--portal-surface);
  border: 1px solid var(--portal-border);
  border-radius: var(--portal-radius);
  box-shadow: var(--portal-shadow);
}

.portal-hero {
  padding: 28px;
  background:
    radial-gradient(circle at top right, rgba(15, 98, 254, 0.22), transparent 40%),
    linear-gradient(135deg, #ffffff, #eef4ff);
}

.portal-hero__eyebrow,
.portal-card__eyebrow,
.portal-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--portal-accent);
}

.portal-hero__title {
  margin: 12px 0;
  font-size: clamp(2rem, 3vw, 3.4rem);
  line-height: 1.1;
}

.portal-hero__text,
.archive-description,
.entry-meta,
.portal-card__meta,
.portal-card__excerpt,
.portal-muted {
  color: var(--portal-muted);
}

.portal-hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 18px;
}

.portal-card {
  overflow: hidden;
}

.portal-card__media {
  aspect-ratio: 16 / 9;
  background: linear-gradient(135deg, #dbe8ff, #eff4ff);
}

.portal-card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.portal-card__body {
  padding: 20px;
}

.portal-card__title {
  margin: 10px 0 12px;
  font-size: 1.2rem;
  line-height: 1.3;
}

.portal-card__title a {
  color: var(--portal-text);
}

.portal-card__title a:hover,
.portal-card__title a:focus {
  color: var(--portal-accent);
}

.portal-card__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  margin-bottom: 12px;
  font-size: 0.95rem;
}

.portal-card__excerpt {
  margin: 0;
}

.portal-ad {
  padding: 22px;
  background: linear-gradient(180deg, #fff8ef, #ffffff);
  border-style: dashed;
}

.portal-ad__label {
  color: var(--portal-warning);
}

.portal-ad__title {
  margin: 10px 0 8px;
  font-size: 1.35rem;
}

.portal-ad__html > *:first-child,
.entry-content > *:first-child {
  margin-top: 0;
}

.portal-ad__html > *:last-child,
.entry-content > *:last-child {
  margin-bottom: 0;
}

.archive-hero,
.entry-header {
  margin-bottom: 24px;
}

.entry-content-wrap {
  padding: 28px;
}

.entry-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
  margin-top: 12px;
}

.entry-content {
  font-size: 1.05rem;
}

.entry-content h2,
.entry-content h3 {
  line-height: 1.25;
}

.portal-sidebar-card,
.portal-meta-list {
  padding: 20px;
}

.portal-sidebar-card + .portal-sidebar-card,
.portal-sidebar-card + .portal-ad,
.portal-ad + .portal-sidebar-card,
.portal-meta-list + .portal-sidebar-card {
  margin-top: 20px;
}

.portal-meta-list dt {
  font-weight: 700;
  margin-top: 12px;
}

.portal-meta-list dt:first-child {
  margin-top: 0;
}

.portal-meta-list dd {
  margin: 4px 0 0;
  color: var(--portal-muted);
}

.portal-taxonomies {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.portal-taxonomies a,
.portal-pill {
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  background: #edf3ff;
}

.portal-pagination {
  margin-top: 28px;
}

.portal-pagination .nav-links {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.portal-pagination .page-numbers {
  display: inline-flex;
  min-width: 42px;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  padding: 0 14px;
  border-radius: 12px;
  border: 1px solid var(--portal-border);
  background: #fff;
  color: var(--portal-text);
}

.portal-pagination .current {
  background: var(--portal-accent);
  border-color: var(--portal-accent);
  color: #fff;
}

.portal-empty {
  padding: 28px;
}

.portal-map {
  width: 100%;
  min-height: 360px;
  border-radius: var(--portal-radius);
  border: 1px solid var(--portal-border);
  overflow: hidden;
  box-shadow: var(--portal-shadow);
}

.site-footer {
  padding: 32px 0 48px;
  color: #d6dbea;
  background: #09162a;
}

.site-footer a {
  color: #ffffff;
}

.site-footer__grid {
  display: grid;
  gap: 24px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
}

.footer-nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.footer-nav a {
  color: rgba(255, 255, 255, 0.84);
}

.portal-copyright {
  margin: 0;
  color: rgba(214, 219, 234, 0.72);
}

.portal-meta-box__grid {
  display: grid;
  gap: 16px;
}

.portal-meta-box label {
  display: block;
  margin-bottom: 6px;
  font-weight: 600;
}

.portal-meta-box .description {
  margin-top: 6px;
}

@media (max-width: 960px) {
  .site-header__bar,
  .site-footer__grid,
  .portal-grid--sidebar,
  .portal-grid--3,
  .portal-grid--2 {
    grid-template-columns: 1fr;
    display: grid;
  }

  .site-nav ul,
  .footer-nav ul {
    justify-content: flex-start;
  }

  .site-search {
    flex-direction: column;
    align-items: stretch;
  }

  .site-search input[type="search"] {
    max-width: none;
  }
}

@media (max-width: 640px) {
  .portal-shell {
    padding: 0 16px;
  }

  .portal-main {
    padding-top: 24px;
  }

  .portal-hero,
  .portal-card__body,
  .entry-content-wrap,
  .portal-ad,
  .portal-sidebar-card,
  .portal-meta-list,
  .portal-empty {
    padding: 18px;
  }
}
