/* ===========================
   GLOBAL RESET & BASE
   =========================== */

* {
  box-sizing: border-box;
}

body {
  font-family: Arial, sans-serif;
  margin: 0;
  padding: 0;
  background-color: #f4f5f7;
  color: #222;
}

/* Headings */
h1, h2, h3, h4 {
  color: #000;
  margin-top: 0;
}

/* Links */
a {
  color: inherit;
}

/* ===========================
   HEADER
   =========================== */

header {
  background-color: #333;
  color: #ffffff;
  padding: 12px 20px;
  text-align: center;
}

header h1 {
  margin: 0 0 6px 0;
  font-size: 1.4rem;
}

header nav {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 16px;
}

header nav a {
  color: #ffffff;
  text-decoration: none;
  font-weight: 500;
  font-size: 0.95rem;
}

header nav a:hover {
  text-decoration: underline;
}

/* ===========================
   FOOTER
   =========================== */

footer {
  background-color: #333;
  color: #ffffff;
  text-align: center;
  padding: 10px 0;
  margin-top: 40px;
  font-size: 0.85rem;
}

/* ===========================
   DEFAULT MAIN LAYOUT
   (used by index.html / simple pages)
   =========================== */

main {
  max-width: 800px;
  margin: 20px auto 40px auto;
  padding: 0 20px;
  text-align: left;
}

main h2 {
  margin-bottom: 10px;
}

/* ===========================
   RECIPES PAGE LAYOUT
   =========================== */

.recipes-main {
  max-width: 980px;
  margin: 20px auto 40px auto;
  padding: 0 20px 20px 20px;
  text-align: left;
}

.recipes-header {
  text-align: center;
  margin-bottom: 24px;
}

.recipes-header h2 {
  margin-bottom: 6px;
}

.recipes-header p {
  margin: 0;
  color: #555;
  font-size: 0.95rem;
}

/* ===========================
   RECIPES GRID & STATES
   =========================== */

.recipes-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
}

@media (min-width: 720px) {
  .recipes-grid {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  }
}

.recipes-loading,
.recipes-empty,
.recipes-error {
  text-align: center;
  color: #555;
  grid-column: 1 / -1;
  font-size: 0.95rem;
}

/* ===========================
   RECIPE CARD
   =========================== */

.recipe-card {
  background-color: #ffffff;
  border-radius: 10px;
  padding: 16px 18px 14px;
  border: 1px solid #e2e2e2;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.recipe-card__title {
  margin: 0;
  font-size: 1.1rem;
}

.recipe-card__meta {
  margin: 0;
  font-size: 0.8rem;
  color: #777;
}

.recipe-card__body {
  margin-top: 6px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Side-by-side sections on wider screens */
@media (min-width: 900px) {
  .recipe-card__body {
    flex-direction: row;
    align-items: flex-start;
  }

  .recipe-section {
    flex: 1;
  }
}

/* ===========================
   RECIPE SECTION CONTENT
   =========================== */

.recipe-section h4 {
  margin: 0 0 6px;
  font-size: 0.95rem;
  font-weight: 600;
}

.recipe-section ul,
.recipe-section ol {
  margin: 0 0 4px 18px;
  padding: 0;
}

.recipe-section li {
  margin-bottom: 4px;
  line-height: 1.4;
}

.recipe-section__empty {
  margin: 0;
  font-size: 0.85rem;
  color: #777;
}

/* ===========================
   LEGACY AUTHOR / RECIPE ITEM
   (if you ever reuse them)
   =========================== */

.author-section {
  margin-bottom: 32px;
  border: 1px solid #ddd;
  border-radius: 10px;
  background: #ffffff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  padding: 20px;
}

.author-section > h2 {
  margin-top: 0;
  margin-bottom: 18px;
  text-align: center;
}

.recipe-item {
  margin-bottom: 22px;
  padding-bottom: 18px;
  border-bottom: 1px solid #eee;
}

.recipe-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
  margin-bottom: 0;
}

.recipe-item h3 {
  margin: 0 0 8px 0;
  font-size: 1.25rem;
  text-align: center;
}

.recipe-item ul,
.recipe-item ol {
  padding-left: 22px;
  margin-left: 0;
  margin-top: 6px;
  margin-bottom: 14px;
  text-align: left;
}

.recipe-item p {
  margin: 6px 0;
}

.recipe-item strong {
  display: block;
  margin-bottom: 4px;
}

/* ===========================
   SUBMIT RECIPE FORM
   =========================== */

.form-section {
  max-width: 640px;
  margin: 0 auto 40px auto;
}

.recipe-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.recipe-form label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.95rem;
}

.recipe-form input[type="text"],
.recipe-form textarea {
  padding: 8px 10px;
  border-radius: 6px;
  border: 1px solid #ccc;
  font: inherit;
  resize: vertical;
  background-color: #ffffff;
}

.recipe-form small {
  font-size: 0.8rem;
  color: #666;
}

.btn-primary {
  align-self: flex-start;
  padding: 8px 16px;
  border-radius: 6px;
  border: none;
  background-color: #2b7cff;
  color: #ffffff;
  font-weight: 600;
  cursor: pointer;
  font-size: 0.95rem;
}

.btn-primary:hover {
  background-color: #205fbf;
}

.form-message {
  margin: 4px 0 0 0;
  font-size: 0.9rem;
}

.form-message--success {
  color: #1a7f37;
}

.form-message--error {
  color: #b3261e;
}

/* Auth status text on submit page */
.auth-status {
  font-size: 0.9rem;
  color: #555;
  margin-top: 6px;
}
