/* Wheeler Family Recipes - Homemade Family Cookbook Design */

/* Import fonts - Handwritten feel */
@import url('https://fonts.googleapis.com/css2?family=Caveat:wght@400;500;600;700&family=Cormorant+Garamond:ital,wght@0,400;0,500;0,600;1,400&family=Lora:ital,wght@0,400;0,500;1,400&display=swap');

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

/* Color Variables - Warm Vintage Cookbook Palette */
:root {
    /* Paper & background tones */
    --color-old-paper: #FDF6E3;
    --color-cream: #FFF8E7;
    --color-recipe-card: #FFFEF9;
    --color-aged-paper: #F4E9D8;
    --color-linen: #EDE4D4;
    
    /* Rich warm accents */
    --color-berry: #8B3A3A;
    --color-wine: #722F37;
    --color-rust: #B7553D;
    --color-copper: #C67D4A;
    --color-honey: #D4A553;
    --color-olive: #6B7B4C;
    
    /* Text colors */
    --color-ink: #2D2418;
    --color-faded-ink: #4A3F35;
    --color-pencil: #5C5145;
    
    /* Decorative */
    --color-red-check: #C44536;
    --color-blue-check: #4A6FA5;
    
    /* Functional */
    --shadow-paper: 0 2px 8px rgba(45, 36, 24, 0.1), 0 4px 20px rgba(45, 36, 24, 0.08);
    --shadow-card: 0 4px 12px rgba(45, 36, 24, 0.12), 0 8px 30px rgba(45, 36, 24, 0.08);
    --shadow-lifted: 0 8px 25px rgba(45, 36, 24, 0.18), 0 15px 40px rgba(45, 36, 24, 0.1);
    
    /* Transitions */
    --transition-quick: 0.2s ease;
    --transition-smooth: 0.3s ease;
    
    /* Border radius */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
}

/* Base Styles */
html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: 'Lora', Georgia, serif;
    background: var(--color-old-paper);
    color: var(--color-ink);
    line-height: 1.8;
    min-height: 100vh;
    position: relative;
}

/* Linen/Paper texture background */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        url("data:image/svg+xml,%3Csvg width='100' height='100' viewBox='0 0 100 100' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='%23d4a553' fill-opacity='0.03'%3E%3Cpath d='M0 0h50v50H0zM50 50h50v50H50z'/%3E%3C/g%3E%3C/svg%3E"),
        linear-gradient(135deg, rgba(212, 165, 83, 0.05) 0%, rgba(139, 58, 58, 0.03) 50%, rgba(107, 123, 76, 0.04) 100%);
    pointer-events: none;
    z-index: -1;
}

/* Decorative top border - like a tablecloth pattern */
body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 8px;
    background: repeating-linear-gradient(
        90deg,
        var(--color-red-check) 0px,
        var(--color-red-check) 20px,
        var(--color-cream) 20px,
        var(--color-cream) 40px
    );
    z-index: 1000;
}

/* Typography */
h1, h2, h3, h4 {
    font-family: 'Caveat', cursive;
    font-weight: 600;
    color: var(--color-berry);
    line-height: 1.2;
}

h1 {
    font-size: clamp(2.5rem, 7vw, 4rem);
    letter-spacing: 0.01em;
}

h2 {
    font-size: clamp(1.8rem, 5vw, 2.8rem);
}

h3 {
    font-size: clamp(1.4rem, 3.5vw, 1.9rem);
}

p {
    color: var(--color-faded-ink);
    font-family: 'Lora', Georgia, serif;
}

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

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

/* Main Container */
.main-container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 20px;
}

/* Header Styles */
.main-header {
    text-align: center;
    padding: 60px 20px 40px;
    margin-bottom: 20px;
    position: relative;
}

.main-header h1 {
    color: var(--color-berry);
    margin-bottom: 15px;
    position: relative;
    display: inline-block;
    text-shadow: 2px 2px 0 rgba(255,255,255,0.8);
}

