/* =====================================================
   DIM.CSS — спільні стилі для сторінок будинків
   (a-frames, altanka, barnhouse, minibarn, miniroom,
    samurai, slupika та подібні)
   ===================================================== */

.article-wrap {
  max-width: 800px;
  margin: 0 auto;
  padding: clamp(40px, 8vw, 80px) var(--gap);
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--sage);
  transition: color .2s;
  margin-bottom: 36px;
}
.back-link:hover { color: var(--lime); }

.article-title {
  font-family: var(--font-display);
  font-size: clamp(22px, 3.5vw, 38px);
  font-weight: 900;
  color: var(--charcoal);
  line-height: 1.2;
  margin-bottom: 16px;
  padding-bottom: 24px;
  border-bottom: 3px solid var(--lime);
}

/* ── Meta badges ── */
.article-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 32px;
}
.meta-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--cream);
  border-radius: 6px;
  padding: 6px 14px;
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--forest);
}
.meta-badge svg { color: var(--lime); }

/* ── Gallery (за замовчуванням: grid 1fr 1fr, головне фото на всю ширину) ── */
.gallery {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: auto auto;
  gap: 12px;
  margin: 0 0 44px;
}
.gallery__main {
  grid-column: 1 / -1;
  width: 100%;
}
.gallery__row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
.gallery__item {
  position: relative;
  border-radius: var(--radius-md);
  overflow: hidden;
  cursor: pointer;
  background: var(--sand);
}
.gallery__item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform .4s ease;
}
.gallery__main img  { height: 420px; }
.gallery__thumb img { height: 190px; }
.gallery__item:hover img { transform: scale(1.04); }
.gallery__overlay {
  position: absolute;
  inset: 0;
  background: rgba(43,58,74,.35);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity .3s;
}
.gallery__item:hover .gallery__overlay { opacity: 1; }
.gallery__zoom {
  width: 48px; height: 48px;
  border-radius: 50%;
  background: var(--lime);
  display: flex; align-items: center; justify-content: center;
  color: var(--forest);
  transform: scale(.8);
  transition: transform .3s;
}
.gallery__item:hover .gallery__zoom { transform: scale(1); }

/* ── Gallery modifier: 3-колонкова сітка (напр. barnhouse) ── */
.gallery--cols3 {
  grid-template-columns: 1fr 1fr 1fr;
}

/* ── Lightbox ── */
.lightbox {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(0,0,0,.92);
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.lightbox.open { display: flex; }
.lightbox__img {
  max-width: 90vw; max-height: 88vh;
  object-fit: contain;
  border-radius: var(--radius-md);
  display: block;
}
.lightbox__close {
  position: absolute; top: 20px; right: 24px;
  width: 44px; height: 44px;
  border-radius: 50%;
  background: rgba(255,255,255,.1);
  border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  color: #fff; transition: background .2s;
}
.lightbox__close:hover { background: var(--lime); color: var(--forest); }
.lightbox__prev, .lightbox__next {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 48px; height: 48px;
  border-radius: 50%;
  background: rgba(255,255,255,.1);
  border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  color: #fff; transition: background .2s;
}
.lightbox__prev { left: 20px; }
.lightbox__next { right: 20px; }
.lightbox__prev:hover, .lightbox__next:hover { background: var(--lime); color: var(--forest); }
.lightbox__counter {
  position: absolute; bottom: 20px; left: 50%; transform: translateX(-50%);
  font-family: var(--font-display); font-size: 12px; font-weight: 700;
  letter-spacing: .1em; color: rgba(255,255,255,.6);
}

/* ── Text ── */
.article-wrap p {
  font-size: 16px; color: var(--mid); line-height: 1.8; margin-bottom: 20px;
}
.article-wrap h2 {
  font-family: var(--font-display);
  font-size: clamp(18px, 2.5vw, 24px);
  font-weight: 700; color: var(--charcoal);
  margin: 44px 0 20px;
}

/* ── Elements list ── */
.elements-list {
  display: flex; flex-direction: column; gap: 12px; margin: 20px 0 40px;
}
.el-item {
  display: flex; gap: 14px; align-items: flex-start;
  background: var(--cream); border-radius: var(--radius-md); padding: 16px 20px;
}
.el-item::before {
  content: ''; display: block; width: 4px; min-height: 100%;
  background: var(--lime); border-radius: 4px; flex-shrink: 0; align-self: stretch;
}
.el-item__text { font-size: 15px; color: var(--mid); line-height: 1.7; }
.el-item__text strong { color: var(--charcoal); }

/* ── Tech cards ── */
.tech-cards {
  display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin: 20px 0 40px;
}
.tech-card {
  background: var(--cream); border-radius: var(--radius-lg);
  border-top: 4px solid var(--lime); padding: 24px 22px;
}
.tech-card__title {
  font-family: var(--font-display); font-size: 14px; font-weight: 700;
  color: var(--forest); margin-bottom: 12px;
}
.tech-card p { font-size: 14px; margin-bottom: 0; }

/* ── Form ── */
.article-form {
  background: #1E2A35; border-radius: var(--radius-lg);
  padding: clamp(28px, 5vw, 48px); margin-top: 52px;
}
.article-form h3 { color: var(--white); margin-bottom: 8px; }
.article-form > p { color: rgba(255,255,255,.6); font-size: 15px; margin-bottom: 24px; }
.form-row { display: grid; gap: 16px; margin-bottom: 16px; }
.form-row--2 { grid-template-columns: 1fr 1fr; }
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-group label {
  font-size: 11px; font-weight: 700; color: rgba(255,255,255,.5);
  letter-spacing: .06em; text-transform: uppercase; font-family: var(--font-display);
}
.form-group input {
  background: rgba(255,255,255,.08); border: 1.5px solid rgba(255,255,255,.18);
  border-radius: var(--radius-sm); color: var(--white); padding: 12px 15px;
  font-size: 15px; font-family: var(--font-body); outline: none;
  transition: border-color .2s, background .2s;
}
.form-group input::placeholder { color: rgba(255,255,255,.3); }
.form-group input:focus { border-color: var(--lime); background: rgba(255,255,255,.11); }
.form-success {
  display: none; background: rgba(212,134,42,.12); border: 1px solid var(--lime);
  border-radius: var(--radius-md); padding: 20px; text-align: center; margin-top: 16px;
}
.form-success.visible { display: block; }
.form-success h4 { color: var(--lime); margin-bottom: 6px; }
.form-success p  { color: rgba(255,255,255,.7); font-size: 14px; margin-bottom: 0; }
.form-error {
  display: none; color: #ff8080; font-size: 14px;
  background: rgba(255,70,70,.1); border-radius: var(--radius-sm);
  padding: 12px 16px; margin-top: 10px;
}
.form-error.visible { display: block; }

.back-link--bottom {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--font-display); font-size: 11px; font-weight: 700;
  letter-spacing: .08em; text-transform: uppercase; color: var(--sage);
  transition: color .2s; margin-top: 52px;
}
.back-link--bottom:hover { color: var(--lime); }

/* ── RESPONSIVE ── */
@media (max-width: 640px) {
  .tech-cards { grid-template-columns: 1fr; }
  .gallery { grid-template-columns: 1fr 1fr; }
  .gallery__main { grid-column: 1 / -1; }
  .gallery__main img  { height: 260px; }
  .gallery__thumb img { height: 150px; }
  .gallery__row { grid-template-columns: repeat(3, 1fr); }
  .form-row--2 { grid-template-columns: 1fr; }
  .lightbox__prev { left: 8px; }
  .lightbox__next { right: 8px; }
}
