/* --- focalx-blog-hub --- */
/**
 * FocalX Blog Hub Styles
 * Colors: Text #2d2f31, Buttons #163b6b, Background #f6f5f8
 */

/* Container */
.focalx-blog-hub {
    --focalx-text: #2d2f31;
    --focalx-primary: #163b6b;
    --focalx-bg: #f6f5f8;
    --focalx-white: #ffffff;
    --focalx-border: #e1e1e1;
    --focalx-text-light: #666666;
    
    font-family: var(--fx-font-body);
    color: var(--focalx-text);
    max-width: var(--fx-max-content, 1140px);
    margin: 0 auto;
    padding: 24px 0;
    position: relative;
}

/* =====================
   HERO SECTION
   ===================== */
.focalx-hero {
    position: relative;
    width: 100%;
    min-height: 420px;
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
    border-radius: 24px;
    overflow: hidden;
    margin-bottom: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.focalx-hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(22, 59, 107, 0.85) 0%, rgba(45, 47, 49, 0.75) 100%);
    z-index: 1;
}

/* Samme mønster som hero-posts.php / css/hero-posts.css */
.focalx-hero__breadcrumb {
    position: absolute;
    top: 18px;
    left: 24px;
    z-index: 3;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    line-height: 1.4;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.86);
    text-shadow: 0 2px 6px rgba(0, 0, 0, 0.28);
}

.focalx-hero__breadcrumb a {
    color: #fff;
    text-decoration: none;
}

.focalx-hero__breadcrumb a:hover,
.focalx-hero__breadcrumb a:focus-visible {
    color: #fff;
    text-decoration: underline;
}

.focalx-hero__breadcrumb-current,
.focalx-hero__breadcrumb-sep {
    color: rgba(255, 255, 255, 0.72);
}

.focalx-hero-content {
    position: relative;
    z-index: 2;
    text-align: center;
    max-width: 600px;
    padding: 0 24px;
}

