/*
Theme Name: Espacio Conjunto
Theme URI: https://espacioconjunto.com
Description: Custom WordPress theme for architecture/design portfolio. Native PHP implementation with zero plugin dependencies.
Version: 1.0.0
Author: Espacio Conjunto Team
Author URI: https://espacioconjunto.com
License: Proprietary
License URI: #
Text Domain: espacio-conjunto
Domain Path: /languages
Requires at least: 6.0
Requires PHP: 8.0
*/

:root {
  /* Primary Palette */
  --ec-limonata:       #e8fe41;
  --ec-volta:          #4101f6;
  --ec-terrazo:        #ff3c2c;
  --ec-bruma:          #8da0ff;
  --ec-obsidian:       #333333;

  /* Neutrals */
  --ec-cream:          #fffcf5;
  --ec-light-gray:     #eaeaea;
  --ec-mid-gray:       #888888;
  --ec-dark:           #242223;
  --ec-black:          #000000;
  --ec-white:          #ffffff;

  /* Semantic */
  --color-primary:     var(--ec-volta);
  --color-accent:      var(--ec-limonata);
  --color-secondary:   var(--ec-terrazo);
  --color-soft:        var(--ec-bruma);
  --color-bg:          var(--ec-white);
  --color-bg-alt:      var(--ec-cream);
  --color-text:        var(--ec-obsidian);
  --color-text-muted:  var(--ec-mid-gray);
  --color-border:      var(--ec-volta);

  /* Typography */
  --font-primary:      'Metro Sans', 'Inter', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  --font-weight-book:  400;
  --font-weight-medium:500;
  --font-weight-bold:  700;
  --font-weight-black: 900;

  /* Type Scale */
  --text-xs:   0.75rem;
  --text-sm:   0.875rem;
  --text-base: 1rem;
  --text-md:   1.125rem;
  --text-lg:   1.25rem;
  --text-xl:   1.5rem;
  --text-2xl:  2rem;
  --text-3xl:  2.5rem;
  --text-4xl:  3.5rem;
  --text-5xl:  4.5rem;

  /* Spacing (8px grid) */
  --space-1:  0.25rem;
  --space-2:  0.5rem;
  --space-3:  0.75rem;
  --space-4:  1rem;
  --space-5:  1.5rem;
  --space-6:  2rem;
  --space-8:  3rem;
  --space-10: 4rem;
  --space-12: 5rem;
  --space-16: 8rem;

  /* Layout */
  --sidebar-width:  240px;
  --container-max:  1400px;
  --content-max:    960px;
  --grid-gap:       var(--space-6);

  /* Transitions */
  --ease-out:        cubic-bezier(0.25, 0.46, 0.45, 0.94);
  --duration-fast:   150ms;
  --duration-normal: 300ms;
  --duration-slow:   500ms;
}

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

html,
body {
  font-family: var(--font-primary);
  line-height: 1.6;
  color: var(--color-text);
  background-color: var(--color-bg);
}

/* Accessibility */
.screen-reader-text {
  border: 0;
  clip: rect(1px, 1px, 1px, 1px);
  clip-path: inset(50%);
  height: 1px;
  margin: -1px;
  overflow: hidden;
  padding: 0;
  position: absolute;
  width: 1px;
  word-wrap: normal;
}

/* Layout: Sidebar + Main Content */
.mobile-header {
  display: none;
}

.site-sidebar {
  scrollbar-width: thin;
  scrollbar-color: var(--ec-bruma) var(--color-bg);
}

.site-sidebar::-webkit-scrollbar {
  width: 6px;
}

.site-sidebar::-webkit-scrollbar-track {
  background: var(--color-bg);
}

.site-sidebar::-webkit-scrollbar-thumb {
  background: var(--ec-bruma);
  border-radius: 3px;
}

.site-sidebar::-webkit-scrollbar-thumb:hover {
  background: var(--ec-volta);
}

.site-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin: 0;
  line-height: 1.2;
}

.site-title a {
  color: var(--color-text);
  text-decoration: none;
  transition: color var(--duration-normal) var(--ease-out);
}

.site-title a:hover {
  color: var(--ec-volta);
}

.main-nav a,
.secondary-nav a {
  transition: color var(--duration-normal) var(--ease-out);
}

