/* Hide WhatsApp widget from main plugin on portfolio list page */
#sweetaddons-whatsapp-widget {
  display: none !important;
}

.site-main {
  max-width: 100% !important;
  width: 100%;
}

.content-area {
  padding-top: 0;
  margin-top: 0;
}

/* ============ mobbin/DESIGN.md tokens (gallery-white monochrome) ============ */
.portfolio-container {
  --sp-primary: #141414;
  --sp-primary-active: #262626;
  --sp-primary-disabled: #e0e0e0;
  --sp-ink: #141414;
  --sp-body: #141414;
  --sp-body-strong: #141414;
  --sp-muted: #707070;
  --sp-muted-soft: #adadad;
  --sp-hairline: #e0e0e0;
  --sp-hairline-soft: #f0f0f0;
  --sp-canvas: #ffffff;
  --sp-surface-soft: #f3f3f3;
  --sp-surface-card: #ffffff;
  --sp-surface-cream-strong: #f0f0f0;
  --sp-surface-dark: #141414;
  --sp-surface-dark-elevated: #262626;
  --sp-on-primary: #ffffff;
  --sp-on-dark: #ffffff;
  --sp-on-dark-soft: #adadad;
  --sp-field: #f0f0f0;
  --sp-accent: #0066ff;
}

/* ============ Base (canvas + Saans substitute: Inter) ============ */
.portfolio-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 40px 24px 56px;
  background: var(--sp-canvas);
  color: var(--sp-body);
  font-family:
    Inter,
    -apple-system,
    "Helvetica Neue",
    Arial,
    sans-serif;
  font-size: 16px;
  line-height: 1.38;
}

.portfolio-shell {
  display: flex;
  flex-direction: column;
  gap: 32px;
}

/* ============ Badges (button-pill-soft + badge-overlay) ============ */
.portfolio-results-kicker,
.card-meta-pill,
.portfolio-badge-muted {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  min-height: 30px;
  padding: 4px 12px;
  border-radius: 10px;
  background: var(--sp-surface-soft);
  border: 0;
  color: var(--sp-ink);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.33;
}

/* ============ Headlines (Saans 652 substitute: 650, tight, zero tracking) ============ */
.portfolio-results-title,
.portfolio-empty-title {
  font-family:
    Inter,
    -apple-system,
    "Helvetica Neue",
    Arial,
    sans-serif;
  font-weight: 650;
  letter-spacing: 0;
  color: var(--sp-ink);
  margin: 0;
}

/* ============ Filter (pricing-card + segmented-control) ============ */
.filter-section {
  margin-bottom: 0;
  padding: 16px;
  border: 1px solid var(--sp-hairline-soft);
  border-radius: 12px;
  background: var(--sp-canvas);
}

.portfolio-tabs {
  display: flex;
  flex-wrap: nowrap;
  gap: 4px;
  padding: 4px;
  border-radius: 12px;
  background: var(--sp-surface-soft);
  overflow-x: auto;
  overflow-y: hidden;
  max-width: 100%;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}

.portfolio-tab {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--sp-muted);
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.4;
  min-height: 40px;
  padding: 8px 16px;
  border-radius: 8px;
  cursor: pointer;
  flex: 0 0 auto;
  white-space: nowrap;
  transition:
    background-color 0.2s ease,
    color 0.2s ease;
}

.portfolio-tab:hover {
  color: var(--sp-ink);
}

.portfolio-tab.is-active {
  background: var(--sp-canvas);
  color: var(--sp-ink);
  box-shadow: 0 1px 2px rgba(20, 20, 20, 0.08);
}

.portfolio-tab:focus-visible {
  outline: 2px solid var(--sp-primary);
  outline-offset: 2px;
}

.filter-row {
  display: flex;
  gap: 15px;
  margin-bottom: 0;
  flex-wrap: wrap;
}

.filter-group {
  flex: 1;
  min-width: 200px;
}

.portfolio-filter-label {
  display: block;
  margin-bottom: 10px;
  color: var(--sp-body-strong);
  font-size: 14px;
  font-weight: 500;
}

.filter-select {
  width: 100%;
  height: 40px;
  padding: 12px 16px;
  border: 1px solid transparent;
  border-radius: 8px;
  font-family: inherit;
  font-size: 16px;
  background-color: var(--sp-field);
  color: var(--sp-ink);
}

.filter-select::placeholder {
  color: var(--sp-muted-soft);
  opacity: 1;
}

.filter-select:focus {
  outline: none;
  border-color: var(--sp-ink);
  box-shadow: 0 0 0 2px var(--sp-ink);
}

