/* Ported from the original /timeline vertical-timeline design, then
   extended with matching styles for login/admin/forms.

   Color system: everything below is generated from the one site seed
   color, #EA6348 (the same color static/style.css uses for the landing
   page), instead of the timeline template's original indigo/pink.
     --seed        the literal seed; large surfaces (nav, header banner),
                    paired with black text, exactly like the landing page.
     --seed-dark    a darker tone of the same hue, for links/buttons/badges
                    that need to sit on a light background — the raw seed
                    fails WCAG AA contrast (3.3:1) as text-on-white, this
                    tone passes comfortably (6.1:1).
     --seed-darker  darker still, for hover/active states.
     --seed-tint    a pale tint of the same hue, for subtle backgrounds. */
:root {
  --seed: #EA6348;
  --seed-dark: #C03316;
  --seed-darker: #972810;
  --seed-tint: #FAD8D1;
  --link: var(--seed-dark);

  --bg: #eee;
  --surface: #f5f5f5;
  --surface-alt: #fff;
  --text: #222;
  --text-muted: #555;
  --text-faint: #777;
  --border: #ccc;
  --border-light: #e2e2e2;
  --shadow: rgba(0, 0, 0, 0.3);
  --shadow-sm: rgba(0, 0, 0, 0.6);
  --flash-text: #333;
}

/* The raw --seed-dark text color (#C03316) only passes contrast against a
   light page background. On a dark background it needs the brighter
   --seed instead — everything else just swaps to a dark neutral set. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --link: var(--seed);
    --bg: #121212;
    --surface: #1e1e1e;
    --surface-alt: #262626;
    --text: #eee;
    --text-muted: #b5b5b5;
    --text-faint: #8a8a8a;
    --border: #3a3a3a;
    --border-light: #333;
    --shadow: rgba(0, 0, 0, 0.6);
    --shadow-sm: rgba(0, 0, 0, 0.8);
    --flash-text: #eee;
  }
}
:root[data-theme="dark"] {
  --link: var(--seed);
  --bg: #121212;
  --surface: #1e1e1e;
  --surface-alt: #262626;
  --text: #eee;
  --text-muted: #b5b5b5;
  --text-faint: #8a8a8a;
  --border: #3a3a3a;
  --border-light: #333;
  --shadow: rgba(0, 0, 0, 0.6);
  --shadow-sm: rgba(0, 0, 0, 0.8);
  --flash-text: #eee;
}

section {
  padding: 100px 0;
}

html, body {
  overflow-x: hidden;
}

body {
  margin: 0;
  font-family: "Roboto", sans-serif;
  font-size: 17px;
  font-weight: 400;
  background-color: var(--bg);
  color: var(--text);
}

h1 {
  font-size: 200%;
  text-transform: uppercase;
  letter-spacing: 3px;
  font-weight: 400;
}

a {
  color: var(--link);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}

/* --- site nav (not part of the original CodePen, styled to match it) --- */
.site-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  background: var(--seed);
}
.site-nav .brand {
  color: #000;
  font-weight: 700;
  font-size: 1.1rem;
  text-decoration: none;
}
.site-nav .links a {
  color: #000;
  margin-left: 20px;
  font-weight: 500;
  text-decoration: none;
}
.site-nav .links a:hover {
  text-decoration: underline;
}
.theme-toggle {
  margin-left: 20px;
  color: #000;
  background: transparent;
  border: 1px solid rgba(0, 0, 0, 0.4);
  border-radius: 2px;
  padding: 5px 10px;
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
}
.theme-toggle:hover {
  background: rgba(0, 0, 0, 0.08);
}

.page {
  max-width: 1000px;
  margin: 0 auto;
  padding: 0 0 64px;
}

