/* ============================================================================
   LATICON — Proyectos (listado + detalle con timeline interactivo)
   Requiere styles.css
   ========================================================================== */

/* -------------------------------------------------------- Hero de proyectos */
.proj-hero {
  position: relative; isolation: isolate; color: #fff; overflow: hidden;
  border-bottom: 1px solid var(--line);
  padding-block: clamp(160px, 20vw, 220px) clamp(50px, 7vw, 80px);
  background:
    linear-gradient(180deg, rgba(6,36,23,.70) 0%, rgba(6,36,23,.35) 45%, rgba(6,36,23,.90) 100%),
    linear-gradient(115deg, rgba(16,103,53,.25) 0%, rgba(6,36,23,.15) 55%, rgba(10,61,37,.4) 100%),
    url("../img/proyectos/tanque-24/covers/cover-main-web.jpg") center/cover no-repeat;
  background-color: var(--brand-900);
}
.proj-hero::after {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none; opacity: .06; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
.proj-hero .eyebrow { color: var(--brand-300); }
.proj-hero h1 { color: #fff; font-size: clamp(2rem, 4.4vw, 3.2rem); max-width: 900px; text-shadow: 0 2px 30px rgba(0,0,0,.35); }
.proj-hero .lead { color: rgba(255,255,255,.9); margin-top: 16px; max-width: 720px; }

/* -------------------------------------------------------- Listado de proyectos */
.proj-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 22px; padding-block: clamp(40px, 6vw, 72px); }
.proj-card {
  display: flex; flex-direction: column; background: var(--paper); border: 1px solid var(--line);
  border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow-sm);
  transition: transform .4s var(--ease), box-shadow .4s var(--ease); color: inherit; text-decoration: none;
}
.proj-card:hover { transform: translateY(-6px); box-shadow: var(--shadow); }
.proj-card__media { aspect-ratio: 16/10; overflow: hidden; position: relative; }
.proj-card__media img { width: 100%; height: 100%; object-fit: cover; transition: transform .7s var(--ease); }
.proj-card:hover .proj-card__media img { transform: scale(1.06); }
.proj-card__client {
  position: absolute; top: 14px; left: 14px; z-index: 2;
  background: rgba(6,36,23,.75); backdrop-filter: blur(6px); color: #fff;
  padding: 6px 12px; border-radius: 100px; font-family: var(--font-display);
  font-size: .72rem; font-weight: 600; letter-spacing: .1em; text-transform: uppercase;
  border: 1px solid rgba(255,255,255,.2);
}
.proj-card__body { padding: 26px 26px 28px; display: flex; flex-direction: column; gap: 12px; flex: 1; }
.proj-card__tag { font-family: var(--font-display); font-size: .7rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--brand); }
.proj-card h3 { font-size: 1.35rem; line-height: 1.25; }
.proj-card p { font-size: .96rem; flex: 1; }
.proj-card__meta { display: flex; align-items: center; gap: 18px; font-size: .82rem; color: var(--ink-3); padding-top: 6px; border-top: 1px solid var(--line); }
.proj-card__meta b { color: var(--ink); font-family: var(--font-display); font-weight: 600; }
.proj-card__cta { display: inline-flex; align-items: center; gap: 8px; margin-top: 6px; color: var(--brand); font-family: var(--font-display); font-weight: 600; font-size: .95rem; transition: gap .3s var(--ease); }
.proj-card:hover .proj-card__cta { gap: 12px; }
.proj-card__cta svg { width: 16px; height: 16px; stroke: currentColor; }