/* Decorative underline for title */
.main-header h1::after {
    content: '';
    display: block;
    width: 100px;
    height: 3px;
    background: linear-gradient(90deg, transparent, var(--color-honey), transparent);
    margin: 10px auto 0;
    border-radius: 2px;
}

.header-dedication {
    margin-top: 20px;
    font-style: italic;
    color: var(--color-faded-ink);
    font-size: 1.15rem;
    line-height: 1.9;
    font-family: 'Cormorant Garamond', Georgia, serif;
}

.header-dedication p {
    margin: 3px 0;
    font-family: 'Cormorant Garamond', Georgia, serif;
}

/* Decorative divider */
.main-header::after {
    content: '✿ ✿ ✿';
    display: block;
    margin-top: 25px;
    color: var(--color-honey);
    font-size: 1.2rem;
    letter-spacing: 15px;
    opacity: 0.7;
}

/* Page Header (for category and recipe pages) */
header {
    text-align: center;
    padding: 40px 20px 20px;
    margin-bottom: 20px;
}

header h1 {
    color: var(--color-berry);
    position: relative;
    display: inline-block;
    text-shadow: 2px 2px 0 rgba(255,255,255,0.8);
}

header h1::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    right: 0;
    height: 3px;
    background: repeating-linear-gradient(
        90deg,
        var(--color-honey),
        var(--color-honey) 8px,
        transparent 8px,
        transparent 16px
    );
}

/* Navigation */
nav {
    margin-bottom: 30px;
}

nav ul {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    list-style: none;
    gap: 10px;
    padding: 0 15px;
}

nav ul li a {
    display: inline-block;
    padding: 10px 20px;
    color: var(--color-faded-ink);
    font-family: 'Caveat', cursive;
    font-size: 1.3rem;
    font-weight: 500;
    border-radius: var(--radius-md);
    background: var(--color-recipe-card);
    border: 2px dashed var(--color-linen);
    box-shadow: var(--shadow-paper);
    transition: all var(--transition-smooth);
}

nav ul li a:hover {
    background: var(--color-berry);
    color: var(--color-cream);
    border-color: var(--color-berry);
    transform: translateY(-3px) rotate(-1deg);
    box-shadow: var(--shadow-card);
}

/* Family Image */
.family-image-container {
    max-width: 420px;
    margin: 0 auto 50px;
    padding: 15px;
    background: var(--color-recipe-card);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-card);
    transform: rotate(-1deg);
    border: 1px solid var(--color-linen);
}

.family-image {
    width: 100%;
    height: auto;
    border-radius: var(--radius-sm);
}

/* Polaroid caption style */
.family-image-container::after {
    content: 'The Wheeler Family 💕';
    display: block;
    text-align: center;
    padding: 15px 10px 5px;
    font-family: 'Caveat', cursive;
    font-size: 1.4rem;
    color: var(--color-faded-ink);
}

/* Category Grid */
.featured-categories {
    padding: 30px 0 50px;
}

.featured-categories h2 {
    text-align: center;
    margin-bottom: 45px;
    color: var(--color-berry);
    position: relative;
}

.featured-categories h2::before,
.featured-categories h2::after {
    content: '~';
    margin: 0 15px;
    color: var(--color-honey);
}

.category-grid, #category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 25px;
    padding: 0 20px;
    max-width: 950px;
    margin: 0 auto;
}

/* Category Cards - Recipe Card Style */
.category-card {
    background: var(--color-recipe-card);
    padding: 30px 25px 25px;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-paper);
    cursor: pointer;
    transition: all var(--transition-smooth);
    position: relative;
    min-height: 170px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    border: 1px solid var(--color-linen);
    /* Lined paper effect */
    background-image: 
        linear-gradient(var(--color-recipe-card) 28px, var(--color-linen) 28px, var(--color-linen) 29px);
    background-size: 100% 29px;
    background-position: 0 25px;
}