.focalx-hero-title {
    color: #fff !important;
    text-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.focalx-search-wrapper {
    position: relative;
    margin-top: 24px;
    max-width: 300px;
    margin-left: auto;
    margin-right: auto;
}

.focalx-search-icon {
    position: absolute;
    right: 16px;
    left: auto;
    top: 50%;
    transform: translateY(-50%);
    color: #666666;
    stroke: #666666;
    pointer-events: none;
    z-index: 1;
    width: 18px;
    height: 18px;
}

.focalx-search-input {
    width: 100%;
    padding: 12px 46px 12px 20px;
    border: none;
    border-radius: 50px !important;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    font-family: 'Ubuntu', sans-serif;
    font-size: 16px !important;
    color: var(--focalx-text);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    transition: all 0.2s ease;
}

.focalx-search-input::placeholder {
    color: var(--focalx-text-light);
}

.focalx-search-input:focus,
.focalx-search-input:focus-visible {
    outline: none !important;
    border: 1px solid #2d2f31 !important;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.2);
}

/* =====================
   TABS NAVIGATION
   ===================== */
.focalx-tabs-nav {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-start;
    gap: 12px;
    margin-bottom: 36px;
    position: relative;
    z-index: 8;
}

.focalx-tab {
    padding: 10px 20px;
    border: 1px solid var(--focalx-border);
    background: transparent;
    color: var(--focalx-text) !important;
    font-size: 14px;
    font-weight: 500;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.focalx-tab:hover {
    background: var(--focalx-bg);
    color: var(--focalx-text) !important;
    border-color: var(--focalx-text);
}

.focalx-tab.active {
    background: var(--focalx-primary);
    color: var(--focalx-white) !important;
    border-color: var(--focalx-primary);
}

/* Dropdown Tab */
.focalx-tab-dropdown {
    position: relative;
}

.focalx-tab-has-dropdown {
    display: flex;
    align-items: center;
    gap: 8px;
}

.focalx-dropdown-arrow {
    transition: transform 0.2s ease;
}

.focalx-tab-dropdown:hover .focalx-dropdown-arrow,
.focalx-tab-dropdown.open .focalx-dropdown-arrow {
    transform: rotate(180deg);
}

.focalx-dropdown-menu {
    position: absolute;
    top: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    background: var(--focalx-white);
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
    padding: 12px;
    min-width: 260px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
    z-index: 8;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

/* Bridge element to prevent dropdown from closing when moving mouse to it */
.focalx-dropdown-menu::before {
    content: '';
    position: absolute;
    top: -12px;
    left: 0;
    right: 0;
    height: 12px;
}

.focalx-tab-dropdown:hover .focalx-dropdown-menu,
.focalx-tab-dropdown.open .focalx-dropdown-menu {
    opacity: 1;
    visibility: visible;
}

.focalx-dropdown-item {
    display: block;
    width: 100%;
    padding: 12px 16px;
    border: none;
    background: transparent;
    color: var(--focalx-text) !important;
    font-size: 14px;
    font-weight: 500;
    text-align: left;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.15s ease;
    box-shadow: none !important;
}

.focalx-dropdown-item:hover {
    background: var(--focalx-bg);
    color: var(--focalx-text) !important;
    box-shadow: none !important;
}

.focalx-dropdown-item.active {
    background: var(--focalx-primary);
    color: var(--focalx-white) !important;
    box-shadow: none !important;
}

/* =====================
   POSTS GRID
   ===================== */
.focalx-posts-container {
    position: relative;
    z-index: 0;
    padding: 0;
}

.focalx-posts-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

/* =====================
   POST CARD
   ===================== */
.focalx-post-card {
    background: var(--focalx-white);
    border-radius: 16px;
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.focalx-post-card img {
    display: block;
}



.focalx-post-card:hover {
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.1);
}

.focalx-post-link {
    display: block;
    text-decoration: none;
    color: inherit;
}

.focalx-post-thumbnail {
    position: relative;
    width: 100%;
    padding-top: 60%;
    overflow: hidden;
    background: #ffffff !important;
    line-height: 0;
    font-size: 0;
}

.focalx-post-thumbnail img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    min-height: calc(100% + 1px);
    object-fit: cover !important;
    object-position: center center;
    display: block !important;
    margin-bottom: -1px;
    transition: transform 0.3s ease;
}

.focalx-post-card:hover .focalx-post-thumbnail img {
    transform: scale(1.03);
}

.focalx-category-tag {
    position: absolute;
    top: 16px;
    left: 16px;
    z-index: 1;
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: var(--focalx-text);
    padding: 6px 12px;
    border-radius: 50px;
    font-family: 'Ubuntu', sans-serif;
	line-height: 1.4em;
    font-size: 12px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.focalx-post-content {
    padding: 18px;
    font-size: 18px;
}

.focalx-post-meta {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 12px;
    font-size: 14px;
    color: var(--focalx-text-light);
}

.focalx-read-time {
    color: var(--focalx-primary);
    font-weight: 600;
}

.focalx-post-title {
    margin: 0 0 12px 0;
    font-size: 20px !important;
    color: var(--focalx-text);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    transition: color 0.2s ease;
}

.focalx-post-link:hover .focalx-post-title,
.focalx-post-link:focus-visible .focalx-post-title {
    color: var(--focalx-primary);
}

.focalx-post-excerpt {
    margin: 0 0 16px 0;
    font-size: 16px;
    line-height: 1.6;
    color: var(--focalx-text-light);
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.focalx-post-author {
    font-size: 14px;
    color: var(--focalx-text-light);
    font-weight: 500;
}

/* =====================
   LOAD MORE & LOADING
   ===================== */
.focalx-load-more-wrapper {
    display: flex;
    justify-content: center;
    margin-top: 48px;
}

.focalx-load-more {
    padding: 16px 48px;
    background: var(--focalx-primary);
    color: var(--focalx-white);
    border-radius: 50px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: 'Ubuntu', sans-serif;
}

.focalx-load-more:hover {
    background: #0f2a4d;
}

.focalx-load-more:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.focalx-loading {
    display: flex;
    justify-content: center;
    padding: 24px;
}

.focalx-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--focalx-border);
    border-top-color: var(--focalx-primary);
    border-radius: 50%;
    animation: focalx-spin 0.8s linear infinite;
}

@keyframes focalx-spin {
    to {
        transform: rotate(360deg);
    }
}

/* No Posts */
.focalx-no-posts {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    color: var(--focalx-text-light);
    font-size: 16px;
}

/* =====================
   RESPONSIVE
   ===================== */
@media (max-width: 1024px) {
    .focalx-posts-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 24px;
    }
}

@media (max-width: 768px) {
    .focalx-hero {
        min-height: 280px;
        border-radius: 0;
        width: 100%;
    }

    .focalx-hero__breadcrumb {
        top: 14px;
        left: 16px;
        right: 16px;
        font-size: 13px;
        flex-wrap: wrap;
    }
    
    .focalx-hero-content {
        padding: 24px 16px;
    }
    
    .focalx-search-wrapper {
        margin-top: 20px;
        max-width: 100%;
    }
    
    .focalx-search-input {
        padding: 12px 42px 12px 16px;
        font-size: 16px !important;
    }
    
    .focalx-search-icon {
        right: 14px;
        left: auto;
    }
    
    
    .focalx-blog-hub {
        padding: 0;
        overflow-x: hidden;
    }
    
    .focalx-tabs-nav {
        padding: 0 24px;
        width: 100%;
        overflow-x: auto;
        overflow-y: visible;
        flex-wrap: nowrap;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        -ms-overflow-style: none;
    }
    
    .focalx-tabs-nav::-webkit-scrollbar {
        display: none;
    }
    
    /* Hide original dropdown on mobile - we use JS to append to body */
    .focalx-tab-dropdown .focalx-dropdown-menu {
        display: none !important;
    }
    
    .focalx-tabs-wrapper {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        -ms-overflow-style: none;
        padding: 0;
        gap: 8px;
        border-radius: 0;
        flex-wrap: nowrap;
        justify-content: flex-start;
        background: transparent;
        box-shadow: none;
    }
    
    .focalx-tabs-wrapper::-webkit-scrollbar {
        display: none;
    }
    
    .focalx-tab {
        padding: 10px 18px;
        font-size: 14px;
        background: var(--focalx-white);
        flex-shrink: 0;
    }
    
    .focalx-posts-container {
        padding: 0 24px 24px 24px;
    }
    
    .focalx-dropdown-menu {
        position: absolute;
        top: calc(100% + 8px);
        bottom: auto;
        left: 0;
        right: auto;
        transform: none;
        border-radius: 12px;
        max-height: none;
        overflow-y: visible;
        z-index: 9999;
        min-width: 220px;
        padding: 16px;
    }
    
    .focalx-posts-grid {
        grid-template-columns: 1fr;
        gap: 24px;
    }
    
    .focalx-post-content {
        padding: 18px;
    }
    
    .focalx-post-title {
        font-size: 18px !important;
    }
    
    .focalx-post-excerpt {
        font-size: 14px;
    }
}

/* Tablet (768–1024px, inkl. iPad / iPad mini): 24px gutter på hele hubben —
 * undgår flush mod viewport; nulstiller posts-container side-padding her så
 * det ikke bliver dobbelt ved 768px (mobil-regel + hub-padding). */
@media (min-width: 768px) and (max-width: 1024px) {
    .focalx-blog-hub {
        padding-left:  24px;
        padding-right: 24px;
        box-sizing:    border-box;
    }

    .focalx-posts-container {
        padding-left:  0;
        padding-right: 0;
    }

    /* Ved 768px giver mobil-blokken tabs 24px side-padding — hub har allerede 24px. */
    .focalx-tabs-nav {
        padding-left:  0;
        padding-right: 0;
    }
}

@media (max-width: 480px) {
    .focalx-post-thumbnail {
        padding-top: 56.25%;
    }
    
    .focalx-load-more {
        width: 100%;
        padding: 14px 24px;
    }
}

/* Disable scroll when mobile dropdown is open */
body.focalx-no-scroll {
    overflow: hidden !important;
    position: fixed;
    width: 100%;
}

/* Mobile dropdown (appended to body via JS) */
.focalx-mobile-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 9998;
}

