/* ============================================================
   Pizza e Pane - Modern, Fast, Responsive Standalone Theme
   ============================================================ */

:root {
    --primary: #c2410c;         /* Warm terracotta crust */
    --primary-hover: #9a3412;
    --primary-light: #ffedd5;
    --secondary: #0f172a;       /* Deep slate */
    --accent: #d97706;          /* Golden honey */
    --bg-page: #faf8f5;         /* Warm flour white */
    --bg-card: #ffffff;
    --bg-sidebar: #f3ede2;      /* Light parchment */
    --text-main: #27272a;
    --text-muted: #71717a;
    --border-color: #e4e4e7;
    --radius-sm: 6px;
    --radius-md: 12px;
    --radius-lg: 18px;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
    --shadow-lg: 0 10px 25px rgba(0,0,0,0.12);
    --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --font-sans: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-sans);
    background-color: var(--bg-page);
    color: var(--text-main);
    line-height: 1.65;
    font-size: 1rem;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

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

a:hover {
    color: var(--primary-hover);
    text-decoration: underline;
}

img {
    max-width: 100%;
    height: auto;
    display: inline-block;
    border-radius: var(--radius-sm);
}

/* ============================================================
   Header & Navigation
   ============================================================ */

.site-header {
    background: #ffffff;
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: var(--shadow-sm);
}

.header-banner {
    background: #ffffff;
    text-align: center;
    padding: 8px 16px;
    border-bottom: 1px solid #f1f1f1;
}

.header-banner img {
    max-height: 90px;
    width: auto;
    object-fit: contain;
}

.navbar {
    max-width: 1280px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 20px;
    gap: 20px;
}

.brand-text {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--secondary);
    letter-spacing: -0.5px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.brand-text:hover {
    text-decoration: none;
    color: var(--primary);
}

.brand-icon {
    width: 32px;
    height: 32px;
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 8px;
    align-items: center;
}

.nav-link {
    color: var(--text-main);
    font-weight: 500;
    font-size: 0.95rem;
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    gap: 6px;
}

.nav-link:hover, .nav-link.active {
    background-color: var(--primary-light);
    color: var(--primary);
    text-decoration: none;
}

.nav-link img {
    width: 20px;
    height: 20px;
}

/* Dropdown Menu */
.dropdown {
    position: relative;
}

.dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: #ffffff;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 8px 0;
    min-width: 230px;
    list-style: none;
    z-index: 1050;
}

.dropdown:hover .dropdown-menu,
.dropdown:focus-within .dropdown-menu {
    display: block;
}

.dropdown-item {
    padding: 8px 16px;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-main);
    font-size: 0.9rem;
    font-weight: 500;
}

.dropdown-item:hover {
    background-color: var(--primary-light);
    color: var(--primary);
    text-decoration: none;
}

.nav-search {
    position: relative;
    display: flex;
    align-items: center;
}

.nav-search input {
    padding: 7px 14px 7px 34px;
    border: 1px solid var(--border-color);
    border-radius: 20px;
    font-size: 0.9rem;
    background: var(--bg-page);
    width: 200px;
    transition: var(--transition);
}

.nav-search input:focus {
    outline: none;
    border-color: var(--primary);
    background: #ffffff;
    width: 260px;
    box-shadow: 0 0 0 3px rgba(194, 65, 12, 0.15);
}

.nav-search-icon {
    position: absolute;
    left: 12px;
    color: var(--text-muted);
    font-size: 0.85rem;
    pointer-events: none;
}

/* Mobile Toggle */
.menu-toggle {
    display: none;
    background: none;
    border: 1px solid var(--border-color);
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 1.2rem;
}

/* ============================================================
   Layout & Container
   ============================================================ */

.site-main {
    flex: 1;
    max-width: 1280px;
    width: 100%;
    margin: 0 auto;
    padding: 24px 20px 48px;
}

