/* ================================================
   Portfolio Page — Exact Figma Match
   Nodes: 48:369 (page), 4:325 (current modal),
          68:103 (realized modal)
   ================================================ */

/* -----------------------------------------------
   Filter Bar
   ----------------------------------------------- */
.pf-filter-bar {
  padding: 2rem 0;
}

.pf-filter-bar .pf-bar-inner {
  display: flex;
  align-items: center;
  gap: 27px;
  height: 56px;
}

/* Tabs container */
.pf-tabs {
  display: flex;
  align-items: center;
  border: 1px solid rgba(77, 155, 215, 0.1);
  border-radius: 5px;
  padding: 4px;
  backdrop-filter: blur(5.85px);
  -webkit-backdrop-filter: blur(5.85px);
  flex-shrink: 0;
}

.pf-tab {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 48px;
  border: none;
  border-radius: 5px;
  background: transparent;
  color: #203a53;
  font-size: 16px;
  font-family: 'urwclassicoregular', sans-serif;
  cursor: pointer;
  padding: 13px 12px;
  white-space: nowrap;
  width: 8.25rem;
}


.pf-tab.active {
  background: #e3f1ff;
  border: 1px solid rgba(77, 155, 215, 0.2);
}

/* Separator line */
.pf-separator {
  flex: 1;
  height: 1px;
  background: rgba(0, 0, 0, 0.1);
  min-width: 20px;
}

/* Fund filter */
.pf-fund-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.pf-fund-label {
  color: #203a53;
  font-size: 16px;
  font-family: 'urwclassicoregular', sans-serif;
  white-space: nowrap;
  margin: 0;
}

.pf-fund-btn {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 123px;
  padding: 10px;
  background: white;
  border: 1px solid rgba(32, 58, 83, 0.3);
  border-radius: 5px;
  backdrop-filter: blur(5.85px);
  -webkit-backdrop-filter: blur(5.85px);
  cursor: pointer;
  font-family: 'urwclassicoregular', sans-serif;
  font-size: 14px;
  color: rgba(32, 58, 83, 0.8);
  text-align: left;
  white-space: nowrap;
}

.pf-fund-btn .pf-chevron {
  width: 7px;
  height: 7px;
  border-right: 1px solid rgba(32, 58, 83, 0.6);
  border-bottom: 1px solid rgba(32, 58, 83, 0.6);
  transform: rotate(45deg);
  flex-shrink: 0;
  margin-top: -4px;
  transition: transform 0.2s ease;
}

/* Flip chevron when dropdown is open */
.pf-fund-btn[aria-expanded="true"] .pf-chevron {
  transform: rotate(-135deg);
  margin-top: 2px;
}

/* Fund dropdown menu */
.pf-fund-dropdown {
  position: absolute;
  top: calc(100% + 3px);
  left: 0;
  right: 0;
  background: white;
  border: 1px solid rgba(77, 155, 215, 0.3);
  border-radius: 5px;
  z-index: 100;
  display: none;
  overflow: hidden;
  backdrop-filter: blur(5.85px);
  -webkit-backdrop-filter: blur(5.85px);
}

.pf-fund-dropdown.open {
  display: block;
}

.pf-fund-option {
  display: block;
  padding: 6px 9px;
  height: 32px;
  font-size: 14px;
  color: rgba(77, 155, 215, 0.8);
  cursor: pointer;
  font-family: 'urwclassicoregular', sans-serif;
  background: none;
  border: none;
  width: 100%;
  text-align: left;
  line-height: 20px;
  font-feature-settings: 'dlig' 1;
}

.pf-fund-option:hover {
  background: #e3f1ff;
}

.pf-fund-option.selected {
  background: #4d9bd7;
  color: white;
  font-weight: normal;
}

/* -----------------------------------------------
   Card Grid
   ----------------------------------------------- */
.pf-grid-section {
  padding: 0 0 5rem;
}

.pf-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}

.pf-card {
  display: flex;
  flex-direction: column;
  gap: 20px;
  width: 100%;
  cursor: pointer;
  background: transparent;
  border: none;
  padding: 0;
  text-align: left;
}

