/* Joomla Center layout-blog pages, RU / EN. Add after the current template styles.
   Scope: body.layout-blog, component area only. */
.layout-blog #sp-component > .sp-column > :is([class*="blog"], [itemtype$="/Blog"], :has(> .page-header)) {
  --blog-font: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --blog-link: #236093;
  --blog-text: #173c55;
  --blog-muted: #61758c;
  --blog-line: #d8e1eb;
  --blog-hero-image: url("/images/joomla-news-hero.webp");
  container: jc-blog / inline-size;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  min-inline-size: 0;
  isolation: isolate;
}

/* Compact hero with a lighter blue palette. */
.layout-blog #sp-component > .sp-column > :is([class*="blog"], [itemtype$="/Blog"], :has(> .page-header))::before,
.layout-blog #sp-component > .sp-column > :is([class*="blog"], [itemtype$="/Blog"], :has(> .page-header))::after {
  content: "";
  grid-area: 1 / 1 / 2 / 2;
  min-block-size: 240px;
  border-radius: 12px;
  pointer-events: none;
}
.layout-blog #sp-component > .sp-column > :is([class*="blog"], [itemtype$="/Blog"], :has(> .page-header)):has(> .category-desc)::before,
.layout-blog #sp-component > .sp-column > :is([class*="blog"], [itemtype$="/Blog"], :has(> .page-header)):has(> .category-desc)::after { grid-row-end: 3; }
.layout-blog #sp-component > .sp-column > :is([class*="blog"], [itemtype$="/Blog"], :has(> .page-header))::before {
  border: 1px solid #4f87be;
  background: radial-gradient(ellipse at 93% 65%, #76b6ed33, transparent 52%),
    linear-gradient(110deg, #143b74, #1b5798 64%, #2a6eac);
}
.layout-blog #sp-component > .sp-column > :is([class*="blog"], [itemtype$="/Blog"], :has(> .page-header))::after {
  justify-self: end;
  inline-size: 43%;
  max-inline-size: 360px;
  background: var(--blog-hero-image) right 12px center / auto 224px no-repeat;
}
.layout-blog #sp-component > .sp-column > :is([class*="blog"], [itemtype$="/Blog"], :has(> .page-header)) > .page-header { display: contents; margin: 0; padding: 0; border: 0; }
.layout-blog #sp-component > .sp-column > :is([class*="blog"], [itemtype$="/Blog"], :has(> .page-header)) > .page-header h1 {
  grid-area: 1 / 1;
  z-index: 1;
  align-self: center;
  min-inline-size: 0;
  min-block-size: 0;
  margin: 0;
  padding: 28px 40% 28px 32px;
  border: 0;
  background: none;
  box-shadow: none;
  color: #fff;
  font: 750 clamp(28px, 4.3cqi, 38px)/1.15 var(--blog-font);
  letter-spacing: -.03em;
  text-align: start;
  text-transform: none;
  text-shadow: none;
  text-wrap: balance;
  overflow-wrap: break-word;
}
.layout-blog #sp-component > .sp-column > :is([class*="blog"], [itemtype$="/Blog"], :has(> .page-header)) > .page-header h1::before,
.layout-blog #sp-component > .sp-column > :is([class*="blog"], [itemtype$="/Blog"], :has(> .page-header)) > .page-header h1::after { content: none; }
.layout-blog #sp-component > .sp-column > :is([class*="blog"], [itemtype$="/Blog"], :has(> .page-header)):has(> .category-desc) > .page-header h1 { align-self: end; padding-bottom: 12px; }
.layout-blog #sp-component > .sp-column > :is([class*="blog"], [itemtype$="/Blog"], :has(> .page-header)) > .category-desc {
  grid-area: 2 / 1;
  z-index: 1;
  align-self: start;
  min-inline-size: 0;
  block-size: auto;
  margin: 0;
  padding: 0 40% 28px 32px;
  border: 0;
  border-radius: 0;
  background: none;
  box-shadow: none;
  color: #e3efff;
  font: 400 16px/1.6 var(--blog-font);
  text-wrap: pretty;
}
.layout-blog #sp-component > .sp-column > :is([class*="blog"], [itemtype$="/Blog"], :has(> .page-header)) > .category-desc p { margin: 0; font: inherit; }
.layout-blog #sp-component > .sp-column > :is([class*="blog"], [itemtype$="/Blog"], :has(> .page-header)) > .category-desc a { color: inherit; text-underline-offset: .18em; }

