/**
 * custom24.ru - Modern Stylesheet Layer v2.0
 * Brand: СоюзЭксперт (Таможенное оформление и сертификация)
 */

:root {
  --c24-primary: #25a75b;
  --c24-primary-dark: #1ea154;
  --c24-primary-light: #e8f7ee;
  --c24-slate: #2b4154;
  --c24-dark: #1e2f3d;
  --c24-text: #334155;
  --c24-text-muted: #64748b;
  --c24-bg: #f8fafc;
  --c24-border: #e2e8f0;
  --c24-card-bg: #ffffff;
  --c24-radius: 8px;
  --c24-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
  --c24-shadow-hover: 0 8px 30px rgba(0, 0, 0, 0.12);
}

/* ==========================================================================
   Typography & Base Reset Overrides
   ========================================================================== */
body {
  font-family: 'Open Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.75;
  color: var(--c24-text);
  background-color: #ffffff;
  -webkit-font-smoothing: antialiased;
}

.content__title {
  font-size: 30px;
  line-height: 1.3;
  color: var(--c24-slate);
  margin-top: 0;
  margin-bottom: 24px;
  font-weight: 700;
  position: relative;
  padding-bottom: 12px;
}

.content__title::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: 0;
  width: 48px;
  height: 3px;
  background-color: var(--c24-primary);
  border-radius: 2px;
}

.content__text p {
  margin-bottom: 20px;
  line-height: 1.75;
  color: var(--c24-text);
}

.content__text h2 {
  font-size: 24px;
  line-height: 1.35;
  color: var(--c24-slate);
  margin-top: 36px;
  margin-bottom: 18px;
  font-weight: 700;
  position: relative;
  padding-left: 16px;
  border-left: 4px solid var(--c24-primary);
}

.content__text h3 {
  font-size: 20px;
  line-height: 1.4;
  color: var(--c24-slate);
  margin-top: 28px;
  margin-bottom: 14px;
  font-weight: 600;
}

.content__text h4 {
  font-size: 17px;
  line-height: 1.45;
  color: var(--c24-slate);
  margin-top: 22px;
  margin-bottom: 12px;
  font-weight: 600;
}

.content__text ul,
.content__text ol {
  margin-bottom: 24px;
  padding-left: 24px;
}

.content__text li {
  margin-bottom: 8px;
  line-height: 1.7;
}

.content__text blockquote {
  border-left: 4px solid var(--c24-primary);
  background-color: var(--c24-bg);
  padding: 16px 20px;
  margin: 24px 0;
  border-radius: 0 var(--c24-radius) var(--c24-radius) 0;
  font-style: italic;
  color: var(--c24-slate);
}

.content__text img {
  max-width: 100%;
  height: auto;
  border-radius: var(--c24-radius);
  margin: 20px 0;
}

/* ==========================================================================
   Buttons & Common UI
   ========================================================================== */
.custom24-btn-green,
.header-btn-consultation {
  display: inline-block;
  background-color: var(--c24-primary);
  color: #ffffff !important;
  font-weight: 600;
  padding: 10px 22px;
  border-radius: 6px;
  text-decoration: none !important;
  transition: background-color 0.2s ease, transform 0.15s ease, box-shadow 0.2s ease;
  border: none;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(37, 167, 91, 0.25);
}

.custom24-btn-green:hover,
.header-btn-consultation:hover {
  background-color: var(--c24-primary-dark);
  color: #ffffff !important;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(37, 167, 91, 0.35);
}

/* Header Action */
.page-header__cta {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  height: 100%;
}

/* ==========================================================================
   Breadcrumbs
   ========================================================================== */
.breadcrumbs {
  background-color: var(--c24-bg);
  padding: 12px 0;
  margin-bottom: 30px;
  font-size: 13px;
  color: var(--c24-text-muted);
  border-bottom: 1px solid var(--c24-border);
}

.breadcrumbs a {
  color: var(--c24-text-muted);
  text-decoration: none;
  transition: color 0.2s ease;
}

.breadcrumbs a:hover {
  color: var(--c24-primary);
}

.breadcrumbs .sep {
  margin: 0 8px;
  color: #cbd5e1;
}

/* ==========================================================================
   Article Archive & Cards Grid (page-stati.php, archive.php)
   ========================================================================== */
.page-stati__header,
.page-archive__header {
  margin-bottom: 36px;
}

.page-stati__subtitle,
.page-archive__subtitle {
  font-size: 17px;
  line-height: 1.6;
  color: var(--c24-text-muted);
  margin-top: 10px;
}

