/* style.css - Corrected Styles for Basic Loaf (Burger Visibility Fix v3) */

/* Import Google Font: Inter */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;700&display=swap');

/* Define Refined Color Palette & Fonts */
:root {
    --font-main: 'Inter', sans-serif;
    --bg-color: #f9f9f9;        /* Very light grey background */
    --content-bg: #ffffff;     /* White for content boxes */
    --text-color: #333333;     /* Dark charcoal text */
    --heading-color: #202020;  /* Very dark grey/black for headings */
    --accent-color: #b07d62;    /* Muted terracotta/rust accent */
    --secondary-color: #757575; /* Medium grey for secondary text */
    --border-color: #e0e0e0;     /* Light grey for borders */
    --link-color: #a06d52;      /* Link color derived from accent */
    --link-hover-color: var(--accent-color);
    --button-text-color: #ffffff;
}

/* Basic Reset & Defaults */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth; /* Smooth scrolling for jump links */
}

body {
    font-family: var(--font-main);
    font-weight: 400; /* Regular weight */
    line-height: 1.75; /* Increased for readability */
    color: var(--text-color);
    background-color: var(--bg-color);
    padding: 20px;
    -webkit-font-smoothing: antialiased; /* Smoother fonts on Mac */
    -moz-osx-font-smoothing: grayscale; /* Smoother fonts on Firefox */
}

/* Limit content width and center it - Increased width */
header, main, footer {
    max-width: 900px; /* Wider for more whitespace */
    margin: 30px auto;
    padding: 35px 45px; /* More generous padding */
    background-color: var(--content-bg);
    border-radius: 10px; /* Slightly larger radius */
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.07); /* Refined shadow */
}

/* Headings - Using Inter */
h1, h2, h3, h4 {
    font-family: var(--font-main); /* Use Inter */
    margin-bottom: 0.7em;
    line-height: 1.3;
    color: var(--heading-color);
    font-weight: 700; /* Bold weight for headings */
}

h1 {
    font-size: 2.6em; /* Slightly adjusted */
    text-align: center;
    margin-bottom: 0.3em;
    letter-spacing: -0.5px; /* Subtle tightening */
}

header h1 + p { /* Tagline */
    text-align: center;
    color: var(--secondary-color);
    margin-top: 0em; /* Closer to H1 */
    margin-bottom: 2.5em; /* More space below tagline */
    font-size: 1.1em;
    font-weight: 400;
}

h2 {
    font-size: 2.1em; /* Adjusted */
    border-bottom: 1px solid var(--border-color); /* Thinner border */
    padding-bottom: 0.5em;
    margin-top: 2em; /* Consistent top margin */
    font-weight: 700;
    letter-spacing: -0.3px;
}

main > *:first-child, main > section:first-child > *:first-child {
 margin-top: 0; /* Remove top margin from first element/heading in main */
}

h3 {
    font-size: 1.6em; /* Adjusted */
    color: var(--heading-color);
    margin-top: 2.5em; /* More space above H3 */
    font-weight: 700;
}

h4 {
    font-size: 1.25em; /* Adjusted */
    margin-top: 2em;
    color: var(--heading-color); /* Use main heading color */
    font-weight: 500; /* Medium weight */
    letter-spacing: 0.2px;
}

/* Paragraphs */
p {
    margin-bottom: 1.4em; /* Consistent paragraph spacing */
}

/* Links */
a {
    color: var(--link-color);
    text-decoration: none;
    transition: color 0.2s ease-in-out;
}

a:hover {
    color: var(--link-hover-color);
    text-decoration: underline; /* Add underline on hover for clarity */
}

/* Horizontal Rule */
hr {
    border: none;
    border-top: 1px solid var(--border-color);
    margin: 3em 0; /* Generous spacing around separators */
}


/* --- Header, Navigation & Hamburger Menu --- */

header {
    position: relative;
    padding-bottom: 15px; /* Adjust padding */
}

/* Hamburger Menu Button */
#menu-toggle {
    display: none; /* <<<< HIDDEN BY DEFAULT ON DESKTOP */
    background: none;
    border: none;
    font-size: 2em;
    cursor: pointer;
    position: absolute;
    top: 30px; /* Position relative to header padding */
    right: 35px; /* Position relative to header padding */
    z-index: 1001;
    color: var(--heading-color);
    padding: 5px;
    line-height: 1;
}

