/* «کتابخانه‌ی مو» — the hair library: the opening with four chapters, the face guide, the sticky filter bar, the wall of
   styles, and the style sheet (a modal <dialog>: full screen on phones, a two-pane spread on desktop). */

/* ---------- opening + chapters ---------- */
.hlo { padding-top: calc(var(--header-h) + clamp(28px, 6vw, 80px)); padding-bottom: clamp(30px, 5vw, 64px); }
.hlo__in { display: grid; gap: clamp(28px, 4vw, 56px); }
.hlo__head { display: grid; gap: 14px; justify-items: start; max-width: 44em; }
.hlo__lead { font-size: clamp(15px, 1.25vw, 18px); line-height: 2.05; color: var(--cocoa); margin: 0; }
.hlo__ch { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(150px, 44vw); gap: 14px; overflow-x: auto; scroll-snap-type: x mandatory;
  margin-inline: calc(-1 * var(--gutter)); padding-inline: var(--gutter); scrollbar-width: none; }
.hlo__ch::-webkit-scrollbar { display: none; }
@media (min-width: 900px) { .hlo__ch { grid-auto-flow: initial; grid-template-columns: repeat(4, 1fr); gap: clamp(16px, 2vw, 30px); overflow: visible; margin: 0; padding: 0; } }
.hlch { position: relative; display: grid; gap: 4px; scroll-snap-align: start; color: inherit; text-decoration: none; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.hlch .media { border-radius: 9999px 9999px 2px 2px; overflow: hidden; margin-bottom: 10px; }
.hlch .media img { transition: transform 1.4s var(--ease), filter .8s; filter: saturate(.85); }
.hlch:hover .media img { transform: scale(1.04); filter: none; }
.hlch__n { position: absolute; top: 58%; left: -.06em; font-size: clamp(54px, 6vw, 92px); font-style: italic; line-height: 1; color: var(--ivory); text-shadow: 0 2px 24px rgba(43,10,15,.35); pointer-events: none; }
.hlch__t { font-family: var(--f-display); font-weight: 300; font-size: clamp(19px, 1.7vw, 26px); line-height: 1.35; }
.hlch__en { font-family: var(--f-latin); font-style: italic; font-size: 14px; color: var(--rosegold); }
.hlch small { font-size: 12px; color: var(--cocoa); }
.hlch.is-on { border-bottom: 2px solid var(--bordeaux); }
.hlch.is-on .hlch__t { color: var(--bordeaux); }
.hlch.is-on .media img { filter: none; }

/* ---------- chapter body ---------- */
.hl { padding-block: clamp(24px, 4vw, 56px) clamp(60px, 8vw, 120px); }
.hl__head { display: grid; gap: 10px; max-width: 46em; margin-bottom: clamp(20px, 3vw, 36px); }
.hl__head p { margin: 0; line-height: 2; }

/* the face guide (cuts) */
.fg { display: grid; gap: 16px; padding: clamp(18px, 2.4vw, 30px); background: var(--paper); border: 1px solid var(--line); margin-bottom: 22px; }
.fg__q { display: grid; gap: 4px; margin: 0; }
.fg__q b { font-family: var(--f-display); font-weight: 400; font-size: 19px; }
.fg__list { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.fg__b { display: grid; justify-items: center; gap: 6px; padding: 12px 4px 10px; border: 1px solid transparent; background: none; font: inherit; color: var(--espresso); cursor: pointer; border-radius: 4px; transition: background .4s, border-color .4s; }
.fg__b b { font-weight: 400; font-size: 13.5px; }
.fg__b small { display: none; font-size: 11.5px; line-height: 1.7; color: var(--cocoa); text-align: center; }
.fg__b:hover { background: var(--ivory); }
.fg__b.is-on { background: var(--blush); border-color: rgba(93,15,23,.25); }
.face { width: 34px; height: 44px; fill: none; stroke: var(--cocoa); stroke-width: 1.3; stroke-linecap: round; transition: stroke .4s; }
.face__f { stroke-width: 1; opacity: .7; }
.fg__b.is-on .face { stroke: var(--bordeaux); }
@media (min-width: 900px) {
  .fg { grid-template-columns: 15em 1fr; align-items: center; }
  .fg__b small { display: block; }
  .face { width: 40px; height: 52px; }
}

/* the sticky filter bar */
.hl__bar { position: sticky; top: calc(var(--header-h) - 1px); z-index: 6; background: var(--ivory); padding: 10px 0 8px; border-bottom: 1px solid var(--line); display: grid; gap: 8px; }
.hl__bar::before { content: ''; position: absolute; inset: 0 calc(-1 * var(--gutter)); background: var(--ivory); z-index: -1; }
.hl__groups { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin-inline: calc(-1 * var(--gutter)); padding-inline: var(--gutter); gap: 6px; }
.hl__groups::-webkit-scrollbar { display: none; }
.hl__groups .chip small { font-size: 11px; opacity: .6; margin-inline-start: 2px; }
.hl__facets { display: flex; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; gap: 6px 18px; align-items: center; margin-inline: calc(-1 * var(--gutter)); padding-inline: var(--gutter); }
.hl__facets::-webkit-scrollbar { display: none; }
.hl__facet { display: flex; align-items: center; gap: 6px; flex: none; }
.hl__ft { font-size: 12px; color: var(--rosegold); margin-inline-end: 2px; white-space: nowrap; }
.hl__facets .chip { min-height: 32px; padding-inline: 12px; font-size: 12.5px; }
.hl__reset { font-size: 12.5px; white-space: nowrap; flex: none; }
@media (min-width: 900px) { .hl__facets, .hl__groups { flex-wrap: wrap; overflow: visible; margin: 0; padding: 0; } }
.hl__tgl { border: 0; background: none; font: inherit; font-size: 12.5px; padding: 0; color: var(--cocoa); }
.hl__tgl span { width: 34px; height: 20px; border-radius: 99px; background: var(--nude); position: relative; transition: background .4s; flex: none; }
.hl__tgl span::after { content: ''; position: absolute; top: 3px; right: 3px; width: 14px; height: 14px; border-radius: 50%; background: var(--ivory); transition: transform .5s var(--ease); }
.hl__tgl[aria-pressed="true"] { color: var(--espresso); }
.hl__tgl[aria-pressed="true"] span { background: var(--bordeaux); }
.hl__tgl[aria-pressed="true"] span::after { transform: translateX(-14px); }

/* «مدل‌های من» */
.hl__mine:empty { display: none; }
.hl__mine { display: grid; gap: 10px; margin-top: 18px; padding: 14px 16px; background: var(--paper); border: 1px solid var(--line); }
.hl__mh { display: flex; align-items: baseline; gap: 10px; }
.hl__mh b { font-family: var(--f-display); font-weight: 400; font-size: 17px; }
.hl__mh small { font-size: 12px; color: var(--cocoa); }
.hl__mr { display: flex; gap: 10px; overflow-x: auto; scrollbar-width: thin; padding-bottom: 4px; }
.hl__mr button { flex: none; width: 84px; display: grid; gap: 4px; border: 0; background: none; padding: 0; font: inherit; cursor: pointer; text-align: start; }
.hl__mr small { font-size: 11px; line-height: 1.5; color: var(--cocoa); overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }

.hl__count { margin: 18px 0 12px; font-size: 13px; color: var(--cocoa); }
.hl__empty { grid-column: 1 / -1; padding: 40px 0; text-align: center; color: var(--cocoa); }
.hl__note { margin-top: 40px; font-size: 12.5px; color: var(--cocoa); line-height: 2; }

/* ---------- the wall ---------- */
.hl__grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 26px 12px; }
@media (min-width: 700px) { .hl__grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 36px 18px; } }
@media (min-width: 1100px) { .hl__grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 44px 24px; } }
.hc { position: relative; display: grid; gap: 10px; align-content: start; }
.hc__open { display: block; position: relative; width: 100%; padding: 0; border: 0; background: none; cursor: pointer; overflow: hidden; }
.hc__open .media img { transition: transform 1.4s var(--ease); }
.hc__open:hover .media img, .hc__open:focus-visible .media img { transform: scale(1.045); }
.hc__view { position: absolute; bottom: 10px; inset-inline-start: 10px; padding: 3px 10px; font-size: 11px; background: rgba(250,246,241,.9); color: var(--espresso); }
.hc__cap { display: grid; gap: 2px; }
.hc__name { margin: 0; font-family: var(--f-display); font-weight: 400; font-size: clamp(15px, 1.25vw, 18px); line-height: 1.5; }
.hc__fact { margin: 0; font-size: 12px; color: var(--cocoa); line-height: 1.7; }
.hc__save { position: absolute; top: 10px; inset-inline-end: 10px; width: 40px; height: 40px; display: grid; place-items: center; border: 0; border-radius: 50%;
  background: rgba(250,246,241,.88); color: var(--espresso); cursor: pointer; transition: transform .5s var(--ease), color .4s; }
