/* CSS Reset & Basics */
* {
    box-sizing: border-box;
}

body {
    font-family: 'Calibri', sans-serif;
    margin: 0;
    padding: 0;
    background-color: #ffffff;
    line-height: 1.6;
}

@font-face {
    font-family: 'Calibri';
    src: url('/fonts/calibri.eot');
    /* IE9 Compat Modes */
    src: url('/fonts/calibri.eot?#iefix') format('embedded-opentype'),
        /* IE6-IE8 */
        url('/fonts/calibri.ttf') format('truetype'),
        /* Safari, Android, iOS */
        url('/fonts/calibri.svg#svgFontName') format('svg');
    /* Legacy iOS */
}

/* Layout Containers */
.main-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
    display: flex;
    flex-direction: column;
}

/* Palielināt satura platumu platos ekrānos */
@media (min-width: 1600px) {
    .main-container {
        max-width: 1600px;
        padding: 0 20px;
    }
}

.content-wrapper {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-top: 0;
}

.column-left,
.column-center,
.column-facebook,
.column-right {
    flex: 1;
    min-width: 280px;
}

.column-left {
    flex: 1.2;
}

.column-center {
    flex: 1.05;
    /* Slightly narrower center to give more room to the left */
    min-width: 0;
}

.column-facebook {
    flex: 0.9;
    min-width: 250px;
    max-width: 400px;
}

/* Ensure Facebook iframe doesn't overflow column */
.column-center iframe,
.column-facebook iframe {
    max-width: 100%;
    box-sizing: border-box;
}

.column-right {
    flex: 0.8;
    max-width: 200px;
    min-width: 180px;
}

.column-right img {
    max-width: 150px;
    height: auto;
}

/* Typography & Links */
.logs p {
    font-weight: normal;
    font-size: 16px;
    color: #000000;
    margin-bottom: 15px;
}

.logs a {
    font-weight: bold;
    color: #000064;
    letter-spacing: 1px;
    text-decoration: none;
}

.logs a:hover {
    color: red;
}