/* One leading item spans the component; subsequent native rows keep two columns. */
.layout-blog #sp-component > .sp-column > :is([class*="blog"], [itemtype$="/Blog"], :has(> .page-header)) > .items-leading {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 20px;
  margin: 24px 0 20px;
}
.layout-blog #sp-component > .sp-column > :is([class*="blog"], [itemtype$="/Blog"], :has(> .page-header)) > .items-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
  margin: 0 0 20px;
}
.layout-blog #sp-component > .sp-column > :is([class*="blog"], [itemtype$="/Blog"], :has(> .page-header)) > .items-row > [class*="col-"],
.layout-blog #sp-component > .sp-column > :is([class*="blog"], [itemtype$="/Blog"], :has(> .page-header)) article.item > .system-unpublished { display: contents; }
.layout-blog #sp-component > .sp-column > :is([class*="blog"], [itemtype$="/Blog"], :has(> .page-header)) > :is(.items-leading, .items-row)::before,
.layout-blog #sp-component > .sp-column > :is([class*="blog"], [itemtype$="/Blog"], :has(> .page-header)) > :is(.items-leading, .items-row)::after { content: none; }
.layout-blog #sp-component > .sp-column > :is([class*="blog"], [itemtype$="/Blog"], :has(> .page-header)) article.item {
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  min-inline-size: 0;
  block-size: auto;
  margin: 0;
  padding: 20px;
  border: 1px solid var(--blog-line);
  border-radius: 10px;
  background: #fff;
  box-shadow: none;
}
.layout-blog #sp-component > .sp-column > :is([class*="blog"], [itemtype$="/Blog"], :has(> .page-header)) > .items-leading > article:first-of-type {
  background: linear-gradient(110deg, #fff, #f5f9fe);
}
.layout-blog #sp-component > .sp-column > :is([class*="blog"], [itemtype$="/Blog"], :has(> .page-header)) .intro-image {
  align-self: stretch;
  min-inline-size: 0;
  margin: 0 0 18px;
  padding: 0;
  overflow: hidden;
  border: 1px solid #dce6ef;
  border-radius: 8px;
  background: #eef4fa;
}
.layout-blog #sp-component > .sp-column > :is([class*="blog"], [itemtype$="/Blog"], :has(> .page-header)) .intro-image > a { display: block; }
.layout-blog #sp-component > .sp-column > :is([class*="blog"], [itemtype$="/Blog"], :has(> .page-header)) .intro-image img {
  display: block;
  inline-size: 100%;
  max-inline-size: 100%;
  block-size: auto;
  aspect-ratio: 1200 / 630;
  object-fit: cover;
  transform: none;
  transition: none;
}
.layout-blog #sp-component > .sp-column > :is([class*="blog"], [itemtype$="/Blog"], :has(> .page-header)) article.item :is(.content-wrap, .entry-info) { display: flex; flex: 1; flex-direction: column; min-inline-size: 0; margin: 0; padding: 0; }
.layout-blog #sp-component > .sp-column > :is([class*="blog"], [itemtype$="/Blog"], :has(> .page-header)) article.item .entry-header { display: flex; flex-direction: column; margin: 0; padding: 0; }
.layout-blog #sp-component > .sp-column > :is([class*="blog"], [itemtype$="/Blog"], :has(> .page-header)) .entry-header h2 {
  order: 0;
  margin: 0 0 10px;
  padding: 0;
  color: var(--blog-link);
  font: 650 18px/1.4 var(--blog-font);
  letter-spacing: -.015em;
  text-shadow: none;
  overflow-wrap: break-word;
}
.layout-blog #sp-component > .sp-column > :is([class*="blog"], [itemtype$="/Blog"], :has(> .page-header)) .entry-header h2 a { color: inherit; text-decoration: none; }
.layout-blog #sp-component > .sp-column > :is([class*="blog"], [itemtype$="/Blog"], :has(> .page-header)) .entry-header h2 a:hover { color: #0b4675; text-decoration: underline; text-underline-offset: .16em; }
.layout-blog #sp-component > .sp-column > :is([class*="blog"], [itemtype$="/Blog"], :has(> .page-header)) .items-leading .entry-header h2 { font-size: 20px; font-weight: 700; }
.layout-blog #sp-component > .sp-column > :is([class*="blog"], [itemtype$="/Blog"], :has(> .page-header)) .entry-header .article-info-wrap { order: 1; margin: 0; }
.layout-blog #sp-component > .sp-column > :is([class*="blog"], [itemtype$="/Blog"], :has(> .page-header)) .article-info { display: flex; flex-wrap: wrap; gap: 6px 14px; margin: 0; padding: 0; line-height: 1.5; }
.layout-blog #sp-component > .sp-column > :is([class*="blog"], [itemtype$="/Blog"], :has(> .page-header)) .article-info > dd { margin: 0; padding: 0; color: var(--blog-muted); font: 400 12px/1.5 var(--blog-font); }
.layout-blog #sp-component > .sp-column > :is([class*="blog"], [itemtype$="/Blog"], :has(> .page-header)) .article-info > dd > :is(i, span.fa, span[class*="icon-"]) { color: #6b85a0; }
.layout-blog #sp-component > .sp-column > :is([class*="blog"], [itemtype$="/Blog"], :has(> .page-header)) .entry-info > [itemprop="description"] { display: flex; flex: 1; flex-direction: column; margin-top: 12px; }
.layout-blog #sp-component > .sp-column > :is([class*="blog"], [itemtype$="/Blog"], :has(> .page-header)) .entry-info > [itemprop="description"] > :is(p, ul, ol) {
  margin: 0 0 10px;
  color: var(--blog-text);
  font: 400 14px/1.65 var(--blog-font);
  overflow-wrap: break-word;
}
.layout-blog #sp-component > .sp-column > :is([class*="blog"], [itemtype$="/Blog"], :has(> .page-header)) .entry-info > [itemprop="description"] > :is(ul, ol) { padding-inline-start: 20px; }
.layout-blog #sp-component > .sp-column > :is([class*="blog"], [itemtype$="/Blog"], :has(> .page-header)) .entry-info > [itemprop="description"] > :is(p, ul, ol) a { color: #115a91; text-underline-offset: .16em; }
.layout-blog #sp-component > .sp-column > :is([class*="blog"], [itemtype$="/Blog"], :has(> .page-header)) .comments-readmore { margin-top: auto; padding-top: 16px; }
.layout-blog #sp-component > .sp-column > :is([class*="blog"], [itemtype$="/Blog"], :has(> .page-header)) .comments-readmore > .row { align-items: center; gap: 8px; margin: 0; }
.layout-blog #sp-component > .sp-column > :is([class*="blog"], [itemtype$="/Blog"], :has(> .page-header)) .comments-readmore > .row > [class*="col-"] { flex: 0 0 auto; inline-size: auto; margin: 0; padding: 0; }
.layout-blog #sp-component > .sp-column > :is([class*="blog"], [itemtype$="/Blog"], :has(> .page-header)) a.readmore {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-block-size: 38px;
  padding: 8px 14px;
  border: 1px solid #115a91;
  border-radius: 8px;
  background: #115a91;
  color: #fff;
  font: 500 14px/20px var(--blog-font);
  text-decoration: none;
}
.layout-blog #sp-component > .sp-column > :is([class*="blog"], [itemtype$="/Blog"], :has(> .page-header)) a.readmore::before {
  content: "";
  flex: 0 0 16px;
  inline-size: 16px;
  block-size: 16px;
  background-color: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M12 11v6'/%3E%3Ccircle cx='12' cy='7.5' r='.9' fill='black' stroke='none'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M12 11v6'/%3E%3Ccircle cx='12' cy='7.5' r='.9' fill='black' stroke='none'/%3E%3C/svg%3E") center / contain no-repeat;
}
.layout-blog #sp-component > .sp-column > :is([class*="blog"], [itemtype$="/Blog"], :has(> .page-header)) .comments-readmore .btn-group > .btn { border-radius: 8px; transition: background-color .16s ease, border-color .16s ease, box-shadow .16s ease; }
.layout-blog #sp-component > .sp-column > :is([class*="blog"], [itemtype$="/Blog"], :has(> .page-header)) .comments-readmore .btn-group > .btn:hover {
  border-color: #216db4;
  background-color: #216db4;
  color: #fff;
  box-shadow: 0 3px 8px #115a9126;
}
.layout-blog #sp-component > .sp-column > :is([class*="blog"], [itemtype$="/Blog"], :has(> .page-header)) .comments-readmore .btn-group > .btn:focus-visible { outline: 2px solid #397fb8; outline-offset: 3px; }
.layout-blog #sp-component > .sp-column > :is([class*="blog"], [itemtype$="/Blog"], :has(> .page-header)) a.readmore:hover { background: #0b4675; border-color: #0b4675; }
.layout-blog #sp-component > .sp-column > :is([class*="blog"], [itemtype$="/Blog"], :has(> .page-header)) :is(.entry-header h2 a, a.readmore):focus-visible { outline: 2px solid #397fb8; outline-offset: 3px; }

