/* ============================================
   FIDEL ARTEAGA MÁRQUEZ · PORTAFOLIO
   Estilos personalizados
   ============================================ */

:root {
  --coral: #E27664;
  --coral-soft: #ECA08F;
  --bg-dark: #0a0a0a;
  --bg-darker: #050505;
  --text-light: #f5f5f5;
  --text-muted: #a3a3a3;
  --text-dimmer: #6b6b6b;
}

/* Smooth scroll */
html {
  scroll-behavior: smooth;
}

/* Layout: footer queda al final, aparece solo al scrollear hasta abajo */
body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main {
  flex: 1 0 auto;
}

/* ============================================
   HERO (Inicio): fondo oscuro con textura arquitectónica
   ============================================ */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background-color: var(--bg-dark);
}

/* Gradiente que simula estructura arquitectónica geométrica oscura.
   Cuando agregues img/hero/portada.jpg se prefiere esa imagen automáticamente. */
.hero-bg {
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle at 25% 40%, rgba(80,80,80,0.35), transparent 55%),
    radial-gradient(circle at 75% 60%, rgba(50,50,50,0.4), transparent 50%),
    linear-gradient(135deg, #0a0a0a 0%, #1a1a1a 45%, #0f0f0f 100%);
  background-size: cover;
  background-position: center;
}

/* Si existe la imagen de hero, úsala */
.hero-bg.has-image {
  background-image: url('../img/hero/portada.jpg');
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(0,0,0,0.3) 0%,
    rgba(0,0,0,0.5) 100%
  );
}

/* Nombre del hero con tracking generoso (estilo arquitectónico) */
.hero-name-link {
  text-decoration: none;
  display: inline-block;
  cursor: pointer;
}

.hero-name {
  font-weight: 300;
  letter-spacing: 0.4em;
  text-transform: uppercase;
  color: var(--coral);
  text-align: center;
  line-height: 1.3;
}

.hero-tag {
  font-weight: 400;
  letter-spacing: 0.35em;
  text-transform: uppercase;
  color: var(--coral-soft);
  font-size: 0.7rem;
}

@media (min-width: 640px) {
  .hero-tag { font-size: 0.8rem; }
}

/* Indicador de scroll abajo del hero */
.scroll-indicator {
  position: absolute;
  bottom: 2.5rem;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(255,255,255,0.6);
  animation: bounce 2.5s ease-in-out infinite;
}

@keyframes bounce {
  0%, 100% { transform: translate(-50%, 0); opacity: 0.6; }
  50% { transform: translate(-50%, 8px); opacity: 1; }
}

