/* =========================================================================
   Elegensoft — Portfolio Page Styles (Modular Dedicated Stylesheet)
   Brand Tokens: --primary (#FF6200), --secondary (#151432)
   Design System: Apple Human Interface Guidelines (HIG 2026)
   Centralized, Balanced Layout Matching Homepage Design
   ========================================================================= */

/* ─── Hero / Header Section (Centered Layout) ───────────────────────────── */

.pf-header-section {
  padding: calc(var(--header-height) + var(--header-offset-top) + var(--safe-top) + 40px) 0 40px;
  background: linear-gradient(180deg, #f8fafc 0%, #ffffff 70%, #f4f6fa 100%);
  border-bottom: 1px solid rgba(21, 20, 50, 0.06);
  position: relative;
  overflow: hidden;
}

/* Subtle ambient backdrop glow */
.pf-header-section::before {
  content: "";
  position: absolute;
  top: -100px;
  left: 50%;
  transform: translateX(-50%);
  width: 680px;
  height: 380px;
  background: radial-gradient(circle, rgba(255, 98, 0, 0.06) 0%, rgba(21, 20, 50, 0.03) 50%, transparent 70%);
  filter: blur(60px);
  pointer-events: none;
  z-index: 0;
}

.pf-header-section .container {
  position: relative;
  z-index: 1;
}

.pf-header-content {
  text-align: center;
  margin: 0 auto 36px;
  max-width: 780px;
}

.pf-badge-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 16px;
  font-size: 13px;
  font-weight: 700;
  color: var(--primary, #FF6200);
  background: var(--primary-subtle, #fff4ed);
  border: 1px solid rgba(255, 98, 0, 0.2);
  border-radius: var(--radius-pill, 9999px);
  margin-bottom: 16px;
  letter-spacing: 0.2px;
}

.pf-page-title {
  font-size: clamp(34px, 4.4vw, 52px);
  font-weight: 800;
  color: var(--text-dark, #151432);
  letter-spacing: -1.5px;
  line-height: 1.15;
  margin-bottom: 16px;
}

.pf-page-subtitle {
  font-size: 16px;
  color: var(--text-body, #3c3b58);
  line-height: 1.65;
  max-width: 620px;
  margin: 0 auto;
}

/* ─── Centered Category Filter Tabs (Pill System) ───────────────────────── */

.pf-filter-tabs {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 28px;
  flex-wrap: wrap;
}

.pf-tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 10px 20px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-body, #3c3b58);
  background: #ffffff;
  border: 1px solid rgba(21, 20, 50, 0.08);
  border-radius: var(--radius-pill, 9999px);
  cursor: pointer;
  transition: all 220ms cubic-bezier(0.23, 1, 0.32, 1);
  box-shadow: 0 2px 8px -1px rgba(21, 20, 50, 0.03);
}

.pf-tab svg {
  color: #71708a;
  transition: color 200ms ease;
}

.pf-tab:hover {
  background: #f4f6fb;
  color: var(--text-dark, #151432);
  border-color: rgba(21, 20, 50, 0.14);
}

.pf-tab.active {
  background: var(--primary, #FF6200);
  color: #ffffff;
  border-color: var(--primary, #FF6200);
  box-shadow: 0 4px 14px rgba(255, 98, 0, 0.28);
}

.pf-tab.active svg {
  color: #ffffff;
}

.pf-tab:active {
  transform: scale(0.97);
}

/* ─── Centered Toolbar: Search + Sort ───────────────────────────────────── */

.pf-toolbar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
  max-width: 720px;
  margin: 0 auto;
}

.pf-search-wrap {
  position: relative;
  flex: 1;
  min-width: 260px;
  max-width: 440px;
}

.pf-search-icon {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: #9ca3af;
  pointer-events: none;
}

.pf-search-input {
  width: 100%;
  height: 44px;
  padding: 10px 18px 10px 44px;
  font-size: 14.5px;
  color: var(--text-dark, #151432);
  background: #ffffff;
  border: 1px solid rgba(21, 20, 50, 0.12);
  border-radius: var(--radius-pill, 9999px);
  transition: all 200ms ease;
  outline: none;
  box-shadow: 0 2px 6px rgba(21, 20, 50, 0.03);
}

.pf-search-input:focus {
  border-color: var(--primary, #FF6200);
  box-shadow: 0 0 0 3px rgba(255, 98, 0, 0.12);
}

.pf-sort-wrap {
  position: relative;
  flex-shrink: 0;
}

.pf-sort-select {
  height: 44px;
  padding: 10px 36px 10px 18px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text-body, #3c3b58);
  background: #ffffff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2371708a' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E") no-repeat calc(100% - 14px) center;
  border: 1px solid rgba(21, 20, 50, 0.12);
  border-radius: var(--radius-pill, 9999px);
  cursor: pointer;
  outline: none;
  appearance: none;
  -webkit-appearance: none;
  transition: all 200ms ease;
  box-shadow: 0 2px 6px rgba(21, 20, 50, 0.03);
}

.pf-sort-select:focus {
  border-color: var(--primary, #FF6200);
}


/* ─── Grid Section (Centralized & Contained) ─────────────────────────────── */

.pf-grid-section {
  padding: 64px 0 96px;
  background: #fbfbfe;
  min-height: 600px;
}

.pf-product-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 30px;
}

/* ─── Premium Portfolio Card (Apple HIG Squircle) ────────────────────────── */

.pf-card {
  background: #ffffff;
  border-radius: var(--radius-lg, 20px);
  border: 1px solid rgba(21, 20, 50, 0.08);
  box-shadow: 0 4px 18px -2px rgba(21, 20, 50, 0.05), 0 2px 6px -1px rgba(21, 20, 50, 0.02);
  overflow: hidden;
  transition: 
    transform 320ms cubic-bezier(0.23, 1, 0.32, 1),
    box-shadow 320ms cubic-bezier(0.23, 1, 0.32, 1),
    border-color 250ms ease;
  display: flex;
  flex-direction: column;
}

.pf-card:hover {
  transform: translateY(-6px);
  border-color: rgba(255, 98, 0, 0.28);
  box-shadow: 
    0 18px 38px -6px rgba(21, 20, 50, 0.10),
    0 8px 16px -4px rgba(255, 98, 0, 0.06);
}

.pf-card-inner {
  display: flex;
  flex-direction: column;
  height: 100%;
  text-decoration: none;
  color: inherit;
}

/* Card Thumbnail */
.pf-card-thumb {
  position: relative;
  width: 100%;
  height: 210px;
  overflow: hidden;
  background: #f1f4f9;
}

.pf-card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 450ms cubic-bezier(0.23, 1, 0.32, 1);
}

.pf-card:hover .pf-card-thumb img {
  transform: scale(1.05);
}

.pf-badge-top {
  position: absolute;
  top: 14px;
  right: 14px;
  background: rgba(21, 20, 50, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: #ffffff;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: var(--radius-pill, 9999px);
  z-index: 1;
  letter-spacing: 0.2px;
}

/* Card Content */
.pf-card-content {
  padding: 22px 24px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.pf-card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.pf-card-client {
  font-size: 12.5px;
  font-weight: 600;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.pf-card-rating {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 12.5px;
  font-weight: 700;
  color: #d97706;
  font-variant-numeric: tabular-nums;
}

.pf-card-name {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-dark, #151432);
  line-height: 1.35;
  margin-bottom: 8px;
  letter-spacing: -0.4px;
  transition: color 200ms ease;
}

.pf-card:hover .pf-card-name {
  color: var(--primary, #FF6200);
}

.pf-card-desc {
  font-size: 13.5px;
  color: var(--text-body, #3c3b58);
  line-height: 1.55;
  margin-bottom: 16px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Tech Tags */
.pf-card-tech {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 18px;
}

.pf-tech-pill {
  font-size: 11px;
  font-weight: 600;
  color: #475569;
  background: #f1f5f9;
  padding: 3px 8px;
  border-radius: 6px;
}

/* Card Footer Action */
.pf-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px solid rgba(21, 20, 50, 0.06);
}

.pf-category-pill {
  display: inline-block;
  padding: 4px 10px;
  font-size: 11.5px;
  font-weight: 700;
  border-radius: var(--radius-pill, 9999px);
}

.pill-web {
  background: #eff6ff;
  color: #2563eb;
}

.pill-mobile {
  background: #f0fdf4;
  color: #16a34a;
}

.pill-ai {
  background: #f5f3ff;
  color: #7c3aed;
}

.pill-cloud {
  background: #fffbeb;
  color: #d97706;
}

.pf-preview-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 13px;
  font-weight: 600;
  color: var(--primary, #FF6200);
  transition: all 180ms ease;
}

.pf-preview-link svg {
  transition: transform 180ms ease;
}

.pf-card:hover .pf-preview-link svg {
  transform: translateX(3px);
}

/* Results Info */
.pf-results-info {
  margin-top: 40px;
  text-align: center;
  font-size: 14px;
  color: var(--text-muted, #71708a);
}

.pf-results-info strong {
  color: var(--text-dark, #151432);
}


/* ─── Centered Pagination (Apple 44pt Touch Targets) ─────────────────────── */

.pf-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 48px;
}

.pf-page-num,
.pf-page-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 600;
  color: var(--text-body, #3c3b58);
  background: #ffffff;
  border: 1px solid rgba(21, 20, 50, 0.08);
  text-decoration: none;
  transition: all 220ms cubic-bezier(0.23, 1, 0.32, 1);
  font-variant-numeric: tabular-nums;
  font-feature-settings: 'tnum';
  box-shadow: 0 2px 6px -1px rgba(21, 20, 50, 0.03);
}

.pf-page-num:hover,
.pf-page-btn:hover:not(.disabled) {
  color: var(--text-dark, #151432);
  background: #f4f6fb;
  border-color: rgba(21, 20, 50, 0.16);
}

.pf-page-num.active {
  background: var(--primary, #FF6200);
  color: #ffffff;
  border-color: var(--primary, #FF6200);
  box-shadow: 0 4px 14px rgba(255, 98, 0, 0.3);
}

.pf-page-num:active,
.pf-page-btn:active {
  transform: scale(0.97);
}

.pf-page-btn.disabled {
  opacity: 0.35;
  pointer-events: none;
  background: #f8fafc;
}


/* ─── Responsive Media Queries ───────────────────────────────────────────── */

@media (max-width: 1100px) {
  .pf-product-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
  }
}

@media (max-width: 768px) {
  .pf-page-title {
    font-size: clamp(28px, 6vw, 36px);
  }

  .pf-page-subtitle {
    font-size: 15px;
  }

  .pf-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .pf-search-wrap {
    max-width: 100%;
  }

  .pf-sort-select {
    width: 100%;
  }

  .pf-product-grid {
    grid-template-columns: 1fr;
    gap: 22px;
  }

  .pf-card-thumb {
    height: 190px;
  }

  .pf-filter-tabs {
    gap: 8px;
  }

  .pf-tab {
    min-height: 40px;
    padding: 8px 16px;
    font-size: 13px;
  }
}

/* ─── Reduced Motion ─────────────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .pf-card {
    transition: none;
  }

  .pf-card:hover {
    transform: none;
  }

  .pf-card-thumb img {
    transition: none;
  }

  .pf-card:hover .pf-card-thumb img {
    transform: none;
  }
}

/* =========================================================================
   Single Portfolio Detail View (.pfd-*)
   Apple HIG & Elegensoft Design System Matching
   ========================================================================= */

.pfd-view {
  min-height: 80vh;
  padding: calc(var(--header-height) + var(--header-offset-top) + var(--safe-top) + 40px) 0 90px;
  background: linear-gradient(180deg, #f8fafc 0%, #ffffff 40%, #f4f6fa 100%);
  position: relative;
}

.pfd-container {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 24px;
}

.pfd-breadcrumb {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--secondary-muted, #71708a);
  margin-bottom: 24px;
}

.pfd-breadcrumb a {
  color: var(--secondary-muted, #71708a);
  text-decoration: none;
  transition: color 0.18s ease;
}

.pfd-breadcrumb a:hover {
  color: var(--primary, #FF6200);
}

.pfd-header {
  margin-bottom: 36px;
}

.pfd-meta-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.pfd-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #fff4ed;
  color: var(--primary, #FF6200);
  font-size: 12.5px;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 9999px;
  border: 1px solid rgba(255, 98, 0, 0.2);
}

.pfd-client {
  font-size: 14px;
  font-weight: 600;
  color: var(--secondary-muted, #71708a);
}

.pfd-title {
  font-size: clamp(30px, 4.5vw, 48px);
  font-weight: 800;
  color: var(--secondary, #151432);
  letter-spacing: -1.2px;
  line-height: 1.18;
  margin-bottom: 16px;
}

.pfd-summary {
  font-size: clamp(16px, 1.8vw, 18px);
  color: var(--text-body, #3c3b58);
  line-height: 1.65;
  max-width: 860px;
  margin-bottom: 20px;
}

.pfd-btn-live {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 22px;
  border-radius: 9999px;
  background: #ffffff;
  color: var(--primary, #FF6200);
  border: 1px solid rgba(255, 98, 0, 0.3);
  font-weight: 700;
  font-size: 14px;
  text-decoration: none;
  box-shadow: 0 2px 10px rgba(255, 98, 0, 0.08);
  transition: all 0.2s ease;
}

.pfd-btn-live:hover {
  background: var(--primary, #FF6200);
  color: #ffffff;
  transform: translateY(-2px);
  box-shadow: 0 6px 18px var(--primary-glow, rgba(255, 98, 0, 0.25));
}

.pfd-hero-media {
  width: 100%;
  border-radius: 20px;
  overflow: hidden;
  border: 1px solid rgba(21, 20, 50, 0.08);
  box-shadow: 0 20px 48px -12px rgba(21, 20, 50, 0.12);
  margin-bottom: 40px;
  background: #f1f3f7;
}

.pfd-hero-media img {
  width: 100%;
  height: auto;
  max-height: 520px;
  object-fit: cover;
  display: block;
}

.pfd-specs-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 40px;
}

.pfd-spec-card {
  background: #ffffff;
  border: 1px solid rgba(21, 20, 50, 0.08);
  border-radius: 14px;
  padding: 20px 16px;
  text-align: center;
  box-shadow: 0 4px 16px -2px rgba(21, 20, 50, 0.04);
}

.pfd-spec-label {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  color: #64748b;
  margin-bottom: 4px;
}

.pfd-spec-val {
  font-size: 16px;
  font-weight: 700;
  color: var(--secondary, #151432);
}

.pfd-content-card {
  background: #ffffff;
  border: 1px solid rgba(21, 20, 50, 0.08);
  border-radius: 20px;
  padding: 40px;
  margin-bottom: 40px;
  box-shadow: 0 4px 20px rgba(21, 20, 50, 0.03);
}

/* Editorial Gutenberg Content Formatting */
.pfd-editorial-content {
  font-size: 16px;
  line-height: 1.85;
  color: var(--text-body, #3c3b58);
}

.pfd-editorial-content h2 {
  font-size: 24px;
  font-weight: 800;
  color: var(--secondary, #151432);
  margin-top: 36px;
  margin-bottom: 16px;
  letter-spacing: -0.5px;
}

.pfd-editorial-content h2:first-child {
  margin-top: 0;
}

.pfd-editorial-content h3 {
  font-size: 20px;
  font-weight: 700;
  color: var(--secondary, #151432);
  margin-top: 28px;
  margin-bottom: 12px;
}

.pfd-editorial-content p {
  margin-bottom: 20px;
}

.pfd-editorial-content ul,
.pfd-editorial-content ol {
  margin: 16px 0 24px 24px;
  padding: 0;
}

.pfd-editorial-content li {
  margin-bottom: 8px;
  line-height: 1.7;
}

.pfd-editorial-content blockquote {
  margin: 28px 0;
  padding: 20px 24px;
  border-left: 4px solid var(--primary, #FF6200);
  background: #fdf8f4;
  border-radius: 0 12px 12px 0;
  font-style: italic;
  color: var(--secondary, #151432);
}

.pfd-editorial-content code {
  background: #f1f3f7;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.9em;
  color: var(--secondary, #151432);
}

.pfd-editorial-content pre {
  background: #151432;
  color: #f8fafc;
  padding: 20px;
  border-radius: 12px;
  overflow-x: auto;
  margin: 24px 0;
}

.pfd-editorial-content pre code {
  background: transparent;
  color: inherit;
  padding: 0;
}

.pfd-editorial-content img {
  max-width: 100%;
  height: auto;
  border-radius: 12px;
  margin: 24px 0;
}

.pfd-tech-section {
  margin-bottom: 32px;
  padding-bottom: 24px;
  border-bottom: 1px solid rgba(21, 20, 50, 0.08);
}

.pfd-tech-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.pfd-tech-pill {
  font-size: 13px;
  font-weight: 600;
  padding: 6px 14px;
  background: #f8f8fc;
  border: 1px solid rgba(21, 20, 50, 0.08);
  border-radius: 9999px;
  color: var(--secondary, #151432);
}

.pfd-actions-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  padding-top: 24px;
  border-top: 1px solid rgba(21, 20, 50, 0.08);
}

.pfd-btn-back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: 9999px;
  background: #f8f8fc;
  border: 1px solid rgba(21, 20, 50, 0.1);
  color: var(--secondary, #151432);
  font-weight: 600;
  font-size: 14.5px;
  text-decoration: none;
  transition: all 0.2s ease;
}

.pfd-btn-back:hover {
  background: #ffffff;
  color: var(--primary, #FF6200);
  border-color: var(--primary, #FF6200);
  transform: translateX(-3px);
}

.pfd-btn-talk {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 28px;
  border-radius: 9999px;
  background: var(--primary, #FF6200);
  color: #ffffff;
  font-weight: 700;
  font-size: 14.5px;
  text-decoration: none;
  box-shadow: 0 6px 20px var(--primary-glow, rgba(255, 98, 0, 0.35));
  transition: all 0.2s ease;
}

.pfd-btn-talk:hover {
  background: var(--primary-hover, #e05600);
  transform: scale(1.03);
}

@media (max-width: 768px) {
  .pfd-specs-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .pfd-content-card {
    padding: 24px 20px;
  }
  .pfd-actions-bar {
    flex-direction: column;
    align-items: stretch;
  }
  .pfd-btn-back,
  .pfd-btn-talk {
    justify-content: center;
  }
}