@container jc-blog (max-width: 680px) {
  .layout-blog #sp-component > .sp-column > :is([class*="blog"], [itemtype$="/Blog"], :has(> .page-header)) > .page-header h1 { padding-inline: 24px 290px; font-size: 30px; }
  .layout-blog #sp-component > .sp-column > :is([class*="blog"], [itemtype$="/Blog"], :has(> .page-header)) > .category-desc { padding-inline: 24px 290px; }
  .layout-blog #sp-component > .sp-column > :is([class*="blog"], [itemtype$="/Blog"], :has(> .page-header))::after { inline-size: 300px; background-size: auto 210px; }
}
@container jc-blog (max-width: 620px) {
  .layout-blog #sp-component > .sp-column > :is([class*="blog"], [itemtype$="/Blog"], :has(> .page-header)) > .items-row { grid-template-columns: minmax(0, 1fr); }
  .layout-blog #sp-component > .sp-column > :is([class*="blog"], [itemtype$="/Blog"], :has(> .page-header)) article.item { padding: 16px; }
}
@container jc-blog (max-width: 520px) {
  .layout-blog #sp-component > .sp-column > :is([class*="blog"], [itemtype$="/Blog"], :has(> .page-header))::before,
  .layout-blog #sp-component > .sp-column > :is([class*="blog"], [itemtype$="/Blog"], :has(> .page-header))::after { min-block-size: 216px; }
  .layout-blog #sp-component > .sp-column > :is([class*="blog"], [itemtype$="/Blog"], :has(> .page-header))::after { inline-size: 100%; max-inline-size: none; opacity: .14; background-size: auto 200px; }
  .layout-blog #sp-component > .sp-column > :is([class*="blog"], [itemtype$="/Blog"], :has(> .page-header)) > .page-header h1 { padding: 24px 22px; font-size: 28px; }
  .layout-blog #sp-component > .sp-column > :is([class*="blog"], [itemtype$="/Blog"], :has(> .page-header)):has(> .category-desc) > .page-header h1 { padding-bottom: 12px; }
  .layout-blog #sp-component > .sp-column > :is([class*="blog"], [itemtype$="/Blog"], :has(> .page-header)) > .category-desc { padding: 0 22px 24px; font-size: 15px; }
  .layout-blog #sp-component > .sp-column > :is([class*="blog"], [itemtype$="/Blog"], :has(> .page-header)) .items-leading .entry-header h2 { font-size: 18px; }
}
@media (max-width: 480px) {
  .layout-blog #sp-component > .sp-column > :is([class*="blog"], [itemtype$="/Blog"], :has(> .page-header)) .entry-info > [itemprop="description"] > :is(p, ul, ol) { font-size: 13px; }
}
@media (prefers-reduced-motion: reduce) {
  .layout-blog #sp-component > .sp-column > :is([class*="blog"], [itemtype$="/Blog"], :has(> .page-header)) .comments-readmore .btn-group > .btn { transition: none; }
}

