/* ================================================================
   Recipe Master — Stylesheet
   Aesthetic: Warm organic editorial, earthy tones
   ================================================================ */

@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,400;0,700;1,400&family=Source+Sans+3:wght@300;400;600&display=swap');

:root {
  --rm-bg:        #faf8f4;
  --rm-card-bg:   #ffffff;
  --rm-primary:   #c17b3d;
  --rm-accent:    #e8523a;
  --rm-dark:      #2c2016;
  --rm-muted:     #7a6a5a;
  --rm-border:    #e8e0d4;
  --rm-green:     #4a7c5f;
  --rm-light:     #f2ede4;
  --rm-shadow:    0 4px 24px rgba(44,32,22,.08);
  --rm-radius:    14px;
  --rm-font-head: 'Playfair Display', Georgia, serif;
  --rm-font-body: 'Source Sans 3', system-ui, sans-serif;
}

/* ---- Base ---- */
.rm-wrapper,
.rm-single-wrap,
.rm-archive-wrap {
  font-family: var(--rm-font-body);
  color: var(--rm-dark);
  background: var(--rm-bg);
}

/* ================================================================
   CARD GRID
   ================================================================ */
.rm-grid {
  display: grid;
  gap: 24px;
  margin: 24px 0;
}
.rm-cols-1 { grid-template-columns: 1fr; }
.rm-cols-2 { grid-template-columns: repeat(2, 1fr); }
.rm-cols-3 { grid-template-columns: repeat(3, 1fr); }
.rm-cols-4 { grid-template-columns: repeat(4, 1fr); }

@media (max-width: 900px) {
  .rm-cols-3, .rm-cols-4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 560px) {
  .rm-cols-2, .rm-cols-3, .rm-cols-4 { grid-template-columns: 1fr; }
}

/* ---- Card ---- */
.rm-card {
  background: var(--rm-card-bg);
  border-radius: var(--rm-radius);
  overflow: hidden;
  box-shadow: var(--rm-shadow);
  transition: transform .25s ease, box-shadow .25s ease;
  display: flex;
  flex-direction: column;
}
.rm-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 36px rgba(44,32,22,.14);
}

.rm-card-image-wrap {
  position: relative;
  display: block;
  aspect-ratio: 4/3;
  overflow: hidden;
}
.rm-card-image {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform .4s ease;
  display: block;
}
.rm-card:hover .rm-card-image { transform: scale(1.05); }
.rm-card-no-image {
  width: 100%; height: 100%;
  background: var(--rm-light);
  display: flex; align-items: center; justify-content: center;
  font-size: 48px;
}
.rm-card-badge {
  position: absolute; top: 12px; left: 12px;
  background: var(--rm-primary);
  color: #fff;
  font-family: var(--rm-font-body);
  font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 20px;
}

.rm-card-body {
  padding: 18px 20px 20px;
  display: flex; flex-direction: column; flex: 1;
}
.rm-card-title { font-family: var(--rm-font-head); font-size: 1.15rem; margin: 0 0 6px; line-height: 1.3; }
.rm-card-title a { color: var(--rm-dark); text-decoration: none; }
.rm-card-title a:hover { color: var(--rm-primary); }