/* Hero Section */
.hero-banner {
    background: linear-gradient(135deg, #fff7ed 0%, #ffedd5 100%);
    border: 1px solid #fed7aa;
    border-radius: var(--radius-lg);
    padding: 32px 36px;
    margin-bottom: 32px;
    position: relative;
    overflow: hidden;
}

.hero-banner h1 {
    font-size: 2.2rem;
    font-weight: 800;
    color: var(--secondary);
    margin-bottom: 10px;
    line-height: 1.2;
}

.hero-banner p {
    font-size: 1.15rem;
    color: #78350f;
    max-width: 700px;
}

/* ============================================================
   Recipe Cards Grid
   ============================================================ */

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 16px;
}

.section-title {
    font-size: 1.7rem;
    font-weight: 700;
    color: var(--secondary);
}

.category-tabs {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.cat-tab {
    padding: 6px 14px;
    border-radius: 20px;
    background: #ffffff;
    border: 1px solid var(--border-color);
    font-size: 0.88rem;
    font-weight: 500;
    color: var(--text-main);
    transition: var(--transition);
}

.cat-tab:hover, .cat-tab.active {
    background: var(--primary);
    color: #ffffff;
    border-color: var(--primary);
    text-decoration: none;
}

.recipes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 28px;
}

.recipe-card {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    overflow: hidden;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    transition: var(--transition);
}

.recipe-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
    border-color: #fdba74;
}

.card-img-link {
    display: block;
    position: relative;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    background: #f4ede3;
}

.card-img-link img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 0;
    transition: transform 0.3s ease;
}

.recipe-card:hover .card-img-link img {
    transform: scale(1.04);
}

.card-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(4px);
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--primary);
    box-shadow: var(--shadow-sm);
}

.card-body {
    padding: 20px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.card-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 8px;
    line-height: 1.35;
}

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

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

.card-intro {
    font-size: 0.92rem;
    color: var(--text-muted);
    margin-bottom: 16px;
    flex: 1;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid #f4f4f5;
    padding-top: 12px;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.difficulty-stars {
    display: flex;
    gap: 2px;
    align-items: center;
}

.difficulty-stars img {
    width: 20px;
    height: 20px;
}

/* ============================================================
   Single Recipe / Article View
   ============================================================ */

.recipe-header {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 28px;
    margin-bottom: 28px;
    box-shadow: var(--shadow-sm);
}

.recipe-meta-top {
    display: flex;
    gap: 12px;
    align-items: center;
    margin-bottom: 12px;
    font-size: 0.88rem;
    color: var(--text-muted);
}

.recipe-title {
    font-size: 2.3rem;
    font-weight: 800;
    color: var(--secondary);
    line-height: 1.2;
    margin-bottom: 16px;
}

.recipe-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 16px;
}

.badge-item {
    background: var(--bg-sidebar);
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.92rem;
    font-weight: 600;
    color: #451a03;
}

.badge-item img {
    width: 22px;
    height: 22px;
}

/* Two-column Recipe Layout */
.recipe-layout {
    display: grid;
    grid-template-columns: 1fr 360px;
    gap: 32px;
    align-items: start;
}

.recipe-instructions {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 32px;
    box-shadow: var(--shadow-sm);
}

.recipe-instructions h2,
.recipe-instructions h3 {
    font-size: 1.45rem;
    font-weight: 700;
    color: var(--secondary);
    margin-top: 24px;
    margin-bottom: 12px;
    border-bottom: 2px solid var(--primary-light);
    padding-bottom: 6px;
}

.recipe-instructions h4 {
    font-size: 1.15rem;
    font-weight: 700;
    margin-top: 18px;
    margin-bottom: 8px;
}

.recipe-instructions p {
    margin-bottom: 14px;
    text-align: justify;
}

.recipe-instructions img {
    margin: 12px 10px 12px 0;
    box-shadow: var(--shadow-sm);
    border: 1px solid #eaeaea;
    transition: transform 0.2s ease;
    cursor: zoom-in;
}

.recipe-instructions img:hover {
    transform: scale(1.02);
}

/* Sidebar with Ingredients */
.recipe-sidebar {
    position: sticky;
    top: 90px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.ingredients-box {
    background: #fffbf5;
    border: 1px solid #fde68a;
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-sm);
}

.ingredients-box h3 {
    font-size: 1.3rem;
    font-weight: 700;
    color: #78350f;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
    border-bottom: 2px solid #fde68a;
    padding-bottom: 8px;
}

.ingredients-box ul {
    list-style: none;
    margin-bottom: 16px;
}