/* -------------------------------------------------------- Detalle de proyecto: cabecera */
.pd-hero { padding-block: clamp(120px, 15vw, 160px) clamp(30px, 4vw, 50px); background: var(--brand-900); color: #fff; }
.pd-hero__inner { max-width: var(--maxw); margin-inline: auto; padding-inline: var(--gutter); display: grid; grid-template-columns: 1.15fr .85fr; gap: clamp(30px, 5vw, 60px); align-items: end; }
.pd-hero__text .eyebrow { color: var(--brand-300); }
.pd-hero h1 { color: #fff; font-size: clamp(1.7rem, 3.2vw, 2.6rem); margin: 14px 0 20px; line-height: 1.1; }
.pd-hero__meta { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin-top: 24px; }
.pd-hero__meta div { padding: 14px 0; border-top: 1px solid rgba(255,255,255,.2); }
.pd-hero__meta b { display: block; font-family: var(--font-display); font-size: .68rem; letter-spacing: .14em; text-transform: uppercase; color: var(--brand-300); margin-bottom: 6px; font-weight: 700; }
.pd-hero__meta span { color: #fff; font-family: var(--font-display); font-size: .98rem; font-weight: 500; }
.pd-hero__cover { border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow-lg); aspect-ratio: 4/3; }
.pd-hero__cover img { width: 100%; height: 100%; object-fit: cover; }

/* -------------------------------------------------------- Detalle: descripción y fases */
.pd-overview { background: var(--paper); padding-block: clamp(56px, 8vw, 96px); }
.pd-overview__grid { max-width: var(--maxw); margin-inline: auto; padding-inline: var(--gutter); display: grid; grid-template-columns: .95fr 1.15fr; gap: clamp(40px, 6vw, 80px); align-items: start; }
.pd-overview__intro .eyebrow { display: inline-flex; }
.pd-overview__intro h2 { font-size: clamp(1.5rem, 2.6vw, 2rem); margin: 14px 0 18px; line-height: 1.15; }
.pd-overview__intro p { font-size: 1.02rem; line-height: 1.7; }
.pd-overview__intro p + p { margin-top: 14px; }

.pd-phases { display: grid; gap: 14px; }
.pd-phase {
  border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--paper);
  transition: border-color .3s var(--ease), box-shadow .3s var(--ease);
}
.pd-phase:hover { border-color: var(--brand-300); box-shadow: var(--shadow-sm); }
.pd-phase summary {
  cursor: pointer; list-style: none; padding: 20px 24px;
  display: flex; align-items: center; gap: 14px; position: relative; padding-right: 48px;
}
.pd-phase summary::-webkit-details-marker { display: none; }
.pd-phase summary::after { content: "+"; position: absolute; right: 18px; top: 50%; transform: translateY(-50%); font-size: 1.6rem; color: var(--brand); transition: transform .3s var(--ease); font-weight: 300; }
.pd-phase[open] summary::after { transform: translateY(-50%) rotate(45deg); }
.pd-phase__num {
  flex: none; width: 40px; height: 40px; border-radius: 10px;
  background: var(--brand); color: #fff; display: grid; place-items: center;
  font-family: var(--font-display); font-weight: 700; font-size: .95rem;
}
.pd-phase__title { font-family: var(--font-display); font-weight: 600; font-size: 1.05rem; color: var(--ink); }
.pd-phase ul { padding: 0 24px 22px 78px; margin: 0; list-style: none; display: grid; gap: 8px; }
.pd-phase li { position: relative; padding-left: 20px; font-size: .93rem; color: var(--ink-2); line-height: 1.55; }
.pd-phase li::before { content: ""; position: absolute; left: 0; top: .58em; width: 12px; height: 2px; background: var(--brand-bright); border-radius: 2px; }

/* -------------------------------------------------------- Timeline */
.pd-timeline { background: var(--paper-2); padding-block: clamp(56px, 8vw, 96px); border-top: 1px solid var(--line); }
.pd-timeline__head { max-width: var(--maxw); margin: 0 auto clamp(30px, 5vw, 50px); padding-inline: var(--gutter); text-align: center; }
.pd-timeline__head h2 { font-size: clamp(1.5rem, 2.8vw, 2.1rem); margin: 12px 0 12px; }
.pd-timeline__head p { max-width: 620px; margin-inline: auto; }

.pd-timeline__layout { max-width: var(--maxw); margin-inline: auto; padding-inline: var(--gutter); display: grid; grid-template-columns: 240px 1fr; gap: 40px; align-items: start; }

/* Sidebar de fechas */
.pd-dates {
  position: sticky; top: 100px;
  max-height: calc(100vh - 130px); overflow-y: auto;
  padding: 8px; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm);
}
.pd-dates__title { font-family: var(--font-display); font-size: .72rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--brand); padding: 10px 12px 8px; border-bottom: 1px solid var(--line); margin-bottom: 6px; }
.pd-date-btn {
  display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 12px;
  border-radius: var(--radius-sm); background: transparent; text-align: left;
  font-family: var(--font-display); font-weight: 500; font-size: .9rem; color: var(--ink-2);
  transition: background .2s var(--ease), color .2s var(--ease); cursor: pointer; border: 0;
}
.pd-date-btn:hover { background: var(--mint); color: var(--brand); }
.pd-date-btn.active { background: var(--brand); color: #fff; }
.pd-date-btn.active .pd-date-btn__count { background: rgba(255,255,255,.2); color: #fff; }
.pd-date-btn__dot { flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--brand-bright); }
.pd-date-btn.active .pd-date-btn__dot { background: #fff; }
.pd-date-btn__label { flex: 1; }
.pd-date-btn__count { font-size: .7rem; padding: 2px 8px; border-radius: 100px; background: var(--mint); color: var(--brand); font-weight: 600; }

/* Panel principal */
.pd-panel { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: clamp(24px, 3vw, 34px); box-shadow: var(--shadow-sm); min-height: 400px; }
.pd-panel__head { display: flex; align-items: center; justify-content: space-between; gap: 18px; flex-wrap: wrap; margin-bottom: 22px; padding-bottom: 20px; border-bottom: 1px solid var(--line); }
.pd-panel__date { font-family: var(--font-display); font-size: 1.5rem; font-weight: 700; color: var(--ink); display: flex; align-items: center; gap: 12px; }
.pd-panel__date::before { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--brand); }
.pd-panel__stats { font-size: .85rem; color: var(--ink-3); font-family: var(--font-display); }
.pd-panel__stats b { color: var(--ink); font-weight: 600; }
.pd-panel__nav { display: inline-flex; gap: 8px; }
.pd-panel__nav button {
  width: 40px; height: 40px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--paper); display: grid; place-items: center;
  transition: all .25s var(--ease); cursor: pointer;
}
.pd-panel__nav button:hover:not(:disabled) { background: var(--brand); border-color: var(--brand); }
.pd-panel__nav button:hover:not(:disabled) svg { stroke: #fff; }
.pd-panel__nav button:disabled { opacity: .4; cursor: not-allowed; }
.pd-panel__nav svg { width: 18px; height: 18px; stroke: var(--ink); transition: stroke .25s; }

.pd-media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; }
.pd-media {
  position: relative; aspect-ratio: 4/3; overflow: hidden; border-radius: var(--radius-sm);
  cursor: pointer; background: var(--mint-2);
  transition: transform .35s var(--ease), box-shadow .35s var(--ease);
}
.pd-media:hover { transform: translateY(-3px); box-shadow: var(--shadow-sm); }
.pd-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s var(--ease); }
.pd-media:hover img { transform: scale(1.05); }
.pd-media--video::after {
  content: ""; position: absolute; left: 50%; top: 50%; transform: translate(-50%,-50%);
  width: 48px; height: 48px; border-radius: 50%; background: rgba(6,36,23,.75); backdrop-filter: blur(4px);
}
.pd-media--video::before {
  content: ""; position: absolute; left: 50%; top: 50%; transform: translate(-40%,-50%);
  border-style: solid; border-width: 8px 0 8px 13px; border-color: transparent transparent transparent #fff;
  z-index: 2;
}

