/*
Theme Name: tl3-prj-cloud
Theme URI: 
Author: TL3
Author URI: http://tl3.com/
Description: A portfolio showcase theme featuring slow, infinite upward rain of project screenshots. Each portfolio CPT item floats upward at a slight angle. Hover pauses the animation for interaction.
Version: 1.0
Requires at least: 5.0
Tested up to: 6.7
Requires PHP: 7.4
*/

/* ── Reset ───────────────────────────────── */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
  width: 100%;
  min-height: 100vh;
  overflow: hidden;
  background: #0a0a0f;
  font-family: 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
  color: #e0e0e0;
}

a { color: inherit; text-decoration: none; }

/* ── Canvas (rain layer) ─────────────────── */
#rain-canvas {
  position: fixed;
  top: 0; left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
}

/* ── Rain card wrapper ───────────────────── */
.rain-card {
  position: absolute;
  cursor: pointer;
  transition: transform 0.35s cubic-bezier(.25,.46,.45,.94),
              opacity 0.35s ease,
              filter 0.35s ease;
  filter: drop-shadow(0 4px 24px rgba(0,0,0,0.55));
  transform-origin: center center;
}
.rain-card:hover {
  transform: scale(1.25) !important;
  filter: drop-shadow(0 8px 40px rgba(100,160,255,0.35));
  z-index: 99999;
  opacity: 1 !important;
}
.rain-card:hover img {
  opacity: 1 !important;
}
.rain-card img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 6px;
  background: #16162a;
  border: 1px solid rgba(255,255,255,0.06);
}
.rain-card .card-label {
  position: absolute;
  bottom: -22px;
  left: 50%;
  transform: translateX(-50%);
  white-space: nowrap;
  font-size: 11px;
  letter-spacing: 0.6px;
  color: rgba(255,255,255,0.55);
  text-transform: uppercase;
  pointer-events: none;
}

/* ── Detail / Project Modal ────────────────── */
#detail-page {
  display: none;
  position: fixed;
  top: 0; left: 0;
  width: 100%;
  height: 100%;
  z-index: 20000;
  align-items: center;
  justify-content: center;
  background: rgba(10, 10, 15, 0);
  transition: background 0.3s ease;
}
#detail-page.active {
  display: flex;
  background: rgba(10, 10, 15, 0.75);
}

/* Semi-transparent backdrop behind the modal */
#detail-page::before {
  content: '';
  position: fixed;
  inset: 0;
  backdrop-filter: blur(4px);
}

#detail-modal {
  position: relative;
  z-index: 20001;
  /* width: 80vw; */
  max-width: 80vw;
  /* max-width: 760px; */
  /* height: 85vh; */
  max-height: 80vh;
  background: #0f0f1a;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 12px;
  box-shadow: 0 24px 80px rgba(0,0,0,0.6);
  overflow-y: auto;
  overflow-x: hidden;
  transform: translateY(120px) scale(0.92);
  opacity: 0;
  transition: transform 0.45s cubic-bezier(.19,1,.22,1),
              opacity 0.45s cubic-bezier(.19,1,.22,1);
}
#detail-page.active #detail-modal {
  transform: translateY(0) scale(1);
  opacity: 1;
}
#detail-body {
  max-width: 100%;
  margin: 0;
  padding: 20px 24px 32px;
}
#detail-body h1 {
  font-size: 22px;
  font-weight: 600;
  margin-bottom: 10px;
  color: #ffffff;
}
#detail-body .detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 16px;
  font-size: 12px;
  color: rgba(255,255,255,0.5);
}
#detail-body .detail-meta span {
  background: rgba(255,255,255,0.06);
  padding: 4px 10px;
  border-radius: 4px;
  border: 1px solid rgba(255,255,255,0.08);
}
#detail-body .detail-meta a {
  color: #6ea8fe;
  text-decoration: underline;
}
#detail-body .detail-content {
  font-size: 14px;
  line-height: 1.75;
  padding: 20px 0;
  color: rgba(255,255,255,0.7);
}
#detail-body .detail-content a {
  color: #6ea8fe;
  text-decoration: underline;
}
#detail-body .detail-content img {
  max-width: 100%;
  height: auto;
  border-radius: 6px;
  margin: 12px 0;
}