/* --- header banner, as in the original timeline page --- */
header.cookbook-header {
  background: var(--seed);
  color: #000;
  padding: 100px 0 80px;
  text-align: center;
  width: 100%;
}
header.cookbook-header .container {
  max-width: 1000px;
  margin: 0 auto;
  padding: 0 24px;
}
header.cookbook-header h1 {
  margin: 0;
}
header.cookbook-header p {
  font-family: "Allura", cursive;
  color: rgba(0, 0, 0, 0.3);
  margin-bottom: 0;
  font-size: 48px;
  margin-top: -10px;
}

.flashes {
  list-style: none;
  padding: 0;
  margin: 24px auto 0;
  max-width: 600px;
}
.flashes li {
  background: var(--surface-alt);
  border-left: 4px solid var(--seed-dark);
  color: var(--flash-text);
  padding: 10px 14px;
  border-radius: 2px;
  margin-bottom: 8px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}

/* --- vertical timeline, ported from /timeline/style.css --- */
.timeline {
  position: relative;
  padding: 60px 0;
}
.timeline::before {
  content: "";
  background: var(--seed-tint);
  width: 5px;
  height: 95%;
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
}

/* .page already centers/constrains width (used on every page); this
   container only needs its own side padding, not another max-width. */
.timeline .container {
  padding: 0 24px;
}

.timeline-item {
  width: 100%;
  margin-bottom: 70px;
}
.timeline-item:nth-child(even) .timeline-content {
  float: right;
  padding: 40px 30px 10px 30px;
}
.timeline-item:nth-child(even) .timeline-content .date {
  right: auto;
  left: 0;
}
.timeline-item:nth-child(even) .timeline-content::after {
  content: "";
  position: absolute;
  border-style: solid;
  width: 0;
  height: 0;
  top: 30px;
  left: -15px;
  border-width: 10px 15px 10px 0;
  border-color: transparent var(--surface) transparent transparent;
}
.timeline-item::after {
  content: "";
  display: block;
  clear: both;
}

.timeline-content {
  position: relative;
  width: 40%;
  padding: 10px 30px;
  border-radius: 4px;
  background: var(--surface);
  box-shadow: 0 20px 25px -15px var(--shadow);
  color: var(--text);
  display: block;
  z-index: 1;
}
.timeline-content:hover {
  text-decoration: none;
}
.timeline-content::after {
  content: "";
  position: absolute;
  border-style: solid;
  width: 0;
  height: 0;
  top: 30px;
  right: -15px;
  border-width: 10px 0 10px 15px;
  border-color: transparent transparent transparent var(--surface);
}
.timeline-content h2 {
  margin-top: 10px;
}
.timeline-content p {
  color: var(--text-muted);
}

.timeline-img {
  width: 30px;
  height: 30px;
  background: var(--seed);
  border-radius: 50%;
  position: absolute;
  left: 50%;
  margin-top: 25px;
  margin-left: -15px;
  z-index: 2;
}

.bnt-more {
  background: var(--seed-dark);
  color: #FFFFFF !important;
  padding: 8px 20px;
  text-transform: uppercase;
  font-size: 14px;
  margin-bottom: 20px;
  margin-top: 10px;
  display: inline-block;
  border-radius: 2px;
  box-shadow: 0 1px 3px -1px rgba(0, 0, 0, 0.6);
}
.bnt-more:hover {
  background: var(--seed-darker);
  color: #FFFFFF !important;
  text-decoration: none;
}

.timeline-card {
  padding: 0 !important;
}
.timeline-card p {
  padding: 0 20px;
}
.timeline-card .bnt-more {
  margin-left: 20px;
}

.timeline-img-header {
  height: 200px;
  position: relative;
  margin-bottom: 20px;
  overflow: hidden;
}
/* A real <img> (not a CSS background-image) so Google Images can actually
   crawl and index recipe photos from the list page. */
.timeline-img-header img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.timeline-img-header::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(rgba(0, 0, 0, 0), rgba(0, 0, 0, 0.4));
}
.timeline-img-header h2 {
  color: #FFFFFF;
  position: absolute;
  bottom: 5px;
  left: 20px;
  margin: 0;
  z-index: 1;
}

