/**
 * Main CSS Styles - Framework Architecture (Blocksy Style)
 * 
 * @package KCTamThuc
 * @since 1.0.0
 */

:root {
    /* Color Palette */
    --color-primary: #00A86B;
    --color-primary-dark: #008556;
    --color-primary-light: #33C088;
    --color-secondary: #2E8B57;
    --color-accent: #20B2AA;
    --color-white: #ffffff;
    --color-black: #2c3e50;
    --color-gray: #f8f9fa;
    --color-dark-gray: #7f8c8d;

    /* Structural Variables */
    --site-container-width: 1200px;
    --header-height: 80px;
    --card-radius: 12px;
    --card-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    --card-shadow-hover: 0 10px 30px rgba(0, 0, 0, 0.12);

    /* Spacing & Transitions */
    --spacing-xs: 5px;
    --spacing-sm: 10px;
    --spacing-md: 20px;
    --spacing-lg: 30px;
    --spacing-xl: 50px;
    --transition-base: all 0.3s ease;
}

/* ===================================
   Base Layout
   =================================== */
body {
    font-family: 'Open Sans', sans-serif;
    color: var(--color-black);
    line-height: 1.6;
    margin: 0;
    background-color: #fcfcfc;
}

.container {
    width: 90%;
    max-width: var(--site-container-width);
    margin: 0 auto;
}

.section {
    padding: var(--spacing-xl) 0;
}

.grid {
    display: grid;
    gap: var(--spacing-lg);
}

.grid-3 {
    grid-template-columns: repeat(3, 1fr);
}

.grid-4 {
    grid-template-columns: repeat(4, 1fr);
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition-base);
}

/* ===================================
   Header Architecture
   =================================== */
.site-header {
    background: var(--menu-bg);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-gradient {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, var(--color-primary), var(--color-accent));
    opacity: 0.9;
    z-index: -1;
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: var(--header-height);
}

.site-branding {
    flex-shrink: 0;
}

.site-title {
    margin: 0;
    font-size: 24px;
    font-weight: 700;
    color: #fff;
}

.site-title a {
    color: inherit;
    display: flex;
    align-items: center;
    gap: 10px;
}

.site-description {
    color: rgba(255, 255, 255, 0.8);
    font-size: 13px;
    margin-top: 5px;
}

/* Header Layouts */
.style-type-1 .header-content {
    justify-content: space-between;
}

.style-type-2 .header-content {
    flex-direction: column;
    height: auto;
    padding: var(--spacing-md) 0;
    gap: var(--spacing-sm);
}

.header-navigation-centered {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding: var(--spacing-sm) 0;
    width: 100%;
    display: flex;
    justify-content: center;
}

/* Navigation & Sub-menus */
.nav-menu {
    display: flex;
    list-style: none;
    padding: 0;
    margin: 0;
    gap: var(--spacing-md);
}

.nav-menu li {
    position: relative;
}

.nav-menu>li>a {
    color: var(--menu-text);
    font-weight: 600;
    padding: 8px 15px;
    border-radius: 5px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.nav-menu a:hover,
.nav-menu .current-menu-item>a {
    background: var(--menu-hover-bg);
    color: var(--menu-hover-text) !important;
}

/* Dropdown */
.nav-menu ul.sub-menu {
    position: absolute;
    top: 100%;
    left: 0;
    background: #fff;
    min-width: 220px;
    padding: 10px 0;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: var(--transition-base);
}

.nav-menu li:hover>ul.sub-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.nav-menu ul.sub-menu a {
    color: #333 !important;
    padding: 10px 20px;
    display: block;
    font-size: 14px;
    font-weight: 500;
}

.nav-menu ul.sub-menu a:hover {
    background: #f8f9fa;
    color: var(--color-primary) !important;
}

/* Search */
.header-search {
    position: relative;
}

.search-toggle {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    border: none;
    padding: 10px 15px;
    border-radius: 5px;
    cursor: pointer;
}

.search-form-wrapper {
    position: absolute;
    top: 120%;
    right: 0;
    background: #fff;
    padding: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    width: 300px;
    display: none;
    z-index: 100;
}

.search-form-wrapper.active {
    display: block;
}

.search-form {
    display: flex;
    gap: 10px;
}

.search-form input[type="search"] {
    flex: 1;
    border: 1px solid #ddd;
    padding: 8px 12px;
    border-radius: 4px;
}

.search-form input[type="submit"] {
    background: var(--color-primary);
    color: #fff;
    border: none;
    padding: 8px 15px;
    border-radius: 4px;
    cursor: pointer;
}

/* Mobile Toggle */
.mobile-menu-toggle {
    display: none;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 10px;
}

.menu-icon span {
    display: block;
    width: 25px;
    height: 2px;
    background: var(--menu-text);
    margin: 6px 0;
    border-radius: 3px;
    transition: var(--transition-base);
}

/* ===================================
   Hero & Elements
   =================================== */
.hero-section {
    position: relative;
    padding: 100px 0;
    text-align: center;
    color: #fff;
    background-image: var(--hero-image-url);
    background-size: cover;
    background-position: center;
    overflow: hidden;
}

.hero-content {
    position: relative;
    z-index: 2;
    max-width: 800px;
    margin: 0 auto;
}

.hero-title {
    font-size: 48px;
    margin-bottom: 20px;
    line-height: 1.2;
}

.hero-description {
    font-size: 20px;
    opacity: 0.9;
    margin-bottom: 40px;
}

.category-card {
    text-align: center;
    padding: 30px;
    display: block;
}

.category-icon .icon-circle {
    width: 70px;
    height: 70px;
    background: var(--color-gray);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    font-size: 28px;
    color: var(--color-primary);
}

/* ===================================
   Card & Loop Architecture
   =================================== */
.dishes-grid {
    margin-bottom: 50px;
}

.card {
    background: var(--color-white);
    border-radius: var(--card-radius);
    box-shadow: var(--card-shadow);
    transition: var(--transition-base);
    overflow: hidden;
    height: 100%;
}

.card:hover {
    box-shadow: var(--card-shadow-hover);
    transform: translateY(-5px);
}

/* Grid Cards */
.style-grid {
    display: flex;
    flex-direction: column;
}

.dish-image-wrapper {
    position: relative;
    aspect-ratio: 16/10;
    overflow: hidden;
    background: #eee;
}

.dish-image-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.dish-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--color-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    /* Control overall overlay opacity via this */
    transition: var(--transition-base);
}

