Changes for page Prepare

Last modified by Veronika Kocher on Friday, 18 Sep 2026 16:47

From version 29.8
edited by Veronika Kocher
on Thursday, 03 Sep 2026 9:34
Change comment: There is no comment for this version
To version 29.10
edited by Veronika Kocher
on Thursday, 03 Sep 2026 13:04
Change comment: There is no comment for this version

Summary

Details

Page properties
Content
... ... @@ -486,23 +486,100 @@
486 486  {{/html}}
487 487  
488 488  {{html clean="false"}}
489 -<!-- SN_HORIZONTAL_BOX_HARMONIZER_START -->
490 -<style data-sn-horizontal-box-harmonizer="4">
491 -[data-sn-equal-height-managed],
492 -[data-sn-first-section-aligned]{
489 +<!-- SN_SERVICE_NAVIGATOR_MASTER_STYLE_START -->
490 +
491 +<style data-sn-service-navigator-master="1">
492 +/* =========================================================
493 + MASTER TYPOGRAPHY
494 + ========================================================= */
495 +#xwikicontent h1,
496 +#xwikicontent h2,
497 +#xwikicontent h3,
498 +#xwikicontent h4,
499 +#xwikicontent h5,
500 +#xwikicontent h6,
501 +#xwikicontent .box-title,
502 +#xwikicontent [role="heading"],
503 +#xwikicontent h1 a,
504 +#xwikicontent h2 a,
505 +#xwikicontent h3 a,
506 +#xwikicontent h4 a,
507 +#xwikicontent h5 a,
508 +#xwikicontent h6 a,
509 +#xwikicontent .box-title a,
510 +#xwikicontent [role="heading"] a{
511 + text-align:left!important;
512 + text-justify:auto!important;
513 + word-spacing:normal!important;
514 +}
515 +
516 +/* =========================================================
517 + COMING SOON / IN VORBEREITUNG
518 + ========================================================= */
519 +.sn-coming-soon-badge{
520 + display:inline-block;
521 + vertical-align:middle;
522 + margin-left:10px;
523 + padding:4px 8px;
524 + border-radius:14px;
525 + border:1px solid #efd9cc;
526 + background:#fff4ee;
527 + color:#8a4d36;
528 + font-size:11px;
529 + font-weight:700;
530 + letter-spacing:.055em;
531 + line-height:1.2;
532 + white-space:nowrap;
533 +}
534 +
535 +/* =========================================================
536 + NATIVE / DETAIL CALLOUT GEOMETRY
537 + Preserve existing backgrounds.
538 + ========================================================= */
539 +#xwikicontent .arsn-info,
540 +#xwikicontent .dmp-info,
541 +#xwikicontent .ido-info,
542 +#xwikicontent .pp-info,
543 +#xwikicontent .infomessage{
544 + box-sizing:border-box!important;
545 + border-left:4px solid #21b6d7!important;
546 + border-radius:8px;
547 + text-align:left!important;
548 + word-spacing:normal!important;
549 +}
550 +
551 +#xwikicontent .arsn-warn,
552 +#xwikicontent .dmp-warn,
553 +#xwikicontent .ido-warn,
554 +#xwikicontent .pp-warn,
555 +#xwikicontent .warn,
556 +#xwikicontent .warning,
557 +#xwikicontent .warningmessage,
558 +#xwikicontent .errormessage{
559 + box-sizing:border-box!important;
560 + border-left:4px solid #e94b13!important;
561 + border-radius:8px;
562 + text-align:left!important;
563 + word-spacing:normal!important;
564 +}
565 +
566 +[data-sn-master-equal-height],
567 +[data-sn-master-first-row]{
493 493   box-sizing:border-box;
494 494  }
495 495  </style>
496 -<script data-sn-horizontal-box-harmonizer="4">
571 +
572 +<script data-sn-service-navigator-master="1">
497 497  (function(){
498 498   "use strict";
499 499  
576 + var PAGE_KIND="overview";
577 + var PLACEHOLDER=false;
578 + var PLACEHOLDER_LABEL="COMING SOON";
579 +
500 500   var MOBILE_MAX=767;
501 501   var ROW_TOLERANCE=6;
502 - var MIN_W=150;
503 - var MIN_H=36;
504 - var MAX_PARENT_CHILDREN=16;
505 - var SEARCH_DEPTH=5;
582 + var RESIZE_DEBOUNCE=220;
506 506  
507 507   var root=
508 508   document.getElementById("xwikicontent")||
... ... @@ -512,93 +512,105 @@
512 512  
513 513   if(!root)return;
514 514  
515 - var heightManaged=new Set();
516 - var sectionManaged=new Set();
517 - var originalMinHeight=new WeakMap();
518 - var originalMarginTop=new WeakMap();
519 - var raf=0;
592 + var managedHeight=new Set();
593 + var managedMargin=new Set();
594 + var originalHeight=new WeakMap();
595 + var originalMargin=new WeakMap();
520 520  
521 - function num(v){
522 - var n=parseFloat(v);
523 - return Number.isFinite(n)?n:0;
524 - }
597 + var resizeTimer=0;
598 + var running=false;
525 525  
526 - function visible(el,minW,minH){
527 - if(!el||el.nodeType!==1)return false;
528 -
529 - var s=getComputedStyle(el);
530 -
531 - if(
532 - s.display==="none"||
533 - s.visibility==="hidden"||
534 - Number(s.opacity)===0
535 - ){
536 - return false;
600 + var THEMES=[
601 + {
602 + name:"BLUE",
603 + accent:"#21b6d7",
604 + bg:"#eaf7fb",
605 + text:"#315d68",
606 + labels:[
607 + "HIER STARTEN",
608 + "ENTSCHEIDEN",
609 + "ÜBERPRÜFEN & ANPASSEN",
610 + "START HERE",
611 + "DECIDE",
612 + "REVIEW & ADAPT"
613 + ]
614 + },
615 + {
616 + name:"RED",
617 + accent:"#e94b13",
618 + bg:"#fff1ec",
619 + text:"#8a4d36",
620 + labels:[
621 + "PLANEN & ORGANISIEREN",
622 + "ORGANISIEREN & DOKUMENTIEREN",
623 + "PUBLIZIEREN & PRÄSENTIEREN",
624 + "PLAN & ORGANISE",
625 + "PLAN & ORGANIZE",
626 + "ORGANISE & DOCUMENT",
627 + "ORGANIZE & DOCUMENT",
628 + "PUBLISH & PRESENT"
629 + ]
630 + },
631 + {
632 + name:"YELLOW",
633 + accent:"#f0aa00",
634 + bg:"#fff8e7",
635 + text:"#785b17",
636 + labels:[
637 + "SCHÜTZEN & KLÄREN",
638 + "STANDARDISIEREN & IDENTIFIZIEREN",
639 + "ÖFFNEN, NACHNUTZEN & AUFFINDBAR MACHEN",
640 + "PROTECT & CLARIFY",
641 + "STANDARDISE & IDENTIFY",
642 + "STANDARDIZE & IDENTIFY",
643 + "OPEN, REUSE & MAKE FINDABLE"
644 + ]
645 + },
646 + {
647 + name:"GREEN",
648 + accent:"#38b76a",
649 + bg:"#edf9f1",
650 + text:"#3f7451",
651 + labels:[
652 + "INFRASTRUKTUR EINRICHTEN",
653 + "INFRASTRUKTUR & ZUSAMMENARBEIT EINRICHTEN",
654 + "SPEICHERN & ZUGRIFF STEUERN",
655 + "REPOSITORIUM, ERHALTEN & ÜBERGEBEN",
656 + "SET UP INFRASTRUCTURE",
657 + "SET UP INFRASTRUCTURE & COLLABORATION",
658 + "STORE & CONTROL ACCESS",
659 + "REPOSITORY, PRESERVE & HAND OVER"
660 + ]
537 537   }
662 + ];
538 538  
539 - var r=el.getBoundingClientRect();
540 -
541 - return (
542 - r.width>=(minW||1)&&
543 - r.height>=(minH||1)
544 - );
664 + function num(value){
665 + var n=parseFloat(value);
666 + return Number.isFinite(n)?n:0;
545 545   }
546 546  
547 - function excluded(el){
548 - return (
549 - !el.matches||
550 - el.matches(
551 - "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]"
552 - )
553 - );
669 + function norm(value){
670 + return String(value||"")
671 + .replace(/\s+/g," ")
672 + .trim()
673 + .toUpperCase();
554 554   }
555 555  
556 - function namedLikeBox(el){
557 - var c=
558 - typeof el.className==="string"
559 - ? el.className
560 - : "";
676 + function visible(el){
677 + if(!el||el.nodeType!==1)return false;
561 561  
562 - return /(^|[s_-])(box|card|tile|panel|role|check|service|source|call|area|detail|resource|topic|warn|info)([s_-]|$)/i.test(c);
563 - }
679 + var style=getComputedStyle(el);
680 + var rect=el.getBoundingClientRect();
564 564  
565 - function boxLike(el){
566 - if(!visible(el,MIN_W,MIN_H)||excluded(el))return false;
567 -
568 - var s=getComputedStyle(el);
569 - var r=el.getBoundingClientRect();
570 -
571 - var border=
572 - num(s.borderTopWidth)+
573 - num(s.borderRightWidth)+
574 - num(s.borderBottomWidth)+
575 - num(s.borderLeftWidth);
576 -
577 - var radius=Math.max(
578 - num(s.borderTopLeftRadius),
579 - num(s.borderTopRightRadius),
580 - num(s.borderBottomLeftRadius),
581 - num(s.borderBottomRightRadius)
582 - );
583 -
584 - var bg=
585 - s.backgroundColor&&
586 - s.backgroundColor!=="rgba(0, 0, 0, 0)"&&
587 - s.backgroundColor!=="transparent";
588 -
589 - var shadow=
590 - s.boxShadow&&
591 - s.boxShadow!=="none";
592 -
593 593   return (
594 - namedLikeBox(el)||
595 - border>=1||
596 - (bg&&radius>=3)||
597 - (shadow&&r.width>=180)
683 + style.display!=="none"&&
684 + style.visibility!=="hidden"&&
685 + rect.width>20&&
686 + rect.height>4
598 598   );
599 599   }
600 600  
601 - function saveOriginal(el,map,property){
690 + function saveStyle(el,map,property){
602 602   if(map.has(el))return;
603 603  
604 604   map.set(el,{
... ... @@ -607,7 +607,7 @@
607 607   });
608 608   }
609 609  
610 - function restoreOriginal(el,map,property){
699 + function restoreStyle(el,map,property){
611 611   var original=map.get(el);
612 612  
613 613   if(original&&original.value){
... ... @@ -621,247 +621,249 @@
621 621   }
622 622   }
623 623  
624 - function reset(){
625 - heightManaged.forEach(function(el){
626 - restoreOriginal(
713 + function resetRuntime(){
714 + managedHeight.forEach(function(el){
715 + restoreStyle(
627 627   el,
628 - originalMinHeight,
717 + originalHeight,
629 629   "min-height"
630 630   );
631 -
632 632   el.removeAttribute(
633 - "data-sn-equal-height-managed"
721 + "data-sn-master-equal-height"
634 634   );
635 635   });
636 636  
637 - sectionManaged.forEach(function(el){
638 - restoreOriginal(
725 + managedMargin.forEach(function(el){
726 + restoreStyle(
639 639   el,
640 - originalMarginTop,
728 + originalMargin,
641 641   "margin-top"
642 642   );
643 -
644 644   el.removeAttribute(
645 - "data-sn-first-section-aligned"
732 + "data-sn-master-first-row"
646 646   );
647 647   });
648 648  
649 - heightManaged.clear();
650 - sectionManaged.clear();
736 + managedHeight.clear();
737 + managedMargin.clear();
651 651   }
652 652  
653 - function pickTarget(child){
654 - if(!visible(child,MIN_W,MIN_H))return null;
740 + function themeFor(text){
741 + var value=norm(text);
655 655  
656 - if(boxLike(child)){
657 - return child;
743 + for(var i=0;i<THEMES.length;i++){
744 + for(var j=0;j<THEMES[i].labels.length;j++){
745 + var label=THEMES[i].labels[j];
746 +
747 + if(
748 + value===label||
749 + value.indexOf(label+" ")===0||
750 + value.indexOf(label+" -")===0||
751 + value.indexOf(label+" ·")===0
752 + ){
753 + return THEMES[i];
754 + }
755 + }
658 658   }
659 659  
660 - var cr=child.getBoundingClientRect();
661 - var q=[];
758 + return null;
759 + }
662 662  
663 - Array.from(child.children||[]).forEach(function(el){
664 - q.push({el:el,depth:1});
665 - });
761 + /* =======================================================
762 + PLACEHOLDER BADGE
763 + ======================================================= */
666 666  
667 - var best=null;
668 - var bestScore=-Infinity;
765 + function applyPlaceholderBadge(){
766 + if(!PLACEHOLDER)return;
669 669  
670 - while(q.length){
671 - var item=q.shift();
672 - var el=item.el;
768 + if(
769 + document.querySelector(
770 + ".sn-coming-soon-badge"
771 + )
772 + ){
773 + return;
774 + }
673 673  
674 - if(!visible(el,MIN_W,MIN_H))continue;
776 + var title=
777 + document.querySelector(
778 + "#document-title"
779 + )||
780 + document.querySelector(
781 + "h1"
782 + );
675 675  
676 - var r=el.getBoundingClientRect();
784 + if(!title)return;
677 677  
678 - if(
679 - r.width>=cr.width*.68&&
680 - boxLike(el)
681 - ){
682 - var widthFit=
683 - 1-Math.min(
684 - 1,
685 - Math.abs(cr.width-r.width)/
686 - Math.max(1,cr.width)
687 - );
786 + var badge=
787 + document.createElement(
788 + "span"
789 + );
688 688  
689 - var topFit=
690 - 1-Math.min(
691 - 1,
692 - Math.abs(cr.top-r.top)/100
693 - );
791 + badge.className=
792 + "sn-coming-soon-badge";
694 694  
695 - var score=
696 - widthFit*6+
697 - topFit*3+
698 - Math.min(r.height,900)/450+
699 - Math.min(r.width*r.height,900000)/900000;
794 + badge.textContent=
795 + PLACEHOLDER_LABEL;
700 700  
701 - if(score>bestScore){
702 - best=el;
703 - bestScore=score;
704 - }
705 - }
797 + badge.setAttribute(
798 + "aria-label",
799 + PLACEHOLDER_LABEL
800 + );
706 706  
707 - if(item.depth<SEARCH_DEPTH){
708 - Array.from(el.children||[]).forEach(function(next){
709 - q.push({
710 - el:next,
711 - depth:item.depth+1
712 - });
713 - });
714 - }
715 - }
716 -
717 - return best;
802 + title.appendChild(
803 + badge
804 + );
718 718   }
719 719  
720 - function groupsByVisualRow(entries){
721 - var groups=[];
807 + /* =======================================================
808 + DETAIL PAGE OWN-ACCENT PROPAGATION
809 + ======================================================= */
722 722  
723 - entries
724 - .slice()
725 - .sort(function(a,b){
726 - return (
727 - a.rect.top-b.rect.top||
728 - a.rect.left-b.rect.left
729 - );
730 - })
731 - .forEach(function(entry){
732 - var group=null;
811 + function parseRGB(value){
812 + var match=String(value||"").match(
813 + /rgba?\(\s*([\d.]+)\s*,\s*([\d.]+)\s*,\s*([\d.]+)/i
814 + );
733 733  
734 - for(var i=0;i<groups.length;i++){
735 - if(
736 - Math.abs(
737 - groups[i].top-
738 - entry.rect.top
739 - )<=ROW_TOLERANCE
740 - ){
741 - group=groups[i];
742 - break;
743 - }
744 - }
816 + if(!match)return null;
745 745  
746 - if(!group){
747 - group={
748 - top:entry.rect.top,
749 - entries:[]
750 - };
751 - groups.push(group);
752 - }
818 + return [
819 + Number(match[1]),
820 + Number(match[2]),
821 + Number(match[3])
822 + ];
823 + }
753 753  
754 - group.entries.push(entry);
755 - });
756 -
757 - return groups;
825 + function distance(a,b){
826 + return Math.sqrt(
827 + Math.pow(a[0]-b[0],2)+
828 + Math.pow(a[1]-b[1],2)+
829 + Math.pow(a[2]-b[2],2)
830 + );
758 758   }
759 759  
760 - function validHorizontalGroup(group){
761 - if(group.entries.length<2)return false;
833 + function paletteMatch(cssColor){
834 + var rgb=parseRGB(cssColor);
762 762  
763 - var lefts=
764 - group.entries
765 - .map(function(e){return e.rect.left;})
766 - .sort(function(a,b){return a-b;});
836 + if(!rgb)return null;
767 767  
768 - if(
769 - lefts[lefts.length-1]-
770 - lefts[0]<
771 - 80
772 - ){
773 - return false;
774 - }
838 + var palette=[
839 + {hex:"#21b6d7",rgb:[33,182,215]},
840 + {hex:"#e94b13",rgb:[233,75,19]},
841 + {hex:"#f0aa00",rgb:[240,170,0]},
842 + {hex:"#38b76a",rgb:[56,183,106]}
843 + ];
775 775  
776 - var widths=
777 - group.entries
778 - .map(function(e){return e.rect.width;})
779 - .filter(function(w){return w>0;});
845 + var best=null;
846 + var bestDistance=Infinity;
780 780  
781 - if(widths.length<2)return false;
848 + palette.forEach(function(item){
849 + var d=distance(rgb,item.rgb);
782 782  
783 - var minWidth=Math.min.apply(Math,widths);
784 - var maxWidth=Math.max.apply(Math,widths);
851 + if(d<bestDistance){
852 + best=item;
853 + bestDistance=d;
854 + }
855 + });
785 785  
786 - return (
787 - maxWidth/
788 - Math.max(1,minWidth)<=
789 - 1.9
790 - );
857 + return bestDistance<=30
858 + ?best
859 + :null;
791 791   }
792 792  
793 - function normalizeText(text){
794 - return String(text||"")
795 - .replace(/s+/g," ")
796 - .trim()
797 - .toUpperCase();
798 - }
862 + function propagateDetailAccents(){
863 + if(PAGE_KIND!=="detail")return;
799 799  
800 - function exactKnownFirstSection(el){
801 - var text=normalizeText(el.textContent);
802 -
803 - return (
804 - text==="HIER STARTEN"||
805 - text==="ORGANISIEREN & DOKUMENTIEREN"||
806 - text==="ENTSCHEIDEN"||
807 - text==="START HERE"||
808 - text==="GET STARTED"||
809 - text==="ORGANISE & DOCUMENT"||
810 - text==="ORGANIZE & DOCUMENT"||
811 - text==="DECIDE"
812 - );
813 - }
814 -
815 - function visuallyFirstSectionBar(card){
816 - var cardRect=card.getBoundingClientRect();
817 - var candidates=[];
818 -
819 819   Array.from(
820 - card.querySelectorAll(
821 - "div,p,span,strong,h3,h4,h5,h6"
866 + root.querySelectorAll(
867 + ".arsn-call,.dmp-call,.ido-call,.pp-call,"+
868 + ".arsn-source,.dmp-source,.ido-source,.pp-source"
822 822   )
823 823   ).forEach(function(el){
824 - if(!visible(el,20,6))return;
825 - if(excluded(el))return;
871 + if(!visible(el))return;
826 826  
827 - var r=el.getBoundingClientRect();
828 - var relativeTop=r.top-cardRect.top;
873 + var style=getComputedStyle(el);
829 829  
830 830   if(
831 - relativeTop<45||
832 - relativeTop>cardRect.height*.72
876 + num(style.borderTopWidth)>=2
833 833   ){
834 - return;
878 + var match=
879 + paletteMatch(
880 + style.borderTopColor
881 + );
882 +
883 + if(match){
884 + el.style.setProperty(
885 + "border-left",
886 + "4px solid "+match.hex,
887 + "important"
888 + );
889 + }
835 835   }
891 + });
836 836  
837 - var widthRatio=
838 - r.width/
839 - Math.max(1,cardRect.width);
893 + // Warning families: explicit safety override.
894 + Array.from(
895 + root.querySelectorAll(
896 + ".arsn-warn,.dmp-warn,.ido-warn,.pp-warn,"+
897 + ".warn,.warning,.warningmessage,.errormessage"
898 + )
899 + ).forEach(function(el){
900 + if(!visible(el))return;
840 840  
841 - if(
842 - widthRatio<.55||
843 - widthRatio>1.05||
844 - r.height>54
845 - ){
846 - return;
847 - }
902 + el.style.setProperty(
903 + "border-left",
904 + "4px solid #e94b13",
905 + "important"
906 + );
907 + });
848 848  
849 - var text=normalizeText(el.textContent);
909 + // Info families: explicit orientation override.
910 + Array.from(
911 + root.querySelectorAll(
912 + ".arsn-info,.dmp-info,.ido-info,.pp-info,.infomessage"
913 + )
914 + ).forEach(function(el){
915 + if(!visible(el))return;
850 850  
851 - if(
852 - text.length<2||
853 - text.length>90
854 - ){
855 - return;
856 - }
917 + el.style.setProperty(
918 + "border-left",
919 + "4px solid #21b6d7",
920 + "important"
921 + );
922 + });
923 + }
857 857  
858 - var style=getComputedStyle(el);
925 + /* =======================================================
926 + OVERVIEW SEMANTIC THEME PALETTE
927 + ======================================================= */
859 859  
860 - var bg=
861 - style.backgroundColor&&
862 - style.backgroundColor!=="rgba(0, 0, 0, 0)"&&
863 - style.backgroundColor!=="transparent";
929 + function smallestThemeHeaders(){
930 + return Array.from(
931 + root.querySelectorAll(
932 + "div,span,p,strong,h3,h4,h5,h6"
933 + )
934 + ).filter(function(el){
935 + if(!visible(el))return false;
936 + if(!themeFor(el.textContent))return false;
864 864  
938 + return !Array.from(
939 + el.children||[]
940 + ).some(function(child){
941 + return !!themeFor(
942 + child.textContent
943 + );
944 + });
945 + });
946 + }
947 +
948 + function findOverviewCard(header){
949 + var node=header.parentElement;
950 + var candidates=[];
951 +
952 + while(node&&node!==root){
953 + var rect=node.getBoundingClientRect();
954 + var style=getComputedStyle(node);
955 +
865 865   var border=
866 866   num(style.borderTopWidth)+
867 867   num(style.borderRightWidth)+
... ... @@ -868,315 +868,674 @@
868 868   num(style.borderBottomWidth)+
869 869   num(style.borderLeftWidth);
870 870  
871 - var mostlyUpper=
872 - text.length>=3&&
873 - text===text.toUpperCase();
874 -
875 - var exact=exactKnownFirstSection(el);
876 -
877 - var score=
878 - (exact?20:0)+
879 - (bg?6:0)+
880 - (border>=1?2:0)+
881 - (mostlyUpper?4:0)+
882 - (num(style.fontWeight)>=600?1:0);
883 -
884 - if(score>=7){
885 - candidates.push({
886 - el:el,
887 - relativeTop:relativeTop,
888 - width:r.width,
889 - score:score
890 - });
962 + if(
963 + rect.width>=220&&
964 + rect.width<=800&&
965 + rect.height>=120&&
966 + border>=1
967 + ){
968 + candidates.push(node);
891 891   }
892 - });
893 893  
971 + node=node.parentElement;
972 + }
973 +
894 894   if(!candidates.length)return null;
895 895  
896 896   candidates.sort(function(a,b){
897 - if(a.score!==b.score)return b.score-a.score;
898 - if(Math.abs(a.relativeTop-b.relativeTop)>3){
899 - return a.relativeTop-b.relativeTop;
900 - }
901 - return b.width-a.width;
977 + return (
978 + b.getBoundingClientRect().height-
979 + a.getBoundingClientRect().height
980 + );
902 902   });
903 903  
904 - // For exact known labels always prefer the earliest exact match.
905 - var exacts=candidates.filter(function(c){
906 - return exactKnownFirstSection(c.el);
907 - });
983 + return candidates[0];
984 + }
908 908  
909 - if(exacts.length){
910 - exacts.sort(function(a,b){
911 - return a.relativeTop-b.relativeTop||b.width-a.width;
912 - });
913 - return exacts[0].el;
914 - }
986 + function rowCandidates(link,card){
987 + var result=[];
988 + var cardRect=
989 + card.getBoundingClientRect();
915 915  
916 - // Generic fallback: earliest high-confidence bar.
917 - candidates.sort(function(a,b){
918 - return a.relativeTop-b.relativeTop||b.score-a.score||b.width-a.width;
919 - });
991 + var node=link;
920 920  
921 - return candidates[0].el;
922 - }
993 + while(node&&node!==card){
994 + if(visible(node)){
995 + var rect=
996 + node.getBoundingClientRect();
923 923  
924 - function alignFirstSections(cards){
925 - var rows=
926 - cards.map(function(card){
927 - var bar=
928 - visuallyFirstSectionBar(card);
998 + if(
999 + rect.height<=105&&
1000 + rect.width>=
1001 + cardRect.width*.50&&
1002 + rect.width<=
1003 + cardRect.width*1.03
1004 + ){
1005 + result.push(node);
1006 + }
1007 + }
929 929  
930 - if(!bar)return null;
1009 + node=node.parentElement;
1010 + }
931 931  
932 - var cardRect=
933 - card.getBoundingClientRect();
1012 + return result;
1013 + }
934 934  
935 - var barRect=
936 - bar.getBoundingClientRect();
1015 + function chooseOuterRow(
1016 + candidates,
1017 + link
1018 + ){
1019 + if(!candidates.length){
1020 + return link;
1021 + }
937 937  
938 - return {
939 - card:card,
940 - bar:bar,
941 - relativeTop:
942 - barRect.top-cardRect.top,
943 - label:
944 - normalizeText(bar.textContent)
945 - };
1023 + var bordered=
1024 + candidates.filter(function(el){
1025 + return (
1026 + num(
1027 + getComputedStyle(el)
1028 + .borderLeftWidth
1029 + )>=1
1030 + );
946 946   });
947 947  
948 - // Conservative: only align when every card in the horizontal row
949 - // has a reliable first section bar.
950 - if(
951 - rows.some(function(row){
952 - return !row;
953 - })
954 - ){
955 - return null;
1033 + var pool=
1034 + bordered.length
1035 + ?bordered
1036 + :candidates;
1037 +
1038 + pool.sort(function(a,b){
1039 + var ar=
1040 + a.getBoundingClientRect();
1041 +
1042 + var br=
1043 + b.getBoundingClientRect();
1044 +
1045 + return (
1046 + ar.left-br.left||
1047 + br.width-ar.width
1048 + );
1049 + });
1050 +
1051 + return pool[0]||link;
1052 + }
1053 +
1054 + function applyOverviewPalette(){
1055 + if(PAGE_KIND!=="overview"){
1056 + return [];
956 956   }
957 957  
958 - var targetTop=
959 - Math.max.apply(
960 - Math,
961 - rows.map(function(row){
962 - return row.relativeTop;
1059 + var headers=
1060 + smallestThemeHeaders()
1061 + .map(function(el){
1062 + return {
1063 + el:el,
1064 + theme:
1065 + themeFor(
1066 + el.textContent
1067 + ),
1068 + card:
1069 + findOverviewCard(
1070 + el
1071 + )
1072 + };
963 963   })
964 - );
1074 + .filter(function(row){
1075 + return !!row.card;
1076 + });
965 965  
966 - rows.forEach(function(row){
967 - var delta=
968 - targetTop-
969 - row.relativeTop;
1078 + var unique=[];
1079 + var seenHeaders=new Set();
970 970  
971 - if(delta<=1)return;
1081 + headers.forEach(function(row){
1082 + var key=
1083 + row.theme.name+
1084 + "|"+
1085 + Math.round(
1086 + row.card
1087 + .getBoundingClientRect()
1088 + .left
1089 + )+
1090 + "|"+
1091 + Math.round(
1092 + row.el
1093 + .getBoundingClientRect()
1094 + .top
1095 + );
972 972  
973 - saveOriginal(
974 - row.bar,
975 - originalMarginTop,
976 - "margin-top"
1097 + if(!seenHeaders.has(key)){
1098 + seenHeaders.add(key);
1099 + unique.push(row);
1100 + }
1101 + });
1102 +
1103 + unique.forEach(function(row){
1104 + var headerRect=
1105 + row.el
1106 + .getBoundingClientRect();
1107 +
1108 + row.el.style.setProperty(
1109 + "background",
1110 + row.theme.bg,
1111 + "important"
977 977   );
978 978  
979 - var currentMargin=
980 - num(
981 - getComputedStyle(
982 - row.bar
983 - ).marginTop
984 - );
1114 + row.el.style.setProperty(
1115 + "color",
1116 + row.theme.text,
1117 + "important"
1118 + );
985 985  
986 - row.bar.style.setProperty(
987 - "margin-top",
988 - (
989 - currentMargin+
990 - delta
991 - )+"px"
1120 + row.el.style.setProperty(
1121 + "text-align",
1122 + "left",
1123 + "important"
992 992   );
993 993  
994 - row.bar.setAttribute(
995 - "data-sn-first-section-aligned",
996 - "4"
1126 + row.el.style.setProperty(
1127 + "word-spacing",
1128 + "normal",
1129 + "important"
997 997   );
998 998  
999 - sectionManaged.add(row.bar);
1132 + var later=
1133 + unique
1134 + .filter(function(other){
1135 + return (
1136 + other.card===row.card&&
1137 + other.el
1138 + .getBoundingClientRect()
1139 + .top>
1140 + headerRect.top+2
1141 + );
1142 + })
1143 + .sort(function(a,b){
1144 + return (
1145 + a.el
1146 + .getBoundingClientRect()
1147 + .top-
1148 + b.el
1149 + .getBoundingClientRect()
1150 + .top
1151 + );
1152 + });
1153 +
1154 + var stopTop=
1155 + later.length
1156 + ?later[0].el
1157 + .getBoundingClientRect()
1158 + .top
1159 + :Infinity;
1160 +
1161 + Array.from(
1162 + row.card.querySelectorAll("a")
1163 + ).forEach(function(link){
1164 + if(!visible(link))return;
1165 +
1166 + var rect=
1167 + link.getBoundingClientRect();
1168 +
1169 + if(
1170 + rect.top<=
1171 + headerRect.bottom-2||
1172 + rect.top>=
1173 + stopTop-2
1174 + ){
1175 + return;
1176 + }
1177 +
1178 + var candidates=
1179 + rowCandidates(
1180 + link,
1181 + row.card
1182 + );
1183 +
1184 + var target=
1185 + chooseOuterRow(
1186 + candidates,
1187 + link
1188 + );
1189 +
1190 + candidates.forEach(function(el){
1191 + el.style.setProperty(
1192 + "border-left",
1193 + "0 solid transparent",
1194 + "important"
1195 + );
1196 + });
1197 +
1198 + target.style.setProperty(
1199 + "border-left",
1200 + "3px solid "+
1201 + row.theme.accent,
1202 + "important"
1203 + );
1204 +
1205 + target.style.setProperty(
1206 + "box-sizing",
1207 + "border-box",
1208 + "important"
1209 + );
1210 + });
1000 1000   });
1001 1001  
1002 - return {
1003 - labels:
1004 - rows.map(function(row){
1005 - return row.label;
1006 - }),
1007 - targetRelativeTop:
1008 - Math.round(targetTop)
1009 - };
1213 + return unique;
1010 1010   }
1011 1011  
1012 - function applyGroup(group){
1013 - if(!validHorizontalGroup(group)){
1014 - return null;
1216 + /* =======================================================
1217 + OVERVIEW CARD HEIGHT + FIRST THEMATIC ROW
1218 + ======================================================= */
1219 +
1220 + function alignOverviewCards(headers){
1221 + if(
1222 + PAGE_KIND!=="overview"||
1223 + window.innerWidth<=MOBILE_MAX
1224 + ){
1225 + return;
1015 1015   }
1016 1016  
1017 1017   var cards=[];
1018 1018   var seen=new Set();
1019 1019  
1020 - group.entries.forEach(function(entry){
1021 - if(!seen.has(entry.target)){
1022 - seen.add(entry.target);
1023 - cards.push(entry.target);
1231 + headers.forEach(function(row){
1232 + if(!seen.has(row.card)){
1233 + seen.add(row.card);
1234 + cards.push(row.card);
1024 1024   }
1025 1025   });
1026 1026  
1027 - if(cards.length<2)return null;
1238 + if(cards.length<2){
1239 + return;
1240 + }
1028 1028  
1029 - var firstSection=
1030 - alignFirstSections(cards);
1242 + // Group cards by actual top position.
1243 + var groups=[];
1031 1031  
1032 - // The section alignment can change natural card heights.
1033 - // Measure only afterwards.
1034 - var maxHeight=0;
1035 -
1036 1036   cards.forEach(function(card){
1037 - maxHeight=Math.max(
1038 - maxHeight,
1039 - card.getBoundingClientRect().height
1040 - );
1246 + var top=
1247 + card.getBoundingClientRect().top;
1248 +
1249 + var group=null;
1250 +
1251 + for(var i=0;i<groups.length;i++){
1252 + if(
1253 + Math.abs(
1254 + groups[i].top-top
1255 + )<=ROW_TOLERANCE
1256 + ){
1257 + group=groups[i];
1258 + break;
1259 + }
1260 + }
1261 +
1262 + if(!group){
1263 + group={
1264 + top:top,
1265 + cards:[]
1266 + };
1267 + groups.push(group);
1268 + }
1269 +
1270 + group.cards.push(card);
1041 1041   });
1042 1042  
1043 - maxHeight=Math.ceil(maxHeight);
1273 + groups.forEach(function(group){
1274 + if(group.cards.length<2){
1275 + return;
1276 + }
1044 1044  
1045 - if(maxHeight<MIN_H)return null;
1278 + var firstHeaders=
1279 + group.cards.map(function(card){
1280 + var candidates=
1281 + headers
1282 + .filter(function(row){
1283 + return row.card===card;
1284 + })
1285 + .sort(function(a,b){
1286 + return (
1287 + a.el
1288 + .getBoundingClientRect()
1289 + .top-
1290 + b.el
1291 + .getBoundingClientRect()
1292 + .top
1293 + );
1294 + });
1046 1046  
1047 - cards.forEach(function(card){
1048 - saveOriginal(
1049 - card,
1050 - originalMinHeight,
1051 - "min-height"
1052 - );
1296 + return candidates.length
1297 + ?candidates[0]
1298 + :null;
1299 + });
1053 1053  
1054 - card.style.setProperty(
1055 - "min-height",
1056 - maxHeight+"px"
1057 - );
1301 + if(
1302 + !firstHeaders.some(function(row){
1303 + return !row;
1304 + })
1305 + ){
1306 + var targetTop=
1307 + Math.max.apply(
1308 + Math,
1309 + firstHeaders.map(function(row){
1310 + return (
1311 + row.el
1312 + .getBoundingClientRect()
1313 + .top-
1314 + row.card
1315 + .getBoundingClientRect()
1316 + .top
1317 + );
1318 + })
1319 + );
1058 1058  
1059 - card.setAttribute(
1060 - "data-sn-equal-height-managed",
1061 - "4"
1062 - );
1321 + firstHeaders.forEach(function(row){
1322 + var relativeTop=
1323 + row.el
1324 + .getBoundingClientRect()
1325 + .top-
1326 + row.card
1327 + .getBoundingClientRect()
1328 + .top;
1063 1063  
1064 - heightManaged.add(card);
1065 - });
1330 + var delta=
1331 + targetTop-relativeTop;
1066 1066  
1067 - return {
1068 - cards:cards.length,
1069 - height:maxHeight,
1070 - firstSection:firstSection
1071 - };
1333 + if(delta>1){
1334 + saveStyle(
1335 + row.el,
1336 + originalMargin,
1337 + "margin-top"
1338 + );
1339 +
1340 + var current=
1341 + num(
1342 + getComputedStyle(
1343 + row.el
1344 + ).marginTop
1345 + );
1346 +
1347 + row.el.style.setProperty(
1348 + "margin-top",
1349 + (
1350 + current+delta
1351 + )+"px"
1352 + );
1353 +
1354 + row.el.setAttribute(
1355 + "data-sn-master-first-row",
1356 + "1"
1357 + );
1358 +
1359 + managedMargin.add(
1360 + row.el
1361 + );
1362 + }
1363 + });
1364 + }
1365 +
1366 + var maxHeight=0;
1367 +
1368 + group.cards.forEach(function(card){
1369 + maxHeight=
1370 + Math.max(
1371 + maxHeight,
1372 + card
1373 + .getBoundingClientRect()
1374 + .height
1375 + );
1376 + });
1377 +
1378 + maxHeight=
1379 + Math.ceil(maxHeight);
1380 +
1381 + group.cards.forEach(function(card){
1382 + saveStyle(
1383 + card,
1384 + originalHeight,
1385 + "min-height"
1386 + );
1387 +
1388 + card.style.setProperty(
1389 + "min-height",
1390 + maxHeight+"px"
1391 + );
1392 +
1393 + card.setAttribute(
1394 + "data-sn-master-equal-height",
1395 + "1"
1396 + );
1397 +
1398 + managedHeight.add(
1399 + card
1400 + );
1401 + });
1402 + });
1072 1072   }
1073 1073  
1074 - function run(){
1075 - reset();
1405 + /* =======================================================
1406 + DETAIL GRID EQUAL HEIGHT, DESKTOP ONLY
1407 + ======================================================= */
1076 1076  
1409 + function equaliseDetailGrids(){
1077 1077   if(
1411 + PAGE_KIND!=="detail"||
1078 1078   window.innerWidth<=MOBILE_MAX
1079 1079   ){
1080 1080   return;
1081 1081   }
1082 1082  
1083 - var parents=
1417 + var selectors=[
1418 + ".arsn-grid",
1419 + ".arsn-grid-2",
1420 + ".arsn-grid-3",
1421 + ".dmp-grid",
1422 + ".ido-grid",
1423 + ".pp-grid"
1424 + ];
1425 +
1426 + selectors.forEach(function(selector){
1084 1084   Array.from(
1085 - root.querySelectorAll("*")
1086 - ).filter(function(parent){
1087 - return (
1088 - visible(parent,MIN_W,MIN_H)&&
1089 - parent.children&&
1090 - parent.children.length>=2&&
1091 - parent.children.length<=MAX_PARENT_CHILDREN
1092 - );
1093 - });
1428 + root.querySelectorAll(selector)
1429 + ).forEach(function(grid){
1430 + var children=
1431 + Array.from(
1432 + grid.children||[]
1433 + ).filter(visible);
1094 1094  
1095 - var touched=new Set();
1435 + if(children.length<2){
1436 + return;
1437 + }
1096 1096  
1097 - parents.forEach(function(parent){
1098 - var entries=[];
1439 + var groups=[];
1099 1099  
1100 - Array.from(parent.children).forEach(function(child){
1101 - if(!visible(child,MIN_W,MIN_H))return;
1441 + children.forEach(function(child){
1442 + var top=
1443 + child
1444 + .getBoundingClientRect()
1445 + .top;
1102 1102  
1103 - var target=pickTarget(child);
1104 - if(!target)return;
1447 + var group=null;
1105 1105  
1106 - entries.push({
1107 - target:target,
1108 - rect:target.getBoundingClientRect()
1449 + for(var i=0;i<groups.length;i++){
1450 + if(
1451 + Math.abs(
1452 + groups[i].top-top
1453 + )<=ROW_TOLERANCE
1454 + ){
1455 + group=groups[i];
1456 + break;
1457 + }
1458 + }
1459 +
1460 + if(!group){
1461 + group={
1462 + top:top,
1463 + items:[]
1464 + };
1465 + groups.push(group);
1466 + }
1467 +
1468 + group.items.push(child);
1109 1109   });
1110 - });
1111 1111  
1112 - if(entries.length<2)return;
1471 + groups.forEach(function(group){
1472 + if(group.items.length<2){
1473 + return;
1474 + }
1113 1113  
1114 - groupsByVisualRow(entries).forEach(function(group){
1115 - if(!validHorizontalGroup(group))return;
1476 + var maxHeight=0;
1116 1116  
1117 - var signature=
1118 - group.entries.map(function(entry){
1119 - return entry.target;
1478 + group.items.forEach(function(item){
1479 + maxHeight=
1480 + Math.max(
1481 + maxHeight,
1482 + item
1483 + .getBoundingClientRect()
1484 + .height
1485 + );
1120 1120   });
1121 1121  
1122 - if(
1123 - !signature.some(function(el){
1124 - return !touched.has(el);
1125 - })
1126 - ){
1127 - return;
1128 - }
1488 + maxHeight=
1489 + Math.ceil(maxHeight);
1129 1129  
1130 - var applied=
1131 - applyGroup(group);
1491 + group.items.forEach(function(item){
1492 + saveStyle(
1493 + item,
1494 + originalHeight,
1495 + "min-height"
1496 + );
1132 1132  
1133 - if(applied){
1134 - signature.forEach(function(el){
1135 - touched.add(el);
1498 + item.style.setProperty(
1499 + "min-height",
1500 + maxHeight+"px"
1501 + );
1502 +
1503 + item.setAttribute(
1504 + "data-sn-master-equal-height",
1505 + "1"
1506 + );
1507 +
1508 + managedHeight.add(item);
1136 1136   });
1137 - }
1510 + });
1138 1138   });
1139 1139   });
1140 1140   }
1141 1141  
1142 - function schedule(){
1143 - if(raf)cancelAnimationFrame(raf);
1515 + /* =======================================================
1516 + RUN / RESPONSIVE SCHEDULING
1517 + ======================================================= */
1144 1144  
1145 - raf=requestAnimationFrame(function(){
1146 - raf=requestAnimationFrame(function(){
1147 - raf=0;
1148 - run();
1149 - });
1150 - });
1519 + function run(){
1520 + if(running)return;
1521 +
1522 + running=true;
1523 +
1524 + try{
1525 + resetRuntime();
1526 + applyPlaceholderBadge();
1527 + propagateDetailAccents();
1528 +
1529 + var headers=
1530 + applyOverviewPalette();
1531 +
1532 + if(
1533 + window.innerWidth>
1534 + MOBILE_MAX
1535 + ){
1536 + alignOverviewCards(
1537 + headers
1538 + );
1539 +
1540 + equaliseDetailGrids();
1541 + }
1542 + }finally{
1543 + running=false;
1544 + }
1151 1151   }
1152 1152  
1153 - addEventListener("resize",schedule,{passive:true});
1154 - addEventListener("load",schedule,{once:true});
1547 + function onResize(){
1548 + if(resizeTimer){
1549 + clearTimeout(
1550 + resizeTimer
1551 + );
1552 + }
1155 1155  
1156 - root.addEventListener(
1157 - "click",
1158 - function(){
1159 - setTimeout(schedule,0);
1160 - },
1161 - true
1162 - );
1554 + resizeTimer=
1555 + setTimeout(
1556 + function(){
1557 + resizeTimer=0;
1558 + run();
1559 + },
1560 + RESIZE_DEBOUNCE
1561 + );
1562 + }
1163 1163  
1164 - Array.from(root.querySelectorAll("img")).forEach(function(img){
1165 - if(!img.complete){
1166 - img.addEventListener("load",schedule,{once:true});
1564 + async function waitForReady(){
1565 + if(
1566 + document.readyState!=="complete"
1567 + ){
1568 + await new Promise(function(resolve){
1569 + window.addEventListener(
1570 + "load",
1571 + resolve,
1572 + {once:true}
1573 + );
1574 + });
1167 1167   }
1168 - });
1169 1169  
1170 - if(document.fonts&&document.fonts.ready){
1171 - document.fonts.ready.then(schedule);
1577 + if(
1578 + document.fonts&&
1579 + document.fonts.ready
1580 + ){
1581 + try{
1582 + await document.fonts.ready;
1583 + }catch(error){}
1584 + }
1585 +
1586 + var images=
1587 + Array.from(
1588 + root.querySelectorAll("img")
1589 + );
1590 +
1591 + await Promise.all(
1592 + images.map(function(img){
1593 + if(img.complete){
1594 + return Promise.resolve();
1595 + }
1596 +
1597 + return new Promise(function(resolve){
1598 + var done=function(){
1599 + resolve();
1600 + };
1601 +
1602 + img.addEventListener(
1603 + "load",
1604 + done,
1605 + {once:true}
1606 + );
1607 +
1608 + img.addEventListener(
1609 + "error",
1610 + done,
1611 + {once:true}
1612 + );
1613 + });
1614 + })
1615 + );
1616 +
1617 + run();
1172 1172   }
1173 1173  
1174 - schedule();
1175 - setTimeout(schedule,200);
1176 - setTimeout(schedule,650);
1177 - setTimeout(schedule,1400);
1620 + window.addEventListener(
1621 + "resize",
1622 + onResize,
1623 + {passive:true}
1624 + );
1625 +
1626 + waitForReady();
1178 1178  })();
1179 1179  </script>
1180 -<!-- SN_HORIZONTAL_BOX_HARMONIZER_END -->
1629 +
1630 +<!-- SN_SERVICE_NAVIGATOR_MASTER_STYLE_END -->
1181 1181  {{/html}}
1182 1182