/* ===============================
   Cookbook Variables
   =============================== */
:root {
  --bg-color-light: #e6e6e6;
  --text-color-light: #333333;
  --link-color-light: #7872f7;
  --bg-color-dark: #333333;
  --text-color-dark: #e6e6e6;
  --link-color-dark: #7872f7;
}

/* ===============================
   Base
   =============================== */
* { box-sizing: border-box; }

body {
  font-family: 'Crimson Text', serif;
  margin: 0;
  padding: 0 clamp(10%, 30.77vw - 103.85px, 25%);
  background-color: var(--bg-color-light);
  color: var(--text-color-light);
  transition: background-color 0.3s ease, color 0.3s ease;
}

body.dark-mode {
  background-color: var(--bg-color-dark);
  color: var(--text-color-dark);
}

/* ===============================
   Cookbook Header
   =============================== */
.cookbook-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 0 10px 0;
}

.cookbook-header h1 {
  font-size: 2rem;
  font-weight: 700;
  margin: 0;
}

/* ===============================
   Dark Mode Toggle (matches main site)
   =============================== */
#mode-toggle {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.toggle-icon {
  display: inline-block;
  width: 2rem;
  height: 2rem;
  -webkit-mask-size: contain;
  mask-size: contain;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-position: center;
  mask-position: center;
  transition: background-color 0.3s ease;
}

body:not(.dark-mode) .toggle-icon {
  background-color: var(--text-color-light);
  -webkit-mask-image: url('/assets/images/svg/sun2.png');
  mask-image: url('/assets/images/svg/sun2.png');
}

body.dark-mode .toggle-icon {
  background-color: var(--text-color-dark);
  -webkit-mask-image: url('/assets/images/svg/moon2.png');
  mask-image: url('/assets/images/svg/moon2.png');
}

/* ===============================
   Recipe List (Index)
   =============================== */
.recipe-list {
  list-style: none;
  padding: 0;
  margin: 10px 0;
}

.recipe-list li {
  padding: 8px 0;
  border-bottom: 1px solid #808080;
}

.recipe-list li:last-child {
  border-bottom: none;
}

.recipe-list a {
  font-size: 1.2rem;
}

/* ===============================
   Single Recipe Page
   =============================== */
.recipe-back {
  text-decoration: none;
  color: var(--link-color-light);
  font-size: 1rem;
}

.recipe-back:hover {
  text-decoration: underline;
}

body.dark-mode .recipe-back,
body.dark-mode .recipe-back:visited {
  color: var(--link-color-dark);
}

.recipe-page h1 {
  font-size: 2rem;
  font-weight: 700;
  margin: 0 0 8px 0;
}

.recipe-content h2 {
  font-size: 1.4rem;
  font-weight: 600;
  margin: 28px 0 12px 0;
}

.recipe-content h3 {
  font-size: 1.1rem;
  font-weight: 600;
  margin: 20px 0 8px 0;
}

.recipe-content ul {
  padding-left: 20px;
  line-height: 1.7;
}

.recipe-content ol {
  padding-left: 20px;
  line-height: 1.8;
}

.recipe-content li {
  margin-bottom: 4px;
}

.recipe-source {
  margin-top: 40px;
  padding-top: 16px;
  border-top: 1px solid #808080;
  font-size: 0.9rem;
  opacity: 0.7;
}

.recipe-source a {
  color: var(--link-color-light);
}

body.dark-mode .recipe-source a {
  color: var(--link-color-dark);
}

/* ===============================
   Hyperlinks
   =============================== */
a {
  color: var(--link-color-light);
  text-decoration: none;
}

a:hover, a:focus {
  text-decoration: underline;
}

a:visited {
  color: var(--link-color-light);
}

body.dark-mode a,
body.dark-mode a:visited {
  color: var(--link-color-dark);
}
