PageSourceSearch

https://www.1188.lv/laika-zinas/riga

html 1188.lv collected 2026-10-02 02:39:03 UTC 173,187 bytes, 2,967 lines download raw bytes

1<!DOCTYPE html>
2<html lang="lv">
3<head>
4    <meta charset="UTF-8"/>
5    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
6    <meta name="theme-color" content="rgb(0,92,150)">
7    <title>Laika ziņas - Rīga - 1188</title>
8        <meta name="description" content="Laika ziņas: Rīga. Temperatūra, vēja ātrums , mitrums. Detalizēta laika prognoze šodienai un nākošajām 8 dienām.">
9<link rel="canonical" href="https://www.1188.lv/laika-zinas/riga"/>
10<link href="/v4/assets/74ec5449/css/bootstrap.css?v=1671790134" rel="stylesheet">
11<link href="//fonts.googleapis.com/css?family=Roboto:300,400,500,700|Ubuntu:400,500,700&amp;subset=latin-ext,cyrillic" rel="stylesheet">
12<link href="/v4/css/app.min.css?v=1762289882" rel="stylesheet">
13<link href="/v4/css/banner.css?v=1762289882" rel="stylesheet">
14<link href="/v4/css/weather.css?v=1762289882" rel="stylesheet">
15<link href="/v4/assets/f67c49f4/mapbox-gl.css?v=1671790134" rel="stylesheet">
16<style>
17                #delfi-adx-2199612 {
18                    position: fixed !important;
19                    top: 0 !important;
20                    left: 0 !important;
21                    right: 0 !important;
22                    bottom: 0 !important;
23                    width: 100vw !important;
24                    height: 100vh !important;
25                    min-width: 100vw !important;
26                    min-height: 100vh !important;
27                    background: rgba(0, 0, 0, 0.9) !important;
28                    background-color: rgba(0, 0, 0, 0.9) !important;
29                    backdrop-filter: blur(4px) !important;
30                    z-index: 999999 !important;
31                    display: flex !important;
32                    visibility: hidden !important;
33                    opacity: 0 !important;
34                    flex-direction: column !important;
35                    align-items: stretch !important;
36                    justify-content: flex-start !important;
37                    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif !important;
38                    margin: 0 !important;
39                    padding: 0 !important;
40                    overflow: hidden !important;
41                    box-sizing: border-box !important;
42                    pointer-events: none !important;
43                    will-change: opacity, visibility, transform !important;
44                    backface-visibility: hidden !important;
45                    -webkit-backface-visibility: hidden !important;
46                    transform: translateZ(0) !important;
47                }
48                
49                /* When banner is shown, make it visible and clickable */
50                #delfi-adx-2199612[style*="display: flex"][style*="visibility: visible"] {
51                    pointer-events: auto !important;
52                    z-index: 999999 !important;
53                }
54                
55                /* Force banner to be visible when shown */
56                #delfi-adx-2199612[style*="opacity: 1"] {
57                    z-index: 999999 !important;
58                    pointer-events: auto !important;
59                }
60
61                /* Ensure overlay background is visible behind content but doesn't block clicks */
62                #delfi-adx-2199612::before {
63                    content: '';
64                    position: absolute;
65                    top: 0;
66                    left: 0;
67                    right: 0;
68                    bottom: 0;
69                    width: 100%;
70                    height: 100%;
71                    background: rgba(0, 0, 0, 0.8);
72                    z-index: -1;
73                    pointer-events: none;
74                }
75
76                #delfi-adx-2199612 .adform-monster-topbar {
77                    position: fixed !important;
78                    top: 0 !important;
79                    left: 0 !important;
80                    right: 0 !important;
81                    bottom: auto !important;
82                    width: 100% !important;
83                    height: 60px !important;
84                    min-height: 60px !important;
85                    max-height: 60px !important;
86                    background-color: #1a1a1a !important;
87                    background: linear-gradient(180deg, #2a2a2a 0%, #1a1a1a 100%) !important;
88                    /* Display/visibility controlled by JavaScript - don't force visible here */
89                    align-items: center !important;
90                    justify-content: space-between !important;
91                    padding: 0 24px !important;
92                    z-index: 1000001 !important;
93                    box-sizing: border-box !important;
94                    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4) !important;
95                    margin: 0 !important;
96                    margin-top: 0 !important;
97                    margin-bottom: 0 !important;
98                    flex-shrink: 0 !important;
99                    transform: translateY(0) translateZ(0) !important;
100                    will-change: transform, opacity, visibility !important;
101                    backface-visibility: hidden !important;
102                    -webkit-backface-visibility: hidden !important;
103                }
104                
105                #delfi-adx-2199612 .adform-monster-logo-link {
106                    display: flex !important;
107                    align-items: center !important;
108                    text-decoration: none !important;
109                    height: 100% !important;
110                    padding: 0 !important;
111                    margin: 0 !important;
112                }
113
114                #delfi-adx-2199612 .adform-monster-logo {
115                    height: 36px !important;
116                    width: auto !important;
117                    display: block !important;
118                    max-width: 120px !important;
119                }
120
121                #delfi-adx-2199612 .adform-monster-close-wrapper {
122                    display: flex !important;
123                    align-items: center !important;
124                    gap: 12px !important;
125                    height: 100% !important;
126                }
127                
128                #delfi-adx-2199612 .adform-monster-countdown {
129                    color: #ffffff !important;
130                    font-size: 15px !important;
131                    font-weight: 500 !important;
132                    white-space: nowrap !important;
133                    display: block !important;
134                    visibility: visible !important;
135                    opacity: 1 !important;
136                }
137
138                #delfi-adx-2199612 .adform-monster-close-link {
139                    color: #ffffff !important;
140                    font-size: 15px !important;
141                    font-weight: 500 !important;
142                    text-decoration: none !important;
143                    cursor: pointer !important;
144                    white-space: nowrap !important;
145                    padding: 8px 16px !important;
146                    border-radius: 4px !important;
147                    transition: background-color 0.2s ease, color 0.2s ease !important;
148                    background-color: transparent !important;
149                }
150
151                #delfi-adx-2199612 .adform-monster-close-link:hover {
152                    color: #ffffff !important;
153                    background-color: rgba(255, 255, 255, 0.1) !important;
154                    text-decoration: none !important;
155                }
156                
157                #delfi-adx-2199612 .adform-monster-close-x {
158                    display: inline-block !important;
159                    margin-left: 8px !important;
160                    font-size: 20px !important;
161                    line-height: 1 !important;
162                    font-weight: 300 !important;
163                }
164                
165                @media (max-width: 900px) {
166                    #delfi-adx-2199612 .adform-monster-topbar {
167                        height: 56px !important;
168                        min-height: 56px !important;
169                        padding: 0 16px !important;
170                        justify-content: flex-end !important;
171                    }
172                    
173                    #delfi-adx-2199612 .adform-monster-logo-link {
174                        display: none !important;
175                    }
176                    
177                    #delfi-adx-2199612 .adform-monster-logo {
178                        display: none !important;
179                    }
180                    
181                    #delfi-adx-2199612 .adform-monster-countdown {
182                        display: none !important;
183                    }
184                    
185                    #delfi-adx-2199612 .adform-monster-close-link {
186                        font-size: 14px !important;
187                        padding: 6px 12px !important;
188                    }
189                }
190
191
192
193                #delfi-adx-2199612 .adform-monster-content {
194                    /* Display/visibility controlled by JavaScript - don't force visible here */
195                    align-items: center !important;
196                    justify-content: center !important;
197                    width: 100vw !important;
198                    max-width: 100vw !important;
199                    height: calc(100vh - 60px) !important;
200                    min-height: calc(100vh - 60px) !important;
201                    margin: 0 !important;
202                    margin-top: 60px !important;
203                    padding: 0 !important;
204                    position: relative !important;
205                    z-index: 1000000 !important;
206                    overflow: hidden !important;
207                    box-sizing: border-box !important;
208                }
209
210                @media (max-width: 900px) {
211                    #delfi-adx-2199612 .adform-monster-content {
212                        height: calc(100vh - 56px) !important;
213                        min-height: calc(100vh - 56px) !important;
214                        margin-top: 56px !important;
215                        padding: 0 !important;
216                        overflow: hidden !important;
217                        box-sizing: border-box !important;
218                    }
219                    
220                    #delfi-adx-2199612 .adform-monster-ad-wrapper {
221                        max-width: 100% !important;
222                        width: 100% !important;
223                        overflow: hidden !important;
224                        box-sizing: border-box !important;
225                        display: flex !important;
226                        justify-content: center !important;
227                        align-items: flex-start !important;
228                    }
229                    
230                    /* Ensure iframes and wrappers are properly constrained */
231                    #delfi-adx-2199612 .adform-iframe-wrapper {
232                        max-width: 100% !important;
233                        width: 100% !important;
234                        overflow: hidden !important;
235                        box-sizing: border-box !important;
236                        margin: 0 auto !important;
237                    }
238                    
239                    #delfi-adx-2199612 .adform-monster-content iframe,
240                    #delfi-adx-2199612 .adform-monster-ad-wrapper iframe,
241                    #delfi-adx-2199612 .adform-iframe-wrapper iframe {
242                        max-width: 100% !important;
243                        box-sizing: border-box !important;
244                    }
245                }
246                
247                /* Ensure content wrapper takes full available space */
248                #delfi-adx-2199612 .adform-monster-ad-wrapper {
249                    display: flex !important;
250                    align-items: flex-start !important;
251                    justify-content: center !important;
252                    width: 100vw !important;
253                    max-width: 100vw !important;
254                    min-width: 100vw !important;
255                    height: 100% !important;
256                    min-height: 100% !important;
257                    position: relative !important;
258                    overflow: visible !important;
259                    box-sizing: border-box !important;
260                    pointer-events: auto !important;
261                    margin: 0 !important;
262                    padding: 0 !important;
263                }
264                
265                /* Default iframe styling */
266                #delfi-adx-2199612 .adform-monster-content iframe,
267                #delfi-adx-2199612 .adform-monster-ad-wrapper iframe {
268                    display: block !important;
269                    margin: 0 auto !important;
270                }
271
272
273                /* Iframe wrapper container */
274                #delfi-adx-2199612 .adform-iframe-wrapper {
275                    width: 100% !important;
276                    max-width: 100% !important;
277                    min-width: 100% !important;
278                    overflow: visible !important;
279                    position: relative;
280                    box-sizing: border-box;
281                    margin: 0 auto;
282                    flex-shrink: 0;
283                    flex-grow: 1;
284                }
285
286                /* Iframe styling - original dimensions preserved, scaled via transform */
287                #delfi-adx-2199612 .adform-iframe-wrapper iframe {
288                    display: block !important;
289                    margin: 0 !important;
290                    padding: 0 !important;
291                    border: none !important;
292                    transform-origin: top left !important;
293                    box-sizing: border-box !important;
294                    max-width: none !important;
295                    max-height: none !important;
296                }
297            </style>
298<style>
299            #delfi-adx-2199623 {
300                position: fixed;
301                bottom: 0;
302                left: 0;
303                right: 0;
304                width: 100%;
305                max-width: 100vw;
306                background-color: #fff;
307                z-index: 9998;
308                box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
309                text-align: center;
310                display: none;
311                padding: 10px 0;
312                overflow: hidden;
313                height: auto;
314                min-height: 90px;
315                box-sizing: border-box;
316            }
317
318            #delfi-adx-2199623 .adform-floor-content {
319                position: relative;
320                width: 100%;
321                max-width: 100%;
322                height: auto;
323                overflow: hidden;
324                text-align: center;
325                box-sizing: border-box;
326                padding: 0 10px;
327                margin: 0 auto;
328            }
329
330            /* Iframe wrapper container */
331            #delfi-adx-2199623 .adform-iframe-wrapper {
332                width: 100% !important;
333                max-width: 100% !important;
334                overflow: hidden !important;
335                position: relative;
336                box-sizing: border-box;
337                margin: 0 auto;
338                flex-shrink: 0;
339                flex-grow: 1;
340                min-width: 0;
341            }
342
343            /* Iframe styling - original dimensions preserved, scaled via transform */
344            #delfi-adx-2199623 .adform-iframe-wrapper iframe {
345                display: block !important;
346                margin: 0 !important;
347                padding: 0 !important;
348                border: none !important;
349                transform-origin: top left !important;
350                box-sizing: border-box !important;
351                max-width: none !important;
352                max-height: none !important;
353            }
354
355            /* Even narrower screens */
356            @media (max-width: 768px) {
357                #delfi-adx-2199623 {
358                    padding: 5px 0;
359                }
360                #delfi-adx-2199623 .adform-floor-content {
361                    padding: 0 5px;
362                }
363            }
364
365            #delfi-adx-2199623 .adform-floor-close {
366                position: absolute;
367                top: -15px;
368                right: 15px;
369                width: 30px;
370                height: 30px;
371                border-radius: 50%;
372                background-color: rgba(0, 0, 0, 0.7)
372;
373                border: 2px solid #fff;
374                cursor: pointer;
375                display: flex;
376                align-items: center;
377                justify-content: center;
378                z-index: 1;
379            }
380
381            #delfi-adx-2199623 .adform-floor-close:before,
382            #delfi-adx-2199623 .adform-floor-close:after {
383                content: '';
384                position: absolute;
385                width: 15px;
386                height: 2px;
387                background-color: #fff;
388            }
389
390            #delfi-adx-2199623 .adform-floor-close:before {
391                transform: rotate(45deg);
392            }
393
394            #delfi-adx-2199623 .adform-floor-close:after {
395                transform: rotate(-45deg);
396            }
397
398            #adform-floor-adsense {
399                position: fixed;
400                bottom: 0;
401                left: 0;
402                right: 0;
403                width: 100%;
404                max-width: 100vw;
405                background-color: #fff;
406                z-index: 9998;
407                box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
408                text-align: center;
409                display: none;
410                padding: 10px 0;
411                overflow: hidden;
412                box-sizing: border-box;
413            }
414
415            @media (max-width: 695px) {
416                #delfi-adx-2199623,
417                #adform-floor-adsense {
418                    display: none !important;
419                }
420            }
421        </style>
422<script src="https://core.dimatter.ai/pubs/1188-lv.min.js" async></script>
vendor: 1 bytes, line 422
422
423<script>
424              window.dimatter = window.dimatter || [];
425              window.dimatter.push('standalone');
426              window.dimatter.push(['_initialize']);
427        
428window.mapboxStyle = 'https://api.maptiler.com/maps/acbc4f7b-2d7f-4b41-bc79-4f7b37dc1842/style.json?key=EEGdL8bsqm2rfbCssCn3'</script>
428            
428<script async src='https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-1066444100463751'
429        crossorigin='anonymous'></script>
429                <!-- Google Tag Manager -->
430    
430<script>
vendor: 375 bytes, lines 430-434
430(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
431                new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
432            j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
433            'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
434        })(window,document,'script','dataLayer','
434GTM-569RRMW
vendor: 8 bytes, lines 434-435
434');
435    
435</script>
435
436    <!-- End Google Tag Manager -->
437    
437<script type="application/javascript" src="https://ced.sascdn.com/tag/3323/smart.js" async></script>
437
438        
438<script>
439        // Load Adform script only once
440        if (!window.adformtag) {
441            var adformScript = document.createElement('script');
442            adformScript.src = '//s1.adform.net/banners/scripts/adx.js';
443            adformScript.async = true;
444            document.head.appendChild(adformScript);
445        }
446    </script>
446
447        </head>
448<body><!-- Google Tag Manager (noscript) -->
vendor: 73 bytes, lines 448-450
448
449<noscript>
450    <iframe src="https://www.googletagmanager.com/ns.html?id=
450GTM-569RRMW
vendor: 84 bytes, lines 450-451
450" height="0" width="0" style="display:none;visibility:hidden"></iframe>
451</noscript>
452<!-- End Google Tag Manager (noscript) -->
453
454    
454<script>
455window.dimatter.push(["1188LV00_Pixel_visas_lapas"]);
456window.dimatter.push(["_requestBanners", "1188LV00_Pixel_visas_lapas"]);
457</script>
457    <div class="banner wallpaper-top">
458    <div class="container-fluid">
459            </div>
460</div>
461<div id="delfi-adx-2199612" 
462     class="adform-banner adform-monster" 
463     data-adform-type="monster" 
464     data-adform-id="2199612">
465
466            <div class="adform-monster-topbar">
467            <a href="/" class="adform-monster-logo-link">
468                <img src="/v4/img/1188-logo.svg" alt="1188" class="adform-monster-logo">
469            </a>
470            <div class="adform-monster-close-wrapper">
471                <span class="adform-monster-countdown" id="delfi-adx-2199612-countdown"></span>
472                <a href="#" class="adform-monster-close-link" id="delfi-adx-2199612-close-link">Aizvērt reklāmu <span class="adform-monster-close-x">✕</span></a>
473            </div>
474        </div>
475        <div class="adform-monster-content">
476            <div id="delfi-adx-2199612-content" class="adform-monster-ad-wrapper">
477                <!-- Adform content will be inserted here -->
478            </div>
479        </div>
480    </div>
481
482<div id="delfi-adx-2199623" 
483     class="adform-floor-ad" 
484     data-adform-type="floor_ad" 
485     data-adform-id="2199623"
486     style="display: none;">
487    <div class="adform-floor-close" onclick="document.getElementById('delfi-adx-2199623').style.display='none';"></div>
488    <div class="adform-floor-content">
489        <!-- Adform content will be inserted here -->
490    </div>
491</div>
492
493<div id="adform-floor-adsense" style="display: none;">
494    <!-- AdSense fallback will be inserted here -->
495    <ins class="adsbygoogle"
496         style="display:inline-block;width:970px;height:90px"
497         data-ad-client="pub-1066444100463751"
498         data-ad-slot="1188LV00_Pixel_visas_lapas"></ins>
499</div>
500<div class="page-container">
501    <div id="nav-tabs">
502    <div class="container-fluid">
503        <a id="nav-logo" href="https://www.1188.lv/" title="Atpakaļ uz sākumlapu">1188</a>
504        <div id="header-menu-mob" data-icon="menu">
505            <select onchange="if(this.value === 'https://play.1188.lv') { window.open(this.value, '_blank'); } else if (this.value) { window.location.href = this.value }">
506                <option hidden selected></option>
507                <option value="https://play.1188.lv">1188 play</option>
508                                    <option value="https://www.1188.lv/zinas/kategorija/izklaide/15">Izklaide</option>
509                                <option value="https://www.1188.lv/katalogs">Uzņēmumi</option>
510                <option value="https://www.1188.lv/satiksme">Satiksme</option>
511                <option value="https://www.1188.lv/varda-dienas">Vārda dienas</option>
512                <option value="https://www.1188.lv/laika-zinas">Laika ziņas</option>
513                <option value="https://www.1188.lv/zinas/360tv-zinnesi-kontakti/25348 ">360 Ziņas kontakti</option>
514                <option value="https://www.1188.lv/iesaka/tv">TV programma</option>
515                <option value="https://www.1188.lv/iesaka/kino">Kino</option>
516                <option value="https://www.1188.lv/iesaka/horoskopi">Horoskopi</option>
517            </select>
518        </div>
519        <div class="menu">
520            <div id="lang-nav" class="dropdown">
521    <a data-toggle="dropdown" aria-haspopup="true" aria-expanded="false" data-language="lv">LV <span class="caret"></span></a>
522    <ul class="dropdown-menu">
523                    <li><a href="https://www.1188.lv/laika-zinas/riga" data-language="lv">LV</a></li>
524                    <li><a href="https://www.1188.lv/en/weather-forecast/riga" data-language="en">EN</a></li>
525                    <li><a href="https://www.1188.lv/ru/prognoz-pogody/riga" data-language="ru">RU</a></li>
526            </ul>
527</div>
528            <ul>
529                <li class="play-portal"><a href="https://play.1188.lv" target="_blank">1188 play</a></li>
530                <li><a href="https://www.1188.lv/katalogs">Uzņēmumi</a></li>
531                <li><a href="https://www.1188.lv/satiksme">Satiksme</a>
532                </li>
533                <li class="dropdown">
534                    <a class="icon" data-icon="nav-more" data-toggle="dropdown" aria-haspopup="true"
535                       aria-expanded="false" title="Visi pakalpojumi"></a>
536                    <ul class="dropdown-menu">
537                        <li>
538                            <a href="https://www.1188.lv/laika-zinas">
538Laika ziņas</a>
539                        </li>
540                        <li>
541                            <a href="https://www.1188.lv/varda-dienas">Vārda dienas</a>
542                        </li>
543                        <li>
544                            <a href="https://www.1188.lv/zinas/360tv-zinnesi-kontakti/25348">360 Ziņas kontakti</a>
545                        </li>
546                        <li>
547                            <a href="https://www.1188.lv/iesaka/tv">TV programma</a>
548                        </li>
549                        <li>
550                            <a href="https://www.1188.lv/iesaka/kino">Kino</a>
551                        </li>
552                        <li>
553                            <a href="https://www.1188.lv/iesaka/horoskopi">Horoskopi</a>
554                        </li>
555                    </ul>
556                </li>
557            </ul>
558        </div>
559        <div class="today-weather">
560    <a href="https://www.1188.lv/laika-zinas/riga">
561        <span data-icon="wicon" class="n moon c4"></span>
562        <span class="temp"><strong>+9</strong><span>°C</span></span>
563    </a>
564</div>    </div>
565</div>
566    <div class="page-content">
567            <section id="weather">
568        <div class="weather-container">
569            <div class="banner giga">
570    <div class="container-fluid">
571        
572            <div class="BannerPlaceholder">
573                <div id="1188LV01_TOP_GIGA_1000x250_1"></div>
574                
574<script type="text/javascript">
575                    window.dimatter.push(["1188LV01_TOP_GIGA_1000x250_1"]);
576                    window.dimatter.push(["_requestBanners", "1188LV01_TOP_GIGA_1000x250_1"]);
577                </script>
577
578            </div>
579            </div>
580</div>
581<div id="weather-header" class="city-1 n moon c4">
582    <div class="weather-kvadrats-banner">
583        <div class="banner">
584                    </div>
585            </div>
586    <div class="container-fluid">
587        <div class="now">
588            <h1 class="page-title">Laika ziņas, <span class="weekday">Piektdiena</span>, 2. oktobris</h1>
589            <div class="item">
590                <div class="title" data-trigger="open-cities">Rīga</div>
591                <a data-trigger="open-cities">Visas pilsētas</a>
592                <div data-icon="wicon" class="n moon c4"></div>
593                <div class="temp">
594                                            <span class="deg hi">+9°</span>
595                                    </div>
596                <div class="details">
597                                            <p>Sajūtas kā pie <strong class="deg hi">+8°</strong></p>
598                        <p data-icon="wind-SE">DA vējš, 2m/s</p>
599                        <p data-icon="humidity">100% gaisa mitrums</p>
600                                    </div>
601            </div>
602        </div>
603        <div class="forecast">
604            <div class="controls">
605                                    <a class="btn icon-only next" data-href="https://www.1188.lv/v4/lv/weather/default/change-weather?id=1&next=1" data-icon="next" title="Nākošā diena"></a>
606                                            </div>
607            <div class="items">
608                                <div class="item selected">
609                        <div class="title">
610                            <strong>Nakts</strong>
611                            <span class="small">00:00 - 06:00</span>
612                        </div>
613                        <div data-icon="wicon" class="n moon c2"></div>
614                        <div class="temp"><span class="deg">+13°</span></div>
615                        <div class="details">
616                            <p data-icon="wind-SE">DA vējš, 2m/s</p>
617                                                        <p data-icon="humidity">86% gaisa mitrums</p>
618                        </div>
619                    </div>
620                                    <div class="item ">
621                        <div class="title">
622                            <strong>Rīts</strong>
623                            <span class="small">06:00 - 12:00</span>
624                        </div>
625                        <div data-icon="wicon" class="d sun c2"></div>
626                        <div class="temp"><span class="deg">+12°</span></div>
627                        <div class="details">
628                            <p data-icon="wind-SE">DA vējš, 2m/s</p>
629                                                        <p data-icon="humidity">89% gaisa mitrums</p>
630                        </div>
631                    </div>
632                                    <div class="item ">
633                        <div class="title">
634                            <strong>Diena</strong>
635                            <span class="small">12:00 - 18:00</span>
636                        </div>
637                        <div data-icon="wicon" class="d sun c2"></div>
638                        <div class="temp"><span class="deg">+19°</span></div>
639                        <div class="details">
640                            <p data-icon="wind-S">D vējš, 3m/s</p>
641                                                        <p data-icon="humidity">64% gaisa mitrums</p>
642                        </div>
643                    </div>
644                                    <div class="item ">
645                        <div class="title">
646                            <strong>Vakars</strong>
647                            <span class="small">18:00 - 00:00</span>
648                        </div>
649                        <div data-icon="wicon" class="n moon c2"></div>
650                        <div class="temp"><span class="deg">+16°</span></div>
651                        <div class="details">
652                            <p data-icon="wind-S">D vējš, 1m/s</p>
653                                                        <p data-icon="humidity">72% gaisa mitrums</p>
654                        </div>
655                    </div>
656                            </div>
657        </div>
658    </div>
659    <div class="provider">
660        <div class="container-fluid">
661            Laika prognozi nodrošina: <a href="http://www.gismeteo.lv">Gismeteo.lv</a>
662        </div>
663    </div>
664</div>
665<div id="weather-nav" class="mobile-sticky">
666    <div class="container-fluid">
667        <ul>
668                                                                                                <li class=" selected"><a data-href="https://www.1188.lv/v4/lv/weather/default/change-weather?id=1">Å odiena</a></li>
669                                                                                                        <li class=""><a data-href="https://www.1188.lv/v4/lv/weather/default/change-weather?id=1&next=1">Rītdiena</a></li>
670                                                                                                        <li class=""><a data-href="https://www.1188.lv/v4/lv/weather/default/change-weather?id=1&next=2">Svētdiena</a></li>
671                                                                                                        <li class=""><a data-href="https://www.1188.lv/v4/lv/weather/default/change-weather?id=1&next=3">Pirmdiena</a></li>
672                                                                                                        <li class=""><a data-href="https://www.1188.lv/v4/lv/weather/default/change-weather?id=1&next=4">Otrdiena</a></li>
673                                                                                                        <li class=""><a data-href="https://www.1188.lv/v4/lv/weather/default/change-weather?id=1&next=5">Trešdiena</a></li>
674                                                                                                        <li class=""><a data-href="https://www.1188.lv/v4/lv/weather/default/change-weather?id=1&next=6">Ceturtdiena</a></li>
675                                                    <li class="gismeteo more"><a data-icon="next" target="_blank" href="https://www.gismeteo.lv/city/weekly/4136/">2 nedēļas</a></li>
676                    </ul>
677    </div>
678</div>
679<a id="open-cities-btn" class="btn btn-lg btn-primary" data-icon="menu" data-trigger="open-cities">Visas pilsētas</a>
680
681            
682<div id="weather-cities">
683    <div class="container-fluid">
684        <a class="close" data-trigger="close-cities" data-icon="close">Aizvērt</a>
685        <div class="cities-list-container">
686                            <div class="cities-list">
687                    
688<div class="type-title">Latvija</div>
689<ul>
690                    <li class="selected"><a href="https://www.1188.lv/laika-zinas/riga">Rīga</a></li>
691                    <li class=""><a href="https://www.1188.lv/laika-zinas/daugavpils">Daugavpils</a></li>
692                    <li class=""><a href="https://www.1188.lv/laika-zinas/liepaja">Liepāja</a></li>
693                    <li class=""><a href="https://www.1188.lv/laika-zinas/jelgava">Jelgava</a></li>
694                    <li class=""><a href="https://www.1188.lv/laika-zinas/jurmala">Jūrmala</a></li>
695                    <li class=""><a href="https://www.1188.lv/laika-zinas/ventspils">Ventspils</a></li>
696                    <li class=""><a href="https://www.1188.lv/laika-zinas/rezekne">Rēzekne</a></li>
697                    <li class=""><a href="https://www.1188.lv/laika-zinas/valmiera">Valmiera</a></li>
698                    <li class=""><a href="https://www.1188.lv/laika-zinas/adazi">Ādaži</a></li>
699                    <li class=""><a href="https://www.1188.lv/laika-zinas/ainazi">Ainaži</a></li>
700                    <li class=""><a href="https://www.1188.lv/laika-zinas/aizkraukle">Aizkraukle</a></li>
701                    <li class=""><a href="https://www.1188.lv/laika-zinas/aizpute">Aizpute</a></li>
702                    <li class=""><a href="https://www.1188.lv/laika-zinas/akniste">Aknīste</a></li>
703                    <li class=""><a href="https://www.1188.lv/laika-zinas/aloja">Aloja</a></li>
704                    <li class=""><a href="https://www.1188.lv/laika-zinas/aluksne">Alūksne</a></li>
705                    <li class=""><a href="https://www.1188.lv/laika-zinas/ape">Ape</a></li>
706                    <li class=""><a href="https://www.1188.lv/laika-zinas/auce">Auce</a></li>
707                    <li class=""><a href="https://www.1188.lv/laika-zinas/balozi">Baloži</a></li>
708                    <li class=""><a href="https://www.1188.lv/laika-zinas/balozi">Baloži</a></li>
709                    <li class=""><a href="https://www.1188.lv/laika-zinas/balvi">Balvi</a></li>
710                    <li class=""><a href="https://www.1188.lv/laika-zinas/bauska">Bauska</a></li>
711                    <li class=""><a href="https://www.1188.lv/laika-zinas/cesis">Cēsis</a></li>
712                    <li class=""><a href="https://www.1188.lv/laika-zinas/cesvaine">Cesvaine</a></li>
713                    <li class=""><a href="https://www.1188.lv/laika-zinas/dagda">Dagda</a></li>
714                    <li class=""><a href="https://www.1188.lv/laika-zinas/dobele">Dobele</a></li>
715                    <li class=""><a href="https://www.1188.lv/laika-zinas/eleja">Eleja</a></li>
716                    <li class=""><a href="https://www.1188.lv/laika-zinas/engure">Engure</a></li>
717                    <li class=""><a href="https://www.1188.lv/laika-zinas/ergli">Ērgļi</a></li>
718                    <li class=""><a href="https://www.1188.lv/laika-zinas/gulbene">Gulbene</a></li>
719                    <li class=""><a href="https://www.1188.lv/laika-zinas/iecava">Iecava</a></li>
720                    <li class=""><a href="https://www.1188.lv/laika-zinas/ilukste">Ilūkste</a></li>
721                    <li class=""><a href="https://www.1188.lv/laika-zinas/jekabpils">Jēkabpils</a></li>
722                    <li class=""><a href="https://www.1188.lv/laika-zinas/kandava">Kandava</a></li>
723                    <li class=""><a href="https://www.1188.lv/laika-zinas/karsava">Kārsava</a></li>
724                    <li class=""><a href="https://www.1188.lv/laika-zinas/kegums">Ķegums</a></li>
725                    <li class=""><a href="https://www.1188.lv/laika-zinas/kolka">Kolka</a></li>
726                    <li class=""><a href="https://www.1188.lv/laika-zinas/kraslava">Krāslava</a></li>
727                    <li class=""><a href="https://www.1188.lv/laika-zinas/kuldiga">Kuldīga</a></li>
728                    <li class=""><a href="https://www.1188.lv/laika-zinas/limbazi">Limbaži</a></li>
729                    <li class=""><a href="https://www.1188.lv/laika-zinas/livani">Līvāni</a></li>
730                    <li class=""><a href="https://www.1188.lv/laika-zinas/lubana">Lubāna</a></li>
731                    <li class=""><a href="https://www.1188.lv/laika-zinas/ludza">Ludza</a></li>
732                    <li class=""><a href="https://www.1188.lv/laika-zinas/madona">Madona</a></li>
733                    <li class=""><a href="https://www.1188.lv/laika-zinas/marupe">Mārupe</a></li>
734                    <li class=""><a href="https://www.1188.lv/laika-zinas/mersrags">Mērsrags</a></li>
735                    <li class=""><a href="https://www.1188.lv/laika-zinas/ogre">Ogre</a></li>
736                    <li class=""><a href="https://www.1188.lv/laika-zinas/olaine">Olaine</a></li>
737                    <li class=""><a href="https://www.1188.lv/laika-zinas/pavilosta">Pāvilosta</a></li>
738                    <li class=""><a href="https://www.1188.lv/laika-zinas/plavinas">Pļaviņas</a></li>
739                    <li class=""><a href="https://www.1188.lv/laika-zinas/preili">Preiļi</a></li>
740                    <li class=""><a href="https://www.1188.lv/laika-zinas/priekule">Priekule</a></li>
741                    <li class=""><a href="https://www.1188.lv/laika-zinas/roja">Roja</a></li>
742                    <li class=""><a href="https://www.1188.lv/laika-zinas/rujiena">Rūjiena</a></li>
743                    <li class=""><a href="https://www.1188.lv/laika-zinas/sabile">Sabile</a></li>
744                    <li class=""><a href="https://www.1188.lv/laika-zinas/salacgriva">Salacgrīva</a></li>
745                    <li class=""><a href="https://www.1188.lv/laika-zinas/salaspils">Salaspils</a></li>
746                    <li class=""><a href="https://www.1188.lv/laika-zinas/saldus">Saldus</a></li>
747                    <li class=""><a href="https://www.1188.lv/laika-zinas/saulkrasti">Saulkrasti</a></li>
748                    <li class=""><a href="https://www.1188.lv/laika-zinas/sigulda">Sigulda</a></li>
749                    <li class=""><a href="https://www.1188.lv/laika-zinas/skrunda">Skrunda</a></li>
750                    <li class=""><a href="https://www.1188.lv/laika-zinas/skulte">Skulte</a></li>
751                    <li class=""><a href="https://www.1188.lv/laika-zinas/smiltene">Smiltene</a></li>
752                    <li class=""><a href="https://www.1188.lv/laika-zinas/stende">Stende</a></li>
753                    <li class=""><a href="https://www.1188.lv/laika-zinas/strenci">Strenči</a></li>
754                    <li class=""><a href="https://www.1188.lv/laika-zinas/talsi">Talsi</a></li>
755                    <li class=""><a href="https://www.1188.lv/laika-zinas/tukums">Tukums</a></li>
756                    <li class=""><a href="https://www.1188.lv/laika-zinas/valdemarpils">Valdemārpils</a></li>
757                    <li class=""><a href="https://www.1188.lv/laika-zinas/valka">Valka</a></li>
758                    <li class=""><a href="https://www.1188.lv/laika-zinas/varaklani">Varakļāni</a></li>
759                    <li class=""><a href="https://www.1188.lv/laika-zinas/viesite">Viesīte</a></li>
760                    <li class=""><a href="https://www.1188.lv/laika-zinas/vilaka">Viļaka</a></li>
761                    <li class=""><a href="https://www.1188.lv/laika-zinas/zilupe">Zilupe</a></li>
762    </ul>                </div>
763                                        <div class="cities-list">
764                    
765<div class="type-title">Eiropa</div>
766<ul>
767                    <li class=""><a href="https://www.1188.lv/laika-zinas/amsterdama">Amsterdama</a></li>
768                    <li class=""><a href="https://www.1188.lv/laika-zinas/atenas">Atēnas</a></li>
769                    <li class=""><a href="https://www.1188.lv/laika-zinas/barselona">Barselona</a></li>
770                    <li class=""><a href="https://www.1188.lv/laika-zinas/berline">Berlīne</a></li>
771                    <li class=""><a href="https://www.1188.lv/laika-zinas/bratislava">Bratislava</a></li>
772                    <li class=""><a href="https://www.1188.lv/laika-zinas/budapesta">Budapešta</a></li>
773                    <li class=""><a href="https://www.1188.lv/laika-zinas/bukareste">Bukareste</a></li>
774                    <li class=""><a href="https://www.1188.lv/laika-zinas/dublina">Dublina</a></li>
775                    <li class=""><a href="https://www.1188.lv/laika-zinas/helsinki">Helsinki</a></li>
776                    <li class=""><a href="https://www.1188.lv/laika-zinas/kijeva">Kijeva</a></li>
777                    <li class=""><a href="https://www.1188.lv/laika-zinas/kopenhagena">Kopenhāgena</a></li>
778                    <li class=""><a href="https://www.1188.lv/laika-zinas/lisabona">Lisabona</a></li>
779                    <li class=""><a href="https://www.1188.lv/laika-zinas/londona">Londona</a></li>
780                    <li class=""><a href="https://www.1188.lv/laika-zinas/madride">Madride</a></li>
781                    <li class=""><a href="https://www.1188.lv/laika-zinas/maskava">Maskava</a></li>
782                    <li class=""><a href="https://www.1188.lv/laika-zinas/minska">Minska</a></li>
783                    <li class=""><a href="https://www.1188.lv/laika-zinas/oslo">Oslo</a></li>
784                    <li class=""><a href="https://www.1188.lv/laika-zinas/parize">Parīze</a></li>
785                    <li class=""><a href="https://www.1188.lv/laika-zinas/praga">Prāga</a></li>
786                    <li class=""><a href="https://www.1188.lv/laika-zinas/roma">Roma</a></li>
787                    <li class=""><a href="https://www.1188.lv/laika-zinas/stokholma">Stokholma</a></li>
788                    <li class=""><a href="https://www.1188.lv/laika-zinas/tallina">Tallina</a></li>
789                    <li class=""><a href="https://www.1188.lv/laika-zinas/var
789sava">Varšava</a></li>
790                    <li class=""><a href="https://www.1188.lv/laika-zinas/vilna">Viļņa</a></li>
791                    <li class=""><a href="https://www.1188.lv/laika-zinas/vine">Vīne</a></li>
792                    <li class=""><a href="https://www.1188.lv/laika-zinas/zagreba">Zagreba</a></li>
793    </ul>                </div>
794                    </div>
795    </div>
796</div>        </div>
797        <div id="weather-map"></div>
798        
799<div class="banner-kvadrats-right-bottom">
800    <div class="banner">
801            </div>
802</div>    </section>
803    </div>
804    <footer id="footer">
805    <div class="container-fluid">
806        <div class="left">
807            <form class="form" role="form" method="get" action="https://www.1188.lv/katalogs/meklet">
808                <div class="form-group">
809                    <input type="search" autocomplete="off" class="form-control " name="InfopageSearch[what]" placeholder="Ko vēlies uzzināt?">
810                </div>
811                <button type="submit" class="btn icon-only" data-icon="search" title="Meklēt">Meklēt</button>
812            </form>
813            <nav id="footer-nav" class="row hidden-xs">
814                <ul class="col-sm-4">
815                    <li><a href="https://www.1188.lv/zinas/1188-pakalpojumi/2148">Par mums</a></li>
816                    <li><a href="https://www.1188.lv/par-mums/reklama">Reklāma</a></li>
817                    <li><a href="https://www.1188.lv/par-mums/biznesam">Biznesa klientiem</a></li>
818                    <li><a href="https://www.1188.lv/par-mums/tarifi">Tarifi</a></li>
819                    <li><a href="https://www.1188.lv/privatuma-politika">Privātuma politika</a></li>
820                    <li><a href="javascript:CookieScript.instance.show()">Sīkdatņu iestatījumi</a></li>
821                    <li><a href="https://www.1188.lv/zinas/politiska-reklama/64648">Politiskā reklāma</a></li>
822                    <li><a href="https://www.1188.lv/zinas/sikdatnu-lietosanas-noteikumi-interneta-vietne-1188-lv/5991">Sīkdatņu lietošanas noteikumi</a></li>
823                    <li><a href="https://www.1188.lv/komentaru-noteikumi">Komentāru pievienošana</a></li>
824                </ul>
825                <ul class="col-sm-4">
826                    <li><a href="https://www.1188.lv/katalogs">Uzņēmumi</a></li>
827                    <li><a href="https://www.1188.lv/satiksme">Autobusi, vilcieni, starptautiskie reisi</a></li>
828                    <li><a href="https://www.1188.lv/satiksme/starppilsetu-autobusi">Autobusu biļetes</a></li>
829                    <li><a href="https://www.1188.lv/satiksme/vilcieni">Vilcienu biļetes</a></li>
830                </ul>
831                <ul class="col-sm-4">
832                    <li><a href="https://www.1188.lv/iesaka/kino">Kinoteātros</a></li>
833                    <li><a href="https://www.1188.lv/iesaka/tv">TV programma</a></li>
834                    <li><a href="https://www.1188.lv/liguma-noteikumi">Līguma noteikumi</a></li>
835                    <li><a href="https://www.1188.lv/zinas/360tv-zinnesi-kontakti/25348">360 Ziņas kontakti</a></li>
836                </ul>
837            </nav>
838            <div id="footer-nav-mob" class="hidden visible-xs" data-icon="menu">
839                <select onchange="if (this.value) window.location.href=this.value">
840                    <option hidden selected></option>
841                    <optgroup label="">
842                        <option value="https://www.1188.lv/zinas/1188-pakalpojumi/2148">Par mums</option>
843                        <option value="https://www.1188.lv/par-mums/reklama">Reklāma</option>
844                        <option value="https://www.1188.lv/par-mums/biznesam">Biznesa klientiem</option>
845                        <option value="https://www.1188.lv/par-mums/tarifi">Tarifi</option>
846                        <option value="https://www.1188.lv/privatuma-politika">Privātuma politika</option>
847                        <option value="https://www.1188.lv/zinas/sikdatnu-lietosanas-noteikumi-interneta-vietne-1188-lv/5991">Sīkdatņu lietošanas noteikumi</option>
848                        <option value="https://www.1188.lv/komentaru-noteikumi">Komentāru pievienošana</option>
849                    </optgroup>
850                    <optgroup label="">
851                        <option value="https://www.1188.lv/katalogs">Uzņēmumi</option>
852                        <option value="https://www.1188.lv/satiksme">Autobusi, vilcieni, starptautiskie reisi</option>
853                        <option value="https://www.1188.lv/satiksme/starppilsetu-autobusi">Autobusu biļetes</option>
854                        <option value="https://www.1188.lv/satiksme/vilcieni">Vilcienu biļetes</option>
855                    </optgroup>
856                    <optgroup label="">
857                        <option value="https://www.1188.lv/iesaka/tv">TV programma</option>
858                        <option value="https://www.1188.lv/iesaka/kino">Kinoteātros</option>
859                        <option value="https://www.1188.lv/liguma-noteikumi">Līguma noteikumi</option>
860                        <option value="https://www.1188.lv/zinas/360tv-zinnesi-kontakti/25348">360 Ziņas kontakti</option>
861                    </optgroup>
862                </select>
863            </div>
864            <div class="add-company">
865                <a class="btn btn-block btn-warning btn-lg" data-icon="next" href="https://www.1188.lv/katalogs/registret-uznemumu">Piesaki savu uzņēmumu</a>
866                <p class="notes">Ja tavs uzņēmums nav mūsu datubāzē, aizpildi vienkāršu formu.</p>
867            </div>
868        </div>
869        <div class="right">
870            <div class="copyright">
871                <p class="text-wrap">1188 datu bāzes, tās daļas vai datu bāzē iekļautās informācijas, vai informācijas daļas pavairošana vai izplatīšana jebkādā formā stingri aizliegta. Tāpat arī ir aizliegta lejupielāde automātiskā režīmā. Jebkura 1188 web lapā publicētā materiāla pārpublicēšana ir kategoriski aizliegta bez 1188 web lapas redakcijas atļaujas.</p>
872                <p>Portāla palÄ«dzÄ«bas dienests: e-pasts - <a href="mailto:[email protected]" title="PalÄ«dzÄ«bas dienesta e-pasta adrese">[email protected]</a><br>
873                    Izstrādāts <a href="https://www.tet.lv/par-tet/par-mums/zimoli">SIA Helio Media</a> 2004-2026</p>
874            </div>
875            <ul class="soc-icons">
876                <li><a data-icon="facebook" target="_blank" href="//www.facebook.com/1188.lv"></a></li>
877                <li><a data-icon="draugiem" target="_blank" href="//www.draugiem.lv/1188"></a></li>
878                <li><a data-icon="twitter" target="_blank" href="//twitter.com/1188"></a></li>
879                <li><a data-icon="google" target="_blank" href="//plus.google.com/u/1/116153303316815609354"></a></li>
880            </ul>
881        </div>
882    </div>
883</footer>
884</div>
885    <div id="sas_93629"></div>
886    
886<script type="application/javascript">
887        var sas = sas || {};
888        sas.cmd = sas.cmd || [];
889        sas.cmd.push(
890            function () {
891                sas.call(
892                    { siteId: 287038, pageId: 1315282, formatId: 93629, tagId: "sas_93629" },
893                    { networkId: 3323, domain: "https://www14.smartadserver.com" /*, onNoad: function() {} */ }
894                );
895            }
896        );
897    </script>
897
898    <!-- Load Delfi script after jQuery and StickyAsset are ready -->
899    
899<script>
900        (function() {
901            // Check if Delfi script is already loaded
902            if (window.delfi_afp && window.delfi_afp.push && typeof window.delfi_afp.push === 'function') {
903                return; // Already loaded
904            }
905            
906            var loadAttempts = 0;
907            var maxAttempts = 50; // 5 seconds max (50 * 100ms)
908            
909            // Wait for jQuery and sticky plugin to be available
910            function loadDelfiScript() {
911                loadAttempts++;
912                
913                if (loadAttempts > maxAttempts) {
914                    console.warn('Delfi script loading timeout - jQuery or StickyAsset not available');
915                    return;
916                }
917                
918                if (typeof jQuery !== 'undefined' && typeof jQuery.fn.sticky === 'function') {
919                    // Check if script is already in DOM
920                    var existingScript = document.querySelector('script[src*="delfi.lv"]');
921                    if (existingScript) {
922                        return; // Already loading or loaded
923                    }
924                    
925                    var script = document.createElement('script');
926                    script.src = 'https://static.delfi.lv/Portal/Scripts/Advertising-runtime.js';
927                    script.async = true;
928                    script.onerror = function() {
929                        console.warn('Failed to load Delfi script');
930                    };
931                    document.head.appendChild(script);
932                } else {
933                    // Retry after a short delay
934                    setTimeout(loadDelfiScript, 100);
935                }
936            }
937            
938            // Start checking when DOM is ready
939            if (document.readyState === 'loading') {
940                document.addEventListener('DOMContentLoaded', loadDelfiScript);
941            } else {
942                loadDelfiScript();
943            }
944        })();
945    </script>
vendor: 1 bytes, line 945
945
946<script src="/v4/assets/8077fdfa/jquery.js?v=1671790134"></script>
vendor: 1 bytes, line 946
946
947<script src="/v4/assets/74ec5449/js/bootstrap.js?v=1671790134"></script>
vendor: 1 bytes, line 947
947
948<script src="/v4/assets/726d7060/jquery.browser.min.js?v=1671790134"></script>
vendor: 1 bytes, line 948
948
949<script src="/v4/assets/94715c1f/jquery.sticky.js?v=1671790134"></script>
vendor: 1 bytes, line 949
949
950<script src="/v4/assets/dfe40772/mgcode.helpers.js?v=1671790134"></script>
vendor: 1 bytes, line 950
950
951<script src="/v4/js/main.js?v=1762289882"></script>
vendor: 1 bytes, line 951
951
952<script src="/v4/assets/9db2545b/js/weather-changer.js?v=1671790487"></script>
vendor: 1 bytes, line 952
952
953<script src="/v4/assets/f67c49f4/mapbox-gl.js?v=1671790134"></script>
vendor: 1 bytes, line 953
953
954<script src="/v4/assets/f283cd2d/native.history.js?v=1671790134"></script>
vendor: 1 bytes, line 954
954
955<script src="/v4/assets/9db2545b/js/weather-map.js?v=1671790487"></script>
vendor: 1 bytes, line 955
955
956<script>
957            // Initialize delfi_afp object
958            if (!window.delfi_afp) {
959                window.delfi_afp = { banners: [] };
960            }
961            if (!window.delfi_afp.push) {
962                window.delfi_afp.push = function(options) {
963                    if (!this.banners) {
964                        this.banners = [];
965                    }
966                    this.banners.push(options);
967                };
968            }
969            
970            function waitForDelfiScript(callback) {
971                // Check if Delfi script is already loaded and ready
972                if (window.delfi_afp && typeof window.delfi_afp.push === 'function' && window.delfi_afp.push.toString().indexOf('native') === -1) {
973                    // Delfi script is loaded and push is the real function
974                    setTimeout(callback, 10);
975                    return;
976                }
977                
978                // Wait for DOM first
979                if (document.readyState === 'loading') {
980                    document.addEventListener('DOMContentLoaded', function() {
981                        waitForDelfiScriptReady(callback);
982                    });
983                } else {
984                    waitForDelfiScriptReady(callback);
985                }
986            }
987            
988            function waitForDelfiScriptReady(callback) {
989                var attempts = 0;
990                var maxAttempts = 100; // 10 seconds max
991                
992                function check() {
993                    attempts++;
994                    // Check if Delfi script has loaded (it replaces the push function)
995                    if (window.delfi_afp && typeof window.delfi_afp.push === 'function') {
996                        // Check if it's the real Delfi function (not our stub)
997                        var pushStr = window.delfi_afp.push.toString();
998                        if (pushStr.indexOf('native') !== -1 || pushStr.length > 200) {
999                            // Real Delfi function loaded
1000                            console.log('Adform: Delfi script loaded after', attempts * 100, 'ms');
1001                    setTimeout(callback, 10);
1002                            return;
1003                        }
1004                    }
1005                    
1006                    if (attempts < maxAttempts) {
1007                        setTimeout(check, 100);
1008                    } else {
1009                        // Timeout - call anyway, our stub will queue it
1010                        console.warn('Adform: Delfi script loading timeout after', attempts * 100, 'ms, calling callback anyway');
1011                        setTimeout(callback, 10);
1012                    }
1013                }
1014                
1015                check();
1016            }
1017        
1018                waitForDelfiScript(function() {
1019                    console.log('Adform: Pushing banner to delfi_afp', {
1020                        dom: 'delfi-adx-2199612',
1021                        mid: parseInt('2199612', 10),
1022                        hasDelfiAfp: !!window.delfi_afp,
1023                        delfiAfpType: typeof window.delfi_afp,
1024                        pushType: typeof window.delfi_afp ? typeof window.delfi_afp.push : 'undefined'
1025                    });
1026                    try {
1027                        if (!window.delfi_afp || typeof window.delfi_afp.push !== 'function') {
1028                            console.error('Adform: delfi_afp.push is not available, banner may not load');
1029                            return;
1030                        }
1031                        // Determine if mobile based on window width at runtime
1032                        // Always use viewport width to determine which banner to show
1033                        const isMobile = window.innerWidth < 901;
1034                        
1035                        // Build the push object with appropriate width constraint
1036                        const pushConfig = {
1037                            dom: 'delfi-adx-2199612',
1038                            mid: parseInt('2199612', 10),
1039                            lazyload: true
1040                        };
1041                        
1042                        // Use viewport width to determine constraint
1043                        // Mobile viewport (< 901px) should show mobile banner (widthAtMost: 900)
1044                        // Desktop viewport (>= 901px) should show desktop banner (widthAtLeast: 901)
1045                        if (isMobile) {
1046                            pushConfig.widthAtMost = 900;
1047                        } else {
1048                            pushConfig.widthAtLeast = 901;
1049                        }
1050                        
1051                        console.log('Adform: Pushing banner with config', {
1052                            adformId: '2199612',
1053                            isMobile: isMobile,
1054                            windowWidth: window.innerWidth,
1055                            constraint: isMobile ? 'widthAtMost: 900' : 'widthAtLeast: 901'
1056                        });
1057                        
1058                        window.delfi_afp.push(pushConfig);
1059                        console.log('Adform: Banner pushed successfully to delfi_afp');
1060                        // Don't show banner automatically - wait for content to be detected
1061                        // The polling and adformtag.onLoaded callbacks will handle showing when content is available
1062                    } catch (e) {
1063                        console.error('Adform: Error pushing banner to delfi_afp:', e);
1064                    }
1065                });
1066            
1067                (function() {
1068                    function hideBannerImmediately() {
1069                        const banner = document.getElementById('delfi-adx-2199612');
1070                        if (banner) {
1071                            // Initially hide banner - it will be shown when content loads or after pushing
1072                            banner.style.setProperty('display', 'none', 'important');
1073                            banner.style.setProperty('visibility', 'hidden', 'important');
1074                            banner.style.setProperty('opacity', '0', 'important');
1075                            banner.style.setProperty('z-index', '-1', 'important');
1076                            banner.style.setProperty('pointer-events', 'n
1076one', 'important');
1077                            
1078                            // Hide content area
1079                            const content = banner.querySelector('.adform-monster-content');
1080                            if (content) {
1081                                content.style.setProperty('display', 'none', 'important');
1082                                content.style.setProperty('visibility', 'hidden', 'important');
1083                            }
1084                            
1085                            // Hide topbar too - it will show with banner
1086                            const topbar = banner.querySelector('.adform-monster-topbar');
1087                            if (topbar) {
1088                                topbar.style.setProperty('display', 'none', 'important');
1089                                topbar.style.setProperty('visibility', 'hidden', 'important');
1090                            }
1091                        }
1092                    }
1093                    
1094                    // Only hide initially if DOM is ready, otherwise wait
1095                    if (document.readyState === 'loading') {
1096                        document.addEventListener('DOMContentLoaded', hideBannerImmediately);
1097                    } else {
1098                        hideBannerImmediately();
1099                    }
1100                    
1101                    const banner = document.getElementById('delfi-adx-2199612');
1102                    const contentWrapper = document.getElementById('delfi-adx-2199612-content');
1103                    let bannerDeterminedEmpty = false;
1104                    let bannerShown = false;
1105                    let adformLoadState = 'pending';
1106                    
1107                    // Key for exposing showBanner function
1108                    const showBannerKey = 'adform_showBanner_' + 'delfi-adx-2199612';
1109                    
1110                    let scaleObserver = null;
1111                    let resizeHandler = null;
1112                    let containerResizeObserver = null;
1113                    let scaleTimeout = null;
1114                    let resizeTimeout = null;
1115                    let contentLoadTimeout = null;
1116                    let stateCheckInterval = null;
1117                    
1118                    function cleanup() {
1119                        restoreScroll();
1120                        if (stateCheckInterval) {
1121                            clearInterval(stateCheckInterval);
1122                        }
1123                        if (scaleObserver && banner) {
1124                            scaleObserver.disconnect();
1125                            scaleObserver = null;
1126                        }
1127                        if (containerResizeObserver) {
1128                            containerResizeObserver.disconnect();
1129                            containerResizeObserver = null;
1130                        }
1131                        if (resizeHandler) {
1132                            window.removeEventListener('resize', resizeHandler);
1133                            resizeHandler = null;
1134                        }
1135                        if (scaleTimeout) {
1136                            clearTimeout(scaleTimeout);
1137                            scaleTimeout = null;
1138                        }
1139                        if (resizeTimeout) {
1140                            clearTimeout(resizeTimeout);
1141                            resizeTimeout = null;
1142                        }
1143                        if (contentLoadTimeout) {
1144                            clearTimeout(contentLoadTimeout);
1145                            contentLoadTimeout = null;
1146                        }
1147                    }
1148
1149                    function restoreScroll() {
1150                        document.body.style.removeProperty('overflow');
1151                        document.documentElement.style.removeProperty('overflow');
1152                        document.body.style.overflow = '';
1153                        document.documentElement.style.overflow = '';
1154                    }
1155                    
1156                    function disableScroll() {
1157                        if (banner && 
1158                            bannerShown && 
1159                            banner.style.display !== 'none' && 
1160                            banner.style.visibility !== 'hidden' &&
1161                            banner.style.opacity !== '0' &&
1162                            window.getComputedStyle(banner).display !== 'none') {
1163                            document.body.style.overflow = 'hidden';
1164                            document.documentElement.style.overflow = 'hidden';
1165                        } else {
1166                            restoreScroll();
1167                        }
1168                    }
1169
1170                    // Setup topbar immediately - make it visible and functional
1171                    function setupTopbar() {
1172                        const topbar = banner ? banner.querySelector('.adform-monster-topbar') : null;
1173                        if (topbar) {
1174                            topbar.style.setProperty('display', 'flex', 'important');
1175                            topbar.style.setProperty('visibility', 'visible', 'important');
1176                            topbar.style.setProperty('opacity', '1', 'important');
1177                            topbar.style.setProperty('pointer-events', 'auto', 'important');
1178                            
1179                            const closeLink = topbar.querySelector('.adform-monster-close-link');
1180                            if (closeLink && !closeLink.hasAttribute('data-listener-attached')) {
1181                                closeLink.setAttribute('data-listener-attached', 'true');
1182                                closeLink.onclick = function(e) {
1183                                    e.preventDefault();
1184                                    e.stopPropagation();
1185                                    stopCountdown();
1186                                    if (typeof hideBanner === 'function') {
1187                                        hideBanner();
1188                                    }
1189                                };
1190                            }
1191                        }
1192                    }
1193
1194                    if (banner) {
1195                        hideBannerImmediately();
1196                        restoreScroll();
1197                        bannerDeterminedEmpty = false;
1198                        bannerShown = false;
1199                        // Don't setup topbar until we know there's content to show
1200                    }
1201                    
1202                    // Restore scroll when DOM is ready
1203                    if (document.readyState === 'loading') {
1204                        document.addEventListener('DOMContentLoaded', function() {
1205                            restoreScroll();
1206                            if (banner) {
1207                                bannerDeterminedEmpty = false;
1208                                bannerShown = false;
1209                                // Topbar will be set up when showBanner() is called
1210                            }
1211                        });
1212                    } else {
1213                        restoreScroll();
1214                    }
1215                    
1216                    window.addEventListener('beforeunload', function() {
1217                        restoreScroll();
1218                        cleanup();
1219                    });
1220
1221                    function moveContentToWrapper() {
1222                        if (!banner || !contentWrapper) return;
1223
1224                        Array.from(banner.children).forEach(function(child) {
1225                            if (child && 
1226                                child.id !== 'delfi-adx-2199612-content' && 
1227                                !child.classList.contains('adform-monster-topbar') && 
1228                                !child.classList.contains('adform-monster-content')) {
1229                                contentWrapper.appendChild(child);
1230                                child.style.pointerEvents = 'auto';
1231                            }
1232                        });
1233
1234                        const contentDiv = banner.querySelector('.adform-monster-content');
1235                        if (contentDiv) {
1236                            Array.from(contentDiv.children).forEach(function(child) {
1237                                if (child && child.id !== 'delfi-adx-2199612-content') {
1238                                    contentWrapper.appendChild(child);
1239                                    child.style.pointerEvents = 'auto';
1240                                }
1241                            });
1242                        }
1243                    }
1244
1245                    function isConfirmedAdformIframe(iframe) {
1246                        const src = iframe && iframe.getAttribute('src');
1247
1248                        return adformLoadState === 'filled' &&
1249                            src &&
1250                            !/^about:blank$/i.test(src) &&
1251                            iframe.offsetWidth > 0 &&
1252                            iframe.offsetHeight > 0;
1253                    }
1254
1255                    function checkForContent() {
1256                        if (!banner) {
1257                            return false;
1258                        }
1259
1260                        moveContentToWrapper();
1261                        
1262                        // A placeholder iframe can be present even when Delfi has
1263                        // returned no creative. Treat it as content only after
1264                        // Adform confirms that the placement is filled.
1265                        const iframes = banner.querySelectorAll('iframe');
1266                        if (iframes.length > 0) {
1267                            const hasValidIframe = Array.from(iframes).some(function(iframe) {
1268                                return isConfirmedAdformIframe(iframe);
1269                            });
1270                            if (hasValidIframe) {
1271                                console.log('Adform: Content detected - iframes found', iframes.length);
1272                                return true;
1273                            }
1274                        }
1275                        
1276                        // Check for images (excluding logo)
1277                        const images = banner.querySelectorAll('img:not(.adform-monster-logo)');
1278                        if (images.length > 0) {
1279                            // Verify at least one image has a src
1280                            const hasValidImage = Array.from(images).some(function(img) {
1281                                return img.src || img.getAttribute('src');
1282                            });
1283                            if (hasValidImage) {
1284                                console.log('Adform: Content detected - images found', images.length);
1285                                return true;
1286                            }
1287                        }
1288                        
1289                        // Check ad wrapper for actual ad content (not just the wrapper itself)
1290                        const adWrapper = banner.querySelector('.adform-monster-ad-wrapper');
1291                        
1292                        if (adWrapper && adWrapper.children.length > 0) {
1293                            // Check if children have actual ad content (iframes, images, or elements with real dimensions)
1294                            const hasRealContent = Array.from(adWrapper.children).some(function(child) {
1295                                // Skip the ad wrapper itself and only check for actual ad elements
1296                                if (child.classList.contains('adform-monster-ad-wrapper')) {
1297                                    return false;
1298                                }
1299                                return (child.tagName === 'IFRAME' && isConfirmedAdformIframe(child)) ||
1300                                       child.tagName === 'IMG' || 
1301                                       Array.from(child.querySelectorAll('iframe')).some(isConfirmedAdformIframe) ||
1302                                       child.querySelector('img') ||
1303                                       (adformLoadState === 'filled' && child.offsetWidth > 100 && child.offsetHeight > 100);
1304                            });
1305                            if (hasRealContent) {
1306                                console.log('Adform: Content detected - adWrapper has children with actual content');
1307                                return true;
1308                            }
1309                        }
1310                        
1311                        // Also check direct children of banner (Adform might insert content directly)
1312                        const directChildren = Array.from(banner.children).filter(function(child) {
1313                            return !child.classList.contains('adform-monster-topbar') && 
1314                                   !child.classList.contains('adform-monster-content');
1315                        });
1316                        if (directChildren.length > 0) {
1317                            const hasRealContent = directChildren.some(function(child) {
1318                                return (child.tagName === 'IFRAME' && isConfirmedAdformIframe(child)) ||
1319                                       child.tagName === 'IMG' || 
1320                                       Array.from(child.querySelectorAll('iframe')).some(isConfirmedAdformIframe) ||
1321                                       child.querySelector('img') ||
1322                                       (adformLoadState === 'filled' && child.children.length > 0) ||
1323                                       (adformLoadState === 'filled' && child.offsetWidth > 0) ||
1324                                       (adformLoadState === 'filled' && child.offsetHeight > 0);
1325                            });
1326                            if (hasRealContent) {
1327                                console.log('Adform: Content detected - direct children of banner');
1328                                return true;
1329                            }
1330                        }
1331                        
1332                        console.log('Adform: No content detected');
1333                        return false;
1334                    }
1335
1336                    let isShowingBanner = false; // Prevent multiple simultaneous calls
1337                    
1338                    function showBanner() {
1339                        // Prevent multiple simultaneous calls that cause shaking
1340                        if (isShowingBanner) {
1341                            console.log('Adform: showBanner already in progress, skipping');
1342                            return;
1343                        }
1344                        
1345                        console.log('Adform: showBanner called', {
1346                            hasBanner: !!banner,
1347                            bannerShown: bannerShown,
1348                            bannerDeterminedEmpty: bannerDeterminedEmpty,
1349                            domId: 'delfi-adx-2199612'
1350                        });
1351                        
1352                        if (!banner) {
1353                            console.warn('Adform: Banner element not found');
1354                            return;
1355                        }
1356                        
1357                        // Don't show if already determined to be empty
1358                        if (bannerDeterminedEmpty) {
1359                            console.log('Adform: Banner already determined empty, not showing');
1360                            return;
1361                        }
1362                        
1363                        // If already shown and visible, don't re-apply styles (prevents shaking)
1364                        if (bannerShown) {
1365                            const computedStyle = window.getComputedStyle(banner);
1366                            if (computedStyle.display === 'flex' && 
1367                                computedStyle.visibility === 'visible' && 
1368                                parseFloat(computedStyle.opacity) >= 0.9) {
1369                                console.log('Adform: Banner already shown and visible, skipping');
1370                                return;
1371                            }
1372                        }
1373                        
1374                        isShowingBanner = true;
1375                        
1376                        moveContentToWrapper();
1377                        const hasContent = checkForContent();
1378                        
1379                        console.log('Adform: Content check result', {
1380                            hasContent: hasContent,
1381                            bannerShown: bannerShown
1382                        });
1383                        
1384                        // Don't show banner if there's no content - ad network didn't provide banner
1385                        if (!hasContent) {
1386                            console.log('Adform: No content detected, not showing banner');
1387                            // If we've been checking for a while and still no content, mark as empty
1388                            if (!bannerShown) {
1389                                // Will be marked as empty by polling after timeout
1390                                return;
1391                            }
1392                            // If already shown but content disappeared, hide it
1393                            if (bannerShown) {
1394                                console.log('Adform: Content disappeared, hiding banner');
1395                                hideBanner();
1396                            }
1397                            return;
1398                        }
1399                            
1400                        bannerShown = true;
1401                        bannerDeterminedEmpty = false;
1402                        
1403                        console.log('Adform: Showing banner now');
1404                            
1405                            // Force show banner immediately
1406                                banner.style.setProperty('display', 'flex', 'important');
1407                                banner.style.setProperty('visibility', 'visible', 'important');
1408                                banner.style.setProperty('opacity', '1', 'important');
1409                            banner.style.setProperty('position', 'fixed', 'important');
1410                            banner.style.setProperty('top', '0', 'important');
1411                            banner.style.setProperty('left', '0', 'important');
1412                            banner.style.setProperty('right', '0', 'important');
1413                            banner.style.setProperty('bottom', '0', 'important');
1414                            banner.style.setProperty('width', '100vw', 'important');
1415                            banner.style.setProperty('height', '100vh', 'important');
1416                                banner.style.setProperty('z-index', '999999', 'important');
1417                            banner.style.setProperty('background', 'rgba(0, 0, 0, 0.9)', 'important');
1418                            banner.style.setProperty('background-color', 'rgba(0, 0, 0, 0.9)', 'important');
1419                            banner.style.setProperty('backdrop-filter', 'blur(4px)', 'important');
1420                            banner.style.setProperty('flex-direction', 'column', 'important');
1421                            banner.style.setProperty('align-items', 'stretch', 'important');
1422                            banner.style.setProperty('justify-content', 'flex-start', 'important');
1423                            banner.style.setProperty('margin', '0', 'important');
1424                            banner.style.setProperty('padding', '0', 'important');
1425                            banner.style.setProperty('overflow', 'hidden', 'important');
1426                            banner.style.setProperty('box-sizing', 'border-box', 'important');
1427                            // Ensure banner is clickable and visible
1428                            banner.style.setProperty('pointer-events', 'auto', 'important');
1429                            
1430                            // Show topbar immediately - don't wait for requestAnimationFrame
1431                            const topbar = banner.querySelector('.adform-monster-topbar');
1432                            if (topbar) {
1433                                // Ensure topbar is at the very top
1434                                topbar.style.setProperty('display', 'flex', 'important');
1435                                topbar.style.setProperty('visibility', 'visible', 'important');
1436                                topbar.style.setProperty('opacity', '1', 'important');
1437                                topbar.style.setProperty('position', 'fixed', 'important');
1438                                topbar.style.setProperty('top', '0', 'important');
1439                                topbar.style.setProperty('left', '0', 'important');
1440                                topbar.style.setProperty('right', '0', 'important');
1441                                topbar.style.setProperty('bottom', 'auto', 'important');
1442                                topbar.style.setProperty('width', '100%', 'important');
1443                                topbar.style.setProperty('height', '60px', 'important');
1444                                topbar.style.setProperty('max-height', '60px', 'important');
1445                                topbar.style.setProperty('z-index', '1000001', 'important');
1446                                topbar.style.setProperty('margin', '0', 'important');
1447                                topbar.style.setProperty('margin-top', '0', 'important');
1448                                topbar.style.setProperty('margin-bottom', '0', 'important');
1449                                topbar.style.setProperty('transform', 'translateY(0)', 'important');
1450                                topbar.style.setProperty('pointer-events', 'auto', 'important');
1451                                topbar.style.setProperty('background-color', '#1a1a1a', 'important');
1452                                topbar.style.setProperty('background', 'linear-gradient(180deg, #2a2a2a 0%, #1a1a1a 100%)', 'important');
1453                                topbar.style.setProperty('align-items', 'center', 'important');
1454                                topbar.style.setProperty('justify-content', 'space-between', 'important');
1455                                topbar.style.setProperty('padding', '0 24px', 'important');
1456                                
1457                                // Ensure logo link is visible
1458                                const logoLink = topbar.querySelector('.adform-monster-logo-link');
1459                                if (logoLink) {
1460                                    logoLink.style.setProperty('display', 'flex', 'important');
1461                                    logoLink.style.setProperty('visibility', 'visible', 'important');
1462                                    logoLink.style.setProperty('opacity', '1', 'important');
1463                                    logoLink.style.setProperty('align-items', 'center', 'important');
1464                                    logoLink.style.setProperty('text-decoration', 'none', 'important');
1465                                    logoLink.style.setProperty('height', '100%', 'important');
1466                                    
1467                                    // Ensure logo image is visible
1468                                    const logoImg = logoLink.querySelector('.adform-monster-logo');
1469                                    if (logoImg) {
1470                                        logoImg.style.setProperty('display', 'block', 'important');
1471                                        logoImg.style.setProperty('visibility', 'visible', 'important');
1472                                        logoImg.style.setProperty('opacity', '1', 'important');
1473                                        logoImg.style.setProperty('height', '36px', 'important');
1474                                        logoImg.style.setProperty('width', 'auto', 'important');
1475                                        logoImg.style.setProperty('max-width', '120px', 'important');
1476                                    }
1477                                }
1478                                
1479                                // Ensure close wrapper is visible
1480                                const closeWrapper = topbar.querySelector('.adform-monster-close-wrapper');
1481                                if (closeWrapper) {
1482                                    closeWrapper.style.setProperty('display', 'flex', 'important');
1483                                    closeWrapper.style.setProperty('visibility', 'visible', 'important');
1484                                    closeWrapper.style.setProperty('opacity', '1', 'important');
1485                                    closeWrapper.style.setProperty('align-items', 'center', 'important');
1486                                    closeWrapper.style.setProperty('height', '100%', 'important');
1487                                    
1488                                    // Ensure countdown is visible (but hide on mobile)
1489                                    const countdownElement = closeWrapper.querySelector('.adform-monster-countdown');
1490                                    if (countdownElement) {
1491                                        const isMobile = window.innerWidth <= 900;
1492                                        if (isMobile) {
1493                                            countdownElement.style.setProperty('display', 'none', 'important');
1494                                        } else {
1495                                            countdownElement.style.setProperty('display', 'block', 'important');
1496                                            countdownElement.style.setProperty('visibility', 'visible', 'important');
1497                                            countdownElement.style.setProperty('opacity', '1', 'important');
1498                                        }
1499                                        countdownElement.style.setProperty('color', '#ffffff', 'important');
1500                                        countdownElement.style.setProperty('font-size', '15px', 'important');
1501                                        countdownElement.style.setProperty('font-weight', '500', 'important');
1502                                        countdownElement.style.setProperty('white-space', 'nowrap', 'important');
1503                                    }
1504                                    
1505                                    // Ensure close link is visible
1506                                    const closeLink = closeWrapper.querySelector('.adform-monster-close-link');
1507                                    if (closeLink) {
1508                                        closeLink.style.setProperty('display', 'block', 'important');
1509                                        closeLink.style.setProperty('visibility', 'visible', 'important');
1510                                        closeLink.style.setProperty('opacity', '1', 'important');
1511                                        closeLink.style.setProperty('color', '#ffffff', 'important');
1512                                        closeLink.style.setProperty('font-size', '15px', 'important');
1513                                        closeLink.style.setProperty('font-weight', '500', 'important');
1514                                        closeLink.style.setProperty('text-decoration', 'none', 'important');
1515                                        closeLink.style.setProperty('cursor', 'pointer', 'important');
1516                                        closeLink.style.setProperty('white-space', 'nowrap', 'important');
1517                                        closeLink.style.setProperty('padding', '8px 16px', 'important');
1518                                        closeLink.style.setProperty('border-radius', '4px', 'important');
1519                                        closeLink.style.setProperty('background-color', 'transparent', 'important');
1520                                    }
1521                                }
1522                            }
1523                            
1524                            // Use requestAnimationFrame to batch style changes and prevent shaking
1525                            requestAnimationFrame(function() {
1526                                // Only update styles if they're not already set correctly
1527                                const computedStyle = window.getComputedStyle(banner);
1528                                if (computedStyle.display !== 'flex' || 
1529                                    computedStyle.visibility !== 'visible' || 
1530                                    parseFloat(computedStyle.opacity) < 0.9) {
1531                                    banner.style.setProperty('display', 'flex', 'important');
1532                                    banner.style.setProperty('visibility', 'visible', 'important');
1533                                    banner.style.setProperty('opacity', '1', 'important');
1534                                }
1535                                banner.style.setProperty('z-index', '999999', 'important');
1536                                banner.style.setProperty('pointer-events', 'auto', 'important');
1537                                
1538                                // Ensure topbar is still visible with all elements
1539                                if (topbar) {
1540                                    const topbarStyle = window.getComputedStyle(topbar);
1541                                    if (topbarStyle.display !== 'flex' || 
1542                                        topbarStyle.visibility !== 'visible' || 
1543                                        parseFloat(topbarStyle.opacity) < 0.9) {
1544                                        topbar.style.setProperty('display', 'flex', 'important');
1545                                        topbar.style.setProperty('visibility', 'visible', 'important');
1546                                        topbar.style.setProperty('opacity', '1', 'important');
1547                                    }
1548                                    topbar.style.setProperty('z-index', '1000001', 'important');
1549                                    topbar.style.setProperty('pointer-events', 'auto', 'important');
1550                                    topbar.style.setProperty('align-items', 'center', 'important');
1551                                    topbar.style.setProperty('justify-content', 'space-between', 'important');
1552                                }
1553                                
1554                                const content = banner.querySelector('.adform-monster-content');
1555                                // Always show content area - it will display Adform content when it loads
1556                                if (content) {
1557                                    const contentStyle = window.getComputedStyle(content);
1558                                    if (contentStyle.display !== 'flex' || 
1559                                        contentStyle.visibility !== 'visible' || 
1560                                        parseFloat(contentStyle.opacity) < 0.9) {
1561                                        content.style.setProperty('display', 'flex', 'important');
1562                                        content.style.setProperty('visibility', 'visible', 'important');
1563                                        content.style.setProperty('opacity', '1', 'important');
1564                                    }
1565                                    content.style.setProperty('pointer-events', 'auto', 'important');
1566                                    content.style.setProperty('margin-top', '60px', 'important');
1567                                    content.style.setProperty('position', 'relative', 'important');
1568                                    content.style.setProperty('z-index', '10000', 'important');
1569                                    content.style.setProperty('align-items', 'center', 'important');
1570                                    content.style.setProperty('justify-content', 'center', 'important');
1571                                }
1572                            
1573                            // Also ensure content wrapper is visible and properly centered
1574                            if (contentWrapper) {
1575                                contentWrapper.style.setProperty('display', 'flex', 'important');
1576                                contentWrapper.style.setProperty('visibility', 'visible', 'important');
1577                                contentWrapper.style.setProperty('pointer-events', 'auto', 'important');
1578                                contentWrapper.style.setProperty('opacity', '1', 'important');
1579                                contentWrapper.style.setProperty('width', '100%', 'important');
1580                                contentWrapper.style.setProperty('height', '100%', 'important');
1581                                contentWrapper.style.setProperty('align-items', 'center', 'important');
1582                                contentWrapper.style.setProperty('justify-content', 'center', 'important');
1583                                contentWrapper.style.setProperty('position', 'relative', 'important');
1584                                }
1585                                
1586                                const closeLink = banner.querySelector('.adform-monster-close-link');
1587                                if (closeLink) {
1588                                    closeLink.onclick = function(e) {
1589                                        e.preventDefault();
1590                                        e.stopPropagation();
1591                        
1591                stopCountdown();
1592                                        hideBanner();
1593                                    };
1594                                }
1595                                
1596                                setTimeout(function() {
1597                                    disableScroll();
1598                                    // Re-check for content after a short delay and move it if needed
1599                                    moveContentToWrapper();
1600                                    
1601                                    // Start countdown timer for auto-close
1602                                    if (typeof startCountdown === 'function') {
1603                                        startCountdown();
1604                                    }
1605                                    
1606                                    // Ensure topbar is still visible after all operations
1607                                    if (topbar) {
1608                                        topbar.style.setProperty('display', 'flex', 'important');
1609                                        topbar.style.setProperty('visibility', 'visible', 'important');
1610                                        topbar.style.setProperty('opacity', '1', 'important');
1611                                        topbar.style.setProperty('z-index', '1000001', 'important');
1612                                    }
1613                                }, 50);
1614                                
1615                                // Reset flag after styles are applied
1616                                isShowingBanner = false;
1617                            });
1618                            
1619                            // Set up MutationObserver to watch for style changes on topbar
1620                            if (topbar) {
1621                                const restoreTopbarVisibility = function() {
1622                                    if (bannerShown && banner && banner.style.display !== 'none') {
1623                                        topbar.style.setProperty('display', 'flex', 'important');
1624                                        topbar.style.setProperty('visibility', 'visible', 'important');
1625                                        topbar.style.setProperty('opacity', '1', 'important');
1626                                        topbar.style.setProperty('z-index', '1000001', 'important');
1627                                        topbar.style.setProperty('position', 'fixed', 'important');
1628                                        topbar.style.setProperty('top', '0', 'important');
1629                                        topbar.style.setProperty('left', '0', 'important');
1630                                        topbar.style.setProperty('right', '0', 'important');
1631                                        topbar.style.setProperty('width', '100%', 'important');
1632                                        topbar.style.setProperty('height', '60px', 'important');
1633                                        topbar.style.setProperty('pointer-events', 'auto', 'important');
1634                                        topbar.style.setProperty('background-color', '#1a1a1a', 'important');
1635                                        topbar.style.setProperty('background', 'linear-gradient(180deg, #2a2a2a 0%, #1a1a1a 100%)', 'important');
1636                                    }
1637                                };
1638                                
1639                                // Watch for style attribute changes
1640                                const topbarObserver = new MutationObserver(function(mutations) {
1641                                    mutations.forEach(function(mutation) {
1642                                        if (mutation.type === 'attributes' && mutation.attributeName === 'style') {
1643                                            const computedStyle = window.getComputedStyle(topbar);
1644                                            if (computedStyle.display === 'none' || 
1645                                                computedStyle.visibility === 'hidden' || 
1646                                                parseFloat(computedStyle.opacity) < 0.1) {
1647                                                console.log('Adform: Topbar style changed, restoring visibility');
1648                                                restoreTopbarVisibility();
1649                                            }
1650                                        }
1651                                    });
1652                                });
1653                                
1654                                topbarObserver.observe(topbar, {
1655                                    attributes: true,
1656                                    attributeFilter: ['style', 'class']
1657                                });
1658                                
1659                                // Also set up a periodic check to ensure topbar stays visible
1660                                const topbarCheckInterval = setInterval(function() {
1661                                    if (bannerShown && banner && banner.style.display !== 'none') {
1662                                        const computedStyle = window.getComputedStyle(topbar);
1663                                        const inlineDisplay = topbar.style.display;
1664                                        const inlineVisibility = topbar.style.visibility;
1665                                        const inlineOpacity = topbar.style.opacity;
1666                                        
1667                                        // Check if topbar is hidden in any way
1668                                        if (computedStyle.display === 'none' || 
1669                                            computedStyle.visibility === 'hidden' || 
1670                                            parseFloat(computedStyle.opacity) < 0.1 ||
1671                                            inlineDisplay === 'none' ||
1672                                            inlineVisibility === 'hidden' ||
1673                                            (inlineOpacity && parseFloat(inlineOpacity) < 0.1)) {
1674                                            console.log('Adform: Topbar was hidden, restoring visibility', {
1675                                                computedDisplay: computedStyle.display,
1676                                                computedVisibility: computedStyle.visibility,
1677                                                computedOpacity: computedStyle.opacity,
1678                                                inlineDisplay: inlineDisplay,
1679                                                inlineVisibility: inlineVisibility,
1680                                                inlineOpacity: inlineOpacity
1681                                            });
1682                                            restoreTopbarVisibility();
1683                                        }
1684                                    } else {
1685                                        clearInterval(topbarCheckInterval);
1686                                        topbarObserver.disconnect();
1687                                    }
1688                                }, 100); // Check very frequently
1689                            }
1690                    }
1691                    
1692                    // Expose showBanner immediately so it can be called from waitForDelfiScript callback
1693                    window[showBannerKey] = showBanner;
1694                    console.log('Adform: showBanner function exposed on window', {
1695                        key: showBannerKey,
1696                        hasFunction: typeof window[showBannerKey] === 'function'
1697                    });
1698                    
1699                    // Set up MutationObserver to watch for content being added to the banner
1700                    // This will detect when Adform actually inserts the ad content
1701                    if (banner) {
1702                        const contentObserver = new MutationObserver(function(mutations) {
1703                            if (bannerDeterminedEmpty || bannerShown) {
1704                                return; // Already handled
1705                            }
1706                            
1707                            let contentAdded = false;
1708                            mutations.forEach(function(mutation) {
1709                                if (mutation.type === 'childList' && mutation.addedNodes.length > 0) {
1710                                    // Check if any added node is actual content
1711                                    Array.from(mutation.addedNodes).forEach(function(node) {
1712                                        if (node.nodeType === 1) { // Element node
1713                                            if (node.tagName === 'IFRAME' || 
1714                                                node.tagName === 'IMG' ||
1715                                                (node.querySelector && (node.querySelector('iframe') || node.querySelector('img')))) {
1716                                                contentAdded = true;
1717                                            }
1718                                        }
1719                                    });
1720                                }
1721                            });
1722                            
1723                            if (contentAdded) {
1724                                console.log('Adform: Content detected via MutationObserver');
1725                                moveContentToWrapper();
1726                                if (checkForContent() && !bannerShown) {
1727                                    showBanner();
1728                                }
1729                            }
1730                        });
1731                        
1732                        contentObserver.observe(banner, {
1733                            childList: true,
1734                            subtree: true
1735                        });
1736                        
1737                        // Also observe the ad wrapper specifically
1738                        if (contentWrapper) {
1739                            contentObserver.observe(contentWrapper, {
1740                                childList: true,
1741                                subtree: true
1742                            });
1743                        }
1744                    }
1745
1746                    function hideBanner() {
1747                        stopCountdown();
1748                        if (banner) {
1749                            bannerDeterminedEmpty = true;
1750                            bannerShown = false;
1751                            // Hide banner completely (including topbar)
1752                            banner.style.setProperty('display', 'none', 'important');
1753                            banner.style.setProperty('visibility', 'hidden', 'important');
1754                            banner.style.setProperty('opacity', '0', 'important');
1755                            banner.style.setProperty('z-index', '-1', 'important');
1756                            banner.style.setProperty('pointer-events', 'none', 'important');
1757                            
1758                            const topbar = banner.querySelector('.adform-monster-topbar');
1759                            const content = banner.querySelector('.adform-monster-content');
1760                            
1761                            // Hide topbar with banner
1762                            if (topbar) {
1763                                topbar.style.setProperty('display', 'none', 'important');
1764                                topbar.style.setProperty('visibility', 'hidden', 'important');
1765                            }
1766                            
1767                            if (content) {
1768                                content.style.setProperty('display', 'none', 'important');
1769                                content.style.setProperty('visibility', 'hidden', 'important');
1770                            }
1771                            restoreScroll();
1772                            if (scaleTimeout) clearTimeout(scaleTimeout);
1773                            if (resizeTimeout) clearTimeout(resizeTimeout);
1774                            if (contentLoadTimeout) clearTimeout(contentLoadTimeout);
1775                        }
1776                    }
1777
1778                    function checkBannerState() {
1779                        if (banner && bannerShown) {
1780                            const isVisible = banner.style.display !== 'none' && 
1781                                            banner.style.visibility !== 'hidden' && 
1782                                            banner.style.opacity !== '0' &&
1783                                            window.getComputedStyle(banner).display !== 'none';
1784                            
1785                            const scrollDisabled = document.body.style.overflow === 'hidden' || 
1786                                                  document.documentElement.style.overflow === 'hidden';
1787                            
1788                            if (!isVisible && scrollDisabled) {
1789                                restoreScroll();
1790                            } else if (isVisible && !scrollDisabled) {
1791                                disableScroll();
1792                            }
1793                        } else if (document.body.style.overflow === 'hidden' || document.documentElement.style.overflow === 'hidden') {
1794                            restoreScroll();
1795                        }
1796                    }
1797                    
1798                    if (stateCheckInterval) {
1799                        clearInterval(stateCheckInterval);
1800                    }
1801                    stateCheckInterval = setInterval(checkBannerState, 500);
1802
1803                    let callbackSetup = false;
1804                    
1805                    function setupAdformCallback() {
1806                        if (callbackSetup) {
1807                            console.log('Adform: Callback already setup, skipping');
1808                            return;
1809                        }
1810                        
1811                        console.log('Adform: setupAdformCallback called', {
1812                            hasAdformtag: !!window.adformtag,
1813                            hasOnLoaded: !!(window.adformtag && typeof window.adformtag.onLoaded === 'function'),
1814                            adformId: '2199612'
1815                        });
1816                        
1817                        if (window.adformtag && typeof window.adformtag.onLoaded === 'function') {
1818                            callbackSetup = true;
1819                            try {
1820                                window.adformtag.onLoaded(parseInt('2199612', 10), function(element) {
1821                                    if (element && element.isEmpty) {
1822                                        adformLoadState = 'empty';
1823                                        bannerDeterminedEmpty = true;
1824                                        hideBanner();
1825                                        return;
1826                                    }
1827
1828                                    adformLoadState = 'filled';
1829                                    
1830                                    [100, 300, 600, 1000].forEach(function(delay) {
1831                                        setTimeout(function() {
1832                                            moveContentToWrapper();
1833                                            if (checkForContent() && !bannerShown) {
1834                                                showBanner();
1835                                            }
1836                                        }, delay);
1837                                    });
1838                                });
1839                            } catch (e) {
1840                                console.error('Error in adformtag.onLoaded:', e);
1841                                setTimeout(function() {
1842                                    if (checkForContent() && !bannerShown) {
1843                                        showBanner();
1844                                    } else if (!checkForContent() && bannerShown) {
1845                                        hideBanner();
1846                                    }
1847                                }, 1000);
1848                            }
1849                        } else {
1850                            setTimeout(setupAdformCallback, 100);
1851                        }
1852                    }
1853                    
1854                    const callbackKey = 'adform_callback_setup_' + '2199612';
1855                    
1856                    if (!window[callbackKey]) {
1857                        window[callbackKey] = true;
1858                    
1859                    window.adformtag = window.adformtag || [];
1860                    window.adformtag.push(function() {
1861                        setupAdformCallback();
1862                    });
1863                    
1864                    if (window.adformtag && typeof window.adformtag.onLoaded === 'function') {
1865                        setupAdformCallback();
1866                        }
1867                    }
1868
1869                    // Poll for content - only show banner when content is actually detected
1870                    // Don't show empty frame if ad network doesn't provide banner
1871                    [200, 500, 1000, 2000, 3000, 5000].forEach(function(delay) {
1872                        setTimeout(function() {
1873                            if (banner && !bannerShown && !bannerDeterminedEmpty) {
1874                                moveContentToWrapper();
1875                                const hasContent = checkForContent();
1876                                console.log('Adform: Polling check', {
1877                                    delay: delay,
1878                                    hasContent: hasContent,
1879                                    bannerShown: bannerShown,
1880                                    bannerDeterminedEmpty: bannerDeterminedEmpty
1881                                });
1882                                
1883                                // Only show banner if content is actually detected
1884                                // Don't show empty frame if ad network doesn't provide banner
1885                                if (hasContent) {
1886                                    showBanner();
1887                                    setTimeout(function() {
1888                                        if (typeof scaleMonsterContent === 'function') {
1889                                            scaleMonsterContent();
1890                                        }
1891                                    }, 300);
1892                                } else if (delay >= 5000) {
1893                                    // After 5 seconds with no content, mark as empty and stop checking
1894                                    console.log('Adform: No content detected after 5 seconds, marking as empty');
1895                                    bannerDeterminedEmpty = true;
1896                                }
1897                            } else if (banner && bannerShown) {
1898                                // Banner is shown, but make sure it stays visible
1899                                // Only re-show if actually hidden (not just low opacity during transition)
1900                                const computedStyle = window.getComputedStyle(banner);
1901                                if (computedStyle.display === 'none' || 
1902                                    computedStyle.visibility === 'hidden') {
1903                                    console.log('Adform: Banner was hidden, re-showing');
1904                                    showBanner();
1905                                }
1906                            }
1907                        }, delay);
1908                    });
1909                    
1910                    // Countdown timer for auto-close after 20 seconds
1911                    let countdownInterval = null;
1912                    let countdownSeconds = 20;
1913                    
1914                    function startCountdown() {
1915                        const countdownElement = document.getElementById('delfi-adx-2199612-countdown');
1916                        if (!countdownElement) return;
1917                        
1918                        countdownSeconds = 20;
1919                        updateCountdownText();
1920                        
1921                        if (countdownInterval) {
1922                            clearInterval(countdownInterval);
1923                        }
1924                        
1925                        countdownInterval = setInterval(function() {
1926                            countdownSeconds--;
1927                            updateCountdownText();
1928                            
1929                            if (countdownSeconds <= 0) {
1930                                clearInterval(countdownInterval);
1931                                countdownInterval = null;
1932                                if (typeof hideBanner === 'function') {
1933                                    hideBanner();
1934                                }
1935                            }
1936                        }, 1000);
1937                    }
1938                    
1939                    function updateCountdownText() {
1940                        const countdownElement = document.getElementById('delfi-adx-2199612-countdown');
1941                        if (countdownElement) {
1942                            countdownElement.textContent = 'Portāls atvērsies pēc ' + countdownSeconds + ' sekundēm';
1943                            // Ensure color is white and hide on mobile
1944                            const isMobile = window.innerWidth <= 900;
1945                            countdownElement.style.setProperty('color', '#ffffff', 'important');
1946                            countdownElement.style.setProperty('display', isMobile ? 'none' : 'block', 'important');
1947                        }
1948                    }
1949                    
1950                    function stopCountdown() {
1951                        if (countdownInterval) {
1952                            clearInterval(countdownInterval);
1953                            countdownInterval = null;
1954                        }
1955                        const countdownElement = document.getElementById('delfi-adx-2199612-countdown');
1956                        if (countdownElement) {
1957                            countdownElement.textContent = '';
1958                        }
1959                    }
1960
1961                    // Reusable function to scale iframes using CSS transform
1962                    function scaleIframes(containerElement, designedWidth, designedHeight) {
1963                        if (!containerElement) return;
1964
1965                        const iframes = containerElement.querySelectorAll('iframe');
1966                        iframes.forEach(function(iframe) {
1967                            // Get iframe's original dimensions
1968                            // First check data attributes (persisted dimensions)
1969                            let iframeWidth = parseInt(iframe.getAttribute('data-original-width'));
1970                            let iframeHeight = parseInt(iframe.getAttribute('data-original-height'));
1971                            
1972                            // If not in data attributes, get from width/height attributes
1973                            if (!iframeWidth || !iframeHeight) {
1974                                iframeWidth = parseInt(iframe.getAttribute('width')) || iframeWidth;
1975                                iframeHeight = parseInt(iframe.getAttribute('height')) || iframeHeight;
1976                            }
1977                            
1978                            // If still not available, try to get from computed dimensions
1979                            if (!iframeWidth || !iframeHeight) {
1980                                iframeWidth = iframeWidth || iframe.offsetWidth || iframe.scrollWidth || designedWidth;
1981                                iframeHeight = iframeHeight || iframe.offsetHeight || iframe.scrollHeight || designedHeight;
1982                            }
1983
1984                            // Use designed dimensions as fallback
1985                            if (!iframeWidth) iframeWidth = designedWidth;
1986                            if (!iframeHeight) iframeHeight = designedHeight;
1987                            
1988                            // Store dimensions in data attributes so they persist
1989                            iframe.setAttribute('data-original-width', iframeWidth);
1990                            iframe.setAttribute('data-original-height', iframeHeight);
1991
1992                            // Get or create wrapper container
1993                            let wrapper = iframe.parentElement;
1994                            if (!wrapper || !wrapper.classList.contains('adform-iframe-wrapper')) {
1995                                wrapper = document.createElement('div');
1996                                wrapper.className = 'adform-iframe-wrapper';
1997                                iframe.parentNode.insertBefore(wrapper, iframe);
1998                                wrapper.appendChild(iframe);
1999                            }
2000
2001                            // Get the parent container's width (the actual available width)
2002                            // Walk up to find the content container
2003                            let parentContainer = containerElement;
2004                            while (parentContainer && !parentContainer.classList.contains('adform-monster-content') && 
2005                                   !parentContainer.classList.contains('adform-monster-ad-wrapper') &&
2006                                   !parentContainer.classList.contains('adform-floor-content') &&
2007                                   parentContainer !== document.body) {
2008                                parentContainer = parentContainer.parentElement;
2009                            }
2010
2011                            // Get container width from parent or viewport
2012                            // For monster banner, use viewport width directly since content is centered
2013                            let containerWidth = window.innerWidth;
2014                            if (parentContainer) {
2015                                if (parentContainer.classList.contains('adform-monster-content') || 
2016                                    parentContainer.classList.contains('adform-monster-ad-wrapper')) {
2017                                    // Monster banner: use full viewport width
2018                                    // On mobile, account for any potential scrollbar or safe areas
2019                                    containerWidth = Math.min(window.innerWidth, document.documentElement.clientWidth);
2020                                } else {
2021                                    // Floor ad: use parent width minus padding
2022                                    containerWidth = parentContainer.offsetWidth || parentContainer.clientWidth || window.innerWidth;
2023                                }
2024                            }
2025
2026                            // For monster banners, set explicit pixel width (full viewport)
2027                            // For other banners, use percentage
2028                            if (parentContainer && (parentContainer.classList.contains('adform-monster-content') || 
2029                                parentContainer.classList.contains('adform-monster-ad-wrapper'))) {
2030                                // Monster banner: set explicit viewport width with constraints
2031                                wrapper.style.width = '100%';
2032                                wrapper.style.maxWidth = '100vw';
2033                                wrapper.style.margin = '0 auto';
2034                            } else {
2035                                // Other banners: use percentage
2036                                wrapper.style.width = '100%';
2037                                wrapper.style.maxWidth = '100%';
2038                            }
2039                            
2040                            wrapper.style.overflow = 'hidden';
2041                            wrapper.style.position = 'relative';
2042                            wrapper.style.boxSizing = 'border-box';
2043                            wrapper.style.flexShrink = '0';
2044                            wrapper.style.flexGrow = '1';
2045                            wrapper.style.minWidth = '0';
2046
2047                            // Force a reflow to get accurate width
2048                            void wrapper.offsetWidth;
2049
2050                            // Get actual wrapper width after it's been sized
2051                            // For monster banner, use the actual rendered width to ensure accuracy
2052                            let actualWrapperWidth = containerWidth;
2053                            if (parentContainer && (parentContainer.classList.contains('adform-monster-content') || 
2054                                parentContainer.classList.contains('adform-monster-ad-wrapper'))) {
2055                                // For monster banners, use the measured wrapper width to account for any constraints
2056                                actualWrapperWidth = Math.min(wrapper.offsetWidth || containerWidth, containerWidth);
2057                            } else if (!parentContainer || (!parentContainer.classList.contains('adform-monster-content') && 
2058                                !parentContainer.classList.contains('adform-monster-ad-wrapper'))) {
2059                                // For non-monster banners, use the wrapper's actual width
2060                                actualWrapperWidth = wrapper.offsetWidth || wrapper.clientWidth || containerWidth;
2061                            }
2062
2063                            // Calculate scale = containerWidth / iframeWidth
2064                            // Ensure banner always scales to fit within viewport
2065                            let scale = actualWrapperWidth > 0 && iframeWidth > 0 ? actualWrapperWidth / iframeWidth : 1;
2066                            
2067                            // If banner is larger than viewport, always scale down
2068                            // If banner is smaller, keep original size (cap at 1.0)
2069                            if (iframeWidth > actualWrapperWidth) {
2070                                // Banner is too wide - scale down to fit
2071                                scale = actualWrapperWidth / iframeWidth;
2072                            } else {
2073                                // Banner fits - don't scale up
2074                                scale = Math.min(scale, 1.0);
2075                            }
2076
2077                            // Debug logging (remove in production)
2078                            console.log('Adform scaling:', {
2079                                iframeWidth: iframeWidth,
2080                                iframeHeight: iframeHeight,
2081                                containerWidth: containerWidth,
2082                                actualWrapperWidth: actualWrapperWidth,
2083                                designedWidth: designedWidth,
2084                                calculatedScale: actualWrapperWidth / iframeWidth,
2085                                finalScale: scale
2086                            });
2087
2088                            // Apply transform to iframe (keep original dimensions unchanged)
2089                            // Use setProperty with !important to prevent Adform from overwriting
2090                            iframe.style.setProperty('width', iframeWidth + 'px', 'important');
2091                            iframe.style.setProperty('height', iframeHeight + 'px', 'important');
2092                            iframe.style.setProperty('transform', 'scale(' + scale + ')', 'important');
2093                            iframe.style.setProperty('transform-origin', 'top left', 'important');
2094                            iframe.style.setProperty('display', 'block', 'important');
2095                            iframe.style.setProperty('margin', '0', 'important');
2096                            iframe.style.setProperty('padding', '0', 'important');
2097                            iframe.style.setProperty('border', 'none', 'important');
2098                            iframe.style.setProperty('box-sizing', 'border-box', 'important');
2099                            iframe.style.setProperty('max-width', 'none', 'important');
2100                            iframe.style.setProperty('max-height', 'none', 'important');
2101
2102                            // Set wrapper height to accommodate scaled iframe
2103                            wrapper.style.height = (iframeHeight * scale) + 'px';
2104
2105                            // Function to reapply scaling (used by observers and load event)
2106                            const reapplyScaling = function() {
2107                                // Get stored dimensions from data attributes
2108                                const storedWidth = parseInt(iframe.getAttribute('data-original-width')) || iframeWidth;
2109                                const storedHeight = parseInt(iframe.getAttribute('data-original-height')) || iframeHeight;
2110                                
2111                                // Recalculate container width
2112                                let currentContainerWidth = Math.min(window.innerWidth, document.documentElement.clientWidth);
2113                                if (parentContainer) {
2114                                    if (parentContainer.classList.contains('adform-monster-content') || 
2115                                        parentContainer.classList.contains('adform-monster-ad-wrapper')) {
2116                                        currentContainerWidth = Math.min(window.innerWidth, document.documentElement.clientWidth);
2117                                        // Don't set explicit width, let CSS handle it
2118                                        wrapper.style.width = '100%';
2119                                        wrapper.style.maxWidth = '100vw';
2120                                    } else {
2121                                        currentContainerWidth = parentContainer.offsetWidth || parentContainer.clientWidth || window.innerWidth;
2122                                    }
2123                                }
2124                                
2125                                // Force reflow
2126                                void wrapper.offsetWidth;
2127                                
2128                                // Get actual wrapper width
2129                                let currentWrapperWidth = currentContainerWidth;
2130                                if (parentContainer && (parentContainer.classList.contains('adform-monster-content') || 
2131                                    parentContainer.classList.contains('adform-monster-ad-wrapper'))) {
2132                                    // For monster banners, use measured width
2133                                    currentWrapperWidth = Math.min(wrapper.offsetWidth || currentContainerWidth, currentContainerWidth);
2134                                } else if (!parentContainer || (!parentContainer.classList.contains('adform-monster-content') && 
2135                                    !parentContainer.classList.contains('adform-monster-ad-wrapper'))) {
2136                                    currentWrapperWidth = wrapper.offsetWidth || wrapper.clientWidth || currentContainerWidth;
2137                                }
2138                                
2139                                // Recalculate scale using stored dimensions
2140                                let currentScale = currentWrapperWidth > 0 && storedWidth > 0 ? currentWrapperWidth / storedWidth : 1;
2141                                
2142                                // If banner is larger than viewport, always scale down
2143                                // If banner is smaller, keep original size (cap at 1.0)
2144                                if (storedWidth > currentWrapperWidth) {
2145                                    currentScale = currentWrapperWidth / storedWidth;
2146                                } else {
2147                                    currentScale = Math.min(currentScale, 1.0);
2148                                }
2149                                
2150                                // Reapply all styles with !important
2151                                iframe.style.setProperty('width', storedWidth + 'px', 'important');
2152                                iframe.style.setProperty('height', storedHeight + 'px', 'important');
2153                                iframe.style.setProperty('transform', 'scale(' + currentScale + ')', 'important');
2154                                iframe.style.setProperty('transform-origin', 'top left', 'important');
2155                                iframe.style.setProperty('max-width', 'none', 'important');
2156                                iframe.style.setProperty('max-height', 'none', 'important');
2157                                wrapper.style.height = (storedHeight * currentScale) + 'px';
2158                            };
2159
2160                            // Add load event listener
2161                            iframe.addEventListener('load', reapplyScaling, { once: true });
2162
2163                            // Watch for style changes on iframe (in case Adform overwrites)
2164                            const iframeStyleObserver = new MutationObserver(function(mutations) {
2165                                let needsReapply = false;
2166                                mutations.forEach(function(mutation) {
2167                                    if (mutation.type === 'attributes' && mutation.attributeName === 'style') {
2168                                        // Check if transform was removed or changed
2169                                        const currentTransform = window.getComputedStyle(iframe).transform;
2170                                        if (!currentTransform || currentTransform === 'none' || !currentTransform.includes('scale')) {
2171                                            needsReapply = true;
2172                                        }
2173                                    }
2174                                });
2175                                if (needsReapply) {
2176                                    setTimeout(reapplyScaling, 10);
2177                                }
2178                            });
2179
2180                            // Observe iframe for style attribute changes
2181                            iframeStyleObserver.observe(iframe, { 
2182                                attributes: true, 
2183                                attributeFilter: ['style'] 
2184                            });
2185                        });
2186                    }
2187
2188                    // Store original dimensions once - CRITICAL: Store once, use forever
2189                    let monsterOriginalDimensions = null; // { width: number, height: number }
2190                    let monsterAdElement = null;
2191                    
2192                    /**
2193                     * Detect ad element dimensions from multiple sources
2194                     * @param {HTMLElement} adElement - The ad element (usually an iframe)
2195                     * @returns {{width: number, height: number}}
2196                     */
2197                    function detectAdDimensions(adElement) {
2198                        let adWidth = 0;
2199                        let adHeight = 0;
2200                            
2201                        // For iframes, check attributes FIRST to get original dimensions, not scaled
2202                        if (adElement.tagName === 'IFRAME') {
2203                            // Method 1: Try width/height attributes (original dimensions)
2204                            adWidth = parseInt(adElement.width) || parseInt(adElement.getAttribute('width'));
2205                            adHeight = parseInt(adElement.height) || parseInt(adElement.getAttribute('height'));
2206                            
2207                            // Method 2: Try inline style attribute if attributes not set
2208                            if (!adWidth || !adHeight || adWidth <= 1 || adHeight <= 1) {
2209                                const inlineStyle = adElement.getAttribute('style') || '';
2210                                const widthMatch = inlineStyle.match(/width:\s*(\d+)px/);
2211                                const heightMatch = inlineStyle.match(/height:\s*(\d+)px/);
2212                                        
2213                                if (widthMatch && heightMatch) {
2214                                    adWidth = parseInt(widthMatch[1]);
2215                                    adHeight = parseInt(heightMatch[1]);
2216                                }
2217                            }
2218                            
2219                            // Method 3: Try computed style only if still not found
2220                            if (!adWidth || !adHeight || adWidth <= 1 || adHeight <= 1) {
2221                                const style = window.getComputedStyle(adElement);
2222                                const styleWidth = parseInt(style.width);
2223                                const styleHeight = parseInt(style.height);
2224                                            
2225                                if (styleWidth > 1 && styleHeight > 1) {
2226                                    adWidth = styleWidth;
2227                                    adHeight = styleHeight;
2228                                }
2229                            }
2230                            
2231                            // Method 4: Last resort - use offsetWidth (may be scaled)
2232                            if (!adWidth || !adHeight || adWidth <= 1 || adHeight <= 1) {
2233                                adWidth = adElement.offsetWidth || adElement.clientWidth || adElement.scrollWidth;
2234                                adHeight = adElement.offsetHeight || adElement.clientHeight || adElement.scrollHeight;
2235                            }
2236                        } else {
2237                            // For non-iframes, use rendered dimensions
2238                            adWidth = adElement.offsetWidth || adElement.clientWidth || adElement.scrollWidth;
2239                            adHeight = adElement.offsetHeight || adElement.clientHeight || adElement.scrollHeight;
2240                        }
2241                            
2242                        // Fallback to defaults ONLY if we have no other option
2243                        if (!adWidth || adWidth === 0 || isNaN(adWidth)) {
2244                            // Don't use fallback - return placeholder instead
2245                            return { width: 1, height: 1, isPlaceholder: true };
2246                        }
2247                            
2248                        // Validate dimensions
2249                        if (isNaN(adWidth) || isNaN(adHeight) || adWidth <= 0 || adHeight <= 0) {
2250                            return { width: 1, height: 1, isPlaceholder: true };
2251                        }
2252                            
2253                        return { width: adWidth, height: adHeight, isPlaceholder: false };
2254                    }
2255
2256                    // Function to find the ad element (iframe) within the container
2257                    function findAdElement(containerElement) {
2258                        if (!containerElement) return null;
2259                        
2260                        // Try multiple selectors
2261                        const selectors = [
2262                            'iframe[id^="adf_"]',
2263                            'iframe',
2264                            'div[id^="adf_"]',
2265                            '[data-adform-id]'
2266                        ];
2267                        
2268                        for (const selector of selectors) {
2269                            try {
2270                                const element = containerElement.querySelector(selector);
2271                                if (element) {
2272                                    // Check if element has reasonable dimensions
2273                                    const dims = detectAdDimensions(element);
2274                                    if (dims.width > 1 && dims.height >
2274 1 && !dims.isPlaceholder) {
2275                                        return element;
2276                                    }
2277                                }
2278                            } catch (e) {
2279                                console.warn('Adform: Invalid selector:', selector, e);
2280                            }
2281                        }
2282                        
2283                        // Also check direct children as fallback
2284                        try {
2285                            const directChildren = containerElement.children;
2286                            for (let i = 0; i < directChildren.length; i++) {
2287                                const child = directChildren[i];
2288                                if (child && (child.tagName === 'IFRAME' || child.tagName === 'DIV')) {
2289                                    const dims = detectAdDimensions(child);
2290                                    if (dims.width > 1 && dims.height > 1 && !dims.isPlaceholder) {
2291                                        return child;
2292                                    }
2293                                }
2294                            }
2295                        } catch (e) {
2296                            console.warn('Adform: Error checking direct children:', e);
2297                        }
2298                        
2299                        return null;
2300                    }
2301                    
2302                    /**
2303                     * Scale monster ad to fit screen without cropping
2304                     * @param {HTMLElement} containerElement - The container element
2305                     * @param {HTMLElement} adElement - The ad element
2306                     */
2307                    function scaleMonsterAd(containerElement, adElement) {
2308                        if (!containerElement || !adElement) {
2309                            return;
2310                        }
2311                            
2312                        adElement.style.setProperty('display', 'block', 'important');
2313                        adElement.style.setProperty('visibility', 'visible', 'important');
2314                        adElement.style.setProperty('opacity', '1', 'important');
2315                        adElement.style.setProperty('z-index', '10002', 'important');
2316                        adElement.style.setProperty('position', 'relative', 'important');
2317                            
2318                        const isMobile = window.innerWidth < 901;
2319                        const detectedDimensions = detectAdDimensions(adElement);
2320                            
2321                        if (!adElement.dataset.originalWidth || !adElement.dataset.originalHeight) {
2322                            const isPlaceholder = detectedDimensions.isPlaceholder || detectedDimensions.width <= 1 || detectedDimensions.height <= 1;
2323                            const isReasonable = detectedDimensions.width >= 300 && 
2324                                                 detectedDimensions.width <= 5000 && 
2325                                                 detectedDimensions.height >= 200 && 
2326                                                 detectedDimensions.height <= 5000;
2327                            
2328                            if (!isPlaceholder && isReasonable) {
2329                                adElement.dataset.originalWidth = detectedDimensions.width;
2330                                adElement.dataset.originalHeight = detectedDimensions.height;
2331                            } else {
2332                                const defaultWidth = isMobile ? 500 : 1300;
2333                                const defaultHeight = isMobile ? 700 : 600;
2334                                adElement.dataset.originalWidth = defaultWidth;
2335                                adElement.dataset.originalHeight = defaultHeight;
2336                            }
2337                        }
2338                            
2339                        const originalAdWidth = parseInt(adElement.dataset.originalWidth);
2340                        const originalAdHeight = parseInt(adElement.dataset.originalHeight);
2341                            
2342                        // First, ensure container is properly sized
2343                        if (containerElement) {
2344                            containerElement.style.setProperty('position', 'relative', 'important');
2345                            containerElement.style.setProperty('width', window.innerWidth + 'px', 'important');
2346                            containerElement.style.setProperty('max-width', window.innerWidth + 'px', 'important');
2347                            containerElement.style.setProperty('min-width', window.innerWidth + 'px', 'important');
2348                            containerElement.style.setProperty('height', '100%', 'important');
2349                            containerElement.style.setProperty('overflow', 'hidden', 'important');
2350                            containerElement.style.setProperty('margin', '0', 'important');
2351                            containerElement.style.setProperty('padding', '0', 'important');
2352                            containerElement.style.setProperty('left', '0', 'important');
2353                        }
2354                        
2355                        // Force a reflow to get accurate container dimensions
2356                        void containerElement.offsetWidth;
2357                        void containerElement.offsetHeight;
2358                        const containerRect = containerElement.getBoundingClientRect();
2359                        
2360                        // Get actual available dimensions from container - use exact container width
2361                        const screenWidth = window.innerWidth;
2362                        const screenHeight = window.innerHeight;
2363                        const topBarHeight = isMobile ? 56 : 60;
2364                        // Use screenWidth directly to ensure accurate scaling on narrow screens
2365                        const availableWidth = Math.floor(screenWidth);
2366                        const availableHeight = Math.floor(containerRect.height) || Math.floor(screenHeight - topBarHeight);
2367                            
2368                        // Simple scale to fit screen width - this worked before
2369                        let scale = availableWidth / originalAdWidth;
2370                        scale = Math.max(0.1, scale);
2371                        scale = Math.round(scale * 10000) / 10000;
2372                        
2373                        const scaledWidth = originalAdWidth * scale;
2374                        const scaledHeight = originalAdHeight * scale;
2375                            
2376                        console.log('Adform: Scaling calculation', {
2377                            originalWidth: originalAdWidth,
2378                            originalHeight: originalAdHeight,
2379                            screenWidth: screenWidth,
2380                            screenHeight: screenHeight,
2381                            containerWidth: containerRect.width,
2382                            containerHeight: containerRect.height,
2383                            availableWidth: availableWidth,
2384                            availableHeight: availableHeight,
2385                            finalScale: scale,
2386                            scaledWidth: scaledWidth,
2387                            scaledHeight: scaledHeight
2388                        });
2389                            
2390                        if (adElement.tagName === 'IFRAME') {
2391                            adElement.width = String(originalAdWidth);
2392                            adElement.height = String(originalAdHeight);
2393                            adElement.style.setProperty('width', originalAdWidth + 'px', 'important');
2394                            adElement.style.setProperty('height', originalAdHeight + 'px', 'important');
2395                            adElement.style.setProperty('border', 'none', 'important');
2396                            adElement.style.setProperty('margin', '0', 'important');
2397                            adElement.style.setProperty('padding', '0', 'important');
2398                        } else {
2399                            adElement.style.setProperty('width', originalAdWidth + 'px', 'important');
2400                            adElement.style.setProperty('height', originalAdHeight + 'px', 'important');
2401                        }
2402                            
2403                        const containerHeight = containerRect.height || containerElement.offsetHeight || containerElement.clientHeight || availableHeight;
2404                            
2405                        // Calculate vertical centering
2406                        let topPosition = 0;
2407                        if (scaledHeight <= containerHeight) {
2408                            topPosition = (containerHeight - scaledHeight) / 2;
2409                        }
2410                        topPosition = Math.max(0, topPosition);
2411                        
2412                        // Position at left edge - scale to fill width
2413                        let leftPosition = 0;
2414                        
2415                        let currentParent = adElement.parentElement;
2416                        while (currentParent && currentParent !== containerElement) {
2417                            currentParent.style.setProperty('position', 'relative', 'important');
2418                            currentParent.style.setProperty('width', '100%', 'important');
2419                            currentParent.style.setProperty('max-width', 'none', 'important');
2420                            currentParent.style.setProperty('min-width', '0', 'important');
2421                            currentParent.style.setProperty('overflow', 'hidden', 'important');
2422                            currentParent.style.setProperty('margin', '0', 'important');
2423                            currentParent.style.setProperty('padding', '0', 'important');
2424                            currentParent = currentParent.parentElement;
2425                        }
2426                        
2427                        adElement.style.setProperty('display', 'block', 'important');
2428                        adElement.style.setProperty('visibility', 'visible', 'important');
2429                        adElement.style.setProperty('opacity', '1', 'important');
2430                        adElement.style.setProperty('position', 'absolute', 'important');
2431                        adElement.style.setProperty('left', leftPosition + 'px', 'important');
2432                        adElement.style.setProperty('top', topPosition + 'px', 'important');
2433                        adElement.style.setProperty('margin', '0', 'important');
2434                        adElement.style.setProperty('padding', '0', 'important');
2435                        adElement.style.setProperty('width', originalAdWidth + 'px', 'important');
2436                        adElement.style.setProperty('height', originalAdHeight + 'px', 'important');
2437                        adElement.style.setProperty('max-width', 'none', 'important');
2438                        adElement.style.setProperty('max-height', 'none', 'important');
2439                        adElement.style.setProperty('min-width', '0', 'important');
2440                        adElement.style.setProperty('min-height', '0', 'important');
2441                        adElement.style.setProperty('transform', 'scale(' + scale + ')', 'important');
2442                        adElement.style.setProperty('transform-origin', 'top left', 'important');
2443                        adElement.style.setProperty('z-index', '10000', 'important');
2444                        adElement.style.setProperty('box-sizing', 'content-box', 'important');
2445                        
2446                        adElement.style.setProperty('pointer-events', 'auto', 'important');
2447                        adElement.style.setProperty('cursor', 'pointer', 'important');
2448                    }
2449                    
2450                    // Function to scale monster banner content
2451                    function scaleMonsterContent() {
2452                        if (!banner) {
2453                            return;
2454                        }
2455                        
2456                        if (banner.style.display === 'none' || banner.style.visibility === 'hidden') {
2457                            if (typeof showBanner === 'function') {
2458                                showBanner();
2459                            }
2460                        }
2461
2462                        const contentDiv = banner.querySelector('.adform-monster-content');
2463                        if (!contentDiv) {
2464                            return;
2465                        }
2466
2467                        // Use double requestAnimationFrame to ensure container is fully sized
2468                        requestAnimationFrame(function() {
2469                            requestAnimationFrame(function() {
2470                                const adElement = findAdElement(contentDiv);
2471                                
2472                                if (adElement) {
2473                                    monsterAdElement = adElement;
2474                                    adElement.style.setProperty('display', 'block', 'important');
2475                                    adElement.style.setProperty('visibility', 'visible', 'important');
2476                                    adElement.style.setProperty('opacity', '1', 'important');
2477                                    
2478                                    try {
2479                                        scaleMonsterAd(contentDiv, adElement);
2480                                    } catch (e) {
2481                                        console.error('Adform: Error in scaleMonsterAd:', e);
2482                                    }
2483                                }
2484                            });
2485                        });
2486                    }
2487
2488                    // Debounced scaling function
2489                    let lastScaleTime = 0;
2490                    const debouncedScale = function() {
2491                        const now = Date.now();
2492                        if (now - lastScaleTime < 100) {
2493                            clearTimeout(scaleTimeout);
2494                            scaleTimeout = setTimeout(function() {
2495                                if (banner && banner.style.display !== 'none') {
2496                                    requestAnimationFrame(scaleMonsterContent);
2497                                }
2498                                lastScaleTime = Date.now();
2499                            }, 150);
2500                        } else {
2501                            if (banner && banner.style.display !== 'none') {
2502                                requestAnimationFrame(scaleMonsterContent);
2503                            }
2504                            lastScaleTime = now;
2505                        }
2506                    };
2507
2508                    // Scale content when banner is shown
2509                    scaleObserver = new MutationObserver(function(mutations) {
2510                        let shouldScale = false;
2511                        mutations.forEach(function(mutation) {
2512                            if (mutation.type === 'attributes' && mutation.attributeName === 'style') {
2513                                const banner = document.getElementById('delfi-adx-2199612');
2514                                if (banner && banner.style.display !== 'none') {
2515                                    shouldScale = true;
2516                                }
2517                            }
2518                            // Watch for iframe additions or any node additions
2519                            if (mutation.type === 'childList' && mutation.addedNodes.length > 0) {
2520                                // Check if any added node is an iframe or contains an iframe
2521                                Array.from(mutation.addedNodes).forEach(function(node) {
2522                                    if (node.nodeType === 1) { // Element node
2523                                        if (node.tagName === 'IFRAME' || node.querySelector && node.querySelector('iframe')) {
2524                                            shouldScale = true;
2525                                }
2526                            }
2527                        });
2528                            }
2529                        });
2530                        
2531                        if (shouldScale) {
2532                            const banner = document.getElementById('delfi-adx-2199612');
2533                            if (banner && banner.style.display !== 'none') {
2534                                // Small delay to ensure iframe is fully in DOM
2535                                setTimeout(function() {
2536                                    debouncedScale();
2537                                }, 50);
2538                            }
2539                        }
2540                    });
2541
2542                    if (banner) {
2543                        scaleObserver.observe(banner, { 
2544                            attributes: true, 
2545                            attributeFilter: ['style'],
2546                            childList: true,
2547                            subtree: true
2548                        });
2549                    }
2550
2551                    function setupContainerResizeObserver() {
2552                        const contentDiv = banner ? banner.querySelector('.adform-monster-content') : null;
2553                        if (!contentDiv || containerResizeObserver) return;
2554                        
2555                        containerResizeObserver = new ResizeObserver(function(entries) {
2556                            for (let entry of entries) {
2557                                if (banner && banner.style.display !== 'none') {
2558                                    const adElement = findAdElement(contentDiv) || monsterAdElement;
2559                                    if (adElement) {
2560                                        scaleMonsterAd(contentDiv, adElement);
2561                                    } else {
2562                                        debouncedScale();
2563                                    }
2564                                }
2565                            }
2566                        });
2567                        
2568                        containerResizeObserver.observe(contentDiv);
2569                    }
2570                    
2571                    resizeHandler = function() {
2572                        clearTimeout(resizeTimeout);
2573                        resizeTimeout = setTimeout(function() {
2574                            if (banner && banner.style.display !== 'none') {
2575                                const contentDiv = banner.querySelector('.adform-monster-content');
2576                                if (contentDiv) {
2577                                    const adElement = findAdElement(contentDiv) || monsterAdElement;
2578                                    if (adElement) {
2579                                        scaleMonsterAd(contentDiv, adElement);
2580                                    } else {
2581                                        debouncedScale();
2582                                    }
2583                                }
2584                            }
2585                        }, 150);
2586                    };
2587
2588                    window.addEventListener('resize', resizeHandler, { passive: true });
2589                    
2590                    if (banner) {
2591                        const contentDiv = banner.querySelector('.adform-monster-content');
2592                        if (contentDiv) {
2593                            setTimeout(setupContainerResizeObserver, 500);
2594                        }
2595                    }
2596
2597                    // Scale after content loads
2598                    const scheduleContentScale = function() {
2599                        clearTimeout(contentLoadTimeout);
2600                        contentLoadTimeout = setTimeout(function() {
2601                            if (banner && banner.style.display !== 'none') {
2602                                requestAnimationFrame(function() {
2603                                    debouncedScale();
2604                                });
2605                            }
2606                        }, 100);
2607                    };
2608
2609                    // Initial scale attempts with increasing delays
2610                    [100, 500, 1000, 2000].forEach(function(delay) {
2611                        setTimeout(function() {
2612                            if (banner && banner.style.display !== 'none') {
2613                                scheduleContentScale();
2614                            }
2615                        }, delay);
2616                    });
2617                })();
2618            
2619
2620            if (!window.delfi_afp) {
2621                window.delfi_afp = { banners: [] };
2622            }
2623            if (!window.delfi_afp.push) {
2624                window.delfi_afp.push = function(options) {
2625                    if (!this.banners) {
2626                        this.banners = [];
2627                    }
2628                    this.banners.push(options);
2629                };
2630            }
2631        
2632            // Only show on desktop
2633            if (window.innerWidth >= 696) {
2634                window.delfi_afp.push({
2635                    dom: 'delfi-adx-2199623',
2636                    mid: parseInt('2199623', 10),
2637                    lazyload: false,
2638                    widthAtLeast: 696,
2639                });
2640            }
2641        
2642            let adformLoaded = false;
2643            let adformEmpty = false;
2644            let adsenseShown = false;
2645            let fallbackTimer = null;
2646
2647            // Function to show AdSense fallback
2648            const showAdSenseFallback = function() {
2649                if (!adformLoaded || adformEmpty) {
2650                    const adsenseContainer = document.getElementById('adform-floor-adsense');
2651                    const adformContainer = document.getElementById('delfi-adx-2199623');
2652
2653                    if (adsenseContainer && !adsenseShown) {
2654                        // Hide Adform container if it exists
2655                        if (adformContainer) {
2656                            adformContainer.style.display = 'none';
2657                        }
2658
2659                        // Show AdSense container
2660                        adsenseContainer.style.display = 'block';
2661                        adsenseShown = true;
2662
2663                        // Insert AdSense ad
2664                        (adsbygoogle = window.adsbygoogle || []).push({
2665                            google_ad_client: 'pub-1066444100463751',
2666                            google_ad_slot: '1188LV00_Pixel_visas_lapas',
2667                            google_ad_width: 970,
2668                            google_ad_height: 90
2669                        });
2670                    }
2671                }
2672            };
2673
2674            // Start fallback timer
2675            fallbackTimer = setTimeout(function() {
2676                if (!adformLoaded) {
2677                    showAdSenseFallback();
2678                }
2679            }, 3000);
2680
2681            // Handle Adform load
2682            window.adformtag = window.adformtag || [];
2683            window.adformtag.push(function() {
2684                window.adformtag.onLoaded(parseInt('2199623', 10), function(element) {
2685                    adformLoaded = true;
2686                    clearTimeout(fallbackTimer);
2687
2688                    const banner = document.getElementById('delfi-adx-2199623');
2689                    if (element.isEmpty) {
2690                        adformEmpty = true;
2691                        if (banner) {
2692                            banner.style.display = 'none';
2693                        }
2694                        showAdSenseFallback();
2695                    } else {
2696                        if (banner) {
2697                            banner.style.display = 'block';
2698                        }
2699                        // Hide AdSense if it was shown
2700                        const adsenseContainer = document.getElementById('adform-floor-adsense');
2701                        if (adsenseContainer) {
2702                            adsenseContainer.style.display = 'none';
2703                        }
2704                    }
2705                });
2706            });
2707
2708            // Additional fallback check - if DOM has content but onLoaded didn't fire
2709            let domChecks = 0;
2710            const checkDomContent = function() {
2711                const banner = document.getElementById('delfi-adx-2199623');
2712                if (banner) {
2713                    const hasContent = banner.children.length > 0 || banner.innerHTML.trim().length > 0;
2714                    if (hasContent && !adformLoaded) {
2715                        // Content found but onLoaded didn't fire
2716                        adformLoaded = true;
2717                        clearTimeout(fallbackTimer);
2718                        banner.style.display = 'block';
2719                    } else if (!hasContent && domChecks < 3 && !adformLoaded) {
2720                        // No content yet, check again
2721                        domChecks++;
2722                        setTimeout(checkDomContent, 3000);
2723                    } else if (!hasContent && domChecks >= 3 && !adformLoaded) {
2724                        // No content after multiple checks
2725                        showAdSenseFallback();
2726                    }
2727                }
2728            };
2729
2730            // Start DOM content check after a delay
2731            setTimeout(checkDomContent, 1000);
2732
2733            // Reusable function to scale iframes using CSS transform
2734            function scaleIframes(containerElement, designedWidth, designedHeight) {
2735                if (!containerElement) return;
2736
2737                const iframes = containerElement.querySelectorAll('iframe');
2738                        iframes.forEach(function(iframe) {
2739                    // Get iframe's original dimensions
2740                    // First check data attributes (persisted dimensions)
2741                    let iframeWidth = parseInt(iframe.getAttribute('data-original-width'));
2742                    let iframeHeight = parseInt(iframe.getAttribute('data-original-height'));
2743                    
2744                    // If not in data attributes, get from width/height attributes
2745                    if (!iframeWidth || !iframeHeight) {
2746                        iframeWidth = parseInt(iframe.getAttribute('width')) || iframeWidth;
2747                        iframeHeight = parseInt(iframe.getAttribute('height')) || iframeHeight;
2748                    }
2749                    
2750                    // If still not available, try to get from computed dimensions
2751                    if (!iframeWidth || !iframeHeight) {
2752                        iframeWidth = iframeWidth || iframe.offsetWidth || iframe.scrollWidth || designedWidth;
2753                        iframeHeight = iframeHeight || iframe.offsetHeight || iframe.scrollHeight || designedHeight;
2754                    }
2755
2756                    // Use designed dimensions as fallback
2757                    if (!iframeWidth) iframeWidth = designedWidth;
2758                    if (!iframeHeight) iframeHeight = designedHeight;
2759                    
2760                    // Store dimensions in data attributes so they persist
2761                    iframe.setAttribute('data-original-width', iframeWidth);
2762                    iframe.setAttribute('data-original-height', iframeHeight);
2763
2764                    // Get or create wrapper container
2765                    let wrapper = iframe.parentElement;
2766                    if (!wrapper || !wrapper.classList.contains('adform-iframe-wrapper')) {
2767                        wrapper = document.createElement('div');
2768                        wrapper.className = 'adform-iframe-wrapper';
2769                        iframe.parentNode.insertBefore(wrapper, iframe);
2770                        wrapper.appendChild(iframe);
2771                    }
2772
2773                    // Get container width (account for padding)
2774                    const content = containerElement.closest('.adform-floor-content') || containerElement;
2775                    const contentWidth = content.offsetWidth || content.clientWidth;
2776                    // Account for padding: 10px on each side = 20px total
2777                    const containerWidth = contentWidth > 0 ? contentWidth - 20 : window.innerWidth - 20;
2778
2779                    // Ensure wrapper has full width of its parent (use percentage)
2780                    wrapper.style.width = '100%';
2781                    wrapper.style.maxWidth = '100%';
2782                    wrapper.style.overflow = 'hidden';
2783                    wrapper.style.position = 'relative';
2784                    wrapper.style.boxSizing = 'border-box';
2785                    wrapper.style.margin = '0 auto';
2786                    wrapper.style.flexShrink = '0';
2787                    wrapper.style.flexGrow = '1';
2788                    wrapper.style.minWidth = '0';
2789
2790                    // Force a reflow to get accurate width
2791                    void wrapper.offsetWidth;
2792
2793                    // Get actual wrapper width after it's been sized
2794                    // Use the calculated container width (accounting for padding)
2795                    const actualWrapperWidth = containerWidth;
2796
2797                    // Calculate scale = containerWidth / designedWidth
2798                    const scale = actualWrapperWidth > 0 && iframeWidth > 0 ? Math.min(actualWrapperWidth / iframeWidth, 1) : 1;
2799
2800                    // Debug logging (remove in production)
2801                    console.log('Adform FloorAd scaling:', {
2802                        iframeWidth: iframeWidth,
2803                        iframeHeight: iframeHeight,
2804                        containerWidth: containerWidth,
2805                        actualWrapperWidth: actualWrapperWidth,
2806                        designedWidth: designedWidth,
2807                        scale: scale
2808                    });
2809
2810                    // Apply transform to iframe (keep original dimensions unchanged)
2811                    // Use setProperty with !important to prevent Adform from overwriting
2812                    iframe.style.setProperty('width', iframeWidth + 'px', 'important');
2813                    iframe.style.setProperty('height', iframeHeight + 'px', 'important');
2814                    iframe.style.setProperty('transform', 'scale(' + scale + ')', 'important');
2815                    iframe.style.setProperty('transform-origin', 'top left', 'important');
2816                    iframe.style.setProperty('display', 'block', 'important');
2817                    iframe.style.setProperty('margin', '0', 'important');
2818                    iframe.style.setProperty('padding', '0', 'important');
2819                    iframe.style.setProperty('border', 'none', 'important');
2820                    iframe.style.setProperty('box-sizing', 'border-box', 'important');
2821                    iframe.style.setProperty('max-width', 'none', 'important');
2822                    iframe.style.setProperty('max-height', 'none', 'important');
2823
2824                    // Set wrapper height to accommodate scaled iframe
2825                    wrapper.style.height = (iframeHeight * scale) + 'px';
2826
2827                    // Function to reapply scaling (used by observers and load event)
2828                    const reapplyScaling = function() {
2829                        // Get stored dimensions from data attributes
2830                        const storedWidth = parseInt(iframe.getAttribute('data-original-width')) || iframeWidth;
2831                        const storedHeight = parseInt(iframe.getAttribute('data-original-height')) || iframeHeight;
2832                        
2833                        const currentContentWidth = content.offsetWidth || content.clientWidth;
2834                        const currentContainerWidth = currentContentWidth > 0 ? currentContentWidth - 20 : window.innerWidth - 20;
2835                        
2836                        // Force reflow
2837                        void wrapper.offsetWidth;
2838                        
2839                        // Recalculate scale using stored dimensions
2840                        const currentScale = currentContainerWidth > 0 && storedWidth > 0 ? Math.min(currentContainerWidth / storedWidth, 1) : 1;
2841                        
2842                        // Reapply all styles with !important
2843                        iframe.style.setProperty('width', storedWidth + 'px', 'important');
2844                        iframe.style.setProperty('height', storedHeight + 'px', 'important');
2845                        iframe.style.setProperty('transform', 'scale(' + currentScale + ')', 'important');
2846                        iframe.style.setProperty('transform-origin', 'top left', 'important');
2847                        iframe.style.setProperty('max-width', 'none', 'important');
2848                        iframe.style.setProperty('max-height', 'none', 'important');
2849                        wrapper.style.height = (storedHeight * currentScale) + 'px';
2850                    };
2851
2852                    // Add load event listener
2853                    iframe.addEventListener('load', reapplyScaling, { once: true });
2854
2855                    // Watch for style changes on iframe (in case Adform overwrites)
2856                    const iframeStyleObserver = new MutationObserver(function(mutations) {
2857                        let needsReapply = false;
2858                        mutations.forEach(function(mutation) {
2859                            if (mutation.type === 'attributes' && mutation.attributeName === 'style') {
2860                                // Check if transform was removed or changed
2861                                const currentTransform = window.getComputedStyle(iframe).transform;
2862                                if (!currentTransform || currentTransform === 'none' || !currentTransform.includes('scale')) {
2863                                    needsReapply = true;
2864                                }
2865                            }
2866                        });
2867                        if (needsReapply) {
2868                            setTimeout(reapplyScaling, 10);
2869                        }
2870                    });
2871
2872                    // Observe iframe for style attribute changes
2873                    iframeStyleObserver.observe(iframe, { 
2874                        attributes: true, 
2875                        attributeFilter: ['style'] 
2876                    });
2877                });
2878            }
2879
2880            // Function to scale floor ad content
2881            function scaleFloorAdContent() {
2882                const banner = document.getElementById('delfi-adx-2199623');
2883                if (banner && banner.style.display !== 'none') {
2884                    const content = banner.querySelector('.adform-floor-content');
2885                    if (content) {
2886                        // Use requestAnimationFrame to ensure layout is complete
2887                        requestAnimationFrame(function() {
2888                            // Floor ad designed dimensions are 970x90px
2889                            scaleIframes(content, 970, 90);
2890                        });
2891                    }
2892                }
2893            }
2894
2895            // Debounced scaling function
2896            let lastScaleTime = 0;
2897            let scaleTimeout = null;
2898            const debouncedScale = function() {
2899                const now = Date.now();
2900                if (now - lastScaleTime < 100) {
2901                    clearTimeout(scaleTimeout);
2902                    scaleTimeout = setTimeout(function() {
2903                        requestAnimationFrame(scaleFloorAdContent);
2904                        lastScaleTime = Date.now();
2905                    }, 150);
2906                } else {
2907                    requestAnimationFrame(scaleFloorAdContent);
2908                    lastScaleTime = now;
2909                }
2910            };
2911
2912            // Run scaling function multiple times to catch content at different load times
2913            [100, 500, 1000, 2000].forEach(function(delay) {
2914                setTimeout(debouncedScale, delay);
2915            });
2916
2917            // Also run on window resize
2918            window.addEventListener('resize', debouncedScale, { passive: true });
2919
2920            // Run when banner is shown
2921            const observer = new MutationObserver(function(mutations) {
2922                let shouldScale = false;
2923                mutations.forEach(function(mutation) {
2924                    if (mutation.type === 'attributes' && mutation.attributeName === 'style') {
2925                        const banner = document.getElementById('delfi-adx-2199623');
2926                        if (banner && banner.style.display !== 'none') {
2927                            shouldScale = true;
2928                        }
2929                    }
2930                    // Watch for iframe additions or any node additions
2931                    if (mutation.type === 'childList' && mutation.addedNodes.length > 0) {
2932                        // Check if any added node is an iframe or contains an iframe
2933                        Array.from(mutation.addedNodes).forEach(function(node) {
2934                            if (node.nodeType === 1) { // Element node
2935                                if (node.tagName === 'IFRAME' || node.querySelector && node.querySelector('iframe')) {
2936                                    shouldScale = true;
2937                                }
2938                            }
2939                        });
2940                    }
2941                });
2942                
2943                if (shouldScale) {
2944                    const banner = document.getElementById('delfi-adx-2199623');
2945                    if (banner && banner.style.display !== 'none') {
2946                        // Small delay to ensure iframe is fully in DOM
2947                        setTimeout(function() {
2948                            debouncedScale();
2949                        }, 50);
2950                    }
2951                }
2952            });
2953
2954            const banner = document.getElementById('delfi-adx-2199623');
2955            if (banner) {
2956                observer.observe(banner, { 
2957                    attributes: true, 
2958                    attributeFilter: ['style'],
2959                    childList: true,
2960                    subtree: true
2961                });
2962            }
2963        </script>
vendor: 1 bytes, line 2963
2963
2964<script>jQuery(function ($) {
2965$('.weather-container').weatherChanger({"city_id":1,"slug":"riga","next":null});
2966$('#weather-map').weatherMap({"style":"https://api.maptiler.com/maps/c56f92eb-4966-47d8-adf1-7586e052f9f7/style.json?key=EEGdL8bsqm2rfbCssCn3","container":"weather-map","dataUrl":"https://www.1188.lv/v4/lv/weather/default/load-forecast-data?city_id=1","center":{"lat":56.95,"lng":24.1}});
2967});</script>
2967</body></html>

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.