/* ================================================================
   build.org.ua — editorial blog theme
   Inspired by Toll Brothers blog style
   Palette: navy #1c2b3a | orange #c8640e | sand #f9f6f2
   ================================================================ */

:root {
  --bld-dark:   #1c2b3a;
  --bld-accent: #c8640e;
  --bld-sand:   #f9f6f2;
  --bld-border: #e5e0d8;
  --bld-text:   #1c2b3a;
  --bld-muted:  #6b7a8d;
  --bld-radius: 3px;
  --bld-gap:    24px;
}

/* ================================================================
   Category filter bar (blog listing only)
   ================================================================ */

.bld-cat-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 16px 0 20px;
  border-bottom: 1.5px solid var(--bld-border);
  margin-bottom: 32px;
}

.bld-cat-bar__link {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--bld-muted);
  text-decoration: none;
  padding: 6px 16px;
  border: 1.5px solid var(--bld-border);
  border-radius: 100px;
  transition: color .18s, border-color .18s, background .18s;
  line-height: 1;
}

.bld-cat-bar__link:hover {
  color: var(--bld-accent);
  border-color: var(--bld-accent);
  background: rgba(200, 100, 14, .06);
  text-decoration: none;
}

.bld-cat-bar__link--active {
  color: #fff;
  border-color: var(--bld-accent);
  background: var(--bld-accent);
}

.bld-cat-bar__link--active:hover {
  color: #fff;
  background: #a8520b;
  border-color: #a8520b;
}

/* ================================================================
   Blog listing page heading
   ================================================================ */

.bld-page-title {
  font-size: clamp(1.5rem, 3.5vw, 2.25rem);
  font-weight: 700;
  color: var(--bld-dark);
  margin: 0 0 28px;
  line-height: 1.15;
}

.bld-page-desc {
  color: var(--bld-muted);
  font-size: 1rem;
  margin-bottom: 36px;
}

/* ================================================================
   Grid layout
   ================================================================ */

.bld-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--bld-gap);
  margin-bottom: 48px;
  /* First item (featured) spans all 3 columns */
  grid-template-rows: auto;
}

.bld-grid__featured {
  grid-column: 1 / -1;
}

.bld-grid__item {
  display: flex;
}

@media (max-width: 900px) {
  .bld-grid { grid-template-columns: repeat(2, 1fr); }
  .bld-grid__featured { grid-column: 1 / -1; }
}

@media (max-width: 600px) {
  .bld-grid { grid-template-columns: 1fr; }
}

/* ================================================================
   Card base
   ================================================================ */

.bld-card {
  background: #fff;
  border: 1px solid var(--bld-border);
  border-radius: var(--bld-radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  width: 100%;
  transition: box-shadow .22s, transform .22s;
}

.bld-card:hover {
  box-shadow: 0 8px 32px rgba(28, 43, 58, .11);
  transform: translateY(-2px);
}

/* ================================================================
   Card image
   ================================================================ */

.bld-card__img-wrap {
  display: block;
  position: relative;
  overflow: hidden;
  background: var(--bld-border);
  aspect-ratio: 16 / 9;
}

.bld-card__img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .4s ease;
}

.bld-card:hover .bld-card__img {
  transform: scale(1.04);
}

.bld-card__img--placeholder {
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #dcd5cc 0%, #bfb4a8 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #a09590;
  font-size: 2.5rem;
}

/* ================================================================
   Featured card — horizontal layout
   ================================================================ */

.bld-grid__featured .bld-card {
  flex-direction: row;
  min-height: 360px;
}

.bld-grid__featured .bld-card__img-wrap {
  flex: 0 0 56%;
  aspect-ratio: auto;
  position: relative;
}

.bld-grid__featured .bld-card__img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.bld-grid__featured .bld-card__body {
  padding: 36px 40px;
}

.bld-grid__featured .bld-card__title {
  font-size: 1.5rem;
  -webkit-line-clamp: 4;
  line-clamp: 4;
}

.bld-grid__featured .bld-card__annotation {
  -webkit-line-clamp: 5;
  line-clamp: 5;
  display: -webkit-box;
}

