/*
 * Template: portfolio-overview
 * Page-specific styling: 4-pill category tab nav + featured gallery
 * (first item full-width, next two items side-by-side at 50% each).
 *
 * Source: legacy /modules/mod_websites/assets/css/style.css
 *         (the `.websites-page` cluster of styles).
 *
 * Banner variant: adds banner-portfolio with background-position:80% 50%
 * (legacy page-244.css: #section-id-1585265841127 background-position).
 *
 * Depends on: tokens.css, base.css, page-title-banner.css.
 *             NEVER redefine those tokens here.
 */

/* ============ Banner variant ============ */
/* Legacy page-244.css sets background-position:80% 50% for the portfolio
   overview banner. Override the partial's default 100% 50%. The partial
   already supports `banner-{{BANNER_VARIANT}}` modifier classes. */
.page-title-banner.banner-portfolio {
  background-size: contain;        /* legacy uses background-size:contain */
  background-position: 80% 50%;
}

/* ============ Section wrapping ============ */
.portfolio-overview-section {
  padding-bottom: 50px;
  background: #fff;
}

.websites-page {
  /* Acts as the host for both .websites-tabs (full-bleed centered nav)
     and the .container that wraps the gallery. Legacy renders both
     directly inside the page body. */
}

/* ============ 4-pill category tabs ============ */
.websites-tabs {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  justify-content: center;
  padding: 44px 0;
  margin: 0;
  list-style: none;
}

.websites-tab {
  margin-left: 25px;
  margin-right: 25px;
}

.btn.btn-tab {
  border: 1px solid var(--color-brand);
  background: transparent;
  color: var(--color-brand);
  font-size: 18px;
  font-weight: 400;
  padding: 10px 24px;
  line-height: 1.25;
  border-radius: 30px;
  cursor: pointer;
  transition: all var(--transition-fast);
  font-family: var(--font-sans);
  white-space: nowrap;
}

.btn.btn-tab:hover {
  border: 2px solid var(--color-brand);
  /* legacy keeps padding the same; with 2px border we'd shift 1px,
     but the visual diff is negligible. */
}

.btn.btn-tab.active {
  border: 2px solid var(--color-brand);
  background: var(--color-brand);
  color: #fff;
  box-shadow: none;
}

.btn.btn-tab.active:hover {
  background: var(--color-brand-active);
}

/* ============ Gallery grid ============ */
/* Legacy: flex-wrap, with first child 100% width, subsequent children
   50% width. Each tile is a full-bleed background image with overlay.
   This produces 1 tile on row 1, 2 tiles on row 2 for the 3-item set
   visible in source-desktop.png. */
.websites-portfolio {
  display: flex;
  flex-wrap: wrap;
  margin: 0;
}

.websites-portfolio .site-item {
  width: 50%;
  min-height: 500px;
  position: relative;
  overflow: hidden;
  background-size: cover;
  background-repeat: no-repeat;
  background-position: center;
  cursor: pointer;
  display: block;
  text-decoration: none;
  color: inherit;
}

.websites-portfolio .site-item:first-child {
  width: 100%;
}

/* ============ Tile overlay (the dark scrim + text) ============ */
.websites-portfolio .site-item .overlay-bg {
  width: 100%;
  height: 100%;
  min-height: inherit;
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-direction: column;
  background: rgba(0, 0, 0, 0.5);
  padding: 0 15px;
  transition: background 0.5s ease;
  box-sizing: border-box;
  text-align: center;
}

.site-item:hover .overlay-bg {
  background: rgba(0, 0, 0, 0.6);
}

.site-item .overlay-text {
  width: 100%;
  margin: 0;
}

.site-item .overlay-text h5 {
  font-size: 30px;
  font-weight: 700;
  color: #fff;
  line-height: 45px;
  margin: 0 0 12px;
  text-align: center;
  font-family: var(--font-sans);
}

/* The intro/desc paragraph wrapper. Legacy uses inline style
   "width:50%;color:#fff;font-size:18px;text-align:center;". */
.site-item .overlay-desc {
  width: 50%;
  color: #fff;
  font-size: 18px;
  line-height: 1.6;
  text-align: center;
  margin: 0 auto;
  font-family: var(--font-sans);
}

.site-item .overlay-desc p {
  margin: 0;
}

/* The hover "mockup-image" layer — present in legacy but hidden by
   default and never shown in the source-desktop.png static screenshot.
   Keep parity with legacy: hidden in static state. */
.site-item .overlay-image {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  z-index: 2;
  background-size: contain;
  background-position: center;
  background-repeat: no-repeat;
  background-color: #fbfbfb;
  display: none;
}

/* ============ "View More" CTA below gallery ============ */
.websites-more {
  margin-top: 50px;
  text-align: center;
}

.websites-more .btn.btn-primary {
  border: 1px solid var(--color-brand);
  background: var(--color-brand);
  font-size: 18px;
  padding: 10px 26px;
  line-height: 1.25;
  color: #fff;
  border-radius: 30px;
  display: inline-block;
  text-decoration: none;
  transition: background-color var(--transition-fast);
  font-family: var(--font-sans);
}

.websites-more .btn.btn-primary:hover {
  background-color: rgba(var(--color-brand-rgb), 0.85);
}

/* ============ Responsive ============ */
@media (max-width: 991.98px) {
  .websites-tab {
    margin-left: 12px;
    margin-right: 12px;
  }
  .btn.btn-tab {
    font-size: 16px;
    padding: 8px 18px;
  }
}

@media (max-width: 767.98px) {
  .websites-tabs {
    padding: 24px 0;
    gap: 8px;
  }
  .websites-tab {
    margin: 0;
  }
  .websites-portfolio .site-item,
  .websites-portfolio .site-item:first-child {
    width: 100%;
    min-height: 300px;
  }
  .site-item .overlay-text h5 {
    font-size: 26px;
    line-height: 42px;
  }
  .site-item .overlay-desc {
    width: 100% !important;
    font-size: 16px;
  }
  .websites-more {
    margin-top: 30px;
  }
}

/* ============ Visually-hidden helper ============ */
.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0);
  white-space: nowrap; border: 0;
}
