/* =========================================
   TEODORS LAPSA - GALVENAIS STILU FAILS
   Visas lapas izmanto šo vienu failu.
========================================= */

/* --- 1. PAMATA IESTATĪJUMI UN KRĀSAS --- */
:root {
  --beige:       #ffffff;
  --navy:        #1a2744;
  --navy-mid:    #243358;
  --navy-light:  #2e4070;
  --bg-text:     rgba(0, 0, 0, 0.15);
  --row-h:       32vw;
  --nav-h:       80px;
}

*, *::before, *::after { 
  box-sizing: border-box; 
  margin: 0; 
  padding: 0; 
}

html {
  scroll-behavior: smooth;
  background-color: #111111;
}

body {
  color: var(--navy);
  font-family: "neue-haas-grotesk-display", sans-serif;
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
}

::selection { background-color: #961a24; color: #ffffff; }
::-moz-selection { background-color: #961a24; color: #ffffff; }


/* --- 2. NAVIGĀCIJAS JOSLA (AUGŠA) --- */
nav {
  position: fixed; 
  top: 0; left: 0; right: 0; 
  z-index: 100;
  background: #111111 !important; 
  height: var(--nav-h);
  display: flex; 
  align-items: center;        
  justify-content: center;    
  gap: 2.5rem;                  
  padding: 0 2rem;
}

.nav-logo {
  color: #ffffff;
  text-decoration: none;
  font-weight: 900;
  text-transform: uppercase; 
  font-size: 1.1rem;
  letter-spacing: 0.3em; 
  white-space: nowrap;
  z-index: 110;
}

.nav-links {
  display: flex; 
  align-items: center; 
  gap: 3rem;
}

nav a.nav-item {
  color: #ffffff; 
  text-decoration: none;
  font-weight: 700; 
  font-size: 1.1rem;
  text-transform: lowercase; 
  transition: color 0.2s, opacity 0.2s; 
}

nav a.nav-item:hover { color: #961a24; opacity: 1; }
nav a.nav-item.active-page { color: #961a24; }

.nav-right-features {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  position: absolute; 
  right: 4rem; 
  top: 50%;
  transform: translateY(-50%); 
}

nav a.lang-btn { color: #961a24; }
nav a.lang-btn:hover { color: #ffffff; }

.nav-ig-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease;
}

.nav-ig-icon svg {
  width: 17px; height: 17px;
  color: #ffffff;
  transition: color 0.3s ease;
}

.nav-ig-icon:hover svg { color: #961a24; }
.nav-ig-icon:active { transform: scale(0.95); }

.menu-toggle {
  display: none;
  flex-direction: column;
  justify-content: space-between;
  width: 24px; height: 16px;
  background: none; border: none; cursor: pointer;
  z-index: 110;
}

.menu-toggle span {
  width: 100%; height: 2px;
  background-color: #ffffff;
  transition: all 0.3s ease;
}


/* --- 3. SĀKUMLAPA (INDEX.HTML) --- */
@keyframes gradient {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

.hero {
  height: 100vh; 
  padding-top: calc(var(--nav-h) + 4rem); 
  display: flex;
  justify-content: space-between; 
  padding-left: 4rem; padding-right: 4rem;
  background: linear-gradient(-45deg, #f3e8ee, #dbeafe, #fee2e2, #f5f5f4);
  background-size: 420% 420%;
  animation: gradient 15s ease infinite;
}

.hero-left, .hero-right {
  font-weight: 900; font-size: 1.1rem; text-transform: uppercase;
  color: #ffffff; mix-blend-mode: difference;
}
.hero-left { letter-spacing: 0.15em; }
.hero-right { font-weight: 700; letter-spacing: 0.05em; }

.scroll-down {
  position: absolute; bottom: 40px; left: 50%;         
  transform: translateX(-50%); color: #ffffff;    
  mix-blend-mode: difference; opacity: 0.7; transition: 0.3s ease;
}
.scroll-down:hover { opacity: 1; transform: translateX(-50%) translateY(3px); }

#darbi-section { background-color: #111111; position: relative; z-index: 5; }
.collage { display: flex; flex-direction: column; }
.collage-row {
  display: flex; height: var(--row-h); overflow-x: scroll; 
  scrollbar-width: none; cursor: grab;
}
.collage-row:active { cursor: grabbing; }
.collage-row::-webkit-scrollbar { display: none; }
.col-img { 
  flex-shrink: 0; height: 100%; background-size: cover; background-position: center; 
  aspect-ratio: var(--aspect-ratio); user-select: none; -webkit-user-drag: none;     
}

.cta { text-align: center; padding: 5rem 2rem; background: #111111; }
.cta h2 { font-size: clamp(1.8rem, 3.5vw, 2.8rem); color: var(--beige); font-weight: 900; }
.cta p { color: rgba(240,235,224,0.50); font-size: 0.9rem; margin-top: 0.8rem; }
.cta-btn { 
  display: inline-block; margin-top: 2rem; padding: 0.85rem 2.5rem; 
  border: 1.5px solid rgba(240,235,224,0.35); color: var(--beige); 
  text-decoration: none; font-size: 0.8rem; letter-spacing: 0.18em; text-transform: uppercase; 
  transition: 0.2s;
}
.cta-btn:hover { background: rgba(240,235,224,0.08); border-color: rgba(240,235,224,0.7); }


/* --- 4. DARBU SADAĻA (DARBI.HTML) --- */
.work-container {
  background-color: #111111; min-height: 100vh;
  padding: calc(var(--nav-h) + 4rem) 4rem 5rem 4rem; display: flex; flex-direction: column;
}
.work-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem; width: 100%; }
.work-card { position: relative; aspect-ratio: 16 / 10; overflow: hidden; display: block; background-color: #1a1a1a; }
.work-card .card-bg {
  position: absolute; top: 0; left: 0; width: 100%; height: 100%;
  background-size: cover; background-position: center; filter: grayscale(100%); 
  transition: filter 0.5s ease, transform 0.6s cubic-bezier(0.16, 1, 0.3, 1); z-index: 1;
}
.work-card:hover .card-bg { filter: grayscale(0%); }
.card-info {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); z-index: 5;
  text-align: center; color: #ffffff; transition: 0.4s ease; pointer-events: none; width: 90%;
}
.work-card:hover .card-info { opacity: 0; transform: translate(-50%, -50%) scale(0.95); }
.card-info h2 { font-weight: 900; font-size: 2rem; text-transform: uppercase; letter-spacing: 0.05em; line-height: 1.2; }
.card-category { font-weight: 700; font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.15em; color: rgba(255, 255, 255, 0.7); display: block; margin-top: 0.5rem; }


/* --- 5. KATRA ATSEVIŠĶĀ PROJEKTA LAPA --- */
.project-container {
  background-color: #111111; min-height: 100vh;
  padding: calc(var(--nav-h) + 4rem) 4rem 6rem 4rem;
}
.project-header { text-align: center; margin-bottom: 4rem; }
.project-header h1 { font-weight: 900; font-size: 1.8rem; text-transform: uppercase; letter-spacing: 0.15em; color: #ffffff; }
.project-gallery { column-count: 3; column-gap: 8px; width: 100%; max-width: 1100px; margin: 0 auto; padding: 0 1rem; }
.project-gallery img { width: 100%; height: auto; display: block; margin-bottom: 8px; cursor: pointer; transition: 0.3s ease; }
.project-gallery img:hover { opacity: 0.8; }

.back-to-works-container { text-align: center; margin: 80px 0 20px 0; }
.back-to-works-btn {
  color: #ffffff; text-decoration: none; font-weight: 350; font-size: 13px; text-transform: lowercase;
  letter-spacing: 2px; display: inline-block; transition: 0.3s ease; 
}
.back-to-works-btn:hover { color: #961a24; text-decoration: underline; text-underline-offset: 5px; }

.suggested-section { max-width: 1100px; margin: 6rem auto 0 auto; padding: 0 1rem; }
.suggested-section h2 { font-weight: 700; font-size: 1.1rem; color: #ffffff; margin-bottom: 1.5rem; letter-spacing: 0.05em; }
.suggested-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }

/* Lightbox */
.popup-overlay {
  position: fixed; top: 0; left: 0; width: 100%; height: 100%;
  background-color: rgba(0, 0, 0, 0.95); display: flex; align-items: center; justify-content: center;
  z-index: 200; opacity: 0; visibility: hidden; transition: 0.4s ease;
}
.popup-overlay.active { opacity: 1; visibility: visible; }
.popup-content { position: relative; max-width: 85%; max-height: 85%; display: flex; justify-content: center; align-items: center; }
.popup-content img { max-width: 100%; max-height: 90vh; object-fit: contain; box-shadow: 0 0 30px rgba(0,0,0,0.5); }
.popup-nav { position: absolute; top: 0; bottom: 0; width: 15%; background: none; border: none; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.popup-nav svg { width: 60px; height: 60px; opacity: 0.3; transition: 0.3s ease; }
.popup-nav:hover svg { opacity: 1; transform: scale(1.2); }
.prev { left: 0; } .next { right: 0; }
.popup-close { position: absolute; top: 30px; right: 40px; font-size: 3rem; color: white; background: none; border: none; cursor: pointer; opacity: 0.5; z-index: 210; }
.popup-close:hover { opacity: 1; }


/* --- 6. KONTAKTI / PAR MANI (KONTAKTI.HTML) --- */
body.contact-page-bg { 
  background-color: #fcecee; 
  color: #111111; 
  display: block; 
}

/* 1. KOPĒJAIS KONTEINERS */
.editorial-container {
  width: 100%; 
  max-width: 100%; 
  margin: var(--nav-h) auto 0 auto; 
  padding: 3rem 4rem 3rem 4rem; 
  min-height: calc(100vh - var(--nav-h)); 
  display: grid;
  grid-template-columns: 1fr 1fr; 
  gap: 4rem;
  align-items: stretch; 
}

/* 2. KOLONNAS */
.editorial-column { 
  display: flex; 
  flex-direction: column; 
  align-items: flex-start; 
}

.editorial-column.right-side { 
  align-items: flex-end; 
}

.editorial-title {
  font-family: "neue-haas-grotesk-display", sans-serif; 
  font-weight: 800; 
  font-size: clamp(2.2rem, 4.5vw, 4.2rem); 
  text-transform: uppercase; 
  line-height: 1; 
  letter-spacing: -0.02em; 
  color: #111111; 
  margin-bottom: 2rem; 
  white-space: nowrap; 
}

.editorial-title.right-align { 
  text-align: right; 
}

/* 3. TEKSTA UN BILŽU IZMĒRI */
.editorial-text { 
  font-size: 0.95rem; 
  line-height: 1.6; 
  color: #222222; 
  width: 100%;
  max-width: 550px; 
}

.editorial-column.right-side .editorial-text { 
  text-align: right; 
}

.editorial-img { 
  width: 100%; 
  max-width: 550px; 
  height: 320px; 
  object-fit: cover;
  display: block; 
  margin-top: auto; 
}

.editorial-text ul { list-style: none; padding: 0; margin: 0; }
.editorial-text li { margin-bottom: 15px; }
.editorial-text strong { display: block; color: #961a24; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.1em; margin-bottom: 0.4rem; }

.gear-list { list-style-type: none; padding-left: 0 !important; margin-top: 5px !important; }
.gear-list li { margin-bottom: 2px !important; font-size: 0.95em; }

.adobe-icon {
  display: inline-flex; align-items: center; justify-content: center;
  background-color: #001E36; color: #31A8FF; font-family: Arial, sans-serif;
  font-weight: bold; font-size: 0.8em; height: 1.7em; width: 1.7em;
  border-radius: 4px; vertical-align: middle; margin: 0 4px; line-height: 1;
}

/* 4. LIELĀ POGA */
.cta-center-container {
  grid-column: span 2; 
  width: 100%;
  max-width: 100%;
  margin: 3rem 0 0 0; 
}

.huge-contact-btn {
  width: 100%;
  background: transparent !important; 
  border: 2px solid #111111 !important;  
  color: #111111 !important;            
  padding: 1.5rem;
  font-size: clamp(1.5rem, 3vw, 2.5rem);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  cursor: pointer;
  transition: color 0.3s ease;
}

.huge-contact-btn:hover {
  background: transparent !important;
  color: #961a24 !important; 
}

/* Pop-up fiksētais fons */
.form-overlay {
  position: fixed; 
  top: 0; left: 0; 
  width: 100vw; height: 100vh;
  background-color: rgba(0, 0, 0, 0.85); 
  display: flex; align-items: center; justify-content: center;
  z-index: 9999; opacity: 0; visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.form-overlay.active { opacity: 1; visibility: visible; }

.form-popup-content {
  background-color: #fcecee; padding: 3rem;
  width: 90%; max-width: 500px; position: relative;
  box-shadow: 0 15px 40px rgba(0,0,0,0.5);
}

/* Formas dizains */
.popup-form-title { font-size: 2rem; text-transform: uppercase; font-weight: 800; margin-bottom: 2rem; color: #111111; }
.popup-actual-form { display: flex; flex-direction: column; gap: 1.2rem; }

.popup-input, .popup-textarea {
  width: 100%; padding: 1rem; border: 1.5px solid rgba(11, 11, 11, 0.2);
  background: transparent; font-family: inherit; font-size: 0.95rem; color: #111111; outline: none;
}
.popup-textarea { min-height: 140px; resize: vertical; }
.popup-input:focus, .popup-textarea:focus { border-color: #961a24; }

.popup-submit-btn {
  background-color: #111111; color: #fcecee; border: none; padding: 1rem;
  font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; cursor: pointer;
}
.popup-submit-btn:hover { background-color: #961a24; }

.footer-email-link {
  display: inline-block; font-weight: 700; color: #ffffff; text-decoration: none;
  text-transform: uppercase; letter-spacing: 0.2em; font-size: 0.9rem; margin-bottom: 2rem; transition: 0.3s;
}
.footer-email-link:hover { color: #961a24; }


/* --- 7. KĀJENE (FOOTER) --- */
footer { 
  background: #111111 !important; color: rgba(255,255,255,0.2) !important;
  border-top: 1px solid rgba(255,255,255,0.05); text-align: center; 
  padding: 3rem 1.5rem 2rem 1.5rem; font-size: 0.72rem; letter-spacing: 0.1em; width: 100%;
}


/* --- 8. MOBILĀ VERSIJA --- */
@media (max-width: 768px) {
  .nav-right-features { position: static; transform: none; flex-direction: column; align-items: center; gap: 2rem; margin-top: 1rem; }
  .nav-ig-icon svg { width: 22px; height: 22px; }
  .editorial-container { 
    grid-template-columns: 1fr; 
    padding: 2rem 1.5rem 3rem 1.5rem; 
    min-height: auto; 
    align-items: start; 
  }
  .editorial-title { white-space: normal; }
  .editorial-title.right-align { text-align: left; }
  .editorial-column { align-items: flex-start !important; }
  .editorial-column.right-side .editorial-text { text-align: left; }
  .editorial-img { height: auto; max-height: 380px; margin-top: 2rem; } 
  .cta-center-container { grid-column: span 1; margin-top: 2rem; }
}

@media (max-width: 680px) {
  :root { --row-h: 65vw; --nav-h: 60px; }
  nav { height: var(--nav-h); justify-content: space-between; padding: 0 1.5rem; }
  .nav-logo { letter-spacing: 0.15em; font-size: 0.95rem; }
  .menu-toggle { display: flex; }
  .menu-toggle.active span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .menu-toggle.active span:nth-child(2) { transform: translateY(-7px) rotate(-45deg); }
  
  .nav-links {
    position: fixed; top: 0; left: 0; width: 100%; height: 100vh;
    background-color: #111111; flex-direction: column; justify-content: center;
    transform: translateY(-100%); transition: transform 0.4s; z-index: 100;
  }
  .nav-links.active { transform: translateY(0); }
  nav a.nav-item { font-size: 1.5rem; }

  .hero { height: 100vh; flex-direction: column; padding: calc(var(--nav-h) + 3rem) 1.5rem 0 1.5rem; }
  .cta-btn { width: 100%; max-width: 300px; }
  .work-container { padding: calc(var(--nav-h) + 2rem) 1.5rem 4rem 1.5rem; }
  .work-grid { grid-template-columns: 1fr; }
  .work-card { aspect-ratio: 4 / 3; }
  .project-gallery { column-count: 1; padding: 0; }
  .suggested-grid { grid-template-columns: 1fr; }
  .popup-nav { width: 20%; }
  .popup-nav svg { width: 40px; height: 40px; }
  .popup-close { top: 20px; right: 20px; font-size: 2.5rem; }
}


/* --- 9. ARHĪVA LAPA (ARHIVS.HTML) --- */
.archive-page-wrapper {
  min-height: 100vh;
  background-color: #111111;
  padding-top: var(--nav-h); 
  display: flex;
  align-items: center;
  justify-content: center;
}

.archive-hero-link {
  text-decoration: none;
  display: block;
  width: 95%;
  max-width: 1400px;
  position: relative; 
  z-index: 50; 
}
.archive-container {
  display: flex;
  gap: 0; /* Nomainīts no 10px uz 0. Šis noņem iekšējās līnijas */
  background-color: #ffffff; 
  padding: 10px; /* Šis saglabā balto rāmi apkārt visam blokam */
  filter: grayscale(100%);
  transition: filter 0.5s ease;
}

.archive-title {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: #961a24; 
  -webkit-text-stroke: 1px #69e5db; 
  mix-blend-mode: difference;
  font-size: clamp(3rem, 7vw, 6rem); 
  font-weight: 900;
  letter-spacing: 0.05em;
  z-index: 10;
  margin: 0;
  white-space: nowrap;
  pointer-events: none; 
  transition: opacity 0.4s ease, visibility 0.4s;
}

.image-square {
  flex: 1; 
  aspect-ratio: 1 / 1; 
  position: relative;
  overflow: hidden;
  background-color: #1a1a1a;
}

.image-square img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.8s ease-in-out; 
}

.image-square img.active {
  opacity: 1;
}

.archive-hero-link:hover .archive-container {
  filter: grayscale(0%);
}

.archive-hero-link:hover .archive-title {
  opacity: 0;
  visibility: hidden;
}

@media (max-width: 768px) {
  .archive-container { 
    gap: 4px; 
    padding: 4px; 
  }
}

/* --- 10. ARHĪVA IEKŠLAPA (FILTRS UN GALERIJA) --- */
.archive-inner-container {
  min-height: 100vh;
  background-color: #111111;
  padding: calc(var(--nav-h) + 2rem) 4rem 4rem 4rem;
}

.filter-wrapper {
  display: flex;
  align-items: center;
  gap: 2rem;
  margin-bottom: 4rem;
  font-family: "neue-haas-grotesk-display", sans-serif;
}

.filter-main {
  background: transparent;
  border: 1.5px solid rgba(240, 235, 224, 0.35); 
  color: #ffffff;
  font-size: 1rem;
  font-weight: 700;
  text-transform: uppercase;
  padding: 0.85rem 2.5rem;
  letter-spacing: 0.18em;
  cursor: pointer;
  transition: 0.3s ease;
}

.filter-main:hover {
  background: rgba(240, 235, 224, 0.08);
  border-color: rgba(240, 235, 224, 0.7);
  color: #961a24; 
}

.filter-options {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  opacity: 0;
  visibility: hidden;
  transform: translateX(-20px);
  transition: all 0.4s ease;
}

.filter-options.visible {
  opacity: 1;
  visibility: visible;
  transform: translateX(0);
}

.filter-options.level-2 {
  display: none; 
  border-left: 1px solid rgba(255, 255, 255, 0.2);
  padding-left: 1.5rem;
}

.sub-label {
  color: rgba(255, 255, 255, 0.5);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  font-weight: 700;
}

.filter-btn {
  background: none;
  border: none;
  color: #ffffff;
  font-size: 0.9rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  cursor: pointer;
  transition: color 0.2s ease, opacity 0.2s ease;
  opacity: 0.5;
}

.filter-btn:hover, .filter-btn.active {
  color: #961a24;
  opacity: 1;
}

/* GALERIJAS REŽĢIS (RINDU IZIETOJUMS) */
.gallery-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  width: 100%;
}

.grid-item {
  height: 280px; /* Bāzes augstums VISĀM bildēm. Vērtību vari mainīt! */
  flex-grow: 1;
  position: relative;
  overflow: hidden;
  background-color: #111111;
  transition: opacity 0.4s ease, transform 0.4s ease;
}

.grid-item img {
  width: 100%;
  height: 100%;
  object-fit: cover; /* Nodrošina, ka rinda tiek glīti aizpildīta */
  display: block;
  transition: transform 0.5s ease;
}

.grid-item:hover img {
  transform: scale(1.03);
}

.grid-item.hidden {
  display: none;
}

/* Ļoti svarīgi! Novērš to, ka lapas pašā apakšā pēdējās 1 vai 2 bildes izstiepjas pa visu ekrāna platumu */
.gallery-grid::after {
  content: '';
  flex-grow: 999;
}

/* RESPONSIVITĀTE UZ MAZĀKIEM EKRĀNIEM */
@media (max-width: 1024px) {
  .filter-wrapper { flex-direction: column; align-items: flex-start; gap: 1rem; }
  .grid-item { height: 230px; } /* Uz planšetēm bildes nedaudz zemākas */
}

@media (max-width: 768px) {
  .archive-inner-container { padding: calc(var(--nav-h) + 1rem) 1.5rem 2rem 1.5rem; }
  .grid-item { height: 180px; } /* Uz telefoniem vēl zemākas, lai smukāk ietilpst */
}