/* Animación de entrada del nombre */
.fade-in {
  animation: fadeUp 1.2s ease-out 0.2s both;
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ============================================
   NAV
   ============================================ */
.nav-link {
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  transition: color 0.2s ease;
}

.nav-link:hover,
.nav-link.active {
  color: var(--coral);
}

.logo-square {
  width: 26px;
  height: 26px;
  background-color: var(--coral);
  display: block;
  transition: transform 0.2s ease;
}

.logo-square:hover {
  transform: scale(1.1);
}

/* ============================================
   FOOTER (centrado, kaomoji en coral)
   ============================================ */
.footer {
  border-top: 1px solid rgba(0,0,0,0.08);
  background-color: #ffffff;
  padding: 2.25rem 0;
  font-size: 0.85rem;
  color: var(--text-dimmer);
  text-align: center;
}

.footer-inner {
  max-width: 80rem;
  margin: 0 auto;
  padding: 0 1.5rem;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 1rem;
}

.footer-kawaii {
  grid-column: 2;
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  letter-spacing: 0.05em;
  color: var(--coral);
  font-size: 0.95rem;
  text-align: center;
}

.footer-icons {
  grid-column: 3;
  justify-self: end;
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.footer-icon {
  width: 20px;
  height: 20px;
  color: var(--coral);
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.footer-icon:hover {
  transform: translateY(-2px);
  opacity: 0.85;
}

/* ============================================
   PÁGINAS DE GALERÍA (Profesional, Académico)
   ============================================ */
.section-title {
  font-weight: 300;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--coral);
}

.firm-label {
  font-weight: 600;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  font-size: 0.75rem;
  color: #1a1a1a;
}

.project-card {
  position: relative;
  overflow: hidden;
  cursor: pointer;
  background-color: #f5f5f5;
  aspect-ratio: 4 / 3;
}

.project-card::after {
  content: '';
  position: absolute;
  inset: 0;
  border: 4px solid transparent;
  pointer-events: none;
  z-index: 4;
  transition: border-color 0.25s ease;
}

.project-card:hover::after {
  border-color: var(--coral);
}

.project-card-fallback {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 1rem;
  background: linear-gradient(135deg, #f0f0f0 0%, #e8e8e8 100%);
  color: #999;
  font-size: 0.75rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  z-index: 1;
}

.project-card-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 2;
}

/* Overlay con nombre del proyecto, aparece al hover (sin degradado) */
.project-card-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: flex-end;
  padding: 1rem 1.25rem;
  opacity: 0;
  transition: opacity 0.25s ease;
  z-index: 3;
  pointer-events: none;
  background: transparent;
}

.project-card:hover .project-card-overlay {
  opacity: 1;
}

.project-card-name {
  color: var(--coral);
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  font-size: 0.85rem;
}

/* Botón clickable sobre el nombre de oficina (estilo invisible) */
.firm-name-btn {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  font-family: inherit;
  display: block;
  margin: 0 auto;
  text-align: center;
  transition: opacity 0.2s ease;
}

.firm-name-btn:hover { opacity: 0.75; }

/* ============================================
   LIGHTBOX
   ============================================ */
.lightbox {
  position: fixed;
  inset: 0;
  background-color: #ffffff;
  z-index: 100;
  display: none;
  flex-direction: column;
  overflow-y: auto;
}

.lightbox.open {
  display: flex;
}

.lightbox-close {
  position: fixed;
  top: 1.5rem;
  right: 1.5rem;
  color: var(--coral);
  background: none;
  border: none;
  cursor: pointer;
  z-index: 110;
  padding: 0.5rem;
  transition: opacity 0.2s ease;
}

.lightbox-close:hover { opacity: 0.7; }

.lightbox-content {
  max-width: 1100px;
  margin: 4rem auto;
  padding: 0 1.5rem;
  color: var(--coral);
  text-align: left;
}

.lightbox-title {
  color: var(--coral);
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  font-size: 1rem;
  margin-bottom: 1.5rem;
  text-align: left;
}

.lightbox-image-wrap {
  position: relative;
  margin-bottom: 1rem;
  text-align: left;
}

.lightbox-image {
  display: block;
  max-width: 100%;
  max-height: 70vh;
  height: auto;
  width: auto;
  background-color: transparent;
  margin: 0;
}

.lightbox-thumbs {
  justify-content: flex-start;
}

.lightbox-thumbs {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  padding-bottom: 0.5rem;
  margin-bottom: 2rem;
}

.lightbox-thumb {
  flex-shrink: 0;
  width: 80px;
  height: 60px;
  object-fit: cover;
  cursor: pointer;
  opacity: 0.45;
  transition: opacity 0.2s ease;
  border: 1px solid rgba(226,118,100,0.15);
}

.lightbox-thumb.active,
.lightbox-thumb:hover {
  opacity: 1;
  border-color: var(--coral);
}

.lightbox-meta {
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  margin-bottom: 1.25rem;
  color: var(--coral);
  max-width: 750px;
  text-align: left;
}

.lightbox-meta strong {
  color: var(--coral);
  margin-right: 0.5rem;
  font-weight: 700;
}

.lightbox-description {
  font-size: 0.8rem;
  line-height: 1.7;
  color: var(--coral);
  margin-bottom: 1.25rem;
  max-width: 750px;
  text-align: left;
}

.lightbox-description-en {
  font-size: 0.75rem;
  line-height: 1.7;
  color: var(--coral-soft);
  font-style: italic;
  max-width: 750px;
  text-align: left;
}

.lightbox-description p,
.lightbox-description-en p {
  margin: 0 0 1em;
}

.lightbox-description p:last-child,
.lightbox-description-en p:last-child { margin-bottom: 0; }

.lightbox-body {
  flex: 1;
  width: 100%;
}

/* ============================================
   SEPARADOR (presentación entre oficinas)
   ============================================ */
.separator-content {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 0 1.5rem;
}

.separator-title {
  font-weight: 600;
  font-size: clamp(0.95rem, 3.5vw, 1.4rem);
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--coral);
  margin: 0 0 1rem;
  line-height: 1.3;
  white-space: nowrap;
}

