/*
Theme Name:         U-label Theme
Theme URI:          https://u-label.com/
Author:             Nestor J 
Description:        A theme built especially for the U-label marketing effort.
Version:            1.0.1
Text Domain:        u-label.com
*/

/* 1. Google Fonts Dynamic API Request (deactivated since theme.json is pulling it) */
/* @import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Sans:wght@300;400;500;700&display=swap');

/* ==========================================
   BASE DOCUMENT DEFINITIONS & UTILITIES
   ========================================== */
body {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-font-smoothing: antialiased;
    font-family: 'IBM Plex Sans', -apple-system, sans-serif;
    background-color: #ffffff;
    color: #222222;
}

@media (prefers-reduced-motion: no-preference) {
	html {
		scroll-behavior: smooth;
	}
}

/* keep anchored sections clear of the 80px header */
[id] {
	scroll-margin-top: calc(var(--header-height) + 16px);
}

/* Custom CSS Theme Variables */
:root {
    --header-height: 80px;
    --font-primary: 'IBM Plex Sans', -apple-system, sans-serif;
    
    /* Configurable Button Colors 
    --btn-primary-bg: #1F42A5;
    --btn-primary-text: #ffffff;
    --btn-primary-border: #1F42A5;
    
    --btn-secondary-bg: transparent;
    --btn-secondary-text: #1F42A5;
    --btn-secondary-border: #1F42A5;

    */
    --btn-primary-bg: var(--wp--preset--color--st-blue); 
    --btn-primary-text: var(--wp--preset--color--white);
    --btn-primary-border: var(--wp--preset--color--st-blue);
    
    --btn-secondary-bg: var(--wp--preset--color--transparent);
    --btn-secondary-text: var(--wp--preset--color--st-blue);
    --btn-secondary-border: var(--wp--preset--color--st-blue);
}

/* Base Flex Layout Configuration used by Theme Blocks
.is-layout-flex {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
    gap: 24px;
}
     */

.u-label-flex-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
    gap: 24px;
}

/* ==========================================
   HEADER GLOBAL STRUCTURAL NAVIGATION
   ========================================== */
.site-header-global {
    width: 100%;
    height: var(--header-height);
    background-color: #ffffff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05); /* Slight shadow border-bottom */
    display: flex;
    align-items: center;
    position: relative;
    z-index: 9999;
    box-sizing: border-box;
}

.header-container {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 100%;
}

.header-right-side {
    display: flex;
    align-items: center;
    gap: 32px;
    height: 100%;
}

/* Main Navigation Options */
.main-navigation {
    font-family: var(--font-primary);
}

/* Consolidated Main Menu Structure */
.main-navigation .nav-menu,
.custom-flex-menu {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    align-items: center;
    gap: 32px; /* Retains your original larger layout spacing choice */
}

.main-navigation .nav-menu li,
.custom-flex-menu li {
    position: relative;
}

.main-navigation .nav-menu a,
.custom-flex-menu li a {
    color: #222222;
    text-decoration: none;
    font-weight: 600; /* Main links preserve your heavy weight styling choice */
    font-size: 15px;  /* Main links preserve your targeted sizing */
    padding: 8px 0;
    display: block;
    transition: color 0.2s ease;
}

.main-navigation .nav-menu a:hover,
.custom-flex-menu li a:hover {
    color: #1F42A5;
}

/* Header Dropdown Sub-menus (One Level Down) */
.main-navigation .nav-menu li ul,
.custom-flex-menu li ul {
    position: absolute;
    top: 100%;
    left: 0;
    background: #ffffff;
    box-shadow: 0 8px 24px rgba(0,0,0,0.1);
    list-style: none;
    padding: 12px 0;
    margin: 0;
    min-width: 180px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.25s ease;
    border-radius: 6px;
}

.main-navigation .nav-menu li:hover > ul,
.custom-flex-menu li:hover > ul {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.main-navigation .nav-menu li ul li a,
.custom-flex-menu li ul li a {
    padding: 8px 20px;
    font-size: 14px;
    font-weight: 400;
}

/* Language Selection Trigger Widget */
.lang-selector-dropdown {
    position: relative;
    display: inline-block;
}

.lang-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    background: #ffffff;
    border: 1px solid #E2E8F0;
    border-radius: 8px; /* Rounded rectangle border */
    padding: 6px 12px;
    cursor: pointer;
    transition: border-color 0.2s ease;
    height: 40px;
}

