/* ==========================================================================
   FLUJO DE RESTRICCIONES CASE STUDY SPECIFIC STYLES (styles-flujo-de-restricciones.css)
   ========================================================================== */

/* Add specific styles or overrides for this case study here */

/* Project Hero Background - Seamless pure black match with portada */
.project-hero {
   background-color: #000000;
}

/* Problem Section */
.project-problem {
   padding: 5rem 0;
}

.problem-title {
   font-size: var(--font-size-h2);
   text-align: center;
   margin-bottom: 1.5rem;
   line-height: 1.1;
   letter-spacing: -1px;
}

.problem-desc {
   font-size: var(--font-size-p);
   margin-bottom: 2.5rem;
   max-width: 820px;
   margin-left: auto;
   margin-right: auto;
   text-align: center;
   line-height: 1.6;
   color: rgba(33, 30, 73, 0.85);
}

/* Problem Interactive Grid (Split: Left Dynamic Icon + Right Vertical List) */
.problem-interactive-grid {
   display: grid;
   grid-template-columns: 1fr 1.35fr;
   gap: 4.5rem;
   align-items: center;
   max-width: 1040px;
   margin: 3.5rem auto 0;
}

/* Left: Visual Circumference Stage */
.problem-visual-column {
   display: flex;
   justify-content: center;
   align-items: center;
}

.problem-icon-stage {
   width: 170px;
   height: 170px;
   border-radius: 50%;
   background-color: var(--accent);
   /* Fondo accent #EECEE6 */
   border: 2px solid rgba(255, 255, 255, 0.7);
   display: flex;
   align-items: center;
   justify-content: center;
   position: relative;
   box-shadow: 0 16px 40px rgba(238, 206, 230, 0.5), 0 6px 16px rgba(33, 30, 73, 0.06);
   transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.4s ease;
}

.problem-icon-stage:hover {
   transform: scale(1.05);
   box-shadow: 0 20px 48px rgba(238, 206, 230, 0.65), 0 8px 20px rgba(33, 30, 73, 0.08);
}

.problem-icon-large {
   position: absolute;
   inset: 0;
   display: flex;
   align-items: center;
   justify-content: center;
   color: var(--text-dark);
   opacity: 0;
   transform: scale(0.75) rotate(-8deg);
   transition: opacity 0.35s cubic-bezier(0.16, 1, 0.3, 1),
      transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
   pointer-events: none;
}

.problem-icon-large.active {
   opacity: 1;
   transform: scale(1) rotate(0deg);
   pointer-events: auto;
}

/* Right: Items Stack */
.problem-items-column {
   display: flex;
   flex-direction: column;
}

.problem-interactive-list {
   display: flex;
   flex-direction: column;
   gap: 1.25rem;
}

.problem-interactive-item {
   border-bottom: 1px solid rgba(33, 30, 73, 0.1);
   padding-bottom: 1.25rem;
   transition: all 0.35s ease;
}

.problem-interactive-item:first-child {
   padding-top: 0;
}

.problem-interactive-item:last-child {
   border-bottom: none;
   padding-bottom: 0;
}

.problem-item-header {
   background: none;
   border: none;
   padding: 0;
   text-align: left;
   width: 100%;
   cursor: pointer;
   display: flex;
   align-items: center;
   justify-content: space-between;
   outline: none;
}

.problem-item-title {
   font-size: 1.6rem;
   font-weight: 600;
   line-height: 1.3;
   letter-spacing: -0.4px;
   color: var(--text-dark);
   opacity: 0.35;
   transition: opacity 0.35s ease, color 0.35s ease, transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
   margin: 0;
}

.problem-interactive-item:hover .problem-item-title {
   opacity: 0.75;
}

.problem-interactive-item.active .problem-item-title {
   opacity: 1;
   color: var(--text-dark);
   transform: translateX(4px);
}

.problem-item-body {
   max-height: 0;
   opacity: 0;
   overflow: hidden;
   transition: max-height 0.4s cubic-bezier(0.16, 1, 0.3, 1),
      opacity 0.35s ease,
      margin-top 0.35s ease;
   margin-top: 0;
}