/* ============ Results bar ============ */
.portfolio-results-bar {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 24px;
}

.portfolio-results-title {
  margin-top: 10px;
  font-size: 44px;
  line-height: 1.13;
}

.portfolio-results-summary {
  font-size: 14px;
  font-weight: 500;
  color: var(--sp-muted);
}

/* ============ Empty state (ex-empty-state-card) ============ */
.portfolio-empty-state {
  padding: 48px 32px;
  border: 0;
  border-radius: 12px;
  background: var(--sp-surface-soft);
  text-align: center;
}

.portfolio-empty-title {
  margin-top: 18px;
  font-size: 32px;
  line-height: 1.13;
}

.portfolio-empty-text {
  max-width: 56ch;
  margin: 14px auto 0;
  color: var(--sp-muted);
  line-height: 1.43;
  font-size: 14px;
}

/* ============ Grid (3-up / 2-up / 1-up) ============ */
.frame-portofolio {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
  margin-bottom: 8px;
}

.col-portofolio {
  width: 100%;
  min-width: 0;
  position: relative;
}

/* ============ Card (pricing-card: white fill, hairline-soft outline, md) ============ */
.card-portofolio {
  display: flex;
  flex-direction: column;
  width: 100%;
  min-width: 0;
  height: 100%;
  position: relative;
  background: var(--sp-surface-card);
  border: 1px solid var(--sp-hairline-soft);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: none;
  transition:
    transform 0.25s ease,
    border-color 0.25s ease,
    background-color 0.25s ease;
}

.card-portofolio:hover {
  transform: none;
  border-color: var(--sp-hairline);
  background: var(--sp-canvas);
  box-shadow: none;
}

.card-image {
  position: relative;
  overflow: hidden;
  aspect-ratio: 16 / 11;
  width: 100%;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--sp-surface-cream-strong);
}

.card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  position: absolute;
  top: 0;
  left: 0;
  transition: transform 0.3s ease;
}

.card-portofolio:hover .card-image img {
  transform: scale(1.02);
}

.card-image::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 45%;
  background: linear-gradient(
    180deg,
    rgba(20, 20, 20, 0) 0%,
    rgba(20, 20, 20, 0.72) 100%
  );
  z-index: 1;
  pointer-events: none;
}

.card-credit {
  position: absolute;
  top: 16px;
  left: 16px;
  z-index: 3;
  padding: 4px 12px;
  border-radius: 8px;
  background: rgba(115, 115, 115, 0.56);
  color: var(--sp-on-dark);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.33;
}

/* Card actions over image */
.card-actions {
  position: absolute;
  top: auto;
  bottom: 14px;
  left: 14px;
  right: 14px;
  width: auto;
  height: auto;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  background: transparent;
  opacity: 1;
  pointer-events: auto;
  box-sizing: border-box;
  padding: 0;
  z-index: 3;
}

/* ============ Buttons (button-primary + button-outline, stadium pills) ============ */
.btn-preview,
.btn-whatsapp {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 36px;
  padding: 8px 14px;
  border-radius: 10px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.4;
  text-decoration: none;
  cursor: pointer;
  position: relative;
  z-index: 3;
  transition:
    background-color 0.2s ease,
    color 0.2s ease,
    border-color 0.2s ease,
    transform 0.2s ease;
}

/* Primary ink CTA */
.btn-preview,
.card-portofolio .card-actions .btn-preview,
.card-portofolio .card-actions a.btn-preview:link,
.card-portofolio .card-actions a.btn-preview:visited,
.card-portofolio .card-actions a.btn-preview:hover,
.card-portofolio .card-actions a.btn-preview:active {
  background-color: #141414 !important;
  background-image: none !important;
  color: #ffffff !important;
  border: 1px solid #141414 !important;
  white-space: nowrap;
  opacity: 1 !important;
  text-decoration: none !important;
  text-shadow: none !important;
  -webkit-text-fill-color: #ffffff !important;
}

.btn-preview svg,
.btn-whatsapp svg {
  flex-shrink: 0;
  width: 14px;
  height: 14px;
  color: inherit;
  fill: currentColor;
}

.card-portofolio .card-actions .btn-preview:hover {
  background-color: #262626 !important;
  border-color: #262626 !important;
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
  transform: none;
}

/* Outline twin on light card */
.btn-whatsapp {
  background-color: var(--sp-canvas);
  color: var(--sp-ink);
  border: 1px solid var(--sp-hairline);
}

.btn-whatsapp:hover {
  background-color: var(--sp-surface-soft);
  border-color: var(--sp-hairline);
  color: var(--sp-ink);
  transform: none;
}