.logs h1 {
    margin: 0;
    padding: 8px 10px 2px 10px;
    font-weight: bold;
    font-size: 22px;
    letter-spacing: 1px;
    color: #ffffff;
    background-image: linear-gradient(to right, #194664, #AA2841, #FFC80F);
    margin-bottom: 10px;
    border-radius: 4px;
}

/* Mazāka atstarpe jaunumu sadaļai */
.column-center .block:first-child h1 {
    margin-bottom: -4px;
    padding-bottom: 2px;
}

.column-center .block:first-child .news-title {
    margin-top: -8px;
    margin-bottom: 14px;
}

/* Izlīdzināt h1 elementus visās kolonnās vienā līmenī */
.column-left h1:first-of-type,
.column-center h1:first-of-type,
.column-facebook h1:first-of-type,
.column-right h1:first-of-type {
    margin-top: 16px;
}

/* Samazināt padding-top uz h1 vidējā un labajā kolonnā */
.column-center h1:first-of-type,
.column-facebook h1:first-of-type,
.column-right h1:first-of-type {
    padding-top: 8px;
    padding-bottom: 2px;
}

.column-right h1 {
    padding-left: 8px;
    padding-right: 8px;
}

.logs h2 {
    font-weight: bold;
    font-size: 22px;
    color: #004040;
}

.logs h3 {
    margin: 0 0 12px 0;
}

.logs .news-title {
    text-align: center;
    margin: -4px 0 14px 0;
    font-weight: bold;
}

.logs .news-text {
    margin: 0 0 12px 0;
    font-size: 16px;
    color: #222222;
    line-height: 1.5;
}

.logs .news-links {
    margin: 0 0 18px 0;
    text-align: center;
}

.logs .news-image {
    text-align: center;
    margin: 6px 0 0 0;
}

.logs .news-image img {
    width: 100%;
    max-width: 480px;
    height: auto;
}

.logs .news-gallery {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.logs .news-gallery .news-image {
    margin: 0;
}

.logs .news-gallery .news-image img {
    max-width: 100%;
}

.logs .news-text-with-image {
    overflow: hidden;
}

.logs .news-image-inline {
    float: left;
    margin: 0 12px 6px 0;
    display: block;
    max-width: 200px;
}

.logs .news-image-inline img {
    max-width: 200px;
    width: 100%;
    height: auto;
    display: block;
}

/* Images */
img {
    max-width: 100%;
    height: auto;
}

/* Header & Navigation */
header {
    width: 100%;
}

.logo-container {
    text-align: left;
    padding: 0;
    margin: 0;
    overflow: hidden;
    /* Zilais fons labajā pusē, ja ekrāns ir platāks par bildi */
    background-color: #194664;
    position: relative;
}

.logo-container img {
    display: block;
    height: auto;
    /* Lielā versija - fiksēts platums, nogriešana no labās puses */
    width: 1200px;
    max-width: none;
}

/* Ja ekrāns ir šaurāks par bildi, bilde tiek nogriezta no labās puses */
/* Ja ekrāns ir platāks par bildi, labajā pusē ir zilais fons */

/* Navigation Menu */
.ddcolortabs {
    padding: 0;
    margin: 0;
    width: 100%;
    background: #194664;
    min-height: 34px;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
}

.ddcolortabs ul {
    font-size: 20px;
    font-family: 'Calibri', sans-serif;
    font-weight: 700;
    margin: 0;
    padding: 0;
    list-style: none;
    display: flex;
    flex-wrap: nowrap;
}

.ddcolortabs li {
    display: inline;
    padding: 0;
    text-transform: uppercase;
}

.ddcolortabs a {
    display: block;
    color: white;
    background: #194664;
    padding: 3px 14px;
    text-decoration: none;
    letter-spacing: 1.2px;
    transition: background-color 0.3s;
}

.ddcolortabs a:hover {
    background-color: #194664;
    color: #AA2841;
}

.ddcolortabs .selected a {
    background-color: #194664;
}

/* Hide submenu arrows on desktop */
.submenu-arrow {
    display: none;
}

/* Mobile Navigation Toggle */
.menu-toggle {
    display: none;
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    padding: 10px;
    order: -1;
}

/* Show hamburger menu when screen is too narrow for all items */
@media (max-width: 1200px) {
    .ddcolortabs {
        flex-wrap: nowrap;
        position: relative;
    }
    
    .menu-toggle {
        display: block;
        flex-shrink: 0;
        width: 100%;
        text-align: left;
        background-color: rgba(25, 70, 100, 0.2);
        border-top: 1px solid rgba(255, 255, 255, 0.2);
        border-bottom: 1px solid rgba(255, 255, 255, 0.2);
        color: #ffffff;
        font-weight: 700;
        padding: 10px;
    }
    
    .menu-toggle.open {
        background-color: rgba(25, 70, 100, 0.4);
    }
    
    .ddcolortabs ul {
        display: none;
        flex-direction: column;
        width: 100%;
        background-color: #194664;
        margin: 0;
        position: absolute;
        top: 100%;
        left: 0;
        z-index: 1000;
        box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
    }
    
    .ddcolortabs ul.active {
        display: flex;
    }
    
    .ddcolortabs li {
        width: 100%;
        display: block;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }
    
    .ddcolortabs a {
        padding: 12px;
        font-weight: 700;
        width: 100%;
        box-sizing: border-box;
        font-size: 20px;
        font-family: 'Calibri', sans-serif;
    }
    
    /* Ensure dropdown menus work correctly in hamburger mode */
    .dropmenudiv_a {
        position: static !important;
        visibility: visible !important;
        width: 100% !important;
        display: none;
        border: none !important;
        border-top-width: 0 !important;
        background-color: rgba(10, 40, 60, 0.95) !important;
    }
    
    .dropmenudiv_a.submenu-active {
        display: block;
        border-top: 1px solid rgba(255, 255, 255, 0.1) !important;
    }
    
    .dropmenudiv_a a {
        padding: 10px 12px 10px 32px !important;
        color: #ffffff !important;
        background-color: transparent !important;
        border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
        font-size: 18px;
        font-weight: 400;
        text-transform: none;
        text-indent: 0 !important;
    }
    
    .dropmenudiv_a a:hover {
        background-color: rgba(170, 40, 65, 0.5) !important;
        color: #FFC80F !important;
    }
    
    .dropmenudiv_a a:last-child {
        border-bottom: none !important;
    }

    /* Prevent submenu links from wrapping */
    .dropmenudiv_a a {
        white-space: nowrap;
    }

    /* Show submenu arrows in hamburger mode */
    .ddcolortabs li .submenu-arrow {
        display: inline-block !important;
        position: absolute !important;
        right: 12px !important;
        top: 50% !important;
        transform: translateY(-50%) !important;
        font-size: 14px !important;
        line-height: 1 !important;
        width: auto !important;
        height: auto !important;
        border: none !important;
        transition: transform 0.2s ease;
    }
    
    .ddcolortabs li.submenu-open > a .submenu-arrow {
        transform: translateY(-50%) rotate(0deg);
    }

    .ddcolortabs li:has(.submenu-arrow) > a {
        position: relative !important;
        padding-right: 35px !important;
    }

    .ddcolortabs li.submenu-open > a {
        color: #FFC80F;
    }
}

/* Footer */
footer {
    text-align: center;
    padding: 20px;
    margin-top: 20px;
    border-top: 1px solid #000064;
}

/* Dropdown Menu (Legacy support, might need JS adjustment) */
.dropmenudiv_a {
    position: absolute;
    top: 0;
    border: 1px solid #000064;
    border-top-width: 8px;
    border-bottom-width: 0;
    font-size: 20px;
    line-height: 18px;
    z-index: 100;
    background-color: white !important;
    width: 230px;
    visibility: hidden;
}

.dropmenudiv_a a {
    width: auto;
    display: block;
    text-indent: 5px;
    border-top: 0 solid #678b3f;
    border-bottom: 1px solid #678b3f;
    padding: 2px 0;
    text-decoration: none;
    color: #000064 !important;
    background-color: transparent !important;
    text-transform: none !important;
    font-weight: normal !important;
    white-space: nowrap;
}

.dropmenudiv_a a:hover {
    background-color: #194664 !important;
    color: #FFC80F !important;
}

/* Map sizing */
.column-left .block:nth-child(4) table,
.column-left .block:nth-child(4) #map {
    width: 100% !important;
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
}

/* Ensure map table doesn't overflow in desktop version */
.block.map-block table {
    max-width: 100% !important;
    box-sizing: border-box !important;
    table-layout: fixed !important;
}

.block.map-block #map {
    max-width: 100% !important;
    box-sizing: border-box !important;
}

