/* ============================================
   WALLPAPERS — brand page grid
   Analogous to .amd-lastview-items
   ============================================ */

/* Section wrapper — no padding, same background as amd-avto-main */
.amd-wall-main {
  width: 100%;
  box-sizing: border-box;
  background: rgba(255, 255, 255, 0.40);
}

.amd-wall-pager-wrap {
  padding: 8px 20px 6px;
}

/* Grid container */
.amd-wall-grid {
  width: 100%;
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  box-sizing: border-box;
}

/* Each card */
.amd-wall-grid a {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  width: 12.5%;
  min-width: 0;
  padding: 0;
  margin: 0;
  box-sizing: border-box;
  background-color: rgba(255, 255, 255, 0.55);
  border-right: 1px solid rgba(0, 0, 0, 0.08);
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  text-decoration: none;
  overflow: hidden;
  position: relative;
  transition: background-color 0.35s ease;
}

/* Heart button on grid cards — fade in on hover, always show when active */
.amd-wall-grid a .amd-fav-icon::before { opacity: 0.4; }
.amd-wall-grid a:hover .amd-fav-icon::before { opacity: 1; }
.amd-wall-grid a .amd-fav-icon.amd-fav-active::before { opacity: 1; }

.amd-wall-grid a:nth-child(8n) {
  border-right: none;
}

.amd-wall-grid a:hover {
  background-color: rgba(255, 255, 255, 1);
}

/* Image wrapper — clips the zoom */
.amd-wall-grid-img-wrap {
  display: block;
  width: 100%;
  line-height: 0;
  overflow: hidden;
  flex-shrink: 0;
}

/* Image — smooth zoom on hover */
.amd-wall-grid-img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  will-change: transform;
  -webkit-transition: -webkit-transform 0.55s ease-in-out, filter 0.4s ease !important;
  transition: transform 0.55s ease-in-out, filter 0.4s ease !important;
}

.amd-wall-grid a:hover .amd-wall-grid-img {
  -webkit-transform: scale(1.09);
  transform: scale(1.09);
  filter: brightness(1.12);
}

/* Text block */
.amd-wall-grid-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 5px 7px 7px;
  min-width: 0;
}

.amd-wall-grid-name {
  font-family: Tahoma, Arial, sans-serif;
  font-size: 12px;
  font-weight: bold;
  color: #000000;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.3;
}

.amd-wall-grid a:hover .amd-wall-grid-name {
  text-decoration: underline;
}