/* Lightbox de proyectos */
.pd-lb { position: fixed; inset: 0; z-index: 3000; background: rgba(6,20,13,.96); display: none; align-items: center; justify-content: center; padding: 30px; }
.pd-lb.open { display: flex; }
.pd-lb__stage { position: relative; max-width: 92vw; max-height: 88vh; display: flex; align-items: center; justify-content: center; }
.pd-lb__stage img, .pd-lb__stage video { max-width: 92vw; max-height: 88vh; border-radius: 8px; box-shadow: var(--shadow-lg); }
.pd-lb__close, .pd-lb__prev, .pd-lb__next {
  position: absolute; z-index: 5; width: 52px; height: 52px; border-radius: 50%;
  background: rgba(255,255,255,.14); backdrop-filter: blur(6px); color: #fff;
  display: grid; place-items: center; cursor: pointer; border: 0;
  transition: background .3s;
}
.pd-lb__close:hover, .pd-lb__prev:hover, .pd-lb__next:hover { background: rgba(255,255,255,.28); }
.pd-lb__close { top: 24px; right: 28px; font-size: 1.6rem; }
.pd-lb__prev, .pd-lb__next { top: 50%; transform: translateY(-50%); }
.pd-lb__prev { left: 24px; }
.pd-lb__next { right: 24px; }
.pd-lb__prev svg, .pd-lb__next svg { width: 22px; height: 22px; stroke: #fff; }
.pd-lb__caption {
  position: absolute; bottom: 24px; left: 50%; transform: translateX(-50%);
  color: rgba(255,255,255,.85); font-family: var(--font-display); font-size: .88rem;
  background: rgba(6,36,23,.6); padding: 8px 16px; border-radius: 100px; backdrop-filter: blur(6px);
}

/* -------------------------------------------------------- CTA de contacto */
.pd-cta {
  margin: clamp(56px, 8vw, 90px) auto 0;
  width: min(var(--maxw), calc(100% - 2 * var(--gutter)));
  padding: clamp(30px, 4vw, 46px);
  background: radial-gradient(120% 200% at 100% 0%, rgba(34,168,95,.25), transparent 55%), linear-gradient(120deg, var(--brand-900), var(--brand-800));
  border-radius: var(--radius-lg); color: #fff; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 20px;
}
.pd-cta h3 { color: #fff; font-size: 1.4rem; margin-bottom: 6px; }
.pd-cta p { color: rgba(255,255,255,.82); font-size: .96rem; max-width: 480px; }
.pd-cta .btn-primary, .pd-cta .btn-primary:hover { color: #fff; text-decoration: none; }

/* -------------------------------------------------------- Responsive */
@media (max-width: 1080px) {
  .proj-grid { grid-template-columns: 1fr; }
  .pd-hero__inner { grid-template-columns: 1fr; }
  .pd-hero__cover { max-width: 520px; }
  .pd-overview__grid { grid-template-columns: 1fr; }
  .pd-timeline__layout { grid-template-columns: 1fr; gap: 24px; }
  .pd-dates { position: static; max-height: none; display: flex; overflow-x: auto; padding: 8px; gap: 6px; }
  .pd-dates__title { display: none; }
  .pd-date-btn { flex: none; min-width: 140px; }
}
@media (max-width: 640px) {
  .pd-hero__meta { grid-template-columns: 1fr 1fr; gap: 10px; }
  .pd-media-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .pd-panel__head { flex-direction: column; align-items: flex-start; gap: 10px; }
  .pd-cta { flex-direction: column; align-items: flex-start; }
}