.main-nav a:hover,
.secondary-nav a:hover {
  color: var(--ec-volta);
}

.site-content {
  min-height: calc(100vh - 100px);
}

.site-footer {
  background-color: var(--color-bg);
  text-align: center;
  color: var(--color-text-muted);
  font-size: 0.9rem;
  line-height: 1.8;
}

/* Body and main layout */
body {
  display: flex;
  margin: 0;
  padding: 0;
  padding-left: 80px;
  min-height: 100vh;
}

.site-sidebar {
  width: 200px;
  height: 100vh;
  position: fixed;
  left: 80px;
  top: 0;
  overflow-y: auto;
  background-color: var(--color-bg);
  flex-shrink: 0;
  border-right: 2px solid var(--ec-volta);
  padding: 50px 40px;
  display: flex;
  flex-direction: column;
  gap: 60px;
}

/* Content Limiter - Constrains main content to 80% width on desktop */
.content-limiter {
  display: flex;
  flex-direction: column;
}

.site-main-wrapper {
  margin-left: 200px;
  margin-right: 0;
  width: calc(100% - 200px);
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
}

.site-content {
  padding: 50px 80px;
  flex: 1;
  margin-top: 0;
}

/* Mobile header (hamburger) */
.mobile-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 60px;
  background-color: var(--color-bg);
  border-bottom: 2px solid var(--ec-volta);
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  z-index: 1000;
  display: none;
}

.hamburger-menu {
  background: none;
  border: none;
  cursor: pointer;
  padding: 10px;
  color: var(--color-text);
  font-size: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hamburger-menu span {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.hamburger-menu span span {
  width: 25px;
  height: 2px;
  background-color: var(--color-text);
  display: block;
  transition: all var(--duration-normal) var(--ease-out);
}

.sidebar-close {
  display: none;
  position: absolute;
  top: 20px;
  right: 20px;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--color-text);
  font-size: 1.8rem;
  width: 40px;
  height: 40px;
  padding: 0;
  align-items: center;
  justify-content: center;
}

.site-branding-mobile {
  margin: 0;
  padding: 0;
}

.site-branding-mobile .site-title {
  margin: 0;
  font-size: 1.3rem;
  line-height: 1.2;
}

/* Navigation */
.main-nav {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.main-nav a {
  color: var(--color-text);
  font-size: 0.95rem;
  text-decoration: none;
  transition: color var(--duration-normal) var(--ease-out);
}

.secondary-nav {
  display: flex;
  flex-direction: column;
  gap: 12px;
  border-top: 2px solid var(--ec-volta);
  padding-top: 30px;
  margin-top: auto;
}

.secondary-nav a {
  color: var(--color-text);
  font-size: 0.95rem;
  text-decoration: none;
  transition: color var(--duration-normal) var(--ease-out);
}

.social-links {
  display: flex;
  gap: 20px;
  border-top: 2px solid var(--ec-volta);
  padding-top: 30px;
}

.social-links a {
  color: var(--color-text);
  font-size: 0.9rem;
  transition: color var(--duration-normal) var(--ease-out);
}

/* CTA Link */
.cta-link {
  color: var(--color-text);
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
  transition: color var(--duration-normal) var(--ease-out);
  display: block;
}

.cta-link:hover {
  color: var(--ec-volta);
}

/* Links */
a {
  color: var(--ec-volta);
  text-decoration: none;
  transition: color var(--duration-normal) var(--ease-out);
}

a:hover {
  color: var(--ec-terrazo);
}

/* Project Grid */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 40px;
}

.projects-grid-section {
  width: 100%;
}

.project-grid-item {
  position: relative;
  overflow: visible;
  border-radius: 0;
  background-color: transparent;
  cursor: pointer;
  transition: transform 0.3s ease;
  display: flex;
  flex-direction: column;
}

.project-grid-item:hover .project-grid-item__image-link {
  opacity: 0.9;
  transition: opacity 0.3s ease;
}

.project-grid-item__image-link {
  display: block;
  width: 100%;
  height: 300px;
  position: relative;
  text-decoration: none;
  overflow: hidden;
  background-color: var(--color-bg-alt);
}

.project-grid-item__image {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background-color: var(--color-bg-alt);
}

.project-grid-item__thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.project-grid-item__fallback {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--ec-light-gray) 0%, var(--ec-cream) 100%);
  padding: 20px;
  text-align: center;
}

