/*
 Theme Name:   Hello Elementor Child
 Theme URI:    https://elementor.com/hello-theme/
 Description:  Child theme for Hello Elementor. Adds sticky nav and site-specific customizations.
 Author:       SJD World
 Author URI:   https://sjdworld.com
 Template:     hello-elementor
 Version:      1.0.0
 License:      GNU General Public License v2 or later
 License URI:  http://www.gnu.org/licenses/gpl-2.0.html
 Text Domain:  hello-elementor-child
*/

/* ==========================================================================
   Elementor Gallery
   ========================================================================== */

.uniform-gallery .gallery-item img {
    aspect-ratio: 1 / 1;
    object-fit: cover;
    width: 100%;
    height: 100%;
}

/* ==========================================================================
   Archive layout (news, categories, etc.) with sidebar
   ========================================================================== */

/* Archive/single: full-width container for wrapper */
main:has(.ttt-archive-wrapper),
.site-main:has(.ttt-archive-wrapper),
.content-area:has(.ttt-archive-wrapper),
.elementor-location-single:has(.ttt-archive-wrapper) {
    width: 100% !important;
    max-width: none !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
    box-sizing: border-box;
}

.ttt-archive-wrapper {
    position: relative;
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
    width: 100%;
    max-width: 1800px;
    margin-left: auto;
    margin-right: auto;
    padding: 2rem 32px;
    box-sizing: border-box;
}

.ttt-archive-wrapper::before {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100vw;
    background-color: #f4f6fe;
    z-index: -1;
}

.ttt-archive-content {
    flex: 1 1 65%;
    min-width: 0;
}

.ttt-archive-sidebar {
    flex: 0 0 220px;
    min-width: 200px;
    margin-top: 3.5rem;
    position: sticky;
    top: 2rem;
    align-self: flex-start;
}

.ttt-archive-header {
    margin-bottom: 2rem;
}

.ttt-archive-title {
    font-family: 'Poppins', sans-serif;
    font-size: 2rem;
    font-weight: 700;
    margin: 0 0 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    color: #0008af;
}

.ttt-archive-description {
    color: #666;
    margin-top: 0.5rem;
}

.ttt-archive-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
}

.ttt-archive-card {
    margin: 0;
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    transition: box-shadow 0.25s ease, transform 0.25s ease;
}

.ttt-archive-card:hover {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    transform: translateY(-4px);
}

.ttt-archive-card-link {
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: inherit;
}

.ttt-archive-card-image {
    aspect-ratio: 16 / 10;
    overflow: hidden;
    background: #e8e8e8;
    flex-shrink: 0;
}

.ttt-archive-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.ttt-archive-card-image-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #888;
    font-size: 0.875rem;
}

.ttt-archive-card-body {
    padding: 1.25rem 1.25rem 1.5rem;
    flex: 1;
}

.ttt-archive-card .ttt-archive-card-title,
.ttt-archive-card h2.ttt-archive-card-title {
    font-size: 19px !important;
    font-weight: 700;
    margin: 0 0 0.5rem;
    line-height: 1.3;
    color: #0008af !important;
}

.ttt-archive-card-link:hover .ttt-archive-card-title {
    color: #0008af !important;
}

.ttt-archive-card-date {
    display: block;
    font-size: 0.8125rem;
    color: #6b7280;
    margin-bottom: 0.75rem;
}

.ttt-archive-card-excerpt {
    font-size: 0.9375rem;
    line-height: 1.5;
    color: #374151;
    margin-bottom: 0.75rem;
}

.ttt-archive-card-excerpt p {
    margin: 0 0 0.5rem;
}

.ttt-archive-card-excerpt p:last-child {
    margin-bottom: 0;
}

.ttt-archive-card-more {
    font-size: 0.9375rem;
    font-weight: 500;
    color: #3b82f6;
    text-decoration: none;
    transition: color 0.2s ease;
}

.ttt-archive-card-link:hover .ttt-archive-card-more {
    color: #fbbf24;
}

/* Single post */
.ttt-archive-wrapper .entry-header {
    margin-bottom: 0;
}

.ttt-archive-wrapper .entry-title {
    font-family: 'Poppins', sans-serif;
    font-size: 1.5rem;
    font-weight: 500;
    margin: 0 0 0.25rem;
    line-height: 1.25;
    color: #0008af;
}

.ttt-archive-wrapper .entry-date {
    font-family: 'Poppins', sans-serif;
    display: block;
    font-size: 0.9375rem;
    color: #6b7280;
    margin-top: 0;
    margin-bottom: 2rem;
}

.ttt-archive-wrapper .post-thumbnail {
    margin-bottom: 1.5rem;
    border-radius: 8px;
    overflow: hidden;
}

.ttt-archive-wrapper .post-thumbnail img {
    display: block;
    width: 100%;
    height: auto;
}

/* Sidebar widgets */
.ttt-archive-sidebar .widget {
    margin-bottom: 2rem;
}

.ttt-archive-sidebar .widget:last-child {
    margin-bottom: 0;
}