/* Red margin line on cards */
.category-card::before {
    content: '';
    position: absolute;
    top: 10px;
    bottom: 10px;
    left: 35px;
    width: 2px;
    background: rgba(196, 69, 54, 0.2);
    border-radius: 1px;
}

/* Corner fold effect */
.category-card::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 0 30px 30px 0;
    border-color: transparent var(--color-aged-paper) transparent transparent;
    border-radius: 0 var(--radius-sm) 0 0;
    transition: border-width var(--transition-smooth);
}

.category-card:hover {
    transform: translateY(-8px) rotate(1deg);
    box-shadow: var(--shadow-lifted);
}

.category-card:hover::after {
    border-width: 0 40px 40px 0;
}

.category-card h3 {
    color: var(--color-berry);
    margin-bottom: 10px;
    text-align: center;
    padding-left: 20px;
    font-size: 1.7rem;
}

.category-card p {
    text-align: center;
    font-size: 0.95rem;
    margin-bottom: 8px;
    padding-left: 20px;
    font-style: italic;
}

.recipe-count {
    display: block;
    background: var(--color-berry);
    color: var(--color-cream);
    padding: 4px 14px;
    border-radius: 15px;
    font-family: 'Caveat', cursive;
    font-size: 1rem;
    font-weight: 600;
    box-shadow: 0 2px 5px rgba(0,0,0,0.15);
    width: fit-content;
    margin: 0 auto 12px;
}

/* Search Container */
.search-container {
    max-width: 450px;
    margin: 0 auto 35px;
    padding: 0 20px;
}

#searchInput {
    width: 100%;
    padding: 14px 20px;
    font-size: 1rem;
    font-family: 'Lora', Georgia, serif;
    border: 2px dashed var(--color-linen);
    border-radius: var(--radius-lg);
    background: var(--color-recipe-card);
    color: var(--color-ink);
    transition: all var(--transition-smooth);
    box-shadow: var(--shadow-paper);
}

#searchInput:focus {
    outline: none;
    border-color: var(--color-honey);
    border-style: solid;
    box-shadow: var(--shadow-card), 0 0 0 3px rgba(212, 165, 83, 0.2);
}

#searchInput::placeholder {
    color: var(--color-pencil);
    opacity: 0.6;
    font-style: italic;
}

/* Recipe List/Grid */
.recipe-list, #recipe-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    padding: 20px;
    max-width: 1100px;
    margin: 0 auto;
}

/* Recipe Cards */
.recipe-card {
    background: var(--color-recipe-card);
    padding: 25px 25px 25px 45px;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-paper);
    cursor: pointer;
    transition: all var(--transition-smooth);
    position: relative;
    border: 1px solid var(--color-linen);
    /* Lined paper effect */
    background-image: 
        linear-gradient(var(--color-recipe-card) 26px, var(--color-linen) 26px, var(--color-linen) 27px);
    background-size: 100% 27px;
    background-position: 0 22px;
}

/* Red margin line */
.recipe-card::before {
    content: '';
    position: absolute;
    top: 8px;
    bottom: 8px;
    left: 32px;
    width: 2px;
    background: rgba(196, 69, 54, 0.2);
}

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

.recipe-card h3 {
    color: var(--color-berry);
    margin-bottom: 12px;
    font-size: 1.5rem;
}

.recipe-card p {
    font-size: 0.92rem;
    line-height: 1.7;
    font-style: italic;
}

/* Single Recipe Page */
.single-recipe {
    max-width: 750px;
    margin: 0 auto;
    padding: 0 20px;
}

.recipe-image {
    text-align: center;
    margin-bottom: 30px;
    padding: 12px;
    background: var(--color-recipe-card);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-card);
    display: inline-block;
    transform: rotate(-1deg);
}

.recipe-photo {
    max-width: 100%;
    height: auto;
    border-radius: var(--radius-sm);
}

