/* =========================================================
   PROJECT TITAN V7
   ASSETS GALLERY + LIGHTBOX
   ========================================================= */


/* ---------------------------------------------------------
   Gallery section
   --------------------------------------------------------- */

.titan-assets-section {
  overflow: hidden;
}

.titan-assets-grid {
  display: grid;
  grid-template-columns:
    repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.titan-asset-card {
  min-width: 0;
  overflow: hidden;
  border: 1px solid
    rgba(15, 23, 42, 0.1);
  border-radius: 18px;
  background: #ffffff;
  box-shadow:
    0 12px 30px
    rgba(15, 23, 42, 0.07);
  transition:
    transform 180ms ease,
    box-shadow 180ms ease,
    border-color 180ms ease;
}

.titan-asset-card:hover {
  transform: translateY(-3px);
  border-color:
    rgba(15, 23, 42, 0.18);
  box-shadow:
    0 18px 40px
    rgba(15, 23, 42, 0.12);
}

.titan-asset-card-featured {
  grid-column: span 2;
}

.titan-asset-button {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.titan-asset-button:focus-visible {
  outline: 3px solid
    rgba(37, 99, 235, 0.45);
  outline-offset: -3px;
}

.titan-asset-image-wrap {
  position: relative;
  display: block;
  overflow: hidden;
  aspect-ratio: 16 / 10;
  background:
    linear-gradient(
      135deg,
      #e2e8f0,
      #f8fafc
    );
}

.titan-asset-card-featured
.titan-asset-image-wrap {
  aspect-ratio: 16 / 7;
}

.titan-asset-image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition:
    transform 400ms ease;
}

.titan-asset-card:hover
.titan-asset-image {
  transform: scale(1.025);
}

.titan-asset-expand {
  position: absolute;
  right: 14px;
  bottom: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 8px 13px;
  border: 1px solid
    rgba(255, 255, 255, 0.35);
  border-radius: 999px;
  background:
    rgba(15, 23, 42, 0.82);
  color: #ffffff;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.02em;
  backdrop-filter: blur(8px);
}

.titan-asset-content {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 18px;
}

.titan-asset-type {
  color: #64748b;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.titan-asset-title {
  color: #0f172a;
  font-size: 18px;
  line-height: 1.3;
}

.titan-asset-description {
  color: #64748b;
  font-size: 14px;
  line-height: 1.55;
}


/* ---------------------------------------------------------
   Hero image support
   --------------------------------------------------------- */

.titan-hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
}

.titan-hero-has-image {
  min-height: 470px;
  display: flex;
  align-items: flex-end;
  background-image:
    var(--titan-hero-image);
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
}

.titan-hero-overlay {
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(
      90deg,
      rgba(5, 15, 30, 0.94) 0%,
      rgba(5, 15, 30, 0.81) 45%,
      rgba(5, 15, 30, 0.34) 100%
    ),
    linear-gradient(
      0deg,
      rgba(5, 15, 30, 0.62) 0%,
      transparent 55%
    );
}

.titan-hero-has-image
.titan-hero-content {
  position: relative;
  z-index: 1;
  width: 100%;
}

.titan-hero-has-image h1,
.titan-hero-has-image
.titan-hero-type,
.titan-hero-has-image
.titan-hero-subtitle {
  color: #ffffff;
}

.titan-hero-has-image
.titan-eyebrow {
  color:
    rgba(255, 255, 255, 0.8);
}

.titan-hero-has-image
.titan-hero-chip {
  border-color:
    rgba(255, 255, 255, 0.25);
  background:
    rgba(15, 23, 42, 0.52);
  color: #ffffff;
  backdrop-filter: blur(8px);
}

.titan-hero-has-image
.titan-button-secondary {
  border-color:
    rgba(255, 255, 255, 0.42);
  background:
    rgba(255, 255, 255, 0.1);
  color: #ffffff;
}

.titan-hero-has-image
.titan-button-secondary:hover {
  background:
    rgba(255, 255, 255, 0.18);
}


/* ---------------------------------------------------------
   Fullscreen lightbox
   --------------------------------------------------------- */

.titan-lightbox {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.titan-lightbox.is-open {
  display: flex;
}

.titan-lightbox-backdrop {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  background:
    rgba(2, 6, 23, 0.88);
  cursor: zoom-out;
  backdrop-filter: blur(8px);
}

.titan-lightbox-dialog {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  width: min(1200px, 100%);
  max-height: calc(100vh - 48px);
  overflow: hidden;
  border: 1px solid
    rgba(255, 255, 255, 0.14);
  border-radius: 20px;
  background: #0f172a;
  box-shadow:
    0 30px 80px
    rgba(0, 0, 0, 0.5);
}

.titan-lightbox-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 16px 18px;
  border-bottom: 1px solid
    rgba(255, 255, 255, 0.1);
  color: #ffffff;
}

.titan-lightbox-toolbar > div {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 3px;
}