/* ============ Card body ============ */
.card-content {
  display: flex;
  flex: 1;
  min-width: 0;
  flex-direction: column;
  gap: 8px;
  padding: 20px;
}

.card-meta-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.card-meta-text {
  color: var(--sp-muted);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.33;
}

.card-title {
  margin: 0;
  min-width: 0;
  max-width: 100%;
  font-family: inherit;
  font-size: 20px;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-title-link {
  color: var(--sp-ink);
  text-decoration: none;
  transition: color 0.2s ease;
  display: block;
  min-width: 0;
  max-width: 100%;
  font-size: inherit;
  font-family: inherit;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-title-link:hover {
  color: var(--sp-primary);
  text-decoration: none;
}

.card-excerpt {
  font-size: 16px;
  color: var(--sp-body);
  margin: 0;
  line-height: 1.38;
}

/* Inline body link */
.card-content a:not(.card-title-link):not(.btn-preview):not(.btn-whatsapp) {
  color: var(--sp-primary);
}

/* ============ Pagination ============ */
.pagination {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-top: 8px;
  flex-wrap: wrap;
}

.pagination-pages {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  flex: 1;
}

.pagination-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  padding: 10px 14px;
  border: 1px solid var(--sp-hairline);
  background: var(--sp-canvas);
  color: var(--sp-ink);
  border-radius: 10px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  user-select: none;
  transition:
    background-color 0.2s ease,
    border-color 0.2s ease;
}

.pagination-btn:hover:not(.disabled):not(.active) {
  background: var(--sp-surface-soft);
  border-color: var(--sp-hairline);
}

.pagination-btn.active {
  background: var(--sp-primary);
  color: var(--sp-on-primary);
  border-color: var(--sp-primary);
}

.pagination-btn.disabled {
  background: var(--sp-surface-soft);
  color: var(--sp-muted);
  opacity: 1;
  cursor: not-allowed;
  pointer-events: none;
}

.pagination-info {
  text-align: center;
  font-size: 14px;
  color: var(--sp-muted);
  margin: 0;
}

/* ============ Alerts (monochrome ladder, no semantic palette) ============ */
.alert {
  padding: 18px 20px;
  margin-bottom: 20px;
  border: 1px solid transparent;
  border-radius: 8px;
  font-size: 16px;
}

.alert-warning {
  color: var(--sp-ink);
  background-color: var(--sp-surface-soft);
  border-color: var(--sp-hairline);
}

.alert-danger {
  color: var(--sp-on-primary);
  background-color: var(--sp-ink);
  border-color: var(--sp-ink);
}

/* ============ Responsive ============ */
@media screen and (max-width: 1024px) {
  .frame-portofolio {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media screen and (max-width: 767px) {
  .portfolio-container {
    padding: 24px 16px 40px;
  }

  .portfolio-shell {
    gap: 24px;
  }

  .filter-section {
    padding: 16px;
  }

  .portfolio-empty-state {
    padding: 24px;
  }

  .card-content {
    padding: 16px;
  }

  .filter-row {
    flex-direction: column;
    gap: 10px;
  }

  .portfolio-results-bar,
  .pagination {
    flex-direction: column;
    align-items: stretch;
  }

  .portfolio-results-summary {
    text-align: left;
  }

  .portfolio-results-title {
    font-size: 32px;
  }

  .frame-portofolio {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .card-actions {
    left: 14px;
    right: 14px;
    bottom: 14px;
    flex-wrap: wrap;
  }

  .btn-preview,
  .btn-whatsapp,
  .pagination-btn {
    width: 100%;
    justify-content: center;
  }

  .pagination {
    gap: 5px;
  }

  .pagination-pages {
    width: 100%;
  }

  .pagination-info {
    width: 100%;
    font-size: 12px;
    margin: 10px 0;
  }
}

/* Preview Page Styles */
.wss-preview-page {
  overflow: hidden !important;
  height: 100vh;
}
.wss-preview-page .card-credit {
  position: absolute;
  left: 0;
  bottom: 5.5%;
  background: rgba(115, 115, 115, 0.56);
  color: var(--sp-on-dark);
  padding: 4px 12px;
  border-radius: 0 8px 8px 0;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.33;
}

.wss-preview-page .page-template-page-preview-php .whatsapp-floating {
  display: none !important;
}

/* Force show modal class for fallback */
.modal-force-show {
  display: block !important;
  opacity: 1 !important;
  visibility: visible !important;
  z-index: 9999 !important;
}