.lang-btn:hover {
    border-color: #CBD5E1;
}

.lang-icon {
    width: 20px;
    height: 20px;
    display: inline-block;
    background: url('https://new.u-label.com/de/wp-content/themes/u-label0-1/assets/icons/globe.svg') no-repeat center / contain;
}

.arrow-down {
    width: 0; 
    height: 0; 
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 5px solid #64748B;
    display: inline-block;
    transition: transform 0.2s ease;
}

.lang-selector-dropdown:hover .arrow-down {
    transform: rotate(180deg);
}

/* WP Managed Dropdown Items styles */
.lang-dropdown-menu {
    position: absolute;
    right: 0;
    top: 100%;
    margin-top: 8px;
    background-color: #ffffff;
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
    border: 1px solid #E2E8F0;
    border-radius: 8px;
    padding: 8px 0;
    list-style: none;
    min-width: 140px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.2s ease;
}

.lang-selector-dropdown:hover .lang-dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.lang-dropdown-menu li, 
.lang-dropdown-menu .menu-item {
    display: block;
    width: 100%;
    margin: 0;
    padding: 0;
}

.lang-dropdown-menu li a,
.lang-dropdown-menu .menu-item a {
    display: block;
    padding: 8px 16px;
    text-decoration: none;
    color: #334155;
    font-family: var(--font-primary);
    font-weight: 400;
    font-size: 14px;
    transition: background-color 0.15s ease, color 0.15s ease;
    white-space: nowrap;
}

.lang-dropdown-menu li a:hover,
.lang-dropdown-menu .menu-item a:hover {
    background-color: #F8FAFC;
    color: var(--btn-primary-bg);
}

/* ==========================================
   HEADER RIGHT-SIDE COMPONENT INLINE FLOW
   ========================================== */

/* 1. Target the absolute outer container in both frontend and the block editor wrapper */
.site-header-global .header-right-side,
.editor-styles-wrapper div[class*="header-right-side"] {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: flex-end;
    gap: 32px;
    height: 100%;
}

/* 2. Target the inner auto-generated WordPress wrapper block inside the editor */
.editor-styles-wrapper div[class*="header-right-side"] > .wp-block-group-inner-container,
.editor-styles-wrapper div[class*="header-right-side"] > .is-layout-flex,
.editor-styles-wrapper div[class*="header-right-side"] > .block-editor-inner-blocks > .block-editor-block-list__layout {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: flex-end;
    gap: 32px;
    width: 100%;
}

/* 3. Keep the language widget stable as an inline element blocks */
.site-header-global .header-right-side .lang-selector-dropdown,
.editor-styles-wrapper .lang-selector-dropdown {
    display: inline-block;
    flex-shrink: 0;
    margin: 0;
}

/* 4. Target the core block buttons structural container wrapper */
.site-header-global .header-right-side .wp-block-buttons.custom-header-buttons,
.editor-styles-wrapper .wp-block-buttons.custom-header-buttons,
.editor-styles-wrapper .custom-header-buttons .block-editor-block-list__layout {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    gap: 12px;
    margin: 0;
    padding: 0;
}

/* 5. Force individual button list elements to override the 25px offset overlapping error */
.site-header-global .custom-header-buttons .wp-block-button,
.editor-styles-wrapper .custom-header-buttons .wp-block-button,
.editor-styles-wrapper .wp-block-button[data-type="core/button"] {
    display: inline-block;
    margin-top: 0;
    margin-bottom: 0;
    margin-left: 0;
    margin-right: 0;
    padding: 0;
}

/* 6. Enforce anchor typography styles loop formatting */
.site-header-global .custom-header-buttons .wp-block-button .wp-block-button__link,
.editor-styles-wrapper .custom-header-buttons .wp-block-button .wp-block-button__link {
    font-family: var(--font-primary);
    font-weight: 500;
    text-decoration: none;
    font-size: 14px;
    padding: 10px 20px;
    border-radius: 6px;
    display: inline-block;
    white-space: nowrap;
    transition: opacity 0.3s ease;
    box-sizing: border-box;
}

/* Button 1 (Secondary style configuration template: Log in) */
.site-header-global .custom-header-buttons .wp-block-button:nth-child(1) .wp-block-button__link {
    background-color: var(--btn-secondary-bg);
    color: var(--btn-secondary-text);
    border: 1px solid var(--btn-secondary-border);
}