.ttt-archive-sidebar .widget-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin: 0 0 1rem;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.ttt-archive-sidebar ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.ttt-archive-sidebar ul li {
    margin-bottom: 0;
    font-size: 1.25rem;
    font-family: 'Poppins', sans-serif;
    border-bottom: 1px solid #b8d4e8;
    padding-bottom: 0.75rem;
    margin-bottom: 0.75rem;
}

.ttt-archive-sidebar ul li:last-child {
    margin-bottom: 0;
    border-bottom: none;
    padding-bottom: 0;
}

/* Category list links (sidebar + dropdown in content) */
.ttt-archive-sidebar ul li a,
.ttt-archive-sidebar .wp-block-categories-list li a,
.ttt-archive-wrapper .ttt-categories-dropdown .ttt-categories-dropdown-list li a {
    color: inherit;
    text-decoration: none;
    font-size: 1.25rem !important;
    font-family: 'Poppins', sans-serif !important;
}

.ttt-archive-sidebar ul li a:hover,
.ttt-archive-sidebar .wp-block-categories-list li a:hover,
.ttt-archive-wrapper .ttt-categories-dropdown .ttt-categories-dropdown-list li a:hover {
    text-decoration: none;
    color: #fcb900 !important;
}

.ttt-archive-sidebar .current-cat a,
.ttt-archive-wrapper .ttt-categories-dropdown .current-cat a {
    color: #fcb900 !important;
}


/* Pagination */
.ttt-archive-content .nav-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid #e0e0e0;
}

.ttt-archive-content .nav-links a,
.ttt-archive-content .nav-links span {
    display: inline-block;
    padding: 0.5rem 0.75rem;
    min-width: 2.5rem;
    text-align: center;
    border: 1px solid #ddd;
    text-decoration: none;
    color: inherit;
}

.ttt-archive-content .nav-links a:hover {
    background: #f5f5f5;
}

.ttt-archive-content .nav-links .current {
    background: #333;
    color: #fff;
    border-color: #333;
}

/* Mobile: single column, sidebar (categories dropdown) above posts */
@media (max-width: 767px) {
    .ttt-archive-wrapper {
        flex-direction: column;
        padding: 1.5rem 1rem;
    }

    .ttt-archive-content {
        flex: 1 1 auto;
        order: 1;
    }

    .ttt-archive-sidebar {
        flex: 1 1 auto;
        min-width: 0;
        order: 2;
        margin-top: 0;
        position: static;
    }

    /* Categories dropdown (mobile: full width, button + list styling) */
    .ttt-archive-wrapper .ttt-categories-dropdown {
        width: 100%;
        margin-bottom: 1rem;
    }

    .ttt-archive-wrapper .ttt-categories-dropdown summary {
        display: block;
        width: 100%;
        box-sizing: border-box;
        padding: 0.75rem 1rem;
        font-family: 'Poppins', sans-serif;
        font-size: 1rem;
        font-weight: 600;
        color: #0008af;
        background: #f4f6fe;
        border: 1px solid #b8d4e8;
        border-radius: 6px;
        cursor: pointer;
        list-style: none;
        -webkit-tap-highlight-color: transparent;
    }

    .ttt-archive-wrapper .ttt-categories-dropdown summary::-webkit-details-marker {
        display: none;
    }

    .ttt-archive-wrapper .ttt-categories-dropdown summary::after {
        content: '';
        display: inline-block;
        margin-left: 0.5rem;
        border: solid currentColor;
        border-width: 0 2px 2px 0;
        padding: 3px;
        transform: rotate(45deg);
        vertical-align: middle;
        transition: transform 0.2s ease;
    }

    .ttt-archive-wrapper .ttt-categories-dropdown[open] summary::after {
        transform: rotate(-135deg);
    }

    .ttt-archive-wrapper .ttt-categories-dropdown .ttt-categories-dropdown-list {
        margin-top: 0.5rem;
        padding: 0.5rem 0;
        list-style: none;
        border: 1px solid #b8d4e8;
        border-radius: 6px;
        background: #fff;
    }

    .ttt-archive-wrapper .ttt-categories-dropdown .ttt-categories-dropdown-list li {
        border-bottom: none;
        padding: 0.5rem 1rem;
        margin: 0;
        list-style: none;
    }

    .ttt-archive-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
}

/* Desktop: hide dropdown summary, list shows normally in sidebar, light blue panel */
@media (min-width: 768px) {
    .ttt-archive-wrapper .ttt-categories-dropdown {
        background-color: #eef1fc;
        padding: 1.25rem;
        border-radius: 8px;
    }

    .ttt-archive-wrapper .ttt-categories-dropdown summary {
        display: none;
    }

    .ttt-archive-wrapper .ttt-categories-dropdown .ttt-categories-dropdown-list {
        margin-top: 0;
        padding: 0;
        border: none;
        background: transparent;
    }
}

/* ==========================================================================
   Header + Sticky Nav
   ========================================================================== */

