/* ============================================================
   WERHINO 2.0 - Millwork Detail Library
   details.css · layers on platform.css (tokens, nav, footer)
   Pinterest/Houzz-style gallery. The grid is free to browse;
   opening the full technical detail requires a free account.
   ============================================================ */

.dlib { padding: calc(var(--nav-h) + clamp(2.5rem,7vh,5rem)) 0 clamp(1.4rem,4vh,2.2rem); }
.dlib__title { font-size: clamp(2.8rem, 6vw, 5rem); margin: 1.3rem 0 1.1rem; max-width: 16ch; }
.dlib__title em { font-style: italic; color: var(--accent); }
.dlib__sub { color: var(--muted); font-weight: 300; max-width: 56ch; line-height: 1.7; font-size: 1.05rem; }

/* search + filters */
.dsearch { margin-top: 2rem; position: relative; max-width: 460px; }
.dsearch input {
  width: 100%; background: var(--bg-2); border: 1px solid var(--line); border-radius: 999px;
  padding: .9em 1.2em .9em 2.8em; color: var(--text); font: inherit; font-size: .92rem; transition: border-color .3s;
}
.dsearch input::placeholder { color: rgba(244,239,231,.4); }
.dsearch input:focus { outline: none; border-color: var(--accent); }
.dsearch svg { position: absolute; left: 1.05em; top: 50%; transform: translateY(-50%); width: 17px; height: 17px; stroke: var(--muted); fill: none; stroke-width: 1.7; }

.dfilters { display: flex; flex-direction: column; gap: .7rem; margin-top: 1.4rem; }
.dfrow { display: flex; flex-wrap: wrap; gap: .45rem; align-items: center; }
.dfrow__label { font-size: .58rem; font-weight: 600; letter-spacing: .18em; text-transform: uppercase; color: var(--faint); width: 70px; flex-shrink: 0; }
.dfilter {
  font-size: .7rem; font-weight: 600; letter-spacing: .04em;
  padding: .5em 1em; border-radius: 999px; border: 1px solid var(--line); color: var(--muted);
  transition: border-color .3s, color .3s, background .3s;
}
.dfilter:hover { color: var(--text); border-color: var(--line-2); }
.dfilter.is-active { background: var(--accent); color: #1a1409; border-color: var(--accent); }

.dcount { margin-top: 1.2rem; font-size: .76rem; color: var(--muted); letter-spacing: .04em; }

/* masonry */
.dgrid { columns: 3 300px; column-gap: clamp(.7rem,1.2vw,1rem); padding-bottom: clamp(4rem,9vh,7rem); }
.dcard {
  break-inside: avoid; position: relative; margin-bottom: clamp(.7rem,1.2vw,1rem);
  border-radius: var(--r-card); overflow: hidden; cursor: pointer; isolation: isolate;
  border: 1px solid var(--line); background: var(--bg-card);
}
.dcard__img { width: 100%; display: block; transition: transform .9s var(--ease), filter .5s var(--ease); filter: brightness(.86); }
.dcard:hover .dcard__img { transform: scale(1.05); filter: brightness(1); }
.dcard::after { content: ''; position: absolute; inset: 0; z-index: 1; pointer-events: none; background: linear-gradient(to top, rgba(8,7,6,.9) 4%, rgba(8,7,6,.12) 46%, transparent 72%); }
.dcard__meta { position: absolute; left: 0; right: 0; bottom: 0; z-index: 2; padding: 1.1rem 1.15rem; }
.dcard__cat { font-size: .58rem; font-weight: 600; letter-spacing: .2em; text-transform: uppercase; color: var(--accent); }
.dcard__title { font-family: var(--font-d); font-weight: 500; font-size: 1.35rem; line-height: 1.06; color: var(--text); margin-top: .2rem; }
.dcard__tags { display: flex; flex-wrap: wrap; gap: .3rem; margin-top: .6rem; }
.dcard__tag { font-size: .56rem; letter-spacing: .08em; color: var(--muted); border: 1px solid var(--line); padding: .2em .6em; border-radius: 999px; }
.dcard__fav {
  position: absolute; top: .8rem; right: .8rem; z-index: 3; width: 36px; height: 36px; border-radius: 50%;
  display: grid; place-items: center; background: rgba(12,11,9,.5); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  border: 1px solid var(--line); color: var(--text); transition: background .3s, color .3s, transform .3s var(--ease);
}
.dcard__fav:hover { transform: scale(1.1); }
.dcard__fav svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.6; }
.dcard__fav.is-fav { background: var(--accent); color: #1a1409; border-color: var(--accent); }
.dcard__fav.is-fav svg { fill: currentColor; }
/* lock hint for non-members */
.dcard__lock { position: absolute; top: .8rem; left: .8rem; z-index: 3; display: none; align-items: center; gap: .35rem;
  font-size: .56rem; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--text);
  background: rgba(12,11,9,.5); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); border: 1px solid var(--line);
  padding: .35em .7em; border-radius: 999px; }
