Last modified by Veronika Kocher on Friday, 04 Sep 2026 14:45

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