.custom24-article-grid {
  display: flex;
  flex-wrap: wrap;
  margin-left: -15px;
  margin-right: -15px;
}

.custom24-article-card {
  width: calc(50% - 30px);
  margin: 0 15px 30px 15px;
  background-color: var(--c24-card-bg);
  border: 1px solid var(--c24-border);
  border-radius: var(--c24-radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: var(--c24-shadow);
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.custom24-article-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--c24-shadow-hover);
  border-color: #cbd5e1;
}

.custom24-card-thumb {
  position: relative;
  height: 200px;
  background-color: #f1f5f9;
  overflow: hidden;
}

.custom24-card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.custom24-article-card:hover .custom24-card-thumb img {
  transform: scale(1.04);
}

.custom24-card-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
}

.custom24-card-placeholder .placeholder-text {
  margin-top: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--c24-slate);
  letter-spacing: 0.5px;
}

.custom24-card-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 2;
}

.custom24-card-badge a {
  display: inline-block;
  background-color: var(--c24-primary);
  color: #ffffff !important;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 4px 10px;
  border-radius: 4px;
  text-decoration: none !important;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.custom24-card-content {
  padding: 20px;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.custom24-card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  color: var(--c24-text-muted);
  margin-bottom: 12px;
}

.custom24-card-meta i {
  color: var(--c24-primary);
  margin-right: 4px;
}

.custom24-card-title {
  font-size: 18px;
  line-height: 1.4;
  margin-top: 0;
  margin-bottom: 12px;
  font-weight: 700;
}

.custom24-card-title a {
  color: var(--c24-slate);
  text-decoration: none;
  transition: color 0.2s ease;
}

.custom24-card-title a:hover {
  color: var(--c24-primary);
}

.custom24-card-excerpt {
  font-size: 14px;
  line-height: 1.6;
  color: var(--c24-text-muted);
  margin-bottom: 16px;
  flex-grow: 1;
}

.custom24-card-excerpt p {
  margin: 0;
}

.custom24-card-footer {
  border-top: 1px solid var(--c24-border);
  padding-top: 14px;
}

.custom24-card-link {
  font-size: 14px;
  font-weight: 600;
  color: var(--c24-primary);
  text-decoration: none !important;
  display: inline-flex;
  align-items: center;
  transition: color 0.2s ease;
}

.custom24-card-link .arrow {
  margin-left: 6px;
  transition: transform 0.2s ease;
}

.custom24-card-link:hover {
  color: var(--c24-primary-dark);
}

.custom24-card-link:hover .arrow {
  transform: translateX(4px);
}

/* ==========================================================================
   Pagination
   ========================================================================== */
.custom24-pagination {
  margin: 40px 0 20px;
  text-align: center;
}

.custom24-pagination .page-numbers {
  display: inline-flex;
  list-style: none;
  padding: 0;
  margin: 0;
  gap: 6px;
}

.custom24-pagination .page-numbers li {
  display: inline-block;
  margin: 0;
}

.custom24-pagination .page-numbers a,
.custom24-pagination .page-numbers span.current,
.custom24-pagination .page-numbers span.dots {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 40px;
  padding: 0 12px;
  font-size: 14px;
  font-weight: 600;
  border-radius: 6px;
  border: 1px solid var(--c24-border);
  color: var(--c24-slate);
  text-decoration: none;
  background-color: #ffffff;
  transition: all 0.2s ease;
}

.custom24-pagination .page-numbers a:hover {
  background-color: var(--c24-primary-light);
  border-color: var(--c24-primary);
  color: var(--c24-primary);
}

.custom24-pagination .page-numbers span.current {
  background-color: var(--c24-primary);
  border-color: var(--c24-primary);
  color: #ffffff;
}

/* ==========================================================================
   Single Article Styling (single.php)
   ========================================================================== */
.custom24-single-article {
  background: #ffffff;
}

.custom24-article-header {
  margin-bottom: 24px;
}

.custom24-article-meta-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
  padding-bottom: 16px;
  margin-bottom: 24px;
  border-bottom: 1px solid var(--c24-border);
  font-size: 13px;
  color: var(--c24-text-muted);
}

.custom24-meta-item i {
  color: var(--c24-primary);
  margin-right: 5px;
}

.custom24-meta-item a {
  color: var(--c24-slate);
  font-weight: 600;
  text-decoration: none;
}

.custom24-meta-item a:hover {
  color: var(--c24-primary);
}

