/* ==========================================================================
   Proyectos: avance de obra (lista de proyectos, etapas y publicaciones)
   ========================================================================== */

.proy { padding: clamp(48px, 7vw, 90px) 0 clamp(70px, 9vw, 120px); }
.proy__grid { display: grid; grid-template-columns: 300px minmax(0, 860px); justify-content: center; gap: 40px; align-items: start; }
.proy__grid > * { min-width: 0; }
.proy__main { display: grid; gap: 22px; width: 100%; }

/* --- Lista de proyectos --- */
.proy__side { position: sticky; top: calc(var(--header-h) + 20px); }
.proy__side-title { font-size: .78rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin: 0 0 12px; }
.proy__lista { display: grid; gap: 8px; }
.proy__item { display: flex; gap: 12px; align-items: center; padding: 10px; border-radius: 16px; background: var(--white); border: 1px solid var(--line); transition: border-color .3s, box-shadow .3s, transform .3s var(--ease); }
.proy__item:hover { border-color: var(--gold); transform: translateY(-1px); }
.proy__item.is-on { border-color: var(--gold); box-shadow: 0 12px 30px -16px rgba(168, 132, 76, .6); background: #fffaf2; }
.proy__item-foto, .proy__item-ico { flex: 0 0 56px; height: 56px; border-radius: 12px; overflow: hidden; background: var(--cream-2); display: grid; place-items: center; color: var(--gold-dark); }
.proy__item-foto img { width: 100%; height: 100%; object-fit: cover; }
.proy__item-txt { min-width: 0; display: grid; gap: 2px; line-height: 1.3; }
.proy__item-txt strong { font-size: .95rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.proy__item-txt small { font-size: .78rem; color: var(--muted); }
.proy__barra { display: block; height: 5px; border-radius: 9px; background: var(--cream-2); overflow: hidden; margin-top: 5px; }
.proy__barra span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--gold-dark), var(--gold-2)); }

/* --- Cabecera y etapas --- */
.proy__etapas { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: clamp(20px, 3vw, 30px); box-shadow: var(--shadow); }
.proy__cab { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; margin-bottom: 18px; }
.proy__cab h2 { font-size: clamp(1.5rem, 2.6vw, 2rem); margin: 4px 0 6px; }
.proy__cab .eyebrow { margin: 0; color: var(--gold-dark); }
.proy__dir { display: flex; gap: 6px; align-items: center; margin: 0; color: var(--muted); font-size: .92rem; }
.proy__pct { text-align: center; flex: 0 0 auto; border-radius: 18px; padding: 10px 16px; background: var(--ink); color: var(--white); line-height: 1.1; }
.proy__pct strong { display: block; font-family: var(--ff-serif); font-size: 1.9rem; color: var(--gold-2); font-weight: 500; }
.proy__pct small { font-size: .74rem; letter-spacing: .06em; text-transform: uppercase; opacity: .75; }

.etapas { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; counter-reset: e; position: relative; }
.etapas::before { content: ""; position: absolute; left: 7%; right: 7%; top: 17px; height: 2px; background: var(--cream-2); }
.etapas__paso { position: relative; text-align: center; display: grid; justify-items: center; gap: 4px; padding: 0 2px; }
.etapas__num { position: relative; z-index: 1; width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: .9rem; background: var(--white); border: 2px solid var(--cream-2); color: var(--muted); }
.etapas__paso strong { font-size: .84rem; font-weight: 700; line-height: 1.2; margin-top: 4px; }
.etapas__paso small { font-size: .74rem; line-height: 1.35; color: var(--muted); }
.etapas__paso--hecha .etapas__num { background: var(--gold); border-color: var(--gold); color: var(--white); }
.etapas__paso--actual .etapas__num { background: var(--ink); border-color: var(--gold); color: var(--gold-2); box-shadow: 0 0 0 6px rgba(201, 164, 106, .22); animation: proyPulso 2.2s ease-in-out infinite; }
.etapas__paso--actual strong { color: var(--gold-dark); }
.etapas__paso--pendiente { opacity: .55; }
.etapas__paso--guia .etapas__num { border-color: var(--gold); color: var(--gold-dark); }
.proy__etapas:not(.proy__etapas--guia) .etapas__paso small { display: none; }
@keyframes proyPulso { 50% { box-shadow: 0 0 0 11px rgba(201, 164, 106, 0); } }

