/* /hub วงเครือข่าย — the home tab (hh-*), feed posts (fp-*), the composer (fc-*), the photo viewer (fv-*), the photo drop
   zone (pd-*) and the event wizard (hw-*). Builds on net.css / hub.css tokens; both colour schemes; 44 px targets. */

/* ---------------------------------------------------------------- hero action (every tab) */
.hhero-side{display:flex;flex-direction:column;align-items:flex-end;gap:12px}
.hhero-rec{min-height:48px;white-space:nowrap}
@media (max-width:560px){
  .hhero-side{grid-column:1/-1;flex-direction:row;align-items:center;justify-content:space-between;flex-wrap:wrap}
  .hhero-side .hhero-stat{flex-direction:row;align-items:baseline;gap:8px}
  .hhero-rec{flex:1 1 auto}
}
.hrow-acts{display:flex;flex-wrap:wrap;gap:8px;justify-content:flex-end}
.hrow-acts [hidden]{display:none}

/* ---------------------------------------------------------------- home layout */
.hh{display:grid;grid-template-columns:minmax(0,1fr) 340px;gap:clamp(20px,3vw,36px);align-items:start}
.hh-head{margin-bottom:14px}
.hh-head p{margin:4px 0 0}
.hh-side{display:flex;flex-direction:column;gap:16px;position:sticky;top:132px}
.hh-lists{display:flex;flex-direction:column;gap:16px}
.hh-lists:empty{display:none}
/* one column: the feed first, the side lists after it; the record card is left out (the hero's button and the
   "บันทึกกิจกรรม" quick action open the same wizard) */
@media (max-width:960px){.hh{grid-template-columns:1fr}.hh-side{display:contents}.hh-rec{display:none}.hh-lists{order:1}}

.hh-compose{display:grid;grid-template-columns:auto minmax(0,1fr);gap:10px 12px;align-items:center;padding:14px 16px;margin-bottom:18px;
  border:1px solid var(--line);border-radius:var(--r-md);background:var(--paper);box-shadow:var(--shadow-1)}
.hh-prompt{font:inherit;font-size:15.5px;text-align:left;min-height:48px;padding:10px 16px;border-radius:100px;border:1px solid var(--line);
  background:var(--panel);color:var(--gray);cursor:pointer;transition:border-color .15s,background-color .15s}
.hh-prompt:hover{border-color:var(--ink-2);background:var(--paper)}
.hh-quick{grid-column:1/-1;display:flex;gap:6px;padding-top:10px;border-top:1px solid var(--line-2)}
.hh-q{flex:1 1 0;display:inline-flex;align-items:center;justify-content:center;gap:8px;min-height:44px;font:inherit;font-size:14.5px;font-weight:600;
  border:0;border-radius:10px;background:none;color:var(--ink-2);cursor:pointer}
.hh-q:hover{background:var(--panel);color:var(--ink)}
.hh-q svg{color:var(--gold)}

.hh-rec{display:grid;grid-template-columns:auto minmax(0,1fr);gap:4px 14px;padding:20px;border-radius:var(--r-md);
  border:2px dashed color-mix(in oklch,var(--marigold) 70%,var(--line));background:color-mix(in oklch,var(--marigold) 9%,var(--paper))}
.hh-rec-ico{grid-row:span 2;width:52px;height:52px;border-radius:14px;display:grid;place-items:center;background:var(--marigold);color:var(--marigold-ink)}
.hh-rec-h{margin:2px 0 0;font-size:17px;line-height:1.3}
.hh-rec p{margin:0;font-size:14px;color:var(--ink-2);text-wrap:pretty}
.hh-rec-btn{grid-column:1/-1;margin-top:12px;background:var(--paper);color:var(--ink);border:1px solid var(--ink-2);box-shadow:none}
.hh-rec-btn:hover{background:var(--paper);border-color:var(--ink)}
.hh-card{padding:16px 18px;border:1px solid var(--line);border-radius:var(--r-md);background:var(--paper)}
.hh-card-h{margin:0 0 10px;font-size:15px;line-height:1.35}
.hh-np,.hh-latest{list-style:none;margin:0 0 10px;padding:0}
.hh-np li{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:10px 0;border-bottom:1px solid var(--line-2)}
.hh-np li > div,.hh-latest li > div{display:flex;flex-direction:column;gap:2px;min-width:0}
.hh-np b,.hh-latest b{font-size:14.5px;overflow-wrap:anywhere}
.hh-latest li{display:grid;grid-template-columns:64px minmax(0,1fr);gap:12px;align-items:center;padding:8px 0}
.hh-lt-img{width:64px;height:64px;border-radius:var(--r-sm);object-fit:cover;background:var(--panel)}

