:root {
  --color-primary: #0ea5e9;
  --color-secondary: #f43f5e;
  --color-accent: #f0f9ff;
  --color-ink: #0f172a;
  --color-muted: #475569;
  --color-line: #dbeafe;
  --header-height: 80px;
  --anchor-offset: var(--header-height);
  --bottom-bar-height: 72px;
}

html {
  scroll-behavior: smooth;
}

body {
  color: var(--color-ink);
  padding-bottom: calc(var(--bottom-bar-height) + env(safe-area-inset-bottom));
  text-rendering: optimizeLegibility;
}

main[id],
section[id] {
  scroll-margin-top: var(--anchor-offset);
}

::selection {
  background: rgba(14, 165, 233, 0.24);
}

.font-display {
  font-family: "Merriweather", Georgia, serif;
}

.section-kicker {
  color: var(--color-secondary);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.focus-ring:focus-visible {
  outline: 3px solid rgba(14, 165, 233, 0.42);
  outline-offset: 3px;
}

.wp-block-ryadom-hero-section,
.wp-block-ryadom-key-stats,
.wp-block-ryadom-about-section,
.wp-block-ryadom-services-section,
.wp-block-ryadom-stay-connected,
.wp-block-ryadom-site-footer,
.wp-block-ryadom-stat-item,
.wp-block-ryadom-service-card {
  max-width: none;
  margin-block-start: 0;
  margin-block-end: 0;
}

.wp-block-ryadom-hero-section,
.wp-block-ryadom-key-stats,
.wp-block-ryadom-about-section,
.wp-block-ryadom-services-section,
.wp-block-ryadom-stay-connected,
.wp-block-ryadom-site-footer {
  width: 100%;
}

.wp-block-ryadom-site-footer ul {
  padding-left: 0;
  list-style: none;
}

.site-footer-donate-button {
  display: inline-flex;
  width: 100%;
  justify-content: center;
  border-radius: 8px;
  background: var(--color-secondary);
  padding: 8px 16px;
  color: #fff;
  font-size: 0.875rem;
  font-weight: 700;
  line-height: 1.25rem;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.site-footer-donate-button:hover {
  background: #e11d48;
  color: #fff;
  text-decoration: none;
}

.site-footer-bottom-text a,
.stay-connected-title a,
.stay-connected-description a,
.stay-connected-note a {
  cursor: pointer;
  text-decoration-line: underline;
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.18em;
  transition: color 0.2s ease, text-decoration-color 0.2s ease;
}

.site-footer-bottom-text a {
  color: #cbd5e1;
}

.stay-connected-title a,
.stay-connected-description a,
.stay-connected-note a {
  color: inherit;
  text-decoration-color: currentColor;
}

.site-footer-bottom-text a:hover,
.site-footer-bottom-text a:focus-visible,
.stay-connected-title a:hover,
.stay-connected-description a:hover,
.stay-connected-note a:hover,
.stay-connected-title a:focus-visible,
.stay-connected-description a:focus-visible,
.stay-connected-note a:focus-visible {
  color: #fff;
  text-decoration-color: currentColor;
}

.ryadom-editor-list-item {
  margin-bottom: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid #e2e8f0;
}

.card-hover {
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

.card-hover:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 25px -5px rgba(15, 23, 42, 0.1), 0 8px 10px -6px rgba(15, 23, 42, 0.1);
}

.hero-safety {
  position: relative;
  isolation: isolate;
  background: #f0f9ff;
}

.hero-safety::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: linear-gradient(to bottom right, rgba(255, 255, 255, 0.9), rgba(240, 249, 255, 0.8));
}

.hero-safety-image {
  position: absolute;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.hero-safety > :not(.hero-safety-image) {
  position: relative;
  z-index: 2;
}

.project-goal-card {
  left: 1rem;
  right: 1rem;
}

.project-goal-card p {
  font-size: 12px;
  line-height: 1.45;
}

.hero-title-accent {
  display: inline-block;
  color: var(--color-primary);
  background-image: linear-gradient(90deg, var(--color-primary), #0284c7);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

@media (min-width: 768px) {
  .project-goal-card {
    left: auto;
    right: -1.5rem;
    max-width: 20rem;
    padding: 1.5rem;
  }

  .project-goal-card p {
    font-size: 1rem;
    line-height: 1.5;
  }
}

.page-hero {
  background:
    linear-gradient(120deg, rgba(240, 249, 255, 0.98), rgba(255, 241, 242, 0.82)),
    radial-gradient(circle at top right, rgba(14, 165, 233, 0.16), transparent 34%);
}

.soft-grid {
  background-image:
    linear-gradient(rgba(14, 165, 233, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(14, 165, 233, 0.08) 1px, transparent 1px);
  background-size: 28px 28px;
}

.glass-nav {
  background: rgba(255, 255, 255, 0.91);
  backdrop-filter: blur(18px);
}

.brand-mark {
  width: 42px;
  height: 42px;
  object-fit: contain;
}

.newsletter-band {
  position: relative;
  overflow: hidden;
  background-image:
    linear-gradient(135deg, rgba(14, 165, 233, 0.98), rgba(37, 99, 235, 0.98)),
    linear-gradient(90deg, rgba(255, 255, 255, 0.08) 1px, transparent 1px),
    linear-gradient(rgba(255, 255, 255, 0.08) 1px, transparent 1px);
  background-size: auto, 32px 32px, 32px 32px;
}

.map-placeholder {
  min-height: 320px;
  background:
    linear-gradient(135deg, rgba(226, 232, 240, 0.92), rgba(241, 245, 249, 0.96)),
    linear-gradient(90deg, rgba(148, 163, 184, 0.24) 1px, transparent 1px),
    linear-gradient(rgba(148, 163, 184, 0.24) 1px, transparent 1px);
  background-size: auto, 32px 32px, 32px 32px;
}

.key-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  text-align: center;
}

.key-stat-item {
  padding: 1rem;
  border-top: 1px solid #f1f5f9;
}

.key-stat-item:first-child {
  border-top: 0;
}

.service-cards-grid,
.service-cards-grid > .block-editor-inner-blocks > .block-editor-block-list__layout {
  display: grid;
  gap: 1.5rem;
}

.service-cards-grid > .block-editor-inner-blocks {
  grid-column: 1 / -1;
}

.service-cards-grid > .block-editor-inner-blocks > .block-editor-block-list__layout > .wp-block-ryadom-service-card {
  margin-block-start: 0;
  margin-block-end: 0;
}

@media (min-width: 768px) {
  .service-cards-grid,
  .service-cards-grid > .block-editor-inner-blocks > .block-editor-block-list__layout {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 1024px) {
  .service-cards-grid,
  .service-cards-grid > .block-editor-inner-blocks > .block-editor-block-list__layout {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

.footer-logo-grid {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem;
}

.footer-logo-card {
  display: inline-flex;
  align-items: center;
}

.footer-logo-card img {
  width: auto;
  max-width: 340px;
  max-height: 110px;
  object-fit: contain;
}

.footer-logo-card--compact img {
  max-width: 170px;
  max-height: 55px;
}

.social-link {
  width: 10.75rem;
  justify-content: center;
}

.article-content p {
  margin-bottom: 1.15rem;
  color: #334155;
  line-height: 1.8;
}

.article-content a:not([class]) {
  color: var(--color-primary);
  font-weight: 700;
  text-decoration-line: underline;
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.18em;
  transition: color 0.2s ease, text-decoration-color 0.2s ease;
}

.article-content a:not([class]):hover,
.article-content a:not([class]):focus-visible {
  color: #0369a1;
  text-decoration-color: currentColor;
}

.article-content h2,
.article-content h3 {
  color: #0f172a;
  font-family: "Merriweather", Georgia, serif;
  font-weight: 700;
  margin: 2rem 0 1rem;
}

.article-content h2 {
  font-size: clamp(1.55rem, 3vw, 2rem);
}

.article-content h3 {
  font-size: clamp(1.25rem, 2.2vw, 1.55rem);
}

.article-content ul {
  margin: 0 0 1.25rem 1.2rem;
  color: #334155;
  line-height: 1.8;
  list-style: disc;
}

.quick-actions {
  position: fixed;
  z-index: 60;
  left: 0;
  right: 0;
  bottom: 0;
  min-height: var(--bottom-bar-height);
  padding-bottom: env(safe-area-inset-bottom);
  border-top: 1px solid rgba(148, 163, 184, 0.28);
  background: rgba(255, 255, 255, 0.97);
  box-shadow: 0 -16px 38px rgba(15, 23, 42, 0.12);
}

.cookie-notice {
  position: fixed;
  z-index: 70;
  left: 1rem;
  right: auto;
  bottom: calc(var(--bottom-bar-height) + env(safe-area-inset-bottom) + 1rem);
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  box-sizing: border-box;
  width: max-content;
  max-width: min(530px, calc(100vw - 2rem));
  padding: 1rem 1rem 1rem 1.1rem;
  border: 1px solid rgba(219, 234, 254, 0.9);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 18px 42px rgba(15, 23, 42, 0.16);
  color: #334155;
  font-size: 0.92rem;
  font-weight: 500;
  line-height: 1.55;
  transition:
    width 280ms cubic-bezier(0.22, 1, 0.36, 1),
    max-height 280ms cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 180ms ease;
}

.cookie-notice[hidden] {
  display: none;
}

.cookie-notice__content {
  flex: 0 1 auto;
  min-width: 0;
}

.cookie-notice__content a,
.cookie-notice__details {
  color: var(--color-primary);
  font-weight: 800;
  text-decoration-line: underline;
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.18em;
  transition: color 0.2s ease, text-decoration-color 0.2s ease;
}

.cookie-notice__content a:hover,
.cookie-notice__content a:focus-visible,
.cookie-notice__details:hover,
.cookie-notice__details:focus-visible {
  color: #0369a1;
  text-decoration-color: currentColor;
}

.cookie-notice__details {
  display: block;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  font: inherit;
}

.cookie-notice__close {
  display: inline-grid;
  flex: 0 0 auto;
  width: 2rem;
  height: 2rem;
  place-items: center;
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: 8px;
  background: #f8fafc;
  color: #0f172a;
  cursor: pointer;
  transition: background-color 160ms ease, border-color 160ms ease, color 160ms ease;
}

.cookie-notice__close:hover {
  border-color: rgba(14, 165, 233, 0.4);
  background: #eff6ff;
  color: var(--color-primary);
}

.cookie-notice__close i,
.cookie-notice__close svg {
  width: 1rem;
  height: 1rem;
}

.cookie-notice__close i::before {
  content: "×";
  display: block;
  font-size: 1.25rem;
  font-weight: 800;
  line-height: 1;
}

.quick-actions__grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.quick-action {
  min-height: var(--bottom-bar-height);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.22rem;
  padding: 0.45rem 0.35rem;
  color: #0f172a;
  font-size: 0.72rem;
  font-weight: 800;
  text-align: center;
  transition: background-color 160ms ease, color 160ms ease;
}

.quick-action:hover {
  background: #f8fafc;
  color: var(--color-primary);
}

.quick-action svg,
.quick-action i {
  width: 20px;
  height: 20px;
}

.quick-action--danger {
  color: #ffffff;
  background: #be123c;
}

.quick-action--danger:hover,
.quick-action--danger:focus-visible {
  color: #ffffff;
  background: #9f1239;
}

iframe[src*="cloudpbx.beeline.ru"],
iframe[src*="callmenow"],
iframe[src*="mpbx"],
[id*="callmenow"],
[class*="callmenow"],
[id*="mpbx"],
[class*="mpbx"] {
  bottom: calc(var(--bottom-bar-height) + env(safe-area-inset-bottom) + 10px) !important;
}

.metric-card {
  border-left: 4px solid var(--color-primary);
}

.skip-link {
  position: fixed;
  z-index: 100;
  left: 1rem;
  top: 1rem;
  transform: translateY(-160%);
  transition: transform 160ms ease;
}

.skip-link:focus {
  transform: translateY(0);
}

[x-cloak] {
  display: none !important;
}

html.reveal-prep [data-reveal]:not(.is-revealed) {
  opacity: 0;
  transform: translate3d(0, 14px, 0);
}

html.reveal-prep [data-reveal] {
  transition:
    opacity 520ms cubic-bezier(0.22, 1, 0.36, 1),
    transform 520ms cubic-bezier(0.22, 1, 0.36, 1);
  transition-delay: var(--reveal-delay, 0ms);
  will-change: opacity, transform;
}

html.reveal-prep [data-reveal].is-revealed {
  opacity: 1;
  transform: translate3d(0, 0, 0);
  will-change: auto;
}

@media (min-width: 1024px) {
  :root {
    --bottom-bar-height: 76px;
  }

  body {
    padding-bottom: 0;
  }

  .quick-actions {
    left: auto;
    right: 1.5rem;
    bottom: 4rem;
    width: min(420px, calc(100vw - 3rem));
    border: 1px solid rgba(148, 163, 184, 0.3);
    border-radius: 8px;
    overflow: hidden;
    padding-bottom: 0;
  }

  .cookie-notice {
    left: 1.5rem;
    bottom: 1.5rem;
  }

  .hotline-link {
    cursor: default;
  }

  iframe[src*="cloudpbx.beeline.ru"],
  iframe[src*="callmenow"],
  iframe[src*="mpbx"],
  [id*="callmenow"],
  [class*="callmenow"],
  [id*="mpbx"],
  [class*="mpbx"] {
    right: calc(420px + 2.5rem) !important;
    max-width: calc(100vw - 420px - 4rem) !important;
  }
}

@media (min-width: 1024px) and (hover: hover) and (pointer: fine) {
  .quick-actions__grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .quick-action--phone {
    display: none;
  }
}

@media (max-width: 520px) {
  .quick-action {
    font-size: 0.66rem;
  }

  .brand-mark {
    width: 40px;
    height: 40px;
  }

  .footer-logo-card img {
    max-width: 300px;
    max-height: 90px;
  }

  .footer-logo-card--compact img {
    max-width: 150px;
    max-height: 45px;
  }

  .social-link {
    width: 100%;
  }
}

@media (min-width: 768px) {
  .key-stat-item {
    border-top: 0;
    border-left: 1px solid #f1f5f9;
  }

  .key-stat-item:first-child {
    border-left: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  html.reveal-prep [data-reveal] {
    opacity: 1;
    transform: none;
    will-change: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