.dish-card:hover .dish-overlay {
    opacity: 0.8;
    /* Updated from 1 to allow some transparency */
}

.card-body {
    padding: 25px;
}

.card-title {
    font-size: 22px;
    margin: 0 0 12px;
    font-weight: 700;
    color: var(--color-black);
}

.card-title a:hover {
    color: var(--color-primary);
}

.dish-meta-inline {
    display: flex;
    gap: 20px;
    margin-bottom: 15px;
    font-size: 14px;
    color: var(--color-dark-gray);
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

.card-text {
    font-size: 14px;
    color: #666;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* List View */
.style-list {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 40px;
    box-shadow: none;
    border-bottom: 1px solid #eee;
    border-radius: 0;
    background: transparent;
    padding: 30px 0;
}

.style-list .dish-image-wrapper {
    width: 320px;
    height: 220px;
    flex-shrink: 0;
    border-radius: 12px;
}

.style-list .card-body {
    flex: 1;
    padding: 0;
}

.style-list .card-title {
    font-size: 28px;
}

/* ===================================
   Single Post Detail
   =================================== */
.breadcrumbs {
    padding: 20px 0;
    font-size: 14px;
    color: var(--color-dark-gray);
    border-bottom: 1px solid #eee;
    margin-bottom: 40px;
}

.breadcrumbs a {
    color: var(--color-primary);
}

.breadcrumbs span {
    margin: 0 10px;
    opacity: 0.5;
}

.dish-hero {
    position: relative;
    height: 450px;
    margin-bottom: 50px;
    border-radius: 15px;
    overflow: hidden;
}

.dish-hero-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.dish-hero-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 150px;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.6));
}

/* Grid Areas for Main Content and Sidebar */
.site-main,
.dish-main-content,
#primary.site-main {
    grid-area: main;
}

.widget-area,
.dish-sidebar,
#secondary {
    grid-area: sidebar;
}

.content-layout-wrapper {
    display: grid;
    gap: 30px;
    grid-template-areas: "main";
    grid-template-columns: 1fr;
}

.sidebar-right .content-layout-wrapper {
    grid-template-columns: 1fr var(--sidebar-width, 320px);
    grid-template-areas: "main sidebar";
}

.sidebar-left .content-layout-wrapper {
    grid-template-columns: var(--sidebar-width, 320px) 1fr;
    grid-template-areas: "sidebar main";
}

.no-sidebar .content-layout-wrapper {
    max-width: 900px;
    margin: 0 auto;
}

/* Sidebar width apply via variables */
.has-sidebar .site-main {
    width: 100%;
}

.has-sidebar .widget-area {
    width: 100%;
}

.dish-header {
    margin-bottom: 40px;
}

.dish-title {
    font-size: 42px;
    margin-bottom: 20px;
    line-height: 1.1;
}

.dish-meta {
    display: flex;
    gap: 30px;
    margin-bottom: 30px;
    font-size: 16px;
    color: var(--color-primary);
    font-weight: 600;
}

.dish-taxonomies {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    margin-top: 20px;
    font-size: 14px;
}

.dish-taxonomies div {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #f0f0f0;
    padding: 5px 12px;
    border-radius: 5px;
}

.dish-taxonomies a {
    color: var(--color-black);
}

.dish-taxonomies a:hover {
    color: var(--color-primary);
}

