/* Version: 2026-03-19-v842 */
/*
 * Portfolio Page Styles
 *
 * Layout and appearance for the portfolio index and tag pages.
 */

h1 {
  text-align: center;
}

/* Tag page headers should be left-aligned */
.portfolio-tag-page h1 {
  text-align: left;
}

/* Override for tag page header structure */
.portfolio-tag-page .tag-page-header h1 {
  text-align: center;
}

/* Portfolio main page layout */
.portfolio-grid {
  display: grid;
  grid-template-columns: 1fr;
  grid-gap: 30px;
  padding: 20px 0;
}

/* Header specific to portfolio page */
header {
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
}

h1 {
  max-width: 960px;
  text-align: center;
}

/* Cards container specific to portfolio page */
.cards {
  display: grid;
  grid-gap: 30px;
  grid-template-columns: 1fr;
  /* Default single column */
}

/* Responsive grid for tag pages only (not main portfolio page) */
/* Target pages with .portfolio-tag-page class (only tag pages have this) */
@media (min-width: 900px) {
  .portfolio-tag-page .cards {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1100px) {
  .portfolio-tag-page .cards {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* Override card layout for portfolio main page */
.cards .card {
  display: flex;
  flex-direction: column;
}

.cards .card .card--details {
  order: 2;
  flex: 0 0 auto;
  /* Don't grow/shrink, size to content */
  justify-content: flex-start;
  align-items: stretch;
}

.cards .card picture {
  order: 1;
  flex: 1;
  /* Take remaining space */
}

/* Truncate card titles to maximum 3 lines */
.cards .card .card--details h2 {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  overflow: hidden;
  line-height: 1.1;
  max-height: calc(1.1em * 3);
  /* 3 lines */
}

/* Ensure proper spacing between elements */
.cards .card .card--details>* {
  flex-shrink: 0;
}

/* Company logo gets consistent spacing */
.cards .card .card--company-logo {
  margin-top: 0.75rem;
}

/* Tags get consistent positioning from the logo */
.cards .card .card--tags {
  margin-top: 0.75rem;
}

.cards .card img {
  order: 1;
}

.portfolio-header {
  margin-bottom: 2rem;
}

.portfolio-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 1.5rem;
}

/* Staggered card animation for portfolio items */
.cards.staggered-animation .card {
  transition: transform 0.2s ease-in-out, box-shadow 0.15s ease-in;
}

@media (min-width: 530px) {
  header {
    margin-bottom: 0.25rem;
  }
}

/* Media queries specific to portfolio layout */
@media (min-width: 768px) {
  header {
    margin-bottom: 1rem;
  }

  /* Reset grid-column for cards in main portfolio layout */
  main .cards .card {
    grid-column: auto;
  }

  /* Removed .cards grid override to allow content-card.css responsive rules */

  /* Increase the maximum width of each card for better readability - but not on grid layouts */
  .card {
    max-width: 550px;
    justify-self: center;
  }

  /* Allow cards to be flexible in multi-column grid layouts (tag pages only) */
  .portfolio-tag-page .cards .card {
    max-width: none;
    width: 100%;
  }
}

/* Remove the 3-column layout for larger screens */
@media (min-width: 1200px) {
  .wrapper {
    max-width: 1600px;
  }

  /* Removed grid-template-columns override to allow content-card.css responsive rules to take precedence */
  .cards {
    grid-gap: 40px;
  }

  /* Allow single-column cards to be larger on big screens, but not in grid layouts */
  .card {
    max-width: 580px;
  }

  /* Override width constraints for multi-column grid layouts (tag pages only) */
  .portfolio-tag-page .cards .card {
    max-width: none;
    width: 100%;
  }
}

/* === Portfolio & Tag Page Backgrounds === */
.portfolio-index,
.portfolio-tag-page {
  background: var(--color-background) !important;
}

.cards .card,
.card,
.portfolio-tag-page .cards .card {
  background: var(--color-white);
  border-radius: 12px;
  /* box-shadow removed: now handled in content-card.css */
}

/* Tag index page specific styles */
.tag-list {
  list-style: none;
  padding-left: 0;
  margin-left: 0;
}

.tag-list li {
  padding-left: 0;
  text-indent: 0;
  margin-bottom: 0.75rem;
}

.tag-list li a {
  color: var(--color-link);
  text-decoration: underline;
  font-weight: 500;
}

.tag-list li a:hover,
.tag-list li a:active {
  box-shadow: 0px 0px 0px 5px var(--color-secondary-50);
  background-color: var(--color-secondary-50);
  text-decoration: underline;
  border-radius: 20px;
  transition: all 0.1s ease-in;
  color: var(--color-text);
}

.tag-count {
  color: var(--color-black-60);
  font-weight: 400;
  margin-left: 0.5rem;
}

/* Portfolio tag component styles moved to main-components.css for global access */


/* Tag index link styling in tag page headers */
.tag-index-link {
  color: var(--color-text) !important;
  text-decoration: underline;
  font-weight: 700;
  font-size: 1rem;
  font-variation-settings: "wght" 700;
  display: inline-block;
  margin-top: 0.5rem;
  margin-left: 0;
  padding: 2px 4px;
  border-radius: 8px;
  transition: all 0.1s ease-in;
}

.tag-index-link:hover,
.tag-index-link:active {
  text-decoration: underline;
  color: var(--color-text);
}

/* === Force offwhite background for portfolio pages === */
body.portfolio-index,
body.portfolio-tag-page {
  background: var(--color-background) !important;
}
