/* ================= RESET ================= */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* ================= VARIABLES ================= */
:root {
  --k-pi-overlay-bg: rgba(0, 54, 96, 0.9);
  --k-pi-overlay-color: #fff;
  --k-pi-overlay-padding: 20px;
  --k-transition-duration-2: 0.3s;
}

/* ================= BODY ================= */
body {
  font-family: 'Open Sans', Arial, sans-serif;
  background-color: #fff;
  color: #212529;
}

/* ================= HEADER DESKTOP ================= */
.site-header {
  background-color: #fff;
}

.header-top {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 20px 40px;
}

.header-logo img {
  height: 80px;
}

.header-social {
  display: flex;
  justify-content: flex-end;
  gap: 16px;
}

.header-social img {
  width: 22px;
  height: 22px;
}

.header-nav {
  border-bottom: 1px solid #e5e5e5;
}


/* ================= MAIN NAV ================= */
.main-nav {
  text-align: center;
  padding: 20px 0;
}

.main-nav ul {
  display: inline-flex;
  gap: 40px;
  list-style: none;
}

.main-nav a {
  position: relative;
  text-decoration: none;
  color: #1b2a3a;
  font-size: 15px;
  letter-spacing: 0.05em;
  padding-bottom: 6px;
}
/* HEADER */
.site-header {
    padding: 30px 20px 10px;
    text-align: center;
}

.header-top {
    position: relative;
    max-width: 1116px;
    margin: 0 auto 20px;
}

.header-logo h1 {
    margin: 0;
    font-size: 42px;
    font-weight: 700;
    color: #003660;
}

/* SOCIAL ICONS */
.header-social {
    position: absolute;
    right: 0;
    top: 10px;
}

.header-social a {
    margin-left: 10px;
}

.header-social img {
    width: 20px;
    height: 20px;
}

/* NAV */
.main-nav {
    display: flex;
    justify-content: center;
    gap: 40px;
    font-size: 16px;
}

.main-nav a {
    text-decoration: none;
    color: #003660;
    padding-bottom: 5px;
}

/* NO HOVER EN EL ITEM ACTIVO */
.main-nav a.active {
  pointer-events: none;        /* No se puede clicar */
  cursor: default;
}

.main-nav a.active:hover::after {
  transform: scaleX(1);        /* No cambia nada */
}

/* PROYECTOS REALIZADOS ACTIVO */
.main-nav a.active::after {
  transform: scaleX(1);        /* Siempre visible */
}



/* FILTERS */
.portfolio-filters {
    list-style: none;
    display: flex;
    justify-content: center;
    gap: 25px;
    padding: 20px 0;
    margin: 0;
    color: #777;
    font-size: 16px;
}

.portfolio-filters li {
    cursor: pointer;
}

.portfolio-filters li.active {
    color: #000;
    font-weight: 600;
}
/* ================= SECONDARY NAV ================= */
.secondary-nav {
  padding: 20px 40px;
}

.secondary-nav ul {
  display: flex;
  gap: 30px;
  list-style: none;
}

.secondary-nav a {
  position: relative;
  text-decoration: none;
  color: #8a8a8a;
  font-size: 15px;
  padding-bottom: 6px;
}

.secondary-nav .active a {
  color: #1b2a3a;
}

/* ================= UNDERLINES ================= */
.main-nav a::after,
.secondary-nav a::after,
.mobile-subnav a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 2px;
  background-color: #1b2a3a;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s ease;
}

.main-nav a:hover::after,
.secondary-nav a:hover::after,
.main-nav .active a::after,
.secondary-nav .active a::after,
.mobile-subnav .active a::after {
  transform: scaleX(1);
}

/* ================= MOBILE HEADER ================= */
.mobile-header {
  display: none;
  border-bottom: 1px solid #e5e5e5;
}

.mobile-top {
  display: grid;
  grid-template-columns: 40px 1fr 40px;
  align-items: center;
  padding: 16px 20px;
}

.mobile-logo {
  justify-self: center;
}


.burger {
  background: none;
  border: none;
  cursor: pointer;
}

.burger span {
  display: block;
  width: 22px;
  height: 2px;
  background-color: #1b2a3a;
  margin: 5px 0;
}

.mobile-logo img {
  height: 100px;
}

/* ================= MOBILE SUBNAV ================= */
.mobile-subnav {
  display: none;
  padding: 12px 16px;
  overflow-x: auto;
  border-bottom: 1px solid #e5e5e5;
}

