/* =====================================================
   VL24 PROJECTS — 2026 BENTO / GLASS / AURORA
   Targets: .section.projects (projects.php)
===================================================== */

:root{
  --brand-primary:#d4e157;
  --brand-hover:#e6f27a;
}

/* ===== SECTION BASE ===== */
.section.projects{
  position:relative;
  padding:clamp(72px, 7vw, 120px) 0;
  overflow:hidden;

  /* subtle premium dark base (works with your neon-green accent) */
  background:
    radial-gradient(1100px 700px at 15% 10%, rgba(212,225,87,.14), transparent 60%),
    radial-gradient(900px 600px at 85% 20%, rgba(255,255,255,.06), transparent 55%),
    radial-gradient(900px 600px at 70% 90%, rgba(212,225,87,.10), transparent 58%),
    linear-gradient(180deg, rgba(10,14,18,1), rgba(10,14,18,.95));
}

/* aurora haze layer */
.section.projects::before{
  content:"";
  position:absolute;
  inset:-2px;
  background:
    radial-gradient(700px 420px at 20% 40%, rgba(212,225,87,.16), transparent 60%),
    radial-gradient(560px 380px at 78% 55%, rgba(120,180,255,.10), transparent 62%),
    radial-gradient(680px 420px at 60% 15%, rgba(255,255,255,.06), transparent 62%);
  filter: blur(18px) saturate(120%);
  opacity:.9;
  pointer-events:none;
  z-index:0;
}

/* grain (very subtle) */
.section.projects::after{
  content:"";
  position:absolute;
  inset:0;
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23n)' opacity='.22'/%3E%3C/svg%3E");
  opacity:.08;
  mix-blend-mode: overlay;
  pointer-events:none;
  z-index:0;
}

.section.projects .container{
  position:relative;
  z-index:1;
}

/* ===== HEADER ===== */
.section.projects .section-header{
  margin-bottom:clamp(26px, 3vw, 44px);
}

.section.projects .section-header h2{
  margin:0 0 12px;
  letter-spacing:-.02em;
  font-weight:800;
  font-size:clamp(28px, 3.1vw, 44px);
  line-height:1.05;
  color:rgba(255,255,255,.92);
}

.section.projects .section-header p{
  margin:0 auto;
  max-width:74ch;
  font-size:clamp(15px, 1.2vw, 18px);
  line-height:1.55;
  color:rgba(255,255,255,.68);
}

/* ===== NAV PILLS (your current HTML places it inside loop; style still works) ===== */
.gallery-nav{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  align-items:center;
  justify-content:center;

  margin:0 0 18px;
  padding:10px 12px;

  border:1px solid rgba(255,255,255,.10);
  background:rgba(255,255,255,.06);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border-radius:999px;
}

.gallery-nav-btn{
  appearance:none;
  text-decoration:none;
  display:inline-flex;
  align-items:center;
  justify-content:center;

  padding:10px 14px;
  border-radius:999px;

  border:1px solid rgba(255,255,255,.10);
  background:rgba(10,14,18,.35);
  color:rgba(255,255,255,.78);

  font-weight:700;
  font-size:13px;
  letter-spacing:.02em;

  transition: transform .18s ease, background .18s ease, border-color .18s ease, color .18s ease;
}

.gallery-nav-btn:hover{
  transform: translateY(-1px);
  border-color: rgba(212,225,87,.35);
  background: rgba(212,225,87,.14);
  color: rgba(212,225,87,.92);
}

.gallery-nav-btn:focus-visible{
  outline:2px solid rgba(212,225,87,.65);
  outline-offset:3px;
}

/* ===== GRID (BENTO) ===== */
.projects-wrap{}

.projects-grid{
  display:grid;
  grid-template-columns: repeat(12, 1fr);
  gap:clamp(14px, 1.8vw, 22px);
}

/* alternate bento sizes */
.projects-grid .project-card{
  grid-column: span 6;
}
.projects-grid .project-card:nth-child(3n){
  grid-column: span 12;
}
@media (max-width: 980px){
  .projects-grid .project-card,
  .projects-grid .project-card:nth-child(3n){
    grid-column: span 12;
  }
}