.ingredients-box li {
    padding: 8px 0;
    border-bottom: 1px dashed #e5dccb;
    font-size: 0.95rem;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    cursor: pointer;
    user-select: none;
}

.ingredients-box li:last-child {
    border-bottom: none;
}

.ingredients-box input[type="checkbox"] {
    margin-top: 4px;
    accent-color: var(--primary);
    cursor: pointer;
}

.ingredients-box li.checked {
    text-decoration: line-through;
    color: var(--text-muted);
    opacity: 0.6;
}

.tools-box {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 20px;
    box-shadow: var(--shadow-sm);
}

.tools-box h4 {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 10px;
    color: var(--secondary);
}

.tools-box ul {
    padding-left: 20px;
    font-size: 0.92rem;
    color: var(--text-main);
}

.tools-box li {
    margin-bottom: 6px;
}

.action-buttons {
    display: flex;
    gap: 10px;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    font-size: 0.92rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: var(--transition);
}

.btn-primary {
    background: var(--primary);
    color: #ffffff;
}

.btn-primary:hover {
    background: var(--primary-hover);
    color: #ffffff;
    text-decoration: none;
}

.btn-outline {
    background: #ffffff;
    border: 1px solid var(--border-color);
    color: var(--text-main);
}

.btn-outline:hover {
    background: #f4f4f5;
    text-decoration: none;
}

/* ============================================================
   Joomla Legacy Class Compatibility
   ============================================================ */
.pp-image-float-right { float: right; padding-left: 15px; margin-bottom: 10px; }
.pp-image-float-left { float: left; padding-right: 15px; margin-bottom: 10px; }
.pp-image-w300 { width: 300px; height: auto; }
.pp-image-w200 { width: 200px; height: auto; }
.pp-recipt-difficulty img { width: 24px; height: 24px; vertical-align: middle; }
.pp-recipt-article img { max-width: 100%; height: auto; border-radius: var(--radius-sm); margin: 8px 10px 8px 0; }

/* Lightbox Modal */
.lightbox-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    z-index: 2000;
    justify-content: center;
    align-items: center;
    cursor: zoom-out;
}

.lightbox-modal.active {
    display: flex;
}

.lightbox-modal img {
    max-width: 90vw;
    max-height: 90vh;
    border-radius: var(--radius-md);
    box-shadow: 0 0 30px rgba(0,0,0,0.5);
}

/* ============================================================
   Footer
   ============================================================ */

.site-footer {
    background: #ffffff;
    border-top: 1px solid var(--border-color);
    padding: 32px 20px;
    margin-top: auto;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.footer-content {
    max-width: 1280px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
}

.footer-links {
    display: flex;
    gap: 16px;
    list-style: none;
}

/* ============================================================
   Responsive Media Queries
   ============================================================ */

@media (max-width: 992px) {
    .recipe-layout {
        grid-template-columns: 1fr;
    }
    
    .recipe-sidebar {
        position: static;
        order: -1; /* Ingredients above instructions on mobile! */
    }
}

@media (max-width: 768px) {
    .menu-toggle {
        display: block;
    }

    .nav-links {
        display: none;
        flex-direction: column;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: #ffffff;
        border-bottom: 1px solid var(--border-color);
        padding: 16px 20px;
        box-shadow: var(--shadow-lg);
    }

    .nav-links.show {
        display: flex;
    }

    .dropdown-menu {
        position: static;
        box-shadow: none;
        border: none;
        padding-left: 16px;
    }

    .nav-search {
        display: none; /* Can be opened via mobile search button */
    }

    .hero-banner h1 {
        font-size: 1.8rem;
    }

    .recipe-title {
        font-size: 1.8rem;
    }

    .recipes-grid {
        grid-template-columns: 1fr;
    }
}

/* Print Stylesheet */
@media print {
    .site-header,
    .nav-search,
    .recipe-sidebar .action-buttons,
    .site-footer,
    .lightbox-modal {
        display: none !important;
    }

    body {
        background: #ffffff;
        color: #000000;
        font-size: 12pt;
    }

    .recipe-layout {
        display: block;
    }

    .recipe-instructions img {
        max-width: 250px;
        page-break-inside: avoid;
    }
}
