Changes for page Get Started

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

From version 8.6
edited by Veronika Kocher
on Thursday, 03 Sep 2026 10:09
Change comment: There is no comment for this version
To version 8.10
edited by Veronika Kocher
on Friday, 04 Sep 2026 14:23
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;">ENABLE · GET STARTED · AUSTRIA</div>
45 + <div class="arsn-eyebrow" style="color:#8a4d36;margin-bottom:5px;">PREPARE · 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,15 +432,24 @@
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 +
435 435  </div>
436 436  {{/html}}
437 437  
438 -\n\n
439 -\n\n{{html clean="false"}}
440 -<!-- SN_HORIZONTAL_BOX_HARMONIZER_START -->
446 +{{html clean="false"}}
447 +<!-- SN_SERVICE_NAVIGATOR_MASTER_STYLE_START -->
441 441  
442 -<style data-sn-horizontal-box-harmonizer="7">
443 -/* ---------- Typography: never justify headings ---------- */
449 +<style data-sn-service-navigator-master="1">
450 +/* =========================================================
451 + MASTER TYPOGRAPHY
452 + ========================================================= */
444 444  #xwikicontent h1,
445 445  #xwikicontent h2,
446 446  #xwikicontent h3,
... ... @@ -462,88 +462,105 @@
462 462   word-spacing:normal!important;
463 463  }
464 464  
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"]{
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{
475 475   box-sizing:border-box!important;
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;
503 + border-left:4px solid #21b6d7!important;
504 + border-radius:8px;
482 482   text-align:left!important;
483 - text-justify:auto!important;
484 484   word-spacing:normal!important;
485 - box-shadow:none!important;
486 486  }
487 487  
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,
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,
507 507  #xwikicontent .errormessage{
508 - --sn-callout-accent:#e94b13;
509 - background:#fff1ec!important;
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;
510 510  }
511 511  
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;
524 +[data-sn-master-equal-height],
525 +[data-sn-master-first-row]{
526 + box-sizing:border-box;
518 518  }
519 519  
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;
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;
526 526  }
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;
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;
532 532  }
533 533  </style>
534 534  
535 -<script data-sn-horizontal-box-harmonizer="7">
562 +<script data-sn-service-navigator-master="1">
536 536  (function(){
537 537   "use strict";
538 538  
566 + var PAGE_KIND="detail";
567 + var PLACEHOLDER=false;
568 + var PLACEHOLDER_LABEL="COMING SOON";
569 +
539 539   var MOBILE_MAX=767;
540 540   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;
545 545   var RESIZE_DEBOUNCE=220;
546 - var MIN_WIDTH_CHANGE=2;
547 547  
548 548   var root=
549 549   document.getElementById("xwikicontent")||
... ... @@ -553,142 +553,114 @@
553 553  
554 554   if(!root)return;
555 555  
556 - var heightManaged=new Set();
557 - var sectionManaged=new Set();
558 - var contentManaged=new Set();
582 + var managedHeight=new Set();
583 + var managedMargin=new Set();
584 + var originalHeight=new WeakMap();
585 + var originalMargin=new WeakMap();
559 559  
560 - var originalMinHeight=new WeakMap();
561 - var originalMarginTop=new WeakMap();
562 -
563 563   var resizeTimer=0;
564 - var lastWidth=-1;
565 - var hasApplied=false;
566 - var applying=false;
588 + var running=false;
567 567  
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;
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 + ]
584 584   }
652 + ];
585 585  
586 - var r=el.getBoundingClientRect();
587 -
588 - return (
589 - r.width>=(minW||1)&&
590 - r.height>=(minH||1)
591 - );
654 + function num(value){
655 + var n=parseFloat(value);
656 + return Number.isFinite(n)?n:0;
592 592   }
593 593  
594 - function normalizeText(text){
595 - return String(text||"")
659 + function norm(value){
660 + return String(value||"")
596 596   .replace(/\s+/g," ")
597 597   .trim()
598 598   .toUpperCase();
599 599   }
600 600  
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 - }
666 + function visible(el){
667 + if(!el||el.nodeType!==1)return false;
609 609  
610 - /* ---------- Custom coloured callouts ---------- */
669 + var style=getComputedStyle(el);
670 + var rect=el.getBoundingClientRect();
611 611  
612 - function nativeCallout(el){
613 - var c=
614 - typeof el.className==="string"
615 - ? el.className.toLowerCase()
616 - : "";
617 -
618 618   return (
619 - /(^|\s)(infomessage|warningmessage|successmessage|errormessage)(\s|$)/.test(c)
673 + style.display!=="none"&&
674 + style.visibility!=="hidden"&&
675 + rect.width>20&&
676 + rect.height>4
620 620   );
621 621   }
622 622  
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){
680 + function saveStyle(el,map,property){
677 677   if(map.has(el))return;
678 678  
679 679   map.set(el,{
680 - value:
681 - el.style.getPropertyValue(
682 - property
683 - ),
684 - priority:
685 - el.style.getPropertyPriority(
686 - property
687 - )
684 + value:el.style.getPropertyValue(property),
685 + priority:el.style.getPropertyPriority(property)
688 688   });
689 689   }
690 690  
691 - function restoreOriginal(el,map,property){
689 + function restoreStyle(el,map,property){
692 692   var original=map.get(el);
693 693  
694 694   if(original&&original.value){
... ... @@ -698,770 +698,1069 @@
698 698   original.priority||""
699 699   );
700 700   }else{
701 - el.style.removeProperty(
702 - property
703 - );
699 + el.style.removeProperty(property);
704 704   }
705 705   }
706 706  
707 707   function resetRuntime(){
708 - heightManaged.forEach(function(el){
709 - restoreOriginal(
704 + managedHeight.forEach(function(el){
705 + restoreStyle(
710 710   el,
711 - originalMinHeight,
707 + originalHeight,
712 712   "min-height"
713 713   );
714 -
715 715   el.removeAttribute(
716 - "data-sn-equal-height-managed"
711 + "data-sn-master-equal-height"
717 717   );
718 718   });
719 719  
720 - sectionManaged.forEach(function(el){
721 - restoreOriginal(
715 + managedMargin.forEach(function(el){
716 + restoreStyle(
722 722   el,
723 - originalMarginTop,
718 + originalMargin,
724 724   "margin-top"
725 725   );
726 -
727 727   el.removeAttribute(
728 - "data-sn-first-section-aligned"
722 + "data-sn-master-first-row"
729 729   );
730 730   });
731 731  
732 - contentManaged.forEach(function(el){
733 - restoreOriginal(
734 - el,
735 - originalMarginTop,
736 - "margin-top"
737 - );
726 + managedHeight.clear();
727 + managedMargin.clear();
728 + }
738 738  
739 - el.removeAttribute(
740 - "data-sn-first-content-aligned"
741 - );
742 - });
730 + function themeFor(text){
731 + var value=norm(text);
743 743  
744 - heightManaged.clear();
745 - sectionManaged.clear();
746 - contentManaged.clear();
747 - }
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];
748 748  
749 - /* ---------- Card detection ---------- */
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 + }
750 750  
751 - function namedLikeBox(el){
752 - var c=
753 - typeof el.className==="string"
754 - ? el.className
755 - : "";
748 + return null;
749 + }
756 756  
757 - return /(^|[\s_-])(box|card|tile|panel|role|check|service|source|call|area|detail|resource|topic|warn|info)([\s_-]|$)/i.test(c);
751 + /* =======================================================
752 + BORDERLESS FILLED RED/ORANGE CTA BUTTONS
753 + ======================================================= */
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 + );
758 758   }
759 759  
760 - function boxLike(el){
761 - if(
762 - !visible(el,MIN_W,MIN_H)||
763 - excluded(el)
764 - ){
765 - return false;
766 - }
763 + function makeFilledRedOrangeCTAsBorderless(){
764 + var RED_ORANGE=[233,75,19];
767 767  
768 - var s=getComputedStyle(el);
769 - var r=el.getBoundingClientRect();
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;
770 770  
771 - var border=
772 - num(s.borderTopWidth)+
773 - num(s.borderRightWidth)+
774 - num(s.borderBottomWidth)+
775 - num(s.borderLeftWidth);
773 + var style=getComputedStyle(el);
774 + var rgb=parseRGB(style.backgroundColor);
776 776  
777 - var radius=Math.max(
778 - num(s.borderTopLeftRadius),
779 - num(s.borderTopRightRadius),
780 - num(s.borderBottomLeftRadius),
781 - num(s.borderBottomRightRadius)
782 - );
776 + if(!rgb)return;
783 783  
784 - var bg=
785 - s.backgroundColor&&
786 - s.backgroundColor!=="rgba(0, 0, 0, 0)"&&
787 - s.backgroundColor!=="transparent";
778 + if(
779 + colourDistance(
780 + rgb,
781 + RED_ORANGE
782 + )>55
783 + ){
784 + return;
785 + }
788 788  
789 - var shadow=
790 - s.boxShadow&&
791 - s.boxShadow!=="none";
787 + var rect=el.getBoundingClientRect();
792 792  
793 - return (
794 - namedLikeBox(el)||
795 - border>=1||
796 - (bg&&radius>=3)||
797 - (shadow&&r.width>=180)
798 - );
799 - }
789 + if(
790 + rect.width<80||
791 + rect.height<24
792 + ){
793 + return;
794 + }
800 800  
801 - function pickTarget(child){
802 - if(!visible(child,MIN_W,MIN_H))return null;
796 + el.style.setProperty(
797 + "border",
798 + "none",
799 + "important"
800 + );
803 803  
804 - if(boxLike(child))return child;
802 + el.style.setProperty(
803 + "border-left",
804 + "none",
805 + "important"
806 + );
805 805  
806 - var cr=child.getBoundingClientRect();
807 - var q=[];
808 + el.style.setProperty(
809 + "border-top",
810 + "none",
811 + "important"
812 + );
808 808  
809 - Array.from(child.children||[]).forEach(function(el){
810 - q.push({el:el,depth:1});
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 + );
811 811   });
832 + }
812 812  
813 - var best=null;
814 - var bestScore=-Infinity;
834 + /* =======================================================
835 + FULL-WIDTH THREE-LINE AREA LABELS
836 + ======================================================= */
815 815  
816 - while(q.length){
817 - var item=q.shift();
818 - var el=item.el;
838 + function compactText(value){
839 + return String(value||"")
840 + .replace(/\s+/g," ")
841 + .trim();
842 + }
819 819  
820 - if(!visible(el,MIN_W,MIN_H))continue;
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 + }
821 821  
822 - var r=el.getBoundingClientRect();
858 + var number=
859 + label.querySelector(
860 + ":scope > .arsn-area-number"
861 + );
823 823  
863 + var action=
864 + label.querySelector(
865 + ":scope > .arsn-area-action"
866 + );
867 +
824 824   if(
825 - r.width>=cr.width*.68&&
826 - boxLike(el)
869 + !number||
870 + !action
827 827   ){
828 - var widthFit=
829 - 1-Math.min(
830 - 1,
831 - Math.abs(cr.width-r.width)/
832 - Math.max(1,cr.width)
833 - );
872 + return;
873 + }
834 834  
835 - var topFit=
836 - 1-Math.min(
837 - 1,
838 - Math.abs(cr.top-r.top)/100
839 - );
875 + var clone=
876 + label.cloneNode(true);
840 840  
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;
878 + var cloneNumber=
879 + clone.querySelector(
880 + ":scope > .arsn-area-number"
881 + );
846 846  
847 - if(score>bestScore){
848 - best=el;
849 - bestScore=score;
850 - }
883 + var cloneAction=
884 + clone.querySelector(
885 + ":scope > .arsn-area-action"
886 + );
887 +
888 + if(cloneNumber){
889 + cloneNumber.remove();
851 851   }
852 852  
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 - });
892 + if(cloneAction){
893 + cloneAction.remove();
860 860   }
861 - }
862 862  
863 - return best;
864 - }
896 + var titleText=
897 + compactText(
898 + clone.textContent
899 + );
865 865  
866 - function groupRows(entries){
867 - var groups=[];
901 + if(!titleText){
902 + return;
903 + }
868 868  
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
905 + var numberNode=
906 + number.cloneNode(true);
907 +
908 + var actionNode=
909 + action.cloneNode(true);
910 +
911 + var titleNode=
912 + document.createElement(
913 + "span"
875 875   );
876 - })
877 - .forEach(function(entry){
878 - var group=null;
879 879  
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 - }
916 + titleNode.className=
917 + "sn-area-label-title";
891 891  
892 - if(!group){
893 - group={
894 - top:entry.rect.top,
895 - entries:[]
896 - };
897 - groups.push(group);
898 - }
919 + titleNode.textContent=
920 + titleText;
899 899  
900 - group.entries.push(entry);
901 - });
922 + while(label.firstChild){
923 + label.removeChild(
924 + label.firstChild
925 + );
926 + }
902 902  
903 - return groups;
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 + });
904 904   }
905 905  
906 - function validRow(group){
907 - if(group.entries.length<2)return false;
972 + /* =======================================================
973 + PLACEHOLDER BADGE
974 + ======================================================= */
908 908  
909 - var lefts=
910 - group.entries
911 - .map(function(e){return e.rect.left;})
912 - .sort(function(a,b){return a-b;});
976 + function applyPlaceholderBadge(){
977 + if(!PLACEHOLDER)return;
913 913  
914 914   if(
915 - lefts[lefts.length-1]-
916 - lefts[0]<
917 - 80
980 + document.querySelector(
981 + ".sn-coming-soon-badge"
982 + )
918 918   ){
919 - return false;
984 + return;
920 920   }
921 921  
922 - var widths=
923 - group.entries
924 - .map(function(e){return e.rect.width;})
925 - .filter(function(w){return w>0;});
987 + var title=
988 + document.querySelector(
989 + "#document-title"
990 + )||
991 + document.querySelector(
992 + "h1"
993 + );
926 926  
927 - if(widths.length<2)return false;
995 + if(!title)return;
928 928  
929 - var minW=
930 - Math.min.apply(Math,widths);
997 + var badge=
998 + document.createElement(
999 + "span"
1000 + );
931 931  
932 - var maxW=
933 - Math.max.apply(Math,widths);
1002 + badge.className=
1003 + "sn-coming-soon-badge";
934 934  
935 - return (
936 - maxW/
937 - Math.max(1,minW)<=
938 - 1.9
1005 + badge.textContent=
1006 + PLACEHOLDER_LABEL;
1007 +
1008 + badge.setAttribute(
1009 + "aria-label",
1010 + PLACEHOLDER_LABEL
939 939   );
940 - }
941 941  
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"
1013 + title.appendChild(
1014 + badge
959 959   );
960 960   }
961 961  
962 - function findKnownBar(card){
963 - var cardRect=
964 - card.getBoundingClientRect();
1018 + /* =======================================================
1019 + DETAIL PAGE OWN-ACCENT PROPAGATION
1020 + ======================================================= */
965 965  
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;
1022 + function parseRGB(value){
1023 + var match=String(value||"").match(
1024 + /rgba?\(\s*([\d.]+)\s*,\s*([\d.]+)\s*,\s*([\d.]+)/i
1025 + );
975 975  
976 - var r=el.getBoundingClientRect();
1027 + if(!match)return null;
977 977  
978 - var rel=
979 - r.top-
980 - cardRect.top;
1029 + return [
1030 + Number(match[1]),
1031 + Number(match[2]),
1032 + Number(match[3])
1033 + ];
1034 + }
981 981  
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;
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 + );
996 996   }
997 997  
998 - function alignKnownBars(cards){
999 - var rows=
1000 - cards.map(function(card){
1001 - var bar=
1002 - findKnownBar(card);
1044 + function paletteMatch(cssColor){
1045 + var rgb=parseRGB(cssColor);
1003 1003  
1004 - if(!bar)return null;
1047 + if(!rgb)return null;
1005 1005  
1006 - var cr=
1007 - card.getBoundingClientRect();
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 + ];
1008 1008  
1009 - var br=
1010 - bar.getBoundingClientRect();
1056 + var best=null;
1057 + var bestDistance=Infinity;
1011 1011  
1012 - return {
1013 - bar:bar,
1014 - relativeTop:
1015 - br.top-
1016 - cr.top
1017 - };
1018 - });
1059 + palette.forEach(function(item){
1060 + var d=distance(rgb,item.rgb);
1019 1019  
1020 - if(
1021 - rows.some(function(row){
1022 - return !row;
1023 - })
1024 - ){
1025 - return false;
1026 - }
1062 + if(d<bestDistance){
1063 + best=item;
1064 + bestDistance=d;
1065 + }
1066 + });
1027 1027  
1028 - var target=
1029 - Math.max.apply(
1030 - Math,
1031 - rows.map(function(row){
1032 - return row.relativeTop;
1033 - })
1034 - );
1068 + return bestDistance<=30
1069 + ?best
1070 + :null;
1071 + }
1035 1035  
1036 - rows.forEach(function(row){
1037 - var delta=
1038 - target-
1039 - row.relativeTop;
1073 + function propagateDetailAccents(){
1074 + if(PAGE_KIND!=="detail")return;
1040 1040  
1041 - if(delta<=1)return;
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;
1042 1042  
1043 - saveOriginal(
1044 - row.bar,
1045 - originalMarginTop,
1046 - "margin-top"
1047 - );
1084 + var style=getComputedStyle(el);
1048 1048  
1049 - var current=
1050 - num(
1051 - getComputedStyle(
1052 - row.bar
1053 - ).marginTop
1054 - );
1086 + if(
1087 + num(style.borderTopWidth)>=2
1088 + ){
1089 + var match=
1090 + paletteMatch(
1091 + style.borderTopColor
1092 + );
1055 1055  
1056 - row.bar.style.setProperty(
1057 - "margin-top",
1058 - (
1059 - current+
1060 - delta
1061 - )+"px"
1062 - );
1094 + if(match){
1095 + el.style.setProperty(
1096 + "border-left",
1097 + "4px solid "+match.hex,
1098 + "important"
1099 + );
1100 + }
1101 + }
1102 + });
1063 1063  
1064 - row.bar.setAttribute(
1065 - "data-sn-first-section-aligned",
1066 - "7"
1067 - );
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;
1068 1068  
1069 - sectionManaged.add(
1070 - row.bar
1113 + el.style.setProperty(
1114 + "border-left",
1115 + "4px solid #e94b13",
1116 + "important"
1071 1071   );
1072 1072   });
1073 1073  
1074 - return true;
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"
1132 + );
1133 + });
1075 1075   }
1076 1076  
1077 - /* ---------- Generic first content after heading ---------- */
1136 + /* =======================================================
1137 + OVERVIEW SEMANTIC THEME PALETTE
1138 + ======================================================= */
1078 1078  
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 - )
1140 + function smallestThemeHeaders(){
1141 + return Array.from(
1142 + root.querySelectorAll(
1143 + "div,span,p,strong,h3,h4,h5,h6"
1088 1088   )
1089 - .filter(function(el){
1090 - if(!visible(el,20,8))return false;
1145 + ).filter(function(el){
1146 + if(!visible(el))return false;
1147 + if(!themeFor(el.textContent))return false;
1091 1091  
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 - )
1149 + return !Array.from(
1150 + el.children||[]
1151 + ).some(function(child){
1152 + return !!themeFor(
1153 + child.textContent
1105 1105   );
1106 - })
1107 - .sort(function(a,b){
1108 - return (
1109 - a.getBoundingClientRect().top-
1110 - b.getBoundingClientRect().top
1111 - );
1112 1112   });
1113 -
1114 - return rows[0]||null;
1156 + });
1115 1115   }
1116 1116  
1117 - function firstContent(card,h){
1118 - if(!h)return null;
1159 + function findOverviewCard(header){
1160 + var node=header.parentElement;
1161 + var candidates=[];
1119 1119  
1120 - var cr=
1121 - card.getBoundingClientRect();
1163 + while(node&&node!==root){
1164 + var rect=node.getBoundingClientRect();
1165 + var style=getComputedStyle(node);
1122 1122  
1123 - var hr=
1124 - h.getBoundingClientRect();
1167 + var border=
1168 + num(style.borderTopWidth)+
1169 + num(style.borderRightWidth)+
1170 + num(style.borderBottomWidth)+
1171 + num(style.borderLeftWidth);
1125 1125  
1126 - var rows=
1127 - Array.from(
1128 - card.querySelectorAll(
1129 - "p,div,ul,ol,dl,blockquote"
1130 - )
1131 - )
1132 - .filter(function(el){
1133 - if(
1134 - el===h||
1135 - h.contains(el)||
1136 - el.contains(h)
1137 - ){
1138 - return false;
1139 - }
1173 + if(
1174 + rect.width>=220&&
1175 + rect.width<=800&&
1176 + rect.height>=120&&
1177 + border>=1
1178 + ){
1179 + candidates.push(node);
1180 + }
1140 1140  
1141 - if(!visible(el,30,8))return false;
1182 + node=node.parentElement;
1183 + }
1142 1142  
1143 - var text=
1144 - String(el.textContent||"")
1145 - .replace(/\s+/g," ")
1146 - .trim();
1185 + if(!candidates.length)return null;
1147 1147  
1148 - if(text.length<3)return false;
1187 + candidates.sort(function(a,b){
1188 + return (
1189 + b.getBoundingClientRect().height-
1190 + a.getBoundingClientRect().height
1191 + );
1192 + });
1149 1149  
1150 - var r=el.getBoundingClientRect();
1194 + return candidates[0];
1195 + }
1151 1151  
1152 - if(
1153 - r.top<
1154 - hr.bottom-1
1155 - ){
1156 - return false;
1157 - }
1197 + function rowCandidates(link,card){
1198 + var result=[];
1199 + var cardRect=
1200 + card.getBoundingClientRect();
1158 1158  
1159 - if(
1160 - r.top-cr.top>
1161 - Math.min(
1162 - 280,
1163 - cr.height*.65
1164 - )
1165 - ){
1166 - return false;
1167 - }
1202 + var node=link;
1168 1168  
1204 + while(node&&node!==card){
1205 + if(visible(node)){
1206 + var rect=
1207 + node.getBoundingClientRect();
1208 +
1169 1169   if(
1170 - r.height>
1171 - cr.height*.58
1210 + rect.height<=105&&
1211 + rect.width>=
1212 + cardRect.width*.50&&
1213 + rect.width<=
1214 + cardRect.width*1.03
1172 1172   ){
1173 - return false;
1216 + result.push(node);
1174 1174   }
1218 + }
1175 1175  
1176 - return true;
1177 - })
1178 - .sort(function(a,b){
1179 - var ar=
1180 - a.getBoundingClientRect();
1220 + node=node.parentElement;
1221 + }
1181 1181  
1182 - var br=
1183 - b.getBoundingClientRect();
1223 + return result;
1224 + }
1184 1184  
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){
1185 1185   return (
1186 - ar.top-br.top||
1187 - ar.height-br.height
1237 + num(
1238 + getComputedStyle(el)
1239 + .borderLeftWidth
1240 + )>=1
1188 1188   );
1189 1189   });
1190 1190  
1191 - return rows[0]||null;
1192 - }
1244 + var pool=
1245 + bordered.length
1246 + ?bordered
1247 + :candidates;
1193 1193  
1194 - function alignGeneric(cards){
1195 - var rows=
1196 - cards.map(function(card){
1197 - var h=
1198 - heading(card);
1249 + pool.sort(function(a,b){
1250 + var ar=
1251 + a.getBoundingClientRect();
1199 1199  
1200 - var c=
1201 - firstContent(
1202 - card,
1203 - h
1204 - );
1253 + var br=
1254 + b.getBoundingClientRect();
1205 1205  
1206 - if(!h||!c)return null;
1256 + return (
1257 + ar.left-br.left||
1258 + br.width-ar.width
1259 + );
1260 + });
1207 1207  
1208 - var cr=
1209 - card.getBoundingClientRect();
1262 + return pool[0]||link;
1263 + }
1210 1210  
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;
1265 + function applyOverviewPalette(){
1266 + if(PAGE_KIND!=="overview"){
1267 + return [];
1227 1227   }
1228 1228  
1229 - var target=
1230 - Math.max.apply(
1231 - Math,
1232 - rows.map(function(row){
1233 - return row.relativeTop;
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 + };
1234 1234   })
1235 - );
1285 + .filter(function(row){
1286 + return !!row.card;
1287 + });
1236 1236  
1237 - rows.forEach(function(row){
1238 - var delta=
1239 - target-
1240 - row.relativeTop;
1289 + var unique=[];
1290 + var seenHeaders=new Set();
1241 1241  
1242 - if(delta<=1)return;
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 + );
1243 1243  
1244 - saveOriginal(
1245 - row.content,
1246 - originalMarginTop,
1247 - "margin-top"
1248 - );
1308 + if(!seenHeaders.has(key)){
1309 + seenHeaders.add(key);
1310 + unique.push(row);
1311 + }
1312 + });
1249 1249  
1250 - var current=
1251 - num(
1252 - getComputedStyle(
1253 - row.content
1254 - ).marginTop
1255 - );
1314 + unique.forEach(function(row){
1315 + var headerRect=
1316 + row.el
1317 + .getBoundingClientRect();
1256 1256  
1257 - row.content.style.setProperty(
1258 - "margin-top",
1259 - (
1260 - current+
1261 - delta
1262 - )+"px"
1319 + row.el.style.setProperty(
1320 + "background",
1321 + row.theme.bg,
1322 + "important"
1263 1263   );
1264 1264  
1265 - row.content.setAttribute(
1266 - "data-sn-first-content-aligned",
1267 - "7"
1325 + row.el.style.setProperty(
1326 + "color",
1327 + row.theme.text,
1328 + "important"
1268 1268   );
1269 1269  
1270 - contentManaged.add(
1271 - row.content
1331 + row.el.style.setProperty(
1332 + "text-align",
1333 + "left",
1334 + "important"
1272 1272   );
1336 +
1337 + row.el.style.setProperty(
1338 + "word-spacing",
1339 + "normal",
1340 + "important"
1341 + );
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 + });
1273 1273   });
1274 1274  
1275 - return true;
1424 + return unique;
1276 1276   }
1277 1277  
1278 - function applyRow(group){
1279 - if(!validRow(group))return false;
1427 + /* =======================================================
1428 + OVERVIEW CARD HEIGHT + FIRST THEMATIC ROW
1429 + ======================================================= */
1280 1280  
1431 + function alignOverviewCards(headers){
1432 + if(
1433 + PAGE_KIND!=="overview"||
1434 + window.innerWidth<=MOBILE_MAX
1435 + ){
1436 + return;
1437 + }
1438 +
1281 1281   var cards=[];
1282 1282   var seen=new Set();
1283 1283  
1284 - group.entries.forEach(function(entry){
1285 - if(!seen.has(entry.target)){
1286 - seen.add(entry.target);
1287 - cards.push(entry.target);
1442 + headers.forEach(function(row){
1443 + if(!seen.has(row.card)){
1444 + seen.add(row.card);
1445 + cards.push(row.card);
1288 1288   }
1289 1289   });
1290 1290  
1291 - if(cards.length<2)return false;
1292 -
1293 - if(
1294 - !alignKnownBars(cards)
1295 - ){
1296 - alignGeneric(cards);
1449 + if(cards.length<2){
1450 + return;
1297 1297   }
1298 1298  
1299 - var maxHeight=0;
1453 + // Group cards by actual top position.
1454 + var groups=[];
1300 1300  
1301 1301   cards.forEach(function(card){
1302 - maxHeight=
1303 - Math.max(
1304 - maxHeight,
1305 - card.getBoundingClientRect().height
1306 - );
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);
1307 1307   });
1308 1308  
1309 - maxHeight=
1310 - Math.ceil(
1311 - maxHeight
1312 - );
1484 + groups.forEach(function(group){
1485 + if(group.cards.length<2){
1486 + return;
1487 + }
1313 1313  
1314 - if(maxHeight<MIN_H)return false;
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 + });
1315 1315  
1316 - cards.forEach(function(card){
1317 - saveOriginal(
1318 - card,
1319 - originalMinHeight,
1320 - "min-height"
1321 - );
1507 + return candidates.length
1508 + ?candidates[0]
1509 + :null;
1510 + });
1322 1322  
1323 - card.style.setProperty(
1324 - "min-height",
1325 - maxHeight+"px"
1326 - );
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 + );
1327 1327  
1328 - card.setAttribute(
1329 - "data-sn-equal-height-managed",
1330 - "7"
1331 - );
1532 + firstHeaders.forEach(function(row){
1533 + var relativeTop=
1534 + row.el
1535 + .getBoundingClientRect()
1536 + .top-
1537 + row.card
1538 + .getBoundingClientRect()
1539 + .top;
1332 1332  
1333 - heightManaged.add(card);
1334 - });
1541 + var delta=
1542 + targetTop-relativeTop;
1335 1335  
1336 - return true;
1337 - }
1544 + if(delta>1){
1545 + saveStyle(
1546 + row.el,
1547 + originalMargin,
1548 + "margin-top"
1549 + );
1338 1338  
1339 - function calculate(force){
1340 - if(applying)return;
1551 + var current=
1552 + num(
1553 + getComputedStyle(
1554 + row.el
1555 + ).marginTop
1556 + );
1341 1341  
1342 - var width=
1343 - Math.round(
1344 - window.innerWidth
1345 - );
1558 + row.el.style.setProperty(
1559 + "margin-top",
1560 + (
1561 + current+delta
1562 + )+"px"
1563 + );
1346 1346  
1347 - var meaningful=
1348 - lastWidth<0||
1349 - Math.abs(
1350 - width-
1351 - lastWidth
1352 - )>=
1353 - MIN_WIDTH_CHANGE;
1565 + row.el.setAttribute(
1566 + "data-sn-master-first-row",
1567 + "1"
1568 + );
1354 1354  
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(){
1355 1355   if(
1356 - hasApplied&&
1357 - !force&&
1358 - !meaningful
1622 + PAGE_KIND!=="detail"||
1623 + window.innerWidth<=MOBILE_MAX
1359 1359   ){
1360 1360   return;
1361 1361   }
1362 1362  
1363 - applying=true;
1628 + var selectors=[
1629 + ".arsn-grid",
1630 + ".arsn-grid-2",
1631 + ".arsn-grid-3",
1632 + ".dmp-grid",
1633 + ".ido-grid",
1634 + ".pp-grid"
1635 + ];
1364 1364  
1365 - try{
1366 - harmoniseCustomCallouts();
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);
1367 1367  
1368 - if(width<=MOBILE_MAX){
1369 - if(hasApplied){
1370 - resetRuntime();
1646 + if(children.length<2){
1647 + return;
1371 1371   }
1372 1372  
1373 - hasApplied=false;
1374 - lastWidth=width;
1375 - return;
1376 - }
1650 + var groups=[];
1377 1377  
1378 - if(hasApplied){
1379 - resetRuntime();
1380 - }
1652 + children.forEach(function(child){
1653 + var top=
1654 + child
1655 + .getBoundingClientRect()
1656 + .top;
1381 1381  
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 - });
1658 + var group=null;
1399 1399  
1400 - var touched=
1401 - new Set();
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 + }
1402 1402  
1403 - parents.forEach(function(parent){
1404 - var entries=[];
1671 + if(!group){
1672 + group={
1673 + top:top,
1674 + items:[]
1675 + };
1676 + groups.push(group);
1677 + }
1405 1405  
1406 - Array.from(
1407 - parent.children
1408 - ).forEach(function(child){
1409 - if(
1410 - !visible(
1411 - child,
1412 - MIN_W,
1413 - MIN_H
1414 - )
1415 - ){
1679 + group.items.push(child);
1680 + });
1681 +
1682 + groups.forEach(function(group){
1683 + if(group.items.length<2){
1416 1416   return;
1417 1417   }
1418 1418  
1419 - var target=
1420 - pickTarget(child);
1687 + var maxHeight=0;
1421 1421  
1422 - if(!target)return;
1423 -
1424 - entries.push({
1425 - target:target,
1426 - rect:
1427 - target.getBoundingClientRect()
1689 + group.items.forEach(function(item){
1690 + maxHeight=
1691 + Math.max(
1692 + maxHeight,
1693 + item
1694 + .getBoundingClientRect()
1695 + .height
1696 + );
1428 1428   });
1429 - });
1430 1430  
1431 - groupRows(
1432 - entries
1433 - ).forEach(function(group){
1434 - if(!validRow(group))return;
1699 + maxHeight=
1700 + Math.ceil(maxHeight);
1435 1435  
1436 - var targets=
1437 - group.entries.map(function(entry){
1438 - return entry.target;
1439 - });
1702 + group.items.forEach(function(item){
1703 + saveStyle(
1704 + item,
1705 + originalHeight,
1706 + "min-height"
1707 + );
1440 1440  
1441 - if(
1442 - !targets.some(function(el){
1443 - return !touched.has(el);
1444 - })
1445 - ){
1446 - return;
1447 - }
1709 + item.style.setProperty(
1710 + "min-height",
1711 + maxHeight+"px"
1712 + );
1448 1448  
1449 - if(applyRow(group)){
1450 - targets.forEach(function(el){
1451 - touched.add(el);
1452 - });
1453 - }
1714 + item.setAttribute(
1715 + "data-sn-master-equal-height",
1716 + "1"
1717 + );
1718 +
1719 + managedHeight.add(item);
1720 + });
1454 1454   });
1455 1455   });
1723 + });
1724 + }
1456 1456  
1457 - lastWidth=width;
1458 - hasApplied=true;
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 + }
1459 1459   }finally{
1460 - applying=false;
1757 + running=false;
1461 1461   }
1462 1462   }
1463 1463  
1464 - function resize(){
1761 + function onResize(){
1465 1465   if(resizeTimer){
1466 1466   clearTimeout(
1467 1467   resizeTimer
... ... @@ -1472,19 +1472,40 @@
1472 1472   setTimeout(
1473 1473   function(){
1474 1474   resizeTimer=0;
1475 - calculate(false);
1772 + run();
1476 1476   },
1477 1477   RESIZE_DEBOUNCE
1478 1478   );
1479 1479   }
1480 1480  
1481 - function waitImages(){
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 +
1482 1482   var images=
1483 1483   Array.from(
1484 1484   root.querySelectorAll("img")
1485 1485   );
1486 1486  
1487 - return Promise.all(
1805 + await Promise.all(
1488 1488   images.map(function(img){
1489 1489   if(img.complete){
1490 1490   return Promise.resolve();
... ... @@ -1509,46 +1509,20 @@
1509 1509   });
1510 1510   })
1511 1511   );
1512 - }
1513 1513  
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);
1831 + run();
1541 1541   }
1542 1542  
1543 - addEventListener(
1834 + window.addEventListener(
1544 1544   "resize",
1545 - resize,
1836 + onResize,
1546 1546   {passive:true}
1547 1547   );
1548 1548  
1549 - initial();
1840 + waitForReady();
1550 1550  })();
1551 1551  </script>
1552 1552  
1553 -<!-- SN_HORIZONTAL_BOX_HARMONIZER_END -->
1554 -{{/html}}\n
1844 +<!-- SN_SERVICE_NAVIGATOR_MASTER_STYLE_END -->
1845 +{{/html}}
1846 +