/* Table of Contents (TOC) */
.custom24-toc {
  background-color: var(--c24-bg);
  border: 1px solid var(--c24-border);
  border-left: 4px solid var(--c24-primary);
  border-radius: var(--c24-radius);
  padding: 20px 24px;
  margin: 28px 0 36px;
}

.custom24-toc__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  user-select: none;
}

.custom24-toc__title {
  font-size: 17px;
  font-weight: 700;
  color: var(--c24-slate);
  margin: 0;
  display: flex;
  align-items: center;
}

.custom24-toc__title::before {
  content: '\f0ca';
  font-family: 'FontAwesome';
  margin-right: 10px;
  color: var(--c24-primary);
  font-size: 15px;
}

.custom24-toc__toggle {
  background: none;
  border: none;
  color: var(--c24-primary);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  padding: 4px 8px;
}

.custom24-toc__list {
  margin: 14px 0 0;
  padding-left: 20px;
  list-style: decimal;
}

.custom24-toc__item {
  margin-bottom: 8px;
  font-size: 14px;
  line-height: 1.5;
}

.custom24-toc__item a {
  color: var(--c24-slate);
  text-decoration: none;
  transition: color 0.2s ease;
}

.custom24-toc__item a:hover {
  color: var(--c24-primary);
}

/* Responsive Tables */
.custom24-table-wrap {
  width: 100%;
  overflow-x: auto;
  margin: 24px 0;
  border: 1px solid var(--c24-border);
  border-radius: var(--c24-radius);
}

.custom24-table-wrap table {
  width: 100%;
  min-width: 500px;
  margin-bottom: 0;
  border-collapse: collapse;
}

.custom24-table-wrap th {
  background-color: var(--c24-bg);
  color: var(--c24-slate);
  font-weight: 700;
  padding: 12px 16px;
  border-bottom: 2px solid var(--c24-border);
  text-align: left;
}

.custom24-table-wrap td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--c24-border);
  color: var(--c24-text);
}

.custom24-table-wrap tr:last-child td {
  border-bottom: none;
}

/* Expert Consultation Box */
.custom24-expert-box {
  background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
  border: 1px solid var(--c24-border);
  border-left: 4px solid var(--c24-primary);
  border-radius: var(--c24-radius);
  padding: 24px;
  margin: 40px 0;
  box-shadow: var(--c24-shadow);
}

.custom24-expert-box__header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
}

.custom24-expert-box__avatar {
  flex-shrink: 0;
  width: 68px;
  height: 68px;
}

.custom24-expert-box__avatar img {
  width: 68px;
  height: 68px;
  object-fit: cover;
  border-radius: 50%;
  border: 3px solid var(--c24-primary-light);
  margin: 0;
}

.custom24-expert-box__badge {
  display: inline-block;
  background-color: var(--c24-primary-light);
  color: var(--c24-primary-dark);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 3px 8px;
  border-radius: 4px;
  margin-bottom: 4px;
}

.custom24-expert-box__name {
  font-size: 18px;
  font-weight: 700;
  color: var(--c24-slate);
  margin: 0 0 4px;
}

.custom24-expert-box__role {
  font-size: 13px;
  color: var(--c24-text-muted);
  margin: 0;
  line-height: 1.4;
}

.custom24-expert-box__body p {
  font-size: 15px;
  line-height: 1.6;
  color: var(--c24-text);
  margin-bottom: 18px;
}

.custom24-expert-box__actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}

.custom24-expert-email {
  color: var(--c24-slate);
  font-weight: 600;
  font-size: 14px;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: color 0.2s ease;
}

.custom24-expert-email:hover {
  color: var(--c24-primary);
}

/* Post Navigation */
.custom24-post-nav {
  margin: 36px 0;
  padding: 24px 0;
  border-top: 1px solid var(--c24-border);
  border-bottom: 1px solid var(--c24-border);
}

.custom24-post-nav__link {
  display: block;
  text-decoration: none !important;
  padding: 12px 16px;
  background-color: var(--c24-bg);
  border: 1px solid var(--c24-border);
  border-radius: 6px;
  transition: all 0.2s ease;
}

.custom24-post-nav__link:hover {
  border-color: var(--c24-primary);
  background-color: #ffffff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.custom24-post-nav__sub {
  display: block;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--c24-primary);
  margin-bottom: 4px;
}