@media (min-width: 769px) {
    .column-left .block:nth-child(4) table,
    .column-left .block:nth-child(4) #map {
        min-width: 0;
        max-width: 100% !important;
    }
    
    /* Hide small Gaujas Ziema image on desktop */
    .column-left .block:nth-child(5) p:first-child {
        display: none;
    }
}

/* 4 kolonnu izkārtojums tikai ļoti platos ekrānos */
@media (min-width: 1800px) {
    /* Show Facebook column on very wide screens */
    .column-facebook {
        display: block;
    }
    
    /* Hide Facebook in center column on very wide screens */
    .facebook-in-center {
        display: none;
    }
}

/* 3 kolonnu izkārtojums vidējos un lielos ekrānos */
/* Vidējā izmēra ekrāniem - 2 kolonnas */
@media (min-width: 769px) and (max-width: 1199px) {
    /* Hide Facebook column on medium screens */
    .column-facebook {
        display: none;
    }
    
    /* Show Facebook in center column on medium screens */
    .facebook-in-center {
        display: block;
    }
    
    /* Content wrapper ar flex-wrap, lai column-right varētu būt apakšā */
    .content-wrapper {
        flex-wrap: wrap;
    }
    
    /* 2 kolonnu izkārtojums - column-left un column-center */
    .column-left {
        flex: 1;
        max-width: 50%;
        min-width: 0;
    }
    
    .column-center {
        flex: 1;
        max-width: 50%;
        min-width: 0;
    }

    .leader-page .column-center {
        flex: 1 1 100%;
        max-width: 100%;
    }
    
    /* column-right apakšā - pilns platums ar "Atbalstītāji" un "Partneri" */
    .column-right {
        flex: 1 1 100%;
        max-width: 100%;
        width: 100%;
        display: flex;
        flex-direction: row;
        flex-wrap: nowrap;
        justify-content: space-between;
        gap: 20px;
        margin-top: 20px;
    }
    
    .column-right .block {
        flex: 1;
        max-width: calc(50% - 10px);
        min-width: 0;
    }
    
    /* Samazināt logo izmēru 2 kolonnu skatā */
    .column-right img {
        max-width: 100px !important;
        width: auto !important;
        height: auto !important;
    }
}