/* Desktop Navigation */
nav#main-nav {
    margin-top: 1.5em; /* Space above nav */
}

nav#main-nav ul#main-nav-list {
    list-style: none;
    text-align: center;
    padding-bottom: 0;
    border-bottom: none;
    margin-bottom: 0;
}

nav#main-nav li {
    display: inline-block;
    margin: 0 10px; /* Spacing between items */
}

nav#main-nav a {
    padding: 8px 10px; /* Padding inside links */
    border-radius: 5px;
    transition: background-color 0.2s ease-in-out, color 0.2s ease-in-out;
    font-family: var(--font-main); /* Use Inter */
    font-weight: 500; /* Medium weight */
    color: var(--secondary-color);
    font-size: 0.95em; /* Adjusted */
    letter-spacing: 0.3px; /* Slight spacing */
}

nav#main-nav a:hover {
    background-color: transparent; /* No background on hover */
    color: var(--link-hover-color); /* Use accent for hover */
    text-decoration: none;
}

/* Desktop Active link style */
nav#main-nav a.active {
    background-color: transparent;
    color: var(--accent-color); /* Use accent color for active */
    font-weight: 700; /* Bold active link */
    border-bottom: 2px solid var(--accent-color); /* Underline effect */
    padding-bottom: 6px; /* Adjust padding for border */
}
nav#main-nav a.active:hover {
     color: var(--accent-color);
}

/* Mobile Menu - Triggered by adding .menu-open class to nav#main-nav */
nav#main-nav.menu-open ul#main-nav-list {
    display: block; /* This rule shows the list when .menu-open is added by JS */
    position: absolute;
    top: 100%; /* Position below the header area */
    left: 0;
    right: 0; /* Ensure it spans width */
    width: calc(100% - 60px); /* Adjust width considering parent padding */
    max-width: 900px; /* Match container width */
    margin: 0 auto; /* Center */
    background-color: var(--content-bg);
    box-shadow: 0 6px 12px rgba(0,0,0,0.1);
    padding: 10px 0;
    z-index: 1000;
    border-radius: 0 0 8px 8px; /* Rounded bottom corners */
    border-top: 1px solid var(--border-color);
}


/* --- Main Content Sections --- */

article section {
    margin-bottom: 3.5em; /* More space between sections */
}

/* Ingredients List */
#ingredients ul {
    list-style: none;
    margin-left: 0; /* Remove default indent */
    margin-bottom: 1.5em;
}

#ingredients li {
    margin-bottom: 0.9em;
    padding-left: 1.8em; /* Space for custom bullet */
    position: relative;
}

#ingredients li::before {
    content: ''; /* Use empty content */
    background-color: var(--accent-color);
    width: 6px; /* Small square/circle */
    height: 6px;
    border-radius: 50%; /* Make it a circle */
    display: inline-block;
    position: absolute;
    left: 0;
    top: 0.6em; /* Adjust vertical alignment */
}


/* Method List (Ordered Steps) */
#method ol {
    list-style: none;
    counter-reset: step-counter;
    margin-left: 0; /* Remove default indent */
}

#method li {
    counter-increment: step-counter;
    margin-bottom: 2.5em; /* More space between steps */
    padding-left: 3.5em; /* Space for custom number */
    position: relative;
}

#method li::before {
    content: counter(step-counter);
    position: absolute;
    left: 0;
    top: -3px;
    background-color: var(--bg-color); /* Match body background */
    color: var(--accent-color);
    width: 2.2em;
    height: 2.2em;
    border-radius: 50%;
    border: 1px solid var(--border-color); /* Subtle border */
    display: inline-block;
    text-align: center;
    line-height: 2.1em; /* Adjust for border */
    font-weight: 700; /* Bold number */
    font-size: 0.9em; /* Slightly smaller number */
    font-family: var(--font-main);
}

#method li strong {
    font-weight: 700;
    color: var(--heading-color);
    display: block; /* Make title block */
    margin-bottom: 0.3em;
}

