/* ================================
   GRID LAYOUTS
   ================================ */

.pgtm-grid {
    display: grid;
    gap: 32px;
}

/* Owners row – 2 columns on desktop */
.pgtm-grid--owners {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

/* Default team grid – 4 columns on desktop */
.pgtm-grid--team,
.pgtm-grid--guides {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

/* Tablet */
@media (max-width: 1024px) {
    .pgtm-grid--owners,
    .pgtm-grid--team,
    .pgtm-grid--guides {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 24px;
    }
}

/* Mobile */
@media (max-width: 640px) {
    .pgtm-grid--owners,
    .pgtm-grid--team,
    .pgtm-grid--guides {
        grid-template-columns: 1fr;
        gap: 20px;
    }
}

/* ================================
   CARD BASE
   ================================ */

.pgtm-card {
    position: relative;
    display: block;
    border-radius: 24px;
    overflow: hidden;
    min-height: 260px;
    text-decoration: none;
    color: #ffffff;
    background: #222;
    transition: transform 0.35s ease, box-shadow 0.35s ease;
}

.pgtm-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 20px 40px rgba(0,0,0,0.35);
}

.pgtm-card-image {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    filter: brightness(0.95);
    transition: transform 0.35s ease, filter 0.35s ease;
}

.pgtm-card:hover .pgtm-card-image {
    transform: scale(1.03);
    filter: brightness(1.05);
}

.pgtm-card-gradient {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        180deg,
        rgba(0,0,0,0.00) 0%,
        rgba(0,0,0,0.55) 70%,
        rgba(0,0,0,0.85) 100%
    );
}

.pgtm-card-content {
    position: absolute;
    inset-inline: 24px;
    bottom: 24px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    z-index: 2;
}

.pgtm-card-name {
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: 0.02em;
}

/* White pill role badge */
.pgtm-card-role {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 18px;
    border-radius: 999px;
    background: #ffffff;
    color: #111827;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: none;
    box-shadow: 0 4px 10px rgba(0,0,0,0.15);
}

/* "View Profile" badge for special members */
.pgtm-card-view-profile {
    position: absolute;
    top: 16px;
    right: 18px;
    z-index: 2;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 6px 12px;
    border-radius: 999px;
    background: rgba(0,0,0,0.45);
    backdrop-filter: blur(4px);
}

/* ================================
   GUIDES SECTION HEADER / FILTERS
   ================================ */

.pgtm-guides-wrapper {
    margin-block: 60px;
}

.pgtm-guides-header {
    text-align: center;
    margin-bottom: 32px;
}

.pgtm-guides-title {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 20px;
}

.pgtm-guides-filters {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: center;
}