/* Lielākiem ekrāniem - 3 kolonnas */
@media (min-width: 1200px) and (max-width: 1799px) {
    /* Hide Facebook column on large screens */
    .column-facebook {
        display: none;
    }
    
    /* Show Facebook in center column on large screens */
    .facebook-in-center {
        display: block;
    }
}

@media (max-width: 768px) {
    /* Mobilajā versijā - mazākā bilde (750px) */
    .logo-container img {
        width: 750px;
    }
    
    .main-container {
        padding: 0 12px;
    }

    .logs .news-gallery {
        grid-template-columns: 1fr;
    }

    .content-wrapper {
        display: flex;
        flex-direction: column;
        gap: 0px;
        margin-top: 0px;
    }

    .column-left,
    .column-center,
    .column-facebook,
    .column-right {
        display: contents;
    }

    .logs h1 {
        font-size: 24px;
        padding-top: 6px;
        padding-bottom: 6px;
    }

    .logs p,
    .logs .news-text {
        font-size: 18px;
    }
    
    /* Palielināt arī citus teksta elementus mobilajā versijā */
    body {
        font-size: 18px;
    }
    
    .logs h2 {
        font-size: 22px;
    }
    
    .ddcolortabs a {
        font-size: 22px;
    }

    .logs .block {
        width: 100%;
        flex: 1 1 100%;
        display: block;
        margin: 0;
        padding: 0;
    }
    
    /* h1 margin mobilajā versijā - vienāda atstarpe pēc visiem h1 */
    .logs h1 {
        margin-top: 0 !important;
        margin-bottom: 16px !important;
    }
    
    /* Paragraph margin mobilajā versijā - atstarpe starp rindām */
    .logs p {
        margin-top: 4px !important;
        margin-bottom: 12px !important;
    }
    
    /* Visu paragraph margin mobilajā versijā - atstarpe starp rindām */
    p {
        margin-top: 4px !important;
        margin-bottom: 12px !important;
    }

    /* Ensure map block is visible and doesn't overflow */
    .block.map-block {
        display: block !important;
        max-width: 100%;
        box-sizing: border-box;
    }
    
    /* Ensure map table doesn't overflow - override HTML width attribute */
    .block.map-block table {
        max-width: 100% !important;
        width: 100% !important;
        box-sizing: border-box !important;
        table-layout: fixed !important;
    }
    
    /* Ensure nested table in map header also doesn't overflow */
    .block.map-block table table {
        max-width: 100% !important;
        width: 100% !important;
        box-sizing: border-box !important;
        table-layout: fixed !important;
    }
    
    /* Ensure table cells don't cause overflow */
    .block.map-block table td {
        max-width: 100%;
        box-sizing: border-box;
        word-wrap: break-word;
        overflow-wrap: break-word;
    }

    /* Hide Gaujas Ziema image block on mobile */
    .column-left .block:nth-child(1) {
        display: none;
    }

    /* Map styling on mobile */
    .column-left .block.map-block #map {
        height: 320px !important;
        max-width: 100%;
        box-sizing: border-box;
    }

    /* Ensure map header links are white on mobile */
    .column-left .block.map-block table tr:first-child td a,
    .column-left .block.map-block table tr:first-child td table td a {
        color: #FFFFFF !important;
    }

    /* Mobile bloku secība */
    /* 1) Rezultāti */
    .column-left .block:nth-child(5) {
        order: 1;
    }
    
    /* 2) Nākamā kārta */
    .column-left .block:nth-child(3) {
        order: 2;
    }
    
    /* 3) Karte */
    .column-left .block:nth-child(4),
    .column-left .block.map-block {
        order: 3;
    }
    
    /* 4) Jaunumi */
    .column-center .block:nth-child(1) {
        order: 4;
        margin-top: 8px;
    }
    
    /* "Jaunumi" blokam mobilajā versijā - vienāda atstarpe kā citos blokos */
    .column-center .block:nth-child(1) h1 {
        margin-bottom: 0px !important;
        padding-top: 0 !important;
        padding-bottom: 0 !important;
    }
    
    /* Noņemt īpašos noteikumus news-title mobilajā versijā, lai būtu tāda pati atstarpe */
    .column-center .block:nth-child(1) .news-title {
        margin-top: 0 !important;
        margin-bottom: 0 !important;
    }
    
    .logs .news-title {
        margin-top: 0 !important;
        margin-bottom: 0 !important;
    }
    
    /* Noņemt margin no h3 un news-text mobilajā versijā, lai būtu tāda pati atstarpe */
    /* Tikai pirmajam h3 (pēc h1 "Jaunumi") - samazināt atstarpi */
    .logs h3:first-of-type {
        margin-top: 0 !important;
        margin-bottom: 0 !important;
        transform: translateY(-13px) !important;
    }
    
    /* Pārējiem h3 elementiem - normāla atstarpe */
    .logs h3:not(:first-of-type) {
        margin-top: 12px !important;
        margin-bottom: 0 !important;
        transform: none !important;
    }
    
    /* Atstarpe pirms otrā h3 - pielāgot .news-links margin */
    .logs .news-links {
        margin-bottom: 18px !important;
    }
    
    .logs .news-text {
        margin-top: 0 !important;
        margin-bottom: 0 !important;
    }
    
    /* Noņemt margin no news-links mobilajā versijā */
    .logs .news-links {
        margin-top: 0 !important;
        margin-bottom: 0 !important;
    }
    
    /* 5) Jaunumi vairāk */
    .column-center .block:nth-child(2) {
        order: 5;
    }
    