.date {
  background: var(--seed-dark);
  display: inline-block;
  color: #FFFFFF;
  padding: 10px;
  position: absolute;
  top: 0;
  right: 0;
  font-size: 13px;
}

.empty-state {
  text-align: center;
  color: var(--text-faint);
  padding: 60px 24px;
}

@media screen and (max-width: 768px) {
  .timeline::before {
    left: 50px;
  }
  .timeline .timeline-img {
    left: 50px;
  }
  .timeline .timeline-content {
    max-width: 100%;
    width: auto;
    margin-left: 70px;
  }
  .timeline .timeline-item:nth-child(even) .timeline-content {
    float: none;
  }
  .timeline .timeline-item:nth-child(odd) .timeline-content::after {
    content: "";
    position: absolute;
    border-style: solid;
    width: 0;
    height: 0;
    top: 30px;
    left: -15px;
    border-width: 10px 15px 10px 0;
    border-color: transparent var(--surface) transparent transparent;
  }
}

/* --- recipe detail page --- */
.recipe-detail {
  max-width: 700px;
  margin: 40px auto 0;
  padding: 0 24px;
}
.back-link {
  display: inline-block;
  margin-bottom: 16px;
}
.recipe-card-single {
  position: relative;
  background: var(--surface);
  border-radius: 4px;
  padding: 30px;
  box-shadow: 0 20px 25px -15px var(--shadow);
}
.recipe-image {
  width: 100%;
  max-height: 320px;
  object-fit: cover;
  border-radius: 4px;
  margin-bottom: 16px;
}
.ingredients, .instructions {
  background: var(--surface-alt);
  padding: 16px 16px 16px 36px;
  border-radius: 4px;
}

.recipe-story {
  margin: 20px 0;
  line-height: 1.6;
}
.recipe-story h1, .recipe-story h2, .recipe-story h3 {
  margin-top: 1.2em;
}
.recipe-story blockquote {
  border-left: 4px solid var(--seed-dark);
  margin: 1em 0;
  padding: 4px 16px;
  color: var(--text-muted);
}
.recipe-story figure {
  margin: 1em 0;
}
.recipe-story figure img {
  max-width: 100%;
  border-radius: 4px;
}
.recipe-story figcaption {
  font-size: 0.85rem;
  color: var(--text-faint);
  margin-top: 4px;
}

/* --- login / admin / forms --- */
.card-form {
  display: flex;
  flex-direction: column;
  max-width: 500px;
  margin: 40px auto 0;
  background: var(--surface);
  padding: 24px 30px;
  border-radius: 4px;
  box-shadow: 0 20px 25px -15px var(--shadow);
}
.card-form label {
  margin-top: 14px;
  margin-bottom: 4px;
  font-weight: 500;
}
.card-form input,
.card-form textarea {
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 2px;
  font-family: inherit;
  font-size: 1rem;
  background: var(--surface-alt);
  color: var(--text);
}

.btn {
  display: inline-block;
  margin-top: 20px;
  background: var(--seed-dark);
  color: #fff;
  border: none;
  padding: 10px 24px;
  border-radius: 2px;
  font-size: 14px;
  text-transform: uppercase;
  cursor: pointer;
  text-decoration: none;
  box-shadow: 0 1px 3px -1px rgba(0, 0, 0, 0.6);
}
.btn:hover {
  background: var(--seed-darker);
  color: #fff;
  text-decoration: none;
}

.admin-wrap {
  max-width: 900px;
  margin: 40px auto 0;
  padding: 0 24px;
}
.admin-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 20px;
  background: var(--surface);
  border-radius: 4px;
  overflow: hidden;
}
.admin-table th, .admin-table td {
  text-align: left;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border-light);
}
.admin-table .actions {
  display: flex;
  gap: 12px;
  align-items: center;
}
.admin-table form {
  margin: 0;
}

.link-btn {
  background: none;
  border: none;
  color: var(--link);
  cursor: pointer;
  padding: 0;
  font-size: 1rem;
  text-decoration: none;
}
.link-btn:hover {
  text-decoration: underline;
}
