/* Estilos específicos da página de portfólio */

body {
  background: linear-gradient(180deg, #f9faff 0%, #ffffff 45%, #f6f7fb 100%);
}

main.portfolio {
  padding: 50px 0 80px;
  min-height: calc(100vh - var(--header-height));
}

.portfolio-hero {
  text-align: center;
  margin-bottom: 32px;
}

.portfolio-hero h1 {
  font-size: clamp(28px, 5vw, 42px);
  margin-bottom: 12px;
}

.portfolio-hero p {
  max-width: 640px;
  margin: 0 auto;
  color: var(--muted);
}

.filters {
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid rgba(46, 124, 246, 0.12);
  border-radius: 18px;
  padding: 22px clamp(18px, 4vw, 34px);
  box-shadow: 0 18px 28px rgba(20, 52, 97, 0.08);
  display: flex;
  flex-wrap: wrap;
  gap: 18px 28px;
  margin-top: 20px;
  margin-bottom: 32px;
  justify-content: space-between;
  align-items: center;
}

.portfolio-hint {
  margin: 20px auto 32px;
  padding: clamp(16px, 4vw, 20px);
  border-radius: 14px;
  border: 1px solid rgba(24, 38, 79, 0.08);
  background: #ffffff;
  box-shadow: 0 12px 26px rgba(10, 22, 48, 0.05);
  display: flex;
  align-items: center;
  gap: 14px;
  color: #1d253a;
}

.hint-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(29, 70, 150, 0.18);
  color: rgba(29, 70, 150, 0.72);
  background: rgba(29, 70, 150, 0.04);
  flex-shrink: 0;
}

.hint-body p {
  margin: 0;
  font-weight: 500;
  color: #3b435d;
  line-height: 1.4;
}

.filter-group {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.filter-label {
  font-weight: 600;
  color: #27324a;
  margin-right: 4px;
  font-size: 0.95rem;
}

.filter-btn {
  border: 1px solid rgba(46, 124, 246, 0.28);
  background: rgba(46, 124, 246, 0.06);
  color: #2852a0;
  border-radius: 999px;
  padding: 9px 18px;
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.filter-btn[aria-pressed="true"] {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
  box-shadow: 0 12px 20px rgba(46, 124, 246, 0.28);
}

.portfolio-grid {
  display: grid;
  gap: 22px;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.media-card {
  position: relative;
  border-radius: 18px;
  overflow: hidden;
  background: #fff;
  border: 1px solid rgba(40, 70, 130, 0.12);
  box-shadow: 0 22px 34px rgba(16, 45, 85, 0.08);
  cursor: pointer;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  display: flex;
  flex-direction: column;
}

.media-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 32px 46px rgba(16, 45, 85, 0.18);
}

.media-thumb {
  position: relative;
  aspect-ratio: 4/3;
  overflow: hidden;
}

.media-thumb img,
.media-thumb video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.media-meta {
  padding: 16px 18px 18px;
}

.media-meta h3 {
  margin: 0;
  font-size: 1rem;
  color: #1d263a;
}

.media-meta span {
  display: block;
  margin-top: 6px;
  font-size: 0.86rem;
  color: var(--muted);
}

.media-card[data-media="video"] .media-thumb::after {
  content: "\25B6";
  position: absolute;
  right: 16px;
  bottom: 16px;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: rgba(12, 27, 58, 0.78);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 1rem;
}

.media-card.is-hidden {
  display: none;
}

.lightbox-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(9, 18, 45, 0.78);
  display: grid;
  place-items: center;
  z-index: 100;
  padding: clamp(18px, 4vw, 42px);
  backdrop-filter: blur(6px);
}
.lightbox-backdrop[hidden] {
  display: none !important;
}

.lightbox-content {
  background: #fff;
  border-radius: 20px;
  overflow: hidden;
  max-width: min(960px, 90vw);
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 32px 60px rgba(8, 24, 53, 0.45);
  position: relative;
}

.lightbox-media {
  width: 100%;
  background: #000;
}

.lightbox-media img,
.lightbox-media video {
  width: 100%;
  height: auto;
  display: block;
  max-height: 70vh;
  object-fit: contain;
  background: #000;
}

.lightbox-caption {
  padding: 18px 22px;
  color: #2f3651;
}

.lightbox-close {
  position: absolute;
  top: 14px;
  right: 14px;
  border: none;
  background: rgba(15, 30, 60, 0.82);
  color: #fff;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 1.2rem;
  cursor: pointer;
  z-index: 5;
}

.media-card.focus-top .media-thumb img {
  object-position: center 20%;
}

.media-card.focus-top .media-thumb video {
  object-position: center 20%;
}

@media (max-width: 780px) {
  .filters {
    flex-direction: column;
    align-items: flex-start;
  }
  .filter-group {
    width: 100%;
    justify-content: flex-start;
  }
  .portfolio-hint {
    flex-direction: column;
    text-align: center;
  }
  .hint-icon {
    margin-bottom: 6px;
  }
}

@media (max-width: 560px) {
  .filters {
    padding: 18px;
  }
  .filter-btn {
    padding: 8px 14px;
  }
  .media-meta h3 {
    font-size: 0.94rem;
  }
  .media-meta span {
    font-size: 0.8rem;
  }
  .portfolio-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
  }
}

@media (max-width: 425px) {
  .filters {
    padding: 16px;
  }
  .filter-btn {
    padding: 6px 10px;
    font-size: 0.75rem;
    font-weight: 600;
  }
  .media-meta h3 {
    font-size: 0.88rem;
  }
  .media-meta span {
    font-size: 0.76rem;
  }
}
