/* =========================================================
   BrabRusCar — блог (галерея проектов)
   ========================================================= */

/* ---------- Blog hero ---------- */
.blog-hero-meta{
  margin-top: 56px;
  display: flex;
  gap: 40px;
  flex-wrap: wrap;
}
.blog-hero-meta div{ display:flex; flex-direction:column; gap:4px; }
.blog-hero-meta strong{ font-family:'Bodoni Moda', serif; font-size: 26px; color: var(--accent-light); }
.blog-hero-meta span{ font-size: 12px; letter-spacing:.08em; text-transform: uppercase; color: var(--text-faint); }

/* ---------- Post grid ---------- */
.post-grid{
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 26px;
}
.post-card{
  position: relative;
  display: block;
  width: 100%;
  text-align: left;
  border: 1px solid var(--border);
  border-radius: var(--radius-m);
  background: var(--surface);
  overflow: hidden;
  cursor: pointer;
  transition: transform .35s var(--ease), border-color .35s ease;
}
.post-card:hover{ transform: translateY(-6px); border-color: rgba(31,122,82,.35); }
.post-card .thumb{
  position: relative;
  aspect-ratio: 4/5;
  overflow: hidden;
}
.post-card .thumb img{
  width: 100%; height: 100%; object-fit: cover;
  transition: transform .7s var(--ease);
}
.post-card:hover .thumb img{ transform: scale(1.06); }
.post-card .thumb::after{
  content:'';
  position:absolute; inset:0;
  background: linear-gradient(to top, rgba(5,5,6,.9) 0%, rgba(5,5,6,.05) 55%);
}
.post-card .count{
  position: absolute; top: 16px; right: 16px; z-index: 2;
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 12px;
  border-radius: 999px;
  background: rgba(10,10,11,.6);
  backdrop-filter: blur(6px);
  border: 1px solid var(--border-soft);
  font-size: 12px; color: var(--text);
}
.post-card .count svg{ width: 13px; height: 13px; color: var(--accent-light); }
.post-card .cap{
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 2;
  padding: 22px;
}
.post-card .k{ display:flex; flex-wrap:wrap; gap: 8px; margin-bottom: 8px; }
.post-card .k span{
  font-size: 10.5px; letter-spacing:.1em; text-transform: uppercase;
  color: var(--accent-light);
  border: 1px solid rgba(111,217,168,.35);
  border-radius: 999px;
  padding: 3px 9px;
}
.post-card .t{ font-family:'Bodoni Moda', serif; font-size: 21px; color: var(--text); line-height: 1.25; }
.post-card .expand{
  position: absolute; bottom: 18px; right: 18px; z-index: 2;
  width: 38px; height: 38px;
  border-radius: 50%;
  background: rgba(10,10,11,.55);
  backdrop-filter: blur(6px);
  border: 1px solid var(--border-soft);
  display: flex; align-items: center; justify-content: center;
  opacity: 0;
  transform: scale(.85);
  transition: opacity .3s ease, transform .3s ease;
}
.post-card:hover .expand{ opacity: 1; transform: scale(1); }
.post-card .expand svg{ width: 16px; height: 16px; color: var(--text); }

@media (max-width: 980px){
  .post-grid{ grid-template-columns: repeat(2, 1fr); gap: 18px; }
}
@media (max-width: 600px){
  .post-grid{ grid-template-columns: 1fr; }
}

/* ---------- Post modal ---------- */
.post-modal{
  position: fixed; inset: 0; z-index: 800;
  background: rgba(4,4,5,.92);
  opacity: 0; visibility: hidden;
  transition: opacity .3s ease, visibility 0s linear .3s;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.post-modal.is-open{ opacity: 1; visibility: visible; transition: opacity .3s ease; }

.post-modal-inner{
  position: relative;
  max-width: 980px;
  margin: 48px auto 90px;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-l);
  overflow: hidden;
  transform: translateY(24px);
  opacity: 0;
  transition: transform .4s var(--ease), opacity .4s var(--ease);
}
.post-modal.is-open .post-modal-inner{ transform: translateY(0); opacity: 1; }

.post-modal-close{
  position: fixed; top: 22px; right: 22px; z-index: 2;
  width: 46px; height: 46px;
  border-radius: 50%;
  background: rgba(10,10,11,.65);
  backdrop-filter: blur(8px);
  border: 1px solid var(--border-soft);
  display: flex; align-items: center; justify-content: center;
  color: var(--text);
}
.post-modal-close svg{ width: 18px; height: 18px; }

.post-modal-hero{
  position: relative;
  aspect-ratio: 16/9;
  background: #08080a;
}
.post-modal-hero img{ width: 100%; height: 100%; object-fit: cover; }
.post-modal-hero::after{
  content:'';
  position:absolute; inset:0;
  background: linear-gradient(to top, rgba(6,6,7,.85) 0%, rgba(6,6,7,0) 45%);
}
.post-modal-hero .head{
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 28px 34px;
}
.post-modal-hero .k{ display:flex; flex-wrap:wrap; gap: 8px; margin-bottom: 10px; }
.post-modal-hero .k span{
  font-size: 11px; letter-spacing:.1em; text-transform: uppercase;
  color: var(--accent-light);
  border: 1px solid rgba(111,217,168,.4);
  border-radius: 999px;
  padding: 4px 11px;
}
.post-modal-hero h2{
  font-size: clamp(24px, 3.6vw, 34px);
  color: var(--text);
  line-height: 1.2;
  text-shadow: 0 2px 18px rgba(0,0,0,.8);
}
.post-modal-hero .base{ margin-top: 8px; color: var(--text-muted); font-size: 14.5px; }

