/* Homepage specific styles */

/* Expanded CSS Variables from spec.lt */
:root {
    --blue: #007bff;
    --indigo: #6610f2;
    --purple: #6f42c1;
    --pink: #e83e8c;
    --red: #dc3545;
    --orange: #fd7e14;
    --yellow: #ffc107;
    --green: #28a745;
    --teal: #20c997;
    --cyan: #17a2b8;
    --gray: #6c757d;
    --gray-dark: #343a40;
    --o-cc5-btn-secondary: #f6f6f6;
    --o-cc5-headings: #ffffff;
    --o-cc5-bg: #383e45;
    --o-cc4-btn-secondary: #f6f6f6;
    --o-cc4-btn-primary: #383e45;
    --o-cc4-bg: #0c5ca7;
    --o-cc3-btn-secondary: #f6f6f6;
    --o-cc3-bg: #685563;
    --o-cc2-headings: #0c5ca7;
    --o-cc2-bg: #f6f6f6;
    --o-cc1-bg: #ffffff;
    --o-color-5: #383e45;
    --o-color-4: #ffffff;
    --o-color-3: #f6f6f6;
    --o-color-2: #685563;
    --o-color-1: #0c5ca7;
    --gray-100: #f8f9fa;
    --gray-200: #e9ecef;
    --gray-300: #dee2e6;
    --gray-400: #ced4da;
    --gray-500: #adb5bd;
    --gray-600: #6c757d;
    --gray-700: #495057;
    --gray-800: #343a40;
    --gray-900: #212529;
    --primary: #0c5ca7;
    --secondary: #685563;
    --success: #0c59a2;
    --info: #17a2b8;
    --warning: #ffc107;
    --danger: #dc3545;
    --light: #f7f7f8;
    --dark: #181a1b;
    --body-color: #212529;
    --body-bg: #ffffff;
    --font-sans-serif: "Open Sans", "Odoo Unicode Support Noto", sans-serif;
}

@media (max-width: 991.98px) {
    .row > .col-lg-8 {
        margin-bottom: 2rem;
    }
}

/* Improved masonry grid for categories presentation - updated to use columns */
.masonry {
    column-count: 2;
    column-gap: 1.5rem;
    margin-bottom: 1.5rem;
    height: auto;
}

.masonry .item {
    break-inside: avoid;
    margin-bottom: 1.5rem;
    display: inline-block;
    width: 100%;
}

.masonry .card {
    height: 100%;
    transition: all 0.3s ease;
    background-color: #fff;
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    display: inline-block;
    width: 100%;
}

/* Card hover effects */
.masonry .card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.1);
}

/* Card header optimizations */
.masonry .card-header {
    background-color: rgba(248, 249, 250, 0.7);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    padding: 0.85rem 1rem;
    display: flex;
    align-items: center;
}

.masonry .card-header h2 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0;
    color: #495057;
    white-space: normal;
    line-height: 1.3;
}

/* Category links styling */
.masonry .card-body {
    padding: 0.8rem 1rem;
    display: flex;
    flex-direction: column;
    max-height: 350px;
    overflow-y: auto;
}

.masonry .card-body a {
    color: #0c5ca7;
    text-decoration: none;
    padding: 0.375rem 0;
    font-size: 0.9rem;
    transition: all 0.2s ease;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    white-space: normal;
    line-height: 1.3;
}

.masonry .card-body a:last-child {
    border-bottom: none;
}

.masonry .card-body a:hover {
    color: #074179;
    background-color: rgba(12, 92, 167, 0.03);
    padding-left: 5px;
}

/* Scrollbar styling for category list */
.masonry .card-body::-webkit-scrollbar {
    width: 5px;
}

.masonry .card-body::-webkit-scrollbar-track {
    background-color: #f1f1f1;
    border-radius: 10px;
}

.masonry .card-body::-webkit-scrollbar-thumb {
    background-color: #d1d1d1;
    border-radius: 10px;
}

/* Responsive adjustments */
@media (max-width: 767.98px) {
    .masonry {
        column-count: 1;
    }

    .masonry .card-body {
        max-height: 250px;
    }
}

@media (min-width: 1200px) {
    .masonry {
        column-count: 2;
    }
}

/* Simplified category grid - updated for column-based layout */
.category-grid {
    column-count: 2;
    column-gap: 1.5rem;
    margin-bottom: 2rem;
}

.category-item {
    break-inside: avoid;
    margin-bottom: 1.5rem;
    display: inline-block;
    width: 100%;
}

/* Responsive adjustments for category grid */
@media (max-width: 767.98px) {
    .category-grid {
        column-count: 1;
    }
}

