/**
 * WPNest Portfolio — frontend styles.
 * Theme-agnostic, system font stack, RWD via CSS Grid auto-fill.
 */

.wpnest-portfolio,
.wpnest-portfolio * {
  box-sizing: border-box;
  font-family:
    -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue",
    Arial, sans-serif;
}

.wpnest-portfolio__container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 32px 20px;
}

/* Archive header & filter */
.wpnest-portfolio__archive-header {
  margin-bottom: 32px;
}
.wpnest-portfolio__archive-title {
  font-size: 2.5rem;
  margin: 0 0 16px;
  line-height: 1.2;
}
.wpnest-portfolio__filter {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.wpnest-portfolio__filter-btn {
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  color: #334155;
  padding: 8px 16px;
  border-radius: 999px;
  cursor: pointer;
  font-size: 0.9rem;
  transition: all 0.15s;
}
.wpnest-portfolio__filter-btn:hover {
  background: #e2e8f0;
}
.wpnest-portfolio__filter-btn.is-active {
  background: #2271b1;
  border-color: #2271b1;
  color: #fff;
}

/* Grid */
.wpnest-portfolio__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
}
.wpnest-portfolio--shortcode .wpnest-portfolio__grid {
  grid-template-columns: repeat(
    auto-fill,
    minmax(calc(100% / var(--wpnest-portfolio-cols, 3) - 16px), 1fr)
  );
}