.amd-wall-grid-views,
.amd-wall-grid-date {
  font-family: Tahoma, Arial, sans-serif;
  font-size: 10px;
  color: #555555;
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

@media (max-width: 1100px) {
  .amd-wall-grid a { width: 25%; }
  .amd-wall-grid a:nth-child(8n) { border-right: 1px solid rgba(0,0,0,0.08); }
  .amd-wall-grid a:nth-child(4n) { border-right: none; }
}

@media (max-width: 600px) {
  .amd-wall-grid a { width: 50%; }
  .amd-wall-grid a:nth-child(4n) { border-right: 1px solid rgba(0,0,0,0.08); }
  .amd-wall-grid a:nth-child(2n) { border-right: none; }
}

/* ============================================
   WALLPAPERS DETAIL PAGE
   ============================================ */

.amd-wall-detail-plashka {
  justify-content: space-between;
  flex-wrap: nowrap;
}
.amd-wall-detail-crumbs {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  min-width: 0;
  flex: 1;
}
.amd-wall-detail-crumbs .amd-add-plashka-title {
  font-size: 12px;
}
.amd-wall-detail-navbtns {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
  margin-left: 12px;
}
.amd-wall-navbtn {
  width: auto !important;
  padding: 0 10px !important;
  white-space: nowrap;
}
.amd-wall-detail-h1wrap {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.amd-add-h1-plashka .amd-wall-detail-h1wrap h1 { font-size: 20px !important; }
@media (max-width: 600px) {
  .amd-add-h1-plashka .amd-wall-detail-h1wrap h1 { font-size: 15px !important; white-space: normal !important; }
}
.amd-wall-detail-date {
  font-family: Tahoma, Arial, sans-serif;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.55);
  font-weight: normal;
}
.amd-wall-detail-outer {
  width: 100%;
  background: rgba(255, 255, 255, 0.40);
  box-sizing: border-box;
}

/* Large image */
.amd-wall-detail-mainwrap {
  position: relative;
  width: 100%;
  line-height: 0;
  background: #111;
  overflow: hidden;
}
.amd-wall-detail-mainimg {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  object-position: center center;
}
.amd-wall-detail-mainwrap a {
  display: block;
  line-height: 0;
}
/* Override prettyPhoto darkening on hover */
.amd-wall-detail-mainwrap a.gallery:hover img,
.amd-wall-detail-mainwrap a.gallery:hover .amd-wall-detail-mainimg {
  opacity: 1 !important;
  filter: none;
}

/* Prev/Next arrows on main image */
.amd-wall-detail-arrowbtn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 48px;
  height: 72px;
  background: rgba(0, 0, 0, 0.30);
  color: #ffffff;
  border: none;
  cursor: pointer;
  font-size: 40px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
  z-index: 10;
  padding: 0;
}
.amd-wall-detail-arrowbtn:hover { background: rgba(0, 0, 0, 0.60); }
.amd-wall-arrowl { left: 0; border-radius: 0 4px 4px 0; }
.amd-wall-arrowr { right: 0; border-radius: 4px 0 0 4px; }

/* Heart button on detail page — right side of H1 row */
.amd-fav-icon.amd-wall-detail-fav {
  position: static;
  width: 34px;
  height: 34px;
  margin-left: auto;
  flex-shrink: 0;
  align-self: center;
}
.amd-fav-icon.amd-wall-detail-fav::before { font-size: 28px; }

/* Reactions bar override for wallpapers detail page */
.amd-wall-react-bar {
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

/* Views + Download column (right side inside reactions bar) */
.amd-wall-detail-meta {
  margin-left: auto;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 5px;
  flex-shrink: 0;
}
.amd-wall-detail-views {
  font-family: Tahoma, Arial, sans-serif;
  font-size: 12px;
  color: #333;
  white-space: nowrap;
}
.amd-wall-detail-download {
  font-family: Tahoma, Arial, sans-serif;
  font-size: 12px;
  font-weight: bold;
  color: #cc0000;
  text-decoration: none;
  white-space: nowrap;
}
.amd-wall-detail-download:hover { text-decoration: underline; }

/* Thumbnail strip */
.amd-wall-detail-thumbstrip {
  display: flex;
  flex-wrap: wrap;
}
.amd-wall-detail-thumb {
  display: block;
  width: 12.5%;
  box-sizing: border-box;
  border-right: 1px solid rgba(0, 0, 0, 0.08);
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  overflow: hidden;
  line-height: 0;
  opacity: 0.65;
  transition: opacity 0.2s;
}
.amd-wall-detail-thumb:nth-child(8n) { border-right: none; }
.amd-wall-detail-thumb:hover { opacity: 1; }
.amd-wall-detail-thumb img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
}

@media (max-width: 1100px) {
  .amd-wall-detail-thumb { width: 25%; }
  .amd-wall-detail-thumb:nth-child(8n) { border-right: 1px solid rgba(0,0,0,0.08); }
  .amd-wall-detail-thumb:nth-child(4n) { border-right: none; }
}
@media (max-width: 600px) {
  .amd-wall-detail-thumb { width: 33.333%; }
  .amd-wall-detail-thumb:nth-child(4n) { border-right: 1px solid rgba(0,0,0,0.08); }
  .amd-wall-detail-thumb:nth-child(3n) { border-right: none; }
  .amd-wall-detail-plashka { flex-wrap: wrap; }
  .amd-wall-detail-navbtns { margin-left: 0; margin-top: 6px; }
}
