﻿.pcm-search-shell {
  order: 3;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  position: relative;
}

.pcm-search-shell .search-btn {
  margin-left: 0;
  transform: none;
  flex: 0 0 auto;
}

.pcm-search-shell .search-btn svg {
  width: 24px;
  height: 24px;
}

.pcm-search-expand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 12px;
  background: rgba(19, 43, 71, 0.92);
  overflow: hidden;
  max-width: 0;
  opacity: 0;
  transform: translateX(10px);
  transition: max-width 260ms ease, opacity 180ms ease, transform 260ms ease;
  pointer-events: none;
}

.pcm-search-shell.is-open .pcm-search-expand {
  max-width: 440px;
  opacity: 1;
  transform: translateX(0);
  pointer-events: auto;
}

.pcm-search-expand__icon {
  color: #d7ecff;
  margin-left: 12px;
  flex: 0 0 auto;
}

.pcm-search-expand__input {
  width: 320px;
  min-width: 0;
  border: none;
  outline: none;
  background: transparent;
  color: #f1f8ff;
  font-weight: 700;
  font-size: 0.97rem;
  padding: 11px 0;
}

.pcm-search-expand__input::placeholder {
  color: #a9c6df;
}

.pcm-search-expand__clear {
  border: none;
  background: transparent;
  color: #f1f8ff;
  width: 38px;
  height: 38px;
  cursor: pointer;
  font-size: 1.5rem;
  line-height: 1;
  margin-right: 2px;
}

.pcm-search-page {
  padding: 18px 0 28px;
}

.pcm-search-page[hidden] {
  display: none !important;
}

body.search-mode .hero,
body.search-mode #rows {
  display: none;
}
body.search-mode {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
body.search-mode .pcm-search-page {
  flex: 1 1 auto;
}
body.search-mode .site-footer {
  margin-top: auto;
}

.pcm-search-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin: 10px 0 16px;
}

.pcm-search-title {
  margin: 0;
  font-size: clamp(1.2rem, 2vw, 1.6rem);
}

.pcm-search-subtitle {
  margin: 0;
  color: #c8dcf5;
  font-weight: 700;
}

.pcm-search-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
}

.pcm-search-card {
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 12px;
  overflow: hidden;
  background: rgba(9, 22, 43, 0.75);
  cursor: pointer;
  transition: transform 150ms ease, box-shadow 150ms ease, border-color 150ms ease;
}

.pcm-search-card:hover {
  transform: translateY(-2px);
  border-color: rgba(158, 225, 255, 0.72);
  box-shadow: 0 14px 24px rgba(0, 0, 0, 0.35);
}

.pcm-search-thumb {
  aspect-ratio: 16 / 9;
  background: #142946;
}

.pcm-search-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.pcm-search-meta {
  padding: 9px 10px 10px;
}

.pcm-search-meta__title {
  margin: 0;
  color: #ecf5ff;
  font-weight: 800;
  font-size: 0.95rem;
  line-height: 1.35;
  min-height: 2.7em;
}

.pcm-search-meta__sub {
  margin-top: 4px;
  color: #b8d0ea;
  font-size: 0.82rem;
  font-weight: 700;
}

.pcm-search-mark {
  color: #ffffff;
  background: rgba(43, 78, 93, 0.95);
  border-radius: 4px;
  padding: 0 2px;
}

.pcm-search-empty,
.pcm-search-error {
  border: 1px dashed rgba(255, 255, 255, 0.22);
  border-radius: 12px;
  padding: 22px;
  color: #d7e8fa;
  text-align: center;
  font-weight: 700;
  background: rgba(12, 28, 53, 0.55);
}

.pcm-search-loading {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
}

.pcm-search-skeleton {
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  overflow: hidden;
  background: rgba(10, 25, 48, 0.7);
}

.pcm-search-skeleton__thumb {
  aspect-ratio: 16 / 9;
  background: linear-gradient(110deg, rgba(32, 57, 90, 0.55) 8%, rgba(60, 92, 133, 0.72) 18%, rgba(32, 57, 90, 0.55) 33%);
  background-size: 200% 100%;
  animation: pcmSearchShimmer 1.2s linear infinite;
}

.pcm-search-skeleton__line {
  height: 12px;
  margin: 10px;
  border-radius: 999px;
  background: linear-gradient(110deg, rgba(32, 57, 90, 0.55) 8%, rgba(60, 92, 133, 0.72) 18%, rgba(32, 57, 90, 0.55) 33%);
  background-size: 200% 100%;
  animation: pcmSearchShimmer 1.2s linear infinite;
}

.pcm-search-skeleton__line.short {
  width: 60%;
}

.pcm-search-sentinel {
  height: 1px;
}

@keyframes pcmSearchShimmer {
  to {
    background-position-x: -200%;
  }
}

@media (max-width: 760px) {
  .pcm-search-shell {
    position: absolute;
    right: 16px;
    top: auto;
    bottom: 0;
    z-index: 4;
    width: auto;
    order: 4;
    justify-content: flex-end;
    margin-top: 0;
  }

  .pcm-search-shell .search-btn {
    transform: none !important;
    margin-right: 0;
    width: 24px;
    height: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .pcm-search-expand {
    position: relative;
    width: 100%;
    max-width: 0;
  }

  .pcm-search-shell.is-open {
    position: static;
    width: 100%;
    order: 1;
    justify-content: flex-start;
    margin-top: 2px;
  }

  .pcm-search-shell.is-open .search-btn {
    margin-right: 6px;
  }

  .pcm-search-shell.is-open .pcm-search-expand {
    max-width: 100%;
  }

  .pcm-search-expand__input {
    width: 100%;
  }

  .pcm-search-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .pcm-search-meta__title {
    font-size: 0.88rem;
  }
}