.recipe {
    background: var(--color-recipe-card);
    padding: 40px 45px 40px 55px;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-card);
    margin-bottom: 30px;
    position: relative;
    border: 1px solid var(--color-linen);
    /* Lined paper effect */
    background-image: 
        linear-gradient(var(--color-recipe-card) 30px, var(--color-linen) 30px, var(--color-linen) 31px);
    background-size: 100% 31px;
    background-position: 0 35px;
}

/* Red margin line for recipe */
.recipe::before {
    content: '';
    position: absolute;
    top: 15px;
    bottom: 15px;
    left: 40px;
    width: 2px;
    background: rgba(196, 69, 54, 0.25);
}

/* Ring binder holes */
.recipe::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 12px;
    transform: translateY(-50%);
    width: 16px;
    height: 200px;
    background-image: 
        radial-gradient(circle, var(--color-linen) 6px, transparent 6px),
        radial-gradient(circle, var(--color-linen) 6px, transparent 6px),
        radial-gradient(circle, var(--color-linen) 6px, transparent 6px);
    background-size: 16px 60px;
    background-position: 0 0, 0 70px, 0 140px;
    background-repeat: no-repeat;
}

/* Ingredients Section */
.ingredients {
    margin-bottom: 35px;
    padding-bottom: 25px;
    border-bottom: 2px dashed var(--color-linen);
}

.ingredients h3, .instructions h3, .notes h3 {
    color: var(--color-berry);
    margin-bottom: 20px;
    font-size: 1.8rem;
}

.ingredients h3::before {
    content: '🥣 ';
}

.instructions h3::before {
    content: '👩‍🍳 ';
}

.notes h3::before {
    content: '📝 ';
}

.ingredients ul, .notes ul {
    list-style: none;
    padding-left: 0;
}

.ingredients li {
    padding: 6px 0 6px 25px;
    position: relative;
    font-size: 1.02rem;
}

.ingredients li::before {
    content: '✓';
    position: absolute;
    left: 0;
    color: var(--color-olive);
    font-weight: bold;
    font-size: 1rem;
}

/* Instructions Section */
.instructions {
    margin-bottom: 35px;
    padding-bottom: 25px;
    border-bottom: 2px dashed var(--color-linen);
}

.instructions ol {
    padding-left: 0;
    counter-reset: step-counter;
    list-style: none;
}

.instructions li {
    padding: 14px 0 14px 55px;
    position: relative;
    counter-increment: step-counter;
    line-height: 1.8;
}

.instructions li::before {
    content: counter(step-counter);
    position: absolute;
    left: 0;
    top: 12px;
    width: 36px;
    height: 36px;
    background: var(--color-berry);
    color: var(--color-cream);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Caveat', cursive;
    font-weight: 700;
    font-size: 1.3rem;
    box-shadow: 0 2px 5px rgba(0,0,0,0.15);
}

/* Notes Section */
.notes {
    background: linear-gradient(135deg, #FFF9E6, #FFF5D6);
    padding: 25px 30px;
    border-radius: var(--radius-md);
    border: 2px dashed var(--color-honey);
    position: relative;
}

.notes::before {
    content: '📌';
    position: absolute;
    top: -12px;
    left: 20px;
    font-size: 1.5rem;
}

.notes li {
    padding: 8px 0 8px 25px;
    position: relative;
}

.notes li::before {
    content: '♦';
    position: absolute;
    left: 5px;
    color: var(--color-honey);
    font-size: 0.8rem;
}

/* Print Button Container */
.print-button-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin: 35px 0;
    padding: 0 20px;
}

.print-button {
    background: var(--color-berry);
    border: none;
    color: var(--color-cream);
    padding: 14px 30px;
    text-align: center;
    font-family: 'Caveat', cursive;
    font-size: 1.4rem;
    font-weight: 600;
    cursor: pointer;
    border-radius: var(--radius-lg);
    transition: all var(--transition-smooth);
    box-shadow: var(--shadow-paper);
}