.separator-subtitle {
  font-size: 0.9rem;
  color: var(--coral);
  max-width: 500px;
  line-height: 1.6;
  margin: 0 auto 1.5rem;
}

.separator-years {
  font-size: 0.8rem;
  letter-spacing: 0.3em;
  color: var(--coral-soft);
  text-transform: uppercase;
  margin: 0;
}

/* Flechas prev/next dentro del lightbox (estilo presentación) */
.lightbox-arrow {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--coral);
  cursor: pointer;
  padding: 1rem;
  z-index: 105;
  transition: opacity 0.2s ease;
  opacity: 0.7;
}

.lightbox-arrow:hover {
  opacity: 1;
}

.lightbox-arrow.prev { left: 1rem; }
.lightbox-arrow.next { right: 1rem; }

@media (max-width: 640px) {
  .lightbox-arrow.prev { left: 0.25rem; }
  .lightbox-arrow.next { right: 0.25rem; }
  .lightbox-arrow { padding: 0.5rem; }
}

/* Imagen placeholder cuando no existe la imagen del proyecto (lightbox) */
.img-fallback {
  background: linear-gradient(135deg, #f7f7f7 0%, #efefef 50%, #f7f7f7 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--coral);
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  font-size: 0.85rem;
  min-height: 300px;
  border: 1px solid rgba(226,118,100,0.15);
}

/* ============================================
   NAV DROPDOWNS (cascada de oficinas → proyectos)
   ============================================ */
.site-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
}

.site-nav .nav-link { color: var(--coral); }
.site-nav.dark .nav-link:hover,
.site-nav.light .nav-link:hover { color: var(--coral-soft); }
.site-nav.light { background-color: rgba(255,255,255,0.95); backdrop-filter: blur(8px); border-bottom: 1px solid rgba(0,0,0,0.05); }

.nav-bar {
  max-width: 80rem;
  margin: 0 auto;
  padding: 1.25rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-menu {
  display: none;
  align-items: center;
  gap: 2.5rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

@media (min-width: 768px) {
  .nav-menu { display: flex; }
}

.nav-item {
  position: relative;
}

/* Dropdown de primer nivel */
.dropdown {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  min-width: 240px;
  background: rgba(20,20,20,0.97);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255,255,255,0.08);
  padding: 0.5rem 0;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease;
  z-index: 60;
}

.site-nav.light .dropdown {
  background: rgba(255,255,255,0.97);
  border-color: rgba(0,0,0,0.08);
  box-shadow: 0 8px 24px rgba(0,0,0,0.08);
}

.nav-item:hover > .dropdown,
.nav-item:focus-within > .dropdown {
  opacity: 1;
  visibility: visible;
}

.dropdown ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.dropdown a {
  display: block;
  padding: 0.7rem 1.25rem;
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.85);
  text-decoration: none;
  white-space: nowrap;
  transition: color 0.15s ease, background 0.15s ease;
}

.site-nav.light .dropdown a {
  color: #1a1a1a;
}

.dropdown a:hover {
  color: var(--coral);
  background: rgba(255,255,255,0.04);
}