/* Logo box — this has the border, not the card */
.pf-card-logo {
  position: relative;
  background: #f9f9f9;
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 5px;
  height: 230px;
  width: 100%;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  padding: 4.75rem 2rem;
}

.pf-card-logo-img {
  max-width: 80%;
  max-height: 80%;
  object-fit: contain;
  transition: opacity 0.3s ease;
}

.pf-card-hover-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.3s ease;
  border-radius: 5px;
}

.pf-card:hover .pf-card-logo-img {
  opacity: 0;
}

.pf-card:hover .pf-card-hover-img {
  opacity: 1;
}

.pf-card-hover-icon {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 56px;
  height: 56px;
  background: #4d9bd7;
  border: 1px solid white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: 2;
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
}

.pf-card:hover .pf-card-hover-icon {
  opacity: 1;
}

.pf-card-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.pf-card-name {
  font-size: 24px;
  color: #203a53;
  font-family: 'urwclassicoregular', sans-serif;
  margin: 0;
  line-height: normal;
}

.pf-card-sector {
  font-size: 16px;
  color: #707070;
  font-family: 'urwclassicoregular', sans-serif;
  margin: 0;
  line-height: 27px;
}

/* -----------------------------------------------
   Modal Overlay
   ----------------------------------------------- */
.pf-modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  z-index: 1050;
  align-items: center;
  justify-content: center;
}

.pf-modal-overlay.open {
  display: flex;
}

/* Modal = white card (1000px) + sidebar (62px) */
.pf-modal {
  display: flex;
  align-items: flex-start;
  max-width: calc(100vw - 40px);
  max-height: calc(100vh - 40px);
}

/* White content card */
.pf-modal-content {
  background: white;
  box-shadow: 10px 0px 30px 0px rgba(0, 0, 0, 0.1);
  width: 1000px;
  max-width: 100%;
  overflow-y: auto;
  max-height: calc(100vh - 40px);
  padding: 40px;
  flex-shrink: 0;
  position: relative;
}

/* Prevent global p/hr styles from leaking into modal */
.pf-modal-content p {
  margin-bottom: 0;
}

/* -----------------------------------------------
   Modal Header
   ----------------------------------------------- */
.pf-modal-header {
  position: relative;
  min-height: 222px;
  margin-bottom: 40px;
}

/* Partial divider — spans only the right portion under company info, not under logo box */
.pf-modal-header::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 373px;
  right: 0;
  height: 1px;
  background: rgba(0, 0, 0, 0.1);
}

.pf-modal-logo-box {
  background: #f9f9f9;
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 5px;
  height: 222px;
  width: 334px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  position: absolute;
  top: 0;
  left: 0;
}

.pf-modal-logo-box img {
  max-width: 80%;
  max-height: 80%;
  object-fit: contain;
}

.pf-modal-company-info {
  margin-left: 373px; /* 334px logo + 39px gap */
  padding-top: 71px;
}

.pf-modal-company-info h2 {
  font-size: 40px;
  color: #203a53;
  font-family: 'urwclassicoregular', sans-serif;
  font-weight: normal;
  margin: 0 0 4px;
  line-height: normal;
}

.pf-modal-company-info .pf-modal-sector-text {
  font-size: 16px;
  color: #707070;
  font-family: 'urwclassicoregular', sans-serif;
  margin: 0;
  line-height: 27px;
}

/* Dividers */
.pf-divider {
  border: none;
  border-top: 1px solid rgba(0, 0, 0, 0.1);
  margin: 0 0 40px;
}

/* -----------------------------------------------
   Modal Meta Row
   ----------------------------------------------- */
.pf-modal-meta {
  display: flex;
  align-items: center;
  height: 60px;
  margin-bottom: 40px;
}

.pf-modal-meta-col {
  width: 230px;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
  border-right: 1px solid rgba(0, 0, 0, 0.1);
  overflow: hidden;
  flex-shrink: 0;
}