/* ---------------------------------------------------------------- posts */
.fp-list{display:flex;flex-direction:column;gap:16px}
.fp{border:1px solid var(--line);border-radius:var(--r-md);background:var(--paper);overflow:hidden}
.fp-head{display:grid;grid-template-columns:auto minmax(0,1fr) auto;gap:12px;align-items:center;padding:14px 16px 8px}
.fp-who{display:flex;flex-direction:column;min-width:0}
.fp-who b{font-size:15.5px;overflow-wrap:anywhere}
.fp-meta{font-size:13px;color:var(--gray);overflow-wrap:anywhere}
.fp-tools{display:flex;gap:2px}
.fp-link{font:inherit;font-size:13.5px;font-weight:600;color:var(--gray);background:none;border:0;padding:6px 8px;border-radius:8px;cursor:pointer;min-height:36px}
.fp-link:hover{color:var(--ink);background:var(--panel)}
.fp-body{margin:0;padding:4px 16px 10px;font-size:15.5px;line-height:1.7;white-space:pre-wrap;overflow-wrap:anywhere;color:var(--ink)}
.fp-body.is-long{display:-webkit-box;-webkit-line-clamp:6;-webkit-box-orient:vertical;overflow:hidden}
.fp-morebtn{margin:-6px 0 6px 8px}
.fp-ev{display:flex;align-items:center;gap:8px;margin:0 16px 10px;padding:8px 12px;border-radius:10px;background:var(--panel);
  font-size:13.5px;font-weight:600;color:var(--ink-2)}