.mobile-subnav ul {
  display: flex;
  gap: 24px;
  list-style: none;
  white-space: nowrap;
}

.mobile-subnav a {
  position: relative;
  text-decoration: none;
  color: #8a8a8a;
  font-size: 15px;
  padding-bottom: 6px;
}

.mobile-subnav .active a {
  color: #1b2a3a;
}

/* ================= MENÚ MÓVIL DESPLEGABLE ================= */
.mobile-menu-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 54, 96, 0.85);
  opacity: 0;
  visibility: hidden;
  transition: 0.3s ease;
  z-index: 998;
}

.mobile-menu-overlay.is-open {
  opacity: 1;
  visibility: visible;
}

.mobile-menu {
  position: fixed;
  top: 0;
  left: 0;
  width: 80%;
  max-width: 300px;
  height: 100vh;
  background: #fff;
  padding: 40px 30px;
  transform: translateX(-100%);
  transition: transform 0.3s ease;
  z-index: 999;
}

.mobile-menu.is-open {
  transform: translateX(0);
}

.mobile-menu ul {
  list-style: none;
}

.mobile-menu li {
  margin-bottom: 25px;
}

.mobile-menu a {
  text-decoration: none;
  color: #0b3b6f;
  font-size: 18px;
  letter-spacing: 0.05em;
}

.mobile-menu .active a {
  text-decoration: underline;
}

/* ================= CONTENT ================= */
.content-wrapper {
  padding: 40px 20px;
}

.portfolio-items {
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
  max-width: 1116px;
  margin: 0 auto;
  list-style: none;
}

.portfolio-item {
  flex: 1 1 calc(33.333% - 15px);
}

.portfolio-item img {
  width: 100%;
  display: block;
}

/* ================= FOOTER ================= */
.site-footer {
  background-color: #f0f0f0;
  text-align: center;
  padding: 40px 20px;
}

.footer-social {
  display: flex;
  justify-content: center;
  gap: 16px;
}

/* ================= RESPONSIVE ================= */
@media (max-width: 992px) {
  .portfolio-item {
    flex: 1 1 calc(50% - 15px);
  }
}

@media (max-width: 576px) {
  .portfolio-item {
    flex: 1 1 100%;
  }
}

@media (max-width: 768px) {
  .site-header,
  .header-nav,
  .secondary-nav {
    display: none;
  }

  .mobile-header {
    display: block;
  }

  .mobile-subnav {
    display: block;
  }
}
/* ================= OVERLAY PORTFOLIO ================= */

.portfolio-item__thumbnail {
  position: relative;
  overflow: hidden;
}

.portfolio-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  opacity: 0;
  transition: opacity 0.3s ease;
}

/* Texto en esquina inferior derecha */
.portfolio-text {
  position: absolute;
  right: 20px;
  bottom: 20px;
  color: #fff;
  text-align: right;
  max-width: 80%;
}

.portfolio-text h3 {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 6px;
}

.portfolio-text p {
  font-size: 14px;
  opacity: 0.9;
  line-height: 1.3;
}

/* Hover */
.portfolio-item__thumbnail:hover .portfolio-overlay {
  opacity: 1;
}

.portfolio-text {
  transform: translateY(10px);
  transition: transform 0.3s ease;
}

.portfolio-item__thumbnail:hover .portfolio-text {
  transform: translateY(0);
}

/* ===== GRID PROYECTOS ===== */

body{
font-family: Arial, sans-serif;
margin:0;
}

.portfolio-items{
display:flex;
flex-wrap:wrap;
gap:15px;
padding:40px;
}

.portfolio-item{
flex:1 1 calc(33.33% - 15px);
cursor:pointer;
}

.portfolio-item img{
width:100%;
display:block;
}

/* ===== LIGHTBOX ===== */

.lightbox{
position:fixed;
top:0;
left:0;
width:100%;
height:100%;
background:rgba(0,0,0,0.9);
display:none;
align-items:center;
justify-content:center;
z-index:999;
}

.lightbox.active{
display:flex;
}

.lightbox img{
max-width:90%;
max-height:85%;
}

.lightbox-close{
position:absolute;
top:30px;
right:40px;
font-size:40px;
color:white;
cursor:pointer;
}

.lightbox-prev,
.lightbox-next{
position:absolute;
top:50%;
transform:translateY(-50%);
font-size:40px;
background:none;
border:none;
color:white;
cursor:pointer;
}

.lightbox-prev{left:40px;}
.lightbox-next{right:40px;}