.titan-lightbox-type {
  color:
    rgba(255, 255, 255, 0.62);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.titan-lightbox-title {
  overflow: hidden;
  color: #ffffff;
  font-size: 16px;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.titan-lightbox-close {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  padding: 0;
  border: 1px solid
    rgba(255, 255, 255, 0.2);
  border-radius: 999px;
  background:
    rgba(255, 255, 255, 0.08);
  color: #ffffff;
  font-size: 29px;
  font-weight: 300;
  line-height: 1;
  cursor: pointer;
}

.titan-lightbox-close:hover {
  background:
    rgba(255, 255, 255, 0.16);
}

.titan-lightbox-image-shell {
  position: relative;
  display: flex;
  min-height: 300px;
  flex: 1;
  align-items: center;
  justify-content: center;
  overflow: auto;
  background: #020617;
}

.titan-lightbox-image {
  display: block;
  max-width: 100%;
  max-height:
    calc(100vh - 190px);
  width: auto;
  height: auto;
  object-fit: contain;
}

.titan-lightbox-nav {
  position: absolute;
  top: 50%;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 58px;
  padding: 0;
  border: 1px solid
    rgba(255, 255, 255, 0.2);
  border-radius: 14px;
  background:
    rgba(15, 23, 42, 0.75);
  color: #ffffff;
  font-size: 38px;
  font-weight: 300;
  line-height: 1;
  cursor: pointer;
  transform: translateY(-50%);
  backdrop-filter: blur(8px);
}

.titan-lightbox-nav:hover {
  background:
    rgba(15, 23, 42, 0.95);
}

.titan-lightbox-nav-previous {
  left: 16px;
}

.titan-lightbox-nav-next {
  right: 16px;
}

.titan-lightbox-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 58px;
  padding: 13px 18px;
  border-top: 1px solid
    rgba(255, 255, 255, 0.1);
  color:
    rgba(255, 255, 255, 0.72);
}

.titan-lightbox-description {
  margin: 0;
  font-size: 13px;
  line-height: 1.45;
}

.titan-lightbox-counter {
  flex: 0 0 auto;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

html.titan-lightbox-open,
html.titan-lightbox-open body {
  overflow: hidden;
}


/* ---------------------------------------------------------
   Accessibility
   --------------------------------------------------------- */

.titan-lightbox button:focus-visible {
  outline: 3px solid
    rgba(96, 165, 250, 0.85);
  outline-offset: 3px;
}


/* ---------------------------------------------------------
   Tablet
   --------------------------------------------------------- */

@media (max-width: 900px) {
  .titan-assets-grid {
    gap: 14px;
  }

  .titan-hero-has-image {
    min-height: 430px;
  }

  .titan-hero-overlay {
    background:
      linear-gradient(
        90deg,
        rgba(5, 15, 30, 0.94) 0%,
        rgba(5, 15, 30, 0.75) 75%,
        rgba(5, 15, 30, 0.58) 100%
      );
  }
}


/* ---------------------------------------------------------
   Mobile
   --------------------------------------------------------- */

@media (max-width: 640px) {
  .titan-assets-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .titan-asset-card-featured {
    grid-column: auto;
  }

  .titan-asset-image-wrap,
  .titan-asset-card-featured
  .titan-asset-image-wrap {
    aspect-ratio: 4 / 3;
  }

  .titan-asset-content {
    padding: 15px;
  }

  .titan-asset-title {
    font-size: 16px;
  }

  .titan-asset-expand {
    right: 10px;
    bottom: 10px;
    min-height: 32px;
    padding: 7px 11px;
    font-size: 11px;
  }

  .titan-hero-has-image {
    min-height: 520px;
    align-items: flex-end;
    background-position: center;
  }

  .titan-hero-overlay {
    background:
      linear-gradient(
        0deg,
        rgba(5, 15, 30, 0.97) 0%,
        rgba(5, 15, 30, 0.86) 55%,
        rgba(5, 15, 30, 0.42) 100%
      );
  }

  .titan-lightbox {
    padding: 0;
  }

  .titan-lightbox-dialog {
    width: 100%;
    height: 100%;
    max-height: none;
    border: 0;
    border-radius: 0;
  }

  .titan-lightbox-toolbar {
    padding:
      calc(
        12px +
        env(safe-area-inset-top)
      )
      14px
      12px;
  }

  .titan-lightbox-image-shell {
    min-height: 0;
  }

  .titan-lightbox-image {
    max-height:
      calc(100vh - 170px);
  }

  .titan-lightbox-nav {
    width: 42px;
    height: 50px;
    border-radius: 12px;
    font-size: 32px;
  }

  .titan-lightbox-nav-previous {
    left: 8px;
  }

  .titan-lightbox-nav-next {
    right: 8px;
  }

  .titan-lightbox-footer {
    padding:
      12px
      14px
      calc(
        12px +
        env(safe-area-inset-bottom)
      );
  }

  .titan-lightbox-description {
    display: -webkit-box;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
  }
}


/* ---------------------------------------------------------
   Reduced motion
   --------------------------------------------------------- */

@media (
  prefers-reduced-motion:
  reduce
) {
  .titan-asset-card,
  .titan-asset-image {
    transition: none;
  }
}