.custom24-post-nav__title {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: var(--c24-slate);
  line-height: 1.4;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Related Articles */
.custom24-related {
  margin-top: 40px;
}

.custom24-related__heading {
  font-size: 20px;
  font-weight: 700;
  color: var(--c24-slate);
  margin-top: 0;
  margin-bottom: 20px;
}

.custom24-related-card {
  background-color: var(--c24-bg);
  border: 1px solid var(--c24-border);
  border-radius: var(--c24-radius);
  padding: 18px 20px;
  margin-bottom: 15px;
  transition: all 0.2s ease;
}

.custom24-related-card:hover {
  background-color: #ffffff;
  border-color: var(--c24-primary);
  box-shadow: var(--c24-shadow);
}

.custom24-related-card__title {
  font-size: 16px;
  line-height: 1.4;
  margin: 0 0 8px;
  font-weight: 600;
}

.custom24-related-card__title a {
  color: var(--c24-slate);
  text-decoration: none;
}

.custom24-related-card__title a:hover {
  color: var(--c24-primary);
}

.custom24-related-card__date {
  font-size: 12px;
  color: var(--c24-text-muted);
  margin: 0;
}

/* ==========================================================================
   Modern Footer (.page-footer)
   ========================================================================== */
.page-footer {
  background-color: var(--c24-dark);
  color: #94a3b8;
  padding: 50px 0 24px;
  margin-top: 60px;
  font-size: 14px;
  line-height: 1.6;
}

.page-footer a {
  color: #cbd5e1;
  text-decoration: none;
  transition: color 0.2s ease;
}

.page-footer a:hover {
  color: var(--c24-primary);
}

.page-footer__col {
  margin-bottom: 30px;
}

.page-footer__logo .logo {
  display: block;
  margin-bottom: 14px;
}

.page-footer__logo .logo__title {
  font-size: 24px;
  font-weight: 700;
  color: #ffffff;
  display: block;
}

.page-footer__logo .logo__slogan {
  font-size: 12px;
  color: #94a3b8;
  display: block;
  margin-top: 2px;
}

.page-footer__desc {
  font-size: 13px;
  line-height: 1.6;
  color: #94a3b8;
  margin-bottom: 14px;
}

.page-footer__copy {
  font-size: 12px;
  color: #64748b;
  margin: 0;
}

.page-footer__title {
  font-size: 16px;
  font-weight: 700;
  color: #ffffff;
  margin-top: 0;
  margin-bottom: 18px;
  position: relative;
  padding-bottom: 8px;
  display: inline-block;
}

.page-footer__title::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: 0;
  width: 28px;
  height: 2px;
  background-color: var(--c24-primary);
}

.page-footer__list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.page-footer__list li {
  margin-bottom: 10px;
}

.page-footer__list a {
  display: inline-block;
  transition: transform 0.15s ease, color 0.2s ease;
}

.page-footer__list a:hover {
  transform: translateX(3px);
}

.page-footer__contacts .page-footer__contact-item {
  margin-bottom: 10px;
}

.page-footer__contacts .contact-label {
  display: block;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #64748b;
}

.page-footer__email-link {
  font-size: 16px;
  font-weight: 700;
  color: var(--c24-primary) !important;
}

.page-footer__contact-hint {
  font-size: 12px;
  color: #94a3b8;
  margin-bottom: 18px;
}

.page-footer__bottom {
  margin-top: 30px;
  padding-top: 24px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.page-footer__subcopy {
  font-size: 12px;
  color: #64748b;
  margin: 0;
}

/* ==========================================================================
   Responsive & Mobile Layout Order
   ========================================================================== */
@media (max-width: 991px) {
  /* Enforce mobile layout order: Main Content above Sidebar! */
  .page > .container > .row {
    display: flex;
    flex-direction: column;
  }

  .col-md-9.col-md-push-3 {
    order: 1;
    left: auto !important;
    right: auto !important;
    width: 100% !important;
  }

  .col-md-3.col-md-pull-9 {
    order: 2;
    left: auto !important;
    right: auto !important;
    width: 100% !important;
    margin-top: 40px;
  }

  .custom24-article-card {
    width: calc(50% - 20px);
    margin: 0 10px 20px;
  }

  .page-header__cta {
    display: none;
  }

  .custom24-post-nav__next {
    margin-top: 12px;
  }

  .custom24-post-nav__link.text-right {
    text-align: left;
  }
}

@media (max-width: 640px) {
  .custom24-article-card {
    width: 100%;
    margin: 0 0 20px;
  }

  .content__title {
    font-size: 24px;
  }

  .custom24-article-meta-bar {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .custom24-expert-box__header {
    flex-direction: column;
    align-items: flex-start;
  }
}
