/* Gallery styles — adapted from chiisao, restyled to fit hyde. */

/* Project cards grid (proyectos list) */
.proyectos-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
  margin-top: 1.5rem;
}
@media (min-width: 48em) {
  .proyectos-grid { grid-template-columns: 1fr 1fr; }
}
@media (min-width: 64em) {
  .proyectos-grid { grid-template-columns: repeat(3, 1fr); }
}

.project-card {
  display: block;
  color: inherit;
  text-decoration: none;
}
.project-card__image-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  margin-bottom: 0.5rem;
  background: #f4f4f4;
}
.project-card__image-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: opacity 0.25s ease, transform 0.25s ease;
}
.project-card:hover .project-card__image-wrap img {
  opacity: 0.85;
  transform: scale(1.02);
}
.project-card__image-wrap--empty { background: #eaeaea; }
.project-card__title {
  font-size: 1rem;
  font-weight: 700;
  margin: 0.4rem 0 0;
}

/* Project / demonios page body */
.project-title {
  margin-bottom: 0.5rem;
}
.project-body { margin: 1.5rem 0; }
.project-cover {
  display: block;
  max-width: 100%;
  margin: 1.5rem auto;
  border-radius: 4px;
}

/* Masonry grid */
.gallery-masonry {
  columns: 2;
  column-gap: 10px;
  margin-top: 1.5rem;
}
.gallery-masonry--3,
.gallery-masonry--4 { display: none; }

.gallery-masonry__item {
  display: block;
  break-inside: avoid;
  margin-bottom: 10px;
  overflow: hidden;
  cursor: zoom-in;
}
.gallery-masonry__item img {
  width: 100%;
  height: auto;
  display: block;
  transition: opacity 0.25s ease, transform 0.25s ease;
}
.gallery-masonry__item:hover img {
  opacity: 0.88;
  transform: scale(1.025);
}

@media (min-width: 480px) {
  .gallery-masonry--2 { display: none; }
  .gallery-masonry--3 { display: block; columns: 3; }
}
@media (min-width: 1100px) {
  .gallery-masonry--3 { display: none; }
  .gallery-masonry--4 { display: block; columns: 4; }
}

/* Hidden source list used to preserve original image order for the lightbox */
#gallery-sources {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* About / Sobre mí landing page */
.about-home {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.25rem;
  text-align: center;
}
@media (min-width: 48em) {
  .about-home {
    flex-direction: row;
    align-items: flex-start;
    text-align: left;
    gap: 2rem;
  }
}

.about-home__photo {
  width: 160px;
  height: 160px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  background: #eaeaea;
}
.about-home__photo--placeholder {
  background: #d8d8d8;
}

.about-home__body {
  display: flex;
  flex-direction: column;
}

.about-home__name {
  font-size: 2.2rem;
  line-height: 1.1;
  margin: 0 0 0.25rem;
  color: #333;
}

.about-home__tagline {
  font-size: 0.95rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent, #777);
  margin: 0 0 1.1rem;
}

@media (min-width: 48em) {
  .about-home__name { margin-top: 0.25rem; }
}

.about-home__bio {
  font-size: 1rem;
  line-height: 1.75;
  color: #444;
}
.about-home__bio p + p { margin-top: 0.8em; }
.about-home__bio a {
  color: var(--accent, inherit);
  font-weight: 600;
}
.about-home__bio a:hover { text-decoration: underline; }

.about-home__social {
  display: flex;
  gap: 1rem;
  margin-top: 1.3rem;
}
.about-home__social a {
  color: var(--accent, #555);
  display: flex;
  align-items: center;
  transition: opacity 0.25s ease;
}
.about-home__social a:hover { opacity: 0.6; }

@media (max-width: 47.99em) {
  .about-home__social { justify-content: center; }
}

/* ============================================================
   MOBILE NAV (hamburger, slide-out sidebar)
   Mirrors chiisao's pattern. Hyde's sidebar is position: static
   at <48em by default; we override to fixed + off-canvas so the
   hamburger toggles it in/out. Desktop layout is untouched.
   ============================================================ */
.mobile-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: #fff;
  border-bottom: 1px solid #e0e0e0;
  position: sticky;
  top: 0;
  z-index: 200;
}

.mobile-site-name {
  font-family: "Abril Fatface", serif;
  font-size: 1.1rem;
  font-weight: 700;
  color: #333;
  letter-spacing: 0.02em;
}

.menu-toggle {
  display: flex;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}

.hamburger {
  display: block;
  width: 22px;
  height: 2px;
  background: #333;
  border-radius: 2px;
  transition: transform 0.25s ease, opacity 0.25s ease;
}

.menu-toggle[aria-expanded="true"] .hamburger:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.menu-toggle[aria-expanded="true"] .hamburger:nth-child(2) {
  opacity: 0;
}
.menu-toggle[aria-expanded="true"] .hamburger:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 290;
}
.sidebar-overlay.active { display: block; }

/* Mobile: convert hyde sidebar to a slide-out panel */
@media (max-width: 47.99em) {
  .sidebar {
    position: fixed !important;
    top: 0;
    left: 0;
    bottom: 0;
    width: 18rem;
    height: 100dvh;
    transform: translateX(-100%);
    transition: transform 0.25s ease;
    z-index: 300;
    overflow-y: auto;
    text-align: left;
  }
  .sidebar.open { transform: translateX(0); }
  /* Disable hyde's bottom-sticky positioning inside the panel */
  .sidebar .sidebar-sticky { position: static; }
}

/* Desktop: hide mobile header, sidebar behaves like normal hyde */
@media (min-width: 48em) {
  .mobile-header { display: none; }
  .sidebar-overlay { display: none !important; }
}