/* assets/css/front.css */

/* Reset-ish */
*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    line-height: 1.5;
    background-color: #f7f5f2;
    color: #222;
}

a {
    color: #b45309;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

.container {
    width: 100%;
    max-width: 1120px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* Header */

.site-header {
    background-color: #ffffff;
    border-bottom: 1px solid #e2e2e2;
    position: sticky;
    top: 0;
    z-index: 50;
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 0;
}

.logo a {
    display: flex;
    flex-direction: column;
}

.logo-main {
    font-weight: 700;
    font-size: 1.2rem;
    letter-spacing: 0.03em;
}

.logo-sub {
    font-size: 0.8rem;
    color: #666;
}

/* Nav */

.main-nav {
    position: relative;
}

.nav-list {
    list-style: none;
    display: flex;
    gap: 1rem;
    margin: 0;
    padding: 0;
}

.nav-item > a {
    display: inline-block;
    padding: 0.4rem 0.2rem;
    font-size: 0.95rem;
}

.nav-item.active > a {
    border-bottom: 2px solid #b45309;
}

/* Dropdowns */

.nav-item.dropdown {
    position: relative;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 190px;
    background-color: #ffffff;
    border: 1px solid #ddd;
    border-radius: 0 0 6px 6px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.06);
    opacity: 0;
    visibility: hidden;
    transform: translateY(6px);
    transition: opacity 0.15s ease, transform 0.15s ease, visibility 0.15s;
    z-index: 40;
}

.dropdown-menu li {
    list-style: none;
}

.dropdown-menu a {
    display: block;
    padding: 0.5rem 0.75rem;
    font-size: 0.9rem;
    white-space: nowrap;
}

.dropdown-menu a:hover {
    background-color: #f6f1ea;
}

.nav-item.dropdown:hover .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* Main layout */

.site-main {
    padding: 1.5rem 0 3rem;
}

/* Page header */

.page-header {
    margin-bottom: 1rem;
}

.page-header h1 {
    margin: 0 0 0.25rem;
}

.page-header p {
    margin: 0;
    color: #555;
}

/* Buttons */

.btn-primary,
.btn-ghost {
    display: inline-block;
    padding: 0.45rem 0.9rem;
    border-radius: 999px;
    border: 1px solid transparent;
    font-size: 0.9rem;
    cursor: pointer;
    background-color: transparent;
    text-align: center;
}

.btn-primary {
    background-color: #b45309;
    color: #fff;
    border-color: #b45309;
}

.btn-primary:hover {
    background-color: #92400e;
    border-color: #92400e;
    text-decoration: none;
}

.btn-ghost {
    border-color: #d4bea6;
    color: #7c5a34;
    background-color: #fdf7ef;
}

.btn-ghost:hover {
    background-color: #f6e6d3;
    text-decoration: none;
}

/* Hero and recipe cards */

.hero {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(0, 3fr);
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.hero-text h1 {
    margin: 0 0 0.5rem;
    font-size: 1.8rem;
}

.hero-text p {
    margin: 0.25rem 0;
    color: #444;
}

.hero-featured-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.hero-featured-item {
    display: flex;
    gap: 0.75rem;
    padding: 0.5rem;
    border-radius: 8px;
    background-color: #fff7ed;
}

.hero-featured-item img {
    width: 72px;
    height: 72px;
    object-fit: cover;
    border-radius: 6px;
}

.hero-featured-info h3 {
    margin: 0 0 0.25rem;
    font-size: 0.95rem;
}

.hero-featured-meta {
    font-size: 0.8rem;
    color: #666;
}

/* Recipe grid */

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 0.75rem;
    gap: 0.5rem;
}

.section-header h2 {
    margin: 0;
    font-size: 1.2rem;
}

.section-subtitle {
    font-size: 0.85rem;
    color: #666;
}

.section-header a {
    font-size: 0.9rem;
}

.recipe-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1rem;
}

.recipe-card {
    background-color: #ffffff;
    border-radius: 12px;
    box-shadow: 0 3px 8px rgba(0,0,0,0.04);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.recipe-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0,0,0,0.06);
}

.recipe-card-image {
    width: 100%;
    height: 180px;           /* Adjust to taste: 160–220px is a good range */
    overflow: hidden;
    background-color: #f0ebe4;
}

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


.recipe-card-body {
    padding: 0.75rem 0.9rem 0.9rem;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.recipe-card-title {
    font-size: 1rem;
    font-weight: 600;
    margin: 0;
}

.recipe-card-summary {
    font-size: 0.9rem;
    color: #555;
    margin: 0;
}

.recipe-card-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8rem;
    color: #777;
    margin-top: 0.4rem;
}