/* 6) Facebook - pēc "Jaunumi vairāk", bet pirms "Nolikums" */
    .column-facebook .block:nth-child(1) {
        order: 6;
    }
    
    /* 7) Nolikums */
    .column-left .block:nth-child(6) {
        order: 7;
        margin-top: 8px;
    }
    
    /* Paslēpt hr elementu pirms "Nolikums" bloka mobilajā versijā */
    .column-left .block:nth-child(6) hr {
        display: none !important;
    }
    
    /* "Nolikums" blokā - izmantot standarta h1 margin */
    .column-left .block:nth-child(6) h1 {
        margin-top: 0 !important;
        margin-bottom: 16px !important;
        padding-top: 0 !important;
        padding-bottom: 0 !important;
    }
    
    .column-left .block:nth-child(6) p {
        margin-top: 0 !important;
        margin-bottom: 0 !important;
    }
    
    /* 8) "Izvēlies atpūtu" */
    .column-left .block:nth-child(7) {
        order: 8;
    }
    
    /* Samazināt tukšumu "Izvēlies atpūtu" blokā */
    .column-left .block:nth-child(7) p {
        margin-top: 0 !important;
        margin-bottom: 0 !important;
    }
    
    .column-left .block:nth-child(7) p br {
        display: none;
    }
    
    /* Hide Facebook in center column on mobile - it's shown from column-facebook */
    .facebook-in-center {
        display: none !important;
    }
    
    /* Ensure Facebook iframe doesn't overflow */
    .column-center .block iframe,
    .column-facebook .block iframe {
        max-width: 100% !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }
    
    /* Prevent horizontal scroll on body */
    body {
        overflow-x: hidden;
    }
    
    /* Ensure main container doesn't overflow */
    .main-container {
        max-width: 100%;
        overflow-x: hidden;
    }

    /* Supporters (Right column) */
    .column-right .block {
        order: 9;
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        align-items: center;
        gap: 12px;
    }

    .column-right .block h1 {
        width: 100%;
        text-align: center;
    }
    
    /* Izlīdzināt un vienādot logotipus mobilajā versijā */
    .column-right .block p[align="center"] {
        margin: 0 !important;
        padding: 0 !important;
        display: flex;
        justify-content: center;
        align-items: center;
    }
    
    .column-right img {
        max-width: 80px !important;
        width: auto !important;
        height: auto !important;
        display: block;
        margin: 0 auto;
        object-fit: contain;
    }

    /* Mobile Menu - Additional optimizations for small screens */
    /* Note: Base hamburger menu styles are defined in @media (max-width: 1200px) above */

    /* Mobile Accordion Submenu - arrow positioning for all states */
    .ddcolortabs li .submenu-arrow {
        display: inline-block !important;
        position: absolute !important;
        right: 12px !important;
        top: 50% !important;
        transform: translateY(-50%) !important;
        font-size: 14px !important;
        line-height: 1 !important;
        width: auto !important;
        height: auto !important;
        border: none !important;
        transition: transform 0.2s ease;
    }
    
    .ddcolortabs li.submenu-open > a .submenu-arrow {
        transform: translateY(-50%) rotate(0deg);
    }

    .ddcolortabs li:has(.submenu-arrow) > a {
        position: relative !important;
        padding-right: 35px !important;
    }

    .ddcolortabs li.submenu-open > a {
        color: #FFC80F;
    }

    .dropmenudiv_a {
        position: static !important;
        visibility: visible !important;
        width: 100% !important;
        display: none;
        border: none !important;
        border-top-width: 0 !important;
        background-color: rgba(10, 40, 60, 0.95) !important;
    }

    .dropmenudiv_a.submenu-active {
        display: block;
        border-top: 1px solid rgba(255, 255, 255, 0.1) !important;
    }

    .dropmenudiv_a a {
        padding: 10px 12px 10px 32px !important;
        color: #ffffff !important;
        background-color: transparent !important;
        border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
        font-size: 18px;
        font-weight: 400;
        text-transform: none;
        text-indent: 0 !important;
        white-space: nowrap;
    }

    .dropmenudiv_a a:hover {
        background-color: rgba(170, 40, 65, 0.5) !important;
        color: #FFC80F !important;
    }

    .dropmenudiv_a a:last-child {
        border-bottom: none !important;
    }
}