@media (min-width: 1200px) {
    .category-grid {
        column-count: 2;
    }
}

.category-card {
    background-color: white;
    border: 1px solid #dee2e6;
    border-radius: 5px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.category-header {
    display: flex;
    align-items: center;
    padding: 1rem;
    border-bottom: 1px solid #e9ecef;
    background-color: #f8f9fa;
}

.category-icon {
    width: 32px;
    height: 32px;
    margin-right: 10px;
}

.category-title {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    color: #6c757d;
    font-family: "Open Sans", "Odoo Unicode Support Noto", sans-serif;
    line-height: 1.2;
}

.category-content {
    display: flex;
    flex-direction: column;
    padding: 1rem;
    max-height: 250px;
    overflow-y: auto;
}

.category-content a {
    color: #0c59a2;
    text-decoration: none;
    padding: 0.5rem 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    font-weight: bold;
    font-family: var(--font-sans-serif);
}

.category-content a:last-child {
    border-bottom: none;
}

.category-content a:hover {
    color: #074179;
}

.category-footer {
    padding: 0.8rem 1rem;
    text-align: right;
    border-top: 1px solid #e9ecef;
}

.view-all {
    color: #0c59a2;
    text-decoration: none;
    font-weight: 500;
    display: inline-block;
    padding: 0.375rem 0.75rem;
    font-size: 0.9rem;
    border: 1px solid #0c59a2;
    border-radius: 0.25rem;
}

.view-all:hover {
    background-color: #0c59a2;
    color: white;
}

/* Scrollbar styling for category content */
.category-content::-webkit-scrollbar {
    width: 5px;
}

.category-content::-webkit-scrollbar-track {
    background-color: #f1f1f1;
}

.category-content::-webkit-scrollbar-thumb {
    background-color: #d1d1d1;
    border-radius: 10px;
}

/* Media queries */
@media (min-width: 768px) {
    .category-content {
        max-height: 300px;
    }
}

/* First page heading - Updated styling */
.first-page {
    font-size: 30px;
    font-weight: 400;
    color: #343a40;
    margin-bottom: 16px;
    text-align: left;
    line-height: 36px;
    font-family: "Open Sans", "Odoo Unicode Support Noto", sans-serif;
}

/* Birthday Block - Updated styling */
.birthday-block,
.new-block,
.popular-block,
.review-block {
    border: 1px solid var(--gray-300);
    border-radius: 5px;
    margin-bottom: 2rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    font-family: var(--font-sans-serif);
}

/* Special background color for blocks */
.birthday-block {
    background-color: rgb(250, 235, 215);
}

.new-block {
    background-color: rgb(240, 248, 255);
}

.popular-block {
    background-color: rgb(250, 235, 215);
}

.review-block {
    background-color: rgb(240, 248, 255);
}

/* Update header styles */
.birthday-block .header {
    padding: 1rem;
    background-color: rgb(250, 235, 215);
    border-bottom: 1px solid white;
}

.new-block .header {
    padding: 1rem;
    background-color: rgb(240, 248, 255);
    border-bottom: 1px solid white;
}

.popular-block .header {
    padding: 1rem;
    background-color: rgb(250, 235, 215);
    border-bottom: 1px solid white;
}

.review-block .header {
    padding: 1rem;
    background-color: rgb(240, 248, 255);
    border-bottom: 1px solid white;
}

/* Center the block titles */
.birthday-block .header h4,
.new-block .header h4,
.popular-block .header h4,
.review-block .header h4 {
    text-align: center;
    margin-bottom: 0;
    font-weight: 600;
    color: var(--gray-600);
}

/* Update body styles */
.birthday-block .body,
.new-block .body,
.popular-block .body,
.review-block .body {
    padding: 1rem;
}

.new-block .body {
    background-color: rgb(240, 248, 255);
}

.popular-block .body {
    background-color: rgb(250, 235, 215);
}

.review-block .body {
    background-color: rgb(240, 248, 255);
    padding: 1rem;
}

/* Update footer styles */
.birthday-block .footer {
    padding: 1rem;
    background-color: rgb(250, 235, 215);
    border-top: none;
    text-align: right;
}

.new-block .footer {
    padding: 1rem;
    background-color: rgb(240, 248, 255);
    border-top: none;
    text-align: right;
}

.popular-block .footer {
    padding: 1rem;
    background-color: rgb(250, 235, 215);
    border-top: none;
    text-align: right;
}

.review-block .footer {
    padding: 1rem;
    background-color: rgb(240, 248, 255);
    border-top: none;
    text-align: right;
}

.birthday-block ul,
.new-block ul,
.popular-block ul,
.review-block ul {
    list-style-type: none;
    padding-left: 0;
    margin-bottom: 0;
}

.birthday-block ul li,
.new-block ul li,
.popular-block ul li {
    padding: 0.5rem 0;
    border-bottom: 1px solid rgba(222, 226, 230, 0.5);
    line-height: 1.5;
}

.birthday-block ul li:last-child,
.new-block ul li:last-child,
.popular-block ul li:last-child {
    border-bottom: none;
}

.review-block ul li {
    padding: 0.5rem 0;
}

/* Sidebar block links styling */
.company-birthday li a,
.new-company li a,
.popular-company li a,
.latest-review li a {
    color: var(--primary);
    text-decoration: none;
    transition: color 0.2s ease;
}

.company-birthday li a:hover,
.new-company li a:hover,
.popular-company li a:hover,
.latest-review li a:hover {
    color: #074179;
    text-decoration: underline;
}

.company-birthday li span,
.new-company li span,
.popular-company li span {
    color: #555;
    font-size: 0.9rem;
}

/* Sidebar footer link styling */
.birthday-block .footer a.btn-link,
.new-block .footer a.btn-link,
.popular-block .footer a.btn-link,
.review-block .footer a.btn-link {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s ease;
    padding: 0.375rem 0.75rem;
}

/* Date font size specification */
.date-container time {
    font-size: 13px;
}

/* Blog posts section */
.o_website_blog_posts {
    background-color: #f8f9fa;
    padding: 3rem 0;
}

.blog-title {
    font-size: 2rem;
    font-weight: 600;
    color: #343a40;
    margin-bottom: 1rem;
}

/* Updated home-blog card styling to match articles page */
.home-blog {
    width: 100%; /* Changed from fixed width to 100% for responsive behavior */
    margin-bottom: 1.5rem;
    border: none;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

.home-blog:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

.home-blog .card-img-top {
    /*height: 240px; !* Increased from 180px to match articles page *!*/
    background-color: #e9ecef;
    object-fit: cover;
}

.pt-30 {
    padding-top: 56.25%; /* 16:9 Aspect Ratio */
    position: relative;
}

.ratio-hp {
    position: relative;
    width: 100%;
    aspect-ratio: 2 / 1;
    overflow: hidden;
}

.ratio-hp img.cover-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    position: absolute;
    top: 0;
    left: 0;
}

.home-blog .card-body {
    padding: 1.25rem;
    min-height: 180px; /* Added to ensure consistent card heights */
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.home-blog .card-title {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #0c59a2; /* Updated to match your brand color */
    line-height: 1.4;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.home-blog .card-text {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    color: #6c757d;
    font-size: 0.9rem;
    line-height: 1.4;
}

.home-blog .card-footer {
    background-color: rgba(0, 0, 0, 0.03);
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    padding: 1rem 1.25rem;
}

/* Move category links 10% to the left */
.home-blog .card-footer a.btn-link small {
    margin-left: -15%;
    display: inline-block;
}

/* Update the blog posts container to use grid */
.o_blog_posts {
    display: grid;
    grid-template-columns: repeat(1, 1fr);
    gap: 1.5rem;
}

/* Responsive adjustments for blog posts */
@media (min-width: 576px) {
    .o_blog_posts {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 992px) {
    .o_blog_posts {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* All blocks styling */
.card.border-primary {
    border-color: #0c5ca7 !important;
}

.card.border-primary .card-header {
    color: #0c5ca7;
    background-color: rgba(12, 92, 167, 0.05);
}

.card.text-primary .card-header {
    color: #0c5ca7 !important;
}

.card .list-group-item a {
    color: #212529;
    text-decoration: none;
}

.card .list-group-item a:hover {
    color: #0c5ca7;
}

/* Add spacing for the main container */
main {
    margin-bottom: 3rem;
}

/* Mobile-specific card footer styles */
@media (max-width: 576px) {
    .home-blog .card-footer {
        display: flex;
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        padding: 0.75rem 1rem;
        flex-wrap: nowrap;
    }

    .home-blog .card-footer a.btn-link {
        font-size: 1.1rem;
        padding: 0.25rem;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .home-blog .card-footer a:first-child {
        max-width: 70%;
        font-size: 1.2rem;
        font-weight: 500;
    }

    .home-blog .card-footer a:last-child {
        text-align: right;
        font-size: 1rem;
    }

    .home-blog .card-footer a small {
        display: inline-block;
        font-size: 0.9rem;
    }
}