/* ===== CARD (GLASS + LAYERED) ===== */
.project-card{
  position:relative;
  overflow:hidden;

  border-radius:24px;
  border:1px solid rgba(255,255,255,.12);
  background:
    linear-gradient(180deg, rgba(255,255,255,.08), rgba(255,255,255,.04));

  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);

  box-shadow:
    0 18px 60px rgba(0,0,0,.38),
    inset 0 1px 0 rgba(255,255,255,.10);

  display:grid;
  grid-template-columns: 1fr 1.05fr;
  min-height: 360px;

  transition: transform .22s ease, border-color .22s ease, box-shadow .22s ease;
}

.project-card::before{
  content:"";
  position:absolute;
  inset:-1px;
  background:
    radial-gradient(420px 260px at 20% 20%, rgba(212,225,87,.16), transparent 60%),
    radial-gradient(520px 320px at 80% 70%, rgba(255,255,255,.08), transparent 62%);
  opacity:.75;
  pointer-events:none;
  z-index:0;
}

.project-card:hover{
  transform: translateY(-4px);
  border-color: rgba(212,225,87,.28);
  box-shadow:
    0 22px 70px rgba(0,0,0,.45),
    inset 0 1px 0 rgba(255,255,255,.12);
}

@media (max-width: 980px){
  .project-card{
    grid-template-columns: 1fr;
    min-height: auto;
  }
}

/* ===== CONTENT SIDE ===== */
.project-content{
  position:relative;
  z-index:1;
  padding:clamp(18px, 2.2vw, 28px);
  display:flex;
  flex-direction:column;
  justify-content:center;
  gap:10px;
}

.project-content h3{
  margin:0;
  font-size:clamp(18px, 1.7vw, 24px);
  line-height:1.15;
  letter-spacing:-.015em;
  font-weight:800;
  color:rgba(255,255,255,.92);
}

.project-content p{
  margin:0;
  max-width:60ch;
  font-size:clamp(14px, 1.1vw, 16px);
  line-height:1.55;
  color:rgba(255,255,255,.68);
}

/* accent underline micro detail */
.project-content h3::after{
  content:"";
  display:block;
  width:44px;
  height:2px;
  margin-top:12px;
  border-radius:2px;
  background: linear-gradient(90deg, rgba(212,225,87,.95), rgba(212,225,87,.15));
  opacity:.9;
}

/* ===== MEDIA SIDE ===== */
.project-image{
  position:relative;
  z-index:1;
  padding:clamp(14px, 1.8vw, 18px);
  display:flex;
  align-items:stretch;
  justify-content:stretch;
}

/* gallery frame */
.project-slider{
  border-radius:20px;
}

.project-gallery{
  position:relative;
  width:100%;
  border-radius:20px;
  overflow:hidden;
  border:1px solid rgba(255,255,255,.10);
  background: rgba(10,14,18,.35);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.08);
}

.project-gallery img{
  width:100%;
  height:100%;
  object-fit:cover;
  display:block;

  transform: scale(1.03);
  transition: transform .6s ease, filter .6s ease;
  filter: contrast(1.05) saturate(1.05);
}

.project-card:hover .project-gallery img{
  transform: scale(1.08);
  filter: contrast(1.08) saturate(1.12);
}

/* ===== NAV ARROWS ===== */
.project-nav{
  position:absolute;
  top:50%;
  transform:translateY(-50%);
  width:44px;
  height:44px;
  border-radius:999px;

  border:1px solid rgba(255,255,255,.14);
  background: rgba(10,14,18,.48);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);

  color: rgba(255,255,255,.86);
  font-size:26px;
  line-height:1;

  display:grid;
  place-items:center;

  cursor:pointer;
  transition: transform .16s ease, background .16s ease, border-color .16s ease, color .16s ease;
  z-index:3;
}

.project-prev{ left: 22px; }
.project-next{ right: 22px; }

.project-nav:hover{
  transform: translateY(-50%) scale(1.04);
  border-color: rgba(212,225,87,.35);
  background: rgba(212,225,87,.14);
  color: rgba(212,225,87,.95);
}

.project-nav:focus-visible{
  outline:2px solid rgba(212,225,87,.65);
  outline-offset:3px;
}

/* ===== ACTIONS ===== */
.project-actions{
  position:absolute;
  left:18px;
  bottom:18px;
  z-index:4;
}