.problem-interactive-item.active .problem-item-body {
   max-height: 200px;
   opacity: 1;
   margin-top: 0.85rem;
}

.problem-item-desc {
   font-size: 1.05rem;
   line-height: 1.65;
   color: rgba(33, 30, 73, 0.85);
   font-weight: 300;
   margin: 0;
   max-width: 580px;
}


.project-text h2 {
   margin-bottom: 1rem;
   font-family: var(--font-main);
   letter-spacing: -1px;
   padding: 16px;
}

/* El Reto Section */
.project-reto {
   padding: 5rem 0;
}

.reto-grid {
   display: grid;
   grid-template-columns: 1fr 1fr;
   gap: 3rem;
   align-items: stretch;
}

.reto-imagen {
   border-radius: 20px;
   overflow: hidden;
   height: 100%;
   min-height: 480px;
}

.reto-imagen img {
   width: 100%;
   height: 100%;
   object-fit: cover;
   display: block;
}

.reto-cards-column {
   display: flex;
   flex-direction: column;
   gap: 1.5rem;
}

.reto-card {
   background-color: #dbe2ff;
   border-radius: 20px;
   padding: 3rem;
   flex: 1;
   display: flex;
   flex-direction: column;
   justify-content: center;
}

.reto-card h3 {
   color: var(--bg-dark);
   font-size: 2.2rem;
   font-weight: 700;
   margin-bottom: 1.5rem;
   line-height: 1.1;
   font-family: var(--font-main);
}

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

.reto-card ul li {
   position: relative;
   padding-left: 1.5rem;
   margin-bottom: 1.2rem;
   color: #49287a;
   font-size: 1.15rem;
   line-height: 1.4;
   font-weight: 500;
}

.reto-card ul li:last-child {
   margin-bottom: 0;
}

.reto-card ul li::before {
   content: "•";
   color: #49287a;
   position: absolute;
   left: 0;
   top: -4px;
   font-weight: 900;
   font-size: 1.5rem;
}

.project-process {
   padding-bottom: 2rem;
}

/* Architecture Section */
.project-architecture {
   padding: 2rem 0 4rem;
}

.architecture-grid {
   display: grid;
   grid-template-columns: 1fr 1.25fr;
   gap: 5rem;
   align-items: center;
}

.architecture-principle {
   display: inline-flex;
   align-items: center;
   font-size: 0.82rem;
   font-weight: 600;
   text-transform: uppercase;
   letter-spacing: 1.5px;
   color: var(--bg-dark);
   background: rgba(33, 30, 73, 0.08);
   padding: 0.4rem 1rem;
   border-radius: 50px;
   margin-bottom: 1.25rem;
}

.architecture-text h2 {
   margin-bottom: 1.25rem;
   font-family: var(--font-main);
   font-size: var(--font-size-h2);
   letter-spacing: -0.5px;
   line-height: 1.2;
}

.architecture-text p {
   font-size: var(--font-size-p);
   font-weight: 300;
   line-height: 1.6;
   color: var(--text-dark);
   margin-bottom: 1.5rem;
}

.architecture-points {
   display: flex;
   flex-direction: column;
   gap: 1rem;
   margin-top: 1.5rem;
}

.architecture-point-item {
   display: flex;
   align-items: flex-start;
   gap: 0.85rem;
   font-size: 0.95rem;
   color: var(--text-dark);
   line-height: 1.5;
}

.architecture-point-icon {
   width: 22px;
   height: 22px;
   border-radius: 50%;
   background: var(--bg-dark);
   color: var(--accent);
   display: flex;
   align-items: center;
   justify-content: center;
   flex-shrink: 0;
   margin-top: 2px;
}

.architecture-frame {
   position: relative;
   border-radius: 20px;
   overflow: hidden;
   background: #ffffff;
   border: 1px solid rgba(33, 30, 73, 0.08);
   box-shadow: 0 20px 45px -10px rgba(33, 30, 73, 0.12);
   transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.4s ease;
}

.architecture-frame:hover {
   transform: translateY(-4px);
   box-shadow: 0 28px 60px -12px rgba(33, 30, 73, 0.18);
}

