/* ========================================
   PAPRIKA RECIPE MANAGER - ENHANCED STYLES
   ======================================== */

/* CSS Variables for easy customization */
:root {
    --primary-color: #d32f2f;
    --primary-hover: #b71c1c;
    --secondary-color: #ff6f00;
    --text-dark: #2c2c2c;
    --text-medium: #5a5a5a;
    --text-light: #757575;
    --background: #fafafa;
    --card-background: #ffffff;
    --border-color: #e0e0e0;
    --shadow-sm: 0 2px 4px rgba(0,0,0,0.08);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.12);
    --shadow-lg: 0 8px 24px rgba(0,0,0,0.15);
    --border-radius: 12px;
    --transition: all 0.3s ease;
}

/* ========================================
   BASE STYLES
   ======================================== */

* {
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: var(--text-dark);
    background: var(--background);
    margin: 0;
    padding: 20px;
}

/* ========================================
   INDEX PAGE STYLES
   ======================================== */

body > h1 {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--text-dark);
    margin: 0 0 1.5rem 0;
    padding-bottom: 1rem;
    border-bottom: 3px solid var(--primary-color);
}

body > ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.25rem;
    max-width: 1400px;
}

body > ul > li {
    background: var(--card-background);
    border-radius: var(--border-radius);
    padding: 0;
    margin: 0;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    overflow: hidden;
}

body > ul > li:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

body > ul > li > a {
    display: block;
    padding: 1.25rem;
    color: var(--text-dark);
    text-decoration: none;
    font-weight: 500;
    font-size: 1.05rem;
    transition: var(--transition);
    position: relative;
}

body > ul > li > a::before {
    content: '🍴';
    margin-right: 0.75rem;
    font-size: 1.2rem;
    transition: var(--transition);
}

body > ul > li:hover > a::before {
    transform: scale(1.2);
}

body > ul > li > a:hover {
    color: var(--primary-color);
}

/* ========================================
   RECIPE PAGE STYLES
   ======================================== */

.recipe {
    max-width: 1100px;
    margin: 0 auto 3rem;
    background: var(--card-background);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-md);
    overflow: hidden;
    page-break-after: always;
}

.recipe:first-child {
    margin-top: 0;
}

/* Recipe Header Section */
.infobox {
    padding: 2rem;
    background: linear-gradient(135deg, #fff 0%, #f8f8f8 100%);
    border-bottom: 1px solid var(--border-color);
}

.name {
    font-size: 2.25rem;
    font-weight: 700;
    color: var(--text-dark);
    margin: 0 0 1rem 0;
    line-height: 1.3;
}

.photobox {
    float: left;
    margin: 0 1.5rem 1rem 0;
}

.photo {
    max-width: 200px;
    max-height: 200px;
    width: auto;
    height: auto;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-md);
    transition: var(--transition);
}

.photo:hover {
    transform: scale(1.05);
    box-shadow: var(--shadow-lg);
}

.photoswipe {
    border: none;
    cursor: pointer;
}

.rating {
    font-size: 1.5rem;
    color: var(--secondary-color);
    margin: 0.5rem 0;
    letter-spacing: 2px;
}

.metadata {
    font-size: 0.95rem;
    color: var(--text-medium);
    line-height: 1.8;
}

.metadata b {
    color: var(--text-dark);
    font-weight: 600;
}

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

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

.categories {
    color: var(--text-light);
    font-size: 0.9rem;
    font-style: italic;
    margin: 0.5rem 0;
}

/* Recipe Content Layout */
.left-column,
.right-column {
    padding: 2rem;
}

@media (min-width: 768px) {
    .left-column {
        float: left;
        width: 35%;
        background: #fafafa;
        min-height: 400px;
    }
    
    .right-column {
        float: right;
        width: 65%;
    }
}

/* Section Headers */
.subhead {
    color: var(--primary-color);
    font-weight: 700;
    font-size: 1.25rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin: 0 0 1rem 0;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--primary-color);
}

/* Ingredients Section */
.ingredientsbox {
    margin-bottom: 2rem;
}

.ingredients {
    padding-bottom: 1rem;
}

.ingredients p {
    margin: 0.5rem 0;
    color: var(--text-dark);
    line-height: 1.7;
}

.ingredients p.line {
    padding-left: 1.5rem;
    position: relative;
}

.ingredients p.line:not(:has(strong:first-child))::before {
    content: '•';
    position: absolute;
    left: 0;
    color: var(--primary-color);
    font-weight: bold;
}

.ingredients strong {
    color: var(--primary-color);
    font-weight: 600;
}

/* Directions Section */
.directionsbox {
    margin-bottom: 2rem;
}

.directions {
    line-height: 1.8;
}

.directions p.line {
    margin: 1.25rem 0;
    padding-left: 1rem;
    border-left: 3px solid var(--primary-color);
    padding: 1rem 0 1rem 1.5rem;
    background: #fafafa;
    border-radius: 0 8px 8px 0;
}

.directions strong {
    color: var(--primary-color);
    font-weight: 600;
    display: block;
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
}

.directions br + br {
    display: none;
}

/* Text Blocks */
.text {
    line-height: 1.7;
}

/* Clear Float */
.clear {
    clear: both;
}

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

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

/* ========================================
   RESPONSIVE DESIGN
   ======================================== */

@media (max-width: 767px) {
    body {
        padding: 10px;
    }
    
    body > h1 {
        font-size: 2rem;
    }
    
    body > ul {
        grid-template-columns: 1fr;
    }
    
    .recipe {
        border-radius: 8px;
    }
    
    .infobox {
        padding: 1.5rem;
    }
    
    .name {
        font-size: 1.75rem;
    }
    
    .photobox {
        float: none;
        margin: 0 0 1rem 0;
        text-align: center;
    }
    
    .photo {
        max-width: 100%;
        max-height: 300px;
    }
    
    .left-column,
    .right-column {
        padding: 1.5rem;
        float: none;
        width: 100%;
    }
    
    .left-column {
        background: transparent;
    }
}

@media (max-width: 480px) {
    body > h1 {
        font-size: 1.75rem;
    }
    
    .name {
        font-size: 1.5rem;
    }
    
    .subhead {
        font-size: 1.1rem;
    }
}

/* ========================================
   PRINT STYLES
   ======================================== */

@media print {
    body {
        background: white;
        padding: 0;
    }
    
    .recipe {
        box-shadow: none;
        page-break-after: always;
        margin-bottom: 0;
    }
    
    body > ul > li {
        box-shadow: none;
        break-inside: avoid;
    }
    
    .photo {
        box-shadow: none;
    }
    
    a {
        color: var(--text-dark);
        text-decoration: underline;
    }
}

/* ========================================
   PHOTOSWIPE ENHANCEMENTS
   ======================================== */

.inline-image {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 1rem 0;
    box-shadow: var(--shadow-sm);
}

.pswp__caption__center {
    text-align: center !important;
}