/* Glossary blog uses term cards instead of article.item; share their appearance. */
.layout-blog #sp-component > .sp-column > :is([class*="blog"], [itemtype$="/Blog"], :has(> .page-header)) > form { min-width: 0; margin-top: 24px; }
.layout-blog #sp-component > .sp-column > :is([class*="blog"], [itemtype$="/Blog"], :has(> .page-header)) .glossary-terms > .row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; margin: 0; }
.layout-blog #sp-component > .sp-column > :is([class*="blog"], [itemtype$="/Blog"], :has(> .page-header)) .glossary-terms > .row::before,
.layout-blog #sp-component > .sp-column > :is([class*="blog"], [itemtype$="/Blog"], :has(> .page-header)) .glossary-terms > .row::after { content: none; }
.layout-blog #sp-component > .sp-column > :is([class*="blog"], [itemtype$="/Blog"], :has(> .page-header)) .glossary-terms .term { display: flex; width: auto; min-width: 0; margin: 0 !important; padding: 0; /* Bootstrap mb-5 utility. */ }
.layout-blog #sp-component > .sp-column > :is([class*="blog"], [itemtype$="/Blog"], :has(> .page-header)) .glossary-terms .term > div { display: flex; flex: 1; flex-direction: column; min-width: 0; margin: 0; padding: 20px; border: 1px solid var(--blog-line); border-radius: 10px; background: #fff; box-shadow: none; }
.layout-blog #sp-component > .sp-column > :is([class*="blog"], [itemtype$="/Blog"], :has(> .page-header)) .glossary-terms h2 { margin: 0 0 12px; padding: 0; color: var(--blog-link); font: 650 18px/1.4 var(--blog-font); overflow-wrap: break-word; }
.layout-blog #sp-component > .sp-column > :is([class*="blog"], [itemtype$="/Blog"], :has(> .page-header)) .glossary-terms .term-description { min-width: 0; color: var(--blog-text); font: 400 14px/1.65 var(--blog-font); overflow-wrap: anywhere; }
.layout-blog #sp-component > .sp-column > :is([class*="blog"], [itemtype$="/Blog"], :has(> .page-header)) .glossary-terms .term-description p { margin: 0 0 10px; font: inherit; }
.layout-blog #sp-component > .sp-column > :is([class*="blog"], [itemtype$="/Blog"], :has(> .page-header)) .glossary-terms .term-synonyms { color: var(--blog-muted); font: 400 13px/1.6 var(--blog-font); }
.layout-blog #sp-component > .sp-column > :is([class*="blog"], [itemtype$="/Blog"], :has(> .page-header)) .glossary-terms .term > div > p:has(> a.readmore) { margin-top: auto; margin-bottom: 0; padding-top: 16px; }
@container jc-blog (max-width: 620px) {
  .layout-blog #sp-component > .sp-column > :is([class*="blog"], [itemtype$="/Blog"], :has(> .page-header)) .glossary-terms > .row { grid-template-columns: minmax(0, 1fr); }
  .layout-blog #sp-component > .sp-column > :is([class*="blog"], [itemtype$="/Blog"], :has(> .page-header)) .glossary-terms .term > div { padding: 16px; }
}