.architecture-frame img {
   width: 100%;
   height: auto;
   display: block;
   object-fit: contain;
}

.placeholder-box.outline {
   background: transparent;
   border: 1px dashed rgba(0, 0, 0, 0.2);
   box-shadow: none;
}

/* Responsive (Flujo de Restricciones) */
@media (max-width: 992px) {
   .architecture-grid {
      grid-template-columns: 1fr;
      gap: 3rem;
   }

   .problem-cards-grid {
      grid-template-columns: 1fr;
      gap: 1.25rem;
   }
}

/* ==========================================================================
   Showcase Gallery (Joshua Baker Pattern)
   ========================================================================== */

.project-gallery-section {
   padding: 4.5rem 0 5.5rem;
   background-color: var(--bg-light);
}

.gallery-carousel-viewport {
   container-type: inline-size;
   width: 100%;
   overflow-x: auto;
   scroll-behavior: smooth;
   scroll-snap-type: x mandatory;
   scrollbar-width: none;
   -ms-overflow-style: none;
   -webkit-overflow-scrolling: touch;
   cursor: grab;
   padding: 0.5rem 0 1rem;
}

.gallery-carousel-viewport::-webkit-scrollbar {
   display: none;
}

.gallery-carousel-viewport.grabbing {
   cursor: grabbing;
   scroll-snap-type: none;
   user-select: none;
}

.gallery-carousel-track {
   display: flex;
   gap: 1.5rem;
   width: max-content;
}

.gallery-slide-item {
   flex: 0 0 calc(80cqi - 0.5rem);
   width: calc(80cqi - 0.5rem);
   max-width: 960px;
   border-radius: 4px;
   overflow: hidden;
   background: #ffffff;
   box-shadow: 0 8px 26px rgba(33, 30, 73, 0.08);
   border: 1px solid rgba(33, 30, 73, 0.06);
   scroll-snap-align: start;
   transition: box-shadow 0.3s ease;
}

.gallery-screen-img {
   width: 100%;
   height: auto;
   display: block;
   border-radius: 4px;
   object-fit: contain;
   user-select: none;
   -webkit-user-drag: none;
}

/* Bottom Controls Bar */
.gallery-bottom-bar {
   display: flex;
   align-items: center;
   justify-content: space-between;
   margin-top: 1.5rem;
   gap: 1rem;
}

.btn-open-gallery {
   display: inline-flex;
   align-items: center;
   justify-content: center;
   gap: 0.65rem;
   padding: 0.65rem 1.6rem;
   border-radius: 50px;
   background-color: #ffffff;
   color: var(--text-dark);
   font-family: var(--font-main);
   font-size: 0.95rem;
   font-weight: 500;
   letter-spacing: 0.2px;
   border: 1px solid rgba(33, 30, 73, 0.12);
   box-shadow: 0 4px 14px rgba(0, 0, 0, 0.05);
   cursor: pointer;
   transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
   outline: none;
}

.btn-open-gallery:hover {
   transform: translateY(-2px);
   background-color: rgba(238, 206, 230, 0.35);
   border-color: rgba(215, 170, 205, 0.85);
   box-shadow: 0 6px 20px rgba(238, 206, 230, 0.35);
   color: var(--text-dark);
}

.btn-open-gallery .btn-icon {
   display: flex;
   align-items: center;
   justify-content: center;
   color: var(--text-dark);
}

.gallery-nav-pills {
   display: inline-flex;
   align-items: center;
   background-color: #ffffff;
   border-radius: 50px;
   border: 1px solid rgba(33, 30, 73, 0.12);
   box-shadow: 0 4px 14px rgba(0, 0, 0, 0.05);
   padding: 3px;
}

.gallery-nav-btn {
   display: flex;
   align-items: center;
   justify-content: center;
   width: 40px;
   height: 40px;
   border-radius: 50px;
   border: none;
   background: transparent;
   color: var(--text-dark);
   cursor: pointer;
   transition: all 0.2s ease;
   outline: none;
}

.gallery-nav-btn:hover:not(:disabled) {
   background-color: rgba(238, 206, 230, 0.4);
   color: var(--text-dark);
}