/* Button 2 (Primary style configuration template: Create e-labels) */
.site-header-global .custom-header-buttons .wp-block-button:nth-child(2) .wp-block-button__link {
    background-color: var(--btn-primary-bg);
    color: var(--btn-primary-text);
    border: 1px solid var(--btn-primary-border);
}

/* Hover States Interaction mapping */
.site-header-global .custom-header-buttons .wp-block-button .wp-block-button__link:hover {
    opacity: 0.7;
}

.wp-site-blocks > header.wp-block-template-part {
    position: sticky;
    top: 0;
    z-index: 9999;
}

/* ==========================================
   GLOBAL FOOTER (dark, block-based)
   ========================================== */
footer {
    background: transparent;
    color: #e5e5e5;
    font-family: var(--font-primary);
    /* padding: 60px 0 30px;*/
}

footer .container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 24px;
}

/* Top region: brand column wider, then three menu columns */
.footer-grid {
    display: grid;
    grid-template-columns: 1.6fr 1fr 1fr 1fr;
    gap: 60px;
}

/* Brand column — site logo in a white rounded box */
.footer-logo-box {
    width: fit-content;
    display: inline-flex;
    align-items: center;
    background: #ffffff;
    border-radius: 5px;
    padding: 12px 18px;
    margin-bottom: 20px;
}
.footer-logo-box .wp-block-site-logo {
    margin: 0;
    line-height: 0;
}
.footer-logo-box .wp-block-site-logo img {
    display: block;
    max-height: 40px;
    width: auto;
}

.footer-brand p {
    color: #b9b9b9;
    font-size: 15px;
    line-height: 1.6;
    max-width: 360px;
    margin-bottom: 24px;
}

/* "Powered by" badge */
.footer-scantrust {
    display: inline-flex;
    flex-direction: column;
    align-items: flex-start;
}

.footer-scantrust-label {
    margin: 0;
    color: #555555;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.footer-scantrust .footer-scantrust-label {
    font-size: 10px;
}

.footer-scantrust-label::after {
	content: "";
	display: block;
	width: 100px;
	height: 16px;
	margin-top: 6px;
	background: url('https://new.u-label.com/de/wp-content/themes/u-label0-1/assets/icons/st-logo-blk.svg') no-repeat left center / contain;
}

/* Menu columns (Navigation blocks) */
.footer-col h4 {
    color: #ffffff;
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin: 0 0 20px 0;
}

.footer-col .wp-block-navigation__container {
    flex-direction: column;
    gap: 14px;
    align-items: flex-start;
}

.footer-col .wp-block-navigation-item a {
    color: #cfcfcf;
    font-size: 15px;
    text-decoration: none;
    transition: color 0.2s ease;
}

.footer-col .wp-block-navigation-item a:hover {
    color: #ffffff;
}

/* Bottom row */
.footer-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
    margin-top: 48px;
    padding-top: 24px;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    color: #9a9a9a;
    font-size: 14px;
}

.footer-copyright {
    margin: 0;
}

.wp-site-blocks > footer.wp-block-template-part {
    margin-top: 0;
}

/* Partnership label + logos (3 across, wrap to a new row past 3, kept small) */
.partners {
    width: fit-content;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    background: #ffffff;
    border-radius: 5px;
    padding: 10px 16px;
}

.partners-label {
    margin: 0;
    color:#222222;
    opacity: 0.6;
}

.partner-logos.wp-block-group {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    width: fit-content;
}
.partner-logos .wp-block-image {
    margin: 0;
    margin-inline: 0;
    flex: 0 0 auto;
}
.partner-logos .wp-block-image img {
    display: block;
    height: 22px;
    width: auto;
}

/* ==========================================
   MOBILE MEDIA BREAKDOWN INTERCEPTIONS
   ========================================== */
