/*
Theme Name: МФЦ Сергиево-Посад
Theme URI: http://mfc-spmr.ru
Author: МФЦ Сергиево-Посадского городского округа
Description: Современная тема сайта МФЦ в цветах «Мои документы».
Version: 1.0.0
Text Domain: mfcsp
*/

:root {
  --brown: #6f2b0e;
  --brown-deep: #4a1c09;
  --coral: #f26649;
  --coral-deep: #d84b30;
  --sand: #e0985b;
  --cream: #f6efe6;
  --paper: #ffffff;
  --ink: #2c1b14;
  --muted: #6e5c53;
  --line: #eadfd4;
  --shadow: 0 12px 30px rgba(74, 28, 9, 0.08);
  --max: 1120px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--cream);
  font-family: "Segoe UI", "PT Sans", "Noto Sans", Arial, sans-serif;
  font-size: 17px;
  line-height: 1.55;
}
img { max-width: 100%; height: auto; }
a { color: var(--brown); }
a:hover { color: var(--coral-deep); }
.skip {
  position: absolute;
  left: 12px;
  top: -40px;
  background: #fff;
  padding: 8px 12px;
  z-index: 10;
}
.skip:focus { top: 12px; }

.topbar {
  background: var(--brown-deep);
  color: #f6efe6;
  font-size: 14px;
}
.topbar a { color: #fff; text-decoration: none; }
.topbar-inner, .header-inner, .nav-inner, .wrap, .footer-inner {
  width: min(var(--max), calc(100% - 32px));
  margin: 0 auto;
}
.topbar-inner {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 8px 0;
  flex-wrap: wrap;
}

.site-header { background: var(--paper); }
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 18px 0;
}
.brand { display: flex; align-items: center; gap: 14px; text-decoration: none; color: var(--ink); }
.brand img { width: 74px; height: auto; }
.brand-name { font-weight: 700; font-size: 18px; line-height: 1.25; max-width: 460px; }
.brand-name span { display: block; font-weight: 500; color: var(--muted); font-size: 14px; margin-top: 2px; }
.search { display: flex; }
.search input[type="search"] {
  border: 1px solid var(--line);
  border-right: 0;
  border-radius: 8px 0 0 8px;
  padding: 10px 12px;
  min-width: 180px;
  font: inherit;
}
.search button {
  border: 0;
  background: var(--brown);
  color: #fff;
  border-radius: 0 8px 8px 0;
  padding: 0 16px;
  font: inherit;
  cursor: pointer;
}