.print-button:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-card);
    background: var(--color-wine);
}

.nav-arrow {
    background: var(--color-recipe-card);
    color: var(--color-faded-ink);
    border: 2px dashed var(--color-linen);
    padding: 12px 18px;
    cursor: pointer;
    border-radius: var(--radius-md);
    font-size: 1.2rem;
    transition: all var(--transition-smooth);
    display: none;
}

.nav-arrow:hover {
    background: var(--color-berry);
    color: var(--color-cream);
    border-color: var(--color-berry);
    transform: scale(1.1);
}

@media screen and (min-width: 768px) {
    .nav-arrow {
        display: inline-block;
    }
}

/* Footer */
footer {
    text-align: center;
    padding: 45px 20px;
    margin-top: 50px;
    color: var(--color-pencil);
    font-size: 0.95rem;
    border-top: 3px double var(--color-linen);
    background: linear-gradient(to bottom, transparent, rgba(244, 233, 216, 0.5));
}

footer::before {
    content: '~ Made with love ~';
    display: block;
    font-family: 'Caveat', cursive;
    font-size: 1.4rem;
    color: var(--color-berry);
    margin-bottom: 15px;
}

/* No Results Message */
.no-results {
    text-align: center;
    padding: 50px 20px;
    color: var(--color-pencil);
    font-style: italic;
    font-family: 'Caveat', cursive;
    font-size: 1.5rem;
}

/* Submit CTA Section */
.submit-cta h3 {
    font-family: 'Caveat', cursive;
    color: var(--color-berry);
}

.submit-cta-btn {
    display: inline-block;
    background: var(--color-berry);
    color: var(--color-cream) !important;
    padding: 14px 32px;
    border-radius: var(--radius-lg);
    font-family: 'Caveat', cursive;
    font-size: 1.4rem;
    font-weight: 600;
    text-decoration: none;
    box-shadow: var(--shadow-card);
    transition: all var(--transition-smooth);
}

.submit-cta-btn:hover {
    background: var(--color-wine);
    transform: translateY(-3px);
    box-shadow: var(--shadow-lifted);
}

/* Responsive Design */
@media screen and (max-width: 768px) {
    body::after {
        height: 6px;
    }
    
    .main-header {
        padding: 40px 15px 30px;
    }
    
    .main-header h1::before,
    .main-header h1::after {
        display: none;
    }
    
    .category-grid, #category-grid {
        grid-template-columns: 1fr;
        max-width: 350px;
    }
    
    .recipe-list, #recipe-list {
        grid-template-columns: 1fr;
        padding: 15px;
    }
    
    .recipe {
        padding: 30px 25px 30px 40px;
    }
    
    .recipe::before {
        left: 28px;
    }
    
    .recipe::after {
        display: none;
    }
    
    nav ul {
        gap: 8px;
    }
    
    nav ul li a {
        padding: 8px 16px;
        font-size: 1.15rem;
    }
    
    .family-image-container {
        transform: none;
        max-width: 350px;
    }
}

@media screen and (max-width: 480px) {
    html {
        font-size: 15px;
    }
    
    .main-container {
        padding: 10px;
    }
    
    .recipe {
        padding: 25px 20px 25px 35px;
    }
    
    .recipe::before {
        left: 22px;
    }
    
    .category-card {
        padding: 25px 20px 20px 40px;
    }
    
    .category-card::before {
        left: 28px;
    }
    
    .recipe-card {
        padding: 20px 20px 20px 40px;
    }
    
    .recipe-card::before {
        left: 28px;
    }
    
    .instructions li {
        padding-left: 48px;
    }
    
    .instructions li::before {
        width: 32px;
        height: 32px;
        font-size: 1.1rem;
    }
}

