Changes for page Get Started

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

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