@media (max-width: 768px) {
    .site-header-global {
        height: auto;
    }
    .header-container {
        flex-direction: column; /* Mobile Top display stacking logic */
        justify-content: center;
        align-items: center;
        gap: 16px;
        padding: 16px;
    }
    .header-right-side {
        width: 100%;
        flex-direction: column;
        gap: 16px;
    }
    .custom-flex-menu,
    .main-navigation .nav-menu {
        flex-wrap: wrap;
        justify-content: center;
        gap: 16px;
    }
    .site-header-global .wp-block-group .custom-header-buttons {
        justify-content: center;
    }

    /* Footer stacks to a single column */
    .footer-grid {
        grid-template-columns: 1fr;
        gap: 32px;
    }
    .footer-bottom {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* ===== ulabel-articles : article index ===== */

/* Full-width section, 4 across, centered incl. partial rows */
.ulabel-articles-index { margin-bottom: 50px; }            /* 50px below the block section */

.ulabel-articles-index ul.ulabel-articles-cards {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 0;                  /* padding + dividers make the gutters */
	margin: 0;
	padding: 0;
	list-style: none;
}

/* Each tile */
.ulabel-articles-index ul.ulabel-articles-cards > li.wp-block-post {
	flex: 0 0 25%;
	max-width: 25%;
	box-sizing: border-box;
	padding: 1rem 1.5rem;                 /* neat, professional breathing room */
	border-right: 1px solid #d9d9d9;      /* light grey vertical divider only */
}

/* No divider on the outer right of a full row, or on the last tile
   (never on the outside / when nothing sits beside it) */
.ulabel-articles-index ul.ulabel-articles-cards > li.wp-block-post:nth-child(4n),
.ulabel-articles-index ul.ulabel-articles-cards > li.wp-block-post:last-child {
	border-right: 0;
}

/* ===== Responsive columns ===== */

/* Small desktop / tablet: drop to 2 across */
@media (max-width: 1024px) {
	.ulabel-articles-index ul.ulabel-articles-cards > li.wp-block-post {
		flex-basis: 50%;
		max-width: 50%;
	}
	/* divider only between the two columns, never on the right edge */
	.ulabel-articles-index ul.ulabel-articles-cards > li.wp-block-post:nth-child(2n) {
		border-right: 0;
	}
}

/* Mobile (matches the theme's hamburger breakpoint): single column, no dividers */
@media (max-width: 782px) {
	.ulabel-articles-index ul.ulabel-articles-cards > li.wp-block-post {
		flex-basis: 100%;
		max-width: 100%;
		border-right: 0;
		padding: 1.25rem 0;
	}
}

/* Category — between image and title */
.ulabel-article-card .wp-block-post-terms,
.ulabel-article-card .wp-block-post-terms a {
	font-size: 9px;
	color: rgb(227, 18, 11);
	text-decoration: none;
}
.ulabel-article-card .wp-block-post-terms { margin: 0.5rem 0 0.25rem; }

/* Title — 24px / #414141 (= rgb(65,65,65)) */
.ulabel-article-card .wp-block-post-title,
.ulabel-article-card .wp-block-post-title a {
	font-size: 24px;
	color: #414141;
	text-decoration: none;
	margin: 0;
}

/* Pagination */
.ulabel-articles-index .wp-block-query-pagination { margin-top: 2.5rem; }

/* ===== Split-flap reveal, staggered ===== */
@keyframes ulabel-flip-in {
	from { opacity: 0; transform: perspective(900px) rotateX(-92deg); }
	to   { opacity: 1; transform: perspective(900px) rotateX(0deg); }
}
.ulabel-articles-index ul.ulabel-articles-cards > li.wp-block-post {
	transform-origin: center;
	backface-visibility: hidden;
	animation: ulabel-flip-in 0.6s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}
.ulabel-articles-index ul.ulabel-articles-cards > li.wp-block-post:nth-child(1)  { animation-delay: 0.00s; }
.ulabel-articles-index ul.ulabel-articles-cards > li.wp-block-post:nth-child(2)  { animation-delay: 0.08s; }
.ulabel-articles-index ul.ulabel-articles-cards > li.wp-block-post:nth-child(3)  { animation-delay: 0.16s; }
.ulabel-articles-index ul.ulabel-articles-cards > li.wp-block-post:nth-child(4)  { animation-delay: 0.24s; }
.ulabel-articles-index ul.ulabel-articles-cards > li.wp-block-post:nth-child(5)  { animation-delay: 0.32s; }
.ulabel-articles-index ul.ulabel-articles-cards > li.wp-block-post:nth-child(6)  { animation-delay: 0.40s; }
.ulabel-articles-index ul.ulabel-articles-cards > li.wp-block-post:nth-child(7)  { animation-delay: 0.48s; }
.ulabel-articles-index ul.ulabel-articles-cards > li.wp-block-post:nth-child(8)  { animation-delay: 0.56s; }
.ulabel-articles-index ul.ulabel-articles-cards > li.wp-block-post:nth-child(9)  { animation-delay: 0.64s; }
.ulabel-articles-index ul.ulabel-articles-cards > li.wp-block-post:nth-child(10) { animation-delay: 0.72s; }
.ulabel-articles-index ul.ulabel-articles-cards > li.wp-block-post:nth-child(11) { animation-delay: 0.80s; }
.ulabel-articles-index ul.ulabel-articles-cards > li.wp-block-post:nth-child(12) { animation-delay: 0.88s; }

/* Accessibility: no flipping for reduced-motion users */
@media (prefers-reduced-motion: reduce) {
	.ulabel-articles-index ul.ulabel-articles-cards > li.wp-block-post { animation: none; }
}



/* ===== ulabel single article ===== */
.ulabel-single { padding: 2.5rem 1.25rem 4rem; }
.ulabel-single-subtitle:empty { display: none; }

/* Category — matches the index (9px / rgb(227,18,11)) */
.ulabel-single-category,
.ulabel-single-category a { font-size: 9px; color: rgb(227, 18, 11); text-decoration: none; }
.ulabel-single-category { margin-bottom: 0.75rem; }

/* H1 in black */
.ulabel-single-title { color: rgb(0, 0, 0); margin: 0 0 0.75rem; }

/* Optional subtitle — IBM Plex Sans Light, dark grey */
.ulabel-single-subtitle {
	font-family: var(--wp--preset--font-family--ibm-plex-sans);
	font-weight: 300;
	color: #555555;
	font-size: 1.25rem;
	line-height: 1.5;
	margin: 0 0 1.5rem;
}

/* Featured image */
.ulabel-single-featured { margin: 1.5rem 0 2rem; }
.ulabel-single-featured img { display: block; width: 100%; height: auto; }

/* Drop cap — first letter of the article body only */
.ulabel-article-body > p:first-of-type::first-letter {
	float: left;
	font-size: 4.4em;
	line-height: 0.78;
	font-weight: 600;
	padding: 0.02em 0.12em 0 0;
	color: #000;
}

/* Share button */
.ulabel-share { margin-top: 1.25rem; }
.ulabel-share-btn {
	display: inline-flex; align-items: center; gap: 0.5rem;
	background: #fff; color: #111;
	border: 1px solid #d9d9d9; border-radius: 0.4rem;
	padding: 0.5rem 0.9rem; font: inherit; font-size: 0.95rem;
	line-height: 1; cursor: pointer;
}
.ulabel-share-btn:hover { background: #f5f5f5; }
.ulabel-share-btn svg { width: 18px; height: 18px; }

/* Modal */
.ulabel-modal[hidden] { display: none; }
.ulabel-modal { position: fixed; inset: 0; z-index: 9999; display: flex; align-items: center; justify-content: center; padding: 1rem; }
.ulabel-modal-overlay { position: absolute; inset: 0; background: rgba(0,0,0,0.5); }
.ulabel-modal-box { position: relative; background: #fff; width: 100%; max-width: 340px; border-radius: 0.75rem; padding: 1.5rem 1.25rem 1.25rem; box-shadow: 0 20px 50px rgba(0,0,0,0.25); }
.ulabel-modal-close { position: absolute; top: 0.5rem; right: 0.6rem; background: none; border: 0; font-size: 1.6rem; line-height: 1; color: #666; cursor: pointer; }
.ulabel-modal-heading { font-family: var(--wp--preset--font-family--ibm-plex-sans); font-size: 1.05rem; font-weight: 600; margin: 0 0 1rem; color: #111; }

.ulabel-share-list { list-style: none; margin: 0; padding: 0; }
.ulabel-share-option {
	display: flex; align-items: center; gap: 0.75rem; width: 100%;
	padding: 0.6rem 0.5rem; background: none; border: 0;
	font: inherit; font-size: 0.95rem; color: #222;
	text-align: left; text-decoration: none; border-radius: 0.5rem; cursor: pointer;
}
.ulabel-share-option:hover { background: #f3f4f6; }
.ulabel-badge {
	display: inline-flex; align-items: center; justify-content: center;
	width: 32px; height: 32px; border-radius: 50%;
	color: #fff; font-weight: 700; font-size: 0.85rem; flex: none;
}
.ulabel-badge svg { width: 16px; height: 16px; }
.ulabel-badge--copy { background: #6b7280; }
.ulabel-badge--facebook { background: #1877F2; }
.ulabel-badge--linkedin { background: #0A66C2; font-size: 0.7rem; }
.ulabel-badge--x { background: #000; }
.ulabel-badge--whatsapp { background: #25D366; }
