Änderungen von Dokument Art & Research Services Navigator

Zuletzt geändert von Veronika Kocher am Freitag, 18 Sep. 2026 16:47

Von Version 9.3
bearbeitet von Veronika Kocher
am Donnerstag, 03 Sep. 2026 9:34
Änderungskommentar: Es gibt keinen Kommentar für diese Version
Auf Version 11.1
bearbeitet von Veronika Kocher
am Donnerstag, 03 Sep. 2026 13:08
Änderungskommentar: Es gibt keinen Kommentar für diese Version

Zusammenfassung

Details

Seiteneigenschaften
Inhalt
... ... @@ -3,7 +3,6 @@
3 3  Der **Service-Navigator Kunst & Forschung** hilft dir, für jede Phase deines Projekts die passende Orientierung, Services und Ressourcen zu finden.
4 4  
5 5  {{info title="Unterstützung für dein Projekt:"}}
6 -
7 7  
8 8   **Support Kunst und Forschung (SKF)** begleitet Projekt- und Fördervorhaben und arbeitet je nach Bedarf mit den passenden Services der Universität zusammen.
9 9  
... ... @@ -636,23 +636,100 @@
636 636  )))
637 637  
638 638  {{html clean="false"}}
639 -<!-- SN_HORIZONTAL_BOX_HARMONIZER_START -->
640 -<style data-sn-horizontal-box-harmonizer="4">
641 -[data-sn-equal-height-managed],
642 -[data-sn-first-section-aligned]{
638 +<!-- SN_SERVICE_NAVIGATOR_MASTER_STYLE_START -->
639 +
640 +<style data-sn-service-navigator-master="1">
641 +/* =========================================================
642 + MASTER TYPOGRAPHY
643 + ========================================================= */
644 +#xwikicontent h1,
645 +#xwikicontent h2,
646 +#xwikicontent h3,
647 +#xwikicontent h4,
648 +#xwikicontent h5,
649 +#xwikicontent h6,
650 +#xwikicontent .box-title,
651 +#xwikicontent [role="heading"],
652 +#xwikicontent h1 a,
653 +#xwikicontent h2 a,
654 +#xwikicontent h3 a,
655 +#xwikicontent h4 a,
656 +#xwikicontent h5 a,
657 +#xwikicontent h6 a,
658 +#xwikicontent .box-title a,
659 +#xwikicontent [role="heading"] a{
660 + text-align:left!important;
661 + text-justify:auto!important;
662 + word-spacing:normal!important;
663 +}
664 +
665 +/* =========================================================
666 + COMING SOON / IN VORBEREITUNG
667 + ========================================================= */
668 +.sn-coming-soon-badge{
669 + display:inline-block;
670 + vertical-align:middle;
671 + margin-left:10px;
672 + padding:4px 8px;
673 + border-radius:14px;
674 + border:1px solid #efd9cc;
675 + background:#fff4ee;
676 + color:#8a4d36;
677 + font-size:11px;
678 + font-weight:700;
679 + letter-spacing:.055em;
680 + line-height:1.2;
681 + white-space:nowrap;
682 +}
683 +
684 +/* =========================================================
685 + NATIVE / DETAIL CALLOUT GEOMETRY
686 + Preserve existing backgrounds.
687 + ========================================================= */
688 +#xwikicontent .arsn-info,
689 +#xwikicontent .dmp-info,
690 +#xwikicontent .ido-info,
691 +#xwikicontent .pp-info,
692 +#xwikicontent .infomessage{
693 + box-sizing:border-box!important;
694 + border-left:4px solid #21b6d7!important;
695 + border-radius:8px;
696 + text-align:left!important;
697 + word-spacing:normal!important;
698 +}
699 +
700 +#xwikicontent .arsn-warn,
701 +#xwikicontent .dmp-warn,
702 +#xwikicontent .ido-warn,
703 +#xwikicontent .pp-warn,
704 +#xwikicontent .warn,
705 +#xwikicontent .warning,
706 +#xwikicontent .warningmessage,
707 +#xwikicontent .errormessage{
708 + box-sizing:border-box!important;
709 + border-left:4px solid #e94b13!important;
710 + border-radius:8px;
711 + text-align:left!important;
712 + word-spacing:normal!important;
713 +}
714 +
715 +[data-sn-master-equal-height],
716 +[data-sn-master-first-row]{
643 643   box-sizing:border-box;
644 644  }
645 645  </style>
646 -<script data-sn-horizontal-box-harmonizer="4">
720 +
721 +<script data-sn-service-navigator-master="1">
647 647  (function(){
648 648   "use strict";
649 649  
725 + var PAGE_KIND="overview";
726 + var PLACEHOLDER=false;
727 + var PLACEHOLDER_LABEL="IN VORBEREITUNG";
728 +
650 650   var MOBILE_MAX=767;
651 651   var ROW_TOLERANCE=6;
652 - var MIN_W=150;
653 - var MIN_H=36;
654 - var MAX_PARENT_CHILDREN=16;
655 - var SEARCH_DEPTH=5;
731 + var RESIZE_DEBOUNCE=220;
656 656  
657 657   var root=
658 658   document.getElementById("xwikicontent")||
... ... @@ -662,93 +662,105 @@
662 662  
663 663   if(!root)return;
664 664  
665 - var heightManaged=new Set();
666 - var sectionManaged=new Set();
667 - var originalMinHeight=new WeakMap();
668 - var originalMarginTop=new WeakMap();
669 - var raf=0;
741 + var managedHeight=new Set();
742 + var managedMargin=new Set();
743 + var originalHeight=new WeakMap();
744 + var originalMargin=new WeakMap();
670 670  
671 - function num(v){
672 - var n=parseFloat(v);
673 - return Number.isFinite(n)?n:0;
674 - }
746 + var resizeTimer=0;
747 + var running=false;
675 675  
676 - function visible(el,minW,minH){
677 - if(!el||el.nodeType!==1)return false;
678 -
679 - var s=getComputedStyle(el);
680 -
681 - if(
682 - s.display==="none"||
683 - s.visibility==="hidden"||
684 - Number(s.opacity)===0
685 - ){
686 - return false;
749 + var THEMES=[
750 + {
751 + name:"BLUE",
752 + accent:"#21b6d7",
753 + bg:"#eaf7fb",
754 + text:"#315d68",
755 + labels:[
756 + "HIER STARTEN",
757 + "ENTSCHEIDEN",
758 + "ÜBERPRÜFEN & ANPASSEN",
759 + "START HERE",
760 + "DECIDE",
761 + "REVIEW & ADAPT"
762 + ]
763 + },
764 + {
765 + name:"RED",
766 + accent:"#e94b13",
767 + bg:"#fff1ec",
768 + text:"#8a4d36",
769 + labels:[
770 + "PLANEN & ORGANISIEREN",
771 + "ORGANISIEREN & DOKUMENTIEREN",
772 + "PUBLIZIEREN & PRÄSENTIEREN",
773 + "PLAN & ORGANISE",
774 + "PLAN & ORGANIZE",
775 + "ORGANISE & DOCUMENT",
776 + "ORGANIZE & DOCUMENT",
777 + "PUBLISH & PRESENT"
778 + ]
779 + },
780 + {
781 + name:"YELLOW",
782 + accent:"#f0aa00",
783 + bg:"#fff8e7",
784 + text:"#785b17",
785 + labels:[
786 + "SCHÜTZEN & KLÄREN",
787 + "STANDARDISIEREN & IDENTIFIZIEREN",
788 + "ÖFFNEN, NACHNUTZEN & AUFFINDBAR MACHEN",
789 + "PROTECT & CLARIFY",
790 + "STANDARDISE & IDENTIFY",
791 + "STANDARDIZE & IDENTIFY",
792 + "OPEN, REUSE & MAKE FINDABLE"
793 + ]
794 + },
795 + {
796 + name:"GREEN",
797 + accent:"#38b76a",
798 + bg:"#edf9f1",
799 + text:"#3f7451",
800 + labels:[
801 + "INFRASTRUKTUR EINRICHTEN",
802 + "INFRASTRUKTUR & ZUSAMMENARBEIT EINRICHTEN",
803 + "SPEICHERN & ZUGRIFF STEUERN",
804 + "REPOSITORIUM, ERHALTEN & ÜBERGEBEN",
805 + "SET UP INFRASTRUCTURE",
806 + "SET UP INFRASTRUCTURE & COLLABORATION",
807 + "STORE & CONTROL ACCESS",
808 + "REPOSITORY, PRESERVE & HAND OVER"
809 + ]
687 687   }
811 + ];
688 688  
689 - var r=el.getBoundingClientRect();
690 -
691 - return (
692 - r.width>=(minW||1)&&
693 - r.height>=(minH||1)
694 - );
813 + function num(value){
814 + var n=parseFloat(value);
815 + return Number.isFinite(n)?n:0;
695 695   }
696 696  
697 - function excluded(el){
698 - return (
699 - !el.matches||
700 - el.matches(
701 - "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]"
702 - )
703 - );
818 + function norm(value){
819 + return String(value||"")
820 + .replace(/\s+/g," ")
821 + .trim()
822 + .toUpperCase();
704 704   }
705 705  
706 - function namedLikeBox(el){
707 - var c=
708 - typeof el.className==="string"
709 - ? el.className
710 - : "";
825 + function visible(el){
826 + if(!el||el.nodeType!==1)return false;
711 711  
712 - return /(^|[s_-])(box|card|tile|panel|role|check|service|source|call|area|detail|resource|topic|warn|info)([s_-]|$)/i.test(c);
713 - }
828 + var style=getComputedStyle(el);
829 + var rect=el.getBoundingClientRect();
714 714  
715 - function boxLike(el){
716 - if(!visible(el,MIN_W,MIN_H)||excluded(el))return false;
717 -
718 - var s=getComputedStyle(el);
719 - var r=el.getBoundingClientRect();
720 -
721 - var border=
722 - num(s.borderTopWidth)+
723 - num(s.borderRightWidth)+
724 - num(s.borderBottomWidth)+
725 - num(s.borderLeftWidth);
726 -
727 - var radius=Math.max(
728 - num(s.borderTopLeftRadius),
729 - num(s.borderTopRightRadius),
730 - num(s.borderBottomLeftRadius),
731 - num(s.borderBottomRightRadius)
732 - );
733 -
734 - var bg=
735 - s.backgroundColor&&
736 - s.backgroundColor!=="rgba(0, 0, 0, 0)"&&
737 - s.backgroundColor!=="transparent";
738 -
739 - var shadow=
740 - s.boxShadow&&
741 - s.boxShadow!=="none";
742 -
743 743   return (
744 - namedLikeBox(el)||
745 - border>=1||
746 - (bg&&radius>=3)||
747 - (shadow&&r.width>=180)
832 + style.display!=="none"&&
833 + style.visibility!=="hidden"&&
834 + rect.width>20&&
835 + rect.height>4
748 748   );
749 749   }
750 750  
751 - function saveOriginal(el,map,property){
839 + function saveStyle(el,map,property){
752 752   if(map.has(el))return;
753 753  
754 754   map.set(el,{
... ... @@ -757,7 +757,7 @@
757 757   });
758 758   }
759 759  
760 - function restoreOriginal(el,map,property){
848 + function restoreStyle(el,map,property){
761 761   var original=map.get(el);
762 762  
763 763   if(original&&original.value){
... ... @@ -771,247 +771,249 @@
771 771   }
772 772   }
773 773  
774 - function reset(){
775 - heightManaged.forEach(function(el){
776 - restoreOriginal(
862 + function resetRuntime(){
863 + managedHeight.forEach(function(el){
864 + restoreStyle(
777 777   el,
778 - originalMinHeight,
866 + originalHeight,
779 779   "min-height"
780 780   );
781 -
782 782   el.removeAttribute(
783 - "data-sn-equal-height-managed"
870 + "data-sn-master-equal-height"
784 784   );
785 785   });
786 786  
787 - sectionManaged.forEach(function(el){
788 - restoreOriginal(
874 + managedMargin.forEach(function(el){
875 + restoreStyle(
789 789   el,
790 - originalMarginTop,
877 + originalMargin,
791 791   "margin-top"
792 792   );
793 -
794 794   el.removeAttribute(
795 - "data-sn-first-section-aligned"
881 + "data-sn-master-first-row"
796 796   );
797 797   });
798 798  
799 - heightManaged.clear();
800 - sectionManaged.clear();
885 + managedHeight.clear();
886 + managedMargin.clear();
801 801   }
802 802  
803 - function pickTarget(child){
804 - if(!visible(child,MIN_W,MIN_H))return null;
889 + function themeFor(text){
890 + var value=norm(text);
805 805  
806 - if(boxLike(child)){
807 - return child;
892 + for(var i=0;i<THEMES.length;i++){
893 + for(var j=0;j<THEMES[i].labels.length;j++){
894 + var label=THEMES[i].labels[j];
895 +
896 + if(
897 + value===label||
898 + value.indexOf(label+" ")===0||
899 + value.indexOf(label+" -")===0||
900 + value.indexOf(label+" ·")===0
901 + ){
902 + return THEMES[i];
903 + }
904 + }
808 808   }
809 809  
810 - var cr=child.getBoundingClientRect();
811 - var q=[];
907 + return null;
908 + }
812 812  
813 - Array.from(child.children||[]).forEach(function(el){
814 - q.push({el:el,depth:1});
815 - });
910 + /* =======================================================
911 + PLACEHOLDER BADGE
912 + ======================================================= */
816 816  
817 - var best=null;
818 - var bestScore=-Infinity;
914 + function applyPlaceholderBadge(){
915 + if(!PLACEHOLDER)return;
819 819  
820 - while(q.length){
821 - var item=q.shift();
822 - var el=item.el;
917 + if(
918 + document.querySelector(
919 + ".sn-coming-soon-badge"
920 + )
921 + ){
922 + return;
923 + }
823 823  
824 - if(!visible(el,MIN_W,MIN_H))continue;
925 + var title=
926 + document.querySelector(
927 + "#document-title"
928 + )||
929 + document.querySelector(
930 + "h1"
931 + );
825 825  
826 - var r=el.getBoundingClientRect();
933 + if(!title)return;
827 827  
828 - if(
829 - r.width>=cr.width*.68&&
830 - boxLike(el)
831 - ){
832 - var widthFit=
833 - 1-Math.min(
834 - 1,
835 - Math.abs(cr.width-r.width)/
836 - Math.max(1,cr.width)
837 - );
935 + var badge=
936 + document.createElement(
937 + "span"
938 + );
838 838  
839 - var topFit=
840 - 1-Math.min(
841 - 1,
842 - Math.abs(cr.top-r.top)/100
843 - );
940 + badge.className=
941 + "sn-coming-soon-badge";
844 844  
845 - var score=
846 - widthFit*6+
847 - topFit*3+
848 - Math.min(r.height,900)/450+
849 - Math.min(r.width*r.height,900000)/900000;
943 + badge.textContent=
944 + PLACEHOLDER_LABEL;
850 850  
851 - if(score>bestScore){
852 - best=el;
853 - bestScore=score;
854 - }
855 - }
946 + badge.setAttribute(
947 + "aria-label",
948 + PLACEHOLDER_LABEL
949 + );
856 856  
857 - if(item.depth<SEARCH_DEPTH){
858 - Array.from(el.children||[]).forEach(function(next){
859 - q.push({
860 - el:next,
861 - depth:item.depth+1
862 - });
863 - });
864 - }
865 - }
866 -
867 - return best;
951 + title.appendChild(
952 + badge
953 + );
868 868   }
869 869  
870 - function groupsByVisualRow(entries){
871 - var groups=[];
956 + /* =======================================================
957 + DETAIL PAGE OWN-ACCENT PROPAGATION
958 + ======================================================= */
872 872  
873 - entries
874 - .slice()
875 - .sort(function(a,b){
876 - return (
877 - a.rect.top-b.rect.top||
878 - a.rect.left-b.rect.left
879 - );
880 - })
881 - .forEach(function(entry){
882 - var group=null;
960 + function parseRGB(value){
961 + var match=String(value||"").match(
962 + /rgba?\(\s*([\d.]+)\s*,\s*([\d.]+)\s*,\s*([\d.]+)/i
963 + );
883 883  
884 - for(var i=0;i<groups.length;i++){
885 - if(
886 - Math.abs(
887 - groups[i].top-
888 - entry.rect.top
889 - )<=ROW_TOLERANCE
890 - ){
891 - group=groups[i];
892 - break;
893 - }
894 - }
965 + if(!match)return null;
895 895  
896 - if(!group){
897 - group={
898 - top:entry.rect.top,
899 - entries:[]
900 - };
901 - groups.push(group);
902 - }
967 + return [
968 + Number(match[1]),
969 + Number(match[2]),
970 + Number(match[3])
971 + ];
972 + }
903 903  
904 - group.entries.push(entry);
905 - });
906 -
907 - return groups;
974 + function distance(a,b){
975 + return Math.sqrt(
976 + Math.pow(a[0]-b[0],2)+
977 + Math.pow(a[1]-b[1],2)+
978 + Math.pow(a[2]-b[2],2)
979 + );
908 908   }
909 909  
910 - function validHorizontalGroup(group){
911 - if(group.entries.length<2)return false;
982 + function paletteMatch(cssColor){
983 + var rgb=parseRGB(cssColor);
912 912  
913 - var lefts=
914 - group.entries
915 - .map(function(e){return e.rect.left;})
916 - .sort(function(a,b){return a-b;});
985 + if(!rgb)return null;
917 917  
918 - if(
919 - lefts[lefts.length-1]-
920 - lefts[0]<
921 - 80
922 - ){
923 - return false;
924 - }
987 + var palette=[
988 + {hex:"#21b6d7",rgb:[33,182,215]},
989 + {hex:"#e94b13",rgb:[233,75,19]},
990 + {hex:"#f0aa00",rgb:[240,170,0]},
991 + {hex:"#38b76a",rgb:[56,183,106]}
992 + ];
925 925  
926 - var widths=
927 - group.entries
928 - .map(function(e){return e.rect.width;})
929 - .filter(function(w){return w>0;});
994 + var best=null;
995 + var bestDistance=Infinity;
930 930  
931 - if(widths.length<2)return false;
997 + palette.forEach(function(item){
998 + var d=distance(rgb,item.rgb);
932 932  
933 - var minWidth=Math.min.apply(Math,widths);
934 - var maxWidth=Math.max.apply(Math,widths);
1000 + if(d<bestDistance){
1001 + best=item;
1002 + bestDistance=d;
1003 + }
1004 + });
935 935  
936 - return (
937 - maxWidth/
938 - Math.max(1,minWidth)<=
939 - 1.9
940 - );
1006 + return bestDistance<=30
1007 + ?best
1008 + :null;
941 941   }
942 942  
943 - function normalizeText(text){
944 - return String(text||"")
945 - .replace(/s+/g," ")
946 - .trim()
947 - .toUpperCase();
948 - }
1011 + function propagateDetailAccents(){
1012 + if(PAGE_KIND!=="detail")return;
949 949  
950 - function exactKnownFirstSection(el){
951 - var text=normalizeText(el.textContent);
952 -
953 - return (
954 - text==="HIER STARTEN"||
955 - text==="ORGANISIEREN & DOKUMENTIEREN"||
956 - text==="ENTSCHEIDEN"||
957 - text==="START HERE"||
958 - text==="GET STARTED"||
959 - text==="ORGANISE & DOCUMENT"||
960 - text==="ORGANIZE & DOCUMENT"||
961 - text==="DECIDE"
962 - );
963 - }
964 -
965 - function visuallyFirstSectionBar(card){
966 - var cardRect=card.getBoundingClientRect();
967 - var candidates=[];
968 -
969 969   Array.from(
970 - card.querySelectorAll(
971 - "div,p,span,strong,h3,h4,h5,h6"
1015 + root.querySelectorAll(
1016 + ".arsn-call,.dmp-call,.ido-call,.pp-call,"+
1017 + ".arsn-source,.dmp-source,.ido-source,.pp-source"
972 972   )
973 973   ).forEach(function(el){
974 - if(!visible(el,20,6))return;
975 - if(excluded(el))return;
1020 + if(!visible(el))return;
976 976  
977 - var r=el.getBoundingClientRect();
978 - var relativeTop=r.top-cardRect.top;
1022 + var style=getComputedStyle(el);
979 979  
980 980   if(
981 - relativeTop<45||
982 - relativeTop>cardRect.height*.72
1025 + num(style.borderTopWidth)>=2
983 983   ){
984 - return;
1027 + var match=
1028 + paletteMatch(
1029 + style.borderTopColor
1030 + );
1031 +
1032 + if(match){
1033 + el.style.setProperty(
1034 + "border-left",
1035 + "4px solid "+match.hex,
1036 + "important"
1037 + );
1038 + }
985 985   }
1040 + });
986 986  
987 - var widthRatio=
988 - r.width/
989 - Math.max(1,cardRect.width);
1042 + // Warning families: explicit safety override.
1043 + Array.from(
1044 + root.querySelectorAll(
1045 + ".arsn-warn,.dmp-warn,.ido-warn,.pp-warn,"+
1046 + ".warn,.warning,.warningmessage,.errormessage"
1047 + )
1048 + ).forEach(function(el){
1049 + if(!visible(el))return;
990 990  
991 - if(
992 - widthRatio<.55||
993 - widthRatio>1.05||
994 - r.height>54
995 - ){
996 - return;
997 - }
1051 + el.style.setProperty(
1052 + "border-left",
1053 + "4px solid #e94b13",
1054 + "important"
1055 + );
1056 + });
998 998  
999 - var text=normalizeText(el.textContent);
1058 + // Info families: explicit orientation override.
1059 + Array.from(
1060 + root.querySelectorAll(
1061 + ".arsn-info,.dmp-info,.ido-info,.pp-info,.infomessage"
1062 + )
1063 + ).forEach(function(el){
1064 + if(!visible(el))return;
1000 1000  
1001 - if(
1002 - text.length<2||
1003 - text.length>90
1004 - ){
1005 - return;
1006 - }
1066 + el.style.setProperty(
1067 + "border-left",
1068 + "4px solid #21b6d7",
1069 + "important"
1070 + );
1071 + });
1072 + }
1007 1007  
1008 - var style=getComputedStyle(el);
1074 + /* =======================================================
1075 + OVERVIEW SEMANTIC THEME PALETTE
1076 + ======================================================= */
1009 1009  
1010 - var bg=
1011 - style.backgroundColor&&
1012 - style.backgroundColor!=="rgba(0, 0, 0, 0)"&&
1013 - style.backgroundColor!=="transparent";
1078 + function smallestThemeHeaders(){
1079 + return Array.from(
1080 + root.querySelectorAll(
1081 + "div,span,p,strong,h3,h4,h5,h6"
1082 + )
1083 + ).filter(function(el){
1084 + if(!visible(el))return false;
1085 + if(!themeFor(el.textContent))return false;
1014 1014  
1087 + return !Array.from(
1088 + el.children||[]
1089 + ).some(function(child){
1090 + return !!themeFor(
1091 + child.textContent
1092 + );
1093 + });
1094 + });
1095 + }
1096 +
1097 + function findOverviewCard(header){
1098 + var node=header.parentElement;
1099 + var candidates=[];
1100 +
1101 + while(node&&node!==root){
1102 + var rect=node.getBoundingClientRect();
1103 + var style=getComputedStyle(node);
1104 +
1015 1015   var border=
1016 1016   num(style.borderTopWidth)+
1017 1017   num(style.borderRightWidth)+
... ... @@ -1018,315 +1018,674 @@
1018 1018   num(style.borderBottomWidth)+
1019 1019   num(style.borderLeftWidth);
1020 1020  
1021 - var mostlyUpper=
1022 - text.length>=3&&
1023 - text===text.toUpperCase();
1024 -
1025 - var exact=exactKnownFirstSection(el);
1026 -
1027 - var score=
1028 - (exact?20:0)+
1029 - (bg?6:0)+
1030 - (border>=1?2:0)+
1031 - (mostlyUpper?4:0)+
1032 - (num(style.fontWeight)>=600?1:0);
1033 -
1034 - if(score>=7){
1035 - candidates.push({
1036 - el:el,
1037 - relativeTop:relativeTop,
1038 - width:r.width,
1039 - score:score
1040 - });
1111 + if(
1112 + rect.width>=220&&
1113 + rect.width<=800&&
1114 + rect.height>=120&&
1115 + border>=1
1116 + ){
1117 + candidates.push(node);
1041 1041   }
1042 - });
1043 1043  
1120 + node=node.parentElement;
1121 + }
1122 +
1044 1044   if(!candidates.length)return null;
1045 1045  
1046 1046   candidates.sort(function(a,b){
1047 - if(a.score!==b.score)return b.score-a.score;
1048 - if(Math.abs(a.relativeTop-b.relativeTop)>3){
1049 - return a.relativeTop-b.relativeTop;
1050 - }
1051 - return b.width-a.width;
1126 + return (
1127 + b.getBoundingClientRect().height-
1128 + a.getBoundingClientRect().height
1129 + );
1052 1052   });
1053 1053  
1054 - // For exact known labels always prefer the earliest exact match.
1055 - var exacts=candidates.filter(function(c){
1056 - return exactKnownFirstSection(c.el);
1057 - });
1132 + return candidates[0];
1133 + }
1058 1058  
1059 - if(exacts.length){
1060 - exacts.sort(function(a,b){
1061 - return a.relativeTop-b.relativeTop||b.width-a.width;
1062 - });
1063 - return exacts[0].el;
1064 - }
1135 + function rowCandidates(link,card){
1136 + var result=[];
1137 + var cardRect=
1138 + card.getBoundingClientRect();
1065 1065  
1066 - // Generic fallback: earliest high-confidence bar.
1067 - candidates.sort(function(a,b){
1068 - return a.relativeTop-b.relativeTop||b.score-a.score||b.width-a.width;
1069 - });
1140 + var node=link;
1070 1070  
1071 - return candidates[0].el;
1072 - }
1142 + while(node&&node!==card){
1143 + if(visible(node)){
1144 + var rect=
1145 + node.getBoundingClientRect();
1073 1073  
1074 - function alignFirstSections(cards){
1075 - var rows=
1076 - cards.map(function(card){
1077 - var bar=
1078 - visuallyFirstSectionBar(card);
1147 + if(
1148 + rect.height<=105&&
1149 + rect.width>=
1150 + cardRect.width*.50&&
1151 + rect.width<=
1152 + cardRect.width*1.03
1153 + ){
1154 + result.push(node);
1155 + }
1156 + }
1079 1079  
1080 - if(!bar)return null;
1158 + node=node.parentElement;
1159 + }
1081 1081  
1082 - var cardRect=
1083 - card.getBoundingClientRect();
1161 + return result;
1162 + }
1084 1084  
1085 - var barRect=
1086 - bar.getBoundingClientRect();
1164 + function chooseOuterRow(
1165 + candidates,
1166 + link
1167 + ){
1168 + if(!candidates.length){
1169 + return link;
1170 + }
1087 1087  
1088 - return {
1089 - card:card,
1090 - bar:bar,
1091 - relativeTop:
1092 - barRect.top-cardRect.top,
1093 - label:
1094 - normalizeText(bar.textContent)
1095 - };
1172 + var bordered=
1173 + candidates.filter(function(el){
1174 + return (
1175 + num(
1176 + getComputedStyle(el)
1177 + .borderLeftWidth
1178 + )>=1
1179 + );
1096 1096   });
1097 1097  
1098 - // Conservative: only align when every card in the horizontal row
1099 - // has a reliable first section bar.
1100 - if(
1101 - rows.some(function(row){
1102 - return !row;
1103 - })
1104 - ){
1105 - return null;
1182 + var pool=
1183 + bordered.length
1184 + ?bordered
1185 + :candidates;
1186 +
1187 + pool.sort(function(a,b){
1188 + var ar=
1189 + a.getBoundingClientRect();
1190 +
1191 + var br=
1192 + b.getBoundingClientRect();
1193 +
1194 + return (
1195 + ar.left-br.left||
1196 + br.width-ar.width
1197 + );
1198 + });
1199 +
1200 + return pool[0]||link;
1201 + }
1202 +
1203 + function applyOverviewPalette(){
1204 + if(PAGE_KIND!=="overview"){
1205 + return [];
1106 1106   }
1107 1107  
1108 - var targetTop=
1109 - Math.max.apply(
1110 - Math,
1111 - rows.map(function(row){
1112 - return row.relativeTop;
1208 + var headers=
1209 + smallestThemeHeaders()
1210 + .map(function(el){
1211 + return {
1212 + el:el,
1213 + theme:
1214 + themeFor(
1215 + el.textContent
1216 + ),
1217 + card:
1218 + findOverviewCard(
1219 + el
1220 + )
1221 + };
1113 1113   })
1114 - );
1223 + .filter(function(row){
1224 + return !!row.card;
1225 + });
1115 1115  
1116 - rows.forEach(function(row){
1117 - var delta=
1118 - targetTop-
1119 - row.relativeTop;
1227 + var unique=[];
1228 + var seenHeaders=new Set();
1120 1120  
1121 - if(delta<=1)return;
1230 + headers.forEach(function(row){
1231 + var key=
1232 + row.theme.name+
1233 + "|"+
1234 + Math.round(
1235 + row.card
1236 + .getBoundingClientRect()
1237 + .left
1238 + )+
1239 + "|"+
1240 + Math.round(
1241 + row.el
1242 + .getBoundingClientRect()
1243 + .top
1244 + );
1122 1122  
1123 - saveOriginal(
1124 - row.bar,
1125 - originalMarginTop,
1126 - "margin-top"
1246 + if(!seenHeaders.has(key)){
1247 + seenHeaders.add(key);
1248 + unique.push(row);
1249 + }
1250 + });
1251 +
1252 + unique.forEach(function(row){
1253 + var headerRect=
1254 + row.el
1255 + .getBoundingClientRect();
1256 +
1257 + row.el.style.setProperty(
1258 + "background",
1259 + row.theme.bg,
1260 + "important"
1127 1127   );
1128 1128  
1129 - var currentMargin=
1130 - num(
1131 - getComputedStyle(
1132 - row.bar
1133 - ).marginTop
1134 - );
1263 + row.el.style.setProperty(
1264 + "color",
1265 + row.theme.text,
1266 + "important"
1267 + );
1135 1135  
1136 - row.bar.style.setProperty(
1137 - "margin-top",
1138 - (
1139 - currentMargin+
1140 - delta
1141 - )+"px"
1269 + row.el.style.setProperty(
1270 + "text-align",
1271 + "left",
1272 + "important"
1142 1142   );
1143 1143  
1144 - row.bar.setAttribute(
1145 - "data-sn-first-section-aligned",
1146 - "4"
1275 + row.el.style.setProperty(
1276 + "word-spacing",
1277 + "normal",
1278 + "important"
1147 1147   );
1148 1148  
1149 - sectionManaged.add(row.bar);
1281 + var later=
1282 + unique
1283 + .filter(function(other){
1284 + return (
1285 + other.card===row.card&&
1286 + other.el
1287 + .getBoundingClientRect()
1288 + .top>
1289 + headerRect.top+2
1290 + );
1291 + })
1292 + .sort(function(a,b){
1293 + return (
1294 + a.el
1295 + .getBoundingClientRect()
1296 + .top-
1297 + b.el
1298 + .getBoundingClientRect()
1299 + .top
1300 + );
1301 + });
1302 +
1303 + var stopTop=
1304 + later.length
1305 + ?later[0].el
1306 + .getBoundingClientRect()
1307 + .top
1308 + :Infinity;
1309 +
1310 + Array.from(
1311 + row.card.querySelectorAll("a")
1312 + ).forEach(function(link){
1313 + if(!visible(link))return;
1314 +
1315 + var rect=
1316 + link.getBoundingClientRect();
1317 +
1318 + if(
1319 + rect.top<=
1320 + headerRect.bottom-2||
1321 + rect.top>=
1322 + stopTop-2
1323 + ){
1324 + return;
1325 + }
1326 +
1327 + var candidates=
1328 + rowCandidates(
1329 + link,
1330 + row.card
1331 + );
1332 +
1333 + var target=
1334 + chooseOuterRow(
1335 + candidates,
1336 + link
1337 + );
1338 +
1339 + candidates.forEach(function(el){
1340 + el.style.setProperty(
1341 + "border-left",
1342 + "0 solid transparent",
1343 + "important"
1344 + );
1345 + });
1346 +
1347 + target.style.setProperty(
1348 + "border-left",
1349 + "3px solid "+
1350 + row.theme.accent,
1351 + "important"
1352 + );
1353 +
1354 + target.style.setProperty(
1355 + "box-sizing",
1356 + "border-box",
1357 + "important"
1358 + );
1359 + });
1150 1150   });
1151 1151  
1152 - return {
1153 - labels:
1154 - rows.map(function(row){
1155 - return row.label;
1156 - }),
1157 - targetRelativeTop:
1158 - Math.round(targetTop)
1159 - };
1362 + return unique;
1160 1160   }
1161 1161  
1162 - function applyGroup(group){
1163 - if(!validHorizontalGroup(group)){
1164 - return null;
1365 + /* =======================================================
1366 + OVERVIEW CARD HEIGHT + FIRST THEMATIC ROW
1367 + ======================================================= */
1368 +
1369 + function alignOverviewCards(headers){
1370 + if(
1371 + PAGE_KIND!=="overview"||
1372 + window.innerWidth<=MOBILE_MAX
1373 + ){
1374 + return;
1165 1165   }
1166 1166  
1167 1167   var cards=[];
1168 1168   var seen=new Set();
1169 1169  
1170 - group.entries.forEach(function(entry){
1171 - if(!seen.has(entry.target)){
1172 - seen.add(entry.target);
1173 - cards.push(entry.target);
1380 + headers.forEach(function(row){
1381 + if(!seen.has(row.card)){
1382 + seen.add(row.card);
1383 + cards.push(row.card);
1174 1174   }
1175 1175   });
1176 1176  
1177 - if(cards.length<2)return null;
1387 + if(cards.length<2){
1388 + return;
1389 + }
1178 1178  
1179 - var firstSection=
1180 - alignFirstSections(cards);
1391 + // Group cards by actual top position.
1392 + var groups=[];
1181 1181  
1182 - // The section alignment can change natural card heights.
1183 - // Measure only afterwards.
1184 - var maxHeight=0;
1185 -
1186 1186   cards.forEach(function(card){
1187 - maxHeight=Math.max(
1188 - maxHeight,
1189 - card.getBoundingClientRect().height
1190 - );
1395 + var top=
1396 + card.getBoundingClientRect().top;
1397 +
1398 + var group=null;
1399 +
1400 + for(var i=0;i<groups.length;i++){
1401 + if(
1402 + Math.abs(
1403 + groups[i].top-top
1404 + )<=ROW_TOLERANCE
1405 + ){
1406 + group=groups[i];
1407 + break;
1408 + }
1409 + }
1410 +
1411 + if(!group){
1412 + group={
1413 + top:top,
1414 + cards:[]
1415 + };
1416 + groups.push(group);
1417 + }
1418 +
1419 + group.cards.push(card);
1191 1191   });
1192 1192  
1193 - maxHeight=Math.ceil(maxHeight);
1422 + groups.forEach(function(group){
1423 + if(group.cards.length<2){
1424 + return;
1425 + }
1194 1194  
1195 - if(maxHeight<MIN_H)return null;
1427 + var firstHeaders=
1428 + group.cards.map(function(card){
1429 + var candidates=
1430 + headers
1431 + .filter(function(row){
1432 + return row.card===card;
1433 + })
1434 + .sort(function(a,b){
1435 + return (
1436 + a.el
1437 + .getBoundingClientRect()
1438 + .top-
1439 + b.el
1440 + .getBoundingClientRect()
1441 + .top
1442 + );
1443 + });
1196 1196  
1197 - cards.forEach(function(card){
1198 - saveOriginal(
1199 - card,
1200 - originalMinHeight,
1201 - "min-height"
1202 - );
1445 + return candidates.length
1446 + ?candidates[0]
1447 + :null;
1448 + });
1203 1203  
1204 - card.style.setProperty(
1205 - "min-height",
1206 - maxHeight+"px"
1207 - );
1450 + if(
1451 + !firstHeaders.some(function(row){
1452 + return !row;
1453 + })
1454 + ){
1455 + var targetTop=
1456 + Math.max.apply(
1457 + Math,
1458 + firstHeaders.map(function(row){
1459 + return (
1460 + row.el
1461 + .getBoundingClientRect()
1462 + .top-
1463 + row.card
1464 + .getBoundingClientRect()
1465 + .top
1466 + );
1467 + })
1468 + );
1208 1208  
1209 - card.setAttribute(
1210 - "data-sn-equal-height-managed",
1211 - "4"
1212 - );
1470 + firstHeaders.forEach(function(row){
1471 + var relativeTop=
1472 + row.el
1473 + .getBoundingClientRect()
1474 + .top-
1475 + row.card
1476 + .getBoundingClientRect()
1477 + .top;
1213 1213  
1214 - heightManaged.add(card);
1215 - });
1479 + var delta=
1480 + targetTop-relativeTop;
1216 1216  
1217 - return {
1218 - cards:cards.length,
1219 - height:maxHeight,
1220 - firstSection:firstSection
1221 - };
1482 + if(delta>1){
1483 + saveStyle(
1484 + row.el,
1485 + originalMargin,
1486 + "margin-top"
1487 + );
1488 +
1489 + var current=
1490 + num(
1491 + getComputedStyle(
1492 + row.el
1493 + ).marginTop
1494 + );
1495 +
1496 + row.el.style.setProperty(
1497 + "margin-top",
1498 + (
1499 + current+delta
1500 + )+"px"
1501 + );
1502 +
1503 + row.el.setAttribute(
1504 + "data-sn-master-first-row",
1505 + "1"
1506 + );
1507 +
1508 + managedMargin.add(
1509 + row.el
1510 + );
1511 + }
1512 + });
1513 + }
1514 +
1515 + var maxHeight=0;
1516 +
1517 + group.cards.forEach(function(card){
1518 + maxHeight=
1519 + Math.max(
1520 + maxHeight,
1521 + card
1522 + .getBoundingClientRect()
1523 + .height
1524 + );
1525 + });
1526 +
1527 + maxHeight=
1528 + Math.ceil(maxHeight);
1529 +
1530 + group.cards.forEach(function(card){
1531 + saveStyle(
1532 + card,
1533 + originalHeight,
1534 + "min-height"
1535 + );
1536 +
1537 + card.style.setProperty(
1538 + "min-height",
1539 + maxHeight+"px"
1540 + );
1541 +
1542 + card.setAttribute(
1543 + "data-sn-master-equal-height",
1544 + "1"
1545 + );
1546 +
1547 + managedHeight.add(
1548 + card
1549 + );
1550 + });
1551 + });
1222 1222   }
1223 1223  
1224 - function run(){
1225 - reset();
1554 + /* =======================================================
1555 + DETAIL GRID EQUAL HEIGHT, DESKTOP ONLY
1556 + ======================================================= */
1226 1226  
1558 + function equaliseDetailGrids(){
1227 1227   if(
1560 + PAGE_KIND!=="detail"||
1228 1228   window.innerWidth<=MOBILE_MAX
1229 1229   ){
1230 1230   return;
1231 1231   }
1232 1232  
1233 - var parents=
1566 + var selectors=[
1567 + ".arsn-grid",
1568 + ".arsn-grid-2",
1569 + ".arsn-grid-3",
1570 + ".dmp-grid",
1571 + ".ido-grid",
1572 + ".pp-grid"
1573 + ];
1574 +
1575 + selectors.forEach(function(selector){
1234 1234   Array.from(
1235 - root.querySelectorAll("*")
1236 - ).filter(function(parent){
1237 - return (
1238 - visible(parent,MIN_W,MIN_H)&&
1239 - parent.children&&
1240 - parent.children.length>=2&&
1241 - parent.children.length<=MAX_PARENT_CHILDREN
1242 - );
1243 - });
1577 + root.querySelectorAll(selector)
1578 + ).forEach(function(grid){
1579 + var children=
1580 + Array.from(
1581 + grid.children||[]
1582 + ).filter(visible);
1244 1244  
1245 - var touched=new Set();
1584 + if(children.length<2){
1585 + return;
1586 + }
1246 1246  
1247 - parents.forEach(function(parent){
1248 - var entries=[];
1588 + var groups=[];
1249 1249  
1250 - Array.from(parent.children).forEach(function(child){
1251 - if(!visible(child,MIN_W,MIN_H))return;
1590 + children.forEach(function(child){
1591 + var top=
1592 + child
1593 + .getBoundingClientRect()
1594 + .top;
1252 1252  
1253 - var target=pickTarget(child);
1254 - if(!target)return;
1596 + var group=null;
1255 1255  
1256 - entries.push({
1257 - target:target,
1258 - rect:target.getBoundingClientRect()
1598 + for(var i=0;i<groups.length;i++){
1599 + if(
1600 + Math.abs(
1601 + groups[i].top-top
1602 + )<=ROW_TOLERANCE
1603 + ){
1604 + group=groups[i];
1605 + break;
1606 + }
1607 + }
1608 +
1609 + if(!group){
1610 + group={
1611 + top:top,
1612 + items:[]
1613 + };
1614 + groups.push(group);
1615 + }
1616 +
1617 + group.items.push(child);
1259 1259   });
1260 - });
1261 1261  
1262 - if(entries.length<2)return;
1620 + groups.forEach(function(group){
1621 + if(group.items.length<2){
1622 + return;
1623 + }
1263 1263  
1264 - groupsByVisualRow(entries).forEach(function(group){
1265 - if(!validHorizontalGroup(group))return;
1625 + var maxHeight=0;
1266 1266  
1267 - var signature=
1268 - group.entries.map(function(entry){
1269 - return entry.target;
1627 + group.items.forEach(function(item){
1628 + maxHeight=
1629 + Math.max(
1630 + maxHeight,
1631 + item
1632 + .getBoundingClientRect()
1633 + .height
1634 + );
1270 1270   });
1271 1271  
1272 - if(
1273 - !signature.some(function(el){
1274 - return !touched.has(el);
1275 - })
1276 - ){
1277 - return;
1278 - }
1637 + maxHeight=
1638 + Math.ceil(maxHeight);
1279 1279  
1280 - var applied=
1281 - applyGroup(group);
1640 + group.items.forEach(function(item){
1641 + saveStyle(
1642 + item,
1643 + originalHeight,
1644 + "min-height"
1645 + );
1282 1282  
1283 - if(applied){
1284 - signature.forEach(function(el){
1285 - touched.add(el);
1647 + item.style.setProperty(
1648 + "min-height",
1649 + maxHeight+"px"
1650 + );
1651 +
1652 + item.setAttribute(
1653 + "data-sn-master-equal-height",
1654 + "1"
1655 + );
1656 +
1657 + managedHeight.add(item);
1286 1286   });
1287 - }
1659 + });
1288 1288   });
1289 1289   });
1290 1290   }
1291 1291  
1292 - function schedule(){
1293 - if(raf)cancelAnimationFrame(raf);
1664 + /* =======================================================
1665 + RUN / RESPONSIVE SCHEDULING
1666 + ======================================================= */
1294 1294  
1295 - raf=requestAnimationFrame(function(){
1296 - raf=requestAnimationFrame(function(){
1297 - raf=0;
1298 - run();
1299 - });
1300 - });
1668 + function run(){
1669 + if(running)return;
1670 +
1671 + running=true;
1672 +
1673 + try{
1674 + resetRuntime();
1675 + applyPlaceholderBadge();
1676 + propagateDetailAccents();
1677 +
1678 + var headers=
1679 + applyOverviewPalette();
1680 +
1681 + if(
1682 + window.innerWidth>
1683 + MOBILE_MAX
1684 + ){
1685 + alignOverviewCards(
1686 + headers
1687 + );
1688 +
1689 + equaliseDetailGrids();
1690 + }
1691 + }finally{
1692 + running=false;
1693 + }
1301 1301   }
1302 1302  
1303 - addEventListener("resize",schedule,{passive:true});
1304 - addEventListener("load",schedule,{once:true});
1696 + function onResize(){
1697 + if(resizeTimer){
1698 + clearTimeout(
1699 + resizeTimer
1700 + );
1701 + }
1305 1305  
1306 - root.addEventListener(
1307 - "click",
1308 - function(){
1309 - setTimeout(schedule,0);
1310 - },
1311 - true
1312 - );
1703 + resizeTimer=
1704 + setTimeout(
1705 + function(){
1706 + resizeTimer=0;
1707 + run();
1708 + },
1709 + RESIZE_DEBOUNCE
1710 + );
1711 + }
1313 1313  
1314 - Array.from(root.querySelectorAll("img")).forEach(function(img){
1315 - if(!img.complete){
1316 - img.addEventListener("load",schedule,{once:true});
1713 + async function waitForReady(){
1714 + if(
1715 + document.readyState!=="complete"
1716 + ){
1717 + await new Promise(function(resolve){
1718 + window.addEventListener(
1719 + "load",
1720 + resolve,
1721 + {once:true}
1722 + );
1723 + });
1317 1317   }
1318 - });
1319 1319  
1320 - if(document.fonts&&document.fonts.ready){
1321 - document.fonts.ready.then(schedule);
1726 + if(
1727 + document.fonts&&
1728 + document.fonts.ready
1729 + ){
1730 + try{
1731 + await document.fonts.ready;
1732 + }catch(error){}
1733 + }
1734 +
1735 + var images=
1736 + Array.from(
1737 + root.querySelectorAll("img")
1738 + );
1739 +
1740 + await Promise.all(
1741 + images.map(function(img){
1742 + if(img.complete){
1743 + return Promise.resolve();
1744 + }
1745 +
1746 + return new Promise(function(resolve){
1747 + var done=function(){
1748 + resolve();
1749 + };
1750 +
1751 + img.addEventListener(
1752 + "load",
1753 + done,
1754 + {once:true}
1755 + );
1756 +
1757 + img.addEventListener(
1758 + "error",
1759 + done,
1760 + {once:true}
1761 + );
1762 + });
1763 + })
1764 + );
1765 +
1766 + run();
1322 1322   }
1323 1323  
1324 - schedule();
1325 - setTimeout(schedule,200);
1326 - setTimeout(schedule,650);
1327 - setTimeout(schedule,1400);
1769 + window.addEventListener(
1770 + "resize",
1771 + onResize,
1772 + {passive:true}
1773 + );
1774 +
1775 + waitForReady();
1328 1328  })();
1329 1329  </script>
1330 -<!-- SN_HORIZONTAL_BOX_HARMONIZER_END -->
1778 +
1779 +<!-- SN_SERVICE_NAVIGATOR_MASTER_STYLE_END -->
1331 1331  {{/html}}
1332 1332