.recipe-chip {
    display: inline-block;
    padding: 0.1rem 0.45rem;
    border-radius: 999px;
    background-color: #f6f1ea;
    font-size: 0.75rem;
}

/* Filters */

.recipe-filters {
    margin-bottom: 1rem;
    padding: 0.75rem 0.9rem;
    background-color: #fdf7ef;
    border-radius: 10px;
    border: 1px solid #ecdcc7;
}

.recipe-filters-form {
    margin: 0;
}

.filters-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem 1rem;
    align-items: flex-end;
}

.filters-group {
    display: flex;
    flex-direction: column;
    min-width: 180px;
    flex: 1 1 0;
}

.filters-group label {
    font-size: 0.8rem;
    color: #555;
    margin-bottom: 0.15rem;
}

.filters-group input[type="text"],
.filters-group select {
    padding: 0.35rem 0.45rem;
    border-radius: 999px;
    border: 1px solid #d8c4aa;
    font-size: 0.9rem;
    background-color: #fff;
}

.filters-group.filters-actions {
    flex: 0 0 auto;
    display: flex;
    flex-direction: row;
    gap: 0.5rem;
    align-items: center;
}

/* Pagination */

.pagination {
    margin-top: 1.25rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.page-link {
    display: inline-block;
    padding: 0.25rem 0.55rem;
    border-radius: 999px;
    border: 1px solid #d4bea6;
    font-size: 0.85rem;
    background-color: #fff;
}

.page-link.active {
    background-color: #b45309;
    border-color: #b45309;
    color: #fff;
}

/* Recipe detail */

.recipe-detail {
    background-color: #ffffff;
    border-radius: 12px;
    padding: 1.25rem 1.25rem 1.5rem;
    box-shadow: 0 4px 10px rgba(0,0,0,0.04);
}

.recipe-detail-header {
    display: grid;
    grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
    gap: 1.25rem;
    margin-bottom: 1.25rem;
    align-items: start;
}

.recipe-detail-header h1 {
    margin: 0 0 0.35rem;
}

.recipe-detail-summary {
    margin: 0 0 0.65rem;
    color: #555;
}

.recipe-detail-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem 0.9rem;
    font-size: 0.85rem;
    color: #666;
}

.recipe-detail-meta .meta-item {
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
}

.recipe-detail-image img {
    width: 100%;
    max-height: 260px;
    object-fit: cover;
    border-radius: 10px;
    background-color: #f0ebe4;
}

.recipe-detail-body {
    display: grid;
    grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
    gap: 1.5rem;
}

.recipe-detail-main h2 {
    margin-top: 0;
}

.ingredients-list {
    padding-left: 1.1rem;
    margin: 0 0 1rem;
}

.instructions-list {
    padding-left: 1.1rem;
    margin: 0;
}

/* Aside panels */

.recipe-detail-aside {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.nutrition-panel,
.tags-panel {
    background-color: #fdf7ef;
    border-radius: 10px;
    padding: 0.8rem 0.9rem;
    border: 1px solid #ecdcc7;
}

.nutrition-panel h2,
.tags-panel h2 {
    margin: 0 0 0.5rem;
    font-size: 1rem;
}

.nutrition-panel table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.nutrition-panel th,
.nutrition-panel td {
    padding: 0.15rem 0;
}

.nutrition-panel th {
    text-align: left;
    font-weight: 500;
    color: #444;
}

.nutrition-panel td {
    text-align: right;
    color: #555;
}

.tags-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
}

.tag-chip {
    display: inline-block;
    padding: 0.1rem 0.45rem;
    border-radius: 999px;
    background-color: #e5e7eb;
    font-size: 0.75rem;
    color: #333;
}

/* Footer */

.site-footer {
    background-color: #222;
    color: #f5f5f5;
    padding: 1.5rem 0;
}

.footer-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.4rem;
}

.footer-links {
    font-size: 0.85rem;
}

.footer-links a {
    color: #fbbf24;
}

.footer-separator {
    margin: 0 0.25rem;
    color: #888;
}

.footer-copy {
    font-size: 0.8rem;
    color: #aaa;
}

/* Responsive */

@media (max-width: 900px) {
    .recipe-detail-header {
        grid-template-columns: minmax(0, 1fr);
    }

    .recipe-detail-body {
        grid-template-columns: minmax(0, 1fr);
    }
}

@media (max-width: 768px) {
    .header-inner {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .hero {
        grid-template-columns: minmax(0, 1fr);
    }

    .filters-row {
        flex-direction: column;
        align-items: stretch;
    }

    .filters-group {
        min-width: 100%;
    }

    .filters-group.filters-actions {
        justify-content: flex-start;
    }
}