.bld-grid__featured .bld-cat-badge {
  font-size: 0.7rem;
}

@media (max-width: 900px) {
  .bld-grid__featured .bld-card {
    flex-direction: column;
    min-height: 0;
  }
  .bld-grid__featured .bld-card__img-wrap {
    flex: none;
    aspect-ratio: 16 / 9;
  }
  .bld-grid__featured .bld-card__img {
    position: static;
    width: 100%;
    height: 100%;
  }
  .bld-grid__featured .bld-card__body {
    padding: 20px 24px;
  }
  .bld-grid__featured .bld-card__title {
    font-size: 1.2rem;
  }
}

/* ================================================================
   Card body
   ================================================================ */

.bld-card__body {
  padding: 20px 22px 24px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

/* ================================================================
   Category badge
   ================================================================ */

.bld-card__cats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 8px;
}

.bld-cat-badge {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--bld-accent);
  text-decoration: none;
  transition: color .15s;
}

.bld-cat-badge:hover {
  color: #a8520b;
  text-decoration: none;
}

/* ================================================================
   Card title
   ================================================================ */

.bld-card__title {
  font-size: 1.0625rem;
  font-weight: 700;
  color: var(--bld-dark);
  text-decoration: none;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  overflow: hidden;
  margin-bottom: 10px;
  transition: color .15s;
}

.bld-card__title:hover {
  color: var(--bld-accent);
  text-decoration: none;
}

/* ================================================================
   Card meta (date · read time)
   ================================================================ */

.bld-card__meta {
  font-size: 0.78rem;
  color: var(--bld-muted);
  margin-bottom: 10px;
  letter-spacing: .01em;
}

/* ================================================================
   Card annotation (excerpt)
   ================================================================ */

.bld-card__annotation {
  font-size: 0.875rem;
  color: #4a5568;
  line-height: 1.65;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  overflow: hidden;
  margin-bottom: auto;
  padding-bottom: 16px;
}

/* ================================================================
   Read more link
   ================================================================ */

.bld-read-more {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--bld-accent);
  text-decoration: none;
  margin-top: 16px;
  transition: gap .2s;
}

.bld-read-more:hover {
  color: #a8520b;
  text-decoration: none;
  gap: 9px;
}

/* ================================================================
   Pagination
   ================================================================ */

.bld-pagination {
  margin-top: 8px;
  padding-top: 24px;
  border-top: 1.5px solid var(--bld-border);
}

/* ================================================================
   Blog listing wrapper — restore full width
   (removes the default OkayCMS sidebar constraint)
   ================================================================ */

.bld-blog-page-wrap {
  width: 100%;
}

/* ================================================================
   HEADER — editorial blog style (Toll Brothers–inspired)
   ================================================================ */

/* Dark background across all header layers */
.header,
.header__top,
.header__center,
.header__bottom,
.header__bottom .fn_header__sticky,
.is-sticky { background: var(--bld-dark) !important; }

.header { border-bottom: none; box-shadow: none; }

/* ---- Hide e-commerce & utility elements ---- */
.header__top,                    /* account / callback / currency strip */
#account,
.header-contact,                 /* phone / email block */
.fn_callback,
.switcher,
#wishlist,
#comparison,
#cart_informer,
.wishlist_informer,
.comparison_informer,
.fn_search_toggle,               /* mobile search icon */
.catalog_button,                 /* «Каталог» dropdown button */
.categories_nav,                 /* product category dropdown */
.fn_catalog_menu {
  display: none !important;
}