.showcase-video {
  width: 100%;
  aspect-ratio: 16 / 9;
  margin: 0 0 20px 0;
  border-radius: 8px;
  overflow: hidden;
  background: #000;
}
.showcase-video iframe {
  width: 100%;
  height: 100%;
  border: none;
  display: block;
}

#back-btn {
  position: fixed;
  top: 18px;
  right: 18px;
  z-index: 10001;
  background: rgba(255,255,255,0.07);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 6px;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s;
  backdrop-filter: blur(8px);
}
#back-btn:hover {
  background: rgba(255,255,255,0.14);
}
#back-btn svg {
  width: 18px;
  height: 18px;
}

/* ── Loading overlay ─────────────────────── */
#loader {
  position: fixed;
  inset: 0;
  background: #0a0a0f;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 20000;
  transition: opacity 0.8s ease;
}
#loader.hidden {
  opacity: 0;
  pointer-events: none;
}
#loader span {
  font-size: 14px;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: rgba(255,255,255,0.35);
}

/* ── Gallery (page-portfolio template) ──── */
#gallery-grid {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px 24px 60px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 20px;
}
.gallery-item {
  background: #111122;
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 8px;
  overflow: hidden;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  cursor: pointer;
}
.gallery-item:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 32px rgba(100,160,255,0.15);
}
.gallery-item img {
  width: 100%;
  height: auto;
  display: block;
}
.gallery-item .no-thumb {
  width: 100%;
  height: 140px;
  background: #16162a;
}
.gallery-label {
  padding: 10px 12px;
}
.gallery-label .gallery-title {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: #ffffff;
  margin-bottom: 4px;
}
.gallery-label .gallery-year {
  display: inline-block;
  font-size: 11px;
  color: rgba(255,255,255,0.4);
  margin-right: 8px;
}
.gallery-label .gallery-client {
  display: inline-block;
  font-size: 11px;
  color: rgba(255,255,255,0.4);
}
.no-portfolio {
  text-align: center;
  color: rgba(255,255,255,0.35);
  padding: 60px 24px;
  font-size: 15px;
}

/* ── Site header ────────────────────────── */
#site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 50;
  padding: 16px 24px;
  background: linear-gradient(to bottom, rgba(10,10,15,0.95) 0%, transparent 100%);
  pointer-events: none;
}
#site-title {
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 0.5px;
}
#site-title a {
  color: #ffffff;
}
#site-subtitle {
  font-size: 12px;
  color: rgba(255,255,255,0.35);
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-top: 2px;
}

/* ── Carousel ───────────────────────────── */
.carousel {
  margin: 0 0 20px 0;
}
.carousel-inner {
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 8px;
  overflow: hidden;
  background: #08080f;
}
.carousel-placeholder {
  padding: 60px 24px;
  text-align: center;
  color: rgba(255,255,255,0.3);
  font-size: 13px;
  letter-spacing: 1px;
}
.carousel-main {
  position: relative;
  text-align: center;
  min-height: 300px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.carousel-image {
  max-width: 100%;
  display: block;
  margin: 0 auto;
  border-radius: 0;
  object-fit: contain;
  height: auto;
}
.carousel-counter {
  position: absolute;
  top: 12px;
  right: 14px;
  font-size: 11px;
  color: rgba(255,255,255,0.5);
  background: rgba(0,0,0,0.5);
  padding: 3px 10px;
  border-radius: 4px;
}
.carousel-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0,0,0,0.5);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 50%;
  width: 40px;
  height: 40px;
  font-size: 18px;
  cursor: pointer;
  transition: background 0.2s;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}
.carousel-btn:hover {
  background: rgba(100,160,255,0.3);
}
.carousel-btn.prev {
  left: 10px;
}
.carousel-btn.next {
  right: 10px;
}
.carousel-strip {
  display: flex;
  gap: 8px;
  padding: 10px;
  overflow-x: auto;
  border-top: 1px solid rgba(255,255,255,0.06);
}
.carousel-thumb {
  flex-shrink: 0;
  width: 70px;
  height: 50px;
  border-radius: 4px;
  overflow: hidden;
  cursor: pointer;
  border: 2px solid transparent;
  transition: border-color 0.2s, opacity 0.2s;
  opacity: 0.4;
}
.carousel-thumb:hover {
  opacity: 0.7;
}
.carousel-thumb.active {
  opacity: 1;
  border-color: #6ea8fe;
}
.carousel-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