.hc__save:hover { transform: scale(1.06); }
.hc__save.is-on, .hs__save.is-on { color: var(--bordeaux); }
.hc__save.is-on svg path, .hs__save.is-on svg path { fill: currentColor; }

/* ---------- the style sheet ---------- */
html.has-sheet { overflow: hidden; }
.hs { padding: 0; border: 0; margin: 0; width: 100%; max-width: 100%; height: 100%; max-height: 100%; background: var(--ivory); color: var(--espresso); overflow-y: auto; overscroll-behavior: contain; }
.hs::backdrop { background: rgba(43,10,15,.6); backdrop-filter: blur(4px); }
html.motion .hs[open] { animation: hsIn .7s var(--ease); }
@keyframes hsIn { from { opacity: 0; transform: translateY(24px); } }
.hs__in { display: grid; min-height: 100%; }
.hs__media { position: relative; height: 64svh; background: var(--nude); }
.hs__media .media { position: absolute; inset: 0; }
.hs__media img { object-position: 50% 30%; }
.hs__view { position: absolute; top: 14px; inset-inline-start: 14px; padding: 4px 12px; font-size: 12px; background: rgba(250,246,241,.9); }
.hs__nav { position: absolute; bottom: 14px; left: 50%; transform: translateX(-50%); display: flex; align-items: center; gap: 4px; padding: 4px; background: rgba(250,246,241,.92); border-radius: 999px; font-size: 12px; color: var(--cocoa); white-space: nowrap; }
.hs__nav button { width: 40px; height: 40px; display: grid; place-items: center; border: 0; border-radius: 50%; background: none; color: var(--espresso); cursor: pointer; }
.hs__nav button:hover { background: var(--blush); }
.hs__body { display: grid; gap: 16px; align-content: start; padding: 22px var(--gutter) 40px; }
.hs__top { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.hs__x { width: 44px; height: 44px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 50%; background: var(--ivory); cursor: pointer; flex: none; }
.hs__t { margin: 0; font-weight: 300; font-size: clamp(26px, 2.6vw, 38px); line-height: 1.35; }
.hs__en { margin: -8px 0 0; font-family: var(--f-latin); font-style: italic; font-size: 16px; color: var(--rosegold); }
.hs__ask { margin: 4px 0 0; padding: 18px 20px 14px; background: var(--blush); display: grid; gap: 10px; border-inline-start: 2px solid var(--bordeaux); }
.hs__ask figcaption { display: flex; align-items: baseline; gap: 10px; }
.hs__ask figcaption b { font-weight: 500; font-size: 14px; color: var(--bordeaux); }
.hs__ask blockquote { margin: 0; font-family: var(--f-display); font-weight: 300; font-size: clamp(16px, 1.3vw, 18.5px); line-height: 2.05; }
.hs__copy { justify-self: start; display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; }
.hs__facts { margin: 0; display: grid; border-top: 1px solid var(--line); }
.hs__facts div { display: grid; grid-template-columns: 7.5em 1fr; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.hs__facts dt { font-size: 12.5px; color: var(--rosegold); }
.hs__facts dd { margin: 0; font-size: 14px; line-height: 1.9; }
.hs__fl { display: block; font-size: 12.5px; color: var(--rosegold); margin-bottom: 8px; }
.hs__faces > div { display: flex; gap: 12px; flex-wrap: wrap; }
.hs__face { display: grid; justify-items: center; gap: 2px; opacity: .32; }
.hs__face small { font-size: 11.5px; }
.hs__face.is-on { opacity: 1; }
.hs__face.is-on .face { stroke: var(--bordeaux); }
.hs__svc { margin: 0; display: flex; justify-content: space-between; align-items: center; gap: 14px; padding: 14px 18px; border: 1px solid var(--line); background: var(--paper); }
.hs__svc > span:first-child { display: grid; gap: 2px; }
.hs__svc b { font-weight: 500; font-size: 15px; }
.hs__svc small { font-size: 12px; color: var(--cocoa); }
.hs__cta { display: flex; flex-wrap: wrap; gap: 10px; }
.hs__cta .btn { display: inline-flex; align-items: center; gap: 8px; }
.hs__cta .btn--primary { flex: 1 1 100%; justify-content: center; }
.hs__sim > div { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.hs__sim button { display: grid; gap: 4px; border: 0; background: none; padding: 0; font: inherit; cursor: pointer; text-align: start; }
.hs__sim small { font-size: 11px; line-height: 1.5; color: var(--cocoa); }
@media (min-width: 900px) {
  .hs { width: min(1240px, 94vw); height: min(90vh, 900px); margin: auto; border-radius: 4px; overflow: hidden; }
  .hs__in { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); height: 100%; min-height: 0; }
  .hs__media { height: 100%; }
  .hs__body { overflow-y: auto; padding: 30px 40px 40px; overscroll-behavior: contain; }
  .hs__cta .btn--primary { flex: 0 1 auto; }
}

/* phones: the close button stays reachable over the photo */
@media (max-width: 899px) {
  .hs__x { position: fixed; top: 12px; inset-inline-end: 12px; z-index: 4; background: rgba(250,246,241,.94); border-color: transparent; box-shadow: 0 4px 18px rgba(43,10,15,.18); }
}

/* ---------- the invitation on the hair lines' pages ---------- */
.hinv { background: var(--oxblood); color: var(--paper); overflow: hidden; }
.hinv__in { display: grid; gap: 40px; align-items: center; }
.hinv__body { display: grid; gap: 18px; justify-items: start; }
.hinv__body h2 { margin: 0; font-weight: 200; line-height: 1.25; }
.hinv__lead { margin: 0; max-width: 32em; line-height: 2.05; color: rgba(244,238,230,.76); }
.hinv__n { margin: 0; font-size: 13px; color: var(--champagne); }
.hinv__n b { font-family: var(--f-display); font-weight: 200; font-size: 38px; color: var(--gold); margin-inline-end: 6px; }
.hinv__ch { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px 14px; }
.hinv__c { display: grid; gap: 3px; color: inherit; text-decoration: none; }
.hinv__c .media { border-radius: 9999px 9999px 2px 2px; overflow: hidden; margin-bottom: 8px; box-shadow: 0 0 0 1px rgba(184,151,90,.35); }
.hinv__c .media img { filter: saturate(.8) brightness(.92); transition: filter .8s, transform 1.4s var(--ease); }
.hinv__c:hover .media img, .hinv__c.is-main .media img { filter: none; }
.hinv__c:hover .media img { transform: scale(1.04); }
.hinv__c b { font-family: var(--f-display); font-weight: 300; font-size: 19px; }
.hinv__c span { font-family: var(--f-latin); font-style: italic; font-size: 13px; color: var(--gold); }
.hinv__c small { font-size: 12px; color: rgba(244,238,230,.6); }
@media (min-width: 900px) {
  .hinv__in { grid-template-columns: minmax(0, .9fr) minmax(0, 1.4fr); gap: 6vw; }
  .hinv__ch { grid-template-columns: repeat(4, minmax(0, 1fr)); align-items: end; }
  .hinv__c:nth-child(even) { transform: translateY(-34px); }
}
/* media rendered as <span> (inside buttons and links) must be a block for its aspect ratio to hold */
span.media { display: block; }