.project-action{
  text-decoration:none;
  display:inline-flex;
  align-items:center;
  gap:8px;

  padding:10px 12px;
  border-radius:999px;

  border:1px solid rgba(255,255,255,.14);
  background: rgba(10,14,18,.46);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);

  color: rgba(255,255,255,.82);
  font-weight:800;
  font-size:13px;

  transition: transform .18s ease, background .18s ease, border-color .18s ease, color .18s ease;
}

.project-action:hover{
  transform: translateY(-1px);
  border-color: rgba(212,225,87,.35);
  background: rgba(212,225,87,.14);
  color: rgba(212,225,87,.95);
}

.project-action:focus-visible{
  outline:2px solid rgba(212,225,87,.65);
  outline-offset:3px;
}

/* ===== CTA BUTTON AREA ===== */
.projects-cta{
  margin-top:clamp(18px, 2.4vw, 30px);
  display:flex;
  justify-content:center;
}

.btn.btn-cta{
  border-radius:999px;
  padding:14px 18px;
  border:1px solid rgba(212,225,87,.35);
  background: linear-gradient(90deg, rgba(212,225,87,.20), rgba(212,225,87,.10));
  color: rgba(212,225,87,.96);
  font-weight:900;
  letter-spacing:.02em;

  box-shadow:
    0 18px 60px rgba(0,0,0,.35),
    inset 0 1px 0 rgba(255,255,255,.10);

  transition: transform .18s ease, box-shadow .18s ease, background .18s ease;
  text-decoration:none;
  display:inline-flex;
  align-items:center;
  gap:10px;
}

.btn.btn-cta:hover{
  transform: translateY(-2px);
  background: linear-gradient(90deg, rgba(212,225,87,.26), rgba(212,225,87,.14));
  box-shadow:
    0 22px 70px rgba(0,0,0,.45),
    inset 0 1px 0 rgba(255,255,255,.12);
}

.btn.btn-cta .btn-arrow{
  display:inline-block;
  transform: translateY(1px);
}

/* ===== MOBILE TUNING ===== */
@media (max-width: 560px){
  .gallery-nav{
    border-radius:18px;
    padding:10px;
  }
  .gallery-nav-btn{
    width:100%;
    justify-content:center;
  }
  .project-image{
    padding:14px;
  }
  .project-actions{
    left:14px;
    bottom:14px;
  }
  .project-prev{ left: 14px; }
  .project-next{ right: 14px; }
}

/* FIX GRID HEIGHT / LAYOUT */
.project-card{
  align-items:stretch;
}

.project-gallery{
  height:100%;
  min-height:320px;
}

.project-gallery img{
  height:100%;
}

/* ===============================
PROJECT SLIDER ENGINE
=============================== */

.project-gallery{
  position:relative;
  overflow:hidden;
}

/* ================================
PROJECT SLIDER — REAL STRUCTURE
================================ */

/* viewport */
.project-gallery{
  position:relative;
  width:100%;
  height:100%;
  overflow:hidden;
  border-radius:20px;
}

/* track liigub */
.project-track{
  display:flex;
  height:100%;
  transition:transform .45s ease;
  will-change:transform;
}

/* slide */
.project-track img{
  flex:0 0 100%;
  width:100%;
  height:100%;
  object-fit:cover; /* lõikab ääred kui vaja */
  display:block;
}

/* pildi ala suurus */
.project-image{
  aspect-ratio:4/3;
  min-height:320px;
}

/* =========================
SLIDER WIDTH HARD FIX
========================= */

/* image column peab olema päris container */
.project-image{
  width:100%;
  overflow:hidden;
  padding:0 !important; /* ⭐ eemaldab sliderit lõhkuva paddingu */
}

/* viewport */
.project-gallery{
  width:100%;
  height:100%;
  overflow:hidden;
}

/* track */
.project-track{
  display:flex;
  width:100%;
}

/* iga slide täidab täpselt viewporti */
.project-track img{
  flex:0 0 100%;
  width:100%;
  height:100%;
  min-width:100%; /* ⭐ oluline */
  object-fit:cover;
}

/* =================================
HIDE TOP FILTER NAV
================================= */

.section.projects .gallery-nav{
  display:none !important;
}

/* =================================
ZOOM ICON ONLY
================================= */

.project-zoom{
  width:46px;
  height:46px;
  padding:0;
  justify-content:center;
  font-size:18px;
}