/* Header transparent so hero image shows through */
#site-header {
    background: transparent !important;
}

/* Make header absolute on mobile so it doesn't push content down */
@media (max-width: 767px) {
    #site-header {
        position: absolute !important;
        top: 0;
        left: 0;
        right: 0;
        z-index: 999 !important;
    }
}

/* Hide sticky nav in Elementor editor (hidden by default, shown only on live site) */
#sticky-nav-container,
.ttt-scroll-header {
    display: none;
}

/* Sticky nav — live site only (supports both #sticky-nav-container and .ttt-scroll-header) */
body:not(.elementor-editor-active) #sticky-nav-container,
body:not(.elementor-editor-active) .ttt-scroll-header {
    display: block;
    position: fixed !important;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100000 !important;
    opacity: 0;
    transform: translateY(-10px);
    pointer-events: none;
    transition: opacity 300ms ease-out, transform 600ms ease-out;
}

/* Visible state after scroll */
body:not(.elementor-editor-active) #sticky-nav-container.is-visible,
body:not(.elementor-editor-active) .ttt-scroll-header.is-visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

/* Hide on mobile */
@media (max-width: 767px) {
    body:not(.elementor-editor-active) #sticky-nav-container,
    body:not(.elementor-editor-active) .ttt-scroll-header {
        display: none !important;
    }
}

/* Offset when admin bar is showing */
body:not(.elementor-editor-active).admin-bar #sticky-nav-container,
body:not(.elementor-editor-active).admin-bar .ttt-scroll-header {
    top: 32px;
}

@media (max-width: 782px) {
    body:not(.elementor-editor-active).admin-bar #sticky-nav-container,
    body:not(.elementor-editor-active).admin-bar .ttt-scroll-header {
        top: 46px;
    }
}

/* When sticky nav is visible, drop quick links behind it */
body.ttt-sticky-visible .ttt-quick-links {
    z-index: 1 !important;
}

/* ==========================================================================
   Recent News (HFE Posts) – home page
   ========================================================================== */

/* Add class "recent-news-section" to the section that wraps the HFE posts widget. */

/* Section: dark blue background */
.recent-news-section {
    background-color: #1a365d !important;
    background-image: radial-gradient(circle at 25% 25%, rgba(255, 255, 255, 0.03) 0%, transparent 50%),
                      linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.02) 50%, transparent 100%),
                      repeating-linear-gradient(0deg, transparent, transparent 20px, rgba(255, 255, 255, 0.03) 20px, rgba(255, 255, 255, 0.03) 21px),
                      repeating-linear-gradient(90deg, transparent, transparent 20px, rgba(255, 255, 255, 0.03) 20px, rgba(255, 255, 255, 0.03) 21px);
    padding: 3rem 1.5rem !important;
}

.recent-news-section .elementor-heading-title {
    font-size: 1.75rem !important;
    font-weight: 700 !important;
    text-align: center !important;
    margin-bottom: 2rem !important;
}

/* Grid: column count controlled in Elementor; we only set gap and max-width */
.recent-news-section .hfe-posts-grid {
    gap: 1.5rem !important;
    max-width: 1200px;
    margin-left: auto !important;
    margin-right: auto !important;
}

/* Card: white background, subtle rounded corners, shadow, lift on hover */
.recent-news-section .hfe-post-card {
    background: #fff !important;
    overflow: hidden;
    display: flex !important;
    flex-direction: column !important;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    min-width: 0;
    transition: box-shadow 0.25s ease, transform 0.25s ease;
}

.recent-news-section .hfe-post-card:hover {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    transform: translateY(-4px);
}

/* Thumbnail: fixed aspect ratio, uniform size */
.recent-news-section .hfe-post-image {
    position: relative !important;
    width: 100% !important;
    aspect-ratio: 16 / 10 !important;
    overflow: hidden !important;
    flex-shrink: 0 !important;
    display: block !important;
}

.recent-news-section .hfe-post-image a {
    position: absolute !important;
    inset: 0 !important;
    display: block !important;
}

.recent-news-section .hfe-post-image img {
    position: absolute !important;
    left: 0 !important;
    top: 0 !important;
    width: 100% !important;
    height: 100% !important;
    max-height: none !important;
    object-fit: cover !important;
    object-position: center !important;
    display: block !important;
}

/* Read More: no underline, yellow on hover (content links only, not image) */
.recent-news-section .hfe-post-card .hfe-post-content a,
.recent-news-section .hfe-post-card > *:not(.hfe-post-image) a {
    text-decoration: none !important;
    color: #3b82f6;
    transition: color 0.2s ease;
}

.recent-news-section .hfe-post-card .hfe-post-content a:hover,
.recent-news-section .hfe-post-card > *:not(.hfe-post-image) a:hover {
    color: #fbbf24 !important;
}

/* Mobile */
@media (max-width: 767px) {
    .recent-news-section .hfe-posts-grid {
        gap: 1.25rem !important;
    }

    .recent-news-section {
        padding: 2rem 1rem !important;
    }
}
