﻿/* ===== Layout ===== */
.main-content {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: stretch;  /* make all flex children equal height */
}

.main-content .left-column {
  flex: 1 1 35%;
  min-width: 250px;
  
  display: flex;          /* let children stretch inside */
  flex-direction: column; /* stack content vertically */
}

.main-content .right-column {
  flex: 1 1 60%;
  min-width: 300px;

  display: flex;          /* let children stretch inside */
  flex-direction: column; /* stack content vertically */
  align-items: center;    /* center children horizontally */
}

/* ===== Responsive Design ===== */
@media (max-width: 768px) {
  .main-content {
    flex-direction: column;
  }

  .main-content .left-column,
  .main-content .right-column {
    flex: 1 1 100%;
  }
}

/* ===== Quick Links 區塊 ===== */
.quick-links {
  margin-top: 20px;
  padding: 14px 18px;
  background: #f0f8ff;
  border-left: 6px solid #1e90ff;
  border-radius: 10px;
  font-size: 0.95em;
  color: #0b3d91;
  box-shadow: 0 2px 6px rgba(0,0,0,0.05);
}

.quick-links strong {
  display: block;
  margin-bottom: 8px;
  font-size: 1.05em;
  color: #003366;
}

.quick-links ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.quick-links li {
  margin: 6px 0;
}

.quick-links a {
  text-decoration: none;
  color: #1e90ff;
  transition: all 0.2s ease;
  font-weight: 500;
}

.quick-links a:hover {
  color: #003366;
  text-decoration: underline;
}

/* ===== Recipe 區塊樣式 ===== */
.recipe {
  width: 100%;
  max-width: 1000px;
  margin: 0 2rem;
  padding: 1.5rem;
  background: var(--card-bg);
  border-radius: var(--border-radius);
  box-shadow: var(--box-shadow);
  transition: var(--transition);
}

.recipe h2 {
  margin-top: 0;
  color: var(--primary-color);
  font-size: 1.6em;
  border-bottom: 2px solid var(--light-bg);
  padding-bottom: 0.5rem;
}

.recipe h3 {
  margin-top: 1.2rem;
  color: var(--text-color);
  font-size: 1.2em;
}

.recipe .ingredients ul,
.recipe .steps ol {
  margin: 0.5rem 0 1rem 1.2rem;
  padding: 0;
}

.recipe .ingredients ul li,
.recipe .steps ol li {
  margin: 0.4rem 0;
  line-height: 1.5;
  font-size: 1em;
  color: var(--text-color);
}

.recipe .ingredients ul li::marker {
  color: var(--primary-color); /* 食材清單前紅色小點 */
}

.recipe .steps ol li::marker {
  color: var(--accent-color); /* 步驟編號亮黃色 */
  font-weight: bold;
}

/* Note Box 通用於食譜 */
.recipe .note-box {
  margin-top: 1rem;
  padding: 12px 16px;
  background: var(--light-bg);
  border-left: 6px solid var(--primary-color);
  border-radius: var(--border-radius);
  color: var(--text-color);
  font-size: 0.95em;
  line-height: 1.5;
}

/* ===== Responsive Video Embeds ===== */
.video-wrapper {
  position: relative;
  width: 100%;
  max-width: 800px;   /* contain video on desktop */
  margin: 0 auto;

  aspect-ratio: 16 / 9;  /* replaces padding-bottom hack */
  overflow: hidden;

  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  margin-bottom: 1rem; /* space between stacked videos */
}

.video-wrapper iframe {
  width: 100%;
  height: 100%;
  border: 0;
}

@media (max-width: 768px) {
  .video-wrapper {
    max-width: 100%;  /* full width on mobile */
  }
}


