/* ==========================================================================
   1. CSS VARIABLES
   ========================================================================== */
:root {
	/* --- LIGHT MODE (DEFAULT) --- */
	--header-bg: #072c40;      
	--header-text: #FFFFFF;
	--page-bg: #f2f2ed;         
	--text-main: #1c2024;
	--text-muted: #8a95a0;
	--sidebar-bg: #1A1A1A;      
	--sidebar-text: #EBEBEB;
	--accent-color: #ff5740;
	--caption-light: #F3F4F6;
	--caption-dark: #4a5568;

	/* --- TYPOGRAPHY ENGINE --- */
	--font-sg: "Segoe Pro", "Segoe UI", -apple-system, BlinkMacSystemFont, Roboto, Helvetica, Arial, sans-serif;
	--font-sgp: "Segoe Print", "Comic Sans MS", cursive, sans-serif;
	--font-at: "American Typewriter", "Courier New", Courier, Rockwell, slab-serif;
	--font-bh: "Bradley Hand", "Marker Felt", "Comic Sans MS", cursive;
	--font-uc: "Univers Condensed", "Arial Narrow", Arial, sans-serif;
	--font-uv: "Univers", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	--font-sp: "SignPainter", "Marker Felt", "Comic Sans MS", cursive;	
}

/* --- AUTOMATIC DARK MODE CONJURING --- */
@media (prefers-color-scheme: dark) {
	:root {
		/* Deep oceanic midnight blue instead of pitch black for a premium look */
		--header-bg: #0a151d;      
		--header-text: #e2e8f0;

		/* The main canvas turns into a beautiful dark graphite slate */
		--page-bg: #12161a;         
		
		/* Text shifts to a soft, highly readable silver-white */
		--text-main: #e2e8f0;
		
		/* Muted text drops back so it doesn't compete with main headings */
		--text-muted: #718096;
		
		/* Sidebar stays dark, but slightly lifted to separate it from the page background */
		--sidebar-bg: #1a1f26;      
		--sidebar-text: #cbd5e1;
		
		/* Keeping your vivid orange accent, but shifting it slightly for dark-mode harmony */
		--accent-color: #ff6b57;
		
		/* Captions shift to match the inverted contrast requirements */
		--caption-light: #2d3748;
		--caption-dark: #a0aec0;
		
		/* Note: Fonts don't change between dark/light mode, so we don't repeat them here! */
	}
}
/* ==========================================================================
   2. MODERN HYBRID RESET & ENVIRONMENT SETTING
   ========================================================================== */