.site-nav.light .dropdown a:hover {
  background: rgba(0,0,0,0.03);
}

/* Submenu (cascading second level: proyectos dentro de cada oficina) */
.dropdown-item.has-submenu > a::after {
  content: ' ›';
  color: var(--coral);
  margin-left: 0.5rem;
}

.submenu {
  position: absolute;
  top: 0;
  left: 100%;
  min-width: 240px;
  background: rgba(20,20,20,0.97);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255,255,255,0.08);
  padding: 0.5rem 0;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}

.site-nav.light .submenu {
  background: rgba(255,255,255,0.97);
  border-color: rgba(0,0,0,0.08);
  box-shadow: 0 8px 24px rgba(0,0,0,0.08);
}

.dropdown-item.has-submenu:hover > .submenu,
.dropdown-item.has-submenu:focus-within > .submenu {
  opacity: 1;
  visibility: visible;
}

.dropdown-heading {
  font-size: 0.65rem;
  letter-spacing: 0.25em;
  color: var(--coral);
  text-transform: uppercase;
  padding: 0.5rem 1.25rem;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  margin-bottom: 0.25rem;
}

.site-nav.light .dropdown-heading {
  border-bottom-color: rgba(0,0,0,0.08);
}

/* Mobile nav: acordeón */
.mobile-menu {
  display: none;
  background: rgba(0,0,0,0.96);
  backdrop-filter: blur(8px);
  padding: 1rem 1.5rem 2rem;
}

.mobile-menu.open {
  display: block;
}

.mobile-menu > ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.mobile-item {
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.mobile-item:last-child { border-bottom: none; }

.mobile-item > a,
.mobile-item > button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 1rem 0;
  background: none;
  border: none;
  color: var(--coral);
  font-size: 0.75rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  font-family: inherit;
}

.mobile-submenu {
  display: none;
  padding-left: 1rem;
  padding-bottom: 1rem;
}

.mobile-item.expanded .mobile-submenu {
  display: block;
}

.mobile-submenu a {
  display: block;
  padding: 0.5rem 0;
  color: rgba(255,255,255,0.75);
  font-size: 0.7rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  text-decoration: none;
}

.mobile-submenu a:hover { color: var(--coral); }

.mobile-submenu .submenu-group {
  margin-top: 0.5rem;
  padding-top: 0.5rem;
  border-top: 1px solid rgba(255,255,255,0.05);
}

.mobile-submenu .submenu-group-title {
  font-size: 0.65rem;
  letter-spacing: 0.25em;
  color: var(--coral);
  text-transform: uppercase;
  margin-bottom: 0.25rem;
}

/* ============================================
   PÁGINAS DE GALERÍA: secciones por oficina
   ============================================ */
.gallery-page {
  padding-top: 6rem;
  padding-bottom: 5rem;
}

.firm-section {
  margin-bottom: 5rem;
}

.firm-header {
  text-align: center;
  margin-bottom: 2.5rem;
}

.firm-name {
  font-weight: 600;
  font-size: 1.5rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--coral);
  margin-bottom: 0.5rem;
}

.firm-years {
  font-size: 0.7rem;
  letter-spacing: 0.25em;
  color: var(--coral-soft);
  text-transform: uppercase;
}

.projects-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  gap: 1.5rem;
  max-width: 80rem;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.projects-grid .project-card {
  flex: 0 0 100%;
}

@media (min-width: 640px) {
  .projects-grid .project-card { flex: 0 0 calc((100% - 1.5rem) / 2); }
}

@media (min-width: 1024px) {
  .projects-grid .project-card { flex: 0 0 calc((100% - 3rem) / 3); }
}

.page-title-wrap {
  text-align: center;
  padding: 3rem 1.5rem 2rem;
  max-width: 80rem;
  margin: 0 auto;
}

.page-title {
  font-size: 2rem;
  font-weight: 300;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--coral);
}