/* Center content in all columns except the first */
.pf-modal-meta-col:not(:first-child) {
  align-items: center;
}

.pf-modal-meta-col:last-child,
.pf-modal-meta-col.no-border {
  border-right: none;
}

.pf-meta-label {
  font-size: 20px;
  color: #203a53;
  font-family: 'urwclassicoregular', sans-serif;
  margin: 0;
  line-height: normal;
}

.pf-meta-value {
  font-size: 16px;
  color: #707070;
  font-family: 'urwclassicoregular', sans-serif;
  line-height: 27px;
  display: block;
}

.pf-meta-value a {
  color: #707070;
  text-decoration: none;
}

.pf-meta-value a:hover {
  color: #4d9bd7;
}

/* -----------------------------------------------
   Modal Description
   ----------------------------------------------- */
.pf-modal-desc-section {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.pf-modal-desc {
  font-size: 16px;
  color: #707070;
  font-family: 'urwclassicoregular', sans-serif;
  line-height: 27px;
  margin: 0;
}

/* -----------------------------------------------
   Modal Sidebar (close + next + prev)
   ----------------------------------------------- */
.pf-modal-sidebar {
  display: flex;
  flex-direction: column;
  width: 62px;
  flex-shrink: 0;
}

.pf-sidebar-btn {
  width: 62px;
  height: 62px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  cursor: pointer;
  color: white;
  font-size: 1.5rem;
  flex-shrink: 0;
}

.pf-sidebar-close {
  background: #4d9bd7;
  font-size: 1.1rem;
}

.pf-sidebar-next {
  background: #203a53;
  font-size: 1.8rem;
  line-height: 1;
}

.pf-sidebar-prev {
  background: #203a53;
  font-size: 1.8rem;
  line-height: 1;
}

.pf-sidebar-btn:hover {
  opacity: 0.85;
}

.pf-sidebar-btn:disabled {
  opacity: 0.35;
  cursor: default;
}

/* -----------------------------------------------
   Responsive
   ----------------------------------------------- */

/* Tablet: 3 columns */
@media (max-width: 991px) {
  .pf-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  /* Modal: stack sidebar below on narrow viewports */
  .pf-modal-content {
    width: 100%;
  }

  .pf-modal {
    width: calc(100vw - 40px);
    flex-direction: column;
  }

  .pf-modal-sidebar {
    flex-direction: row;
    width: 100%;
  }

  .pf-sidebar-btn {
    width: 62px;
    height: 50px;
  }
}

/* Large mobile: 2 columns + filter bar wraps */
@media (max-width: 767px) {
  .pf-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .pf-filter-bar .pf-bar-inner {
    height: auto;
    flex-wrap: wrap;
    gap: 12px;
    padding: 12px 0;
  }

  .pf-separator {
    display: none;
  }

  /* Modal header: stack logo above info */
  .pf-modal-header {
    min-height: auto;
  }

  /* Full-width divider on mobile (logo stacks above, so partial divider doesn't apply) */
  .pf-modal-header::after {
    left: 0;
  }

  .pf-modal-logo-box {
    position: static;
    width: 100%;
    height: 160px;
    margin-bottom: 20px;
  }

  .pf-modal-company-info {
    margin-left: 0;
    padding-top: 0;
  }

  .pf-modal-company-info h2 {
    font-size: 28px;
  }

  .pf-modal-meta {
    height: auto;
    flex-wrap: wrap;
    gap: 20px;
  }

  .pf-modal-meta-col {
    width: auto;
    min-width: 120px;
    height: auto;
    border-right: none;
  }
}

/* Small mobile: 2 columns still, reduce logo box height */
@media (max-width: 575px) {
  .pf-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }

  .pf-card-logo {
    height: 140px;
  }

  .pf-card-name {
    font-size: 18px;
  }

  .pf-card-sector {
    font-size: 13px;
  }
}

/* Very small: 1 column */
@media (max-width: 399px) {
  .pf-grid {
    grid-template-columns: 1fr;
  }
}
