Last modified by Veronika Kocher on Friday, 04 Sep 2026 14:45

From version 5.10
edited by Veronika Kocher
on Thursday, 03 Sep 2026 10:09
Change comment: There is no comment for this version
To version 5.13
edited by Veronika Kocher
on Thursday, 03 Sep 2026 15:54
Change comment: There is no comment for this version

Summary

Details

Page properties
Content
... ... @@ -26,7 +26,7 @@
26 26  <section class="ido-card" style="margin-bottom:18px;overflow:hidden;border-left:6px solid #e94b13;">
27 27  <div class="ido-hero"><img src="https://xwiki.uni-ak.ac.at/bin/download/Service%20Navigator/Art%20%26%20Research%20Services%20Navigator/WebHome/enable.png" alt="Research materials, documentation and project outputs"></div>
28 28  <div style="padding:18px 21px 20px">
29 -<div class="ido-eye" style="color:#8a4d36;margin-bottom:5px">ENABLE · IDENTIFY DATA &amp; RESEARCH OUTPUTS</div>
29 +<div class="ido-eye" style="color:#8a4d36;margin-bottom:5px">PREPARE · IDENTIFY DATA &amp; RESEARCH OUTPUTS</div>
30 30  <h2 style="font-size:27px;line-height:1.2;margin:0 0 8px;color:#2c2926">Know what your project creates, collects, reuses and needs to keep</h2>
31 31  <p style="margin:0;color:#5e5953;line-height:1.6;max-width:1160px">Before you can plan storage, rights, data protection, documentation, publication or preservation, you need a realistic inventory of the materials and outputs your project will work with. In artistic research this often includes much more than conventional “research data”: source material, physical objects, sketches, recordings, software, process documentation, performances, installations and the records that make them understandable later.</p>
32 32  </div>
... ... @@ -261,12 +261,13 @@
261 261  </div>
262 262  {{/html}}
263 263  
264 -\n\n
265 -\n\n{{html clean="false"}}
266 -<!-- SN_HORIZONTAL_BOX_HARMONIZER_START -->
264 +{{html clean="false"}}
265 +<!-- SN_SERVICE_NAVIGATOR_MASTER_STYLE_START -->
267 267  
268 -<style data-sn-horizontal-box-harmonizer="7">
269 -/* ---------- Typography: never justify headings ---------- */
267 +<style data-sn-service-navigator-master="1">
268 +/* =========================================================
269 + MASTER TYPOGRAPHY
270 + ========================================================= */
270 270  #xwikicontent h1,
271 271  #xwikicontent h2,
272 272  #xwikicontent h3,
... ... @@ -288,88 +288,105 @@
288 288   word-spacing:normal!important;
289 289  }
290 290  
291 -/* ---------- Native XWiki semantic callouts ---------- */
292 -#xwikicontent .box.infomessage,
293 -#xwikicontent .infomessage,
294 -#xwikicontent .box.warningmessage,
295 -#xwikicontent .warningmessage,
296 -#xwikicontent .box.successmessage,
297 -#xwikicontent .successmessage,
298 -#xwikicontent .box.errormessage,
299 -#xwikicontent .errormessage,
300 -#xwikicontent [data-sn-callout-harmonized="1"]{
292 +/* =========================================================
293 + COMING SOON / IN VORBEREITUNG
294 + ========================================================= */
295 +.sn-coming-soon-badge{
296 + display:inline-block;
297 + vertical-align:middle;
298 + margin-left:10px;
299 + padding:4px 8px;
300 + border-radius:14px;
301 + border:1px solid #efd9cc;
302 + background:#fff4ee;
303 + color:#8a4d36;
304 + font-size:11px;
305 + font-weight:700;
306 + letter-spacing:.055em;
307 + line-height:1.2;
308 + white-space:nowrap;
309 +}
310 +
311 +/* =========================================================
312 + NATIVE / DETAIL CALLOUT GEOMETRY
313 + Preserve existing backgrounds.
314 + ========================================================= */
315 +#xwikicontent .arsn-info,
316 +#xwikicontent .dmp-info,
317 +#xwikicontent .ido-info,
318 +#xwikicontent .pp-info,
319 +#xwikicontent .infomessage{
301 301   box-sizing:border-box!important;
302 - border-radius:8px!important;
303 - border-top:1px solid rgba(0,0,0,.08)!important;
304 - border-right:1px solid rgba(0,0,0,.08)!important;
305 - border-bottom:1px solid rgba(0,0,0,.08)!important;
306 - border-left:4px solid var(--sn-callout-accent,#21b6d7)!important;
307 - padding:14px 16px!important;
321 + border-left:4px solid #21b6d7!important;
322 + border-radius:8px;
308 308   text-align:left!important;
309 - text-justify:auto!important;
310 310   word-spacing:normal!important;
311 - box-shadow:none!important;
312 312  }
313 313  
314 -#xwikicontent .box.infomessage,
315 -#xwikicontent .infomessage{
316 - --sn-callout-accent:#21b6d7;
317 - background:#eaf7fb!important;
318 -}
319 -
320 -#xwikicontent .box.warningmessage,
321 -#xwikicontent .warningmessage{
322 - --sn-callout-accent:#f0aa00;
323 - background:#fff8e7!important;
324 -}
325 -
326 -#xwikicontent .box.successmessage,
327 -#xwikicontent .successmessage{
328 - --sn-callout-accent:#38b76a;
329 - background:#edf9f1!important;
330 -}
331 -
332 -#xwikicontent .box.errormessage,
327 +#xwikicontent .arsn-warn,
328 +#xwikicontent .dmp-warn,
329 +#xwikicontent .ido-warn,
330 +#xwikicontent .pp-warn,
331 +#xwikicontent .warn,
332 +#xwikicontent .warning,
333 +#xwikicontent .warningmessage,
333 333  #xwikicontent .errormessage{
334 - --sn-callout-accent:#e94b13;
335 - background:#fff1ec!important;
335 + box-sizing:border-box!important;
336 + border-left:4px solid #e94b13!important;
337 + border-radius:8px;
338 + text-align:left!important;
339 + word-spacing:normal!important;
336 336  }
337 337  
338 -#xwikicontent [data-sn-callout-harmonized="1"] > :first-child,
339 -#xwikicontent .infomessage > :first-child,
340 -#xwikicontent .warningmessage > :first-child,
341 -#xwikicontent .successmessage > :first-child,
342 -#xwikicontent .errormessage > :first-child{
343 - margin-top:0!important;
342 +[data-sn-master-equal-height],
343 +[data-sn-master-first-row]{
344 + box-sizing:border-box;
344 344  }
345 345  
346 -#xwikicontent [data-sn-callout-harmonized="1"] > :last-child,
347 -#xwikicontent .infomessage > :last-child,
348 -#xwikicontent .warningmessage > :last-child,
349 -#xwikicontent .successmessage > :last-child,
350 -#xwikicontent .errormessage > :last-child{
351 - margin-bottom:0!important;
347 +/* =========================================================
348 + FULL-WIDTH THREE-LINE NUMBER / TITLE / SUBTITLE BLOCKS
349 + ========================================================= */
350 +#xwikicontent .arsn-area-label[data-sn-three-line="1"]{
351 + display:grid!important;
352 + grid-template-columns:minmax(0,1fr)!important;
353 + grid-auto-rows:auto!important;
354 + width:100%!important;
355 + max-width:none!important;
356 + box-sizing:border-box!important;
357 + justify-items:start!important;
358 + align-items:start!important;
359 + gap:2px!important;
360 + text-align:left!important;
361 + text-align-last:left!important;
362 + text-justify:auto!important;
363 + word-spacing:normal!important;
364 + white-space:normal!important;
352 352  }
353 -
354 -#xwikicontent [data-sn-equal-height-managed],
355 -#xwikicontent [data-sn-first-section-aligned],
356 -#xwikicontent [data-sn-first-content-aligned]{
357 - box-sizing:border-box;
366 +#xwikicontent .arsn-area-label[data-sn-three-line="1"] > .arsn-area-number,
367 +#xwikicontent .arsn-area-label[data-sn-three-line="1"] > .sn-area-label-title,
368 +#xwikicontent .arsn-area-label[data-sn-three-line="1"] > .arsn-area-action{
369 + display:block!important;
370 + width:100%!important;
371 + margin:0!important;
372 + text-align:left!important;
373 + text-align-last:left!important;
374 + text-justify:auto!important;
375 + word-spacing:normal!important;
376 + white-space:normal!important;
358 358  }
359 359  </style>
360 360  
361 -<script data-sn-horizontal-box-harmonizer="7">
380 +<script data-sn-service-navigator-master="1">
362 362  (function(){
363 363   "use strict";
364 364  
384 + var PAGE_KIND="detail";
385 + var PLACEHOLDER=false;
386 + var PLACEHOLDER_LABEL="COMING SOON";
387 +
365 365   var MOBILE_MAX=767;
366 366   var ROW_TOLERANCE=6;
367 - var MIN_W=150;
368 - var MIN_H=36;
369 - var MAX_PARENT_CHILDREN=18;
370 - var SEARCH_DEPTH=5;
371 371   var RESIZE_DEBOUNCE=220;
372 - var MIN_WIDTH_CHANGE=2;
373 373  
374 374   var root=
375 375   document.getElementById("xwikicontent")||
... ... @@ -379,142 +379,114 @@
379 379  
380 380   if(!root)return;
381 381  
382 - var heightManaged=new Set();
383 - var sectionManaged=new Set();
384 - var contentManaged=new Set();
400 + var managedHeight=new Set();
401 + var managedMargin=new Set();
402 + var originalHeight=new WeakMap();
403 + var originalMargin=new WeakMap();
385 385  
386 - var originalMinHeight=new WeakMap();
387 - var originalMarginTop=new WeakMap();
388 -
389 389   var resizeTimer=0;
390 - var lastWidth=-1;
391 - var hasApplied=false;
392 - var applying=false;
406 + var running=false;
393 393  
394 - function num(v){
395 - var n=parseFloat(v);
396 - return Number.isFinite(n)?n:0;
397 - }
398 -
399 - function visible(el,minW,minH){
400 - if(!el||el.nodeType!==1)return false;
401 -
402 - var s=getComputedStyle(el);
403 -
404 - if(
405 - s.display==="none"||
406 - s.visibility==="hidden"||
407 - Number(s.opacity)===0
408 - ){
409 - return false;
408 + var THEMES=[
409 + {
410 + name:"BLUE",
411 + accent:"#21b6d7",
412 + bg:"#eaf7fb",
413 + text:"#315d68",
414 + labels:[
415 + "HIER STARTEN",
416 + "ENTSCHEIDEN",
417 + "ÜBERPRÜFEN & ANPASSEN",
418 + "START HERE",
419 + "DECIDE",
420 + "REVIEW & ADAPT"
421 + ]
422 + },
423 + {
424 + name:"RED",
425 + accent:"#e94b13",
426 + bg:"#fff1ec",
427 + text:"#8a4d36",
428 + labels:[
429 + "PLANEN & ORGANISIEREN",
430 + "ORGANISIEREN & DOKUMENTIEREN",
431 + "PUBLIZIEREN & PRÄSENTIEREN",
432 + "PLAN & ORGANISE",
433 + "PLAN & ORGANIZE",
434 + "ORGANISE & DOCUMENT",
435 + "ORGANIZE & DOCUMENT",
436 + "PUBLISH & PRESENT"
437 + ]
438 + },
439 + {
440 + name:"YELLOW",
441 + accent:"#f0aa00",
442 + bg:"#fff8e7",
443 + text:"#785b17",
444 + labels:[
445 + "SCHÜTZEN & KLÄREN",
446 + "STANDARDISIEREN & IDENTIFIZIEREN",
447 + "ÖFFNEN, NACHNUTZEN & AUFFINDBAR MACHEN",
448 + "PROTECT & CLARIFY",
449 + "STANDARDISE & IDENTIFY",
450 + "STANDARDIZE & IDENTIFY",
451 + "OPEN, REUSE & MAKE FINDABLE"
452 + ]
453 + },
454 + {
455 + name:"GREEN",
456 + accent:"#38b76a",
457 + bg:"#edf9f1",
458 + text:"#3f7451",
459 + labels:[
460 + "INFRASTRUKTUR EINRICHTEN",
461 + "INFRASTRUKTUR & ZUSAMMENARBEIT EINRICHTEN",
462 + "SPEICHERN & ZUGRIFF STEUERN",
463 + "REPOSITORIUM, ERHALTEN & ÜBERGEBEN",
464 + "SET UP INFRASTRUCTURE",
465 + "SET UP INFRASTRUCTURE & COLLABORATION",
466 + "STORE & CONTROL ACCESS",
467 + "REPOSITORY, PRESERVE & HAND OVER"
468 + ]
410 410   }
470 + ];
411 411  
412 - var r=el.getBoundingClientRect();
413 -
414 - return (
415 - r.width>=(minW||1)&&
416 - r.height>=(minH||1)
417 - );
472 + function num(value){
473 + var n=parseFloat(value);
474 + return Number.isFinite(n)?n:0;
418 418   }
419 419  
420 - function normalizeText(text){
421 - return String(text||"")
477 + function norm(value){
478 + return String(value||"")
422 422   .replace(/\s+/g," ")
423 423   .trim()
424 424   .toUpperCase();
425 425   }
426 426  
427 - function excluded(el){
428 - return (
429 - !el.matches||
430 - el.matches(
431 - "button,input,select,textarea,option,label,img,svg,canvas,table,thead,tbody,tfoot,tr,td,th,summary,script,style,noscript,template,.btn,.chip,[role=button]"
432 - )
433 - );
434 - }
484 + function visible(el){
485 + if(!el||el.nodeType!==1)return false;
435 435  
436 - /* ---------- Custom coloured callouts ---------- */
487 + var style=getComputedStyle(el);
488 + var rect=el.getBoundingClientRect();
437 437  
438 - function nativeCallout(el){
439 - var c=
440 - typeof el.className==="string"
441 - ? el.className.toLowerCase()
442 - : "";
443 -
444 444   return (
445 - /(^|\s)(infomessage|warningmessage|successmessage|errormessage)(\s|$)/.test(c)
491 + style.display!=="none"&&
492 + style.visibility!=="hidden"&&
493 + rect.width>20&&
494 + rect.height>4
446 446   );
447 447   }
448 448  
449 - function customCallout(el){
450 - if(!visible(el,220,42)||excluded(el))return false;
451 -
452 - var r=el.getBoundingClientRect();
453 -
454 - if(r.height>520)return false;
455 -
456 - var s=getComputedStyle(el);
457 -
458 - var bg=
459 - s.backgroundColor&&
460 - s.backgroundColor!=="rgba(0, 0, 0, 0)"&&
461 - s.backgroundColor!=="transparent"&&
462 - s.backgroundColor!=="rgb(255, 255, 255)";
463 -
464 - var left=
465 - num(s.borderLeftWidth);
466 -
467 - return (
468 - bg&&
469 - left>=2
470 - );
471 - }
472 -
473 - function harmoniseCustomCallouts(){
474 - Array.from(
475 - root.querySelectorAll(
476 - "div,aside,section"
477 - )
478 - ).forEach(function(el){
479 - if(nativeCallout(el))return;
480 - if(!customCallout(el))return;
481 -
482 - var s=getComputedStyle(el);
483 -
484 - el.setAttribute(
485 - "data-sn-callout-harmonized",
486 - "1"
487 - );
488 -
489 - if(
490 - s.borderLeftColor
491 - ){
492 - el.style.setProperty(
493 - "--sn-callout-accent",
494 - s.borderLeftColor
495 - );
496 - }
497 - });
498 - }
499 -
500 - /* ---------- Restore only values V7 itself changed ---------- */
501 -
502 - function saveOriginal(el,map,property){
498 + function saveStyle(el,map,property){
503 503   if(map.has(el))return;
504 504  
505 505   map.set(el,{
506 - value:
507 - el.style.getPropertyValue(
508 - property
509 - ),
510 - priority:
511 - el.style.getPropertyPriority(
512 - property
513 - )
502 + value:el.style.getPropertyValue(property),
503 + priority:el.style.getPropertyPriority(property)
514 514   });
515 515   }
516 516  
517 - function restoreOriginal(el,map,property){
507 + function restoreStyle(el,map,property){
518 518   var original=map.get(el);
519 519  
520 520   if(original&&original.value){
... ... @@ -524,770 +524,1069 @@
524 524   original.priority||""
525 525   );
526 526   }else{
527 - el.style.removeProperty(
528 - property
529 - );
517 + el.style.removeProperty(property);
530 530   }
531 531   }
532 532  
533 533   function resetRuntime(){
534 - heightManaged.forEach(function(el){
535 - restoreOriginal(
522 + managedHeight.forEach(function(el){
523 + restoreStyle(
536 536   el,
537 - originalMinHeight,
525 + originalHeight,
538 538   "min-height"
539 539   );
540 -
541 541   el.removeAttribute(
542 - "data-sn-equal-height-managed"
529 + "data-sn-master-equal-height"
543 543   );
544 544   });
545 545  
546 - sectionManaged.forEach(function(el){
547 - restoreOriginal(
533 + managedMargin.forEach(function(el){
534 + restoreStyle(
548 548   el,
549 - originalMarginTop,
536 + originalMargin,
550 550   "margin-top"
551 551   );
552 -
553 553   el.removeAttribute(
554 - "data-sn-first-section-aligned"
540 + "data-sn-master-first-row"
555 555   );
556 556   });
557 557  
558 - contentManaged.forEach(function(el){
559 - restoreOriginal(
560 - el,
561 - originalMarginTop,
562 - "margin-top"
563 - );
544 + managedHeight.clear();
545 + managedMargin.clear();
546 + }
564 564  
565 - el.removeAttribute(
566 - "data-sn-first-content-aligned"
567 - );
568 - });
548 + function themeFor(text){
549 + var value=norm(text);
569 569  
570 - heightManaged.clear();
571 - sectionManaged.clear();
572 - contentManaged.clear();
573 - }
551 + for(var i=0;i<THEMES.length;i++){
552 + for(var j=0;j<THEMES[i].labels.length;j++){
553 + var label=THEMES[i].labels[j];
574 574  
575 - /* ---------- Card detection ---------- */
555 + if(
556 + value===label||
557 + value.indexOf(label+" ")===0||
558 + value.indexOf(label+" -")===0||
559 + value.indexOf(label+" ·")===0
560 + ){
561 + return THEMES[i];
562 + }
563 + }
564 + }
576 576  
577 - function namedLikeBox(el){
578 - var c=
579 - typeof el.className==="string"
580 - ? el.className
581 - : "";
566 + return null;
567 + }
582 582  
583 - return /(^|[\s_-])(box|card|tile|panel|role|check|service|source|call|area|detail|resource|topic|warn|info)([\s_-]|$)/i.test(c);
569 + /* =======================================================
570 + BORDERLESS FILLED RED/ORANGE CTA BUTTONS
571 + ======================================================= */
572 +
573 + function colourDistance(a,b){
574 + return Math.sqrt(
575 + Math.pow(a[0]-b[0],2)+
576 + Math.pow(a[1]-b[1],2)+
577 + Math.pow(a[2]-b[2],2)
578 + );
584 584   }
585 585  
586 - function boxLike(el){
587 - if(
588 - !visible(el,MIN_W,MIN_H)||
589 - excluded(el)
590 - ){
591 - return false;
592 - }
581 + function makeFilledRedOrangeCTAsBorderless(){
582 + var RED_ORANGE=[233,75,19];
593 593  
594 - var s=getComputedStyle(el);
595 - var r=el.getBoundingClientRect();
584 + Array.from(
585 + root.querySelectorAll(
586 + 'a,button,[role="button"],input[type="submit"],input[type="button"]'
587 + )
588 + ).forEach(function(el){
589 + if(!visible(el))return;
596 596  
597 - var border=
598 - num(s.borderTopWidth)+
599 - num(s.borderRightWidth)+
600 - num(s.borderBottomWidth)+
601 - num(s.borderLeftWidth);
591 + var style=getComputedStyle(el);
592 + var rgb=parseRGB(style.backgroundColor);
602 602  
603 - var radius=Math.max(
604 - num(s.borderTopLeftRadius),
605 - num(s.borderTopRightRadius),
606 - num(s.borderBottomLeftRadius),
607 - num(s.borderBottomRightRadius)
608 - );
594 + if(!rgb)return;
609 609  
610 - var bg=
611 - s.backgroundColor&&
612 - s.backgroundColor!=="rgba(0, 0, 0, 0)"&&
613 - s.backgroundColor!=="transparent";
596 + if(
597 + colourDistance(
598 + rgb,
599 + RED_ORANGE
600 + )>55
601 + ){
602 + return;
603 + }
614 614  
615 - var shadow=
616 - s.boxShadow&&
617 - s.boxShadow!=="none";
605 + var rect=el.getBoundingClientRect();
618 618  
619 - return (
620 - namedLikeBox(el)||
621 - border>=1||
622 - (bg&&radius>=3)||
623 - (shadow&&r.width>=180)
624 - );
625 - }
607 + if(
608 + rect.width<80||
609 + rect.height<24
610 + ){
611 + return;
612 + }
626 626  
627 - function pickTarget(child){
628 - if(!visible(child,MIN_W,MIN_H))return null;
614 + el.style.setProperty(
615 + "border",
616 + "none",
617 + "important"
618 + );
629 629  
630 - if(boxLike(child))return child;
620 + el.style.setProperty(
621 + "border-left",
622 + "none",
623 + "important"
624 + );
631 631  
632 - var cr=child.getBoundingClientRect();
633 - var q=[];
626 + el.style.setProperty(
627 + "border-top",
628 + "none",
629 + "important"
630 + );
634 634  
635 - Array.from(child.children||[]).forEach(function(el){
636 - q.push({el:el,depth:1});
632 + el.style.setProperty(
633 + "border-right",
634 + "none",
635 + "important"
636 + );
637 +
638 + el.style.setProperty(
639 + "border-bottom",
640 + "none",
641 + "important"
642 + );
643 +
644 + el.style.setProperty(
645 + "box-shadow",
646 + "none",
647 + "important"
648 + );
637 637   });
650 + }
638 638  
639 - var best=null;
640 - var bestScore=-Infinity;
652 + /* =======================================================
653 + FULL-WIDTH THREE-LINE AREA LABELS
654 + ======================================================= */
641 641  
642 - while(q.length){
643 - var item=q.shift();
644 - var el=item.el;
656 + function compactText(value){
657 + return String(value||"")
658 + .replace(/\s+/g," ")
659 + .trim();
660 + }
645 645  
646 - if(!visible(el,MIN_W,MIN_H))continue;
662 + function makeThreeLineAreaLabels(){
663 + Array.from(
664 + root.querySelectorAll(
665 + ".arsn-area-label"
666 + )
667 + ).forEach(function(label){
668 + if(
669 + label.getAttribute(
670 + "data-sn-three-line"
671 + )==="1"
672 + ){
673 + return;
674 + }
647 647  
648 - var r=el.getBoundingClientRect();
676 + var number=
677 + label.querySelector(
678 + ":scope > .arsn-area-number"
679 + );
649 649  
681 + var action=
682 + label.querySelector(
683 + ":scope > .arsn-area-action"
684 + );
685 +
650 650   if(
651 - r.width>=cr.width*.68&&
652 - boxLike(el)
687 + !number||
688 + !action
653 653   ){
654 - var widthFit=
655 - 1-Math.min(
656 - 1,
657 - Math.abs(cr.width-r.width)/
658 - Math.max(1,cr.width)
659 - );
690 + return;
691 + }
660 660  
661 - var topFit=
662 - 1-Math.min(
663 - 1,
664 - Math.abs(cr.top-r.top)/100
665 - );
693 + var clone=
694 + label.cloneNode(true);
666 666  
667 - var score=
668 - widthFit*6+
669 - topFit*3+
670 - Math.min(r.height,900)/450+
671 - Math.min(r.width*r.height,900000)/900000;
696 + var cloneNumber=
697 + clone.querySelector(
698 + ":scope > .arsn-area-number"
699 + );
672 672  
673 - if(score>bestScore){
674 - best=el;
675 - bestScore=score;
676 - }
701 + var cloneAction=
702 + clone.querySelector(
703 + ":scope > .arsn-area-action"
704 + );
705 +
706 + if(cloneNumber){
707 + cloneNumber.remove();
677 677   }
678 678  
679 - if(item.depth<SEARCH_DEPTH){
680 - Array.from(el.children||[]).forEach(function(next){
681 - q.push({
682 - el:next,
683 - depth:item.depth+1
684 - });
685 - });
710 + if(cloneAction){
711 + cloneAction.remove();
686 686   }
687 - }
688 688  
689 - return best;
690 - }
714 + var titleText=
715 + compactText(
716 + clone.textContent
717 + );
691 691  
692 - function groupRows(entries){
693 - var groups=[];
719 + if(!titleText){
720 + return;
721 + }
694 694  
695 - entries
696 - .slice()
697 - .sort(function(a,b){
698 - return (
699 - a.rect.top-b.rect.top||
700 - a.rect.left-b.rect.left
723 + var numberNode=
724 + number.cloneNode(true);
725 +
726 + var actionNode=
727 + action.cloneNode(true);
728 +
729 + var titleNode=
730 + document.createElement(
731 + "span"
701 701   );
702 - })
703 - .forEach(function(entry){
704 - var group=null;
705 705  
706 - for(var i=0;i<groups.length;i++){
707 - if(
708 - Math.abs(
709 - groups[i].top-
710 - entry.rect.top
711 - )<=ROW_TOLERANCE
712 - ){
713 - group=groups[i];
714 - break;
715 - }
716 - }
734 + titleNode.className=
735 + "sn-area-label-title";
717 717  
718 - if(!group){
719 - group={
720 - top:entry.rect.top,
721 - entries:[]
722 - };
723 - groups.push(group);
724 - }
737 + titleNode.textContent=
738 + titleText;
725 725  
726 - group.entries.push(entry);
727 - });
740 + while(label.firstChild){
741 + label.removeChild(
742 + label.firstChild
743 + );
744 + }
728 728  
729 - return groups;
746 + label.appendChild(
747 + numberNode
748 + );
749 +
750 + label.appendChild(
751 + titleNode
752 + );
753 +
754 + label.appendChild(
755 + actionNode
756 + );
757 +
758 + label.setAttribute(
759 + "data-sn-three-line",
760 + "1"
761 + );
762 +
763 + var head=
764 + label.closest(
765 + ".arsn-area-head"
766 + );
767 +
768 + if(head){
769 + head.style.setProperty(
770 + "width",
771 + "100%",
772 + "important"
773 + );
774 +
775 + head.style.setProperty(
776 + "max-width",
777 + "100%",
778 + "important"
779 + );
780 +
781 + head.style.setProperty(
782 + "box-sizing",
783 + "border-box",
784 + "important"
785 + );
786 + }
787 + });
730 730   }
731 731  
732 - function validRow(group){
733 - if(group.entries.length<2)return false;
790 + /* =======================================================
791 + PLACEHOLDER BADGE
792 + ======================================================= */
734 734  
735 - var lefts=
736 - group.entries
737 - .map(function(e){return e.rect.left;})
738 - .sort(function(a,b){return a-b;});
794 + function applyPlaceholderBadge(){
795 + if(!PLACEHOLDER)return;
739 739  
740 740   if(
741 - lefts[lefts.length-1]-
742 - lefts[0]<
743 - 80
798 + document.querySelector(
799 + ".sn-coming-soon-badge"
800 + )
744 744   ){
745 - return false;
802 + return;
746 746   }
747 747  
748 - var widths=
749 - group.entries
750 - .map(function(e){return e.rect.width;})
751 - .filter(function(w){return w>0;});
805 + var title=
806 + document.querySelector(
807 + "#document-title"
808 + )||
809 + document.querySelector(
810 + "h1"
811 + );
752 752  
753 - if(widths.length<2)return false;
813 + if(!title)return;
754 754  
755 - var minW=
756 - Math.min.apply(Math,widths);
815 + var badge=
816 + document.createElement(
817 + "span"
818 + );
757 757  
758 - var maxW=
759 - Math.max.apply(Math,widths);
820 + badge.className=
821 + "sn-coming-soon-badge";
760 760  
761 - return (
762 - maxW/
763 - Math.max(1,minW)<=
764 - 1.9
823 + badge.textContent=
824 + PLACEHOLDER_LABEL;
825 +
826 + badge.setAttribute(
827 + "aria-label",
828 + PLACEHOLDER_LABEL
765 765   );
766 - }
767 767  
768 - /* ---------- Known ARSN first section bars ---------- */
769 -
770 - function knownBar(el){
771 - var text=
772 - normalizeText(
773 - el.textContent
774 - );
775 -
776 - return (
777 - text==="HIER STARTEN"||
778 - text==="ORGANISIEREN & DOKUMENTIEREN"||
779 - text==="ENTSCHEIDEN"||
780 - text==="START HERE"||
781 - text==="GET STARTED"||
782 - text==="ORGANISE & DOCUMENT"||
783 - text==="ORGANIZE & DOCUMENT"||
784 - text==="DECIDE"
831 + title.appendChild(
832 + badge
785 785   );
786 786   }
787 787  
788 - function findKnownBar(card){
789 - var cardRect=
790 - card.getBoundingClientRect();
836 + /* =======================================================
837 + DETAIL PAGE OWN-ACCENT PROPAGATION
838 + ======================================================= */
791 791  
792 - var rows=
793 - Array.from(
794 - card.querySelectorAll(
795 - "div,p,span,strong,h3,h4,h5,h6"
796 - )
797 - )
798 - .filter(function(el){
799 - if(!visible(el,20,6))return false;
800 - if(!knownBar(el))return false;
840 + function parseRGB(value){
841 + var match=String(value||"").match(
842 + /rgba?\(\s*([\d.]+)\s*,\s*([\d.]+)\s*,\s*([\d.]+)/i
843 + );
801 801  
802 - var r=el.getBoundingClientRect();
845 + if(!match)return null;
803 803  
804 - var rel=
805 - r.top-
806 - cardRect.top;
847 + return [
848 + Number(match[1]),
849 + Number(match[2]),
850 + Number(match[3])
851 + ];
852 + }
807 807  
808 - return (
809 - rel>=35&&
810 - rel<=
811 - cardRect.height*.75
812 - );
813 - })
814 - .sort(function(a,b){
815 - return (
816 - a.getBoundingClientRect().top-
817 - b.getBoundingClientRect().top
818 - );
819 - });
820 -
821 - return rows[0]||null;
854 + function distance(a,b){
855 + return Math.sqrt(
856 + Math.pow(a[0]-b[0],2)+
857 + Math.pow(a[1]-b[1],2)+
858 + Math.pow(a[2]-b[2],2)
859 + );
822 822   }
823 823  
824 - function alignKnownBars(cards){
825 - var rows=
826 - cards.map(function(card){
827 - var bar=
828 - findKnownBar(card);
862 + function paletteMatch(cssColor){
863 + var rgb=parseRGB(cssColor);
829 829  
830 - if(!bar)return null;
865 + if(!rgb)return null;
831 831  
832 - var cr=
833 - card.getBoundingClientRect();
867 + var palette=[
868 + {hex:"#21b6d7",rgb:[33,182,215]},
869 + {hex:"#e94b13",rgb:[233,75,19]},
870 + {hex:"#f0aa00",rgb:[240,170,0]},
871 + {hex:"#38b76a",rgb:[56,183,106]}
872 + ];
834 834  
835 - var br=
836 - bar.getBoundingClientRect();
874 + var best=null;
875 + var bestDistance=Infinity;
837 837  
838 - return {
839 - bar:bar,
840 - relativeTop:
841 - br.top-
842 - cr.top
843 - };
844 - });
877 + palette.forEach(function(item){
878 + var d=distance(rgb,item.rgb);
845 845  
846 - if(
847 - rows.some(function(row){
848 - return !row;
849 - })
850 - ){
851 - return false;
852 - }
880 + if(d<bestDistance){
881 + best=item;
882 + bestDistance=d;
883 + }
884 + });
853 853  
854 - var target=
855 - Math.max.apply(
856 - Math,
857 - rows.map(function(row){
858 - return row.relativeTop;
859 - })
860 - );
886 + return bestDistance<=30
887 + ?best
888 + :null;
889 + }
861 861  
862 - rows.forEach(function(row){
863 - var delta=
864 - target-
865 - row.relativeTop;
891 + function propagateDetailAccents(){
892 + if(PAGE_KIND!=="detail")return;
866 866  
867 - if(delta<=1)return;
894 + Array.from(
895 + root.querySelectorAll(
896 + ".arsn-call,.dmp-call,.ido-call,.pp-call,"+
897 + ".arsn-source,.dmp-source,.ido-source,.pp-source"
898 + )
899 + ).forEach(function(el){
900 + if(!visible(el))return;
868 868  
869 - saveOriginal(
870 - row.bar,
871 - originalMarginTop,
872 - "margin-top"
873 - );
902 + var style=getComputedStyle(el);
874 874  
875 - var current=
876 - num(
877 - getComputedStyle(
878 - row.bar
879 - ).marginTop
880 - );
904 + if(
905 + num(style.borderTopWidth)>=2
906 + ){
907 + var match=
908 + paletteMatch(
909 + style.borderTopColor
910 + );
881 881  
882 - row.bar.style.setProperty(
883 - "margin-top",
884 - (
885 - current+
886 - delta
887 - )+"px"
888 - );
912 + if(match){
913 + el.style.setProperty(
914 + "border-left",
915 + "4px solid "+match.hex,
916 + "important"
917 + );
918 + }
919 + }
920 + });
889 889  
890 - row.bar.setAttribute(
891 - "data-sn-first-section-aligned",
892 - "7"
893 - );
922 + // Warning families: explicit safety override.
923 + Array.from(
924 + root.querySelectorAll(
925 + ".arsn-warn,.dmp-warn,.ido-warn,.pp-warn,"+
926 + ".warn,.warning,.warningmessage,.errormessage"
927 + )
928 + ).forEach(function(el){
929 + if(!visible(el))return;
894 894  
895 - sectionManaged.add(
896 - row.bar
931 + el.style.setProperty(
932 + "border-left",
933 + "4px solid #e94b13",
934 + "important"
897 897   );
898 898   });
899 899  
900 - return true;
938 + // Info families: explicit orientation override.
939 + Array.from(
940 + root.querySelectorAll(
941 + ".arsn-info,.dmp-info,.ido-info,.pp-info,.infomessage"
942 + )
943 + ).forEach(function(el){
944 + if(!visible(el))return;
945 +
946 + el.style.setProperty(
947 + "border-left",
948 + "4px solid #21b6d7",
949 + "important"
950 + );
951 + });
901 901   }
902 902  
903 - /* ---------- Generic first content after heading ---------- */
954 + /* =======================================================
955 + OVERVIEW SEMANTIC THEME PALETTE
956 + ======================================================= */
904 904  
905 - function heading(card){
906 - var cr=
907 - card.getBoundingClientRect();
908 -
909 - var rows=
910 - Array.from(
911 - card.querySelectorAll(
912 - "h1,h2,h3,h4,h5,h6,.box-title,[role=heading]"
913 - )
958 + function smallestThemeHeaders(){
959 + return Array.from(
960 + root.querySelectorAll(
961 + "div,span,p,strong,h3,h4,h5,h6"
914 914   )
915 - .filter(function(el){
916 - if(!visible(el,20,8))return false;
963 + ).filter(function(el){
964 + if(!visible(el))return false;
965 + if(!themeFor(el.textContent))return false;
917 917  
918 - var r=el.getBoundingClientRect();
919 -
920 - var rel=
921 - r.top-
922 - cr.top;
923 -
924 - return (
925 - rel>=0&&
926 - rel<=
927 - Math.min(
928 - 160,
929 - cr.height*.45
930 - )
967 + return !Array.from(
968 + el.children||[]
969 + ).some(function(child){
970 + return !!themeFor(
971 + child.textContent
931 931   );
932 - })
933 - .sort(function(a,b){
934 - return (
935 - a.getBoundingClientRect().top-
936 - b.getBoundingClientRect().top
937 - );
938 938   });
939 -
940 - return rows[0]||null;
974 + });
941 941   }
942 942  
943 - function firstContent(card,h){
944 - if(!h)return null;
977 + function findOverviewCard(header){
978 + var node=header.parentElement;
979 + var candidates=[];
945 945  
946 - var cr=
947 - card.getBoundingClientRect();
981 + while(node&&node!==root){
982 + var rect=node.getBoundingClientRect();
983 + var style=getComputedStyle(node);
948 948  
949 - var hr=
950 - h.getBoundingClientRect();
985 + var border=
986 + num(style.borderTopWidth)+
987 + num(style.borderRightWidth)+
988 + num(style.borderBottomWidth)+
989 + num(style.borderLeftWidth);
951 951  
952 - var rows=
953 - Array.from(
954 - card.querySelectorAll(
955 - "p,div,ul,ol,dl,blockquote"
956 - )
957 - )
958 - .filter(function(el){
959 - if(
960 - el===h||
961 - h.contains(el)||
962 - el.contains(h)
963 - ){
964 - return false;
965 - }
991 + if(
992 + rect.width>=220&&
993 + rect.width<=800&&
994 + rect.height>=120&&
995 + border>=1
996 + ){
997 + candidates.push(node);
998 + }
966 966  
967 - if(!visible(el,30,8))return false;
1000 + node=node.parentElement;
1001 + }
968 968  
969 - var text=
970 - String(el.textContent||"")
971 - .replace(/\s+/g," ")
972 - .trim();
1003 + if(!candidates.length)return null;
973 973  
974 - if(text.length<3)return false;
1005 + candidates.sort(function(a,b){
1006 + return (
1007 + b.getBoundingClientRect().height-
1008 + a.getBoundingClientRect().height
1009 + );
1010 + });
975 975  
976 - var r=el.getBoundingClientRect();
1012 + return candidates[0];
1013 + }
977 977  
978 - if(
979 - r.top<
980 - hr.bottom-1
981 - ){
982 - return false;
983 - }
1015 + function rowCandidates(link,card){
1016 + var result=[];
1017 + var cardRect=
1018 + card.getBoundingClientRect();
984 984  
985 - if(
986 - r.top-cr.top>
987 - Math.min(
988 - 280,
989 - cr.height*.65
990 - )
991 - ){
992 - return false;
993 - }
1020 + var node=link;
994 994  
1022 + while(node&&node!==card){
1023 + if(visible(node)){
1024 + var rect=
1025 + node.getBoundingClientRect();
1026 +
995 995   if(
996 - r.height>
997 - cr.height*.58
1028 + rect.height<=105&&
1029 + rect.width>=
1030 + cardRect.width*.50&&
1031 + rect.width<=
1032 + cardRect.width*1.03
998 998   ){
999 - return false;
1034 + result.push(node);
1000 1000   }
1036 + }
1001 1001  
1002 - return true;
1003 - })
1004 - .sort(function(a,b){
1005 - var ar=
1006 - a.getBoundingClientRect();
1038 + node=node.parentElement;
1039 + }
1007 1007  
1008 - var br=
1009 - b.getBoundingClientRect();
1041 + return result;
1042 + }
1010 1010  
1044 + function chooseOuterRow(
1045 + candidates,
1046 + link
1047 + ){
1048 + if(!candidates.length){
1049 + return link;
1050 + }
1051 +
1052 + var bordered=
1053 + candidates.filter(function(el){
1011 1011   return (
1012 - ar.top-br.top||
1013 - ar.height-br.height
1055 + num(
1056 + getComputedStyle(el)
1057 + .borderLeftWidth
1058 + )>=1
1014 1014   );
1015 1015   });
1016 1016  
1017 - return rows[0]||null;
1018 - }
1062 + var pool=
1063 + bordered.length
1064 + ?bordered
1065 + :candidates;
1019 1019  
1020 - function alignGeneric(cards){
1021 - var rows=
1022 - cards.map(function(card){
1023 - var h=
1024 - heading(card);
1067 + pool.sort(function(a,b){
1068 + var ar=
1069 + a.getBoundingClientRect();
1025 1025  
1026 - var c=
1027 - firstContent(
1028 - card,
1029 - h
1030 - );
1071 + var br=
1072 + b.getBoundingClientRect();
1031 1031  
1032 - if(!h||!c)return null;
1074 + return (
1075 + ar.left-br.left||
1076 + br.width-ar.width
1077 + );
1078 + });
1033 1033  
1034 - var cr=
1035 - card.getBoundingClientRect();
1080 + return pool[0]||link;
1081 + }
1036 1036  
1037 - var rr=
1038 - c.getBoundingClientRect();
1039 -
1040 - return {
1041 - content:c,
1042 - relativeTop:
1043 - rr.top-cr.top
1044 - };
1045 - });
1046 -
1047 - if(
1048 - rows.some(function(row){
1049 - return !row;
1050 - })
1051 - ){
1052 - return false;
1083 + function applyOverviewPalette(){
1084 + if(PAGE_KIND!=="overview"){
1085 + return [];
1053 1053   }
1054 1054  
1055 - var target=
1056 - Math.max.apply(
1057 - Math,
1058 - rows.map(function(row){
1059 - return row.relativeTop;
1088 + var headers=
1089 + smallestThemeHeaders()
1090 + .map(function(el){
1091 + return {
1092 + el:el,
1093 + theme:
1094 + themeFor(
1095 + el.textContent
1096 + ),
1097 + card:
1098 + findOverviewCard(
1099 + el
1100 + )
1101 + };
1060 1060   })
1061 - );
1103 + .filter(function(row){
1104 + return !!row.card;
1105 + });
1062 1062  
1063 - rows.forEach(function(row){
1064 - var delta=
1065 - target-
1066 - row.relativeTop;
1107 + var unique=[];
1108 + var seenHeaders=new Set();
1067 1067  
1068 - if(delta<=1)return;
1110 + headers.forEach(function(row){
1111 + var key=
1112 + row.theme.name+
1113 + "|"+
1114 + Math.round(
1115 + row.card
1116 + .getBoundingClientRect()
1117 + .left
1118 + )+
1119 + "|"+
1120 + Math.round(
1121 + row.el
1122 + .getBoundingClientRect()
1123 + .top
1124 + );
1069 1069  
1070 - saveOriginal(
1071 - row.content,
1072 - originalMarginTop,
1073 - "margin-top"
1074 - );
1126 + if(!seenHeaders.has(key)){
1127 + seenHeaders.add(key);
1128 + unique.push(row);
1129 + }
1130 + });
1075 1075  
1076 - var current=
1077 - num(
1078 - getComputedStyle(
1079 - row.content
1080 - ).marginTop
1081 - );
1132 + unique.forEach(function(row){
1133 + var headerRect=
1134 + row.el
1135 + .getBoundingClientRect();
1082 1082  
1083 - row.content.style.setProperty(
1084 - "margin-top",
1085 - (
1086 - current+
1087 - delta
1088 - )+"px"
1137 + row.el.style.setProperty(
1138 + "background",
1139 + row.theme.bg,
1140 + "important"
1089 1089   );
1090 1090  
1091 - row.content.setAttribute(
1092 - "data-sn-first-content-aligned",
1093 - "7"
1143 + row.el.style.setProperty(
1144 + "color",
1145 + row.theme.text,
1146 + "important"
1094 1094   );
1095 1095  
1096 - contentManaged.add(
1097 - row.content
1149 + row.el.style.setProperty(
1150 + "text-align",
1151 + "left",
1152 + "important"
1098 1098   );
1154 +
1155 + row.el.style.setProperty(
1156 + "word-spacing",
1157 + "normal",
1158 + "important"
1159 + );
1160 +
1161 + var later=
1162 + unique
1163 + .filter(function(other){
1164 + return (
1165 + other.card===row.card&&
1166 + other.el
1167 + .getBoundingClientRect()
1168 + .top>
1169 + headerRect.top+2
1170 + );
1171 + })
1172 + .sort(function(a,b){
1173 + return (
1174 + a.el
1175 + .getBoundingClientRect()
1176 + .top-
1177 + b.el
1178 + .getBoundingClientRect()
1179 + .top
1180 + );
1181 + });
1182 +
1183 + var stopTop=
1184 + later.length
1185 + ?later[0].el
1186 + .getBoundingClientRect()
1187 + .top
1188 + :Infinity;
1189 +
1190 + Array.from(
1191 + row.card.querySelectorAll("a")
1192 + ).forEach(function(link){
1193 + if(!visible(link))return;
1194 +
1195 + var rect=
1196 + link.getBoundingClientRect();
1197 +
1198 + if(
1199 + rect.top<=
1200 + headerRect.bottom-2||
1201 + rect.top>=
1202 + stopTop-2
1203 + ){
1204 + return;
1205 + }
1206 +
1207 + var candidates=
1208 + rowCandidates(
1209 + link,
1210 + row.card
1211 + );
1212 +
1213 + var target=
1214 + chooseOuterRow(
1215 + candidates,
1216 + link
1217 + );
1218 +
1219 + candidates.forEach(function(el){
1220 + el.style.setProperty(
1221 + "border-left",
1222 + "0 solid transparent",
1223 + "important"
1224 + );
1225 + });
1226 +
1227 + target.style.setProperty(
1228 + "border-left",
1229 + "3px solid "+
1230 + row.theme.accent,
1231 + "important"
1232 + );
1233 +
1234 + target.style.setProperty(
1235 + "box-sizing",
1236 + "border-box",
1237 + "important"
1238 + );
1239 + });
1099 1099   });
1100 1100  
1101 - return true;
1242 + return unique;
1102 1102   }
1103 1103  
1104 - function applyRow(group){
1105 - if(!validRow(group))return false;
1245 + /* =======================================================
1246 + OVERVIEW CARD HEIGHT + FIRST THEMATIC ROW
1247 + ======================================================= */
1106 1106  
1249 + function alignOverviewCards(headers){
1250 + if(
1251 + PAGE_KIND!=="overview"||
1252 + window.innerWidth<=MOBILE_MAX
1253 + ){
1254 + return;
1255 + }
1256 +
1107 1107   var cards=[];
1108 1108   var seen=new Set();
1109 1109  
1110 - group.entries.forEach(function(entry){
1111 - if(!seen.has(entry.target)){
1112 - seen.add(entry.target);
1113 - cards.push(entry.target);
1260 + headers.forEach(function(row){
1261 + if(!seen.has(row.card)){
1262 + seen.add(row.card);
1263 + cards.push(row.card);
1114 1114   }
1115 1115   });
1116 1116  
1117 - if(cards.length<2)return false;
1118 -
1119 - if(
1120 - !alignKnownBars(cards)
1121 - ){
1122 - alignGeneric(cards);
1267 + if(cards.length<2){
1268 + return;
1123 1123   }
1124 1124  
1125 - var maxHeight=0;
1271 + // Group cards by actual top position.
1272 + var groups=[];
1126 1126  
1127 1127   cards.forEach(function(card){
1128 - maxHeight=
1129 - Math.max(
1130 - maxHeight,
1131 - card.getBoundingClientRect().height
1132 - );
1275 + var top=
1276 + card.getBoundingClientRect().top;
1277 +
1278 + var group=null;
1279 +
1280 + for(var i=0;i<groups.length;i++){
1281 + if(
1282 + Math.abs(
1283 + groups[i].top-top
1284 + )<=ROW_TOLERANCE
1285 + ){
1286 + group=groups[i];
1287 + break;
1288 + }
1289 + }
1290 +
1291 + if(!group){
1292 + group={
1293 + top:top,
1294 + cards:[]
1295 + };
1296 + groups.push(group);
1297 + }
1298 +
1299 + group.cards.push(card);
1133 1133   });
1134 1134  
1135 - maxHeight=
1136 - Math.ceil(
1137 - maxHeight
1138 - );
1302 + groups.forEach(function(group){
1303 + if(group.cards.length<2){
1304 + return;
1305 + }
1139 1139  
1140 - if(maxHeight<MIN_H)return false;
1307 + var firstHeaders=
1308 + group.cards.map(function(card){
1309 + var candidates=
1310 + headers
1311 + .filter(function(row){
1312 + return row.card===card;
1313 + })
1314 + .sort(function(a,b){
1315 + return (
1316 + a.el
1317 + .getBoundingClientRect()
1318 + .top-
1319 + b.el
1320 + .getBoundingClientRect()
1321 + .top
1322 + );
1323 + });
1141 1141  
1142 - cards.forEach(function(card){
1143 - saveOriginal(
1144 - card,
1145 - originalMinHeight,
1146 - "min-height"
1147 - );
1325 + return candidates.length
1326 + ?candidates[0]
1327 + :null;
1328 + });
1148 1148  
1149 - card.style.setProperty(
1150 - "min-height",
1151 - maxHeight+"px"
1152 - );
1330 + if(
1331 + !firstHeaders.some(function(row){
1332 + return !row;
1333 + })
1334 + ){
1335 + var targetTop=
1336 + Math.max.apply(
1337 + Math,
1338 + firstHeaders.map(function(row){
1339 + return (
1340 + row.el
1341 + .getBoundingClientRect()
1342 + .top-
1343 + row.card
1344 + .getBoundingClientRect()
1345 + .top
1346 + );
1347 + })
1348 + );
1153 1153  
1154 - card.setAttribute(
1155 - "data-sn-equal-height-managed",
1156 - "7"
1157 - );
1350 + firstHeaders.forEach(function(row){
1351 + var relativeTop=
1352 + row.el
1353 + .getBoundingClientRect()
1354 + .top-
1355 + row.card
1356 + .getBoundingClientRect()
1357 + .top;
1158 1158  
1159 - heightManaged.add(card);
1160 - });
1359 + var delta=
1360 + targetTop-relativeTop;
1161 1161  
1162 - return true;
1163 - }
1362 + if(delta>1){
1363 + saveStyle(
1364 + row.el,
1365 + originalMargin,
1366 + "margin-top"
1367 + );
1164 1164  
1165 - function calculate(force){
1166 - if(applying)return;
1369 + var current=
1370 + num(
1371 + getComputedStyle(
1372 + row.el
1373 + ).marginTop
1374 + );
1167 1167  
1168 - var width=
1169 - Math.round(
1170 - window.innerWidth
1171 - );
1376 + row.el.style.setProperty(
1377 + "margin-top",
1378 + (
1379 + current+delta
1380 + )+"px"
1381 + );
1172 1172  
1173 - var meaningful=
1174 - lastWidth<0||
1175 - Math.abs(
1176 - width-
1177 - lastWidth
1178 - )>=
1179 - MIN_WIDTH_CHANGE;
1383 + row.el.setAttribute(
1384 + "data-sn-master-first-row",
1385 + "1"
1386 + );
1180 1180  
1388 + managedMargin.add(
1389 + row.el
1390 + );
1391 + }
1392 + });
1393 + }
1394 +
1395 + var maxHeight=0;
1396 +
1397 + group.cards.forEach(function(card){
1398 + maxHeight=
1399 + Math.max(
1400 + maxHeight,
1401 + card
1402 + .getBoundingClientRect()
1403 + .height
1404 + );
1405 + });
1406 +
1407 + maxHeight=
1408 + Math.ceil(maxHeight);
1409 +
1410 + group.cards.forEach(function(card){
1411 + saveStyle(
1412 + card,
1413 + originalHeight,
1414 + "min-height"
1415 + );
1416 +
1417 + card.style.setProperty(
1418 + "min-height",
1419 + maxHeight+"px"
1420 + );
1421 +
1422 + card.setAttribute(
1423 + "data-sn-master-equal-height",
1424 + "1"
1425 + );
1426 +
1427 + managedHeight.add(
1428 + card
1429 + );
1430 + });
1431 + });
1432 + }
1433 +
1434 + /* =======================================================
1435 + DETAIL GRID EQUAL HEIGHT, DESKTOP ONLY
1436 + ======================================================= */
1437 +
1438 + function equaliseDetailGrids(){
1181 1181   if(
1182 - hasApplied&&
1183 - !force&&
1184 - !meaningful
1440 + PAGE_KIND!=="detail"||
1441 + window.innerWidth<=MOBILE_MAX
1185 1185   ){
1186 1186   return;
1187 1187   }
1188 1188  
1189 - applying=true;
1446 + var selectors=[
1447 + ".arsn-grid",
1448 + ".arsn-grid-2",
1449 + ".arsn-grid-3",
1450 + ".dmp-grid",
1451 + ".ido-grid",
1452 + ".pp-grid"
1453 + ];
1190 1190  
1191 - try{
1192 - harmoniseCustomCallouts();
1455 + selectors.forEach(function(selector){
1456 + Array.from(
1457 + root.querySelectorAll(selector)
1458 + ).forEach(function(grid){
1459 + var children=
1460 + Array.from(
1461 + grid.children||[]
1462 + ).filter(visible);
1193 1193  
1194 - if(width<=MOBILE_MAX){
1195 - if(hasApplied){
1196 - resetRuntime();
1464 + if(children.length<2){
1465 + return;
1197 1197   }
1198 1198  
1199 - hasApplied=false;
1200 - lastWidth=width;
1201 - return;
1202 - }
1468 + var groups=[];
1203 1203  
1204 - if(hasApplied){
1205 - resetRuntime();
1206 - }
1470 + children.forEach(function(child){
1471 + var top=
1472 + child
1473 + .getBoundingClientRect()
1474 + .top;
1207 1207  
1208 - var parents=
1209 - Array.from(
1210 - root.querySelectorAll("*")
1211 - )
1212 - .filter(function(parent){
1213 - return (
1214 - visible(
1215 - parent,
1216 - MIN_W,
1217 - MIN_H
1218 - )&&
1219 - parent.children&&
1220 - parent.children.length>=2&&
1221 - parent.children.length<=
1222 - MAX_PARENT_CHILDREN
1223 - );
1224 - });
1476 + var group=null;
1225 1225  
1226 - var touched=
1227 - new Set();
1478 + for(var i=0;i<groups.length;i++){
1479 + if(
1480 + Math.abs(
1481 + groups[i].top-top
1482 + )<=ROW_TOLERANCE
1483 + ){
1484 + group=groups[i];
1485 + break;
1486 + }
1487 + }
1228 1228  
1229 - parents.forEach(function(parent){
1230 - var entries=[];
1489 + if(!group){
1490 + group={
1491 + top:top,
1492 + items:[]
1493 + };
1494 + groups.push(group);
1495 + }
1231 1231  
1232 - Array.from(
1233 - parent.children
1234 - ).forEach(function(child){
1235 - if(
1236 - !visible(
1237 - child,
1238 - MIN_W,
1239 - MIN_H
1240 - )
1241 - ){
1497 + group.items.push(child);
1498 + });
1499 +
1500 + groups.forEach(function(group){
1501 + if(group.items.length<2){
1242 1242   return;
1243 1243   }
1244 1244  
1245 - var target=
1246 - pickTarget(child);
1505 + var maxHeight=0;
1247 1247  
1248 - if(!target)return;
1249 -
1250 - entries.push({
1251 - target:target,
1252 - rect:
1253 - target.getBoundingClientRect()
1507 + group.items.forEach(function(item){
1508 + maxHeight=
1509 + Math.max(
1510 + maxHeight,
1511 + item
1512 + .getBoundingClientRect()
1513 + .height
1514 + );
1254 1254   });
1255 - });
1256 1256  
1257 - groupRows(
1258 - entries
1259 - ).forEach(function(group){
1260 - if(!validRow(group))return;
1517 + maxHeight=
1518 + Math.ceil(maxHeight);
1261 1261  
1262 - var targets=
1263 - group.entries.map(function(entry){
1264 - return entry.target;
1265 - });
1520 + group.items.forEach(function(item){
1521 + saveStyle(
1522 + item,
1523 + originalHeight,
1524 + "min-height"
1525 + );
1266 1266  
1267 - if(
1268 - !targets.some(function(el){
1269 - return !touched.has(el);
1270 - })
1271 - ){
1272 - return;
1273 - }
1527 + item.style.setProperty(
1528 + "min-height",
1529 + maxHeight+"px"
1530 + );
1274 1274  
1275 - if(applyRow(group)){
1276 - targets.forEach(function(el){
1277 - touched.add(el);
1278 - });
1279 - }
1532 + item.setAttribute(
1533 + "data-sn-master-equal-height",
1534 + "1"
1535 + );
1536 +
1537 + managedHeight.add(item);
1538 + });
1280 1280   });
1281 1281   });
1541 + });
1542 + }
1282 1282  
1283 - lastWidth=width;
1284 - hasApplied=true;
1544 + /* =======================================================
1545 + RUN / RESPONSIVE SCHEDULING
1546 + ======================================================= */
1547 +
1548 + function run(){
1549 + if(running)return;
1550 +
1551 + running=true;
1552 +
1553 + try{
1554 + resetRuntime();
1555 + applyPlaceholderBadge();
1556 + propagateDetailAccents();
1557 +
1558 + var headers=
1559 + applyOverviewPalette();
1560 +
1561 + makeThreeLineAreaLabels();
1562 + makeFilledRedOrangeCTAsBorderless();
1563 +
1564 + if(
1565 + window.innerWidth>
1566 + MOBILE_MAX
1567 + ){
1568 + alignOverviewCards(
1569 + headers
1570 + );
1571 +
1572 + equaliseDetailGrids();
1573 + }
1285 1285   }finally{
1286 - applying=false;
1575 + running=false;
1287 1287   }
1288 1288   }
1289 1289  
1290 - function resize(){
1579 + function onResize(){
1291 1291   if(resizeTimer){
1292 1292   clearTimeout(
1293 1293   resizeTimer
... ... @@ -1298,19 +1298,40 @@
1298 1298   setTimeout(
1299 1299   function(){
1300 1300   resizeTimer=0;
1301 - calculate(false);
1590 + run();
1302 1302   },
1303 1303   RESIZE_DEBOUNCE
1304 1304   );
1305 1305   }
1306 1306  
1307 - function waitImages(){
1596 + async function waitForReady(){
1597 + if(
1598 + document.readyState!=="complete"
1599 + ){
1600 + await new Promise(function(resolve){
1601 + window.addEventListener(
1602 + "load",
1603 + resolve,
1604 + {once:true}
1605 + );
1606 + });
1607 + }
1608 +
1609 + if(
1610 + document.fonts&&
1611 + document.fonts.ready
1612 + ){
1613 + try{
1614 + await document.fonts.ready;
1615 + }catch(error){}
1616 + }
1617 +
1308 1308   var images=
1309 1309   Array.from(
1310 1310   root.querySelectorAll("img")
1311 1311   );
1312 1312  
1313 - return Promise.all(
1623 + await Promise.all(
1314 1314   images.map(function(img){
1315 1315   if(img.complete){
1316 1316   return Promise.resolve();
... ... @@ -1335,46 +1335,20 @@
1335 1335   });
1336 1336   })
1337 1337   );
1338 - }
1339 1339  
1340 - async function initial(){
1341 - if(
1342 - document.readyState!==
1343 - "complete"
1344 - ){
1345 - await new Promise(function(resolve){
1346 - addEventListener(
1347 - "load",
1348 - resolve,
1349 - {once:true}
1350 - );
1351 - });
1352 - }
1353 -
1354 - if(
1355 - document.fonts&&
1356 - document.fonts.ready
1357 - ){
1358 - try{
1359 - await document.fonts.ready;
1360 - }catch(error){}
1361 - }
1362 -
1363 - await waitImages();
1364 -
1365 - // Exactly one initial layout calculation.
1366 - calculate(true);
1649 + run();
1367 1367   }
1368 1368  
1369 - addEventListener(
1652 + window.addEventListener(
1370 1370   "resize",
1371 - resize,
1654 + onResize,
1372 1372   {passive:true}
1373 1373   );
1374 1374  
1375 - initial();
1658 + waitForReady();
1376 1376  })();
1377 1377  </script>
1378 1378  
1379 -<!-- SN_HORIZONTAL_BOX_HARMONIZER_END -->
1380 -{{/html}}\n
1662 +<!-- SN_SERVICE_NAVIGATOR_MASTER_STYLE_END -->
1663 +{{/html}}
1664 +