/* เมนู "เครือข่าย": network-international.php (แผนที่โลก) และ network-community.php (แผนที่ประเทศไทย)
   โหลดเฉพาะสองหน้านี้ ต่อจาก main.css และก่อน theme.css (includes/header.php) ไม่ใช้ !important
   แผนที่เป็นฉากเต็มความกว้างจอสีม่วงเข้มของธีม พื้นที่ที่มีข้อมูลยิ่งมีรายการมากยิ่งสว่าง (ระดับ 1–4)
   สีส้มของธีม (--accent-warm) ใช้กับสิ่งที่ชี้ไปยัง ม.เกษตรศาสตร์ บางเขน: จุดเริ่มต้น เส้นเครือข่าย และพื้นที่ที่เลือก
   --u (ตั้งโดย network-map.js) = หน่วยแผนที่ต่อ 1px บนจอ ใช้ให้ตัวหนังสือและเส้นบางส่วนคงขนาดเมื่อซูม */
.netmap{
  scroll-margin-top:calc(var(--header-h) + 8px);
  --night:var(--purple-900);
  --sea:#34163f;
  --land:#4b2a5a;
  --border:#2b0f35;
  --context:#3c1d49;
  --l1:#9b62b6;
  --l2:var(--purple-300);
  --l3:var(--purple-200);
  --l4:#f1dcfb;
  --lantern:var(--accent-warm);
  --u:1;
  position:relative;
  background:var(--night);
  color:#fff;
}
.netmap{overflow-x:clip} /* the closed detail panel waits off to the right of the stage; it must not widen the page */
.netmap__stage{position:relative}