/* ---- Logo: инвертировать в белый ---- */
.header .logo__link img {
  filter: brightness(0) invert(1);
  max-height: 44px;
}
/* SVG-лого */
.header .logo__link svg path,
.header .logo__link svg rect,
.header .logo__link svg polygon { fill: #fff !important; }

/* ---- header__center: logo слева, меню справа ---- */
.header__center { border-bottom: 1px solid rgba(255,255,255,.08); }

.header__center .f_row {
  justify-content: space-between;
  align-items: center;
  padding: 18px 0;
}

/* Menu switcher (hamburger – desktop, обычно скрыт) */
.fn_menu_switch.menu_switcher { display: none !important; }

/* ---- Горизонтальное меню ---- */
.header__menu { gap: 0; }

.header__menu .menu_group__list.menu_group__list--1 {
  display: flex !important;
  flex-wrap: wrap;
  gap: 0;
  list-style: none;
  padding: 0;
  margin: 0;
}

.header__menu .menu_group__item--1 { position: relative; }

.header__menu .menu_group__link {
  display: block;
  padding: 6px 14px !important;
  font-size: 0.74rem !important;
  font-weight: 700 !important;
  letter-spacing: .06em !important;
  text-transform: uppercase !important;
  color: rgba(255,255,255,.7) !important;
  text-decoration: none;
  transition: color .18s;
  white-space: nowrap;
}

.header__menu .menu_group__link:hover,
.header__menu .menu_group__item--1:hover > a.menu_group__link {
  color: var(--bld-accent) !important;
  text-decoration: none !important;
}

/* Submenu dropdown */
.header__menu .menu_group__list--2 {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  background: var(--bld-dark);
  border: 1px solid rgba(255,255,255,.1);
  border-top: 2px solid var(--bld-accent);
  min-width: 180px;
  z-index: 200;
  padding: 6px 0;
  list-style: none;
}

.header__menu .menu_group__item--1:hover .menu_group__list--2 { display: block; }

.header__menu .menu_group__list--2 .menu_group__link {
  padding: 8px 18px !important;
  font-size: 0.78rem !important;
  color: rgba(255,255,255,.65) !important;
  font-weight: 600 !important;
}

.header__menu .menu_group__list--2 .menu_group__link:hover {
  color: var(--bld-accent) !important;
  background: rgba(255,255,255,.04);
}

/* ---- header__bottom: скрыт на десктопе, только mobile ---- */
@media (min-width: 992px) {
  .header__bottom { display: none !important; }
}

/* Mobile header__bottom — гамбургер + поиск */
@media (max-width: 991px) {
  .header__center { display: none; }

  .header__bottom { display: block !important; }

  .header__bottom .header__bottom_panel {
    padding: 10px 0;
    align-items: center;
    gap: 12px;
  }

  .header__bottom .menu_switcher.hidden-lg-up {
    display: flex !important;
    align-items: center;
    gap: 8px;
    color: rgba(255,255,255,.8);
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: .04em;
    text-transform: uppercase;
  }

  .header__bottom .menu_switcher .catalog_icon { color: #fff; }

  .header__bottom .search {
    flex: 1;
    border: 1px solid rgba(255,255,255,.2);
    border-radius: 2px;
    background: rgba(255,255,255,.06);
    height: 36px;
  }

  .header__bottom .search__input {
    background: transparent;
    color: #fff;
    font-size: 0.8rem;
    height: 36px;
    padding: 0 10px;
  }

  .header__bottom .search__input::placeholder { color: rgba(255,255,255,.35); }

  .header__bottom .search__button {
    background: transparent;
    color: rgba(255,255,255,.5);
    border: none;
    width: 36px;
  }
}

/* ================================================================
   MAIN BANNER — hide on homepage
   ================================================================ */

.main_banner { display: none !important; }

/* ================================================================
   Homepage hero  — contained within site container
   ================================================================ */

.bld-hero {
  position: relative;
  overflow: hidden;
  border-radius: 4px;
  aspect-ratio: 21 / 8;
  min-height: 260px;
  background: var(--bld-dark);
  margin-bottom: 40px;
}

.bld-hero__img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.bld-hero__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to top,
    rgba(10, 18, 28, .84) 0%,
    rgba(10, 18, 28, .28) 52%,
    rgba(10, 18, 28, .06) 100%
  );
}

.bld-hero__content {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 52px 40px 36px;
  max-width: 780px;
}

.bld-hero__cat {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--bld-accent);
  text-decoration: none;
  margin-bottom: 10px;
}

