/* Стабильная таблица стилей для PHP-страниц (раздел "Статьи"). Имя файла и путь не меняются
   при пересборках Next.js-части сайта, чтобы автопубликация статей не зависела от билдов. */

@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;500;600;700;800&display=swap');

:root {
  --background: #ffffff;
  --background-soft: #f2f6fa;
  --background-faint: #fafdff;
  --foreground: #000f1b;
  --heading: #173248;
  --primary: #0e89bf;
  --primary-dark: #0a6a94;
  --border: #d1d1d1;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--background);
  color: var(--foreground);
  font-family: 'Montserrat', Arial, Helvetica, sans-serif;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 { color: var(--heading); margin: 0 0 0.5em; letter-spacing: -.015em; }

a { color: inherit; text-decoration: none; }
a:hover { color: var(--primary); }

.container-page {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 1rem;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: linear-gradient(180deg, rgba(16,35,52,0.98) 0%, rgba(23,50,72,0.95) 100%);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(255,255,255,.12);
  box-shadow: 0 8px 24px rgba(0,0,0,.12);
}
.site-header__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-top: 1.5rem;
  padding-bottom: 1.5rem;
}
.site-header__logo { display: flex; align-items: center; gap: 1rem; flex-shrink: 0; min-width: 0; }
.site-header__logo img { width: 144px; height: 144px; border-radius: 1rem; box-shadow: 0 4px 14px rgba(0,0,0,.18); object-fit: cover; }
.site-header__logo-text { display: none; font-size: 1.125rem; font-weight: 600; color: #fff; text-align: center; line-height: 1.2; }
@media (min-width: 640px) { .site-header__logo-text { display: block; } }
.site-nav { display: none; align-items: center; gap: 1.25rem; font-size: 0.875rem; font-weight: 500; white-space: nowrap; }
.site-nav a { color: rgba(255,255,255,.9); }
.site-header__contacts { display: none; align-items: center; gap: 1rem; }
.site-header__contacts a.email,
.site-header__contacts a.phone { font-size: 0.875rem; font-weight: 500; color: rgba(255,255,255,.9); white-space: nowrap; overflow-wrap: normal; display: inline-block; flex-shrink: 0; }
.site-header__contacts a.email { margin-right: 0.25rem; }
.btn-whatsapp {
  border-radius: 999px; background: #6b7280; color: #fff !important; padding: 0.5rem 1rem;
  font-size: 0.875rem; font-weight: 600; white-space: nowrap;
  box-shadow: 0 6px 16px rgba(0,0,0,.18); transition: background-color .2s ease, transform .2s ease, box-shadow .2s ease;
}
.btn-whatsapp:hover { background: #4b5563; color: #fff !important; transform: translateY(-1px); box-shadow: 0 10px 22px rgba(0,0,0,.24); }
.site-header__mobile { display: flex; align-items: center; gap: 0.5rem; margin-left: auto; }
.site-header__mobile-contacts { display: flex; flex-direction: column; align-items: flex-end; gap: 0.1rem; }
.site-header__mobile a.email,
.site-header__mobile a.phone { font-size: 0.72rem; font-weight: 500; color: rgba(255,255,255,.9); line-height: 1.1; white-space: nowrap; overflow-wrap: normal; display: inline-block; flex-shrink: 0; }
.site-header__mobile a.phone { color: #fff !important; }
.site-header__mobile a.email,
.site-header__mobile a.phone { font-weight: 600; }
.menu-toggle {
  display: flex; flex-direction: column; align-items: center; justify-content: center; width: 2.5rem; height: 2.5rem;
  border: 1px solid rgba(255,255,255,.3); border-radius: 0.5rem; background: rgba(255,255,255,.1); cursor: pointer;
  flex-shrink: 0; padding: 0; transition: background-color .2s ease, border-color .2s ease;
}
.menu-toggle:hover { background: rgba(255,255,255,.18); border-color: rgba(255,255,255,.45); }
.menu-toggle span { display: block; width: 20px; height: 2px; background: #fff; margin: 2px 0; }
.mobile-nav {
  display: none; position: fixed; inset-inline: 0; top: 196px; z-index: 40; margin: 0 1rem;
  flex-direction: column; gap: 0.25rem; border: 1px solid var(--border); border-radius: 0.75rem;
  background: #fff; padding: 0.75rem; box-shadow: 0 10px 25px rgba(0,0,0,.12);
  animation: fadeInMenu .18s ease;
}
@keyframes fadeInMenu { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: translateY(0); } }
.mobile-nav.open { display: flex; }
.mobile-nav a { padding: 0.5rem 0.75rem; border-radius: 0.5rem; font-size: 0.875rem; font-weight: 500; color: var(--foreground); }
.mobile-nav a:hover { background: var(--background-soft); color: var(--primary); }

@media (min-width: 1024px) {
  .site-nav, .site-header__contacts { display: flex; }
  .site-header__mobile { display: none; }
}
@media (max-width: 1023px) {
  .site-header__row { padding-top: 1rem; padding-bottom: 1rem; gap: 0.75rem; }
  .site-header__logo { min-width: 0; }
}
@media (min-width: 1536px) {
  .site-header__contacts a.email { display: inline; }
}
@media (max-width: 1535px) {
  .site-header__contacts a.email { display: none; }
}

/* Footer */
.site-footer { margin-top: 5rem; background: var(--heading); color: rgba(255,255,255,.85); box-shadow: 0 -12px 32px rgba(0,0,0,.1); }
.site-footer__grid { display: grid; gap: 2.5rem; padding: 4rem 0; grid-template-columns: 1fr; }
.site-footer h3 { color: rgba(255,255,255,.9); font-size: 0.875rem; text-transform: uppercase; letter-spacing: .03em; margin-bottom: .75rem; }
.site-footer a { color: rgba(255,255,255,.7); transition: color .15s ease; }
.site-footer a:hover { color: var(--primary); }
.site-footer ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: .5rem; font-size: .875rem; }
.site-footer__bottom { border-top: 1px solid rgba(255,255,255,.1); font-size: .75rem; color: rgba(255,255,255,.5); padding: 1.5rem 0; }
.site-footer__bottom-row { display: flex; flex-direction: column; gap: .5rem; justify-content: space-between; }
.site-footer img { border-radius: .75rem; margin-bottom: 1rem; width: 88px; height: 88px; box-shadow: 0 6px 18px rgba(0,0,0,.25); }
@media (min-width: 768px) {
  .site-footer__grid { grid-template-columns: repeat(4, 1fr); }
  .site-footer__bottom-row { flex-direction: row; align-items: center; }
}

/* Article pages */
.page-hero { border-bottom: 1px solid rgba(23,50,72,.08); background: linear-gradient(135deg, #f8fbff 0%, #f1f6fb 55%, #eef5f9 100%); padding: 4.5rem 0 4rem; position: relative; overflow: hidden; }
.page-hero::after { content: ''; position: absolute; inset: auto -8% -35% auto; width: 340px; height: 340px; background: radial-gradient(circle, rgba(14,137,191,.14) 0%, rgba(14,137,191,0) 72%); pointer-events: none; }
.page-hero__inner { display: flex; align-items: center; justify-content: flex-start; }
.page-hero__content { max-width: 760px; width: 100%; display: flex; flex-direction: column; align-items: flex-start; }
.page-hero__eyebrow { display: inline-block; margin-bottom: 1rem; padding: .45rem .85rem; border-radius: 999px; background: rgba(14,137,191,.12); color: var(--primary); font-size: .76rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; box-shadow: 0 2px 8px rgba(14,137,191,.12); }
.page-hero h1 { font-size: 1.875rem; font-weight: 800; margin: 0; line-height: 1.08; letter-spacing: -.02em; }
.page-hero p { color: rgba(0,15,27,.78); margin: 1rem 0 0; max-width: 660px; font-size: 1rem; line-height: 1.75; }
.page-hero__actions { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 1.4rem; }
.page-hero .btn { display: inline-block; border-radius: 999px; background: linear-gradient(135deg, var(--primary) 0%, #1b9fd1 100%); color: #fff; padding: .9rem 1.45rem; font-size: .92rem; font-weight: 600; box-shadow: 0 14px 28px rgba(14,137,191,.22); transition: transform .2s ease, box-shadow .2s ease, background .2s ease; }
.page-hero .btn:hover { background: linear-gradient(135deg, var(--primary-dark) 0%, #0d7ba6 100%); color: #fff; transform: translateY(-2px); box-shadow: 0 18px 34px rgba(14,137,191,.3); }
@media (min-width: 640px) { .page-hero h1 { font-size: 2.3rem; } }

.articles-grid { display: grid; gap: 1.75rem; padding: 4rem 0 4.5rem; grid-template-columns: 1fr; align-items: stretch; }
@media (min-width: 768px) { .articles-grid { grid-template-columns: 1fr 1fr; } }
.article-card {
  position: relative;
  display: flex; flex-direction: column; align-items: flex-start; justify-content: flex-start; gap: .75rem;
  min-height: 220px; border: 1px solid rgba(23,50,72,.08); border-radius: 1.25rem; padding: 1.9rem;
  background: linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
  box-shadow: 0 1px 2px rgba(23,50,72,.04), 0 22px 48px -12px rgba(23,50,72,.16);
  transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
  overflow: hidden;
}
.article-card::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px; background: linear-gradient(90deg, var(--primary) 0%, #1b9fd1 100%); opacity: 0; transition: opacity .25s ease; }
.article-card:focus-within { border-color: rgba(14,137,191,.35); box-shadow: 0 1px 2px rgba(23,50,72,.05), 0 26px 52px -10px rgba(23,50,72,.2); }
.article-card:hover { transform: translateY(-6px); border-color: rgba(14,137,191,.4); box-shadow: 0 1px 2px rgba(23,50,72,.05), 0 30px 56px -10px rgba(23,50,72,.22); }
.article-card:hover::before { opacity: 1; }
.article-card time { display: block; font-size: .75rem; color: rgba(0,15,27,.56); letter-spacing: .02em; font-weight: 600; text-transform: uppercase; }
.article-card h2 { font-size: 1.125rem; margin: 0; line-height: 1.35; color: var(--heading); }
.article-card p { flex: 1 1 auto; font-size: .92rem; color: rgba(0,15,27,.72); margin: 0; line-height: 1.72; }
.article-card .read-more { display: inline-flex; align-items: center; gap: .3rem; margin-top: auto; font-size: .875rem; font-weight: 700; color: var(--primary); transition: gap .2s ease, color .2s ease; }
.article-card .read-more:hover { color: var(--primary-dark); gap: .5rem; }

.article-body { max-width: 720px; margin: 0 auto; padding: 4.5rem 1rem; }
.article-body .breadcrumb { font-size: .875rem; color: rgba(0,15,27,.6); margin-bottom: 1rem; }
.article-body h1 { font-size: 1.875rem; font-weight: 800; }
.article-body .meta { font-size: .875rem; color: rgba(0,15,27,.5); margin: .75rem 0 2rem; }
.article-body h2 { font-size: 1.25rem; font-weight: 700; margin-top: 2rem; }
.article-body p { color: rgba(0,15,27,.85); margin: 0 0 .75rem; line-height: 1.6; }
.cta-box { margin-top: 2.5rem; border-radius: 1.1rem; background: linear-gradient(180deg, var(--background-soft) 0%, #eaf2f8 100%); padding: 1.75rem; border: 1px solid rgba(23,50,72,.06); box-shadow: 0 16px 34px -10px rgba(23,50,72,.12); }
.cta-box p:first-child { font-weight: 700; color: var(--heading); }
.cta-box .btn { display: inline-block; margin-top: 1rem; border-radius: 999px; background: linear-gradient(135deg, var(--primary) 0%, #1b9fd1 100%); color: #fff; padding: .75rem 1.6rem; font-size: .875rem; font-weight: 600; box-shadow: 0 10px 22px rgba(14,137,191,.25); transition: transform .2s ease, box-shadow .2s ease; }
.cta-box .btn:hover { color: #fff; transform: translateY(-2px); box-shadow: 0 14px 28px rgba(14,137,191,.32); }