.proy__ahora { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-top: 20px; padding: 14px 16px; border-radius: 16px; background: #fbf5ea; border: 1px solid rgba(201, 164, 106, .35); }
.proy__ahora p { margin: 0; flex: 1 1 260px; font-size: .95rem; line-height: 1.5; }
.proy__ahora-ico { flex: 0 0 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--gold); color: var(--white); }
.proy__ver { font-weight: 600; font-size: .9rem; color: var(--gold-dark); white-space: nowrap; }
.proy__ver:hover { color: var(--ink); }

/* --- Avatar y rol --- */
.avatar { flex: 0 0 44px; width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: linear-gradient(135deg, var(--gold-dark), var(--gold-2)); color: var(--ink); font-weight: 700; font-size: 1.05rem; }
.avatar--sm { flex-basis: 32px; width: 32px; height: 32px; font-size: .85rem; }
.rol { display: inline-block; font-size: .7rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; padding: 2px 8px; border-radius: 20px; background: var(--cream-2); color: var(--gold-dark); vertical-align: 1px; }

/* --- Publicar --- */
.pub { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 20px; display: grid; gap: 14px; box-shadow: var(--shadow); }
.pub__head { display: flex; gap: 12px; align-items: center; line-height: 1.3; }
.pub__head strong { display: block; font-size: 1.02rem; }
.pub__head small { color: var(--muted); font-size: .84rem; }
.pub__selects { display: grid; grid-template-columns: 1.6fr 1fr; gap: 10px; }
.pub__selects label { display: grid; gap: 4px; min-width: 0; }
.pub__selects span { font-size: .76rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.pub select, .pub textarea, .coment-form input { width: 100%; font: inherit; font-size: .95rem; color: var(--text); background: var(--cream); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; outline: none; transition: border-color .2s, background .2s; }
.pub select:focus, .pub textarea:focus, .coment-form input:focus { border-color: var(--gold); background: var(--white); }
.pub textarea { resize: vertical; min-height: 84px; line-height: 1.5; }
.pub__medios { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
.pub__medio { position: relative; aspect-ratio: 1; border-radius: 12px; overflow: hidden; background: var(--ink-3); }
.pub__medio img, .pub__medio video { width: 100%; height: 100%; object-fit: cover; }
.pub__medio button { position: absolute; top: 5px; right: 5px; width: 24px; height: 24px; border-radius: 50%; background: rgba(14, 17, 22, .75); color: #fff; font-size: 16px; line-height: 1; }
.pub__medio i { position: absolute; left: 6px; bottom: 6px; font-style: normal; font-size: .7rem; font-weight: 700; color: #fff; background: rgba(14, 17, 22, .7); padding: 2px 6px; border-radius: 8px; }
.pub__barra { height: 6px; border-radius: 9px; background: var(--cream-2); overflow: hidden; }
.pub__barra span { display: block; height: 100%; width: 0; background: var(--gold); transition: width .2s; }
.pub__error { margin: 0; color: #b42318; font-size: .9rem; }
.pub__acciones { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; border-top: 1px solid var(--line); padding-top: 12px; }
.pub__adjuntar { position: relative; display: inline-flex; gap: 7px; align-items: center; padding: 8px 14px; border-radius: 30px; font-size: .9rem; font-weight: 600; cursor: pointer; color: var(--ink); background: var(--cream); transition: background .2s; }
.pub__adjuntar:hover { background: var(--cream-2); }
.pub__adjuntar svg { color: var(--gold-dark); }
.pub__adjuntar input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; }
.pub__limite { color: var(--muted); font-size: .78rem; margin-right: auto; }
.pub.is-enviando { opacity: .7; pointer-events: none; }

/* --- Publicaciones --- */
.feed { display: grid; gap: 22px; }
.post { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: 0 16px 40px -28px rgba(14, 17, 22, .35); overflow: hidden; scroll-margin-top: calc(var(--header-h) + 20px); }
.post__head { display: flex; gap: 12px; align-items: center; padding: 18px 20px 0; }
.post__quien { flex: 1; min-width: 0; line-height: 1.35; }
.post__quien p { margin: 0; }
.post__quien small { color: var(--muted); font-size: .82rem; }
.post__quien small a { color: var(--gold-dark); font-weight: 600; }
.post__quien small a:hover { color: var(--ink); }
.chip-etapa { display: inline-flex; gap: 7px; align-items: center; font-size: .78rem; font-weight: 700; padding: 4px 11px 4px 4px; border-radius: 30px; background: #fbf5ea; color: var(--gold-dark); border: 1px solid rgba(201, 164, 106, .4); white-space: nowrap; }
.chip-etapa b { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; background: var(--gold); color: var(--white); font-size: .74rem; }
.post__borrar { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; color: var(--muted); transition: background .2s, color .2s; }
.post__borrar:hover { background: #fdecea; color: #b42318; }
.post__texto { padding: 14px 20px 0; margin: 0; font-size: 1rem; line-height: 1.6; white-space: normal; overflow-wrap: anywhere; }

.post__fotos { display: grid; gap: 4px; margin-top: 14px; grid-template-columns: repeat(6, 1fr); grid-auto-rows: 160px; }
.post__foto { position: relative; overflow: hidden; background: var(--ink-3); grid-column: span 3; }
.post__foto img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s var(--ease); }
.post__foto:hover img { transform: scale(1.04); }
.post__fotos--1 { grid-auto-rows: auto; }
.post__fotos--1 .post__foto { grid-column: 1 / -1; aspect-ratio: 16 / 10; max-height: 520px; }
.post__fotos--2 { grid-auto-rows: 300px; }
.post__fotos--3 .post__foto:first-child { grid-column: 1 / -1; grid-row: span 2; }
.post__fotos--4 .post__foto:first-child { grid-column: 1 / -1; grid-row: span 2; }
.post__fotos--4 .post__foto:not(:first-child) { grid-column: span 2; }
.post__fotos--5 .post__foto:nth-child(-n+2) { grid-row: span 2; }
.post__fotos--5 .post__foto:nth-child(n+3) { grid-column: span 2; }
.post__mas { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(14, 17, 22, .55); color: #fff; font-size: 1.8rem; font-weight: 600; }
.post__video { margin-top: 14px; background: #000; }
.post__video video { display: block; width: 100%; max-height: 560px; }

.post__acciones { display: flex; gap: 10px; align-items: center; padding: 10px 14px; border-top: 1px solid var(--line); margin-top: 14px; }
.post__fotos + .post__acciones, .post__video + .post__acciones { margin-top: 0; }
.like { display: inline-flex; gap: 8px; align-items: center; padding: 8px 14px; border-radius: 30px; font-weight: 600; font-size: .92rem; transition: background .2s, color .2s; }
.like svg { fill: none; stroke: currentColor; stroke-width: 1.9; transition: transform .35s var(--ease); }
.like:hover { background: #fdf0f0; color: #d23c4b; }
.like.is-on { color: #e0245e; }
.like.is-on svg { fill: currentColor; stroke: currentColor; }
.like.is-pop svg { animation: likePop .45s var(--ease); }
.like b { font-weight: 700; color: var(--muted); }
.like.is-on b { color: inherit; }
@keyframes likePop { 40% { transform: scale(1.45); } 100% { transform: scale(1); } }
.compartir { display: inline-flex; gap: 8px; align-items: center; padding: 8px 14px; border-radius: 30px; font-weight: 600; font-size: .92rem; transition: background .2s, color .2s; }
.compartir:hover { background: #f6efe2; color: #a8843f; }
.comp-menu { position: absolute; z-index: 1200; min-width: 210px; padding: 6px; background: #fff; border-radius: 14px; box-shadow: 0 18px 50px rgba(14,17,22,.18), 0 2px 6px rgba(14,17,22,.08); border: 1px solid rgba(14,17,22,.06); animation: compIn .18s ease-out; }
@keyframes compIn { from { opacity: 0; transform: translateY(-4px); } }
.comp-menu__op { display: flex; align-items: center; gap: 12px; width: 100%; padding: 9px 10px; border-radius: 10px; font-size: .93rem; font-weight: 600; color: #1a1d23; text-decoration: none; text-align: left; background: none; border: 0; cursor: pointer; font-family: inherit; }
.comp-menu__op:hover { background: #f5f2ec; }
.comp-menu__op i { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; color: #fff; flex: none; }
.comp-menu__op--facebook i { background: #1877f2; }
.comp-menu__op--whatsapp i { background: #25d366; }
.comp-menu__op--x i { background: #0e1116; }
.comp-menu__op--correo i { background: #8a7a5c; }
.comp-menu__op--copiar i { background: #c9a35b; }
.post__ncoment { display: inline-flex; gap: 6px; align-items: center; margin-left: auto; color: var(--muted); font-size: .9rem; }

.post__coments { padding: 0 18px 16px; background: #fcfaf7; border-top: 1px solid var(--line); }
.post__coments ul { list-style: none; margin: 0; padding: 12px 0 0; display: grid; gap: 10px; }
.post__coments ul:empty { padding: 0; }
.coment { display: flex; gap: 9px; align-items: flex-start; }
.coment__burbuja { background: var(--white); border: 1px solid var(--line); border-radius: 4px 16px 16px 16px; padding: 8px 13px; min-width: 0; }
.coment__burbuja p { margin: 0; line-height: 1.45; }
.coment__autor { font-size: .88rem; }
.coment__texto { font-size: .93rem; overflow-wrap: anywhere; }
.coment__meta { font-size: .76rem; color: var(--muted); margin-top: 3px !important; }
.coment__meta button { font-size: inherit; color: var(--muted); text-decoration: underline; }
.coment__meta button:hover { color: #b42318; }
.coment-form { display: flex; gap: 9px; align-items: center; margin-top: 12px; }
.coment-form input { border-radius: 30px; padding: 9px 16px; background: var(--white); }
.coment-form button { flex: 0 0 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; background: var(--gold); color: var(--ink); }
.coment-form button:hover { background: var(--gold-2); }

.feed__paginas { display: flex; justify-content: space-between; gap: 10px; }
.proy__vacio { text-align: center; padding: 50px 20px; border: 1px dashed rgba(201, 164, 106, .6); border-radius: var(--radius-lg); color: var(--muted); background: rgba(255, 255, 255, .5); }
.proy__vacio svg { color: var(--gold); margin: 0 auto 10px; }
.proy__vacio p { margin: 0; }
.proy__nota { display: flex; gap: 8px; align-items: center; justify-content: center; margin: 0; font-size: .88rem; color: var(--muted); text-align: center; }
.proy__nota svg { color: #e0245e; flex: 0 0 auto; }

/* --- Visor de fotos --- */
.plb { position: fixed; inset: 0; z-index: 1000; background: rgba(8, 10, 13, .94); display: grid; place-items: center; padding: 50px 90px; }
.plb[hidden] { display: none; }
.plb img { max-width: 100%; max-height: calc(100vh - 100px); max-height: calc(100dvh - 100px); width: auto; height: auto; object-fit: contain; border-radius: 6px; }
.plb__x { position: absolute; top: 14px; right: 18px; color: #fff; font-size: 2.4rem; line-height: 1; }
.plb__nav { position: absolute; top: 50%; margin-top: -27px; width: 54px; height: 54px; border-radius: 50%; display: flex; align-items: center; justify-content: center; padding: 0; color: #fff; background: rgba(255, 255, 255, .1); border: 1px solid rgba(255, 255, 255, .18); transition: background .2s; z-index: 2; }
.plb__nav svg { display: block; }
.plb__nav:hover { background: rgba(255, 255, 255, .22); }
.plb__nav--prev { left: 20px; }
.plb__nav--next { right: 20px; }
.plb__nav[hidden] { display: none; }
.plb__count { position: absolute; bottom: 16px; left: 50%; transform: translateX(-50%); color: rgba(255, 255, 255, .75); font-size: .9rem; }

/* --- Encabezado del muro y botón "Nueva publicación" --- */
.proy__top { display: flex; justify-content: space-between; align-items: center; gap: 18px; flex-wrap: wrap; padding: clamp(20px, 3vw, 28px) clamp(20px, 3vw, 30px); border-radius: var(--radius-lg); background: radial-gradient(120% 140% at 100% 0%, #2a2216 0%, var(--ink) 60%); color: var(--white); box-shadow: var(--shadow); }
.proy__top .eyebrow { margin: 0 0 6px; color: var(--gold-2); }
.proy__top h2 { margin: 0; font-size: clamp(1.6rem, 3vw, 2.3rem); color: var(--white); }
.proy__top h2 em { color: var(--gold-2); }
.btn-nueva { position: relative; display: inline-flex; align-items: center; gap: 12px; padding: 8px 22px 8px 8px; border-radius: 999px; font-weight: 700; font-size: .95rem; letter-spacing: .01em; color: var(--ink); background: linear-gradient(135deg, var(--gold-2), var(--gold) 55%, var(--gold-dark)); box-shadow: 0 12px 28px -10px rgba(201, 164, 106, .7), inset 0 1px 0 rgba(255, 255, 255, .45); transition: transform .3s var(--ease), box-shadow .3s; overflow: hidden; }
.btn-nueva::after { content: ""; position: absolute; inset: 0; background: linear-gradient(110deg, transparent 30%, rgba(255, 255, 255, .45) 50%, transparent 70%); transform: translateX(-120%); transition: transform .8s var(--ease); }
.btn-nueva:hover { transform: translateY(-2px); box-shadow: 0 18px 34px -12px rgba(201, 164, 106, .85), inset 0 1px 0 rgba(255, 255, 255, .45); }
.btn-nueva:hover::after { transform: translateX(120%); }
.btn-nueva__ico { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: var(--ink); color: var(--gold-2); transition: transform .4s var(--ease); }
.btn-nueva:hover .btn-nueva__ico { transform: rotate(90deg); }

/* --- Ventana para publicar --- */
.pmodal { position: fixed; inset: 0; z-index: 1001; display: grid; place-items: center; padding: 20px; }
.pmodal[hidden] { display: none; }
.pmodal__fondo { position: absolute; inset: 0; background: rgba(8, 10, 13, .6); backdrop-filter: blur(4px); opacity: 0; transition: opacity .25s; }
.pmodal__caja { position: relative; width: min(620px, 100%); max-height: calc(100vh - 40px); overflow-y: auto; opacity: 0; transform: translateY(18px) scale(.98); transition: opacity .25s, transform .3s var(--ease); }
.pmodal.is-open .pmodal__fondo { opacity: 1; }
.pmodal.is-open .pmodal__caja { opacity: 1; transform: none; }
.pmodal__x { margin-left: auto; width: 36px; height: 36px; border-radius: 50%; font-size: 1.6rem; line-height: 1; color: var(--muted); background: var(--cream); }
.pmodal__x:hover { background: var(--cream-2); color: var(--ink); }
.pub__head > div { flex: 1; min-width: 0; }
.pub__campo { display: grid; gap: 4px; }
.pub__campo span { font-size: .76rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
@media (max-width: 640px) {
    .pmodal { padding: 0; place-items: end stretch; }
    .pmodal__caja { width: 100%; max-height: 92vh; border-radius: 24px 24px 0 0; }
    .btn-nueva { width: 100%; justify-content: center; }
}

/* --- Responsivo --- */
@media (max-width: 1100px) {
    .proy__grid { grid-template-columns: minmax(0, 1fr); gap: 22px; }
    .proy__side { position: static; }
    .proy__lista { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 6px; margin-inline: -4px; padding-inline: 4px; }
    .proy__item { flex: 0 0 250px; scroll-snap-align: start; }
}
@media (max-width: 760px) {
    .etapas { grid-template-columns: 1fr; gap: 0; }
    .etapas::before { left: 17px; right: auto; top: 18px; bottom: 18px; width: 2px; height: auto; }
    .etapas__paso { grid-template-columns: 36px 1fr; justify-items: start; text-align: left; column-gap: 12px; row-gap: 0; padding: 6px 0; }
    .etapas__num { grid-row: span 2; }
    .etapas__paso strong { margin-top: 0; align-self: end; }
    .proy__etapas:not(.proy__etapas--guia) .etapas__paso strong { align-self: center; grid-row: span 2; }
    .pub__selects { grid-template-columns: 1fr; }
    .post__head { flex-wrap: wrap; padding: 16px 16px 0; }
    .chip-etapa { order: 3; margin-left: 56px; }
    .post__texto { padding-inline: 16px; }
    .post__fotos { grid-auto-rows: 110px; }
    .post__fotos--2 { grid-auto-rows: 190px; }
    .post__fotos--1 { grid-auto-rows: auto; }
    .plb { padding: 50px 10px; }
    .plb__nav { width: 44px; height: 44px; margin-top: -22px; background: rgba(14, 17, 22, .55); }
    .plb__nav--prev { left: 8px; }
    .plb__nav--next { right: 8px; }
}
.pub__acciones .btn { margin-left: auto; }
.avatar--logo { background: var(--white); border: 1px solid var(--line); padding: 4px; box-shadow: 0 4px 12px -6px rgba(14, 17, 22, .35); }
.avatar--logo img { width: 100%; height: 100%; object-fit: contain; }
.post__ok { color: var(--gold); vertical-align: -3px; margin-left: 2px; }
.chip-modelo { display: inline-flex; gap: 6px; align-items: center; font-size: .8rem; font-weight: 700; padding: 6px 12px; border-radius: 30px; background: #fbf5ea; color: var(--gold-dark); border: 1px solid rgba(201, 164, 106, .45); white-space: nowrap; transition: background .2s, color .2s; }
.chip-modelo:hover { background: var(--gold); color: var(--ink); }
.chip-modelo--lux { background: var(--ink); color: var(--gold-2); border-color: var(--ink); }
@media (max-width: 760px) { .chip-modelo { order: 3; margin-left: 56px; } }
.post__editar:hover { background: #fbf5ea; color: var(--gold-dark); }
.chip-modelo + .post__editar, .post__quien + .post__editar { margin-left: 2px; }
