/* ============================================================
   ADRIAMH.COM — styles.css
   ============================================================ */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: Helvetica, Arial, sans-serif;
  font-size: 12px;
  color: #ed1c24;
}

a:link,
a:visited,
a:hover,
a:active {
  color: #ed1c24;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* ── HEADER / LOGO ── */

header {
  position: relative;
  z-index: 9999;
  font-weight: bold;
}

.logo {
  position: fixed;
  top: 10px;
  left: 50px;
  z-index: 999;
  font-size: 18px;
  line-height: 50px;
}

@media (max-width: 768px) {
  .logo {
    left: 15px;
  }
}

/* ── FOOTER ── */

footer {
  position: fixed;
  bottom: 0;
  width: 100%;
  height: 75px;
  line-height: 75px;
  text-align: center;
  word-spacing: 10px;
  background: white;
  font-weight: bold;
  z-index: 50;
}

@media (max-width: 450px) {
  footer {
    height: 50px;
    line-height: 50px;
  }
}

/* ── INDEX (projectes) ── */

.container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 100px;
  margin: 50px auto 150px;
  width: 100%;
  justify-items: center;
  align-items: center;
}

.item {
  position: relative;
  width: 100%;
  max-width: 1200px;
  margin: auto;
  cursor: pointer;
}

.item img {
  width: 100%;
  height: auto;
  display: block;
}

.text {
  text-align: center;
  margin: 10px 0;
  font-weight: bold;
}

.open {
  float: left;
  padding-top: 10px;
  margin-left: 10px;
}

.open:hover {
  cursor: pointer;
  text-decoration: underline;
}

.num {
  float: right;
  padding-top: 10px;
}

.numfix {
  float: right;
  padding-top: 10px;
  margin-right: 10px;
}

.modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 999;
  background: rgba(255, 255, 255, 0.9);
  overflow: auto;
}

.modalcontent {
  width: 50%;
  margin: 100px auto;
  text-align: justify;
}

[class^="close"] {
  cursor: pointer;
  text-align: center;
  line-height: 100px;
}

[class^="close"]:hover {
  text-decoration: underline;
}

@media (max-width: 1200px) {
  .container {
    grid-template-columns: 1fr;
    gap: 50px;
    width: 100%;
  }
}

@media (max-width: 800px) {
  .modalcontent {
    width: 80%;
  }
}

/* ── INFO ── */

.containerinfo {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 100px;
  margin: 100px auto 150px;
  width: calc(100% - 20px);
  padding: 0 10px;
}

@media (max-width: 800px) {
  .containerinfo {
    grid-template-columns: 1fr;
  }
}

.descripcion {
  position: absolute;
  top: 50%;
  left: 10%;
  transform: translate(-5%, -50%);
  text-align: justify;
  z-index: 1;
}

/* ── DESKTOP GALLERY (masonry) ── */

#gallery {
  margin: 50px auto 150px;
  width: 100%;
}

#gi {
  position: relative;
  width: 100%;
}

.card {
  position: absolute;
  overflow: hidden;
  background: #eee;
  cursor: zoom-in;
}

.card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.35s ease;
}

.card:hover img {
  transform: scale(1.04);
}

/* ── LIGHTBOX ── */

#lightbox {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(255, 255, 255, 1);
  z-index: 999;
  overflow: hidden;
  justify-content: center;
  align-items: center;
}

#lightbox.open {
  display: flex;
}

#lb-img {
  display: block;
  width: auto;
  height: auto;
  max-width: 100vw;
  max-height: 82vh;
}

#lb-close {
  position: fixed;
  top: 16px;
  right: 22px;
  font-size: 10px;
  font-weight: bold;
  letter-spacing: .12em;
  text-transform: uppercase;
  background: none;
  border: none;
  cursor: pointer;
  color: #ed1c24;
  z-index: 1000;
}

#lb-close:hover {
  text-decoration: underline;
}

#lb-caption {
  position: fixed;
  bottom: 85px;
  width: 100%;
  text-align: center;
  font-size: 10px;
  font-weight: bold;
}

/* ── MOBILE: single-column infinite scroll ── */

#mobile-scroll {
  display: none;
}

@media (max-width: 768px) {

  #gallery,
  #lightbox {
    display: none !important;
  }

  #mobile-scroll {
    display: block;
    padding-top: 50px;
    padding-bottom: 65px;
  }

  .scroll-item {
    display: block;
    width: 100%;
    line-height: 0;
    margin-bottom: 50px;
  }

  .scroll-item img {
    display: block;
    width: 100%;
    height: auto;
  }

  .scroll-item .scroll-caption {
    display: block;
    margin-top: 10px;
    text-align: center;
    font-size: 10px;
    font-weight: bold;
    line-height: 1.4;
    color: #ed1c24;
  }
}