.nav-toggle { position: absolute; opacity: 0; pointer-events: none; }
.nav-toggle-label { display: none; }
.site-nav { background: var(--brown); }
.site-nav a { color: #fff; text-decoration: none; }
.menu { display: flex; flex-wrap: wrap; gap: 4px; list-style: none; margin: 0; padding: 0; }
.menu a { display: block; padding: 12px 14px; border-radius: 8px; }
.menu a:hover, .menu .current-menu-item a { background: rgba(255,255,255,0.12); }

.wrap { padding: 22px 0 56px; }
.hero { display: grid; grid-template-columns: 1.35fr 0.9fr; gap: 14px; align-items: stretch; }
.promo {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  text-decoration: none;
  color: #fff;
  border-radius: 22px;
  padding: 22px 24px;
  min-height: 0;
}
.promo::after {
  content: "";
  position: absolute;
  width: 180px;
  height: 180px;
  border-radius: 50%;
  right: -48px;
  bottom: -64px;
  background: rgba(255,255,255,0.16);
}
.promo > * { position: relative; z-index: 1; }
.promo h2 { margin: 0; font-size: 28px; line-height: 1.15; letter-spacing: -0.03em; }
.promo p { margin: 0; max-width: 38em; }
.promo-main h2 { font-size: 36px; }
.kicker { font-size: 13px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; opacity: 0.85; }
.btn {
  display: inline-flex;
  margin-top: 8px;
  background: #fff;
  color: var(--brown);
  border-radius: 999px;
  padding: 8px 14px;
  font-weight: 700;
  font-size: 14px;
}
.tone-coral { background: linear-gradient(145deg, #ff7a62, #e14d34 70%); }
.tone-sand { background: linear-gradient(145deg, #f0be86, #c98445); color: #3a2410; }
.tone-sand .btn { color: #3a2410; }
.tone-cream { background: #fff; color: var(--ink); border: 1px solid var(--line); }
.tone-ink { background: var(--brown); }
.promo-side { display: grid; gap: 14px; }
.promo-side .promo h2 { font-size: 22px; }

.actions { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-top: 14px; }
.action {
  background: #fff;
  border-radius: 18px;
  padding: 16px 16px 14px;
  text-decoration: none;
  color: inherit;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 4px;
  border-top: 4px solid var(--coral);
}
.action strong { font-size: 18px; }
.action span { color: var(--muted); font-size: 14px; }
.action:hover { transform: translateY(-2px); }

.section-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin: 36px 0 14px; }
.section-head h2 { margin: 0; font-size: 28px; letter-spacing: -0.03em; }
.section-head a { font-weight: 700; text-decoration: none; }

.news-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; align-items: stretch; }
.news-card {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
  background: #fff;
  border-radius: 18px;
  overflow: hidden;
  box-shadow: var(--shadow);
}
.news-cover {
  display: block;
  aspect-ratio: 16 / 9;
  background: #fff;
  overflow: hidden;
  border-radius: 18px 18px 0 0;
}
.news-cover img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  display: block;
}
.news-body { display: flex; flex-direction: column; gap: 6px; padding: 14px 16px 16px; }
.news-card time { color: var(--coral-deep); font-size: 13px; font-weight: 700; }
.news-card h3 { margin: 0; font-size: 18px; line-height: 1.3; }
.news-card p { margin: 0; color: var(--muted); font-size: 15px; }
.news-card.no-photo .news-body { padding-top: 18px; }

.service-bento {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  width: 100%;
}
.service-card {
  position: relative;
  display: block;
  aspect-ratio: 3 / 2;
  background: #fff;
  border-radius: 18px;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  box-shadow: var(--shadow);
  min-width: 0;
}
.service-card img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
}

.links { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-top: 18px; }
.links > .panel:first-child { grid-column: span 2; }
.panel { background: #fff; border-radius: 18px; padding: 18px 18px 8px; box-shadow: var(--shadow); }
.panel h2 { margin: 0 0 12px; }
.link-list { list-style: none; margin: 0; padding: 0 0 10px; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; align-items: stretch; }
.link-list li { margin: 0; padding: 0; min-width: 0; display: flex; }
.link-list a {
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 46px;
  background: var(--cream);
  border-radius: 12px;
  padding: 12px 12px;
  text-decoration: none;
  font-weight: 700;
  line-height: 1.3;
}
.hours { background: var(--brown); color: #fff; }
.hours h2, .hours p, .hours a { color: #fff; }
.hours .phone { font-size: 22px; font-weight: 750; margin: 0 0 8px; }

.page-title { margin: 0 0 16px; font-size: 36px; line-height: 1.15; letter-spacing: -0.03em; }
.meta { color: var(--muted); margin: 0 0 8px; }
.entry { background: var(--paper); border-radius: 22px; padding: 28px; box-shadow: var(--shadow); }
.entry h1, .entry h2, .entry h3 { line-height: 1.25; }
.content, .content h2, .content h3, .content h4, .content h5, .content p, .content li, .content span, .content em, .content strong { font-family: inherit; }
.content h4, .content h5 { font-size: 22px; font-weight: 700; color: var(--ink); margin: 1.3em 0 0.4em; }
.content p { margin: 0 0 0.9em; }
.content h2, .content h3 { margin: 1.3em 0 0.4em; }
.office-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.office-card {
  background: var(--cream);
  color: var(--ink);
  border-radius: 18px;
  padding: 16px 18px 14px;
  min-width: 0;
}
.office-card h2 { margin: 0 0 8px; font-size: 22px; letter-spacing: -0.03em; }
.office-kicker { margin: 0 0 4px; color: var(--coral-deep); font-size: 12px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; }
.office-card p { margin: 0 0 8px; }
.office-card dl { margin: 8px 0 0; display: grid; gap: 8px; }
.office-card dt { font-size: 12px; font-weight: 700; color: var(--muted); }
.office-card dd { margin: 0; font-weight: 650; }
.office-card a { text-decoration: none; }
.office-extra p { margin: 0 0 6px; }
.office-wide { grid-column: 1 / -1; }
.office-hero {
  background: linear-gradient(145deg, #ff7d66, #e14d34);
  color: #fff;
}
.office-hero .office-kicker, .office-hero a { color: #fff; }
.office-note { background: #fff; border: 1px solid var(--line); }
.pos-slot { margin: 16px 0 4px; }
.pos-slot img { max-width: none; }
.pos-slot #js-show-iframe-wrapper { border-radius: 22px; overflow: hidden; }
.pos-note { margin: 10px 0 0; color: var(--muted); font-size: 13px; line-height: 1.45; }
.entry table { width: 100%; border-collapse: collapse; display: block; overflow-x: auto; }
.entry td, .entry th { border: 1px solid var(--line); padding: 6px 8px; vertical-align: top; }
.entry iframe { max-width: 100%; }
.news-photo {
  display: block;
  width: 100% !important;
  max-width: 100%;
  height: auto !important;
  float: none !important;
  margin: 4px 0 18px !important;
  border-radius: 16px;
}
.bento { display: flex; flex-direction: column; gap: 12px; margin: 0 0 8px; background: none; color: inherit; border: 0; min-width: 0; }
.bento.tone-coral, .bento.tone-sand, .bento.tone-ink, .bento.tone-cream { background: none; color: inherit; border: 0; }
.bento-row { display: grid; gap: 12px; align-items: stretch; min-width: 0; }
.bento-row > * { min-width: 0; }
.bento-row.hero-left { grid-template-columns: 1.45fr 1fr; grid-template-rows: 1fr 1fr; }
.bento-row.hero-right { grid-template-columns: 1fr 1.45fr; grid-template-rows: 1fr 1fr; }
.bento-row.pair { grid-template-columns: 1fr 1fr; }
.bento-row.solo { grid-template-columns: 1fr; }
.hero-left .tile:nth-child(1) { grid-column: 1; grid-row: 1 / span 2; }
.hero-left .tile:nth-child(2) { grid-column: 2; grid-row: 1; }
.hero-left .tile:nth-child(3) { grid-column: 2; grid-row: 2; }
.hero-right .tile:nth-child(1) { grid-column: 1; grid-row: 1; }
.hero-right .tile:nth-child(2) { grid-column: 1; grid-row: 2; }
.hero-right .tile:nth-child(3) { grid-column: 2; grid-row: 1 / span 2; }
.tile {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 12px;
  min-height: 112px;
  height: 100%;
  box-sizing: border-box;
  background: var(--cream);
  color: var(--ink);
  border-radius: 18px;
  padding: 16px 16px 14px 62px;
  text-decoration: none;
  font-weight: 700;
  line-height: 1.35;
  min-width: 0;
  overflow-wrap: anywhere;
}
.tile::before {
  content: "";
  position: absolute;
  left: 14px;
  top: 16px;
  width: 36px;
  height: 36px;
  border-radius: 11px;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23d84b30' stroke-width='1.8'%3E%3Cpath d='M7 3h7l5 5v13a1 1 0 0 1-1 1H7a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1z'/%3E%3Cpath d='M14 3v6h6'/%3E%3C/svg%3E") center / 20px no-repeat;
}
.tile::after {
  content: "Открыть";
  margin-top: auto;
  font-size: 13px;
  font-weight: 700;
  color: var(--coral-deep);
}
.tile:has(.tile-go)::after, .tile.static::after { content: none; }
.tile-go { margin-top: auto; font-size: 13px; color: var(--coral-deep); }
.tile.hero {
  background:
    radial-gradient(circle at 110% 120%, rgba(255,255,255,.28), transparent 40%),
    linear-gradient(145deg, #ff7d66, #e14d34);
  color: #fff;
  font-size: 18px;
}
.tone-sand .tile.hero {
  background:
    radial-gradient(circle at 110% 120%, rgba(255,255,255,.35), transparent 42%),
    linear-gradient(145deg, #f0be86, #c98445);
  color: #3a2410;
}
.tone-ink .tile.hero { background: linear-gradient(145deg, #8a4630, #4a1c09); color: #fff; }
.tone-cream .tile.hero { background: #fff; color: var(--ink); border: 1px solid var(--line); }
.tile.hero::before { background-color: rgba(255,255,255,.92); }
.tile.hero::after, .tile.hero .tile-go { color: inherit; }
a.tile { transition: transform .18s ease, filter .18s ease, box-shadow .18s ease; }
a.tile:hover { transform: translateY(-3px); box-shadow: 0 16px 28px rgba(74, 28, 9, 0.14); }
a.tile.hero:hover,
a.tile.hero:hover::after,
a.tile.hero:hover .tile-go { color: #fff; }
a.tile.hero:hover { filter: brightness(1.08); text-decoration: underline; text-underline-offset: 3px; }
.bento.tone-sand a.tile.hero:hover,
.bento.tone-sand a.tile.hero:hover::after,
.bento.tone-sand a.tile.hero:hover .tile-go { color: #3a2410; }
.bento.tone-cream a.tile.hero:hover,
.bento.tone-cream a.tile.hero:hover::after,
.bento.tone-cream a.tile.hero:hover .tile-go { color: var(--coral-deep); }
.svc-head { display: flex; align-items: center; justify-content: flex-start; gap: 10px; margin: 28px 0 14px; }
.svc-head h2 { margin: 0; font-size: 26px; letter-spacing: -0.03em; }
.svc-count { background: var(--brown); color: #fff; border-radius: 999px; min-width: 32px; text-align: center; padding: 3px 10px; font-size: 13px; font-weight: 700; }
.svc-block:nth-child(4n+1) .svc-count { background: var(--coral); }
.svc-block:nth-child(4n+2) .svc-count { background: #c98445; }
.svc-block:nth-child(4n+3) .svc-count { background: var(--brown); }
.svc-block:nth-child(4n) .svc-count { background: #2c1b14; }
.pager { display: flex; gap: 16px; margin-top: 18px; flex-wrap: wrap; }
.pager a, .pager span { background: #fff; padding: 8px 12px; border-radius: 8px; }

.site-footer { background: var(--brown-deep); color: #f6efe6; padding: 28px 0; font-size: 15px; }
.footer-inner { display: grid; grid-template-columns: 1.4fr 1fr; gap: 20px; }
.site-footer a { color: #fff; }
.site-footer h2 { font-size: 16px; margin: 0 0 8px; }
.legal { margin-top: 18px; color: #e7cbbd; font-size: 13px; }
.legal p { margin: 0 0 6px; }
.legal a { color: #fff; text-decoration: underline; text-underline-offset: 2px; }

@media (max-width: 860px) {
  .service-bento { grid-template-columns: 1fr; }
  .links > .panel:first-child { grid-column: auto; }
  .hero, .news-grid, .service-grid, .links, .footer-inner, .actions, .link-list, .office-grid,
  .bento-row.hero-left, .bento-row.hero-right, .bento-row.pair { grid-template-columns: 1fr; }
  .bento-row.hero-left, .bento-row.hero-right { grid-template-rows: none; }
  .hero-left .tile:nth-child(n), .hero-right .tile:nth-child(n) { grid-column: auto; grid-row: auto; }
  .header-inner { align-items: flex-start; flex-direction: column; }
  .search, .search input[type="search"] { width: 100%; }
  .nav-toggle-label {
    display: block;
    background: var(--brown);
    color: #fff;
    padding: 12px 16px;
    cursor: pointer;
  }
  .site-nav .nav-inner { display: none; padding-bottom: 10px; }
  .nav-toggle:checked ~ .nav-inner { display: block; }
  .menu { flex-direction: column; }
  .page-title, .promo-main h2 { font-size: 28px; }
  .entry { padding: 18px 14px; }
  .tile { padding: 14px 14px 12px 54px; }
  .tile.hero { font-size: 16px; }
  .svc-head h2 { font-size: 22px; }
  .brand { min-width: 0; }
  .brand-name { font-size: 16px; max-width: none; }
  .search input[type="search"] { min-width: 0; }
  .nav-toggle-label { margin: 0 16px 10px; border-radius: 8px; }
  .office-wide { grid-column: auto; }
}