.rm-card-rating { display: flex; align-items: center; gap: 6px; margin-bottom: 8px; }
.rm-stars { color: #f5a623; letter-spacing: 1px; }
.rm-star-empty { color: #d9cfc4; }
.rm-rating-number { font-size: 13px; color: var(--rm-muted); }

.rm-card-meta { display: flex; gap: 14px; margin-bottom: 10px; }
.rm-meta-item { font-size: 12px; color: var(--rm-muted); }

.rm-card-excerpt { font-size: 14px; color: var(--rm-muted); line-height: 1.55; flex: 1; margin: 0 0 14px; }

.rm-card-btn {
  display: inline-block;
  color: var(--rm-primary);
  font-weight: 600; font-size: 13px;
  text-decoration: none;
  border: 2px solid var(--rm-primary);
  border-radius: 8px;
  padding: 7px 16px;
  transition: background .2s, color .2s;
  align-self: flex-start;
}
.rm-card-btn:hover { background: var(--rm-primary); color: #fff; }

/* ================================================================
   FILTER BAR
   ================================================================ */
.rm-filter-bar { margin-bottom: 4px; }
.rm-filters { display: flex; gap: 12px; flex-wrap: wrap; padding: 12px 0; }
.rm-filter-select {
  padding: 8px 14px;
  border: 1.5px solid var(--rm-border);
  border-radius: 8px;
  background: #fff;
  font-family: var(--rm-font-body);
  font-size: 14px;
  color: var(--rm-dark);
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%237a6a5a'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
}
.rm-filter-select:focus { outline: none; border-color: var(--rm-primary); }

/* ================================================================
   SEARCH BAR
   ================================================================ */
.rm-search-bar { margin: 0 0 28px; }
.rm-search-bar form { display: flex; gap: 10px; max-width: 520px; margin: 0 auto; }
.rm-search-input {
  flex: 1;
  padding: 12px 18px;
  border: 2px solid var(--rm-border);
  border-radius: 10px;
  font-size: 15px;
  font-family: var(--rm-font-body);
  background: #fff;
}
.rm-search-input:focus { outline: none; border-color: var(--rm-primary); }
.rm-search-btn {
  padding: 12px 22px;
  background: var(--rm-primary);
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 15px; font-weight: 600;
  cursor: pointer;
  font-family: var(--rm-font-body);
  transition: background .2s;
}
.rm-search-btn:hover { background: var(--rm-accent); }

/* ================================================================
   NO RESULTS
   ================================================================ */
.rm-no-results {
  text-align: center; padding: 60px 20px;
  color: var(--rm-muted);
}
.rm-no-results span { font-size: 48px; display: block; margin-bottom: 12px; }

/* ================================================================
   ARCHIVE HEADER
   ================================================================ */
.rm-archive-wrap { padding: 40px 20px; max-width: 1200px; margin: 0 auto; }
.rm-archive-header { text-align: center; margin-bottom: 32px; }
.rm-archive-title {
  font-family: var(--rm-font-head);
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  margin: 0 0 8px;
  color: var(--rm-dark);
}
.rm-archive-subtitle { color: var(--rm-muted); font-size: 1.05rem; margin: 0; }

/* ================================================================
   SINGLE RECIPE
   ================================================================ */

/* Hero */
.rm-hero {
  position: relative;
  background: var(--rm-dark);
  color: #fff;
  min-height: 400px;
  display: flex; align-items: flex-end;
}
.rm-hero-image {
  position: absolute; inset: 0;
}
.rm-hero-image img { width: 100%; height: 100%; object-fit: cover; }
.rm-hero-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,.75) 0%, rgba(0,0,0,.15) 60%, transparent 100%);
}
.rm-hero-content {
  position: relative; z-index: 2;
  padding: 40px 48px;
  width: 100%; box-sizing: border-box;
}