.dcard__lock svg { width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 1.6; }
body:not(.is-member) .dcard__lock { display: inline-flex; }

.dempty { color: var(--muted); padding: 2rem 0; }

/* detail modal */
.dlb { position: fixed; inset: 0; z-index: 410; display: none; align-items: center; justify-content: center; padding: 1.2rem; }
.dlb.is-open { display: flex; }
.dlb__backdrop { position: absolute; inset: 0; background: rgba(6,5,4,.84); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
.dlb__card { position: relative; width: min(1040px, 100%); max-height: 92vh; overflow: hidden; display: grid; grid-template-columns: 1.1fr 1fr; background: var(--bg-card); border: 1px solid var(--line); border-radius: 20px; box-shadow: 0 50px 130px rgba(0,0,0,.6); }
.dlb.is-open .dlb__card { animation: authPop .5s var(--ease); }
.dlb__media { position: relative; background: #0a0908; }
.dlb__media img { width: 100%; height: 100%; object-fit: cover; min-height: 360px; }
.dlb__info { padding: clamp(1.6rem,2.4vw,2.4rem); overflow-y: auto; max-height: 92vh; display: flex; flex-direction: column; gap: 1.05rem; }
.dlb__cat { font-size: .62rem; font-weight: 600; letter-spacing: .2em; text-transform: uppercase; color: var(--accent); }
.dlb__name { font-family: var(--font-d); font-weight: 500; font-size: clamp(2rem,3.2vw,2.7rem); line-height: 1.03; }
.dlb__tags { display: flex; flex-wrap: wrap; gap: .35rem; }
.dlb__tag { font-size: .58rem; letter-spacing: .08em; color: var(--muted); border: 1px solid var(--line); padding: .25em .7em; border-radius: 999px; }
.dlb__drawing { width: 100%; border-radius: 10px; border: 1px solid var(--line); background: #14120d; overflow: hidden; display: block; }
.dlb__drawing svg { display: block; width: 100%; height: auto; }
.dlb__row { display: flex; flex-direction: column; gap: .25rem; }
.dlb__row h5 { font-size: .6rem; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; color: var(--faint); }
.dlb__row p { font-size: .92rem; color: var(--text); line-height: 1.55; }
.dlb__li { list-style: none; display: flex; gap: .6rem; align-items: flex-start; font-size: .9rem; color: var(--muted); padding: .25rem 0; }
.dlb__li::before { content: ''; width: 6px; height: 6px; border-radius: 50%; margin-top: .5em; flex-shrink: 0; }
.dlb__li--good::before { background: var(--ok); }
.dlb__li--bad::before { background: var(--hot); }
.dlb__costline { display: flex; align-items: baseline; gap: .6rem; }
.dlb__cost { font-family: var(--font-d); font-size: 1.3rem; font-weight: 600; color: var(--accent); letter-spacing: .05em; }
.dlb__costlabel { font-size: .62rem; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; color: var(--faint); }
.dlb__crosslink { display: inline-block; font-size: .82rem; color: var(--accent); text-decoration: underline; text-underline-offset: 3px; transition: color .3s; }
.dlb__crosslink:hover { color: var(--accent-2); }
.dlb__actions { display: flex; flex-wrap: wrap; gap: .7rem; margin-top: auto; padding-top: .6rem; }
.dlb__actions .btn { flex: 1; min-width: 160px; }
.dlb__save { flex: 1; }
.dlb__close { position: absolute; top: 1rem; right: 1rem; z-index: 4; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; color: var(--text); background: rgba(12,11,9,.55); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); border: 1px solid var(--line); transition: background .3s, color .3s, transform .3s var(--ease); }
.dlb__close:hover { background: var(--accent); color: #1a1409; transform: rotate(90deg); }
.dlb__close svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 1.6; }

@media (max-width: 900px) { .dgrid { columns: 2 220px; } .dfrow__label { width: 100%; } }
@media (max-width: 760px) {
  .dlb__card { grid-template-columns: 1fr; grid-template-rows: auto 1fr; max-height: 94vh; overflow-y: auto; }
  .dlb__media img { min-height: 220px; max-height: 36vh; }
}
@media (max-width: 480px) { .dgrid { columns: 1; } }