.fp-ev svg{flex:none;color:var(--gold)}
.fp-photos{display:grid;gap:3px;background:var(--line-2)}
.fp-photos.n1{grid-template-columns:1fr}
.fp-photos.n2{grid-template-columns:1fr 1fr}
.fp-photos.n3{grid-template-columns:2fr 1fr;grid-template-rows:1fr 1fr}
.fp-photos.n3 .fp-ph:first-child{grid-row:span 2}
.fp-photos.n4{grid-template-columns:1fr 1fr}
.fp-ph{position:relative;display:block;padding:0;border:0;background:var(--panel);cursor:zoom-in;aspect-ratio:4/3;overflow:hidden}
.fp-photos.n1 .fp-ph{aspect-ratio:auto;max-height:560px}
.fp-photos.n3 .fp-ph:first-child{aspect-ratio:auto}
.fp-ph img{width:100%;height:100%;object-fit:cover;display:block;transition:transform .4s var(--ease)}
.fp-photos.n1 .fp-ph img{max-height:560px}
.fp-ph:hover img{transform:scale(1.02)}
.fp-ph:focus-visible{outline:3px solid var(--blue);outline-offset:-3px}
.fp-more{position:absolute;inset:0;display:grid;place-items:center;background:rgba(8,12,22,.55);color:#fff;font:800 28px/1 Inter,sans-serif}
.fp-stats{display:flex;justify-content:space-between;gap:10px;padding:10px 16px 0;font-size:13.5px;color:var(--gray);min-height:20px}
.fp-acts{display:flex;gap:4px;margin:6px 10px 0;padding:4px 0;border-top:1px solid var(--line-2);border-bottom:1px solid var(--line-2)}
.fp-act{flex:1 1 0;display:inline-flex;align-items:center;justify-content:center;gap:8px;min-height:44px;font:inherit;font-size:14.5px;font-weight:600;
  border:0;border-radius:10px;background:none;color:var(--ink-2);cursor:pointer}
.fp-act:hover{background:var(--panel);color:var(--ink)}
/* the heart: an outline that fills with marigold-red when liked (state also in aria-pressed and the label) */
.fp-heart{width:18px;height:18px;flex:none;background:currentColor;
  -webkit-mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='none' stroke='%23000' stroke-width='2' stroke-linejoin='round' d='M12 20s-7.5-4.6-9.2-9.1C1.6 7.6 3.7 4.5 7 4.5c2 0 3.6 1.1 5 3 1.4-1.9 3-3 5-3 3.3 0 5.4 3.1 4.2 6.4C19.5 15.4 12 20 12 20Z'/%3E%3C/svg%3E") center/contain no-repeat;
  mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='none' stroke='%23000' stroke-width='2' stroke-linejoin='round' d='M12 20s-7.5-4.6-9.2-9.1C1.6 7.6 3.7 4.5 7 4.5c2 0 3.6 1.1 5 3 1.4-1.9 3-3 5-3 3.3 0 5.4 3.1 4.2 6.4C19.5 15.4 12 20 12 20Z'/%3E%3C/svg%3E") center/contain no-repeat}
.fp-like[aria-pressed="true"]{color:#C2410C}
:where([data-theme="dark"]) .fp-like[aria-pressed="true"]{color:#FB923C}
.fp-like[aria-pressed="true"] .fp-heart{
  -webkit-mask-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23000' d='M12 20s-7.5-4.6-9.2-9.1C1.6 7.6 3.7 4.5 7 4.5c2 0 3.6 1.1 5 3 1.4-1.9 3-3 5-3 3.3 0 5.4 3.1 4.2 6.4C19.5 15.4 12 20 12 20Z'/%3E%3C/svg%3E");
  mask-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23000' d='M12 20s-7.5-4.6-9.2-9.1C1.6 7.6 3.7 4.5 7 4.5c2 0 3.6 1.1 5 3 1.4-1.9 3-3 5-3 3.3 0 5.4 3.1 4.2 6.4C19.5 15.4 12 20 12 20Z'/%3E%3C/svg%3E");
  animation:fp-pop .35s var(--ease)}
@keyframes fp-pop{40%{transform:scale(1.3)}}
.fp-comments{padding:8px 16px 14px;display:flex;flex-direction:column;gap:8px}
.fp-all{align-self:flex-start;padding-left:0}
.fp-clist{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:10px}
.fp-c{display:grid;grid-template-columns:32px minmax(0,1fr);gap:8px;align-items:start}
.fp-cbody p{margin:0;padding:8px 12px;border-radius:14px;background:var(--panel);font-size:14.5px;line-height:1.55;overflow-wrap:anywhere}
.fp-ctext{white-space:pre-wrap}
.fp-cmeta{display:flex;align-items:center;gap:4px;padding-left:12px;font-size:12.5px;color:var(--gray)}
.fp-cmeta .fp-link{font-size:12.5px;min-height:28px;padding:2px 6px}
.fp-cform{display:grid;grid-template-columns:32px minmax(0,1fr) auto;gap:8px;align-items:center}
.fp-cin{font:inherit;font-size:16px;line-height:1.45;min-height:44px;max-height:160px;padding:10px 14px;border:1px solid var(--line);border-radius:22px;
  background:var(--panel);color:var(--ink);resize:none;field-sizing:content}
.fp-cin:focus{outline:none;border-color:var(--blue);box-shadow:0 0 0 3px var(--blue-soft);background:var(--paper)}
.fp-send{width:44px;height:44px;border-radius:50%;border:0;display:grid;place-items:center;background:var(--btn-blue);color:#fff;cursor:pointer}
.fp-send:hover{background:var(--btn-blue-hi)}
.fp-loadmore{display:flex;margin:18px auto 0}
.fp-loadmore[hidden]{display:none}
@media (max-width:560px){.fp-head,.fp-comments{padding-left:12px;padding-right:12px}.fp-body{padding-left:12px;padding-right:12px}
  .hh-compose{padding:12px}.hh-q span{font-size:14px}}

/* ---------------------------------------------------------------- composer + viewer */
dialog.nd.fc-dlg{width:min(640px,calc(100vw - 24px))}
.fc-who{display:flex;align-items:center;gap:10px}
.fc-text{font:inherit;font-size:16.5px;line-height:1.7;width:100%;box-sizing:border-box;min-height:140px;padding:12px 14px;border:1px solid var(--line);
  border-radius:var(--r-sm);background:var(--paper);color:var(--ink);resize:vertical}
.fc-text:focus{outline:none;border-color:var(--blue);box-shadow:0 0 0 3px var(--blue-soft)}
.fc-left{font-size:13px;color:var(--tone-warn);margin-top:-10px}
.fc-left:empty{display:none}
.fc-tools{display:flex;flex-wrap:wrap;gap:8px;align-items:center}
.fc-evl{display:inline-flex;align-items:center;gap:8px;flex:1 1 220px;min-width:0;padding:0 12px;min-height:44px;border:1px solid var(--line);
  border-radius:10px;color:var(--gray)}
.fc-ev{flex:1;min-width:0;font:inherit;font-size:15px;border:0;background:none;color:var(--ink);min-height:42px}
.fc-photos[hidden]{display:none}
dialog.nd.fv-dlg{width:min(1100px,calc(100vw - 16px));background:#0B0F17}
dialog.nd.fv-dlg .nd-body{padding:0}
.fv{position:relative;margin:0;display:grid;place-items:center;min-height:50vh}
.fv-img{max-width:100%;max-height:calc(100vh - 110px);object-fit:contain;display:block}
.fv figcaption{width:100%;padding:10px 16px;color:#C9D3E4;font-size:14px;text-align:center}
.fv-count{margin:0}
.fv-nav{position:absolute;top:calc(50% - 22px);width:48px;height:48px;border-radius:50%;border:0;display:grid;place-items:center;
  background:rgba(255,255,255,.88);color:#0B0F17;cursor:pointer;box-shadow:0 6px 18px rgba(0,0,0,.35)}
.fv-prev{left:12px}.fv-prev svg{transform:scaleX(-1)}
.fv-next{right:12px}

/* ---------------------------------------------------------------- photo drop zone */
.pd{display:flex;flex-direction:column;gap:12px}
.pd-zone{position:relative;display:flex;flex-direction:column;align-items:center;gap:10px;text-align:center;padding:clamp(20px,4vw,32px) 16px;
  border:2px dashed var(--line);border-radius:var(--r-md);background:var(--panel);transition:border-color .15s,background-color .15s,transform .2s var(--ease)}
.pd-zone.is-over{border-color:var(--blue);background:var(--blue-soft);transform:scale(1.01)}
.pd-zone.is-full{opacity:.6}
.pd-ico{width:56px;height:56px;border-radius:16px;display:grid;place-items:center;background:var(--paper);color:var(--gold);box-shadow:var(--shadow-1)}
.pd-lead{margin:0;font-size:16px;color:var(--ink)}
.pd-pick{min-height:48px;cursor:pointer}
.pd-pick.is-off{pointer-events:none;opacity:.5}
.pd-input{position:absolute;width:1px;height:1px;opacity:0;overflow:hidden;clip-path:inset(50%)}
label:has(+ .pd-input:focus-visible){outline:2.5px solid var(--blue);outline-offset:3px}
.pd-hint{margin:0;font-size:13px;color:var(--gray)}
/* touch screens: there is nothing to drag from, so the zone is just the big button */
@media (pointer:coarse){.pd-desk{display:none}.pd-lead:empty,.pd-lead:has(.pd-desk:only-child){display:none}}
.pd-count{margin:0;font-size:14px;font-weight:600;color:var(--ink-2);font-variant-numeric:tabular-nums}
.pd-note{margin:0;font-size:13.5px;color:var(--gray)}
.pd-note:empty{display:none}
.pd-grid{list-style:none;margin:0;padding:0;display:grid;grid-template-columns:repeat(auto-fill,minmax(96px,1fr));gap:10px}
.pd-grid[hidden]{display:none}
.pd-tile{position:relative;aspect-ratio:1;border-radius:var(--r-sm);overflow:hidden;background:var(--panel)}
.pd-new{animation:pd-in .3s var(--ease)}
@keyframes pd-in{from{opacity:0;transform:scale(.92)}}
.pd-tile img{width:100%;height:100%;object-fit:cover;display:block}
.pd-tile.is-wait img,.pd-tile.is-up img{opacity:.55}
.pd-tile.is-fail{outline:2px solid var(--tone-err);outline-offset:-2px}
.pd-cover{position:absolute;left:6px;top:6px;padding:2px 8px;border-radius:100px;font-size:11.5px;font-weight:700;background:var(--marigold);color:var(--marigold-ink)}
.pd-state{position:absolute;left:0;right:0;bottom:0;display:flex;align-items:center;justify-content:center;gap:6px;padding:5px 6px;font-size:11.5px;
  font-weight:600;color:#fff;background:linear-gradient(transparent,rgba(8,12,22,.8))}
.pd-tile.is-fail .pd-state{background:rgba(180,35,47,.92);top:auto}
.pd-spin{width:12px;height:12px;border-radius:50%;border:2px solid rgba(255,255,255,.4);border-top-color:#fff;animation:pd-spin .8s linear infinite}
@keyframes pd-spin{to{transform:rotate(360deg)}}
.pd-retry{position:absolute;left:50%;top:50%;transform:translate(-50%,-60%);white-space:nowrap;font:inherit;font-size:13px;font-weight:700;min-height:36px;padding:0 12px;
  border-radius:100px;border:0;background:var(--paper);color:var(--ink);cursor:pointer;box-shadow:var(--shadow-1)}
.pd-x{position:absolute;right:4px;top:4px;width:32px;height:32px;border-radius:50%;border:0;display:grid;place-items:center;
  background:rgba(8,12,22,.66);color:#fff;cursor:pointer}
.pd-x::before{content:"";position:absolute;inset:-6px}
.pd-x:disabled{opacity:.4;cursor:default}

/* ---------------------------------------------------------------- event wizard */
dialog.nd.hw-dlg{width:min(720px,calc(100vw - 16px))}
.hw{--gw-accent:var(--btn-blue)}
.hw-title{padding-right:56px;margin:0 0 4px}
.hw-praise:empty{display:none}
.hw-form{display:flex;flex-direction:column;gap:16px;margin-top:8px}
.hw-steps .gw-step{display:flex;flex-direction:column;gap:16px}
.hw-hint{margin:0;font-size:14.5px;color:var(--ink-2);text-wrap:pretty}
.hw .btn-primary,.hw .btn-ghost,.hw .btn-danger{min-height:44px}
.hw-strip{list-style:none;margin:0;padding:0;display:flex;flex-wrap:wrap;gap:8px}
.hw-strip img,.hw-more{width:72px;height:72px;border-radius:var(--r-sm);object-fit:cover;display:grid;place-items:center}
.hw-more{background:var(--panel);font-weight:700;color:var(--ink-2)}
.hw-review{margin:0;display:grid;grid-template-columns:130px minmax(0,1fr);border-top:1px solid var(--line-2)}
.hw-review dt,.hw-review dd{padding:10px 0;border-bottom:1px solid var(--line-2)}
.hw-review dt{font-size:14px;color:var(--gray)}
.hw-review dd{margin:0;display:flex;justify-content:space-between;gap:10px;color:var(--ink);overflow-wrap:anywhere}
.hw-edit{flex:none;font-size:13px;background:none;border:0;padding:0 2px;cursor:pointer;color:var(--blue)}
@media (max-width:480px){.hw-review{grid-template-columns:1fr}.hw-review dt{padding-bottom:0;border-bottom:0}}
.hw-actions [hidden]{display:none}
/* the step's buttons stay in reach while a long step (many photos) scrolls under them */
.hw-actions{position:sticky;bottom:-28px;z-index:1;margin-bottom:-28px;padding:12px 0 28px;background:var(--paper)}
@media (max-width:480px){.pd-grid{grid-template-columns:repeat(3,minmax(0,1fr));gap:8px}}

@media (prefers-reduced-motion:reduce){
  .pd-new,.fp-like[aria-pressed="true"] .fp-heart{animation:none}
  .pd-zone.is-over{transform:none}.fp-ph:hover img{transform:none}
  .pd-spin{animation-duration:2.4s}
}