#method li p {
    margin-top: 0.5em;
    margin-bottom: 0.5em;
    font-size: 1em;
    color: var(--text-color);
}

/* --- Recipe Quick Overview Box --- */
#method-summary {
    background-color: var(--bg-color); /* Match body background */
    padding: 25px; /* More padding */
    border-radius: 8px;
    margin-bottom: 3em;
    border: 1px solid var(--border-color);
}
#method-summary h4 {
    margin-top: 0;
    margin-bottom: 1em;
    color: var(--heading-color);
    font-size: 1.3em;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.5em;
}
#method-summary ul {
    list-style: none;
    padding-left: 0;
    list-style-type: none; /* Be extra explicit */
}

/* Updated rule for summary list items (using Flexbox, no bullet) */
#method-summary li {
    display: flex; /* Keep Flexbox */
    /* align-items: flex-start; */ /* Alignment less critical */
    /* gap: 0.6em; */ /* REMOVED gap */
    margin-bottom: 1em; /* Use consistent vertical spacing */
    font-size: 0.95em;
    /* Removed position: relative; padding-left */
}

/* Updated rule for summary list item bullets (content removed) */
#method-summary li::before {
    content: ''; /* REMOVED content */
    /* Removed other properties */
}

/* Rule for the content wrapper inside the li */
.summary-content {
    flex-grow: 1; /* Allow text content to take remaining space */
}

/* Rules for paragraphs inside the li */
#method-summary li p {
    margin-top: 0;
    margin-bottom: 0.2em;
}
#method-summary li p:last-child {
    margin-bottom: 0;
}
/* --- End of Recipe Quick Overview Box Styles --- */


/* Notes / Aside */
aside {
    background-color: var(--bg-color);
    padding: 25px;
    border-radius: 8px;
    font-size: 0.95em;
    margin-top: 2em;
    border: 1px solid var(--border-color);
    border-left: 4px solid var(--accent-color); /* Use accent color */
    line-height: 1.7;
}

aside h4 {
    margin-top: 0;
    margin-bottom: 0.7em;
    font-size: 1.15em;
    color: var(--heading-color);
}

aside p {
    margin-bottom: 0.6em;
}
aside p:last-child {
    margin-bottom: 0;
}

/* Recipe Scaler Input Area */
#recipe-scaler-ui {
    background-color: transparent; /* Remove background */
    padding: 10px 0; /* Adjust padding */
    margin-bottom: 1.5em;
    border-radius: 0;
    display: block; /* Make it block */
    border: none;
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
}
#recipe-scaler-ui label {
    margin-right: 10px;
    font-weight: 500; /* Medium weight */
    color: var(--heading-color);
}
#recipe-scaler-ui input[type="number"] {
    width: 75px; /* Slightly wider */
    padding: 10px; /* More padding */
    border: 1px solid var(--border-color);
    border-radius: 5px;
    font-size: 1em;
    font-family: var(--font-main);
}


/* Call to Action Buttons */
.button {
    display: inline-block;
    padding: 14px 30px; /* Increased padding */
    margin: 10px 5px;
    border: 1px solid transparent; /* Start with transparent border */
    border-radius: 6px;
    text-decoration: none;
    color: var(--button-text-color);
    background-color: var(--accent-color); /* Use accent color */
    cursor: pointer;
    text-align: center;
    font-family: var(--font-main); /* Use main font */
    font-weight: 500; /* Medium weight */
    font-size: 1em;
    letter-spacing: 0.5px; /* Slight spacing */
    transition: all 0.2s ease-in-out; /* Smooth transition */
}

.button:hover {
    text-decoration: none;
    color: var(--button-text-color);
    background-color: #966b54; /* Darker accent */
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.button.primary { /* Already using accent */
     background-color: var(--accent-color);
}
.button.primary:hover {
    background-color: #966b54; /* Darker accent */
}

.button.secondary {
    background-color: var(--heading-color); /* Use dark heading color */
    color: var(--content-bg); /* White text */
}
.button.secondary:hover {
    background-color: #000000; /* Black on hover */
     color: var(--content-bg);
}

.button.disabled {
    background-color: var(--border-color);
    color: var(--secondary-color);
    cursor: not-allowed;
    opacity: 0.8;
    transform: none;
    box-shadow: none;
}


/* Footer */
footer {
    text-align: center;
    margin-top: 50px; /* More space above footer */
    padding: 30px;
    border-top: 1px solid var(--border-color);
    font-size: 0.9em;
    color: var(--secondary-color);
    background-color: var(--bg-color);
    box-shadow: none;
}

footer p {
    margin-bottom: 0.5em;
}
footer a {
    color: var(--secondary-color);
}
footer a:hover {
    color: var(--accent-color);
}


/* Image Styling (Uncomment when adding images) */

img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 2em auto;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.07);
}