*, *::before, *::after {
  box-sizing: border-box;
}
html {
	color-scheme: light dark;
	-webkit-font-smoothing: antialiased;
	hanging-punctuation: first allow-end last;
	-webkit-text-size-adjust: 100%;
	text-size-adjust: 100%;
	font-size: 100%; 
}
@media (max-width: 768px) {
    html {
        font-size: 90%;
    }
}
@media (max-width: 480px) {
    html {
        font-size: 85%;
    }
}
body {
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	background-color: var(--page-bg);
	color: var(--text-main);
	display: flex;
	flex-direction: column;
	min-height: 100vh;
	overflow-y: auto;
	margin: 0;
	padding: 0;
	transition: background-color 0.3s ease, color 0.3s ease;
}
h1 {
    font-size: clamp(1.8rem, 4vw + 1rem, 3.5rem);
}
h2 {
    font-size: clamp(1.4rem, 3vw + 0.5rem, 2.2rem);
}
/* --- HEADER --- */
header {
	background-color: var(--header-bg);
	color: var(--header-text);
	height: 70px;
	display: flex;
	align-items: center;
	padding: 0 20px;
	position: relative;
	z-index: 10;
	box-shadow: 0 2px 5px rgba(0,0,0,0.15);
}
header img {
	display: inline-block;
	max-height: 50px;
	margin-left: 15px;
}
.menu-btn {
	background: none;
	border: none;
	color: var(--header-text);
	font-size: 24px;
	cursor: pointer;
	display: flex;
	align-items: center;
}
/* --- MAIN CONTENT WINDOW --- */
main {
	flex: 1;
	padding: 40px 20px;
	max-width: 1400px;
	width: 100%;
	margin: 0 auto; 
	line-height: 1.6;
}
/* --- FOOTER --- */
footer {
	position: sticky;
	bottom: 0;
	background-color: var(--page-bg); 
	height: 60px;
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding: 0 30px;
	border-top: 1px solid rgba(0,0,0,0.05); 
	z-index: 1020;
	justify-content: center;
    gap: 20px;
}
footer img {
	width: 30px;
}
/* --- Nav Arrows --- */
.nav-arrow {
	background: none;
	border: none;
	font-size: 28px;
	color: var(--text-main);
	cursor: pointer;
	padding: 10px;
	transition: color 0.2s;
}
.nav-arrow:hover {
	color: var(--accent-color);
}
/* --- SIDEBAR OVERLAY --- */
.sidebar {
	position: fixed;
	top: 0;
	left: -100%; 
	width: 85%;
	max-width: 360px;
	height: 100%;
	background-color: var(--sidebar-bg);
	color: var(--sidebar-text);
	z-index: 20;
	transition: left 0.3s ease;
	box-shadow: 5px 0 15px rgba(0,0,0,0.3);
	display: flex;
	flex-direction: column;
}
.sidebar.open {
	left: 0;
}
.sidebar-header {
	padding: 20px;
	border-bottom: 1px solid #333;
	display: flex;
	justify-content: space-between;
	align-items: center;
}
.close-btn {
	background: none;
	border: none;
	color: var(--sidebar-text);
	font-size: 24px;
	cursor: pointer;
}
.toc-container {
    flex: 1;
    overflow-y: auto; 
    padding: 20px 0 80px 0; 
}
/* --- ACCORDION & MENU TYPOGRAPHY --- */
.menu-link-wrapper {
    display: block;
    width: 100%;
    clear: both;
    position: relative;
    z-index: 5;
}
.menu-item-link {
    display: block;
    padding: 15px 20px;
    color: var(--sidebar-text);
    text-decoration: none;
    font-size: 1rem;
    border-bottom: 1px solid #262626;
    cursor: pointer;
    text-transform: none;
}
.chapter-trigger {
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding: 15px 20px;
	font-size: 1rem;
	border-bottom: 1px solid #262626;
	cursor: pointer;
	user-select: none;
}
.chapter-trigger::after {
	content: '►';
	font-size: 0.8rem;
	color: #666;
	transition: transform 0.2s;
}
.chapter-wrapper.active .chapter-trigger::after {
	transform: rotate(90deg);
	color: var(--accent-color);
}
.recipe-list {
	max-height: 0;
	overflow: hidden;
	background-color: #111; 
	transition: max-height 0.25s ease-out;
}
.chapter-wrapper.active .recipe-list {
	max-height: 500px; 
	overflow-y: auto;
}
.recipe-item {
	display: block;
	padding: 12px 20px 12px 35px; 
	color: var(--text-muted);
	text-decoration: none;
	font-size: 0.9rem;
	border-bottom: 1px solid #1C1C1C;
	cursor: pointer;
}
.recipe-item:hover, .menu-item-link:hover {
	color: var(--accent-color);
	background-color: #222;
}
/* --- MAIN CONTENT --- */
.primary-layout {
	max-width: 1200px;
	margin: 0 auto;
	display: grid;
	grid-template-columns: 1fr;
	gap: 30px;
}
.left-page-content {
	line-height: 1.6;
	font-size: 1.05rem;
}
.page-title h1 {
	margin-bottom: 10px;
	color: var(--header-bg);
	font-family: var(--font-sgp);
	font-size: 2.6rem;
	font-weight: 300;
	letter-spacing: 1px;
	text-transform: uppercase;
	margin: 0;
}
/* 📱 Mobile Specific Rules for Inside Recipe Titles */
@media (max-width: 576px) {
    
    /* 1. Break the horizontal row and stack elements vertically */
    .page-title.d-flex {
        flex-direction: column !important; /* Overrides Bootstrap's horizontal flex default */
        align-items: center !important;
        text-align: center;
        margin-bottom: 2rem !important; /* Pulls the margin back slightly for mobile screens */
    }

    /* 2. Style the Flag as a top-centered crown accent */
    .page-title .flag {
        margin-right: 0 !important;   /* Strips out the desktop right margin (me-3) */
        margin-bottom: 12px !important; /* Adds breathing room directly below the flag */
        max-width: 50px;              /* Keeps the flag elegantly sized on mobile */
        height: auto;
    }

    /* 3. Give the Title 100% of the horizontal real estate */
    .page-title h1 {
        font-size: clamp(1.8rem, 5vw + 0.5rem, 2.5rem); /* Keeps the typography fluid and clean */
        width: 100%;
        line-height: 1.2;
    }
}
.intro-text p {
	margin-bottom: 15px;
	text-align: justify;
	font-family: var(--font-at);
}
.right-page-photo {
    background-color: #2e2e2e;
    border-radius: 4px;
    padding: 20px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}
.caption-light {
    color: var(--caption-light);
    font-family: var(--font-bh);
    margin-top: 12px;
    font-size: 1rem;
    font-style: italic;
}
.caption-dark {
    color: var(--caption-dark);
    font-family: var(--font-bh);
    margin-top: 12px;
    font-size: 1rem;
    font-style: italic;
} 
/* --- Recipe --- */
.ingredients-block h3 {
	font-family: var(--font-sg);
	color: #6B5B24;
	font-weight: 700;
	font-size: 1.2rem;
	margin-bottom: 2px;
}
.ingredients-block .yield {
	font-family: var(--font-sg);
	font-style: italic;
	font-size: 0.9rem;
	color: #666;
	margin-bottom: 12px;
}
.ingredients-block ul {
	list-style-type: none;
}
.ingredients-block li {
	font-family: var(--font-uc);
	font-weight: 400;
	font-size: 0.95rem;
	line-height: 1.4;
	margin-bottom: 8px;
	text-indent: -10px;
}
.ingredients-block li::before {
	content: "• ";
	color: #6B5B24;
}        
.history-photo-box {
    margin-top: 25px;
    width: 100%;
    font-size: 0.85rem;
    line-height: 1.2;
}
.history-photo-box .history-img {
    width: 90%;
    background-color: #ddd;
    border: 1px solid #bbb;
    margin-bottom: 5px;
    overflow: hidden;
}
@media screen and (max-width: 450px) {
	.history-photo-box .history-img {
		width: 100%;
    }
}
.history-photo-box .history-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}      
.steps-block {
	font-family: var(--font-uv);
	font-style: italic;
	font-size: 1.05rem;
	line-height: 1.6;
}
.steps-block p {
	margin-bottom: 18px;
	text-align: left;
}       
/* --- FLAGS --- */			
.flag {
	width: 45px;
	height: 27px;
	box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}			
  