.bld-hero__cat:hover { color: #e07b2e; text-decoration: none; }

.bld-hero__title {
  display: block;
  font-size: clamp(1.4rem, 2.8vw, 2.2rem);
  font-weight: 700;
  color: #fff;
  line-height: 1.2;
  text-decoration: none;
  margin-bottom: 22px;
  text-shadow: 0 2px 10px rgba(0,0,0,.3);
}

.bld-hero__title:hover { color: #fff; text-decoration: none; }

.bld-hero__cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--bld-accent);
  color: #fff;
  text-decoration: none;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  padding: 10px 20px;
  border-radius: 2px;
  transition: background .18s;
}

.bld-hero__cta:hover { background: #a8520b; color: #fff; text-decoration: none; }

/* Tablet: 768–1024px — shorter aspect ratio */
@media (max-width: 1024px) {
  .bld-hero {
    aspect-ratio: 16 / 7;
  }
  .bld-hero__content {
    padding: 40px 28px 28px;
  }
}

/* Mobile: <640px — fixed height, taller layout */
@media (max-width: 640px) {
  .bld-hero {
    aspect-ratio: auto;
    height: 420px;
    border-radius: 0;
  }
  .bld-hero__content {
    padding: 32px 18px 24px;
  }
  .bld-hero__title {
    font-size: 1.25rem;
  }
  .bld-hero__cat {
    font-size: 0.62rem;
  }
}

/* ================================================================
   Homepage sections (latest articles, category sections)
   ================================================================ */

.bld-section {
  margin-bottom: 52px;
}

.bld-section__header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding-bottom: 14px;
  border-bottom: 1.5px solid var(--bld-border);
  margin-bottom: 24px;
}

.bld-section__title {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--bld-dark);
}

.bld-section__more {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--bld-accent);
  text-decoration: none;
  transition: color .15s;
}

.bld-section__more:hover { color: #a8520b; text-decoration: none; }

/* ================================================================
   Article page (post.tpl) styles
   ================================================================ */

/* Hero wallpaper — full-width with better height */
.bld-post-hero {
  width: 100%;
  position: relative;
  overflow: hidden;
  aspect-ratio: 21 / 7;
  min-height: 260px;
  background: var(--bld-sand) no-repeat center center;
  background-size: cover;
}

/* Category labels on hero */
.bld-post-hero .post__labels {
  position: absolute;
  top: 20px;
  left: 24px;
  display: flex;
  gap: 8px;
}

/* Post container body */
.bld-post-content {
  max-width: 760px;
  margin: 0 auto;
  padding: 36px 24px 48px;
}

/* Post heading */
.bld-post-content .post__heading {
  font-size: clamp(1.6rem, 3.5vw, 2.25rem);
  font-weight: 700;
  color: var(--bld-dark);
  line-height: 1.2;
  margin-bottom: 16px;
}

/* Post meta bar */
.bld-post-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: center;
  color: var(--bld-muted);
  font-size: 0.85rem;
  padding-bottom: 20px;
  border-bottom: 1.5px solid var(--bld-border);
  margin-bottom: 28px;
}

.bld-post-meta .bld-post-meta__item {
  display: flex;
  align-items: center;
  gap: 5px;
}

/* Article body typography */
.post_container__body .block__description--style h2 {
  font-size: 1.375rem;
  font-weight: 700;
  color: var(--bld-dark);
  border-left: 4px solid var(--bld-accent);
  padding-left: 14px;
  margin: 2em 0 0.75em;
  line-height: 1.25;
}

.post_container__body .block__description--style h3 {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--bld-dark);
  margin: 1.75em 0 0.6em;
}

.post_container__body .block__description--style h4 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--bld-dark);
  margin: 1.5em 0 0.5em;
  text-transform: uppercase;
  letter-spacing: .04em;
}

.post_container__body .block__description--style p {
  line-height: 1.75;
  margin-bottom: 1.25em;
  color: #2d3748;
}

.post_container__body .block__description--style blockquote {
  border-left: 4px solid var(--bld-accent);
  background: var(--bld-sand);
  padding: 16px 22px;
  margin: 28px 0;
  border-radius: 0 var(--bld-radius) var(--bld-radius) 0;
  font-style: italic;
  color: var(--bld-dark);
}

