/* Custom styles - non-duplicate rules only */

/* Form message styling */
#message {
    margin-top: 15px;
    font-weight: bold;
}

.success {
    color: green;
}

.error {
    color: red;
}

/* Header opacity (make header fully opaque for proper dropdown visibility) */
header {
    opacity: 1;
}

/* Icon sizing */
.icon-images {
    width: 15px;
}

/* Home link layout */
.home-link {
    display: flex;
    align-items: center;
    gap: 10px;
}

.home-image {
    position: absolute;
}

/* Blog card styling */
.categories-blog {
    border-radius: 10px;
}

.article-image {
    height: 80%;
}

/* Lazy Loading Image Optimization */
.lazy-image {
    opacity: 0;
    transition: opacity 0.3s ease-in;
}

.lazy-image.loaded {
    opacity: 1;
}

/* Image container with aspect ratio for layout stability */
.image-container {
    position: relative;
    overflow: hidden;
    background-color: #f3f4f6;
    /* Gray placeholder */
}

.image-container::before {
    content: "";
    display: block;
    padding-top: 66.67%;
    /* 3:2 aspect ratio */
}

.image-container>* {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Optimized image rendering */
img {
    content-visibility: auto;
}

/* Content visibility for below-fold sections */
.lazy-section {
    content-visibility: auto;
    contain-intrinsic-size: 0 500px;
}



/* Load More Button */
.load-more-btn {
    background-color: #14B8A6;
    color: white;
    padding: 12px 32px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1);
}

.load-more-btn:hover {
    background-color: #0F766E;
    box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1);
}

.load-more-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.footer-links {
    list-style-type: none !important;
    padding: 0 !important;
}

/* Desktop dropdown styles: show .dropdown-menu on hover and add subtle transition */
.dropdown {
    position: relative;
}

.dropdown-menu {
    opacity: 0;
    transform: translateY(6px);
    transition: opacity 160ms ease, transform 160ms ease;
    min-width: 14rem;
    pointer-events: none;
}

.dropdown-menu.hidden {
    display: none !important;
}

.dropdown-menu:not(.hidden) {
    display: block;
}

@media (min-width: 1024px) {

    /* Ensure nav doesn't clip dropdowns */
    nav.hidden.lg\:flex {
        overflow: visible !important;
    }

    /* Show dropdown on hover - override .hidden class */
    .dropdown:hover .dropdown-menu {
        display: block !important;
        opacity: 1 !important;
        transform: translateY(0) !important;
        pointer-events: auto !important;
    }

    /* Allow pointer events for menu items */
    .dropdown:hover .dropdown-menu a {
        pointer-events: auto;
    }

    /* Professional hover effects on dropdown menu items */
    .dropdown-menu a {
        position: relative;
        padding: 0.5rem 1rem;
    }

    .dropdown-menu a:hover {
        background-color: #f0fdfa;
        color: #14B8A6;
    }
}

/* Ensure arrow rotation class is supported when toggling via JS */
.rotate-180 {
    transform: rotate(180deg);
    transition: transform 160ms ease;
}

/* Small polish for dropdown links */
.dropdown-menu a {
    transition: background-color 120ms ease, color 120ms ease, padding-left 120ms ease;
}

/* Ensure dropdown has proper z-index */
.dropdown-menu {
    z-index: 9999;
    position: absolute;
}

/* Professional Category Cards Styling */
.category-card {
    cursor: pointer;
    text-decoration: none;
    color: inherit;
    display: flex;
    border-radius: 1rem;
    border: 2px solid transparent;
    box-shadow: 0 8px 20px -12px rgb(17 24 39 / 0.35);
    transition: all 300ms ease;
}

.category-card:hover {
    text-decoration: none;
    border-color: #14B8A6;
    border-radius: 1rem;
    box-shadow: 0 18px 30px -16px rgb(20 184 166 / 0.45), 0 10px 20px -10px rgb(17 24 39 / 0.25);
    transform: translateY(-8px);
}

.category-card h3 {
    font-size: 1.125rem;
    transition: color 300ms ease;
} 

.category-card:hover h3 {
    color: #14B8A6;
}

/* Smooth transitions for category icon rotation and scale */
.category-card .ri-sofa-2-line,