.post-modal-body{ padding: 34px; }
.post-modal-body .intro{ color: var(--text-muted); font-size: 16px; line-height: 1.8; max-width: 720px; }

.post-modal-note{
  margin-top: 22px;
  padding: 16px 20px;
  border: 1px dashed var(--border);
  border-radius: var(--radius-m);
  color: var(--text-faint);
  font-size: 14px;
  line-height: 1.7;
}

.post-spec-groups{
  margin-top: 34px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 26px;
}
.post-spec-group h3{
  font-size: 13px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--accent-light);
  font-weight: 700;
  margin-bottom: 16px;
}
.post-spec-group ul{ display: flex; flex-direction: column; gap: 12px; }
.post-spec-group li{
  display: flex;
  gap: 11px;
  align-items: flex-start;
  font-size: 14.5px;
  color: var(--text);
  line-height: 1.5;
}
.post-spec-group li svg{
  width: 15px; height: 15px;
  flex-shrink: 0;
  margin-top: 3px;
  color: var(--accent);
}
.post-spec-groups .post-spec-group:only-child{
  grid-column: 1 / -1;
  max-width: 460px;
}
@media (max-width: 680px){
  .post-spec-groups{ grid-template-columns: 1fr; }
  .post-modal-body{ padding: 24px; }
  .post-modal-hero .head{ padding: 20px; }
}

.post-materials{
  margin-top: 30px;
  padding-top: 26px;
  border-top: 1px solid var(--border-soft);
}
.post-materials h3{
  font-size: 13px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--text-faint);
  font-weight: 700;
  margin-bottom: 12px;
}
.post-materials p{ color: var(--text-muted); font-size: 14.5px; line-height: 1.75; }

.post-photos{
  margin-top: 36px;
  padding-top: 30px;
  border-top: 1px solid var(--border-soft);
}
.post-photos h3{
  font-size: 13px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--text-faint);
  font-weight: 700;
  margin-bottom: 18px;
}
.post-photos-grid{
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}
.post-photos-grid button{
  position: relative;
  padding: 0; margin: 0; border: 0;
  display: block;
  aspect-ratio: 1/1;
  overflow: hidden;
  border-radius: var(--radius-s);
  cursor: zoom-in;
  background: var(--surface);
}
.post-photos-grid img{
  width: 100%; height: 100%; object-fit: cover;
  transition: transform .5s var(--ease), filter .4s ease;
  filter: grayscale(.1) brightness(.92);
}
.post-photos-grid button:hover img{ transform: scale(1.08); filter: grayscale(0) brightness(1); }
@media (max-width: 680px){
  .post-photos-grid{ grid-template-columns: repeat(3, 1fr); }
}

.post-modal-cta{
  margin-top: 36px;
  padding-top: 30px;
  border-top: 1px solid var(--border-soft);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 20px;
}
.post-modal-cta p{ color: var(--text-muted); font-size: 15px; max-width: 400px; }
.post-modal-cta .hero-ctas{ margin-top: 0; }

/* ---------- Gallery lightbox with next/prev ---------- */
.glightbox{
  position: fixed; inset: 0; z-index: 900;
  background: rgba(4,4,5,.96);
  display: flex; align-items: center; justify-content: center;
  opacity: 0; visibility: hidden;
  transition: opacity .3s ease, visibility 0s linear .3s;
  padding: 40px;
}
.glightbox.is-open{ opacity: 1; visibility: visible; transition: opacity .3s ease; }
.glightbox img{
  max-width: 100%; max-height: 100%;
  object-fit: contain;
  border-radius: 10px;
  box-shadow: 0 40px 90px -20px rgba(0,0,0,.8);
}
.glightbox-close{
  position: absolute; top: 26px; right: 26px;
  width: 46px; height: 46px;
  border-radius: 50%;
  background: rgba(255,255,255,.06);
  border: 1px solid var(--border-soft);
  display: flex; align-items: center; justify-content: center;
  color: var(--text);
}
.glightbox-close svg{ width: 18px; height: 18px; }
.glightbox-nav{
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 52px; height: 52px;
  border-radius: 50%;
  background: rgba(255,255,255,.06);
  border: 1px solid var(--border-soft);
  display: flex; align-items: center; justify-content: center;
  color: var(--text);
}
.glightbox-nav svg{ width: 20px; height: 20px; }
.glightbox-prev{ left: 20px; }
.glightbox-next{ right: 20px; }
.glightbox-count{
  position: absolute; left: 50%; bottom: 22px; transform: translateX(-50%);
  font-size: 13px; letter-spacing: .06em; color: var(--text-faint);
}
@media (max-width: 700px){
  .glightbox{ padding: 16px; }
  .glightbox-nav{ width: 42px; height: 42px; }
  .glightbox-prev{ left: 8px; }
  .glightbox-next{ right: 8px; }
}