/* Card */
.wpnest-portfolio__card {
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
  transition:
    transform 0.2s,
    box-shadow 0.2s;
}
.wpnest-portfolio__card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(15, 23, 42, 0.12);
}
.wpnest-portfolio__card-link {
  display: block;
  text-decoration: none;
  color: inherit;
}
.wpnest-portfolio__card-thumb {
  position: relative;
  aspect-ratio: 16 / 10;
  background: #f1f5f9;
  overflow: hidden;
}
.wpnest-portfolio__card-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.wpnest-portfolio__card-thumb-placeholder {
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #e2e8f0, #cbd5e1);
}
.wpnest-portfolio__card-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  background: #2271b1;
  color: #fff;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
}
.wpnest-portfolio__card-body {
  padding: 20px;
}
.wpnest-portfolio__card-company {
  font-size: 0.85rem;
  color: #64748b;
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.wpnest-portfolio__card-title {
  font-size: 1.2rem;
  margin: 0 0 8px;
  color: #0f172a;
  line-height: 1.3;
}
.wpnest-portfolio__card-excerpt {
  color: #475569;
  font-size: 0.9rem;
  line-height: 1.5;
  margin: 0 0 12px;
}
.wpnest-portfolio__card-cats {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.wpnest-portfolio__card-cat {
  background: #f1f5f9;
  color: #475569;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.75rem;
}

/* Pagination */
.wpnest-portfolio__pagination {
  margin-top: 40px;
  display: flex;
  justify-content: center;
  gap: 6px;
}
.wpnest-portfolio__pagination .page-numbers {
  padding: 8px 14px;
  border-radius: 6px;
  background: #f1f5f9;
  color: #334155;
  text-decoration: none;
}
.wpnest-portfolio__pagination .page-numbers.current {
  background: #2271b1;
  color: #fff;
}

.wpnest-portfolio__empty {
  text-align: center;
  padding: 60px 20px;
  color: #64748b;
}

/* Single */
.wpnest-portfolio__single-header {
  margin-bottom: 24px;
}
.wpnest-portfolio__breadcrumb {
  font-size: 0.85rem;
  color: #64748b;
  margin-bottom: 12px;
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  row-gap: 4px;
}
.wpnest-portfolio__breadcrumb a {
  color: #2271b1;
  text-decoration: none;
}
.wpnest-portfolio__single-title {
  font-size: 2.5rem;
  margin: 0 0 8px;
  line-height: 1.2;
}
.wpnest-portfolio__single-company {
  color: #64748b;
  font-size: 1.05rem;
}
.wpnest-portfolio__single-company a {
  color: #2271b1;
  text-decoration: none;
}
.wpnest-portfolio__single-cover {
  display: flex;
  justify-content: center;
  margin: 24px 0;
  border-radius: 12px;
  overflow: hidden;
}
.wpnest-portfolio__single-cover img {
  width: 35vw;
  height: auto;
  display: block;
}
.wpnest-portfolio__single-content {
  padding: 40px 48px;
  background: var(--card, #fff);
  border: 1px solid var(--line, #ece5dc);
  border-radius: 18px;
  box-shadow:
    0 1px 0 rgba(26, 20, 16, 0.04),
    0 2px 6px rgba(26, 20, 16, 0.04);
  font-size: 17px;
  line-height: 1.75;
  color: var(--ink-2, #4a4138);
}
.wpnest-portfolio__single-content > * + * {
  margin-top: 18px;
}
.wpnest-portfolio__single-content h2,
.wpnest-portfolio__single-content h3,
.wpnest-portfolio__single-content h4 {
  color: var(--ink, #1a1410);
  letter-spacing: -0.02em;
  line-height: 1.2;
}
.wpnest-portfolio__single-content h2 {
  font-size: 30px;
}
.wpnest-portfolio__single-content h3 {
  font-size: 22px;
  margin-top: 36px;
}
.wpnest-portfolio__single-content h4 {
  font-size: 18px;
  margin-top: 28px;
}
.wpnest-portfolio__single-content a {
  color: var(--accent-text, #c64e08);
  text-decoration: underline;
}
.wpnest-portfolio__single-content a:hover {
  text-decoration: none;
}

@media (max-width: 720px) {
  .wpnest-portfolio__single-content {
    padding: 28px 22px;
    margin: 24px 16px;
  }
}

/* Gallery */
.wpnest-portfolio__gallery {
  margin: 32px 0;
}
.wpnest-portfolio__gallery-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
}
.wpnest-portfolio__gallery-link {
  display: block;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  border-radius: 8px;
  cursor: zoom-in;
}
.wpnest-portfolio__gallery-link img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.2s;
}
.wpnest-portfolio__gallery-link:hover img {
  transform: scale(1.05);
}

/* Testimonials */
.wpnest-portfolio__testimonials {
  margin: 48px 0;
  padding: 32px;
  background: #f8fafc;
  border-radius: 12px;
}
.wpnest-portfolio__testimonials h2 {
  margin: 0 0 20px;
  font-size: 1.5rem;
}
.wpnest-portfolio__testimonials-list {
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.wpnest-portfolio__testimonial {
  background: #fff;
  border-radius: 8px;
  padding: 24px 28px;
  border-left: 4px solid #2271b1;
  margin: 0;
}
.wpnest-portfolio__testimonial-quote {
  font-style: italic;
  color: #334155;
  margin: 0 0 12px;
  font-size: 1.05rem;
  line-height: 1.65;
}
.wpnest-portfolio__testimonial-meta {
  font-size: 0.9rem;
  color: #475569;
}

/* Related */
.wpnest-portfolio__related {
  margin-top: 48px;
}
.wpnest-portfolio__related h2 {
  margin-bottom: 20px;
  font-size: 1.5rem;
}

/* Lightbox */
.wpnest-portfolio__lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.9);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 99999;
  padding: 20px;
}
.wpnest-portfolio__lightbox.is-open {
  display: flex;
}
.wpnest-portfolio__lightbox-img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 8px;
}
.wpnest-portfolio__lightbox-close {
  position: absolute;
  top: 20px;
  right: 20px;
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: #fff;
  font-size: 2rem;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  cursor: pointer;
  line-height: 1;
}
.wpnest-portfolio__lightbox-close:hover {
  background: rgba(255, 255, 255, 0.2);
}
body.wpnest-portfolio-lightbox-open {
  overflow: hidden;
}

/* Mobile responsive */
@media (max-width: 640px) {
  .wpnest-portfolio__archive-title,
  .wpnest-portfolio__single-title {
    font-size: 1.75rem;
  }
  .wpnest-portfolio__container {
    padding: 20px 16px;
  }
  .wpnest-portfolio__testimonials {
    padding: 20px;
  }
}