.rm-breadcrumb { font-size: 13px; opacity: .75; margin-bottom: 10px; }
.rm-breadcrumb a { color: #fff; text-decoration: none; }
.rm-breadcrumb a:hover { text-decoration: underline; }

.rm-single-title {
  font-family: var(--rm-font-head);
  font-size: clamp(1.8rem, 4vw, 3rem);
  margin: 0 0 12px; line-height: 1.2;
  color: #fff;
}
.rm-hero-rating { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; font-size: 18px; }
.rm-hero-author { margin: 0 0 12px; font-size: 14px; opacity: .85; }

.rm-tax-tags { display: flex; gap: 8px; flex-wrap: wrap; }
.rm-tag {
  font-size: 12px; font-weight: 600; padding: 4px 12px; border-radius: 20px;
  letter-spacing: .05em;
}
.rm-tag-cat  { background: var(--rm-primary); color: #fff; }
.rm-tag-cui  { background: var(--rm-green);   color: #fff; }
.rm-tag-diff { background: rgba(255,255,255,.2); color: #fff; border: 1px solid rgba(255,255,255,.4); }

/* Container */
.rm-single-container {
  max-width: 1100px; margin: 0 auto;
  padding: 40px 24px 60px;
}

/* Quick stats */
.rm-quick-stats {
  display: flex; gap: 0;
  background: #fff;
  border-radius: var(--rm-radius);
  box-shadow: var(--rm-shadow);
  overflow: hidden;
  margin-bottom: 36px;
}
.rm-stat {
  flex: 1; padding: 20px 16px; text-align: center;
  border-right: 1px solid var(--rm-border);
}
.rm-stat:last-child { border-right: none; }
.rm-stat-highlight { background: var(--rm-light); }
.rm-stat-icon { font-size: 22px; margin-bottom: 4px; }
.rm-stat-value { font-family: var(--rm-font-head); font-size: 1.3rem; font-weight: 700; color: var(--rm-primary); }
.rm-stat-label { font-size: 11px; color: var(--rm-muted); text-transform: uppercase; letter-spacing: .07em; margin-top: 2px; }

@media (max-width: 600px) {
  .rm-quick-stats { flex-wrap: wrap; }
  .rm-stat { flex: 1 1 50%; border-bottom: 1px solid var(--rm-border); }
}

/* Intro */
.rm-intro {
  background: var(--rm-light);
  border-left: 4px solid var(--rm-primary);
  border-radius: 0 var(--rm-radius) var(--rm-radius) 0;
  padding: 18px 24px;
  margin-bottom: 36px;
  font-size: 1.05rem; line-height: 1.65; color: var(--rm-dark);
}
.rm-intro p { margin: 0; }

/* Layout */
.rm-main-layout {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 28px;
  align-items: start;
}
@media (max-width: 768px) {
  .rm-main-layout { grid-template-columns: 1fr; }
}

/* Box */
.rm-box {
  background: var(--rm-card-bg);
  border-radius: var(--rm-radius);
  box-shadow: var(--rm-shadow);
  padding: 24px;
  margin-bottom: 24px;
}
.rm-box-title {
  font-family: var(--rm-font-head);
  font-size: 1.25rem; margin: 0 0 18px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--rm-border);
  display: flex; align-items: center; gap: 8px;
}
.rm-box-title small { font-family: var(--rm-font-body); font-size: 12px; color: var(--rm-muted); font-weight: 400; }
.rm-servings-badge {
  margin-left: auto;
  background: var(--rm-light);
  color: var(--rm-primary);
  font-family: var(--rm-font-body);
  font-size: 12px; font-weight: 600;
  padding: 3px 10px; border-radius: 20px;
}

/* Ingredients */
.rm-ing-group-title {
  font-weight: 700; font-size: 13px; text-transform: uppercase;
  letter-spacing: .08em; color: var(--rm-primary);
  margin: 14px 0 8px;
}
.rm-ing-list { list-style: none; margin: 0; padding: 0; }
.rm-ing-item {
  display: flex; align-items: baseline; gap: 8px;
  padding: 8px 0;
  border-bottom: 1px dashed var(--rm-border);
  font-size: 14px;
  cursor: pointer;
  transition: background .15s;
}
.rm-ing-item:last-child { border-bottom: none; }
.rm-ing-item:hover { background: var(--rm-light); border-radius: 6px; padding-left: 6px; }
.rm-ing-check { color: var(--rm-border); font-size: 16px; flex-shrink: 0; transition: color .2s; }
.rm-ing-item.rm-checked .rm-ing-check { color: var(--rm-green); }
.rm-ing-item.rm-checked .rm-ing-name { text-decoration: line-through; color: var(--rm-muted); }
.rm-ing-name { flex: 1; }
.rm-ing-amount { font-weight: 600; color: var(--rm-primary); white-space: nowrap; }
.rm-ing-note { font-size: 12px; color: var(--rm-muted); font-style: italic; }

/* Nutrition */
.rm-nut-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.rm-nut-item { text-align: center; background: var(--rm-light); border-radius: 10px; padding: 12px 8px; }
.rm-nut-val { font-family: var(--rm-font-head); font-size: 1.2rem; color: var(--rm-primary); }
.rm-nut-val span { font-size: 11px; color: var(--rm-muted); font-family: var(--rm-font-body); margin-left: 2px; }
.rm-nut-label { font-size: 11px; color: var(--rm-muted); margin-top: 2px; text-transform: uppercase; letter-spacing: .06em; }

/* Steps */
.rm-steps { display: flex; flex-direction: column; gap: 0; }
.rm-step {
  display: flex; gap: 16px; padding: 20px 0;
  border-bottom: 1px solid var(--rm-border);
}
.rm-step:last-child { border-bottom: none; }
.rm-step-num {
  flex-shrink: 0;
  width: 40px; height: 40px;
  background: var(--rm-primary); color: #fff;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--rm-font-head); font-size: 1.1rem; font-weight: 700;
}
.rm-step-body { flex: 1; }
.rm-step-title { font-family: var(--rm-font-head); font-size: 1.05rem; margin: 0 0 6px; color: var(--rm-dark); }
.rm-step-desc { margin: 0 0 10px; line-height: 1.65; }
.rm-step-tip {
  display: flex; align-items: flex-start; gap: 8px;
  background: #fffbf0; border: 1px solid #f5e09a;
  border-radius: 8px; padding: 10px 14px;
  font-size: 13px; color: #7a6200;
}
.rm-tip-icon { flex-shrink: 0; }

/* Video */
.rm-video-embed { position: relative; padding-top: 56.25%; border-radius: 10px; overflow: hidden; }
.rm-video-embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: none; }