/* --- Responsive Adjustments & Mobile Menu --- */

@media (max-width: 768px) {
     header, main, footer {
        padding: 25px 25px; /* Adjust padding */
    }
     h1 { font-size: 2.2em; }
     h2 { font-size: 1.9em; }
     h3 { font-size: 1.5em; }
     h4 { font-size: 1.2em; }

    /* Hamburger Menu Activation */
    #menu-toggle {
        display: block; /* <<<< THIS RULE MAKES THE BUTTON VISIBLE ON MOBILE */
        top: 30px; /* Adjust position if needed */
        right: 25px; /* Adjust position if needed */
    }

    nav#main-nav ul#main-nav-list {
        display: none; /* Hide desktop nav list by default */
    }

    /* Mobile menu list item styling (when open) */
    nav#main-nav.menu-open ul#main-nav-list li {
        display: block;
        margin: 0;
        text-align: left; /* Align left on mobile */
        border-bottom: 1px solid var(--border-color);
    }
     nav#main-nav.menu-open ul#main-nav-list li:last-child {
        border-bottom: none;
    }

    /* Mobile menu link styling (when open) */
     nav#main-nav.menu-open ul#main-nav-list a {
        display: block;
        padding: 15px 25px; /* Adjust padding */
        color: var(--heading-color);
        font-size: 1.05em;
        font-weight: 500;
        /* Reset desktop styles if needed */
        background-color: transparent;
        border-bottom: none;
        padding-bottom: 15px;
    }
     nav#main-nav.menu-open ul#main-nav-list a:hover {
        background-color: var(--bg-color); /* Use body bg for hover */
     }
     nav#main-nav.menu-open ul#main-nav-list a.active {
        background-color: var(--accent-color);
        color: #fff;
     }
     nav#main-nav.menu-open ul#main-nav-list a.active:hover {
        background-color: #966b54; /* Darker accent */
     }

     /* Reset desktop nav wrapper styles */
     nav#main-nav ul { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }

} /* End of @media (max-width: 768px) */


@media (max-width: 600px) {
    body {
        padding: 10px;
        font-size: 16px; /* Ensure readable base font */
        line-height: 1.7;
    }
    header, main, footer {
        padding: 20px 15px; /* Adjust padding */
        margin: 15px auto;
        border-radius: 8px;
    }
    h1 { font-size: 2em; }
    h2 { font-size: 1.7em; }
    h3 { font-size: 1.4em; }
    h4 { font-size: 1.15em; }

    #menu-toggle {
        top: 22px; /* Adjust */
        right: 15px;
        font-size: 1.9em;
    }

     nav#main-nav.menu-open ul#main-nav-list a {
         padding: 12px 20px;
         font-size: 1em;
     }

    #method li {
        padding-left: 3em; /* Adjust for number */
    }
    #method li::before {
        width: 2em; /* Adjust number size */
        height: 2em;
        line-height: 1.9em; /* Adjust */
        font-size: 0.9em;
        top: 0;
    }

    /* Adjust summary list on small screens if needed */
    #method-summary li {
        font-size: 0.9em; /* Slightly smaller text */
        margin-bottom: 0.8em;
    }

    .button {
        padding: 12px 20px;
        font-size: 1em;
        display: block;
        width: 100%;
        max-width: none; /* Allow full width */
    }
} /* End of @media (max-width: 600px) */
/* --- Accessibility Helper --- */
/* Class to visually hide content while keeping it accessible to screen readers */
.visually-hidden {
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    height: 1px;
    overflow: hidden;
    position: absolute;
    white-space: nowrap;
    width: 1px;
  }
  /* --- End Accessibility Helper --- */