/* ===== Food Content ===== */

  .food-guide {
    width: 100%;
    max-width: 1000px;
    margin: auto;
    background: #fff;
    padding: 20px 24px;
    border-radius: 16px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  }
  .food-guide h2 {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-bottom: 1em;
    font-size: 1.6em;
    color: #333;
  }
  
  
  .food-icon {
    font-size: 1.6em;
  }
  /* 圖例 */
  .legend {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 20px;
    font-size: 0.95em;
  }
  .legend span {
    display: flex;
    align-items: center;
    gap: 6px;
  }
  .legend .box {
    width: 16px;
    height: 16px;
    border-radius: 3px;
    display: inline-block;
  }
  .ok-box { background: #d4f8d4; border: 1px solid #3ba55d; }
  .warn-box { background: #fff3b0; border: 1px solid #e0a800; }
  .avoid-box { background: #f8d4d4; border: 1px solid #c53030; }

  /* 分類清單 */
  .food-guide h3 {
    margin-top: 1.4em;
    font-size: 1.2em;
    color: #444;
    border-left: 6px solid #999;
    padding-left: 8px;
  }
    
.food-guide ul {
  list-style: none;
  padding-left: 0;
}

.food-guide li {
  padding: 6px 8px;
  margin: 4px 0;
  border-radius: 6px;
  font-size: 0.95em;
}

/* 狀態分類 */
.food-guide li.ok {
  background: #e6f8ec;
  border-left: 5px solid #28a745;
}

.food-guide li.warn {
  background: #fffbe6;
  border-left: 5px solid #f0ad4e;
}

.food-guide li.avoid {
  background: #fdecea;
  border-left: 5px solid #d9534f;
}
  
  
  .note-box {
    margin-top: 12px;
    padding: 12px 16px;
    background: #e8f4fd;
    border-left: 6px solid #2980b9;
    border-radius: 10px;
    color: #1b4f72;
    font-size: 0.95em;
    line-height: 1.5;
  }
  
	/* Shared styles for principle, tips */
	.principle, .tips {
	  margin: 20px 0;
	  padding: 16px 20px;
	  border-radius: 10px;
	}
	
	/* Specific styles */
	.tips {
	  background: #f3f9e8;
	  border-left: 6px solid #7cb518;
	}
	
	.principle {
	  background: #f0fff4;
	  border-left: 6px solid #28a745;
	}
  
  .principle h3 {
    margin: 0 0 10px;
    font-size: 1.2em;
    color: #155724;
  }
  .principle ul {
    margin: 0;
    padding-left: 20px;
  }
  
  
  
/* ===== 營養分析區塊 ===== */
.recipe {
  width: 100%;
  max-width: 1000px;
  background: var(--card-bg);
  padding: 20px;
  border-radius: var(--border-radius);
  box-shadow: var(--box-shadow);
  margin: 1.5rem auto;
}

.recipe h2 {
  text-align: center;
  margin-bottom: 1rem;
  color: var(--primary-color);
}

.recipe h3 {
  margin-top: 1.2rem;
  color: var(--primary-color);
}

.recipe ul, 
.recipe ol {
  margin: 0.5rem 0 0 1.2rem;
  padding: 0;
}

.recipe li {
  margin: 0.4rem 0;
}

.recipe .nutrition {
  margin-top: 1.5rem;
  padding: 14px 18px;
  background: var(--light-bg);
  border-left: 6px solid var(--accent-color);
  border-radius: var(--border-radius);
  box-shadow: var(--box-shadow);
  color: var(--text-color);
  font-size: 0.95em;
  line-height: 1.6;
}

/* 表格樣式 */
.food-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 10px;
  font-size: 0.95em;
}

.food-table th,
.food-table td {
  padding: 8px;
  border: 1px solid #ccc;
  text-align: left;
}

.food-table thead th {
  background: #f0f0f0;
}
  


/* START hamburger menu */
/* Mobile First Styles */
.hamburger-menu {
  position: relative;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background-color: var(--primary-color);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  margin: 15px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
  z-index: 1001;
}

.hamburger-menu:hover {
  background-color: #b35959;
  transform: scale(1.05);
}

.hamburger-menu .line {
  width: 20px;
  height: 2px;
  background-color: white;
  margin: 2px 0;
  transition: all 0.3s ease;
  border-radius: 2px;
}

.food-sidebar {
  display: none;
  background-color: var(--primary-color);
  padding: 1.5rem;
  box-shadow: 3px 0 10px rgba(0,0,0,0.1);
  height: 100vh;
  overflow-y: auto;
}


.sidebar-header {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.5rem 0.6rem;
  margin-bottom: 1.2rem;
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--primary-color);
  border-bottom: 2px solid rgba(0,51,102,0.15);
}

.sidebar-header .logo {
  font-size: 1.5rem;
}

.sidebar-header .title {
  letter-spacing: 1px;
}

/* Desktop styling */
@media (min-width: 768px) {
  .sidebar-header {
    color: #fff;
    border-bottom: 2px solid rgba(255,255,255,0.2);
  }
}


.food-sidebar ul {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  padding: 0;
  margin: 0;
  list-style: none;
}

.food-sidebar li {
  transition: all 0.3s ease;
  border-radius: 8px;
  overflow: hidden;
}

.food-sidebar a {
  display: flex;
  align-items: center;
  padding: 1rem 1.5rem;
  text-decoration: none;
  color: #CC6666;
  font-family: 'Arial', sans-serif;
  font-weight: 500;
  transition: all 0.3s ease;
  background: rgba(255,255,255,0.9);
  border-radius: 8px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.05);
  border: 1px solid rgba(204,102,102,0.2);
}