/* =================================
LIGHTBOX OVER HEADER FIX
================================= */

.vl24-lightbox,
[data-vl24-lightbox-overlay],
.lightbox,
.modal{
  z-index:999999 !important;
}

/* header alla */
.site-header,
.header{
  z-index:10;
}

.projects-cta .btn-cta{
  display:none;
}

/* =========================================
VL24 PROJECTS — HEADER SYSTEM (GLOBAL STYLE)
sama feel nagu hero + other sections
========================================= */

/* container spacing */
.section.projects .section-header{
  max-width:1200px;
  margin:0 auto 80px;
}

/* TITLE */
.section.projects .section-header h2{
  margin:0 0 22px;

  font-family: var(--font-heading, Montserrat, sans-serif);
  font-weight:800;

  font-size:clamp(34px, 3.4vw, 52px);
  line-height:1.05;
  letter-spacing:-.02em;

  color:#fff;
  position:relative;
}

/* accent line (VL24 style) */
.section.projects .section-header h2::after{
  content:"";
  display:block;

  width:60px;
  height:3px;
  margin-top:18px;

  border-radius:2px;

  background:linear-gradient(
    90deg,
    var(--brand-primary),
    rgba(212,225,87,.2)
  );
}

/* DESCRIPTION */
.section.projects .section-header p{
  margin:0;

  max-width:640px;

  font-size:18px;
  line-height:1.7;

  color:rgba(255,255,255,.72);
}

/* desktop alignment → left text block */
.section.projects .section-header{
  display:grid;
  grid-template-columns:420px 1fr;
  gap:80px;
  align-items:start;
}

/* mobile */
@media (max-width:900px){

  .section.projects .section-header{
    grid-template-columns:1fr;
    gap:28px;
    margin-bottom:50px;
  }

  .section.projects .section-header p{
    max-width:100%;
  }

}

/* =================================
VL24 PROJECT ZOOM ICON — PREMIUM
================================= */

.project-zoom{
  width:32px;
  height:32px;
  padding:0;

  display:flex;
  align-items:center;
  justify-content:center;

  border-radius:50%;

  background:rgba(10,14,18,.55);
  border:0px solid rgba(212,225,87,.35);

  backdrop-filter:blur(12px);

  color:#ffffff;

  transition:all .25s ease;
}

/* SVG */
.project-zoom svg{
  width:20px;
  height:20px;
  stroke:currentColor;
  stroke-width:2.2;
  fill:none;
}

/* hover */
.project-zoom:hover{
  background:var(--brand-primary);
  color:#111;

  box-shadow:
    0 0 20px rgba(212,225,87,.45),
    0 8px 30px rgba(0,0,0,.35);

  transform:translateY(-2px) scale(1.06);
}

/* subtle pulse idle (premium feel) */
@media (hover:hover){
  .project-zoom{
    animation:vl24ZoomIdle 4s ease-in-out infinite;
  }
}

@keyframes vl24ZoomIdle{
  0%,100%{ box-shadow:0 0 0 rgba(212,225,87,0); }
  50%{ box-shadow:0 0 12px rgba(212,225,87,.25); }
}

/* =====================================
WHY CARDS — MOBILE/TABLET HARD RESET
fix broken top layout
pane faili lõppu
===================================== */

@media (max-width:1200px){

  /* -------------------------
  KILL DESKTOP OVERLAP LOGIC
  ------------------------- */

  /* tabs ei tohi pildi peale ronida */
  .why-tabs{
    margin-bottom:0 !important;
    transform:none !important;
    border-radius:20px !important;
  }

  /* panel padding tagasi normaalseks */
  .why-panel.active{
    padding-top:18px !important;
  }

  /* pildi wrapper reset */
  .why-img{
    margin:0 0 14px 0 !important;
    transform:none !important;
    border-radius:18px !important;
  }

  /* tekst ei tohi üles ronida */
  .why-text{
    margin-top:0 !important;
  }


  /* -------------------------
  REMOVE DARK BAND OVERFLOW
  ------------------------- */

  .vl24-why-cards .vl24-wrap::before{
    top:0 !important;
    bottom:0 !important;
    mask-image:none !important;
    -webkit-mask-image:none !important;
  }


  /* -------------------------
  CLEAN CARD STACK ORDER
  ------------------------- */

  .why-tabs-wrap{
    position:relative !important;
    top:auto !important;
    margin:0 0 16px !important;
    backdrop-filter:none !important;
  }

}