.focalx-mobile-dropdown {
    position: fixed !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    min-width: 280px;
    max-width: calc(100vw - 48px);
    background: #ffffff;
    border-radius: 12px;
    padding: 12px;
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.25);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 6px;
    opacity: 1 !important;
    visibility: visible !important;
}


/* --- focalx-social-icons --- */
.fx-social-icons-nav {
	display: block;
}

.fx-social-icons {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 12px;
	list-style: none;
	margin: 0;
	padding: 0;
	box-sizing: border-box;
}

.fx-social-icons__item {
	margin: 0;
	padding: 0;
}

.fx-social-icons__link {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	min-width: 40px;
	min-height: 40px;
	border-radius: 50%;
	text-decoration: none;
	color: #2b2b2b;
	background: #ffffff;
	transition:
		transform 0.2s ease,
		box-shadow 0.2s ease,
		color 0.2s ease;
	box-sizing: border-box;
}

.fx-social-icons__link:hover {
	color: #163b6b;
	opacity: 0.8;
}

.fx-social-icons__link:focus {
	outline: none;
}

.fx-social-icons__link:focus-visible {
	box-shadow:
		0 0 0 2px #ffffff,
		0 0 0 4px #163b6b;
	color: #163b6b;
}

.fx-social-icons__circle {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	height: 100%;
	line-height: 0;
	border-radius: inherit;
}

.fx-social-icons__glyph {
	display: block;
	width: 22px;
	height: 22px;
	flex-shrink: 0;
}

@media (prefers-reduced-motion: reduce) {
	.fx-social-icons__link {
		transition: none;
	}

	.fx-social-icons__link:hover {
		transform: none;
	}
}
