/*
Theme Name: ДаМосква
Theme URI: https://damoskva.ru/
Description: Городская афиша Москвы, подборки, площадки и статьи.
Version: 2.0.2
Requires at least: 5.9
Requires PHP: 7.4
Text Domain: damoskva
*/

:root {
    --paper: #fcfcfb;
    --surface: #f1f1f4;
    --white: #fff;
    --ink: #1c1b24;
    --muted: #55535f;
    --line: #dedce4;
    --accent: #4a2ab0;
    --accent-dark: #361c86;
    --accent-soft: #f0eafd;
    --lime: #e5fb86;
    --radius: 20px;
    --shadow: 0 10px 28px #24203a10;
}
*, *::before, *::after { box-sizing: border-box; }
html { scroll-padding-top: 20px; }
body {
    margin: 0;
    background: var(--paper);
    color: var(--ink);
    font: 16px/1.55 system-ui, -apple-system, "Segoe UI", sans-serif;
    overflow-wrap: anywhere;
}
h1, h2, h3, p, figure { margin: 0; }
h1, h2, h3 { line-height: 1.1; }
h1 { font-size: clamp(2.15rem, 5vw, 4.35rem); font-weight: 800; letter-spacing: -.055em; }
h2 { font-size: clamp(1.55rem, 3.15vw, 2.55rem); letter-spacing: -.042em; }
a { color: var(--accent); text-underline-offset: .19em; }
a:hover { color: var(--accent-dark); }
button, input, textarea, select { font: inherit; color: inherit; }
button, summary { cursor: pointer; }
img { display: block; max-width: 100%; height: auto; }
:focus-visible { outline: 3px solid #6634d4; outline-offset: 3px; }
.shell { width: min(1240px, calc(100% - 72px)); margin-inline: auto; }
.site-main { min-height: 55vh; padding-block: 30px 76px; }
.screen-reader-text {
    position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden;
    clip: rect(0, 0, 0, 0); clip-path: inset(50%); white-space: nowrap;
}
.skip-link:focus {
    width: auto; height: auto; clip: auto; clip-path: none;
    top: 12px; left: 12px; z-index: 10; padding: 10px 15px;
    background: var(--white); border-radius: 10px;
}

.site-header { background: var(--white); border-bottom: 1px solid var(--line); }
.header-inner {
    min-height: 75px; display: grid; grid-template-columns: auto 1fr minmax(190px, 246px);
    align-items: center; gap: clamp(18px, 3vw, 44px);
}
.brand {
    display: inline-flex; align-items: center; gap: 9px; width: fit-content;
    color: var(--ink); font-size: 1.45rem; letter-spacing: -.065em;
    font-weight: 850; text-decoration: none; white-space: nowrap;
}
.brand-accent { color: var(--accent); }
.brand-mark {
    width: 33px; height: 33px; background: var(--accent); border-radius: 10px;
    display: inline-flex; align-items: flex-end; justify-content: center;
    padding-bottom: 8px; gap: 2px; flex: 0 0 auto;
}
.brand-mark i { display: block; background: var(--lime); width: 4px; height: 9px; border-radius: 3px 3px 0 0; }
.brand-mark i:nth-child(2) { height: 17px; }
.brand-mark i:last-child { height: 12px; }
.main-nav ul, .site-footer ul {
    list-style: none; margin: 0; padding: 0;
}
.main-nav ul { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.main-nav a {
    display: block; padding: 9px 12px; min-height: 44px;
    color: var(--muted); font-weight: 650; text-decoration: none; border-radius: 10px;
}
.main-nav a:hover, .main-nav a[aria-current="page"] { color: var(--accent); background: var(--accent-soft); }
.site-search {
    display: flex; width: 100%; min-width: 0; align-items: stretch; border: 1px solid var(--line);
    background: var(--paper); border-radius: 12px;
}
.site-search input {
    flex: 1; min-width: 0; min-height: 44px; width: 100%; border: 0;
    border-radius: 12px; background: transparent; padding: 9px 12px;
}
.site-search button {
    display: grid; place-items: center; min-width: 45px; border: 0; border-radius: 10px;
    color: var(--accent); background: transparent;
}
.site-search button:hover { background: var(--accent-soft); }

.home-hero {
    position: relative; display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr);
    min-height: 350px; isolation: isolate; overflow: hidden; border-radius: 27px;
    background: #241742; color: var(--white);
}
.hero-copy { z-index: 1; align-self: center; padding: clamp(28px, 4vw, 58px); }
.hero-copy h1 { font-size: clamp(3rem, 6.2vw, 5.75rem); line-height: .96; }
.hero-copy h1 span { color: var(--lime); }
.hero-copy p { margin: 20px 0 26px; color: #eee6ff; font-size: clamp(1rem, 1.9vw, 1.22rem); }
.button {
    display: inline-flex; align-items: center; justify-content: center; gap: 12px;
    min-height: 46px; padding: 10px 17px; border: 1px solid transparent; border-radius: 11px;
    text-align: center; text-decoration: none; font-weight: 750; line-height: 1.2;
}
.button-primary { background: var(--accent); color: var(--white); }
.button-primary:hover { background: var(--accent-dark); color: var(--white); }
.home-hero .button-primary { background: var(--lime); color: #21173b; }
.home-hero .button-primary:hover { background: #f1ffbb; }
.home-hero :focus-visible { outline-color: var(--lime); }
.button-secondary { background: var(--white); border-color: var(--line); color: var(--accent); }
.button-secondary:hover { background: var(--accent-soft); border-color: #b5a1e6; }
.hero-art { position: relative; min-width: 0; }
.hero-art::before {
    content: ""; position: absolute; inset: -20% -20% -20% -28%;
    background: radial-gradient(ellipse at 66% 58%, #6842d2 0%, #4e2d9d 29%, transparent 67%);
}
.hero-orbit {
    position: absolute; width: min(36vw, 480px); aspect-ratio: 1;
    top: 50%; left: 47%; transform: translate(-50%, -50%); border-radius: 50%;
    border: 1px solid #c3acff73; box-shadow: 0 0 0 25px #b49aff24, 0 0 0 54px #b49aff16, 0 0 0 84px #b49aff0c;
}
.hero-ticket {
    position: absolute; width: 66%; max-width: 360px; aspect-ratio: 1.55;
    display: flex; align-items: end; justify-content: center; gap: 5%;
    top: 49%; left: 48%; padding: 12% 12% 9%; border-radius: 17px;
    background: var(--lime); transform: translate(-50%, -50%) rotate(-14deg);
    box-shadow: 0 19px 45px #190e3a55;
}
.hero-ticket::before {
    content: ""; position: absolute; inset: 9% 8%; border: 1px solid #25194166; border-radius: 10px;
}
.hero-ticket span {
    position: relative; width: 19%; height: 67%; background: #271b43;
    clip-path: polygon(50% 0, 100% 33%, 100% 100%, 0 100%, 0 33%);
}
.hero-ticket span:nth-child(2) { height: 115%; }
.hero-ticket span:nth-child(3) { height: 82%; }
.hero-star {
    position: absolute; top: 14%; right: 10%; color: #e9ddff; line-height: 1; font-size: clamp(3rem, 7vw, 7.3rem);
    transform: rotate(-12deg);
}
.hero-dot { position: absolute; width: 12px; height: 12px; border-radius: 50%; bottom: 19%; left: 13%; background: #e9ddff; }

.home-section, .collections-section { margin-top: 34px; }
.section-heading {
    display: flex; align-items: baseline; justify-content: space-between;
    gap: 12px 22px; flex-wrap: wrap; margin-bottom: 19px;
}
.more-link, .back-link, .reset-link { font-weight: 700; }
.more-link { text-decoration: none; }
.more-link:hover { text-decoration: underline; }
.arrow-up {
    position: relative; display: inline-block; width: 11px; height: 11px; flex: 0 0 11px;
    vertical-align: .05em;
}
.arrow-up::before {
    content: ""; position: absolute; top: 0; right: 0; width: 8px; height: 8px;
    border-top: 2px solid; border-right: 2px solid;
}
.arrow-up::after {
    content: ""; position: absolute; width: 12px; height: 2px; top: 7px; left: 0;
    background: currentColor; transform: rotate(-45deg); transform-origin: left center;
}
.more-link .arrow-up { margin-left: 3px; }
.filter-panel {
    padding: 0 0 12px; margin-bottom: 13px;
    border-bottom: 1px solid var(--line);
}
.pills, .filter-options { display: flex; flex-wrap: wrap; gap: 7px; align-items: center; }
.pill {
    display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 8px 13px;
    text-decoration: none; color: var(--ink); border-radius: 999px; border: 1px solid var(--line);
    background: var(--surface); border-color: transparent; font-size: .875rem; font-weight: 650; line-height: 1.25;
}
.pill:hover { color: var(--accent); border-color: #a996d6; background: var(--accent-soft); }
.pill.is-active { color: var(--white); border-color: var(--accent); background: var(--accent); }
.filter-options { margin-top: 10px; }
.check { width: 15px; height: 15px; border: 1px solid #756b86; border-radius: 4px; }
.is-active .check { background: var(--lime); border-color: var(--lime); position: relative; }
.is-active .check::after {
    content: ""; position: absolute; width: 7px; height: 4px; border: solid #241742;
    border-width: 0 0 2px 2px; top: 3px; left: 3px; transform: rotate(-45deg);
}
.reset-link { padding: 9px 4px; margin-left: 5px; font-size: .9rem; }
.filter-details { margin-top: 10px; }
.filter-details summary, .schedule-details summary {
    width: fit-content; min-height: 44px; padding: 10px 5px;
    color: var(--accent); font-weight: 700;
}
.date-forms { display: flex; flex-wrap: wrap; align-items: end; gap: 15px 24px; }
.date-form { display: flex; flex-wrap: wrap; align-items: end; gap: 8px; }
.date-form label { display: grid; gap: 4px; color: var(--muted); font-size: .85rem; font-weight: 650; }
.date-form input {
    min-height: 46px; min-width: 0; max-width: 100%; padding: 7px 9px; border-radius: 9px;
    border: 1px solid var(--line); background: var(--paper); color: var(--ink); font-size: 1rem;
}
.date-form button { font-size: .87rem; }
.category-nav { margin: 0 0 21px; }
.category-nav .pill { background: var(--white); border-color: var(--line); }
.category-nav .pill.is-active { background: var(--accent); border-color: var(--accent); }

.event-grid, .collection-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; }
.event-card {
    display: flex; min-width: 0; background: var(--surface);
    border-radius: 15px; transition: box-shadow .18s;
}
.event-card:hover, .event-card:focus-within { box-shadow: var(--shadow); }
.card-link { display: flex; flex-direction: column; width: 100%; min-width: 0; color: var(--ink); text-decoration: none; border-radius: inherit; }
.card-link:hover { color: var(--ink); }
.card-media { position: relative; overflow: hidden; border-radius: 15px 15px 0 0; aspect-ratio: 1.5; background: #ded2fa; }
.card-media img { width: 100%; height: 100%; object-fit: cover; }
.card-placeholder {
    background:
        radial-gradient(circle at 78% 35%, #d9f879 0 7%, transparent 7.5%),
        repeating-radial-gradient(ellipse at 65% 78%, #ffffff40 0 1px, transparent 2px 15px),
        linear-gradient(145deg, #c3acf3, #e6dcff);
}
.card-media.has-date:not(.card-placeholder)::after {
    content: ""; position: absolute; inset: 0 0 auto; height: 85px;
    background: linear-gradient(#1c1725b8, transparent); pointer-events: none;
}
.card-date, .card-price {
    position: absolute; z-index: 1; inset-inline-start: 10px; max-width: calc(100% - 20px);
    font-size: .8rem; font-weight: 750; line-height: 1.25;
}
.card-date { top: 10px; color: var(--white); text-shadow: 0 1px 4px #0009; }
.card-placeholder .card-date { color: #241742; text-shadow: none; }
.card-price {
    bottom: 10px; padding: 5px 9px; color: #201a2c; background: var(--white); border-radius: 999px;
}
.card-price.is-free { background: var(--lime); }
.card-body { display: flex; flex: 1; flex-direction: column; gap: 6px; padding: 14px 14px 17px; }
.card-kicker { color: var(--accent); font-size: .79rem; font-weight: 650; line-height: 1.3; }
.card-title { font-size: clamp(1rem, 1.55vw, 1.23rem); font-weight: 720; letter-spacing: -.024em; line-height: 1.22; }
.card-link:hover .card-title { color: var(--accent); }
.card-place { display: flex; align-items: flex-start; gap: 6px; margin-top: auto; padding-top: 4px; color: var(--muted); font-size: .85rem; line-height: 1.35; }
.card-place svg { flex: 0 0 auto; }

.collection-card {
    position: relative; display: flex; align-items: end; isolation: isolate; overflow: hidden;
    min-height: 154px; border-radius: 17px; background: #e9defb; color: #241742; text-decoration: none;
}
.collection-card:nth-child(4n+2) { background: #e8f4b8; }
.collection-card:nth-child(4n+3) { background: #fbe0cb; }
.collection-card:nth-child(4n+4) { background: #dbe9ff; }
.collection-card.has-image { color: var(--white); }
.collection-card img, .collection-card.has-image::after { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.collection-card.has-image::after { content: ""; z-index: 0; background: linear-gradient(transparent 4%, #201135 100%); }
.collection-content { z-index: 1; width: 100%; padding: 17px; display: flex; gap: 10px; align-items: end; justify-content: space-between; }
.collection-content strong { font-size: clamp(1.05rem, 2vw, 1.4rem); line-height: 1.2; letter-spacing: -.025em; }
.collection-content .arrow-up { margin-bottom: 3px; }
.collection-card:hover { color: inherit; box-shadow: var(--shadow); }
.collection-card.has-image:hover { color: var(--white); }
.collection-card:hover strong { text-decoration: underline; text-underline-offset: .18em; }
.page-heading { margin: 4px 0 25px; }
.page-heading > p { margin-top: 10px; color: var(--muted); font-size: 1.05rem; }
.page-heading .active-summary { color: var(--accent); font-weight: 700; }
.page-heading + .collections-section { margin-top: 0; }
.pagination { display: flex; flex-wrap: wrap; justify-content: center; gap: 7px; margin-top: 27px; }
.page-numbers {
    display: inline-grid; place-items: center; min-height: 44px; min-width: 44px;
    padding: 5px 9px; border: 1px solid var(--line); background: var(--white);
    border-radius: 9px; text-decoration: none; font-weight: 700;
}
.page-numbers.current { color: var(--white); background: var(--accent); border-color: var(--accent); }
a.page-numbers:hover { background: var(--accent-soft); }
.empty-state {
    padding: 26px; background: var(--white); border: 1px solid var(--line);
    border-radius: var(--radius); color: var(--muted);
}
.empty-state .button { margin-top: 15px; }
.error-page { display: grid; justify-items: start; gap: 13px; padding: clamp(25px, 5vw, 64px); }
.error-page .site-search { max-width: 400px; }
.error-code { color: var(--accent); font-weight: 800; }
.archive-description { max-width: 850px; margin-top: 28px; }
.archive-intro { margin: 0 0 24px; }

.reading-page, .comments-area {
    padding: clamp(20px, 4vw, 46px); background: var(--white);
    border: 1px solid var(--line); border-radius: var(--radius);
}
.event-page, .reading-page, .comments-area { margin: 0 auto 32px; }
.event-page { max-width: 1060px; }
.reading-page, .comments-area { max-width: 860px; }
.back-link { display: inline-block; margin-bottom: 16px; }
.event-hero { display: grid; gap: clamp(20px, 3.8vw, 42px); align-items: center; }
.event-hero.has-poster { grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); }
.event-intro h1 {
    font-size: clamp(1.9rem, 2.75vw, 2.85rem);
    font-weight: 760; line-height: 1.12; letter-spacing: -.035em;
    text-wrap: pretty;
}
.event-category { margin-bottom: 9px; color: var(--accent); font-size: .92rem; font-weight: 700; }
.event-facts {
    display: grid; grid-template-columns: repeat(2, minmax(0, max-content));
    gap: 10px clamp(16px, 3vw, 34px); margin: 17px 0;
}
.event-fact-place { grid-column: 1 / -1; }
.event-facts dt { color: var(--muted); font-size: .81rem; }
.event-facts dd { margin: 2px 0 0; font-weight: 650; line-height: 1.4; }
.event-poster { min-width: 0; }
.event-poster img {
    width: auto; max-width: 100%; height: auto; max-height: 330px;
    margin-inline: auto; border-radius: 14px;
}
.event-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.status-ended { color: var(--muted); font-weight: 700; }
.event-section { margin-top: 27px; padding-top: 24px; border-top: 1px solid var(--line); }
.event-section h2, .comments-area h2 { margin-bottom: 15px; }
.schedule-list { margin: 0; padding: 0; list-style: none; }
.schedule-row {
    display: grid; grid-template-columns: minmax(120px, 1.2fr) minmax(65px, .8fr) minmax(76px, .8fr) minmax(95px, auto);
    align-items: center; gap: 8px 18px; min-height: 62px; padding: 8px 0;
}
.schedule-row + .schedule-row { border-top: 1px solid var(--line); }
.schedule-date { display: grid; }
.schedule-time { grid-column: 2; }
.schedule-price { grid-column: 3; }
.schedule-link { grid-column: 4; justify-self: end; background: var(--accent-soft); border-color: transparent; min-height: 44px; font-size: .875rem; }
.schedule-row--period { grid-template-columns: minmax(0, 1fr) minmax(70px, auto) minmax(0, 1fr); }
.schedule-row--period .schedule-link { grid-column: 3; }
.schedule-date time { font-weight: 750; }
.schedule-date span, .muted, .article-date { color: var(--muted); }
.schedule-details { margin-top: 8px; }
.venue-card { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.venue-card p { color: var(--muted); }
.article-image { margin-block: 18px; }
.article-image img { border-radius: 14px; }
.article-date, .article-tags { margin-block: 12px; }
.prose { font-size: 1.055rem; line-height: 1.7; }
.prose > * + * { margin-top: 1em; }
.prose h2, .prose h3 { margin-top: 1.3em; }
.prose li + li { margin-top: .35em; }
.prose iframe, .prose video { max-width: 100%; }
.prose table { display: block; max-width: 100%; overflow-x: auto; border-collapse: collapse; }
.prose th, .prose td { border: 1px solid var(--line); padding: 7px 10px; text-align: left; }
.aligncenter { margin-inline: auto; }
.alignleft { float: left; margin: 0 15px 12px 0; }
.alignright { float: right; margin: 0 0 12px 15px; }
.wp-caption { max-width: 100%; }
.wp-caption-text, figcaption { color: var(--muted); font-size: .9rem; }
.prose::after { content: ""; display: block; clear: both; }
.comment-list { padding-left: 24px; }
.comment-list li { margin-bottom: 12px; }
.comment-form p { margin: 10px 0; }
.comment-form label { display: block; }
.comment-form input:not([type="checkbox"]), .comment-form textarea {
    width: min(100%, 550px); padding: 9px 12px; border: 1px solid var(--line); border-radius: 8px;
}
.comment-form input[type="submit"] { background: var(--accent); color: var(--white); width: auto; max-width: 100%; cursor: pointer; }
.site-footer { border-top: 1px solid var(--line); background: #eeebf5; }
.footer-inner { display: grid; grid-template-columns: 1.2fr 1fr .7fr; gap: 20px; padding-block: 29px 35px; }
.site-footer address { margin-top: 10px; color: var(--muted); font-style: normal; font-size: .88rem; }
.site-footer li a { display: inline-block; min-height: 32px; padding-block: 3px; font-size: .88rem; }

@media (min-width: 1001px) {
    .filter-panel { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 7px 12px; }
    .filter-options { justify-content: flex-end; margin-top: 0; }
    .filter-details { grid-column: 1 / -1; margin-top: 0; }
}
@media (max-width: 1000px) {
    .shell { width: min(1240px, calc(100% - 46px)); }
    .header-inner { column-gap: 13px; }
    .main-nav a { padding-inline: 8px; }
    .event-grid, .collection-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 13px; }
}
@media (max-width: 760px) {
    .shell { width: calc(100% - 30px); }
    .site-main { padding-block: 17px 44px; }
    .header-inner {
        grid-template-columns: auto minmax(0, 1fr); grid-template-areas: "brand search" "nav nav";
        gap: 5px 10px; padding-block: 10px 5px;
    }
    .header-inner .brand { grid-area: brand; font-size: 1.22rem; gap: 5px; }
    .brand-mark { width: 27px; height: 27px; padding-bottom: 5px; }
    .header-inner .site-search { grid-area: search; }
    .header-inner .site-search input { padding-inline: 7px; }
    .main-nav { grid-area: nav; }
    .main-nav ul { gap: 2px; }
    .main-nav a { font-size: .9rem; padding-inline: 7px; }
    .home-hero { min-height: 282px; grid-template-columns: minmax(0, 1fr); }
    .hero-copy { padding: 26px; }
    .hero-copy h1 { font-size: clamp(2.55rem, 9.2vw, 4.5rem); }
    .hero-copy p { max-width: 27ch; }
    .hero-art { position: absolute; inset: 0 0 0 63%; opacity: .42; pointer-events: none; }
    .hero-ticket { top: 46%; width: 90%; }
    .hero-orbit { width: 95%; }
    .hero-star { right: 5%; top: 17%; }
    .home-section, .collections-section { margin-top: 31px; }
    .pill { min-height: 44px; padding-inline: 10px; font-size: .85rem; }
    .event-grid, .collection-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .event-hero.has-poster { grid-template-columns: minmax(0, 1fr); }
    .event-poster { max-width: 560px; }
    .event-poster img { margin-inline: 0; max-height: 280px; }
    .footer-inner { grid-template-columns: 1fr 1fr; }
    .footer-inner > div { grid-column: 1 / -1; }
}
@media (max-width: 520px) {
    .schedule-row, .schedule-row--period { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
    .schedule-row--period .schedule-time { justify-self: end; }
    .schedule-price { grid-column: 1; }
    .schedule-row .schedule-link { grid-column: 2; justify-self: start; }
    .schedule-row--period .schedule-link { grid-column: 1 / -1; }
}
@media (max-width: 390px) {
    .shell { width: calc(100% - 22px); }
    .event-grid, .collection-grid { gap: 8px; }
    .card-body { padding: 10px; }
    .card-date, .card-price { inset-inline-start: 7px; max-width: calc(100% - 14px); }
    .card-date { top: 7px; }
    .card-price { bottom: 7px; }
    .date-form { width: 100%; }
    .date-form label { max-width: 100%; }
    .date-form input { width: 136px; }
    .date-form button { max-width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { transition-duration: .01ms !important; }
}