.food-sidebar a:hover {
  background: #C71585;
  color: white;
  transform: translateX(8px);
  box-shadow: 0 4px 15px rgba(204,102,102,0.3);
}

.food-sidebar a:active {
  transform: translateX(4px);
  background: #b35959;
}

.food-sidebar li.selected a {
  color: white;
  background-color: #800000;
  /* Optional: add subtle transition */
  transition: all 0.2s ease;
}

/* Mobile styles */
@media (max-width: 767px) {
  .food-sidebar {
    width: 100%;
    position: absolute;
    top: 60px;
    left: -100%;
    transition: all 0.3s ease;
    z-index: 1000;
    background: #fff;
  }
  
  .active .food-sidebar {
	display: block;
	left: 0;
  }
  
  .hamburger-menu span {
    left: calc(100% + 15px);
    right: auto;
  }
}

/* Desktop Styles */
@media (min-width: 768px) {
  .hamburger-menu {
    display: none;
  } 
  
  .food-sidebar {
    display: block;
    width: 250px;
    position: absolute;
    left: 0;
    top: 0;
    background: var(--primary-color);
  }
  
  .cssMeal {
    margin-left: 250px; /* Offset main content by sidebar width */
    max-width: calc(100% - 250px);
  }

}

/* Hamburger Animation */
.active .line {
  background-color: rgba(0, 0, 0, 0.8);
}

.active .line-1 {
  transform: rotate(45deg) translate(5px, 5px);
}

.active .line-2 {
  opacity: 0;
  visibility: hidden;
}

.active .line-3 {
  transform: rotate(-45deg) translate(5px, -5px);
}

.hamburger-menu span {
  position: absolute;
  left: 5rem;
  background-color: #e2b646;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 0.8rem 1.2rem;
  color: #fff;
  font-family: "Baloo Da 2", serif;
  font-size: 1.2rem;
  border-radius: 4px;
  opacity: 0;
  visibility: hidden;
  transition: all 0.2s;
  white-space: nowrap;
}

.active .hamburger-menu:hover span {
  opacity: 1;
  visibility: visible;
}

.hamburger-menu span::before {
  content: "";
  position: absolute;
  left: -8px;
  border-width: 8px 8px 8px 0;
  border-style: solid;
  border-color: transparent #e2b646 transparent transparent;
}
/* END hamburger menu */

.food-sidebar-header {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 1rem 1.2rem;
  margin-bottom: 1.2rem;
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--primary-color);
  border-bottom: 2px solid rgba(0,51,102,0.15);
}

.food-sidebar-header .logo {
  font-size: 1.5rem;
}

.food-sidebar-header .title {
  letter-spacing: 1px;
}

/* Desktop styling */
@media (min-width: 768px) {
  .food-sidebar-header {
    color: #fff;
    border-bottom: 2px solid rgba(255,255,255,0.2);
  }
}

/* END hamburger menu */  