.pgtm-filter-pill {
    border: none;
    cursor: pointer;
    border-radius: 999px;
    padding: 8px 18px;
    font-size: 0.9rem;
    background: #f3f4f6;
    color: #111827;
    transition: background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.pgtm-filter-pill.is-active,
.pgtm-filter-pill:hover {
    background: #0b7b6a; /* brand teal */
    color: #ffffff;
    box-shadow: 0 8px 20px rgba(11,123,106,0.35);
}

/* Simple CSS-only filtering support (hide via data attributes if you attach JS later) */
.pgtm-card[data-hidden="1"] {
    display: none !important;
}

/* ================================
   CARD SIZING (HEIGHT TUNING)
   ================================ */

/* Default (desktop) – make cards taller */
.pgtm-card {
    min-height: 340px;                  /* was 260px */
}

/* Regular team cards */
.pgtm-grid--team .pgtm-card {
    min-height: 460px;
}

/* Guides cards */
.pgtm-grid--guides .pgtm-card {
    min-height: 460px;
}

/* Owners row usually needs even more height */
.pgtm-grid--owners .pgtm-card {
    min-height: 600px;
}

/* Owners row: keep portraits centered instead of top-biased crop */
.pgtm-grid--owners .pgtm-card-image {
    position: absolute !important;
    inset: 0 !important;
    width: 100% !important;
    height: 100% !important;
    background-position: center center !important;
    background-size: cover !important;
    aspect-ratio: auto !important;
}

/* Regular team cards: fill the whole card area with cover */
.pgtm-grid--team .pgtm-card-image {
    position: absolute !important;
    inset: 0 !important;
    width: 100% !important;
    height: 100% !important;
    background-position: center center !important;
    background-size: cover !important;
    aspect-ratio: auto !important;
}

/* Guides cards: fill the whole card area with cover */
.pgtm-grid--guides .pgtm-card-image {
    position: absolute !important;
    inset: 0 !important;
    width: 100% !important;
    height: 100% !important;
    background-position: center center !important;
    background-size: cover !important;
    aspect-ratio: auto !important;
}

/* Tablet */
@media (max-width: 1024px) {
    .pgtm-card {
        min-height: 360px;
    }

    .pgtm-grid--team .pgtm-card {
        min-height: 440px;
    }

    .pgtm-grid--guides .pgtm-card {
        min-height: 440px;
    }

    .pgtm-grid--owners .pgtm-card {
        min-height: 540px;
    }
}

/* Mobile – extra height so faces are not cut */
@media (max-width: 640px) {
    .pgtm-card {
        min-height: 420px;
    }

    .pgtm-grid--team .pgtm-card {
        min-height: 460px;
    }

    .pgtm-grid--guides .pgtm-card {
        min-height: 460px;
    }

    .pgtm-grid--owners .pgtm-card {
        min-height: 500px;
    }
}

/* Better focus on faces inside background image */
.pgtm-card-image {
    background-position: center top;    /* was center */
}

/* --- Stronger mobile overrides for card height --- */
@media (max-width: 640px) {
    .pgtm-grid--owners .pgtm-card,
    .pgtm-grid--team .pgtm-card,
    .pgtm-grid--guides .pgtm-card {
        min-height: 480px !important; /* increase if still tight */
    }
}

/* Extra boost for very small screens */
@media (max-width: 480px) {
    .pgtm-grid--owners .pgtm-card,
    .pgtm-grid--team .pgtm-card,
    .pgtm-grid--guides .pgtm-card {
        min-height: 520px !important;
    }
}

/* existing */
.pgtm-guides-header {
    text-align: center;
    margin-bottom: 32px;
}

/* override only for the trip page section */
.pgtm-trip-guides-section .pgtm-guides-header,
.pgtm-trip-guides-section .pgtm-guides-title {
    text-align: left;
}

/* =========================================================
   PGTM Responsive Guides Grid (mobile / tablet / 1200-1900)
   ========================================================= */

/* Base grid: auto-fit columns, prevents squeezing */
.pgtm-grid.pgtm-grid--guides{
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 22px;
  align-items: stretch;
}

/* Tablet: slightly wider cards */
@media (min-width: 768px){
  .pgtm-grid.pgtm-grid--guides{
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  }
}

/* Desktop 1200+: keep 3-4 columns depending on space */
@media (min-width: 1200px){
  .pgtm-grid.pgtm-grid--guides{
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 26px;
  }
}

/* Large desktop 1600+: allow a bit wider cards (prevents ugly wraps) */
@media (min-width: 1600px){
  .pgtm-grid.pgtm-grid--guides{
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  }
}

/* Make cards flexible and prevent text weird breaking */
.pgtm-card{
  min-width: 0; /* required for ellipsis/nowrap inside grid */
  border-radius: 22px; /* optional, keeps it nice */
  overflow: hidden;
}

/* Image: keep consistent height across breakpoints */
.pgtm-card-image{
  width: 100%;
  aspect-ratio: 3 / 4;         /* consistent portrait look */
  background-size: cover;
  background-position: center;
}

/* Content overlay spacing */
.pgtm-card-content{
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 16px;
}

/* Name: 1 line (no per-word line breaks) */
.pgtm-card-name{
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  word-break: normal !important;
  overflow-wrap: normal !important;
}

/* Role pill: keep on 1 line too */
.pgtm-card-role{
  display: inline-flex;
  align-items: center;
  justify-content: center;

  max-width: 100%;
  padding: 10px 16px;
  border-radius: 999px;

  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;

  word-break: normal !important;
  overflow-wrap: normal !important;

  width: auto !important;      /* avoids forced tiny widths */
  min-width: 0 !important;
}

/* If any global styles are forcing aggressive breaking, neutralize */
.pgtm-card *{
  word-break: normal;
  overflow-wrap: normal;
}

/* Trip page: if only 1 guide, do NOT stretch full width */
.pgtm-trip-guides-section .pgtm-grid--count-1{
  grid-template-columns: minmax(280px, 520px); /* one column with max width */
  justify-content: start; /* keep it aligned left */
}

/* Optional: center it instead of left (if you prefer) */
/*
.pgtm-trip-guides-section .pgtm-grid--count-1{
  grid-template-columns: minmax(280px, 520px);
  justify-content: center;
}
*/

/* ================================
   ABOUT US - GUIDES GRID FIX
   Force 4 columns + no stretching
================================ */

/* Base: use CSS Grid so hidden/filtered items don't stretch */
.pgtm-grid.pgtm-grid--guides{
  display: grid !important;
  grid-template-columns: repeat(1, minmax(0, 1fr));
  gap: 28px !important;
  align-items: start !important;
}

/* Tablet */
@media (min-width: 768px){
  .pgtm-grid.pgtm-grid--guides{
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Small desktop */
@media (min-width: 992px){
  .pgtm-grid.pgtm-grid--guides{
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* Desktop: 4 columns (your requirement) */
@media (min-width: 1200px){
  .pgtm-grid.pgtm-grid--guides{
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

/* Make sure cards don't grow/stretch like flex items */
.pgtm-grid.pgtm-grid--guides .pgtm-card{
  width: 100% !important;
  max-width: 100% !important;
  flex: none !important;     /* in case old CSS used flex */
}

/* ================================
   FIX: prevent black empty area under images
   (your last override caused it)
   ================================ */

.pgtm-grid.pgtm-grid--guides .pgtm-card-image{
  position: absolute !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;

  background-size: cover !important;
  background-position: center !important;

  /* cancel aspect-ratio hacks */
  aspect-ratio: auto !important;
}