.gallery-nav-btn:disabled {
   opacity: 0.3;
   cursor: not-allowed;
}

.gallery-nav-divider {
   width: 1px;
   height: 20px;
   background-color: rgba(33, 30, 73, 0.1);
}

@media (max-width: 768px) {
   .gallery-slide-item {
      flex: 0 0 calc(86cqi - 0.5rem);
      width: calc(86cqi - 0.5rem);
   }

   .gallery-carousel-track {
      gap: 1rem;
   }

   .gallery-bottom-bar {
      margin-top: 1.25rem;
   }

   .btn-open-gallery {
      padding: 0.55rem 1.25rem;
      font-size: 0.88rem;
   }

   .gallery-nav-btn {
      width: 36px;
      height: 36px;
   }
}

/* ==========================================================================
   Fullscreen Gallery Modal Overlay (Joshua Baker Pattern)
   ========================================================================== */

.gallery-modal-overlay {
   position: fixed;
   inset: 0;
   z-index: 99999;
   background-color: var(--bg-light);
   overflow: hidden;
   opacity: 0;
   visibility: hidden;
   transition: opacity 0.3s cubic-bezier(0.16, 1, 0.3, 1),
               visibility 0.3s ease;
}

.gallery-modal-overlay.is-open {
   opacity: 1;
   visibility: visible;
}

/* Floating Exit Button Header - permanently fixed at top */
.gallery-modal-header {
   position: absolute;
   top: 0;
   left: 0;
   right: 0;
   height: 5.5rem;
   display: flex;
   align-items: center;
   justify-content: center;
   z-index: 1000;
   pointer-events: none;
   background: linear-gradient(to bottom, var(--bg-light) 50%, rgba(251, 251, 253, 0.85) 80%, transparent 100%);
   backdrop-filter: blur(8px);
   -webkit-backdrop-filter: blur(8px);
}

.btn-close-gallery {
   pointer-events: auto;
   display: inline-flex;
   align-items: center;
   justify-content: center;
   gap: 0.6rem;
   padding: 0.65rem 1.6rem;
   border-radius: 50px;
   background-color: #ffffff;
   color: var(--text-dark);
   font-family: var(--font-main);
   font-size: 0.95rem;
   font-weight: 500;
   letter-spacing: 0.2px;
   border: 1px solid rgba(33, 30, 73, 0.12);
   box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
   cursor: pointer;
   backdrop-filter: blur(12px);
   -webkit-backdrop-filter: blur(12px);
   transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
   outline: none;
}

.btn-close-gallery:hover {
   transform: translateY(-2px);
   background-color: rgba(238, 206, 230, 0.4);
   border-color: rgba(215, 170, 205, 0.9);
   box-shadow: 0 8px 24px rgba(238, 206, 230, 0.45);
   color: var(--text-dark);
}

.btn-close-gallery .btn-icon {
   display: flex;
   align-items: center;
   justify-content: center;
   color: var(--text-dark);
}

/* Independent scroll area */
.gallery-modal-scroll {
   position: absolute;
   inset: 0;
   overflow-y: auto;
   -webkit-overflow-scrolling: touch;
   padding: 6.5rem 1.5rem 5rem;
   display: flex;
   justify-content: center;
}

/* 1-2-2 Grid layout */
.gallery-modal-grid {
   display: grid;
   grid-template-columns: repeat(2, 1fr);
   gap: 3rem 2rem;
   max-width: 1120px;
   width: 100%;
   margin: 0 auto;
   height: max-content;
}

/* Item 1 is featured full-width (1-2-2 rhythm) */
.gallery-modal-item:first-child {
   grid-column: 1 / -1;
}

.gallery-modal-item {
   display: flex;
   flex-direction: column;
}