/* Category Cards Minimalist Styling */
.category-card {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.category-card:hover {
    transform: translateY(-8px);
}

.category-card i {
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.category-card:hover i {
    transform: scale(1.1);
    color: #14B8A6;
}

@media (max-width: 640px) {

    /* Optimize category cards for mobile */
    .category-card {
        padding: 1.25rem !important;
    }

    .category-card:hover {
        transform: translateY(-4px);
    }
}

/* Ensure 4 columns layout on desktop */
@media (min-width: 1024px) {
    .category-card {
        min-height: 10rem;
    }
}

/* Mobile dropdown enhanced spacing and styling */
@media (max-width: 1023px) {

    /* Improve mobile menu details/summary styling */
    details.group {
        margin-bottom: 0.75rem;
    }

    details.group>summary {
        padding: 0.75rem 1rem;
        background-color: #f9fafb;
        border-radius: 0.375rem;
        font-weight: 600;
        color: #1f2937;
        cursor: pointer;
        user-select: none;
        transition: all 200ms ease;
        display: flex;
        align-items: center;
        justify-content: space-between;
    }

    details.group>summary:hover {
        background-color: #f3f4f6;
        color: #14B8A6;
    }

    details.group>summary::after {
        content: '›';
        font-size: 1.5rem;
        transition: transform 200ms ease;
        margin-left: 0.5rem;
    }

    details.group[open]>summary::after {
        transform: rotate(90deg);
    }

    /* Mobile submenu items spacing */
    details.group>div {
        background-color: #ffffff;
        border-left: 3px solid #14B8A6;
        margin-top: 0.25rem;
        margin-bottom: 0.5rem;
        border-radius: 0 0.375rem 0.375rem 0;
    }

    details.group>div a {
        padding: 0.875rem 1.25rem;
        transition: all 150ms ease;
        display: block;
        border-left: 3px solid transparent;
        margin-left: -3px;
        font-size: 0.925rem;
    }

    details.group>div a:hover {
        background-color: #f0fdfa;
        color: #14B8A6;
        padding-left: 1.5rem;
        font-weight: 500;
    }

    /* Main mobile menu item spacing */
    .nav-link-mobile {
        padding: 0.875rem 1rem !important;
        margin-bottom: 0.375rem !important;
        border-radius: 0.375rem;
        transition: all 150ms ease;
    }

    #mobile-menu {
        padding-top: 1rem !important;
        padding-bottom: 1rem !important;
    }
}

/* Custom 992px Breakpoints for Hero Section */
@media (max-width: 991px) {
    .hide-below-992 {
        display: none !important;
    }

    .featured-article-blog-section {
        flex-direction: column !important;
    }

    /* Override fixed height on mobile for Featured Articles section */
    section.h-\[800px\] {
        height: auto !important;
        padding-bottom: 4rem !important;
    }
}

@media (min-width: 992px) {
    .text-left-992 {
        text-align: left !important;
    }
}

/* Mobile Blog Cards Strict Constraints (max 767px) */
@media (max-width: 767px) {

    .categories-blog,
    .blog-card,
    a.group>.bg-white.shadow-sm {
        height: 218px !important;
        display: flex !important;
        flex-direction: column !important;
        margin: 0 !important;
        /* Decrease margin completely */
    }

    .categories-blog>div:first-child,
    .categories-blog>a>div:first-child,
    .blog-card>div:first-child,
    .blog-card>a>div:first-child,
    a.group>.bg-white.shadow-sm>div:first-child {
        height: 120px !important;
        min-height: 120px !important;
        flex-shrink: 0 !important;
    }

    /* Target the image directly to apply 100% height and remove implicit explicit widths/heights */
    .categories-blog img,
    .blog-card img,
    a.group>.bg-white.shadow-sm img {
        width: 100% !important;
        height: 100% !important;
        object-fit: cover !important;
    }

    .categories-blog>div:nth-child(2),
    .categories-blog>a>div:nth-child(2),
    .blog-card>div:nth-child(2),
    .blog-card>a>div:nth-child(2),
    a.group>.bg-white.shadow-sm>div:nth-child(2) {
        padding: 10px !important;
        /* Exact 10px padding requested */
        flex: 1 1 0% !important;
        overflow: hidden !important;
    }

    .categories-blog h3,
    .categories-blog h4,
    .categories-blog .text-xl,
    .blog-card h3,
    .blog-card h4,
    .blog-card .text-xl,
    a.group>.bg-white.shadow-sm h3 {
        font-size: 16px !important;
        /* Exact 16px heading */
        line-height: 1.25rem !important;
        margin-bottom: 2px !important;
        display: -webkit-box !important;
        -webkit-line-clamp: 2 !important;
        line-clamp: 2 !important;
        -webkit-box-orient: vertical !important;
        overflow: hidden !important;
    }

    .categories-blog p,
    .blog-card p,
    a.group>.bg-white.shadow-sm p {
        display: block !important;
        font-size: 12px !important;
        /* Exact 12px paragraph */
        line-height: 1rem !important;
        margin-bottom: 0 !important;
        display: -webkit-box !important;
        -webkit-line-clamp: 1 !important;
        /* Remove some para words via tight clamping to 1 line */
        line-clamp: 1 !important;
        -webkit-box-orient: vertical !important;
        overflow: hidden !important;
    }
}


/* Article page hero images only (exclude blog/category cards) */
main article.lg\:col-span-2 img.w-full.h-80.object-fill.rounded-lg.shadow-lg {
    height: 438px;
    object-fit: cover;
}