.project-grid-item__fallback-title {
  color: var(--color-text);
  font-size: 1.1rem;
  font-weight: 600;
  margin: 0;
}

.project-grid-item__info {
  padding: 15px 0;
  color: var(--color-text);
}

.project-grid-item__title {
  margin: 0 0 8px 0;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--color-text);
}

.project-grid-item__category {
  color: var(--color-text-muted);
}

.project-grid-item__year {
  margin: 0;
  font-size: 0.85rem;
  color: var(--color-text-muted);
}

/* Category Pages */
.projects-category {
  width: 100%;
}

.category-title {
  font-size: 2.8rem;
  font-weight: 700;
  margin-bottom: 80px;
  color: var(--color-text);
}

.category-description {
  font-size: 1.05rem;
  line-height: 1.8;
  margin-bottom: 80px;
  color: var(--color-text-muted);
}

.no-projects-message {
  text-align: center;
  padding: 40px;
  color: var(--color-text-muted);
  font-size: 1.1rem;
}

/* Single Project Page */
.project-header {
  margin-bottom: 80px;
  text-align: left;
}

.project-title {
  font-size: 3.5rem;
  font-weight: 700;
  text-transform: uppercase;
  margin: 0 0 50px 0;
  color: var(--color-text);
  letter-spacing: -0.02em;
}

.project-intro {
  margin: 0 0 150px 0;
  text-align: left;
}

.project-intro p {
  margin: 0 0 25px 0;
  font-size: 1.05rem;
  line-height: 1.85;
  color: var(--color-text-muted);
}

.project-intro p:last-child {
  margin-bottom: 0;
}

/* Gallery */
.gallery-section {
  width: 100%;
  margin-bottom: 120px;
  margin-top: 60px;
}

.gallery-entry {
  margin-bottom: 140px;
}

.gallery-entry__image {
  width: 100%;
  height: auto;
  margin-bottom: 80px;
  overflow: hidden;
  border-radius: 2px;
}

.gallery-entry__image img {
  width: 100%;
  height: auto;
  display: block;
}

.gallery-entry__title {
  font-size: 0.95rem;
  font-weight: 500;
  margin-bottom: 15px;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.gallery-entry__caption {
  font-size: 1rem;
  line-height: 1.8;
  color: var(--color-text-muted);
}

/* Project Categories Section */
.project-categories-section {
  margin-top: 80px;
  padding-top: 60px;
  border-top: 2px solid var(--ec-volta);
}

.project-categories-label {
  font-size: 0.85rem;
  color: var(--color-text-muted);
  text-transform: uppercase;
  margin-bottom: 15px;
  display: block;
}

.project-categories-list {
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
}

.project-category-link {
  color: var(--color-text);
  text-decoration: none;
  transition: color var(--duration-normal) var(--ease-out);
}

.project-category-link:hover {
  color: var(--ec-volta);
}

/* Back to Top */
.back-to-top {
  margin-top: 80px;
  text-align: center;
}

.back-to-top a {
  font-size: 0.9rem;
  color: var(--color-text-muted);
  text-decoration: none;
  transition: color var(--duration-normal) var(--ease-out);
}

.back-to-top a:hover {
  color: var(--color-text);
}

/* Footer */
.site-footer {
  background-color: var(--color-bg);
  text-align: center;
  color: var(--color-text-muted);
  font-size: 0.9rem;
  line-height: 1.8;
  padding: 50px 40px;
  margin-top: auto;
  border-top: 2px solid var(--ec-volta);
}

.site-footer__locations {
  margin-bottom: 15px;
}

.site-footer__address {
  margin: 0;
}

/* Team Page */
.team-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 40px;
  margin-bottom: 80px;
}

.team-member {
  text-align: center;
}

.team-photo {
  width: 100%;
  height: auto;
  border-radius: 8px;
  margin-bottom: 20px;
  display: block;
}

.team-member-name {
  font-size: 1.2rem;
  font-weight: 600;
  margin: 0 0 8px 0;
  color: var(--color-text);
}

.team-member-role {
  font-size: 0.95rem;
  color: var(--color-text-muted);
  margin: 0 0 15px 0;
  font-weight: 500;
}