/* ---- The map ---- */
.netmap__canvas{position:relative;overflow:hidden}
.netmap__svg{display:block;width:100%;height:auto}
.netmap.is-ready .netmap__canvas{height:clamp(460px,82svh,920px)}
.netmap.is-ready .netmap__svg{height:100%}
/* before the script has run (or without it) the map still has to fit the screen, never run to full width at its own height */
.netmap:not(.is-ready) .netmap__svg{width:auto;max-width:100%;max-height:82svh;margin-inline:auto}
.netmap__svg path{fill:var(--land);stroke:var(--border);stroke-width:.6px;vector-effect:non-scaling-stroke;transition:fill .7s ease,opacity .3s ease}
.netmap__svg .netmap__sphere{fill:var(--sea);stroke:rgba(224,201,236,.18);stroke-width:1px}
.netmap__svg .netmap__grid{fill:none;stroke:rgba(224,201,236,.08);stroke-width:.6px;pointer-events:none}
.netmap__svg .netmap__context path{fill:var(--context);stroke:var(--border);pointer-events:none}
.netmap__label{fill:rgba(224,201,236,.55);font-family:var(--font-thai);font-size:calc(var(--u) * 13px);text-anchor:middle;pointer-events:none}
.netmap--thailand{--land:#5b356b;--context:#3a1b46}
.netmap--thailand .netmap__canvas{background:var(--night)}

.netmap__svg path.is-active{cursor:pointer}
.netmap__svg .is-l1{fill:var(--l1)}
.netmap__svg .is-l2{fill:var(--l2)}
.netmap__svg .is-l3{fill:var(--l3)}
.netmap__svg .is-l4{fill:var(--l4)}
.netmap__svg path.is-active.is-pending,.netmap__svg .netmap__marker.is-pending{fill:var(--land)}
.netmap__svg path.is-active.is-hot{fill:var(--lantern)}
.netmap__svg path.is-dimmed{opacity:.35}
.netmap__svg path.is-dimmed.is-active{pointer-events:none}
.netmap__svg [tabindex]:focus,.netmap__svg [tabindex]:focus-visible{outline:none}

/* Arcs from Bangkhen (world) */
.netmap__svg .netmap__arc{fill:none;stroke:var(--lantern);stroke-linecap:round;opacity:.6;pointer-events:none;transition:opacity .25s ease}
.netmap__arc.is-pending,.netmap__arc-end.is-pending{opacity:0}
.netmap.has-hot .netmap__arc,.netmap.has-selection .netmap__arc{opacity:.14}
.netmap .netmap__arc.is-hot,.netmap .netmap__arc.is-selected{opacity:1;stroke-width:calc(var(--u) * 2.6)}
.netmap__arc-end{fill:var(--lantern);pointer-events:none;transform-box:fill-box;transform-origin:center}
.netmap .netmap__arc.is-dimmed,.netmap .netmap__arc-end.is-dimmed{opacity:.06}
/* Rings for countries too small to point at (Singapore, Hong Kong…) */
.netmap__marker{stroke:var(--night);cursor:pointer;transition:fill .7s ease}
.netmap__marker.is-dimmed{opacity:.3;pointer-events:none}
/* Bubbles: number of projects in a province (Thailand) */
.netmap__bubble{pointer-events:none;transform-box:fill-box;transform-origin:center;transition:opacity .3s ease}
.netmap__bubble circle{fill:var(--lantern);stroke:var(--night)}
.netmap__bubble text{fill:var(--night);font-family:var(--font-ui);font-size:calc(var(--u) * 12px);font-weight:700;text-anchor:middle;dominant-baseline:central}
.netmap__bubble.is-pending{opacity:0}
.netmap__bubble.is-dimmed{opacity:.2}
/* Kasetsart University, Bangkhen */
.netmap__origin{pointer-events:none}
.netmap__origin-dot{fill:var(--lantern);stroke:#fff}
.netmap__origin-halo{fill:var(--lantern);opacity:.22}
/* Selection and keyboard focus are copies drawn on top, so neighbouring shapes cannot hide them.
   A chosen area is filled in the lantern colour with a hairline edge; the others step back. Only keyboard focus gets a ring. */
.netmap__svg .netmap__selected{fill:var(--lantern);stroke:#ffe6c4;stroke-width:1px;stroke-linejoin:round;pointer-events:none}
.netmap__svg .netmap__focusring{fill:none;stroke:#fff;stroke-width:2px;stroke-linejoin:round;vector-effect:non-scaling-stroke;pointer-events:none}
.netmap__svg .netmap__marker.is-selected{fill:var(--lantern)}
.netmap.has-selection .netmap__svg path.is-active:not(.is-selected),.netmap.has-selection .netmap__marker:not(.is-selected){opacity:.55}
.netmap.has-selection .netmap__svg path.is-dimmed{opacity:.35}
.netmap.is-ready .netmap__canvas{touch-action:pan-y}
.netmap .netmap__canvas.is-zoomed{cursor:grab;touch-action:none}
.netmap .netmap__canvas.is-dragging{cursor:grabbing}
.netmap__canvas.is-dragging .netmap__svg path{pointer-events:none}

/* ---- Things that float over the map ---- */
.netmap__hud{position:absolute;z-index:4;top:clamp(18px,2.4vw,32px);left:var(--gutter);max-width:min(560px,calc(100% - 2 * var(--gutter) - 80px));pointer-events:none}
.netmap__stats{display:flex;margin:0}
.netmap__stat{display:flex;flex-direction:column-reverse;gap:8px;padding-right:clamp(18px,2.2vw,32px)}
.netmap__stat+.netmap__stat{padding-left:clamp(18px,2.2vw,32px);border-left:1px solid rgba(224,201,236,.28)}
.netmap__stat dt,.netmap__num{text-shadow:0 0 5px var(--night),0 0 2px var(--night)}
.netmap__stat dt{margin:0;color:var(--purple-200);font-family:var(--font-thai);font-size:var(--fs-xs);line-height:1.4}
.netmap__num{margin:0;color:#fff;font-family:var(--font-ui);font-size:clamp(36px,4.2vw,60px);font-weight:500;font-variant-numeric:tabular-nums;letter-spacing:-.02em;line-height:1}
/* Regions: on wide screens they are labels on the map itself (.netmap__tag); the row of buttons is for phones */
.netmap__dock{display:contents}
.netmap__regions{display:none}
.netmap__chip{position:relative;display:flex;align-items:baseline;gap:8px;flex:0 0 auto;min-height:40px;padding:6px 12px;border:0;background:none;color:var(--purple-200);font-family:var(--font-thai);font-size:var(--fs-sm);line-height:1.4;white-space:nowrap;cursor:pointer;transition:color .2s ease}
.netmap__chip::before{content:"";position:absolute;left:12px;bottom:0;width:calc(100% - 24px);height:2px;background:var(--lantern);transform:scaleX(0);transform-origin:left;transition:transform .3s cubic-bezier(.2,.8,.2,1)}
.netmap__chip:hover,.netmap .netmap__chip.is-on{color:#fff}
.netmap__chip.is-on::before{transform:scaleX(1)}
.netmap__chip-n{color:rgba(224,201,236,.7);font-family:var(--font-ui);font-size:var(--fs-xs);font-variant-numeric:tabular-nums}
.netmap__chip.is-on .netmap__chip-n{color:#fff}
.netmap__ind{display:none}
.netmap__chip:focus-visible,.netmap__btn:focus-visible,.netmap__tag:focus-visible{outline:2px solid #fff;outline-offset:2px}
@media(min-width:901px){
  .netmap__tags{position:absolute;inset:0;z-index:3;pointer-events:none;opacity:0;transition:opacity .6s ease .1s}
  .netmap__tags.is-laid{opacity:1}
  .netmap.has-selection .netmap__tags{opacity:0}
  .netmap.has-selection .netmap__tag{pointer-events:none}
  .netmap__tag{position:absolute;left:0;top:0;display:flex;align-items:baseline;gap:6px;padding:4px 6px;border:0;background:none;color:rgba(255,255,255,.88);font-family:var(--font-thai);font-size:var(--fs-sm);line-height:1.3;white-space:nowrap;text-shadow:0 0 8px var(--night),0 0 3px var(--night),0 0 1px var(--night);transform:translate(calc(var(--x,0px) - 50%),calc(var(--y,0px) - 50%));pointer-events:auto;cursor:pointer;transition:color .2s ease,opacity .3s ease}
  .netmap__tag b{color:var(--lantern);font-family:var(--font-ui);font-size:var(--fs-xs);font-weight:600;font-variant-numeric:tabular-nums}
  .netmap__tag:hover{color:#fff}
  .netmap__tag.is-on{color:#fff;font-weight:700;text-decoration:underline;text-decoration-color:var(--lantern);text-decoration-thickness:2px;text-underline-offset:5px}
  .netmap.has-region .netmap__tag:not(.is-on){opacity:.55}
  .netmap__tag.is-away{opacity:0;pointer-events:none}
}
@media(max-width:900px){.netmap__tags{display:none}}
.netmap__hint{position:absolute;z-index:3;right:var(--gutter);bottom:clamp(16px,2vw,28px);display:flex;align-items:center;gap:8px;margin:0;color:rgba(224,201,236,.82);font-size:var(--fs-xs);pointer-events:none;transition:opacity .7s ease}
.netmap.has-opened .netmap__hint{opacity:0}
.netmap__hint-touch,.netmap__hint-icon--touch{display:none}
@media(hover:none),(pointer:coarse){
  .netmap__hint-mouse,.netmap__hint-icon--mouse{display:none}
  .netmap__hint-touch{display:inline}
  .netmap__hint-icon--touch{display:block}
}

.netmap__zoom{position:absolute;z-index:4;top:clamp(18px,2.4vw,32px);right:var(--gutter);display:flex;flex-direction:column;gap:6px;transition:right .45s cubic-bezier(.2,.8,.2,1)}
.netmap.has-selection .netmap__zoom{right:calc(clamp(14px,1.6vw,22px) + min(420px,38vw) + 16px)}
.netmap__btn{display:grid;place-items:center;min-width:42px;min-height:42px;padding:0 12px;border:1px solid rgba(224,201,236,.38);border-radius:10px;background:rgba(43,15,53,.78);color:#fff;font-family:var(--font-ui);font-size:22px;line-height:1;cursor:pointer}
.netmap__btn--text{font-family:var(--font-thai);font-size:var(--fs-xs)}
.netmap__btn:hover{border-color:var(--purple-200);background:var(--purple-800)}

.netmap__legend{display:grid;gap:4px;margin:16px 0 0;padding:0;list-style:none;color:rgba(224,201,236,.85);font-size:var(--fs-xs);line-height:1.5;text-shadow:0 0 6px var(--night),0 0 2px var(--night)}
.netmap__legend li{display:flex;align-items:center;gap:8px}
.netmap__origin-key{flex:none;width:12px;height:12px;border:2px solid #fff;border-radius:50%;background:var(--lantern)}

.netmap__tip{position:absolute;z-index:6;display:grid;gap:2px;min-width:150px;max-width:260px;padding:10px 14px;transform:translate(-50%,calc(-100% - 14px));border-radius:10px;background:#fff;color:var(--ink);box-shadow:0 10px 30px rgba(20,4,28,.45);font-family:var(--font-thai);font-size:var(--fs-xs);line-height:1.55;pointer-events:none}
.netmap__tip[hidden]{display:none}
.netmap__tip.is-below{transform:translate(-50%,18px)}
.netmap__tip strong{color:var(--purple-900);font-size:var(--fs-sm)}
.netmap__tip-count{color:var(--purple-600);font-weight:600}
.netmap__tip-list{color:var(--ink-muted);white-space:pre-line}
.netmap__tip-list:empty{display:none}

/* Detail panel: slides in over the right side of the map */
.netmap__panel{position:absolute;z-index:5;top:clamp(14px,1.6vw,22px);right:clamp(14px,1.6vw,22px);bottom:clamp(14px,1.6vw,22px);width:min(420px,38vw);overflow:auto;padding:26px 24px 28px;border-radius:16px;background:#fff;color:var(--ink);box-shadow:0 24px 60px rgba(20,4,28,.5);visibility:hidden;transform:translateX(calc(100% + 40px));transition:transform .45s cubic-bezier(.2,.8,.2,1),visibility .45s}
.netmap__panel.is-open{visibility:visible;transform:none}
.netmap:not(.is-ready) .netmap__panel{display:none}
.netmap__panel:focus{outline:none}
.netmap__panel:focus-visible{box-shadow:0 0 0 3px var(--lantern),0 24px 60px rgba(20,4,28,.5)}
.netmap__close{position:absolute;top:12px;right:12px;display:grid;place-items:center;width:40px;height:40px;padding:0;border:0;border-radius:50%;background:var(--purple-100);color:var(--purple-900);font-size:26px;line-height:1;cursor:pointer}
.netmap__close:hover{background:var(--purple-200)}
.netmap__close:focus-visible{outline:3px solid var(--purple-700);outline-offset:2px}
.netmap__panel .netarea{padding:0;border:0;background:none}
.netmap__panel .netarea__title{display:block;margin:0 52px 16px 0;color:var(--purple-900);font-size:clamp(24px,2.2vw,32px);line-height:1.25}
.netmap__panel .netarea__count{display:block;margin-top:6px;color:var(--purple-600);font-size:var(--fs-sm);font-weight:600}

.netmap__empty{position:absolute;z-index:3;left:50%;top:50%;width:min(480px,calc(100% - 2 * var(--gutter)));padding:22px 26px;transform:translate(-50%,-50%);border:1px solid rgba(224,201,236,.3);border-radius:14px;background:rgba(43,15,53,.88);text-align:center}
.netmap__empty p{margin:0;color:var(--purple-200);font-size:var(--fs-sm);text-wrap:balance}
.netmap__empty .netmap__empty-title{margin-bottom:6px;color:#fff;font-size:var(--fs-lg);font-weight:600}

/* Phones and narrow windows: counts and region buttons above the map, zoom buttons in a row, legend below,
   and the panel becomes a sheet that slides up from the bottom */
@media(max-width:900px){
  .netmap__stage{display:flex;flex-direction:column}
  .netmap .netmap__hud{position:static;order:1;max-width:none;padding:22px var(--gutter) 10px}
  .netmap .netmap__legend{text-shadow:none}
  .netmap .netmap__regions:not([hidden]){order:2;display:flex;gap:4px;margin:0;padding:0 calc(var(--gutter) - 12px);overflow-x:auto;scrollbar-width:none}
  .netmap .netmap__zoom,.netmap.has-selection .netmap__zoom{position:static;order:3;flex-direction:row;justify-content:flex-end;padding:8px var(--gutter) 10px}
  .netmap__canvas{order:4}
  .netmap.is-ready .netmap__canvas{height:clamp(380px,70svh,680px)}
  .netmap--world.is-ready .netmap__canvas{height:clamp(320px,58svh,540px)}
  .netmap .netmap__hint{position:static;order:6;padding:4px var(--gutter) 20px}
  .netmap .netmap__panel{position:fixed;z-index:60;inset:auto 0 0 0;width:auto;max-height:76vh;padding-bottom:calc(28px + env(safe-area-inset-bottom));border-radius:18px 18px 0 0;transform:translateY(105%);box-shadow:0 -16px 40px rgba(20,4,28,.35)}
  .netmap .netmap__panel.is-open{transform:none}
}
@media(prefers-reduced-motion:reduce){
  .netmap__panel,.netmap__chip,.netmap__zoom,.netmap__svg path,.netmap__arc,.netmap__marker,.netmap__bubble{transition:none}
}

/* ---- Text list under the map (works without JavaScript) ---- */
.netlist{padding-block:clamp(40px,5vw,72px) clamp(48px,6vw,88px)}
.netlist--world{padding-bottom:clamp(20px,2.4vw,32px)}
.netlist h2{margin:0 0 clamp(18px,2vw,28px)}
.netlist__grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(min(100%,340px),1fr));gap:clamp(14px,1.6vw,22px)}
.netarea{padding:20px 22px;border:1px solid var(--line);border-radius:var(--radius-sm);background:var(--surface-raised)}
.netarea__title{display:flex;flex-wrap:wrap;align-items:baseline;gap:4px 12px;margin:0 0 12px;font-size:var(--fs-h3)}
.netarea__count{color:var(--ink-muted);font-size:var(--fs-xs);font-weight:400}
.netarea__items{display:grid;gap:16px;margin:0;padding:0;list-style:none}
.netitem{padding-top:0;border-top:0}
.netarea__items>.netitem:not([hidden])~.netitem:not([hidden]){padding-top:14px;border-top:1px solid var(--line)}
.netitem__img{width:100%;height:auto;margin-bottom:10px;border-radius:var(--radius-sm)}
.netitem__title{margin:0;font-family:var(--font-thai);font-size:var(--fs-base);font-weight:600;line-height:1.5}
.netitem__sub,.netitem__year{margin:2px 0 0;font-size:var(--fs-xs)}
.netitem__year{color:var(--purple-600)}
.netitem__text{margin:8px 0 0;font-size:var(--fs-sm);line-height:1.75}
.netitem__related{display:flex;flex-wrap:wrap;gap:6px;margin:10px 0 0;padding:0;list-style:none}
.netitem__related a{display:inline-block;padding:4px 12px;border:1px solid var(--purple-200);border-radius:var(--radius-pill);background:var(--purple-50);color:var(--purple-800);font-size:var(--fs-xs);line-height:1.6;text-decoration:none}
.netitem__related a:hover{border-color:var(--purple-600);background:var(--purple-100)}
.netitem__kind{color:var(--ink-muted)}

/* ---- Institution entry (world map): tags, one-line summary, people, up to three points.
   Same markup in the detail panel and in the list under the map. English names are set in the UI face so they read
   apart from the Thai text around them. ---- */
.netlist--world .netitem__title,.netmap__panel .netitem__title{font-family:var(--font-ui);font-size:clamp(1.0625rem,1rem + .35vw,1.25rem);font-weight:600;line-height:1.35;letter-spacing:-.005em;color:var(--purple-900)}
.netitem__site{display:inline;color:inherit;text-decoration:none}
.netitem__site svg{display:inline-block;width:.8em;height:.8em;margin-left:2px;color:var(--purple-500);vertical-align:.05em}
.netitem__site:hover{color:var(--purple-700);text-decoration:underline;text-decoration-thickness:1px;text-underline-offset:4px}
.netitem__summary{max-width:62ch;margin:6px 0 0;color:var(--ink);font-size:var(--fs-base);line-height:1.75}
.netitem__people{margin:4px 0 0;color:var(--ink-muted);font-size:var(--fs-xs);line-height:1.6}
.netitem__points{max-width:62ch;margin:8px 0 0;padding-left:1.1em;color:var(--ink-muted);font-size:var(--fs-sm);line-height:1.7}
.netitem__points li+li{margin-top:2px}

/* ---- The deck under the world map: the ประชาสัมพันธ์ slider of the home page, with institution cards.
   The row runs the full width of the window. One card sits in the middle, its neighbours are dimmed and run out to both
   edges; the round buttons sit over the edges of the middle card (see .stage in theme.css). The picture on the left of
   each card comes from network_partners.image_id; without one that part is plain night purple. ---- */
.netlist__top{display:flex;flex-wrap:wrap;align-items:end;justify-content:space-between;gap:16px 32px;margin-bottom:clamp(22px,2.6vw,34px)}
.netlist--world .netlist__top h2{margin:0}
.netlist--world .netfilter{margin:0}
.netdeck{--slide:min(76cqw,1040px);--deck-gap:clamp(12px,1.4vw,24px);position:relative;container-type:inline-size}
.netdeck__viewport{position:relative}
.netdeck__track{position:relative;display:flex;align-items:stretch;gap:var(--deck-gap);margin:0;padding:0 calc((100cqw - var(--slide)) / 2);overflow-x:auto;overscroll-behavior-x:contain;scroll-snap-type:x mandatory;list-style:none;scrollbar-width:thin;scrollbar-color:var(--purple-300) transparent}
.netdeck.is-ready .netdeck__track{scrollbar-width:none}
.netdeck.is-ready .netdeck__track::-webkit-scrollbar{display:none}
.netdeck__card{position:relative;display:grid;flex:none;grid-template-columns:minmax(0,5fr) minmax(0,7fr);width:var(--slide);min-height:clamp(300px,30cqw,400px);overflow:hidden;border-radius:14px;background:#fff;scroll-snap-align:center;scroll-snap-stop:always}
.netdeck__card[hidden]{display:none}
.netdeck.is-ready .netdeck__card{opacity:.4;cursor:pointer;transition:opacity .35s ease}
.netdeck.is-ready .netdeck__card.is-active{opacity:1;cursor:auto}
.netdeck__media{position:relative;min-height:100%;background:var(--purple-900)}
.netdeck__media img{position:absolute;inset:0;width:100%;height:100%;object-fit:cover}
.netdeck__body{display:flex;flex-direction:column;min-width:0;padding:clamp(24px,3.2cqw,48px) clamp(24px,3.6cqw,56px) clamp(22px,2.6cqw,36px)}
.netdeck__where{display:flex;flex-wrap:wrap;align-items:baseline;justify-content:space-between;gap:4px 16px;margin:0 0 clamp(14px,1.6cqw,22px);color:var(--ink-muted);font-family:var(--font-thai);font-size:var(--fs-sm)}
.netdeck__where>span{color:var(--purple-700);font-weight:600}
.netdeck__acts{color:var(--ink-muted);font-family:var(--font-ui);font-size:var(--fs-xs);font-variant-numeric:tabular-nums}
/* The institution's name opens its page; on a card the link covers the whole card. */
.netitem__page{color:inherit;text-decoration:none;background:linear-gradient(currentColor,currentColor) 0 100% / 0 2px no-repeat;padding-bottom:4px;transition:background-size .3s ease,color .2s ease}
.netitem__page:hover,.netitem__page:focus-visible,.netdeck__card.is-active:hover .netitem__page{color:var(--purple-700);text-decoration:none;background-size:100% 2px}
.netdeck__card .netitem__page::after{content:"";position:absolute;inset:0;z-index:1}
.netdeck.is-ready .netdeck__card.is-active{cursor:pointer}
.netdeck__body>.netitem{display:flex;flex:1 1 auto;flex-direction:column}
.netdeck__card .netitem__title{font-family:var(--font-ui);font-size:clamp(1.375rem,1.1rem + 1.1cqw,2rem);font-weight:600;line-height:1.2;letter-spacing:-.012em;color:var(--purple-900)}
.netdeck__card .netitem__summary{margin-top:14px;font-size:var(--fs-lg);line-height:1.7}
.netdeck__card .netitem__people{margin-top:8px;font-size:var(--fs-sm)}
.netdeck__card .netitem__summary~.netitem__points{display:none}
.netdeck__card .netitem__related{order:8}
.netdeck__card .netitem__tags{order:9;margin:auto 0 0;padding-top:clamp(18px,2cqw,26px)}
/* Buttons over the left and right edge of the middle card, half way down. */
.netdeck__ctrls{position:absolute;inset:0;z-index:2;display:flex;align-items:center;justify-content:space-between;padding:0 calc((100cqw - var(--slide)) / 2 - 22px);pointer-events:none}
.netdeck__ctrls[hidden]{display:none}
.netdeck__ctrl:disabled{opacity:0;pointer-events:none}
.netdeck__count{margin:14px 0 0;padding:0 calc((100cqw - var(--slide)) / 2);color:var(--ink-muted);font-family:var(--font-ui);font-size:var(--fs-sm);font-variant-numeric:tabular-nums}
.netdeck__count[hidden]{display:none}
@media(max-width:640px){
  .netdeck{--slide:87cqw}
  .netlist__top{display:block}
  .netlist--world .netlist__top h2{margin-bottom:16px}
  .netlist--world .netfilter{margin:0 calc(-1 * var(--gutter))}
  .netdeck__card{grid-template-columns:1fr;grid-template-rows:auto 1fr;min-height:0}
  .netdeck__media{min-height:0;aspect-ratio:16/9}
  .netdeck__media.is-empty{aspect-ratio:auto;height:10px}
  .netdeck__body{padding:20px 20px 22px}
  /* On a phone the buttons move under the card, right-aligned with it, as on the home page. */
  .netdeck__ctrls{position:static;justify-content:flex-end;gap:10px;margin-top:12px;padding:0 calc((100cqw - var(--slide)) / 2)}
  .netdeck__ctrl:disabled{opacity:.35}
  .netdeck__count{position:absolute;bottom:14px;margin:0}
}
@media(prefers-reduced-motion:reduce){.netdeck.is-ready .netdeck__card{transition:none}}

/* Tags: small diamond markers instead of pills, so a card with three reads as a short list, not a row of buttons. */
.netitem__tags{display:flex;flex-wrap:wrap;gap:6px 20px;margin:0 0 12px;padding:0;list-style:none}
.netitem__tags li{display:flex;align-items:center;gap:9px;padding:0;background:none;color:var(--purple-800);font-size:var(--fs-xs);font-weight:500;line-height:1.6}
.netitem__tags li::before{content:"";flex:none;width:7px;height:7px;border-radius:1px;background:var(--purple-500);transform:rotate(45deg)}

/* ---- Filter by tag above the list (shown by network-map.js) ---- */
.netfilter{display:flex;flex-wrap:wrap;gap:6px;margin:0 0 clamp(20px,2.4vw,32px)}
.netfilter[hidden]{display:none}
.netfilter__chip{flex:none;min-height:40px;padding:6px 15px;border:1px solid var(--purple-200);border-radius:var(--radius-pill);background:transparent;color:var(--purple-900);font-family:var(--font-thai);font-size:var(--fs-sm);line-height:1.4;cursor:pointer}
.netfilter__chip:hover{border-color:var(--purple-500)}
.netfilter__chip[aria-pressed="true"]{border-color:var(--purple-800);background:var(--purple-800);color:#fff}
.netfilter__n{margin-left:2px;color:var(--purple-600);font-family:var(--font-ui);font-variant-numeric:tabular-nums}
.netfilter__chip[aria-pressed="true"] .netfilter__n{color:var(--purple-200)}
@media(max-width:760px){
  .netfilter{flex-wrap:nowrap;margin-inline:calc(-1 * var(--gutter));padding-inline:var(--gutter);overflow-x:auto;scrollbar-width:none}
  .netfilter::-webkit-scrollbar{display:none}
}
.netarea[hidden],.netitem[hidden]{display:none}
.netmap__svg path.is-tag-dim,.netmap__marker.is-tag-dim{opacity:.35}
.netmap .netmap__arc.is-tag-dim,.netmap .netmap__arc-end.is-tag-dim{opacity:.06}

/* ---- Detail panel on the world map: one institution at a time, arrows pinned to the bottom of the panel ---- */
.netmap--world .netmap__panel{display:flex;flex-direction:column}
.netmap--world .netmap__detail{display:flex;flex:1 0 auto;flex-direction:column}
.netmap__panel .netarea{display:flex;flex:1 0 auto;flex-direction:column}
.netmap__panel .netarea__head{margin:0 52px 20px 0}
.netmap__panel .netarea__head .netarea__title{margin:0}
.netcar{display:grid;flex:1 0 auto;grid-template-rows:1fr auto}
.netcar__track{display:grid;align-content:start;margin:0;padding:0;list-style:none;touch-action:pan-y}
.netcar__slide{grid-area:1/1;padding:0!important;border:0!important;visibility:hidden;opacity:0;transition:opacity .18s ease,visibility 0s .18s}
.netcar__slide.is-current{visibility:visible;opacity:1;transition:opacity .18s ease}
.netcar.is-fwd .netcar__slide.is-current{animation:netcar-in-fwd .18s ease}
.netcar.is-back .netcar__slide.is-current{animation:netcar-in-back .18s ease}
@keyframes netcar-in-fwd{from{transform:translateX(16px)}}
@keyframes netcar-in-back{from{transform:translateX(-16px)}}
.netcar__nav{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-top:24px;padding-top:16px;border-top:1px solid var(--line)}
.netcar__btn{display:grid;place-items:center;width:44px;height:44px;padding:0;border:1px solid var(--purple-200);border-radius:50%;background:#fff;color:var(--purple-800);cursor:pointer}
.netcar__btn:hover:not(:disabled){border-color:var(--purple-700);background:var(--purple-800);color:#fff}
.netcar__btn:disabled{border-color:var(--line);color:var(--purple-300);cursor:default}
.netcar__icon{width:20px;height:20px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.netcar__count{color:var(--ink-muted);font-family:var(--font-ui);font-size:var(--fs-sm);font-variant-numeric:tabular-nums}
@media(prefers-reduced-motion:reduce){
  .netcar__slide,.netcar__slide.is-current{transition:none}
  .netcar.is-fwd .netcar__slide.is-current,.netcar.is-back .netcar__slide.is-current{animation:none}
}

/* ---- Photo strip under the deck (network-international.php): activity photos that keep moving sideways.
   Without JavaScript or with reduced motion each row is a strip that scrolls by hand. Photos keep their own
   proportions at one height; the edges of the window fade so photos slide in and out rather than being cut. ---- */
.netphotos{padding-block:0 clamp(32px,4vw,56px)}
.netphotos__rows{display:grid;gap:clamp(10px,1.2vw,16px)}
.netphotos__row{overflow-x:auto;scrollbar-width:thin;scrollbar-color:var(--purple-300) transparent}
.netphotos__strip{display:flex;width:max-content;margin:0;padding:0 var(--gutter);list-style:none}
.netphotos__strip li{flex:none;margin-right:clamp(10px,1.2vw,16px)}
.netphotos__strip img{display:block;width:auto;height:clamp(200px,24vw,340px);max-width:none;border-radius:12px;background:var(--purple-100);object-fit:cover}
.netphotos.is-moving .netphotos__row{overflow:hidden;-webkit-mask-image:linear-gradient(90deg,transparent,#000 5%,#000 95%,transparent);mask-image:linear-gradient(90deg,transparent,#000 5%,#000 95%,transparent)}
.netphotos.is-moving .netphotos__strip{padding:0;animation:netphotos-slide var(--netphotos-time,60s) linear infinite}
.netphotos.is-moving .netphotos__row[data-dir="right"] .netphotos__strip{animation-direction:reverse}
@keyframes netphotos-slide{to{transform:translateX(-50%)}}
@media(prefers-reduced-motion:reduce){.netphotos .netphotos__strip{animation:none}}

/* ---- Photo strip: each photo is a button that opens the large view; the event shows on the photo on hover or focus.
   A row stops while the pointer is on it or one of its photos has focus, so the text can be read and the photo hit. ---- */
.netphotos__item{position:relative;display:block;padding:0;border:0;border-radius:12px;background:none;cursor:zoom-in;overflow:hidden}
.netphotos__item img{border-radius:0}
.netphotos__item:focus-visible{outline:3px solid var(--purple-500);outline-offset:-3px}
.netphotos__cap{position:absolute;inset:auto 0 0;display:flex;flex-direction:column;gap:2px;padding:36px 14px 12px;background:linear-gradient(transparent,rgba(26,8,33,.86));color:#fff;text-align:left;opacity:0;transition:opacity .2s ease;pointer-events:none}
.netphotos__inst{color:var(--purple-200);font-family:var(--font-ui);font-size:var(--fs-xs);font-weight:600;line-height:1.4}
.netphotos__title{font-family:var(--font-thai);font-size:var(--fs-sm);font-weight:500;line-height:1.45}
.netphotos__item:hover .netphotos__cap,.netphotos__item:focus-visible .netphotos__cap{opacity:1}
.netphotos.is-moving .netphotos__row:hover .netphotos__strip,.netphotos.is-moving .netphotos__row:focus-within .netphotos__strip{animation-play-state:paused}
@media(hover:none){.netphotos__cap{opacity:1;padding-top:28px}.netphotos__title{display:none}}

/* ---- Link from an institution card to its page ---- */

/* ---- network-partner.php: one institution and its activities ---- */
.netpartner{padding-block:clamp(28px,3.4vw,48px) clamp(56px,7vw,96px)}
.netpartner .back-link{margin-bottom:clamp(18px,2.2vw,28px)}
.netpartner__head{display:grid;grid-template-columns:minmax(0,5fr) minmax(0,7fr);gap:clamp(24px,4vw,56px);align-items:start;margin-bottom:clamp(40px,5vw,72px)}
.netpartner__media{position:relative;aspect-ratio:4/3;overflow:hidden;border-radius:18px;background:var(--purple-900)}
.netpartner__media img{position:absolute;inset:0;width:100%;height:100%;object-fit:cover}
.netpartner__where{margin:0 0 8px;color:var(--purple-700);font-size:var(--fs-sm);font-weight:600}
.netpartner__intro h1{margin:0;font-family:var(--font-ui);font-size:clamp(1.875rem,1.4rem + 2vw,3rem);font-weight:600;line-height:1.15;letter-spacing:-.015em;color:var(--purple-900)}
.netpartner__th{margin:8px 0 0;color:var(--ink-muted)}
.netpartner__summary{max-width:60ch;margin:18px 0 0;font-size:var(--fs-lg);line-height:1.75}
.netpartner__facts{display:grid;gap:14px;margin:26px 0 0;padding-top:22px;border-top:1px solid var(--line)}
.netpartner__facts>div{display:grid;grid-template-columns:minmax(120px,11rem) minmax(0,1fr);gap:4px 20px}
.netpartner__facts dt{color:var(--ink-muted);font-size:var(--fs-sm)}
.netpartner__facts dd{margin:0;font-size:var(--fs-sm);line-height:1.7}
.netpartner__facts .netitem__tags{margin:0}
.netpartner__acts h2{margin:0 0 clamp(20px,2.6vw,32px)}
.netpartner__n{color:var(--purple-500);font-family:var(--font-ui);font-weight:500}
.netpartner__none{color:var(--ink-muted)}
@media(max-width:760px){
  .netpartner__head{grid-template-columns:1fr}
  .netpartner__media.is-empty{display:none}
  .netpartner__facts>div{grid-template-columns:1fr}
}
/* Timeline: a line down the left, a marker per activity.
   Each activity sets its text beside its photos; the first photo gets the most room. ---- */
.nettl{position:relative;display:grid;grid-template-columns:minmax(0,1fr);gap:clamp(44px,5vw,72px);margin:0;padding:0 0 0 clamp(30px,3vw,44px);list-style:none}
.nettl::before{content:"";position:absolute;top:10px;bottom:10px;left:7px;width:2px;border-radius:2px;background:var(--purple-200)}
.nettl__item{position:relative;display:grid;grid-template-columns:minmax(0,5fr) minmax(0,7fr);gap:clamp(22px,3vw,48px);align-items:start;min-width:0}
.nettl__item.is-text{grid-template-columns:minmax(0,1fr)}
.nettl__item::before{content:"";position:absolute;top:8px;left:calc(-1 * clamp(30px,3vw,44px));width:16px;height:16px;border:3px solid var(--purple-700);border-radius:50%;background:var(--purple-700);box-sizing:border-box}
.nettl__text{position:sticky;top:104px;min-width:0}
@media(max-width:900px){.nettl__text{position:static}}
.nettl__meta{display:flex;flex-wrap:wrap;align-items:center;gap:6px 14px;margin:0 0 8px;font-size:var(--fs-sm)}
.nettl__period{color:var(--ink-muted);font-variant-numeric:tabular-nums}
.nettl__title{margin:0;font-size:clamp(1.25rem,1.05rem + .8vw,1.75rem);line-height:1.35;color:var(--purple-900)}
.nettl__body{max-width:62ch;margin:12px 0 0;font-size:var(--fs-base);line-height:1.85}
.nettl__photos{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px;margin:0;padding:0;list-style:none}
.nettl__photos--1{grid-template-columns:minmax(0,1fr)}
.nettl__photos--2,.nettl__photos--3{grid-template-columns:repeat(2,minmax(0,1fr))}
.nettl__photos--3>li:first-child,.nettl__photos--4>li:first-child{grid-column:1 / -1}
.nettl__photo{display:block;width:100%;padding:0;border:0;border-radius:12px;background:var(--purple-100);overflow:hidden;cursor:zoom-in;aspect-ratio:4/3}
.nettl__photos--1 .nettl__photo,.nettl__photos--3>li:first-child .nettl__photo,.nettl__photos--4>li:first-child .nettl__photo{aspect-ratio:16/10}
.nettl__photo img{display:block;width:100%;height:100%;object-fit:cover;transition:transform .3s ease}
.nettl__photo:hover img{transform:scale(1.03)}
.nettl__photo:focus-visible{outline:3px solid var(--purple-500);outline-offset:2px}
@media(max-width:900px){.nettl__item{grid-template-columns:minmax(0,1fr)}}
@media(prefers-reduced-motion:reduce){.nettl__photo img,.netitem__page,.netbox .netbox__link{transition:none}}

/* ---- Large view of a photo (strip and institution page) ---- */
.netbox{width:min(1100px,calc(100vw - 32px));max-width:none;max-height:calc(100dvh - 32px);padding:0;border:0;border-radius:18px;background:var(--purple-900);color:#fff;overflow:auto}
.netbox::backdrop{background:rgba(18,6,24,.78)}
.netbox__frame{position:relative}
.netbox__close{position:absolute;top:10px;right:10px;z-index:2;display:grid;place-items:center;width:44px;height:44px;padding:0;border:0;border-radius:50%;background:rgba(0,0,0,.45);color:#fff;font-size:28px;line-height:1;cursor:pointer}
.netbox__close:hover{background:rgba(0,0,0,.7)}
.netbox__figure{margin:0}
.netbox__stage{position:relative;display:grid;place-items:center;background:#120618}
.netbox__img{display:block;width:100%;max-height:calc(100dvh - 220px);object-fit:contain}
.netbox__nav{position:absolute;top:50%;transform:translateY(-50%)}
.netbox__nav--prev{left:14px}
.netbox__nav--next{right:14px}
.netbox__nav[hidden]{display:none}
.netbox__cap{display:grid;gap:4px;padding:18px clamp(18px,3vw,32px) 22px}
.netbox__cap p{margin:0;color:#fff}
.netbox .netbox__inst{color:var(--purple-200);font-family:var(--font-ui);font-size:var(--fs-sm);font-weight:600}
.netbox__title{font-size:var(--fs-lg);font-weight:600;line-height:1.5}
/* White text at rest and on hover; a thin track under it fills with a solid white line from the left on hover. */
.netbox .netbox__link{justify-self:start;margin-top:8px;padding-bottom:3px;color:#fff;font-size:var(--fs-sm);text-decoration:none;background:linear-gradient(#fff,#fff) 0 100% / 0 1.5px no-repeat,linear-gradient(rgba(255,255,255,.3),rgba(255,255,255,.3)) 0 100% / 100% 1px no-repeat;transition:background-size .3s ease}
.netbox .netbox__link:hover,.netbox .netbox__link:focus-visible{color:#fff;background-size:100% 1.5px,100% 1px}
.netbox .netbox__link:focus-visible{outline:2px solid #fff;outline-offset:4px;border-radius:2px}
.netbox__link[hidden]{display:none}
@media(max-width:640px){.netbox__nav{display:none}}