.dish-description {
    font-size: 17px;
    line-height: 1.8;
    color: #444;
    margin-bottom: 50px;
}

.dish-description p {
    margin-bottom: 25px;
}

.dish-ingredients,
.dish-instructions {
    background: #fff;
    padding: 40px;
    border-radius: 15px;
    margin-bottom: 40px;
    box-shadow: var(--card-shadow);
}

.dish-ingredients h3,
.dish-instructions h3 {
    font-size: 24px;
    color: var(--color-primary);
    margin-bottom: 25px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.author-box {
    display: flex;
    background: #f9f9f9;
    padding: 30px;
    border-radius: 15px;
    margin: 50px 0;
    gap: 25px;
    align-items: center;
}

.author-avatar img {
    border-radius: 50%;
    width: 100px;
    height: 100px;
}

.author-info h4 {
    margin: 0 0 8px;
    font-size: 20px;
    color: var(--color-primary);
}

.author-bio {
    color: #666;
    font-size: 15px;
    line-height: 1.6;
}

/* ===================================
   Widgets & Footer
   =================================== */
.widget {
    margin-bottom: 40px;
}

.widget-title {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 25px;
    color: var(--color-primary);
    padding-bottom: 10px;
    border-bottom: 2px solid var(--color-accent);
    position: relative;
}

.widget-title::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 50px;
    height: 2px;
    background: var(--color-primary);
}

.widget ul {
    list-style: none;
    padding: 0;
}

.widget ul li {
    padding: 12px 0;
    border-bottom: 1px solid #eee;
    display: flex;
    align-items: center;
    gap: 10px;
}

.widget ul li:last-child {
    border-bottom: none;
}

.site-footer {
    background: #2c3e50;
    color: #fff;
    padding: 80px 0 40px;
    margin-top: 80px;
    position: relative;
}

.footer-widgets-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 50px;
    margin-bottom: 60px;
}

.footer-widget-area h4 {
    color: #fff;
    margin-bottom: 30px;
    font-size: 22px;
    font-weight: 700;
    border-left: 4px solid var(--color-primary);
    padding-left: 15px;
}

.footer-widget-area ul li {
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    opacity: 0.9;
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 40px;
}

.footer-bottom-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 30px;
}

.site-info p {
    margin: 0;
    font-size: 15px;
    opacity: 0.8;
}

.social-links {
    display: flex;
    gap: 20px;
}

.social-links a {
    width: 45px;
    height: 45px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

.social-links a:hover {
    background: var(--color-primary);
    transform: translateY(-5px);
}

.footer-navigation ul {
    display: flex;
    list-style: none;
    padding: 0;
    margin: 0;
    gap: 25px;
    font-size: 15px;
    font-weight: 500;
}

.footer-navigation a {
    opacity: 0.8;
    color: #fff;
}

.footer-navigation a:hover {
    opacity: 1;
    color: var(--color-primary);
}

/* ===================================
   Utilities
   =================================== */
.back-to-top {
    position: fixed;
    bottom: 40px;
    right: 40px;
    width: 50px;
    height: 50px;
    background: var(--color-primary);
    color: #fff;
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    opacity: 0;
    visibility: hidden;
    transition: var(--transition-base);
    cursor: pointer;
    z-index: 999;
    font-size: 20px;
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
}

.back-to-top:hover {
    transform: translateY(-8px);
    background: var(--color-primary-dark);
}

/* Sticky Header scrolled */
.site-header.scrolled {
    background: #fff !important;
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.1);
}

.site-header.scrolled .site-title a,
.site-header.scrolled .nav-menu>li>a {
    color: #333 !important;
}

.site-header.scrolled .search-toggle {
    color: #333;
    background: rgba(0, 0, 0, 0.05);
}

.site-header.scrolled .site-description {
    color: #888 !important;
}

/* ===================================
   Responsive Framework
   =================================== */
@media (max-width: 1200px) {
    .container {
        width: 95%;
    }
}

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

    .footer-widgets-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .content-layout-wrapper {
        grid-template-columns: 1fr !important;
    }

    .mobile-menu-toggle {
        display: block;
    }

    .main-navigation {
        display: none;
    }

    /* Show/hide via JS toggle class */

    .style-list {
        flex-direction: column;
        align-items: flex-start;
    }

    .style-list .dish-image-wrapper {
        width: 100%;
        height: auto;
        aspect-ratio: 16/10;
    }
}

@media (max-width: 768px) {
    .hero-title {
        font-size: 32px;
    }

    .dish-title {
        font-size: 32px;
    }

    .footer-widgets-grid {
        grid-template-columns: 1fr;
    }

    .footer-bottom-content {
        flex-direction: column;
        text-align: center;
    }
}

@media (max-width: 480px) {

    .grid-2,
    .grid-3,
    .grid-4 {
        grid-template-columns: 1fr;
    }

    .hero-title {
        font-size: 28px;
    }
}