.team-member-bio {
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--color-text-muted);
  margin: 0 0 15px 0;
}

.team-member-contact {
  display: flex;
  justify-content: center;
  gap: 15px;
  margin-top: 15px;
}

.team-member-contact a {
  color: var(--ec-volta);
  text-decoration: none;
  font-size: 0.85rem;
  transition: color var(--duration-normal) var(--ease-out);
}

.team-member-contact a:hover {
  color: var(--ec-terrazo);
}

/* Meta Boxes */
.ec-meta-box-field {
  margin-bottom: 15px;
}

.ec-meta-box-field input[type="text"],
.ec-meta-box-field input[type="number"],
.ec-meta-box-field textarea {
  width: 100%;
  padding: 8px;
  margin-top: 5px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-family: inherit;
}

.ec-repeater-items {
  padding: 15px;
  background-color: #f8f8f8;
  margin-bottom: 15px;
  border-radius: 4px;
  min-height: 50px;
}

.ec-repeater-item {
  margin-bottom: 15px;
  padding: 15px;
  background: white;
  border: 1px solid #ddd;
  border-radius: 4px;
  display: grid;
  grid-template-columns: 120px 1fr 100px;
  gap: 15px;
  align-items: start;
}

.ec-image-preview {
  width: 120px;
  height: 80px;
  overflow: hidden;
  border-radius: 4px;
  background: #f0f0f0;
}

.ec-image-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.gallery-title,
.gallery-caption {
  width: 100%;
  padding: 8px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 12px;
  font-family: inherit;
}

.gallery-title {
  font-weight: 600;
}

.gallery-caption {
  min-height: 60px;
}

/* Responsive */

/* Tablet: 768px - 1024px */
@media (max-width: 1024px) {
  body {
    padding-left: 60px;
  }

  .site-sidebar {
    left: 60px;
    width: 180px;
    padding: 40px 30px;
  }

  .site-main-wrapper {
    margin-left: 180px;
    width: calc(100% - 180px);
  }

  .site-content {
    padding: 50px 60px;
  }

  .projects-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 30px;
  }
}

/* Mobile: < 768px */
@media (max-width: 768px) {
  body {
    padding-left: 0;
    flex-direction: column;
  }

  .site-sidebar {
    left: 0;
  }

  /* Mobile Menu Toggle */
  .mobile-header {
    display: flex;
  }

  .sidebar-close {
    display: flex;
  }

  /* Sidebar becomes full-screen overlay on mobile */
  .site-sidebar {
    position: fixed;
    left: -100%;
    top: 0;
    width: 100%;
    height: 100vh;
    border-right: none;
    border-bottom: none;
    transition: left var(--duration-normal) var(--ease-out);
    z-index: 1001;
    padding: 40px 30px;
    gap: 40px;
    align-items: center;
    justify-content: flex-start;
    text-align: center;
    overflow-y: auto;
    padding-top: 80px;
  }

  .site-sidebar.active {
    left: 0;
  }

  .site-sidebar .site-branding {
    width: 100%;
    text-align: center;
    order: 0;
  }

  .site-sidebar > div:nth-of-type(2) {
    width: 100%;
    order: 1;
    text-align: center;
  }

  .site-sidebar > div:nth-of-type(2) a {
    font-size: 0.95rem;
    font-weight: 600;
  }

  .main-nav {
    width: 100%;
    gap: 30px;
    text-align: center;
    order: 2;
  }

  .main-nav a {
    display: block;
    font-size: 0.95rem;
  }

  .secondary-nav {
    width: 100%;
    border: none;
    padding: 0;
    gap: 20px;
    text-align: center;
    order: 3;
    margin-top: auto;
  }

  .secondary-nav a {
    display: block;
    font-size: 0.95rem;
  }

  .social-links {
    width: 100%;
    border: none;
    padding: 0;
    justify-content: center;
    gap: 30px;
    order: 4;
  }

  .site-main-wrapper {
    margin-left: 0;
    width: 100%;
    margin-top: 60px;
    max-width: none;
  }

  .site-content {
    padding: 30px 30px;
    margin-top: 0;
  }

  .site-title {
    font-size: 1.3rem;
  }

  /* Mobile grid */
  .projects-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  /* Mobile team grid */
  .team-grid {
    grid-template-columns: 1fr;
  }
}
