Changes for page Get Started

Last modified by Veronika Kocher on Friday, 04 Sep 2026 15:32

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

Summary

Details

Page properties
Content
... ... @@ -42,7 +42,7 @@
42 42   <section class="arsn-card" style="margin-bottom:18px;overflow:hidden;border-left:6px solid #e94b13;">
43 43   <div class="arsn-hero-image"><img src="https://xwiki.uni-ak.ac.at/bin/download/Service%20Navigator/Art%20%26%20Research%20Services%20Navigator/WebHome/enable.png" alt="Planning an artistic or research project" /></div>
44 44   <div style="padding:18px 21px 20px 21px;">
45 - <div class="arsn-eyebrow" style="color:#8a4d36;margin-bottom:5px;">PREPARE · GET STARTED · AUSTRIA</div>
45 + <div class="arsn-eyebrow" style="color:#8a4d36;margin-bottom:5px;">ENABLE · GET STARTED · AUSTRIA</div>
46 46   <h2 style="font-size:27px;line-height:1.2;margin:0 0 8px 0;color:#2c2926;">From project idea to a fundable, workable project</h2>
47 47   <p style="margin:0;color:#5e5953;line-height:1.6;max-width:1100px;">
48 48   Use this page to clarify your project before you search for funding or start spending money.
... ... @@ -435,13 +435,12 @@
435 435  </div>
436 436  {{/html}}
437 437  
438 -{{html clean="false"}}
439 -<!-- SN_SERVICE_NAVIGATOR_MASTER_STYLE_START -->
438 +\n\n
439 +\n\n{{html clean="false"}}
440 +<!-- SN_HORIZONTAL_BOX_HARMONIZER_START -->
440 440  
441 -<style data-sn-service-navigator-master="1">
442 -/* =========================================================
443 - MASTER TYPOGRAPHY
444 - ========================================================= */
442 +<style data-sn-horizontal-box-harmonizer="7">
443 +/* ---------- Typography: never justify headings ---------- */
445 445  #xwikicontent h1,
446 446  #xwikicontent h2,
447 447  #xwikicontent h3,
... ... @@ -463,105 +463,88 @@
463 463   word-spacing:normal!important;
464 464  }
465 465  
466 -/* =========================================================
467 - COMING SOON / IN VORBEREITUNG
468 - ========================================================= */
469 -.sn-coming-soon-badge{
470 - display:inline-block;
471 - vertical-align:middle;
472 - margin-left:10px;
473 - padding:4px 8px;
474 - border-radius:14px;
475 - border:1px solid #efd9cc;
476 - background:#fff4ee;
477 - color:#8a4d36;
478 - font-size:11px;
479 - font-weight:700;
480 - letter-spacing:.055em;
481 - line-height:1.2;
482 - white-space:nowrap;
483 -}
484 -
485 -/* =========================================================
486 - NATIVE / DETAIL CALLOUT GEOMETRY
487 - Preserve existing backgrounds.
488 - ========================================================= */
489 -#xwikicontent .arsn-info,
490 -#xwikicontent .dmp-info,
491 -#xwikicontent .ido-info,
492 -#xwikicontent .pp-info,
493 -#xwikicontent .infomessage{
465 +/* ---------- Native XWiki semantic callouts ---------- */
466 +#xwikicontent .box.infomessage,
467 +#xwikicontent .infomessage,
468 +#xwikicontent .box.warningmessage,
469 +#xwikicontent .warningmessage,
470 +#xwikicontent .box.successmessage,
471 +#xwikicontent .successmessage,
472 +#xwikicontent .box.errormessage,
473 +#xwikicontent .errormessage,
474 +#xwikicontent [data-sn-callout-harmonized="1"]{
494 494   box-sizing:border-box!important;
495 - border-left:4px solid #21b6d7!important;
496 - border-radius:8px;
476 + border-radius:8px!important;
477 + border-top:1px solid rgba(0,0,0,.08)!important;
478 + border-right:1px solid rgba(0,0,0,.08)!important;
479 + border-bottom:1px solid rgba(0,0,0,.08)!important;
480 + border-left:4px solid var(--sn-callout-accent,#21b6d7)!important;
481 + padding:14px 16px!important;
497 497   text-align:left!important;
483 + text-justify:auto!important;
498 498   word-spacing:normal!important;
485 + box-shadow:none!important;
499 499  }
500 500  
501 -#xwikicontent .arsn-warn,
502 -#xwikicontent .dmp-warn,
503 -#xwikicontent .ido-warn,
504 -#xwikicontent .pp-warn,
505 -#xwikicontent .warn,
506 -#xwikicontent .warning,
507 -#xwikicontent .warningmessage,
488 +#xwikicontent .box.infomessage,
489 +#xwikicontent .infomessage{
490 + --sn-callout-accent:#21b6d7;
491 + background:#eaf7fb!important;
492 +}
493 +
494 +#xwikicontent .box.warningmessage,
495 +#xwikicontent .warningmessage{
496 + --sn-callout-accent:#f0aa00;
497 + background:#fff8e7!important;
498 +}
499 +
500 +#xwikicontent .box.successmessage,
501 +#xwikicontent .successmessage{
502 + --sn-callout-accent:#38b76a;
503 + background:#edf9f1!important;
504 +}
505 +
506 +#xwikicontent .box.errormessage,
508 508  #xwikicontent .errormessage{
509 - box-sizing:border-box!important;
510 - border-left:4px solid #e94b13!important;
511 - border-radius:8px;
512 - text-align:left!important;
513 - word-spacing:normal!important;
508 + --sn-callout-accent:#e94b13;
509 + background:#fff1ec!important;
514 514  }
515 515  
516 -[data-sn-master-equal-height],
517 -[data-sn-master-first-row]{
518 - box-sizing:border-box;
512 +#xwikicontent [data-sn-callout-harmonized="1"] > :first-child,
513 +#xwikicontent .infomessage > :first-child,
514 +#xwikicontent .warningmessage > :first-child,
515 +#xwikicontent .successmessage > :first-child,
516 +#xwikicontent .errormessage > :first-child{
517 + margin-top:0!important;
519 519  }
520 520  
521 -/* =========================================================
522 - FULL-WIDTH THREE-LINE NUMBER / TITLE / SUBTITLE BLOCKS
523 - ========================================================= */
524 -#xwikicontent .arsn-area-label[data-sn-three-line="1"]{
525 - display:grid!important;
526 - grid-template-columns:minmax(0,1fr)!important;
527 - grid-auto-rows:auto!important;
528 - width:100%!important;
529 - max-width:none!important;
530 - box-sizing:border-box!important;
531 - justify-items:start!important;
532 - align-items:start!important;
533 - gap:2px!important;
534 - text-align:left!important;
535 - text-align-last:left!important;
536 - text-justify:auto!important;
537 - word-spacing:normal!important;
538 - white-space:normal!important;
520 +#xwikicontent [data-sn-callout-harmonized="1"] > :last-child,
521 +#xwikicontent .infomessage > :last-child,
522 +#xwikicontent .warningmessage > :last-child,
523 +#xwikicontent .successmessage > :last-child,
524 +#xwikicontent .errormessage > :last-child{
525 + margin-bottom:0!important;
539 539  }
540 -#xwikicontent .arsn-area-label[data-sn-three-line="1"] > .arsn-area-number,
541 -#xwikicontent .arsn-area-label[data-sn-three-line="1"] > .sn-area-label-title,
542 -#xwikicontent .arsn-area-label[data-sn-three-line="1"] > .arsn-area-action{
543 - display:block!important;
544 - width:100%!important;
545 - margin:0!important;
546 - text-align:left!important;
547 - text-align-last:left!important;
548 - text-justify:auto!important;
549 - word-spacing:normal!important;
550 - white-space:normal!important;
527 +
528 +#xwikicontent [data-sn-equal-height-managed],
529 +#xwikicontent [data-sn-first-section-aligned],
530 +#xwikicontent [data-sn-first-content-aligned]{
531 + box-sizing:border-box;
551 551  }
552 552  </style>
553 553  
554 -<script data-sn-service-navigator-master="1">
535 +<script data-sn-horizontal-box-harmonizer="7">
555 555  (function(){
556 556   "use strict";
557 557  
558 - var PAGE_KIND="detail";
559 - var PLACEHOLDER=false;
560 - var PLACEHOLDER_LABEL="COMING SOON";
561 -
562 562   var MOBILE_MAX=767;
563 563   var ROW_TOLERANCE=6;
541 + var MIN_W=150;
542 + var MIN_H=36;
543 + var MAX_PARENT_CHILDREN=18;
544 + var SEARCH_DEPTH=5;
564 564   var RESIZE_DEBOUNCE=220;
546 + var MIN_WIDTH_CHANGE=2;
565 565  
566 566   var root=
567 567   document.getElementById("xwikicontent")||
... ... @@ -571,114 +571,142 @@
571 571  
572 572   if(!root)return;
573 573  
574 - var managedHeight=new Set();
575 - var managedMargin=new Set();
576 - var originalHeight=new WeakMap();
577 - var originalMargin=new WeakMap();
556 + var heightManaged=new Set();
557 + var sectionManaged=new Set();
558 + var contentManaged=new Set();
578 578  
560 + var originalMinHeight=new WeakMap();
561 + var originalMarginTop=new WeakMap();
562 +
579 579   var resizeTimer=0;
580 - var running=false;
564 + var lastWidth=-1;
565 + var hasApplied=false;
566 + var applying=false;
581 581  
582 - var THEMES=[
583 - {
584 - name:"BLUE",
585 - accent:"#21b6d7",
586 - bg:"#eaf7fb",
587 - text:"#315d68",
588 - labels:[
589 - "HIER STARTEN",
590 - "ENTSCHEIDEN",
591 - "ÜBERPRÜFEN & ANPASSEN",
592 - "START HERE",
593 - "DECIDE",
594 - "REVIEW & ADAPT"
595 - ]
596 - },
597 - {
598 - name:"RED",
599 - accent:"#e94b13",
600 - bg:"#fff1ec",
601 - text:"#8a4d36",
602 - labels:[
603 - "PLANEN & ORGANISIEREN",
604 - "ORGANISIEREN & DOKUMENTIEREN",
605 - "PUBLIZIEREN & PRÄSENTIEREN",
606 - "PLAN & ORGANISE",
607 - "PLAN & ORGANIZE",
608 - "ORGANISE & DOCUMENT",
609 - "ORGANIZE & DOCUMENT",
610 - "PUBLISH & PRESENT"
611 - ]
612 - },
613 - {
614 - name:"YELLOW",
615 - accent:"#f0aa00",
616 - bg:"#fff8e7",
617 - text:"#785b17",
618 - labels:[
619 - "SCHÜTZEN & KLÄREN",
620 - "STANDARDISIEREN & IDENTIFIZIEREN",
621 - "ÖFFNEN, NACHNUTZEN & AUFFINDBAR MACHEN",
622 - "PROTECT & CLARIFY",
623 - "STANDARDISE & IDENTIFY",
624 - "STANDARDIZE & IDENTIFY",
625 - "OPEN, REUSE & MAKE FINDABLE"
626 - ]
627 - },
628 - {
629 - name:"GREEN",
630 - accent:"#38b76a",
631 - bg:"#edf9f1",
632 - text:"#3f7451",
633 - labels:[
634 - "INFRASTRUKTUR EINRICHTEN",
635 - "INFRASTRUKTUR & ZUSAMMENARBEIT EINRICHTEN",
636 - "SPEICHERN & ZUGRIFF STEUERN",
637 - "REPOSITORIUM, ERHALTEN & ÜBERGEBEN",
638 - "SET UP INFRASTRUCTURE",
639 - "SET UP INFRASTRUCTURE & COLLABORATION",
640 - "STORE & CONTROL ACCESS",
641 - "REPOSITORY, PRESERVE & HAND OVER"
642 - ]
568 + function num(v){
569 + var n=parseFloat(v);
570 + return Number.isFinite(n)?n:0;
571 + }
572 +
573 + function visible(el,minW,minH){
574 + if(!el||el.nodeType!==1)return false;
575 +
576 + var s=getComputedStyle(el);
577 +
578 + if(
579 + s.display==="none"||
580 + s.visibility==="hidden"||
581 + Number(s.opacity)===0
582 + ){
583 + return false;
643 643   }
644 - ];
645 645  
646 - function num(value){
647 - var n=parseFloat(value);
648 - return Number.isFinite(n)?n:0;
586 + var r=el.getBoundingClientRect();
587 +
588 + return (
589 + r.width>=(minW||1)&&
590 + r.height>=(minH||1)
591 + );
649 649   }
650 650  
651 - function norm(value){
652 - return String(value||"")
594 + function normalizeText(text){
595 + return String(text||"")
653 653   .replace(/\s+/g," ")
654 654   .trim()
655 655   .toUpperCase();
656 656   }
657 657  
658 - function visible(el){
659 - if(!el||el.nodeType!==1)return false;
601 + function excluded(el){
602 + return (
603 + !el.matches||
604 + el.matches(
605 + "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]"
606 + )
607 + );
608 + }
660 660  
661 - var style=getComputedStyle(el);
662 - var rect=el.getBoundingClientRect();
610 + /* ---------- Custom coloured callouts ---------- */
663 663  
612 + function nativeCallout(el){
613 + var c=
614 + typeof el.className==="string"
615 + ? el.className.toLowerCase()
616 + : "";
617 +
664 664   return (
665 - style.display!=="none"&&
666 - style.visibility!=="hidden"&&
667 - rect.width>20&&
668 - rect.height>4
619 + /(^|\s)(infomessage|warningmessage|successmessage|errormessage)(\s|$)/.test(c)
669 669   );
670 670   }
671 671  
672 - function saveStyle(el,map,property){
623 + function customCallout(el){
624 + if(!visible(el,220,42)||excluded(el))return false;
625 +
626 + var r=el.getBoundingClientRect();
627 +
628 + if(r.height>520)return false;
629 +
630 + var s=getComputedStyle(el);
631 +
632 + var bg=
633 + s.backgroundColor&&
634 + s.backgroundColor!=="rgba(0, 0, 0, 0)"&&
635 + s.backgroundColor!=="transparent"&&
636 + s.backgroundColor!=="rgb(255, 255, 255)";
637 +
638 + var left=
639 + num(s.borderLeftWidth);
640 +
641 + return (
642 + bg&&
643 + left>=2
644 + );
645 + }
646 +
647 + function harmoniseCustomCallouts(){
648 + Array.from(
649 + root.querySelectorAll(
650 + "div,aside,section"
651 + )
652 + ).forEach(function(el){
653 + if(nativeCallout(el))return;
654 + if(!customCallout(el))return;
655 +
656 + var s=getComputedStyle(el);
657 +
658 + el.setAttribute(
659 + "data-sn-callout-harmonized",
660 + "1"
661 + );
662 +
663 + if(
664 + s.borderLeftColor
665 + ){
666 + el.style.setProperty(
667 + "--sn-callout-accent",
668 + s.borderLeftColor
669 + );
670 + }
671 + });
672 + }
673 +
674 + /* ---------- Restore only values V7 itself changed ---------- */
675 +
676 + function saveOriginal(el,map,property){
673 673   if(map.has(el))return;
674 674  
675 675   map.set(el,{
676 - value:el.style.getPropertyValue(property),
677 - priority:el.style.getPropertyPriority(property)
680 + value:
681 + el.style.getPropertyValue(
682 + property
683 + ),
684 + priority:
685 + el.style.getPropertyPriority(
686 + property
687 + )
678 678   });
679 679   }
680 680  
681 - function restoreStyle(el,map,property){
691 + function restoreOriginal(el,map,property){
682 682   var original=map.get(el);
683 683  
684 684   if(original&&original.value){
... ... @@ -688,1069 +688,770 @@
688 688   original.priority||""
689 689   );
690 690   }else{
691 - el.style.removeProperty(property);
701 + el.style.removeProperty(
702 + property
703 + );
692 692   }
693 693   }
694 694  
695 695   function resetRuntime(){
696 - managedHeight.forEach(function(el){
697 - restoreStyle(
708 + heightManaged.forEach(function(el){
709 + restoreOriginal(
698 698   el,
699 - originalHeight,
711 + originalMinHeight,
700 700   "min-height"
701 701   );
714 +
702 702   el.removeAttribute(
703 - "data-sn-master-equal-height"
716 + "data-sn-equal-height-managed"
704 704   );
705 705   });
706 706  
707 - managedMargin.forEach(function(el){
708 - restoreStyle(
720 + sectionManaged.forEach(function(el){
721 + restoreOriginal(
709 709   el,
710 - originalMargin,
723 + originalMarginTop,
711 711   "margin-top"
712 712   );
726 +
713 713   el.removeAttribute(
714 - "data-sn-master-first-row"
728 + "data-sn-first-section-aligned"
715 715   );
716 716   });
717 717  
718 - managedHeight.clear();
719 - managedMargin.clear();
720 - }
732 + contentManaged.forEach(function(el){
733 + restoreOriginal(
734 + el,
735 + originalMarginTop,
736 + "margin-top"
737 + );
721 721  
722 - function themeFor(text){
723 - var value=norm(text);
739 + el.removeAttribute(
740 + "data-sn-first-content-aligned"
741 + );
742 + });
724 724  
725 - for(var i=0;i<THEMES.length;i++){
726 - for(var j=0;j<THEMES[i].labels.length;j++){
727 - var label=THEMES[i].labels[j];
728 -
729 - if(
730 - value===label||
731 - value.indexOf(label+" ")===0||
732 - value.indexOf(label+" -")===0||
733 - value.indexOf(label+" ·")===0
734 - ){
735 - return THEMES[i];
736 - }
737 - }
738 - }
739 -
740 - return null;
744 + heightManaged.clear();
745 + sectionManaged.clear();
746 + contentManaged.clear();
741 741   }
742 742  
743 - /* =======================================================
744 - BORDERLESS FILLED RED/ORANGE CTA BUTTONS
745 - ======================================================= */
749 + /* ---------- Card detection ---------- */
746 746  
747 - function colourDistance(a,b){
748 - return Math.sqrt(
749 - Math.pow(a[0]-b[0],2)+
750 - Math.pow(a[1]-b[1],2)+
751 - Math.pow(a[2]-b[2],2)
752 - );
751 + function namedLikeBox(el){
752 + var c=
753 + typeof el.className==="string"
754 + ? el.className
755 + : "";
756 +
757 + return /(^|[\s_-])(box|card|tile|panel|role|check|service|source|call|area|detail|resource|topic|warn|info)([\s_-]|$)/i.test(c);
753 753   }
754 754  
755 - function makeFilledRedOrangeCTAsBorderless(){
756 - var RED_ORANGE=[233,75,19];
760 + function boxLike(el){
761 + if(
762 + !visible(el,MIN_W,MIN_H)||
763 + excluded(el)
764 + ){
765 + return false;
766 + }
757 757  
758 - Array.from(
759 - root.querySelectorAll(
760 - 'a,button,[role="button"],input[type="submit"],input[type="button"]'
761 - )
762 - ).forEach(function(el){
763 - if(!visible(el))return;
768 + var s=getComputedStyle(el);
769 + var r=el.getBoundingClientRect();
764 764  
765 - var style=getComputedStyle(el);
766 - var rgb=parseRGB(style.backgroundColor);
771 + var border=
772 + num(s.borderTopWidth)+
773 + num(s.borderRightWidth)+
774 + num(s.borderBottomWidth)+
775 + num(s.borderLeftWidth);
767 767  
768 - if(!rgb)return;
777 + var radius=Math.max(
778 + num(s.borderTopLeftRadius),
779 + num(s.borderTopRightRadius),
780 + num(s.borderBottomLeftRadius),
781 + num(s.borderBottomRightRadius)
782 + );
769 769  
770 - if(
771 - colourDistance(
772 - rgb,
773 - RED_ORANGE
774 - )>55
775 - ){
776 - return;
777 - }
784 + var bg=
785 + s.backgroundColor&&
786 + s.backgroundColor!=="rgba(0, 0, 0, 0)"&&
787 + s.backgroundColor!=="transparent";
778 778  
779 - var rect=el.getBoundingClientRect();
789 + var shadow=
790 + s.boxShadow&&
791 + s.boxShadow!=="none";
780 780  
781 - if(
782 - rect.width<80||
783 - rect.height<24
784 - ){
785 - return;
786 - }
793 + return (
794 + namedLikeBox(el)||
795 + border>=1||
796 + (bg&&radius>=3)||
797 + (shadow&&r.width>=180)
798 + );
799 + }
787 787  
788 - el.style.setProperty(
789 - "border",
790 - "none",
791 - "important"
792 - );
801 + function pickTarget(child){
802 + if(!visible(child,MIN_W,MIN_H))return null;
793 793  
794 - el.style.setProperty(
795 - "border-left",
796 - "none",
797 - "important"
798 - );
804 + if(boxLike(child))return child;
799 799  
800 - el.style.setProperty(
801 - "border-top",
802 - "none",
803 - "important"
804 - );
806 + var cr=child.getBoundingClientRect();
807 + var q=[];
805 805  
806 - el.style.setProperty(
807 - "border-right",
808 - "none",
809 - "important"
810 - );
811 -
812 - el.style.setProperty(
813 - "border-bottom",
814 - "none",
815 - "important"
816 - );
817 -
818 - el.style.setProperty(
819 - "box-shadow",
820 - "none",
821 - "important"
822 - );
809 + Array.from(child.children||[]).forEach(function(el){
810 + q.push({el:el,depth:1});
823 823   });
824 - }
825 825  
826 - /* =======================================================
827 - FULL-WIDTH THREE-LINE AREA LABELS
828 - ======================================================= */
813 + var best=null;
814 + var bestScore=-Infinity;
829 829  
830 - function compactText(value){
831 - return String(value||"")
832 - .replace(/\s+/g," ")
833 - .trim();
834 - }
816 + while(q.length){
817 + var item=q.shift();
818 + var el=item.el;
835 835  
836 - function makeThreeLineAreaLabels(){
837 - Array.from(
838 - root.querySelectorAll(
839 - ".arsn-area-label"
840 - )
841 - ).forEach(function(label){
842 - if(
843 - label.getAttribute(
844 - "data-sn-three-line"
845 - )==="1"
846 - ){
847 - return;
848 - }
820 + if(!visible(el,MIN_W,MIN_H))continue;
849 849  
850 - var number=
851 - label.querySelector(
852 - ":scope > .arsn-area-number"
853 - );
822 + var r=el.getBoundingClientRect();
854 854  
855 - var action=
856 - label.querySelector(
857 - ":scope > .arsn-area-action"
858 - );
859 -
860 860   if(
861 - !number||
862 - !action
825 + r.width>=cr.width*.68&&
826 + boxLike(el)
863 863   ){
864 - return;
865 - }
828 + var widthFit=
829 + 1-Math.min(
830 + 1,
831 + Math.abs(cr.width-r.width)/
832 + Math.max(1,cr.width)
833 + );
866 866  
867 - var clone=
868 - label.cloneNode(true);
835 + var topFit=
836 + 1-Math.min(
837 + 1,
838 + Math.abs(cr.top-r.top)/100
839 + );
869 869  
870 - var cloneNumber=
871 - clone.querySelector(
872 - ":scope > .arsn-area-number"
873 - );
841 + var score=
842 + widthFit*6+
843 + topFit*3+
844 + Math.min(r.height,900)/450+
845 + Math.min(r.width*r.height,900000)/900000;
874 874  
875 - var cloneAction=
876 - clone.querySelector(
877 - ":scope > .arsn-area-action"
878 - );
879 -
880 - if(cloneNumber){
881 - cloneNumber.remove();
847 + if(score>bestScore){
848 + best=el;
849 + bestScore=score;
850 + }
882 882   }
883 883  
884 - if(cloneAction){
885 - cloneAction.remove();
853 + if(item.depth<SEARCH_DEPTH){
854 + Array.from(el.children||[]).forEach(function(next){
855 + q.push({
856 + el:next,
857 + depth:item.depth+1
858 + });
859 + });
886 886   }
861 + }
887 887  
888 - var titleText=
889 - compactText(
890 - clone.textContent
891 - );
863 + return best;
864 + }
892 892  
893 - if(!titleText){
894 - return;
895 - }
866 + function groupRows(entries){
867 + var groups=[];
896 896  
897 - var numberNode=
898 - number.cloneNode(true);
899 -
900 - var actionNode=
901 - action.cloneNode(true);
902 -
903 - var titleNode=
904 - document.createElement(
905 - "span"
869 + entries
870 + .slice()
871 + .sort(function(a,b){
872 + return (
873 + a.rect.top-b.rect.top||
874 + a.rect.left-b.rect.left
906 906   );
876 + })
877 + .forEach(function(entry){
878 + var group=null;
907 907  
908 - titleNode.className=
909 - "sn-area-label-title";
880 + for(var i=0;i<groups.length;i++){
881 + if(
882 + Math.abs(
883 + groups[i].top-
884 + entry.rect.top
885 + )<=ROW_TOLERANCE
886 + ){
887 + group=groups[i];
888 + break;
889 + }
890 + }
910 910  
911 - titleNode.textContent=
912 - titleText;
892 + if(!group){
893 + group={
894 + top:entry.rect.top,
895 + entries:[]
896 + };
897 + groups.push(group);
898 + }
913 913  
914 - while(label.firstChild){
915 - label.removeChild(
916 - label.firstChild
917 - );
918 - }
900 + group.entries.push(entry);
901 + });
919 919  
920 - label.appendChild(
921 - numberNode
922 - );
923 -
924 - label.appendChild(
925 - titleNode
926 - );
927 -
928 - label.appendChild(
929 - actionNode
930 - );
931 -
932 - label.setAttribute(
933 - "data-sn-three-line",
934 - "1"
935 - );
936 -
937 - var head=
938 - label.closest(
939 - ".arsn-area-head"
940 - );
941 -
942 - if(head){
943 - head.style.setProperty(
944 - "width",
945 - "100%",
946 - "important"
947 - );
948 -
949 - head.style.setProperty(
950 - "max-width",
951 - "100%",
952 - "important"
953 - );
954 -
955 - head.style.setProperty(
956 - "box-sizing",
957 - "border-box",
958 - "important"
959 - );
960 - }
961 - });
903 + return groups;
962 962   }
963 963  
964 - /* =======================================================
965 - PLACEHOLDER BADGE
966 - ======================================================= */
906 + function validRow(group){
907 + if(group.entries.length<2)return false;
967 967  
968 - function applyPlaceholderBadge(){
969 - if(!PLACEHOLDER)return;
909 + var lefts=
910 + group.entries
911 + .map(function(e){return e.rect.left;})
912 + .sort(function(a,b){return a-b;});
970 970  
971 971   if(
972 - document.querySelector(
973 - ".sn-coming-soon-badge"
974 - )
915 + lefts[lefts.length-1]-
916 + lefts[0]<
917 + 80
975 975   ){
976 - return;
919 + return false;
977 977   }
978 978  
979 - var title=
980 - document.querySelector(
981 - "#document-title"
982 - )||
983 - document.querySelector(
984 - "h1"
985 - );
922 + var widths=
923 + group.entries
924 + .map(function(e){return e.rect.width;})
925 + .filter(function(w){return w>0;});
986 986  
987 - if(!title)return;
927 + if(widths.length<2)return false;
988 988  
989 - var badge=
990 - document.createElement(
991 - "span"
992 - );
929 + var minW=
930 + Math.min.apply(Math,widths);
993 993  
994 - badge.className=
995 - "sn-coming-soon-badge";
932 + var maxW=
933 + Math.max.apply(Math,widths);
996 996  
997 - badge.textContent=
998 - PLACEHOLDER_LABEL;
999 -
1000 - badge.setAttribute(
1001 - "aria-label",
1002 - PLACEHOLDER_LABEL
935 + return (
936 + maxW/
937 + Math.max(1,minW)<=
938 + 1.9
1003 1003   );
940 + }
1004 1004  
1005 - title.appendChild(
1006 - badge
942 + /* ---------- Known ARSN first section bars ---------- */
943 +
944 + function knownBar(el){
945 + var text=
946 + normalizeText(
947 + el.textContent
948 + );
949 +
950 + return (
951 + text==="HIER STARTEN"||
952 + text==="ORGANISIEREN & DOKUMENTIEREN"||
953 + text==="ENTSCHEIDEN"||
954 + text==="START HERE"||
955 + text==="GET STARTED"||
956 + text==="ORGANISE & DOCUMENT"||
957 + text==="ORGANIZE & DOCUMENT"||
958 + text==="DECIDE"
1007 1007   );
1008 1008   }
1009 1009  
1010 - /* =======================================================
1011 - DETAIL PAGE OWN-ACCENT PROPAGATION
1012 - ======================================================= */
962 + function findKnownBar(card){
963 + var cardRect=
964 + card.getBoundingClientRect();
1013 1013  
1014 - function parseRGB(value){
1015 - var match=String(value||"").match(
1016 - /rgba?\(\s*([\d.]+)\s*,\s*([\d.]+)\s*,\s*([\d.]+)/i
1017 - );
966 + var rows=
967 + Array.from(
968 + card.querySelectorAll(
969 + "div,p,span,strong,h3,h4,h5,h6"
970 + )
971 + )
972 + .filter(function(el){
973 + if(!visible(el,20,6))return false;
974 + if(!knownBar(el))return false;
1018 1018  
1019 - if(!match)return null;
976 + var r=el.getBoundingClientRect();
1020 1020  
1021 - return [
1022 - Number(match[1]),
1023 - Number(match[2]),
1024 - Number(match[3])
1025 - ];
1026 - }
978 + var rel=
979 + r.top-
980 + cardRect.top;
1027 1027  
1028 - function distance(a,b){
1029 - return Math.sqrt(
1030 - Math.pow(a[0]-b[0],2)+
1031 - Math.pow(a[1]-b[1],2)+
1032 - Math.pow(a[2]-b[2],2)
1033 - );
982 + return (
983 + rel>=35&&
984 + rel<=
985 + cardRect.height*.75
986 + );
987 + })
988 + .sort(function(a,b){
989 + return (
990 + a.getBoundingClientRect().top-
991 + b.getBoundingClientRect().top
992 + );
993 + });
994 +
995 + return rows[0]||null;
1034 1034   }
1035 1035  
1036 - function paletteMatch(cssColor){
1037 - var rgb=parseRGB(cssColor);
998 + function alignKnownBars(cards){
999 + var rows=
1000 + cards.map(function(card){
1001 + var bar=
1002 + findKnownBar(card);
1038 1038  
1039 - if(!rgb)return null;
1004 + if(!bar)return null;
1040 1040  
1041 - var palette=[
1042 - {hex:"#21b6d7",rgb:[33,182,215]},
1043 - {hex:"#e94b13",rgb:[233,75,19]},
1044 - {hex:"#f0aa00",rgb:[240,170,0]},
1045 - {hex:"#38b76a",rgb:[56,183,106]}
1046 - ];
1006 + var cr=
1007 + card.getBoundingClientRect();
1047 1047  
1048 - var best=null;
1049 - var bestDistance=Infinity;
1009 + var br=
1010 + bar.getBoundingClientRect();
1050 1050  
1051 - palette.forEach(function(item){
1052 - var d=distance(rgb,item.rgb);
1012 + return {
1013 + bar:bar,
1014 + relativeTop:
1015 + br.top-
1016 + cr.top
1017 + };
1018 + });
1053 1053  
1054 - if(d<bestDistance){
1055 - best=item;
1056 - bestDistance=d;
1057 - }
1058 - });
1020 + if(
1021 + rows.some(function(row){
1022 + return !row;
1023 + })
1024 + ){
1025 + return false;
1026 + }
1059 1059  
1060 - return bestDistance<=30
1061 - ?best
1062 - :null;
1063 - }
1028 + var target=
1029 + Math.max.apply(
1030 + Math,
1031 + rows.map(function(row){
1032 + return row.relativeTop;
1033 + })
1034 + );
1064 1064  
1065 - function propagateDetailAccents(){
1066 - if(PAGE_KIND!=="detail")return;
1036 + rows.forEach(function(row){
1037 + var delta=
1038 + target-
1039 + row.relativeTop;
1067 1067  
1068 - Array.from(
1069 - root.querySelectorAll(
1070 - ".arsn-call,.dmp-call,.ido-call,.pp-call,"+
1071 - ".arsn-source,.dmp-source,.ido-source,.pp-source"
1072 - )
1073 - ).forEach(function(el){
1074 - if(!visible(el))return;
1041 + if(delta<=1)return;
1075 1075  
1076 - var style=getComputedStyle(el);
1043 + saveOriginal(
1044 + row.bar,
1045 + originalMarginTop,
1046 + "margin-top"
1047 + );
1077 1077  
1078 - if(
1079 - num(style.borderTopWidth)>=2
1080 - ){
1081 - var match=
1082 - paletteMatch(
1083 - style.borderTopColor
1084 - );
1049 + var current=
1050 + num(
1051 + getComputedStyle(
1052 + row.bar
1053 + ).marginTop
1054 + );
1085 1085  
1086 - if(match){
1087 - el.style.setProperty(
1088 - "border-left",
1089 - "4px solid "+match.hex,
1090 - "important"
1091 - );
1092 - }
1093 - }
1094 - });
1056 + row.bar.style.setProperty(
1057 + "margin-top",
1058 + (
1059 + current+
1060 + delta
1061 + )+"px"
1062 + );
1095 1095  
1096 - // Warning families: explicit safety override.
1097 - Array.from(
1098 - root.querySelectorAll(
1099 - ".arsn-warn,.dmp-warn,.ido-warn,.pp-warn,"+
1100 - ".warn,.warning,.warningmessage,.errormessage"
1101 - )
1102 - ).forEach(function(el){
1103 - if(!visible(el))return;
1104 -
1105 - el.style.setProperty(
1106 - "border-left",
1107 - "4px solid #e94b13",
1108 - "important"
1064 + row.bar.setAttribute(
1065 + "data-sn-first-section-aligned",
1066 + "7"
1109 1109   );
1110 - });
1111 1111  
1112 - // Info families: explicit orientation override.
1113 - Array.from(
1114 - root.querySelectorAll(
1115 - ".arsn-info,.dmp-info,.ido-info,.pp-info,.infomessage"
1116 - )
1117 - ).forEach(function(el){
1118 - if(!visible(el))return;
1119 -
1120 - el.style.setProperty(
1121 - "border-left",
1122 - "4px solid #21b6d7",
1123 - "important"
1069 + sectionManaged.add(
1070 + row.bar
1124 1124   );
1125 1125   });
1073 +
1074 + return true;
1126 1126   }
1127 1127  
1128 - /* =======================================================
1129 - OVERVIEW SEMANTIC THEME PALETTE
1130 - ======================================================= */
1077 + /* ---------- Generic first content after heading ---------- */
1131 1131  
1132 - function smallestThemeHeaders(){
1133 - return Array.from(
1134 - root.querySelectorAll(
1135 - "div,span,p,strong,h3,h4,h5,h6"
1079 + function heading(card){
1080 + var cr=
1081 + card.getBoundingClientRect();
1082 +
1083 + var rows=
1084 + Array.from(
1085 + card.querySelectorAll(
1086 + "h1,h2,h3,h4,h5,h6,.box-title,[role=heading]"
1087 + )
1136 1136   )
1137 - ).filter(function(el){
1138 - if(!visible(el))return false;
1139 - if(!themeFor(el.textContent))return false;
1089 + .filter(function(el){
1090 + if(!visible(el,20,8))return false;
1140 1140  
1141 - return !Array.from(
1142 - el.children||[]
1143 - ).some(function(child){
1144 - return !!themeFor(
1145 - child.textContent
1092 + var r=el.getBoundingClientRect();
1093 +
1094 + var rel=
1095 + r.top-
1096 + cr.top;
1097 +
1098 + return (
1099 + rel>=0&&
1100 + rel<=
1101 + Math.min(
1102 + 160,
1103 + cr.height*.45
1104 + )
1146 1146   );
1106 + })
1107 + .sort(function(a,b){
1108 + return (
1109 + a.getBoundingClientRect().top-
1110 + b.getBoundingClientRect().top
1111 + );
1147 1147   });
1148 - });
1113 +
1114 + return rows[0]||null;
1149 1149   }
1150 1150  
1151 - function findOverviewCard(header){
1152 - var node=header.parentElement;
1153 - var candidates=[];
1117 + function firstContent(card,h){
1118 + if(!h)return null;
1154 1154  
1155 - while(node&&node!==root){
1156 - var rect=node.getBoundingClientRect();
1157 - var style=getComputedStyle(node);
1120 + var cr=
1121 + card.getBoundingClientRect();
1158 1158  
1159 - var border=
1160 - num(style.borderTopWidth)+
1161 - num(style.borderRightWidth)+
1162 - num(style.borderBottomWidth)+
1163 - num(style.borderLeftWidth);
1123 + var hr=
1124 + h.getBoundingClientRect();
1164 1164  
1165 - if(
1166 - rect.width>=220&&
1167 - rect.width<=800&&
1168 - rect.height>=120&&
1169 - border>=1
1170 - ){
1171 - candidates.push(node);
1172 - }
1126 + var rows=
1127 + Array.from(
1128 + card.querySelectorAll(
1129 + "p,div,ul,ol,dl,blockquote"
1130 + )
1131 + )
1132 + .filter(function(el){
1133 + if(
1134 + el===h||
1135 + h.contains(el)||
1136 + el.contains(h)
1137 + ){
1138 + return false;
1139 + }
1173 1173  
1174 - node=node.parentElement;
1175 - }
1141 + if(!visible(el,30,8))return false;
1176 1176  
1177 - if(!candidates.length)return null;
1143 + var text=
1144 + String(el.textContent||"")
1145 + .replace(/\s+/g," ")
1146 + .trim();
1178 1178  
1179 - candidates.sort(function(a,b){
1180 - return (
1181 - b.getBoundingClientRect().height-
1182 - a.getBoundingClientRect().height
1183 - );
1184 - });
1148 + if(text.length<3)return false;
1185 1185  
1186 - return candidates[0];
1187 - }
1150 + var r=el.getBoundingClientRect();
1188 1188  
1189 - function rowCandidates(link,card){
1190 - var result=[];
1191 - var cardRect=
1192 - card.getBoundingClientRect();
1152 + if(
1153 + r.top<
1154 + hr.bottom-1
1155 + ){
1156 + return false;
1157 + }
1193 1193  
1194 - var node=link;
1159 + if(
1160 + r.top-cr.top>
1161 + Math.min(
1162 + 280,
1163 + cr.height*.65
1164 + )
1165 + ){
1166 + return false;
1167 + }
1195 1195  
1196 - while(node&&node!==card){
1197 - if(visible(node)){
1198 - var rect=
1199 - node.getBoundingClientRect();
1200 -
1201 1201   if(
1202 - rect.height<=105&&
1203 - rect.width>=
1204 - cardRect.width*.50&&
1205 - rect.width<=
1206 - cardRect.width*1.03
1170 + r.height>
1171 + cr.height*.58
1207 1207   ){
1208 - result.push(node);
1173 + return false;
1209 1209   }
1210 - }
1211 1211  
1212 - node=node.parentElement;
1213 - }
1176 + return true;
1177 + })
1178 + .sort(function(a,b){
1179 + var ar=
1180 + a.getBoundingClientRect();
1214 1214  
1215 - return result;
1216 - }
1182 + var br=
1183 + b.getBoundingClientRect();
1217 1217  
1218 - function chooseOuterRow(
1219 - candidates,
1220 - link
1221 - ){
1222 - if(!candidates.length){
1223 - return link;
1224 - }
1225 -
1226 - var bordered=
1227 - candidates.filter(function(el){
1228 1228   return (
1229 - num(
1230 - getComputedStyle(el)
1231 - .borderLeftWidth
1232 - )>=1
1186 + ar.top-br.top||
1187 + ar.height-br.height
1233 1233   );
1234 1234   });
1235 1235  
1236 - var pool=
1237 - bordered.length
1238 - ?bordered
1239 - :candidates;
1191 + return rows[0]||null;
1192 + }
1240 1240  
1241 - pool.sort(function(a,b){
1242 - var ar=
1243 - a.getBoundingClientRect();
1194 + function alignGeneric(cards){
1195 + var rows=
1196 + cards.map(function(card){
1197 + var h=
1198 + heading(card);
1244 1244  
1245 - var br=
1246 - b.getBoundingClientRect();
1200 + var c=
1201 + firstContent(
1202 + card,
1203 + h
1204 + );
1247 1247  
1248 - return (
1249 - ar.left-br.left||
1250 - br.width-ar.width
1251 - );
1252 - });
1206 + if(!h||!c)return null;
1253 1253  
1254 - return pool[0]||link;
1255 - }
1208 + var cr=
1209 + card.getBoundingClientRect();
1256 1256  
1257 - function applyOverviewPalette(){
1258 - if(PAGE_KIND!=="overview"){
1259 - return [];
1211 + var rr=
1212 + c.getBoundingClientRect();
1213 +
1214 + return {
1215 + content:c,
1216 + relativeTop:
1217 + rr.top-cr.top
1218 + };
1219 + });
1220 +
1221 + if(
1222 + rows.some(function(row){
1223 + return !row;
1224 + })
1225 + ){
1226 + return false;
1260 1260   }
1261 1261  
1262 - var headers=
1263 - smallestThemeHeaders()
1264 - .map(function(el){
1265 - return {
1266 - el:el,
1267 - theme:
1268 - themeFor(
1269 - el.textContent
1270 - ),
1271 - card:
1272 - findOverviewCard(
1273 - el
1274 - )
1275 - };
1229 + var target=
1230 + Math.max.apply(
1231 + Math,
1232 + rows.map(function(row){
1233 + return row.relativeTop;
1276 1276   })
1277 - .filter(function(row){
1278 - return !!row.card;
1279 - });
1235 + );
1280 1280  
1281 - var unique=[];
1282 - var seenHeaders=new Set();
1237 + rows.forEach(function(row){
1238 + var delta=
1239 + target-
1240 + row.relativeTop;
1283 1283  
1284 - headers.forEach(function(row){
1285 - var key=
1286 - row.theme.name+
1287 - "|"+
1288 - Math.round(
1289 - row.card
1290 - .getBoundingClientRect()
1291 - .left
1292 - )+
1293 - "|"+
1294 - Math.round(
1295 - row.el
1296 - .getBoundingClientRect()
1297 - .top
1298 - );
1242 + if(delta<=1)return;
1299 1299  
1300 - if(!seenHeaders.has(key)){
1301 - seenHeaders.add(key);
1302 - unique.push(row);
1303 - }
1304 - });
1305 -
1306 - unique.forEach(function(row){
1307 - var headerRect=
1308 - row.el
1309 - .getBoundingClientRect();
1310 -
1311 - row.el.style.setProperty(
1312 - "background",
1313 - row.theme.bg,
1314 - "important"
1244 + saveOriginal(
1245 + row.content,
1246 + originalMarginTop,
1247 + "margin-top"
1315 1315   );
1316 1316  
1317 - row.el.style.setProperty(
1318 - "color",
1319 - row.theme.text,
1320 - "important"
1321 - );
1250 + var current=
1251 + num(
1252 + getComputedStyle(
1253 + row.content
1254 + ).marginTop
1255 + );
1322 1322  
1323 - row.el.style.setProperty(
1324 - "text-align",
1325 - "left",
1326 - "important"
1257 + row.content.style.setProperty(
1258 + "margin-top",
1259 + (
1260 + current+
1261 + delta
1262 + )+"px"
1327 1327   );
1328 1328  
1329 - row.el.style.setProperty(
1330 - "word-spacing",
1331 - "normal",
1332 - "important"
1265 + row.content.setAttribute(
1266 + "data-sn-first-content-aligned",
1267 + "7"
1333 1333   );
1334 1334  
1335 - var later=
1336 - unique
1337 - .filter(function(other){
1338 - return (
1339 - other.card===row.card&&
1340 - other.el
1341 - .getBoundingClientRect()
1342 - .top>
1343 - headerRect.top+2
1344 - );
1345 - })
1346 - .sort(function(a,b){
1347 - return (
1348 - a.el
1349 - .getBoundingClientRect()
1350 - .top-
1351 - b.el
1352 - .getBoundingClientRect()
1353 - .top
1354 - );
1355 - });
1356 -
1357 - var stopTop=
1358 - later.length
1359 - ?later[0].el
1360 - .getBoundingClientRect()
1361 - .top
1362 - :Infinity;
1363 -
1364 - Array.from(
1365 - row.card.querySelectorAll("a")
1366 - ).forEach(function(link){
1367 - if(!visible(link))return;
1368 -
1369 - var rect=
1370 - link.getBoundingClientRect();
1371 -
1372 - if(
1373 - rect.top<=
1374 - headerRect.bottom-2||
1375 - rect.top>=
1376 - stopTop-2
1377 - ){
1378 - return;
1379 - }
1380 -
1381 - var candidates=
1382 - rowCandidates(
1383 - link,
1384 - row.card
1385 - );
1386 -
1387 - var target=
1388 - chooseOuterRow(
1389 - candidates,
1390 - link
1391 - );
1392 -
1393 - candidates.forEach(function(el){
1394 - el.style.setProperty(
1395 - "border-left",
1396 - "0 solid transparent",
1397 - "important"
1398 - );
1399 - });
1400 -
1401 - target.style.setProperty(
1402 - "border-left",
1403 - "3px solid "+
1404 - row.theme.accent,
1405 - "important"
1406 - );
1407 -
1408 - target.style.setProperty(
1409 - "box-sizing",
1410 - "border-box",
1411 - "important"
1412 - );
1413 - });
1270 + contentManaged.add(
1271 + row.content
1272 + );
1414 1414   });
1415 1415  
1416 - return unique;
1275 + return true;
1417 1417   }
1418 1418  
1419 - /* =======================================================
1420 - OVERVIEW CARD HEIGHT + FIRST THEMATIC ROW
1421 - ======================================================= */
1278 + function applyRow(group){
1279 + if(!validRow(group))return false;
1422 1422  
1423 - function alignOverviewCards(headers){
1424 - if(
1425 - PAGE_KIND!=="overview"||
1426 - window.innerWidth<=MOBILE_MAX
1427 - ){
1428 - return;
1429 - }
1430 -
1431 1431   var cards=[];
1432 1432   var seen=new Set();
1433 1433  
1434 - headers.forEach(function(row){
1435 - if(!seen.has(row.card)){
1436 - seen.add(row.card);
1437 - cards.push(row.card);
1284 + group.entries.forEach(function(entry){
1285 + if(!seen.has(entry.target)){
1286 + seen.add(entry.target);
1287 + cards.push(entry.target);
1438 1438   }
1439 1439   });
1440 1440  
1441 - if(cards.length<2){
1442 - return;
1291 + if(cards.length<2)return false;
1292 +
1293 + if(
1294 + !alignKnownBars(cards)
1295 + ){
1296 + alignGeneric(cards);
1443 1443   }
1444 1444  
1445 - // Group cards by actual top position.
1446 - var groups=[];
1299 + var maxHeight=0;
1447 1447  
1448 1448   cards.forEach(function(card){
1449 - var top=
1450 - card.getBoundingClientRect().top;
1451 -
1452 - var group=null;
1453 -
1454 - for(var i=0;i<groups.length;i++){
1455 - if(
1456 - Math.abs(
1457 - groups[i].top-top
1458 - )<=ROW_TOLERANCE
1459 - ){
1460 - group=groups[i];
1461 - break;
1462 - }
1463 - }
1464 -
1465 - if(!group){
1466 - group={
1467 - top:top,
1468 - cards:[]
1469 - };
1470 - groups.push(group);
1471 - }
1472 -
1473 - group.cards.push(card);
1302 + maxHeight=
1303 + Math.max(
1304 + maxHeight,
1305 + card.getBoundingClientRect().height
1306 + );
1474 1474   });
1475 1475  
1476 - groups.forEach(function(group){
1477 - if(group.cards.length<2){
1478 - return;
1479 - }
1309 + maxHeight=
1310 + Math.ceil(
1311 + maxHeight
1312 + );
1480 1480  
1481 - var firstHeaders=
1482 - group.cards.map(function(card){
1483 - var candidates=
1484 - headers
1485 - .filter(function(row){
1486 - return row.card===card;
1487 - })
1488 - .sort(function(a,b){
1489 - return (
1490 - a.el
1491 - .getBoundingClientRect()
1492 - .top-
1493 - b.el
1494 - .getBoundingClientRect()
1495 - .top
1496 - );
1497 - });
1314 + if(maxHeight<MIN_H)return false;
1498 1498  
1499 - return candidates.length
1500 - ?candidates[0]
1501 - :null;
1502 - });
1316 + cards.forEach(function(card){
1317 + saveOriginal(
1318 + card,
1319 + originalMinHeight,
1320 + "min-height"
1321 + );
1503 1503  
1504 - if(
1505 - !firstHeaders.some(function(row){
1506 - return !row;
1507 - })
1508 - ){
1509 - var targetTop=
1510 - Math.max.apply(
1511 - Math,
1512 - firstHeaders.map(function(row){
1513 - return (
1514 - row.el
1515 - .getBoundingClientRect()
1516 - .top-
1517 - row.card
1518 - .getBoundingClientRect()
1519 - .top
1520 - );
1521 - })
1522 - );
1323 + card.style.setProperty(
1324 + "min-height",
1325 + maxHeight+"px"
1326 + );
1523 1523  
1524 - firstHeaders.forEach(function(row){
1525 - var relativeTop=
1526 - row.el
1527 - .getBoundingClientRect()
1528 - .top-
1529 - row.card
1530 - .getBoundingClientRect()
1531 - .top;
1328 + card.setAttribute(
1329 + "data-sn-equal-height-managed",
1330 + "7"
1331 + );
1532 1532  
1533 - var delta=
1534 - targetTop-relativeTop;
1333 + heightManaged.add(card);
1334 + });
1535 1535  
1536 - if(delta>1){
1537 - saveStyle(
1538 - row.el,
1539 - originalMargin,
1540 - "margin-top"
1541 - );
1336 + return true;
1337 + }
1542 1542  
1543 - var current=
1544 - num(
1545 - getComputedStyle(
1546 - row.el
1547 - ).marginTop
1548 - );
1339 + function calculate(force){
1340 + if(applying)return;
1549 1549  
1550 - row.el.style.setProperty(
1551 - "margin-top",
1552 - (
1553 - current+delta
1554 - )+"px"
1555 - );
1342 + var width=
1343 + Math.round(
1344 + window.innerWidth
1345 + );
1556 1556  
1557 - row.el.setAttribute(
1558 - "data-sn-master-first-row",
1559 - "1"
1560 - );
1347 + var meaningful=
1348 + lastWidth<0||
1349 + Math.abs(
1350 + width-
1351 + lastWidth
1352 + )>=
1353 + MIN_WIDTH_CHANGE;
1561 1561  
1562 - managedMargin.add(
1563 - row.el
1564 - );
1565 - }
1566 - });
1567 - }
1568 -
1569 - var maxHeight=0;
1570 -
1571 - group.cards.forEach(function(card){
1572 - maxHeight=
1573 - Math.max(
1574 - maxHeight,
1575 - card
1576 - .getBoundingClientRect()
1577 - .height
1578 - );
1579 - });
1580 -
1581 - maxHeight=
1582 - Math.ceil(maxHeight);
1583 -
1584 - group.cards.forEach(function(card){
1585 - saveStyle(
1586 - card,
1587 - originalHeight,
1588 - "min-height"
1589 - );
1590 -
1591 - card.style.setProperty(
1592 - "min-height",
1593 - maxHeight+"px"
1594 - );
1595 -
1596 - card.setAttribute(
1597 - "data-sn-master-equal-height",
1598 - "1"
1599 - );
1600 -
1601 - managedHeight.add(
1602 - card
1603 - );
1604 - });
1605 - });
1606 - }
1607 -
1608 - /* =======================================================
1609 - DETAIL GRID EQUAL HEIGHT, DESKTOP ONLY
1610 - ======================================================= */
1611 -
1612 - function equaliseDetailGrids(){
1613 1613   if(
1614 - PAGE_KIND!=="detail"||
1615 - window.innerWidth<=MOBILE_MAX
1356 + hasApplied&&
1357 + !force&&
1358 + !meaningful
1616 1616   ){
1617 1617   return;
1618 1618   }
1619 1619  
1620 - var selectors=[
1621 - ".arsn-grid",
1622 - ".arsn-grid-2",
1623 - ".arsn-grid-3",
1624 - ".dmp-grid",
1625 - ".ido-grid",
1626 - ".pp-grid"
1627 - ];
1363 + applying=true;
1628 1628  
1629 - selectors.forEach(function(selector){
1630 - Array.from(
1631 - root.querySelectorAll(selector)
1632 - ).forEach(function(grid){
1633 - var children=
1634 - Array.from(
1635 - grid.children||[]
1636 - ).filter(visible);
1365 + try{
1366 + harmoniseCustomCallouts();
1637 1637  
1638 - if(children.length<2){
1639 - return;
1368 + if(width<=MOBILE_MAX){
1369 + if(hasApplied){
1370 + resetRuntime();
1640 1640   }
1641 1641  
1642 - var groups=[];
1373 + hasApplied=false;
1374 + lastWidth=width;
1375 + return;
1376 + }
1643 1643  
1644 - children.forEach(function(child){
1645 - var top=
1646 - child
1647 - .getBoundingClientRect()
1648 - .top;
1378 + if(hasApplied){
1379 + resetRuntime();
1380 + }
1649 1649  
1650 - var group=null;
1382 + var parents=
1383 + Array.from(
1384 + root.querySelectorAll("*")
1385 + )
1386 + .filter(function(parent){
1387 + return (
1388 + visible(
1389 + parent,
1390 + MIN_W,
1391 + MIN_H
1392 + )&&
1393 + parent.children&&
1394 + parent.children.length>=2&&
1395 + parent.children.length<=
1396 + MAX_PARENT_CHILDREN
1397 + );
1398 + });
1651 1651  
1652 - for(var i=0;i<groups.length;i++){
1653 - if(
1654 - Math.abs(
1655 - groups[i].top-top
1656 - )<=ROW_TOLERANCE
1657 - ){
1658 - group=groups[i];
1659 - break;
1660 - }
1661 - }
1400 + var touched=
1401 + new Set();
1662 1662  
1663 - if(!group){
1664 - group={
1665 - top:top,
1666 - items:[]
1667 - };
1668 - groups.push(group);
1669 - }
1403 + parents.forEach(function(parent){
1404 + var entries=[];
1670 1670  
1671 - group.items.push(child);
1672 - });
1673 -
1674 - groups.forEach(function(group){
1675 - if(group.items.length<2){
1406 + Array.from(
1407 + parent.children
1408 + ).forEach(function(child){
1409 + if(
1410 + !visible(
1411 + child,
1412 + MIN_W,
1413 + MIN_H
1414 + )
1415 + ){
1676 1676   return;
1677 1677   }
1678 1678  
1679 - var maxHeight=0;
1419 + var target=
1420 + pickTarget(child);
1680 1680  
1681 - group.items.forEach(function(item){
1682 - maxHeight=
1683 - Math.max(
1684 - maxHeight,
1685 - item
1686 - .getBoundingClientRect()
1687 - .height
1688 - );
1422 + if(!target)return;
1423 +
1424 + entries.push({
1425 + target:target,
1426 + rect:
1427 + target.getBoundingClientRect()
1689 1689   });
1429 + });
1690 1690  
1691 - maxHeight=
1692 - Math.ceil(maxHeight);
1431 + groupRows(
1432 + entries
1433 + ).forEach(function(group){
1434 + if(!validRow(group))return;
1693 1693  
1694 - group.items.forEach(function(item){
1695 - saveStyle(
1696 - item,
1697 - originalHeight,
1698 - "min-height"
1699 - );
1436 + var targets=
1437 + group.entries.map(function(entry){
1438 + return entry.target;
1439 + });
1700 1700  
1701 - item.style.setProperty(
1702 - "min-height",
1703 - maxHeight+"px"
1704 - );
1441 + if(
1442 + !targets.some(function(el){
1443 + return !touched.has(el);
1444 + })
1445 + ){
1446 + return;
1447 + }
1705 1705  
1706 - item.setAttribute(
1707 - "data-sn-master-equal-height",
1708 - "1"
1709 - );
1710 -
1711 - managedHeight.add(item);
1712 - });
1449 + if(applyRow(group)){
1450 + targets.forEach(function(el){
1451 + touched.add(el);
1452 + });
1453 + }
1713 1713   });
1714 1714   });
1715 - });
1716 - }
1717 1717  
1718 - /* =======================================================
1719 - RUN / RESPONSIVE SCHEDULING
1720 - ======================================================= */
1721 -
1722 - function run(){
1723 - if(running)return;
1724 -
1725 - running=true;
1726 -
1727 - try{
1728 - resetRuntime();
1729 - applyPlaceholderBadge();
1730 - propagateDetailAccents();
1731 -
1732 - var headers=
1733 - applyOverviewPalette();
1734 -
1735 - makeThreeLineAreaLabels();
1736 - makeFilledRedOrangeCTAsBorderless();
1737 -
1738 - if(
1739 - window.innerWidth>
1740 - MOBILE_MAX
1741 - ){
1742 - alignOverviewCards(
1743 - headers
1744 - );
1745 -
1746 - equaliseDetailGrids();
1747 - }
1457 + lastWidth=width;
1458 + hasApplied=true;
1748 1748   }finally{
1749 - running=false;
1460 + applying=false;
1750 1750   }
1751 1751   }
1752 1752  
1753 - function onResize(){
1464 + function resize(){
1754 1754   if(resizeTimer){
1755 1755   clearTimeout(
1756 1756   resizeTimer
... ... @@ -1761,40 +1761,19 @@
1761 1761   setTimeout(
1762 1762   function(){
1763 1763   resizeTimer=0;
1764 - run();
1475 + calculate(false);
1765 1765   },
1766 1766   RESIZE_DEBOUNCE
1767 1767   );
1768 1768   }
1769 1769  
1770 - async function waitForReady(){
1771 - if(
1772 - document.readyState!=="complete"
1773 - ){
1774 - await new Promise(function(resolve){
1775 - window.addEventListener(
1776 - "load",
1777 - resolve,
1778 - {once:true}
1779 - );
1780 - });
1781 - }
1782 -
1783 - if(
1784 - document.fonts&&
1785 - document.fonts.ready
1786 - ){
1787 - try{
1788 - await document.fonts.ready;
1789 - }catch(error){}
1790 - }
1791 -
1481 + function waitImages(){
1792 1792   var images=
1793 1793   Array.from(
1794 1794   root.querySelectorAll("img")
1795 1795   );
1796 1796  
1797 - await Promise.all(
1487 + return Promise.all(
1798 1798   images.map(function(img){
1799 1799   if(img.complete){
1800 1800   return Promise.resolve();
... ... @@ -1819,20 +1819,46 @@
1819 1819   });
1820 1820   })
1821 1821   );
1512 + }
1822 1822  
1823 - run();
1514 + async function initial(){
1515 + if(
1516 + document.readyState!==
1517 + "complete"
1518 + ){
1519 + await new Promise(function(resolve){
1520 + addEventListener(
1521 + "load",
1522 + resolve,
1523 + {once:true}
1524 + );
1525 + });
1526 + }
1527 +
1528 + if(
1529 + document.fonts&&
1530 + document.fonts.ready
1531 + ){
1532 + try{
1533 + await document.fonts.ready;
1534 + }catch(error){}
1535 + }
1536 +
1537 + await waitImages();
1538 +
1539 + // Exactly one initial layout calculation.
1540 + calculate(true);
1824 1824   }
1825 1825  
1826 - window.addEventListener(
1543 + addEventListener(
1827 1827   "resize",
1828 - onResize,
1545 + resize,
1829 1829   {passive:true}
1830 1830   );
1831 1831  
1832 - waitForReady();
1549 + initial();
1833 1833  })();
1834 1834  </script>
1835 1835  
1836 -<!-- SN_SERVICE_NAVIGATOR_MASTER_STYLE_END -->
1837 -{{/html}}
1838 -
1553 +<!-- SN_HORIZONTAL_BOX_HARMONIZER_END -->
1554 +{{/html}}\n