.post_container__body .block__description--style a {
  color: var(--bld-accent);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

.post_container__body .block__description--style a:hover {
  color: #a8520b;
}

.post_container__body .block__description--style ul,
.post_container__body .block__description--style ol {
  padding-left: 1.4em;
  margin-bottom: 1.25em;
}

.post_container__body .block__description--style li {
  line-height: 1.7;
  margin-bottom: .4em;
  color: #2d3748;
}

.post_container__body .block__description--style img {
  max-width: 100%;
  border-radius: 4px;
  margin: 12px 0;
}

/* Table of contents */
.post__table_contents {
  background: var(--bld-sand);
  border: 1.5px solid var(--bld-border);
  border-radius: var(--bld-radius);
  padding: 18px 22px;
  margin: 24px 0 32px;
}

.post__table_contents_title {
  font-weight: 700;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--bld-muted);
  margin-bottom: 10px;
}

.post__table_contents ol {
  margin: 0;
  padding-left: 1.2em;
}

.post__table_contents li {
  margin-bottom: 6px;
  line-height: 1.4;
}

.post__table_contents a {
  color: var(--bld-dark);
  text-decoration: none;
  font-size: 0.9rem;
}

.post__table_contents a:hover {
  color: var(--bld-accent);
}

/* Post labels (category badges on article page) */
.post__label {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: #fff;
  background: var(--bld-accent);
  padding: 4px 12px;
  border-radius: 100px;
  text-decoration: none;
}

.post__label:hover {
  background: #a8520b;
  text-decoration: none;
  color: #fff;
}

/* ================================================================
   Sidebar on article pages — clean minimal style
   ================================================================ */

.sidebar .sidebar_heading {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--bld-muted);
  padding: 0 0 12px;
  border-bottom: 1.5px solid var(--bld-border);
  margin-bottom: 12px;
  margin-top: 12px;
}

.sidebar .blog_catalog__link {
  font-size: 0.875rem;
  color: var(--bld-dark);
  text-decoration: none;
  padding: 5px 0;
  display: block;
  border-bottom: 1px solid var(--bld-border);
  transition: color .15s, padding-left .15s;
}

.sidebar .blog_catalog__link:hover {
  color: var(--bld-accent);
  padding-left: 4px;
}

.sidebar .blog_catalog__link.selected {
  color: var(--bld-accent);
  font-weight: 700;
}

/* Hide sidebar category images — text-only nav */
.sidebar .blog_catalog__no_image,
.sidebar .blog_catalog picture {
  display: none !important;
}

/* ================================================================
   Prev / next post navigation
   ================================================================ */

.pager {
  display: flex;
  gap: 16px;
  margin: 32px 0;
  list-style: none;
  padding: 0;
}

.pager li {
  flex: 1;
}

.pager a {
  display: block;
  padding: 16px 20px;
  border: 1.5px solid var(--bld-border);
  border-radius: var(--bld-radius);
  color: var(--bld-dark);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1.35;
  transition: border-color .18s, color .18s;
}

.pager a:hover {
  border-color: var(--bld-accent);
  color: var(--bld-accent);
}

/* ================================================================
   Tags footer
   ================================================================ */

.post_tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 24px;
}

.post_tag {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--bld-muted);
  text-decoration: none;
  border: 1px solid var(--bld-border);
  padding: 3px 12px;
  border-radius: 100px;
  transition: color .15s, border-color .15s;
}

.post_tag:hover {
  color: var(--bld-accent);
  border-color: var(--bld-accent);
}

/* ================================================================
   Author block
   ================================================================ */

.post_author {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  background: var(--bld-sand);
  border: 1.5px solid var(--bld-border);
  border-radius: var(--bld-radius);
  padding: 20px 24px;
  margin: 24px 0;
}

.post_author__img img {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  object-fit: cover;
}

.post_author__name a,
.post_author__name span {
  font-weight: 700;
  font-size: 1rem;
  color: var(--bld-dark);
  text-decoration: none;
}

.post_author__position {
  font-size: 0.85rem;
  color: var(--bld-muted);
  margin-top: 2px;
}

/* ================================================================
   Comments section
   ================================================================ */

.block--border {
  border-top: 1.5px solid var(--bld-border);
  margin-top: 32px;
  padding-top: 24px;
}

.block__title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--bld-dark);
  margin-bottom: 20px;
}