/* Print Styles */
@media print {
    @page {
        margin: 0.4in;
        size: letter;
    }
    
    * {
        box-shadow: none !important;
        text-shadow: none !important;
    }
    
    body {
        background: white !important;
        color: black !important;
        font-size: 10pt;
        line-height: 1.3;
        font-family: Georgia, serif;
    }
    
    body::before,
    body::after {
        display: none !important;
    }
    
    .no-print, nav, .print-button-container, .recipe-image, .single-recipe > .recipe-image {
        display: none !important;
    }
    
    /* Compact Header */
    header {
        padding: 0;
        margin-bottom: 8px;
        border-bottom: 2px solid #333;
        padding-bottom: 5px;
    }
    
    header h1 {
        font-size: 16pt;
        color: black !important;
        margin: 0;
        font-family: Georgia, serif;
    }
    
    header h1::after {
        display: none;
    }
    
    /* Recipe Card Container */
    .single-recipe {
        max-width: 100%;
        padding: 0;
    }
    
    .recipe {
        box-shadow: none !important;
        padding: 0 !important;
        background: none !important;
        background-image: none !important;
        border: none !important;
        display: grid;
        grid-template-columns: 1fr 1.5fr;
        gap: 15px;
    }
    
    .recipe::before,
    .recipe::after {
        display: none !important;
    }
    
    /* Ingredients - Left Column */
    .ingredients {
        margin: 0;
        padding: 10px;
        border: 1px solid #ccc;
        border-radius: 4px;
        page-break-inside: avoid;
        background: #fafafa !important;
    }
    
    .ingredients h3 {
        font-size: 11pt;
        margin-bottom: 6px;
        border-bottom: 1px solid #ddd;
        padding-bottom: 4px;
    }
    
    .ingredients h3::before {
        content: '▪ ' !important;
    }
    
    .ingredients ul {
        margin: 0;
        padding: 0;
    }
    
    .ingredients li {
        padding: 2px 0 2px 15px;
        font-size: 9pt;
        line-height: 1.4;
    }
    
    .ingredients li::before {
        content: '•' !important;
        left: 0;
        font-size: 9pt;
        color: #333 !important;
    }
    
    /* Instructions - Right Column */
    .instructions {
        margin: 0;
        padding: 0;
        border: none;
        page-break-inside: avoid;
    }
    
    .instructions h3 {
        font-size: 11pt;
        margin-bottom: 6px;
        border-bottom: 1px solid #ddd;
        padding-bottom: 4px;
    }
    
    .instructions h3::before {
        content: '▪ ' !important;
    }
    
    .instructions ol {
        margin: 0;
        padding: 0;
    }
    
    .instructions li {
        padding: 3px 0 3px 22px;
        font-size: 9pt;
        line-height: 1.4;
    }
    
    .instructions li::before {
        width: 16px;
        height: 16px;
        font-size: 9pt;
        top: 3px;
        background: #333 !important;
        color: white !important;
        font-family: Georgia, serif;
    }
    
    /* Notes - Full Width Below */
    .notes {
        grid-column: 1 / -1;
        margin-top: 8px;
        padding: 8px 10px;
        background: #f5f5f5 !important;
        border: 1px dashed #999 !important;
        border-radius: 4px;
        page-break-inside: avoid;
    }
    
    .notes::before {
        display: none !important;
    }
    
    .notes h3 {
        font-size: 10pt;
        margin-bottom: 4px;
    }
    
    .notes h3::before {
        content: '💡 ' !important;
    }
    
    .notes li {
        padding: 2px 0 2px 12px;
        font-size: 8pt;
        line-height: 1.4;
    }
    
    .notes li::before {
        content: '→' !important;
        left: 0;
        color: #666 !important;
    }
    
    /* Footer */
    footer {
        margin-top: 10px;
        padding-top: 5px;
        border-top: 1px solid #ccc;
        font-size: 8pt;
        text-align: center;
        page-break-inside: avoid;
    }
    
    footer::before {
        display: none !important;
    }
    
    footer p {
        margin: 2px 0;
    }
}