@media (min-width: 769px) and (max-width: 1199px) {
    .telpu-page .column-center {
        max-width: 100%;
    }
}

/* Telpu orientēšanās nolikums - WordPress bloku līdzīgs noformējums */
.telpu-nolikums img {
    max-width: 100%;
    height: auto;
}

.telpu-nolikums .wp-block-table table {
    width: 100%;
    border-collapse: collapse;
}

.telpu-nolikums .wp-block-table {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.telpu-nolikums .wp-block-table table {
    min-width: 720px;
}

.telpu-nolikums .wp-block-table td,
.telpu-nolikums .wp-block-table th {
    border: 1px solid #c7cbd1;
    padding: 8px 10px;
    vertical-align: top;
}

.telpu-nolikums .wp-block-table.is-style-stripes table tr:nth-child(odd) {
    background: #f2f4f6;
}

.telpu-nolikums .wp-block-media-text {
    display: flex;
    gap: 16px;
    align-items: center;
    flex-wrap: wrap;
}

.telpu-nolikums .wp-block-media-text__media img {
    max-width: 160px;
    width: 100%;
}

.telpu-nolikums .wp-block-image.size-large img {
    max-width: 720px;
    width: 100%;
    display: block;
    margin: 0 auto;
}


.telpu-nolikums .wp-block-gallery {
    display: flex;
    flex-wrap: wrap;
    gap: 12px 18px;
    align-items: center;
}

.telpu-nolikums .wp-block-gallery img {
    max-width: 180px;
    height: auto;
}

@media (max-width: 768px) {
    .telpu-nolikums .wp-block-media-text {
        flex-direction: column;
        align-items: flex-start;
    }

    .telpu-nolikums .wp-block-gallery img {
        max-width: 140px;
    }
}