/* =====================================
WHY CARDS — IMAGE FULL WIDTH
mobile + tablet
===================================== */

@media (max-width:1200px){

  /* card padding eemaldame pildi jaoks */
  .why-panel.active{
    padding:0 !important;
    overflow:hidden;
  }

  /* pilt täidab kogu kaardi */
  .why-img{
    margin:0 !important;
    width:100%;
    border-radius:22px 22px 0 0;
    overflow:hidden;
  }

  /* pilt täidab wrapperi */
  .why-img img{
    width:100%;
    height:100%;
    display:block;
    object-fit:cover;
  }

  /* tekstile oma padding */
  .why-text{
    padding:20px 18px 22px !important;
  }

}

/* =====================================
WHY CARDS — READ MORE SPACING
===================================== */

.vl24-why-cards .why-readmore{
  display:inline-block;
  margin-top:18px;   /* ⭐ õhk teksti ja nupu vahel */
}

/* card bottom breathing space */
.vl24-why-cards .why-text{
  padding-bottom:8px;
}

/* =====================================
WHY CARDS — BACKGROUND LAYER FIX
fix broken dark overlay position
===================================== */

/* wrapper peab olema positioning context */
.vl24-why-cards .vl24-wrap{
  position:relative;
  z-index:1;
}

/* background layer jääb sisu taha */
.vl24-why-cards .vl24-wrap::before{
  z-index:-1 !important;     /* ⭐ kõige olulisem fix */
  pointer-events:none;
}

/* kaardid alati layerist kõrgemal */
.why-left,
.why-right,
.why-panel,
.why-img,
.why-text{
  position:relative;
  z-index:2;
}

/* =====================================
WHY CARDS — DARK LAYER POSITION FIX
ONLY MOBILE + TABLET
liigutab tumeda layeri üles
===================================== */

@media (max-width:1200px){

  .vl24-why-cards .vl24-wrap::before{
    top:-140px !important;   /* ⭐ liigutab layeri üles */
    bottom:-20px !important; /* hoiab alumise osa */
  }

}

/* =====================================
WHY CARDS — READ MORE POSITION FIX
ONLY MOBILE + TABLET
===================================== */

@media (max-width:1200px){

  .vl24-why-cards .why-readmore{
    display:inline-block;

    margin-top:24px !important;   /* rohkem õhku teksti alt */
    margin-left:20px;              /* ⭐ vasakust nurgast eemale */
    margin-bottom:20px;           /* ⭐ alumisest nurgast eemale */
  }

}

/* =========================================
PROJECTS — STICKY STACK ENABLE (MOBILE ONLY)
kõige olulisem: kill overflow/transform chain
========================================= */

@media (max-width:980px){

  /* sticky killerid maha */
  .section.projects,
  .section.projects .container,
  .section.projects .projects-wrap,
  .section.projects .projects-grid{
    overflow:visible !important;
    transform:none !important;
    filter:none !important;
    perspective:none !important;
  }

  /* kui kuskil parentil on "contain", tapab ka sticky */
  .section.projects,
  .section.projects *{
    contain: none !important;
  }

}

/* =========================================
PROJECTS — CARD STACK SCROLL (MOBILE ONLY)
kaardid jäävad sticky ja kerivad üksteise peale
========================================= */

@media (max-width:980px){

  .projects-grid{
    gap:0 !important;
  }

  .projects-grid .project-card{
    position:sticky !important;
    top:calc(var(--header-h, 80px) + 16px) !important; /* ⭐ headeri alla */

    margin:0 0 80px 0 !important;  /* ⭐ kui palju "püsib" enne kui järgmine peale tuleb */

    /* oluline: sticky element ei tohi ise transformida */
    transform:none !important;
    will-change:auto !important;
  }

  /* z-index stacking */
  .projects-grid .project-card:nth-child(1){ z-index:1; }
  .projects-grid .project-card:nth-child(2){ z-index:2; }
  .projects-grid .project-card:nth-child(3){ z-index:3; }
  .projects-grid .project-card:nth-child(4){ z-index:4; }
  .projects-grid .project-card:nth-child(5){ z-index:5; }
  .projects-grid .project-card:nth-child(6){ z-index:6; }

}