.gallery-modal-img-wrap {
   width: 100%;
   border-radius: 4px;
   overflow: hidden;
   background: #ffffff;
   border: 1px solid rgba(33, 30, 73, 0.08);
   box-shadow: 0 8px 30px rgba(33, 30, 73, 0.08);
   transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.gallery-modal-img-wrap:hover {
   transform: translateY(-3px);
   box-shadow: 0 14px 40px rgba(33, 30, 73, 0.12);
}

.gallery-modal-img-wrap img {
   width: 100%;
   height: auto;
   display: block;
   border-radius: 4px;
   object-fit: contain;
}

/* Caption styling: 12px font-size, max 2 lines, caption style */
.gallery-modal-caption {
   font-size: 12px;
   font-weight: 400;
   color: rgba(33, 30, 73, 0.72);
   line-height: 1.5;
   margin-top: 0.75rem;
   padding: 0 2px;
   font-family: var(--font-main);
   display: -webkit-box;
   -webkit-line-clamp: 2;
   -webkit-box-orient: vertical;
   overflow: hidden;
   text-overflow: ellipsis;
}

@media (max-width: 768px) {
   .gallery-modal-grid {
      grid-template-columns: 1fr;
      gap: 2rem;
   }

   .gallery-modal-item:first-child {
      grid-column: auto;
   }

   .gallery-modal-header {
      height: 4.5rem;
   }

   .gallery-modal-scroll {
      padding: 5rem 1rem 3.5rem;
   }

   .btn-close-gallery {
      padding: 0.55rem 1.25rem;
      font-size: 0.88rem;
   }
}

.placeholder-box.tall {
   min-height: 500px;
}

.placeholder-box {
   background: #f0f0f0;
   border-radius: 12px;
   display: flex;
   align-items: center;
   justify-content: center;
   color: var(--text-dark);
   font-size: var(--font-size-h4);
}

/* ==========================================================================
   Architecture Teaser / Progressive Disclosure Toggle
   ========================================================================== */

/* Cut-off peek teaser showing top portion of Architecture section */
.full-case-wrapper {
   position: relative;
   max-height: 260px;
   overflow: hidden;
   background-color: var(--bg-light);
   transition: max-height 0.75s cubic-bezier(0.16, 1, 0.3, 1);
}

.full-case-wrapper::after {
   content: "";
   position: absolute;
   bottom: 0;
   left: 0;
   right: 0;
   height: 80px;
   background: linear-gradient(to bottom, rgba(33, 30, 73, 0) 0%, rgba(33, 30, 73, 0.08) 100%);
   pointer-events: none;
   opacity: 1;
   transition: opacity 0.4s ease;
}

.full-case-wrapper.expanded {
   max-height: 2000px;
}

.full-case-wrapper.expanded::after {
   opacity: 0;
   pointer-events: none;
}

.full-case-inner {
   min-height: 0;
   opacity: 1;
   transform: none;
}

/* Read Full Project Action Button Container */
.read-full-case-container {
   padding: 1.5rem 0 3.5rem;
   display: flex;
   justify-content: center;
   align-items: center;
   background-color: var(--bg-light);
   position: relative;
   z-index: 10;
   transition: padding 0.35s ease;
}

.full-case-wrapper.expanded + .read-full-case-container {
   padding: 2.5rem 0 4rem;
}

/* Button style unified with "Abrir galeria" */
.btn-read-full-case {
   display: inline-flex;
   align-items: center;
   justify-content: center;
   gap: 0.65rem;
   padding: 0.65rem 1.6rem;
   border-radius: 50px;
   background-color: #ffffff;
   color: var(--text-dark);
   font-family: var(--font-main);
   font-size: 0.95rem;
   font-weight: 500;
   letter-spacing: 0.2px;
   border: 1px solid rgba(33, 30, 73, 0.12);
   box-shadow: 0 4px 14px rgba(0, 0, 0, 0.05);
   cursor: pointer;
   transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
   outline: none;
}

.btn-read-full-case:hover {
   transform: translateY(-2px);
   background-color: rgba(238, 206, 230, 0.35);
   border-color: rgba(215, 170, 205, 0.85);
   box-shadow: 0 6px 20px rgba(238, 206, 230, 0.35);
   color: var(--text-dark);
}

.btn-read-full-case .btn-icon {
   display: flex;
   align-items: center;
   justify-content: center;
   color: var(--text-dark);
   transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.btn-read-full-case.expanded .btn-icon {
   transform: rotate(180deg);
}
