/* ============================================================
   GALLERY PAGE
   ============================================================ */

.star-rating { display:flex; align-items:center; gap:3px; margin-bottom:12px; }
.star { font-size:16px; line-height:1; cursor:pointer; transition:transform .1s; }
.star:hover { transform:scale(1.2); }
.star.filled { color:#f5a623; }
.star.empty  { color:var(--border-light); }
.rating-text { font-size:12px; color:var(--text-muted); margin-left:6px; }

.action-btn { display:inline-flex; align-items:center; gap:6px; padding:7px 16px; border-radius:6px; font-size:12px; font-weight:600; cursor:pointer; transition:color .2s,background .2s,border-color .2s,transform .15s; border:1px solid var(--border-light); background:var(--bg-hover); color:var(--text-secondary); }
.action-btn:hover { background:var(--bg-card); color:var(--text-primary); transform:translateY(-1px); }
.action-btn.primary { background:var(--accent); border-color:var(--accent); color:#fff; }
.action-btn.primary:hover { background:#c42a3e; border-color:#c42a3e; }
.tags-list { display:flex; flex-wrap:wrap; gap:6px; margin-top:12px; }
.tag-link { padding:3px 10px; background:var(--bg-hover); border:1px solid var(--border); border-radius:12px; font-size:11px; color:var(--text-muted); transition:color .2s,border-color .2s; }
.tag-link:hover { color:var(--accent); border-color:var(--accent); }


.cta-box { background:linear-gradient(135deg,#1a0a0e 0%,#1f1015 100%); border:1px solid rgba(232,51,74,.3); border-radius:var(--radius); padding:20px 24px; text-align:center; margin:20px 0; }
.cta-box h3 { font-family:var(--font-display); font-size:20px; letter-spacing:3px; color:var(--text-primary); margin-bottom:6px; }
.cta-box p { font-size:13px; color:var(--text-muted); margin-bottom:14px; }
.cta-btn { display:inline-block; padding:10px 28px; background:var(--accent); color:#fff; font-family:var(--font-display); font-size:14px; letter-spacing:2px; border-radius:6px; transition:background .2s,transform .15s; }
.cta-btn:hover { background:#c42a3e; transform:translateY(-2px); }

/* partner-strip не выходит за высоту photos-main */

.photo-num { position:absolute; top:5px; left:5px; background:rgba(0,0,0,.65); color:rgba(255,255,255,.8); font-size:10px; font-weight:600; padding:2px 6px; border-radius:3px; opacity:0; transition:opacity .2s; z-index:2; }

.photo-zoom-icon { position:absolute; bottom:8px; right:8px; background:rgba(232,51,74,.85); color:#fff; width:28px; height:28px; border-radius:50%; display:flex; align-items:center; justify-content:center; opacity:0; transition:opacity .2s; z-index:2; }

/* Partner strip — скрыт на десктопе */

.partner-badge {
  position: absolute;
  top: 5px; right: 5px;
  background: rgba(232,51,74,.9);
  color: #fff;
  font-size: 8px; font-weight: 700;
  letter-spacing: .5px;
  padding: 2px 5px;
  border-radius: 3px;
  text-transform: uppercase;
  pointer-events: none;
  z-index: 3;
}

/* Планшет ≤1280px: partner-strip появляется справа, 180px */

@media (max-width: 1280px) {
  
  
  
  

}

/* Мобильный ≤560px: 2 колонки галереи + 1 партнёр = равные трети */

@media (max-width: 560px) {
  
  
  
  
  
}

/* Основная сетка на разных экранах */

@media (max-width: 860px) {
  
}

/* Responsive */

@media (max-width:860px) {
  
  
  
  
}
@media (max-width:560px) {
  
  
  
  .star-rating { justify-content:center; }
  
  .tags-list { justify-content:center; }
}

/* Scroll row — горизонтальный скролл */

.gi-chip:hover,

/* Vote up/down */

.gi-vote-btn.gi-up:hover,

/* reCAPTCHA */

.recaptcha-wrap {
  margin: 12px 0 4px;
}
.recaptcha-note {
  font-size: 10px;
  color: var(--text-muted);
  margin-top: 6px;
}

/* Comments block toggle */

#commentsBlock {
  overflow: hidden;
  transition: opacity 0.3s ease;
}
#commentsBlock.open {
  display: block !important;
  animation: fadeInDown 0.3s ease;
}
@keyframes fadeInDown {
  from { opacity: 0; transform: translateY(-10px); }
  to   { opacity: 1; transform: translateY(0); }
}
#leaveCommentBtn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

/* ── Все labels у картинок — 1 строка с ... ── */

.sidebar-thumb-label,
.overlay-title,

/* ── Ad banners (300×250 scaled to fit) ── */

.ad-banner-wrap {
  position: relative;
  overflow: hidden;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
}
.ad-banner-wrap .ad-label {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--text-muted);
  text-align: center;
  padding: 5px 0 4px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.ad-banner-holder {
  flex: 1;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.ad-banner-inner {
  width: 300px;
  height: 250px;
  flex-shrink: 0;
  transform-origin: center center;
}

/* Сайдбар — aspect-ratio 2/3 как sidebar-thumb */

.sidebar-thumb.ad-banner-wrap {
  aspect-ratio: 2/3;
}

/* ── Gallery page title ── */

.gallery-page-title {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 400;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--text-secondary);
  margin: 0 0 14px 0;
  line-height: 1.2;
}
.gallery-page-model { color: var(--text-primary); }
.gallery-page-name  { color: var(--accent); }

/* ── Double ad row ── */

.ad-double-row {
  display: flex;
  gap: 8px;
  margin: 16px 0;
}
.ad-double-row .ad-banner-wrap {
  flex: 1;
  min-width: 0;
}
@media (max-width: 900px) {
  .ad-double-row {
    max-height: 200px;
  }
  .ad-double-row .ad-banner-wrap {
    max-height: 200px;
  }
  .ad-double-row .ad-banner-holder {
    max-height: 172px;

/* 200px - label height */

}
}

/* ── Photo strip ── */

.photo-strip-wrap {
  margin-bottom: 0;
  border-bottom: 2px solid var(--border);
}
.photo-strip {
  display: flex;
  gap: 2px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  flex-wrap: nowrap;
  scrollbar-width: none;
}
.photo-strip::-webkit-scrollbar { display: none; }
.photo-strip-thumb {
  flex-shrink: 0;
  width: calc((100% - 12px) / 7);
  aspect-ratio: 3/4;
  overflow: hidden;
  position: relative;
}
.photo-strip-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  display: block;
}
.photo-strip-thumb:hover { opacity: .85; }
.photo-strip-num {
  position: absolute; bottom: 3px; left: 3px;
  background: rgba(0,0,0,.7); color: rgba(255,255,255,.8);
  font-size: 8px; font-weight: 700; padding: 1px 4px;
  border-radius: 2px; opacity: 0; transition: opacity .2s; pointer-events: none;
}
.photo-strip-thumb:hover .photo-strip-num { opacity: 1; }
@media (max-width: 900px) { .photo-strip-thumb { width: calc((100% - 8px) / 5); } }
@media (max-width: 600px) { .photo-strip-thumb { width: calc((100% - 4px) / 3); } }

/* ============================================================
   PICTURE PAGE — специфичный CSS
   ============================================================ */

.pic-wrap {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000;
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 0;
  min-height: 300px;
}
.pic-main {
  display: block;
  max-width: 100%;
  max-height: 82vh;
  width: auto;
  height: auto;
  object-fit: contain;
  position: relative;
  z-index: 1;
}
.btn-prev, .btn-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0,0,0,.55);
  border: 1px solid rgba(255,255,255,.1);
  color: #fff;
  width: 44px;
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background .2s, border-color .2s;
  text-decoration: none;
  z-index: 5;
  flex-shrink: 0;
}
.btn-prev { left: 0; border-radius: 0 var(--radius) var(--radius) 0; }
.btn-next { right: 0; border-radius: var(--radius) 0 0 var(--radius); }
.btn-prev:hover, .btn-next:hover { background: var(--accent); border-color: var(--accent); }

.pic-model-tag {
  position: absolute;
  bottom: 10px; left: 10px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(0,0,0,.72);
  color: #fff;
  font-size: 12px; font-weight: 600;
  padding: 5px 10px;
  border-radius: 20px;
  text-decoration: none;
  z-index: 5;
  transition: background .2s;
  border: 1px solid rgba(255,255,255,.12);
}
.pic-model-tag:hover { background: var(--accent); border-color: var(--accent); }

.pic-zoom-btn {
  position: absolute;
  bottom: 10px; right: 10px;
  background: rgba(0,0,0,.6);
  border: 1px solid rgba(255,255,255,.12);
  color: rgba(255,255,255,.8);
  width: 34px; height: 34px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background .2s;
  z-index: 5;
  text-decoration: none;
}
.pic-zoom-btn:hover { background: var(--accent); color: #fff; }

.pic-counter-badge {
  position: absolute;
  top: 10px;
  left: 50%; transform: translateX(-50%);
  background: rgba(0,0,0,.65);
  color: rgba(255,255,255,.85);
  font-size: 12px; font-weight: 600;
  padding: 3px 12px;
  border-radius: 20px;
  pointer-events: none;
  white-space: nowrap;
  z-index: 5;
}
.gal-title-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 16px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}
.gal-title {
  font-family: var(--font-display);
  font-size: 20px;
  letter-spacing: 2px;
  color: var(--text-primary);
  line-height: 1.1;
  margin: 0;
  text-transform: uppercase;
}
.gal-title .model-name { color: var(--text-primary); text-decoration: none; }
.gal-title .model-name:hover { color: var(--accent); }
.gal-title .gal-name   { color: var(--accent); }
.gal-title .photo-of   { color: var(--text-muted); font-size:13px; letter-spacing:0; font-family: var(--font-body); text-transform: none; }
.pic-btns {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  padding: 10px 0;
}
.pic-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: 6px;
  font-size: 12px; font-weight: 600;
  cursor: pointer;
  border: 1px solid var(--border-light);
  background: var(--bg-hover);
  color: var(--text-secondary);
  text-decoration: none;
  transition: color .2s, background .2s, border-color .2s, transform .15s;
  white-space: nowrap;
}
.pic-btn:hover { background: var(--bg-card); color: var(--text-primary); transform: translateY(-1px); }
.pic-btn.active { background: rgba(232,51,74,.15); border-color: var(--accent); color: var(--accent); }
.pic-btn-share { margin-left: auto; }
.gal-meta-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.vote-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 12px;
  border-radius: 6px;
  font-size: 13px; font-weight: 700;
  cursor: pointer;
  border: 1px solid var(--border-light);
  background: var(--bg-hover);
  color: var(--text-secondary);
  transition: color .2s, background .2s, border-color .2s;
}
.vote-btn.up:hover, .vote-btn.up.voted { background: rgba(34,197,94,.15); border-color: #22c55e; color: #22c55e; }
.vote-btn.dn:hover, .vote-btn.dn.voted { background: rgba(232,51,74,.15); border-color: var(--accent); color: var(--accent); }
.vote-btn.voted { pointer-events: none; }
.rating-pct { font-size: 13px; font-weight: 700; color: var(--text-secondary); }
.rating-bar { flex:1; min-width:60px; max-width:120px; height:5px; background:rgba(255,255,255,.1); border-radius:3px; overflow:hidden; }
.rating-fill { height:100%; background:#22c55e; border-radius:3px; transition:width .4s; }
.meta-count { font-size:11px; color:var(--text-muted); }
.gal-meta-tabs { display:flex; gap:4px; margin-left:auto; }
.tab-btn {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 5px 12px; border-radius: 6px;
  font-size: 12px; font-weight: 600;
  border: 1px solid var(--border); background: var(--bg-card); color: var(--text-secondary);
  cursor: pointer; transition: color .2s, background .2s, border-color .2s;
}
.tab-btn.active, .tab-btn:hover { background: var(--accent); border-color: var(--accent); color: #fff; }
.tb-icon { display:flex; align-items:center; }
.gal-panel { display: none; }
.gal-panel.open { display: block; }
.gal-info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 8px; font-size: 12px; color: var(--text-secondary);
  padding: 14px; background: var(--bg-card);
  border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 12px;
}
.gal-info-item { display:flex; flex-direction:column; gap:3px; }
.gal-info-label { font-size:10px; font-weight:700; letter-spacing:1px; text-transform:uppercase; color:var(--text-muted); }
.gal-info-value { color:var(--text-primary); }
.gal-info-value a { color:var(--accent); }
.gal-info-value a:hover { text-decoration:underline; }
.filmstrip-wrap {
  overflow: hidden; margin-bottom: 10px;
  background: #000; border-radius: var(--radius); border: 1px solid var(--border);
}
.filmstrip {
  display: flex; gap: 2px; overflow-x: auto;
  -webkit-overflow-scrolling: touch; scrollbar-width: none;
  scroll-behavior: smooth; padding: 3px;
}
.filmstrip::-webkit-scrollbar { display:none; }

.film-thumb {
  flex-shrink: 0;
  height: 72px;
  width: auto;
  min-width: 48px;
  overflow: hidden;
  border-radius: 2px;
  border: 2px solid transparent;
  cursor: pointer;
  transition: border-color .15s, opacity .15s;
  opacity: .6;
  position: relative;
  display: block;
  text-decoration: none;
  background: #111;
}
.film-thumb img {
  height: 100%;
  width: auto;
  max-width: 130px;
  object-fit: cover;
  object-position: center top;
  display: block;
  pointer-events: none;
}
.film-thumb:hover {
  opacity: .85;
  border-color: rgba(255,255,255,.35);
}
.film-thumb.active {
  opacity: 1;
  border-color: var(--accent);
}

.film-num {
  position:absolute; bottom:2px; right:2px;
  background:rgba(0,0,0,.7); color:rgba(255,255,255,.8);
  font-size:8px; font-weight:700; padding:1px 3px; border-radius:2px; pointer-events:none;
}
.related-pics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 3px;
}
.related-pic-thumb {
  aspect-ratio: 2/3; overflow: hidden; border: 1px solid var(--border);
  cursor: pointer; position: relative; background: var(--bg-hover);
  transition: border-color .2s; display: block; border-radius: var(--radius);
}
.related-pic-thumb:hover { border-color:var(--accent); }
.related-pic-thumb img { width:100%; height:100%; object-fit:cover; object-position:center top; display:block; transition:transform .3s; }
.related-pic-thumb:hover img { transform:scale(1.06); }
.related-pic-num {
  position:absolute; top:5px; left:5px;
  background:rgba(0,0,0,.65); color:rgba(255,255,255,.8);
  font-size:9px; font-weight:700; padding:1px 5px; border-radius:2px;
}
.pic-keyboard-hint {
  display:flex; align-items:center; gap:10px;
  font-size:11px; color:var(--text-muted); padding:4px 0 8px;
}
.pic-keyboard-hint kbd {
  display:inline-flex; align-items:center; justify-content:center;
  background:var(--bg-card); border:1px solid var(--border-light);
  border-radius:3px; padding:1px 6px; font-size:10px; color:var(--text-secondary); font-family:monospace;
}
@media (max-width: 760px) { .pic-keyboard-hint { display:none; } }
@media (max-width: 560px) {
  .gal-title { font-size:15px; letter-spacing:1px; }
  .btn-prev, .btn-next { width:36px; height:56px; }
  .related-pics-grid { grid-template-columns:repeat(3, 1fr); }
  .gal-meta-tabs { margin-left:0; width:100%; }
  
  .pic-btns { gap:6px; }
  .pic-btn { padding:6px 10px; font-size:11px; }
}

/* Ad card inside related gallery grid */

.gallery-card.ad-banner-wrap {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  padding-top: calc(100% * 4 / 3);
}
.gallery-card.ad-banner-wrap .ad-label {
  position: absolute;
  top: 0; left: 0; right: 0;
  font-size: 9px;
  letter-spacing: 1px;
  color: var(--text-muted);
  text-align: center;
  padding: 6px 0 5px;
  text-transform: uppercase;
  border-bottom: 1px solid var(--border);
  background: var(--bg-card);
  z-index: 2;
}
.gallery-card.ad-banner-wrap .ad-banner-holder {
  position: absolute;
  inset: 0;
  top: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.gallery-card.ad-banner-wrap .ad-banner-inner {
  position: absolute;
  top: 50%;
  left: 50%;
  transform-origin: center center;
  transform: translate(-50%, -50%) scale(1);
  width: 300px;
  height: 250px;
}