/* =====================
   RESET & BASE
   ===================== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --cream: #fdf6ec;
  --warm-brown: #7c4a1e;
  --light-brown: #c28b5a;
  --accent: #e07b39;
  --accent-dark: #c4612a;
  --text: #3b2a1a;
  --text-light: #7a5c3e;
  --card-bg: #fff9f2;
  --border: #e8d5c0;
  --shadow: rgba(124, 74, 30, 0.12);
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Georgia', serif;
  background: var(--cream);
  color: var(--text);
  line-height: 1.7;
}

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
}

/* =====================
   HEADER
   ===================== */
header {
  background: var(--warm-brown);
  padding: 20px 24px 16px;
  text-align: center;
}

.header-inner { max-width: 1100px; margin: 0 auto; }

.logo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 6px;
}

.logo-icon { font-size: 2.4rem; }
.logo-svg  { height: 52px; width: auto; display: block; }

.pixel-logo {
  font-family: 'Press Start 2P', 'Courier New', monospace;
  font-size: 40px;
  font-weight: normal;
  color: #ffffff;
  text-shadow: 4px 4px 0px #3b1a00;
  letter-spacing: 2px;
  line-height: 1;
}
.logo-heart { color: #e07b39; margin-right: 14px; }
.logo-fi    { color: #e8c9a8; font-size: 0.65em; }

header h1 {
  font-size: 2.4rem;
  color: #fff;
  letter-spacing: 0.5px;
}

.tagline {
  color: #e8c9a8;
  font-style: italic;
  font-size: 0.95rem;
  margin-bottom: 12px;
}

nav { display: flex; justify-content: center; gap: 32px; flex-wrap: wrap; }

nav a {
  color: #f5dfc0;
  text-decoration: none;
  font-size: 0.95rem;
  letter-spacing: 1px;
  text-transform: uppercase;
  font-family: 'Arial', sans-serif;
  transition: color 0.2s;
}

nav a:hover { color: #fff; }


.btn {
  display: inline-block;
  background: var(--warm-brown);
  color: #fff;
  padding: 13px 32px;
  border-radius: 30px;
  text-decoration: none;
  font-family: 'Arial', sans-serif;
  font-size: 0.95rem;
  font-weight: bold;
  letter-spacing: 0.5px;
  border: none;
  cursor: pointer;
  transition: background 0.2s, transform 0.15s;
}

.btn:hover { background: #5c3412; transform: translateY(-2px); }

/* =====================
   SEARCH & FILTERS
   ===================== */
.controls {
  padding: 24px 24px 20px;
  background: #f5ece0;
  border-bottom: 2px solid var(--border);
}

.controls .container { display: flex; flex-direction: column; align-items: center; gap: 16px; }

#search {
  width: 100%;
  max-width: 500px;
  padding: 12px 20px;
  border: 2px solid var(--border);
  border-radius: 30px;
  font-size: 1rem;
  font-family: 'Georgia', serif;
  background: #fff;
  color: var(--text);
  outline: none;
  transition: border-color 0.2s;
}

#search:focus { border-color: var(--accent); }

.filters { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }

.filter-btn {
  padding: 8px 20px;
  border: 2px solid var(--border);
  border-radius: 20px;
  background: #fff;
  color: var(--text-light);
  font-family: 'Arial', sans-serif;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s;
}

.filter-btn:hover, .filter-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.sub-filters { margin-top: 6px; min-height: 0; }

.sub-filter-btn {
  padding: 5px 15px;
  border: 1.5px solid var(--border);
  border-radius: 20px;
  background: #f5f5f5;
  color: var(--text-light);
  font-size: 0.78rem;
  cursor: pointer;
  transition: all 0.2s;
}

.sub-filter-btn:hover, .sub-filter-btn.active {
  background: #555;
  border-color: #555;
  color: #fff;
}

/* =====================
   RECIPE GRID
   ===================== */
.recipe-section { padding: 48px 24px; }

.recipe-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 28px;
}

.recipe-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 4px 16px var(--shadow);
  transition: transform 0.2s, box-shadow 0.2s;
  cursor: pointer;
}

.recipe-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 28px var(--shadow);
}

.card-img {
  background: linear-gradient(135deg, #f5dfc0, #e8c4a0);
  font-size: 4rem;
  text-align: center;
  padding: 32px 0;
}

.card-has-photo {
  padding: 0;
  height: 200px;
  overflow: hidden;
}

.card-has-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.card-body { padding: 20px; }

.category-tag {
  display: inline-block;
  background: #fde8d0;
  color: var(--accent-dark);
  font-size: 0.75rem;
  font-family: 'Arial', sans-serif;
  font-weight: bold;
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 3px 10px;
  border-radius: 10px;
  margin-bottom: 10px;
}

.card-body h3 {
  font-size: 1.25rem;
  color: var(--warm-brown);
  margin-bottom: 8px;
}

.card-body p {
  font-size: 0.93rem;
  color: var(--text-light);
  margin-bottom: 14px;
}

.card-meta {
  display: flex;
  gap: 16px;
  font-size: 0.85rem;
  color: var(--text-light);
  font-family: 'Arial', sans-serif;
  margin-bottom: 16px;
}

.btn-outline {
  padding: 9px 22px;
  border: 2px solid var(--accent);
  border-radius: 20px;
  background: transparent;
  color: var(--accent);
  font-family: 'Arial', sans-serif;
  font-size: 0.88rem;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-outline:hover {
  background: var(--accent);
  color: #fff;
}

.no-results {
  text-align: center;
  color: var(--text-light);
  font-style: italic;
  font-size: 1.1rem;
  padding: 40px 0;
}

/* =====================
   ABOUT
   ===================== */
.about {
  background: var(--warm-brown);
  padding: 60px 24px;
  color: #f5dfc0;
}

.about-inner {
  display: flex;
  align-items: center;
  gap: 36px;
  flex-wrap: wrap;
}

.about-emoji { font-size: 5rem; }

.about h2 {
  font-size: 1.9rem;
  color: #fff;
  margin-bottom: 12px;
}

.about p { font-size: 1rem; line-height: 1.8; max-width: 680px; }

/* =====================
   CONTACT
   ===================== */
.contact {
  padding: 60px 24px;
  background: #f5ece0;
  text-align: center;
}

.contact h2 { font-size: 1.9rem; color: var(--warm-brown); margin-bottom: 8px; }
.contact > .container > p { color: var(--text-light); margin-bottom: 28px; }

.contact-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-width: 520px;
  margin: 0 auto;
}

.contact-form input,
.contact-form textarea {
  padding: 12px 18px;
  border: 2px solid var(--border);
  border-radius: 10px;
  font-size: 1rem;
  font-family: 'Georgia', serif;
  background: #fff;
  color: var(--text);
  outline: none;
  transition: border-color 0.2s;
  resize: vertical;
}

.contact-form input:focus,
.contact-form textarea:focus { border-color: var(--accent); }

/* =====================
   FOOTER
   ===================== */
footer {
  background: #3b2a1a;
  color: #b89070;
  text-align: center;
  padding: 20px;
  font-family: 'Arial', sans-serif;
  font-size: 0.88rem;
}

/* =====================
   MODAL
   ===================== */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(30, 18, 8, 0.7);
  z-index: 1000;
  justify-content: center;
  align-items: center;
  padding: 20px;
}

.modal-overlay.open { display: flex; }

.modal {
  background: var(--card-bg);
  border-radius: 20px;
  max-width: 600px;
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
  padding: 36px;
  position: relative;
  box-shadow: 0 20px 60px rgba(0,0,0,0.4);
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 20px;
  background: none;
  border: none;
  font-size: 1.4rem;
  cursor: pointer;
  color: var(--text-light);
  transition: color 0.2s;
}

.modal-close:hover { color: var(--accent); }

.modal h2 { color: var(--warm-brown); font-size: 1.8rem; margin-bottom: 6px; }
.modal .modal-meta { color: var(--text-light); font-size: 0.9rem; font-family: 'Arial', sans-serif; margin-bottom: 20px; }
.modal .modal-emoji { font-size: 3.5rem; margin-bottom: 16px; display: block; }
.modal h3 { color: var(--warm-brown); margin: 20px 0 10px; font-size: 1.1rem; }
.modal ul, .modal ol { padding-left: 22px; color: var(--text); }
.modal li { margin-bottom: 6px; font-size: 0.97rem; }

/* =====================
   IMAGE GALLERY
   ===================== */
.img-gallery {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  overflow-x: auto;
  border-radius: 8px;
}

.img-gallery img {
  width: 180px;
  height: 140px;
  object-fit: cover;
  border-radius: 8px;
  flex-shrink: 0;
  cursor: zoom-in;
  transition: opacity 0.15s;
}
.img-gallery img:hover { opacity: 0.88; }

/* =====================
   LIGHTBOX
   ===================== */
#lightboxOverlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.92);
  z-index: 9999;
  align-items: center;
  justify-content: center;
  animation: lbFade 0.18s ease;
}
#lightboxOverlay.open { display: flex; }
#lightboxImg {
  max-width: 92vw;
  max-height: 90vh;
  object-fit: contain;
  border-radius: 6px;
  box-shadow: 0 8px 40px rgba(0,0,0,0.6);
}
.lightbox-close {
  position: fixed;
  top: 18px;
  right: 22px;
  background: rgba(255,255,255,0.15);
  border: none;
  color: #fff;
  font-size: 1.6rem;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  cursor: pointer;
  line-height: 1;
  transition: background 0.15s;
}
.lightbox-close:hover { background: rgba(255,255,255,0.3); }
@keyframes lbFade { from { opacity:0 } to { opacity:1 } }

/* =====================
   SUBMIT FORM (in modal)
   ===================== */
.form-group {
  margin-bottom: 14px;
}

.form-group label {
  display: block;
  font-family: 'Arial', sans-serif;
  font-size: 0.8rem;
  font-weight: bold;
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 5px;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 9px 13px;
  border: 2px solid var(--border);
  border-radius: 8px;
  font-size: 0.95rem;
  font-family: 'Georgia', serif;
  background: #fff;
  color: var(--text);
  outline: none;
  transition: border-color 0.2s;
  resize: vertical;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus { border-color: var(--accent); }

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}


.submit-btn {
  width: 100%;
  padding: 13px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 10px;
  font-family: 'Arial', sans-serif;
  font-size: 1rem;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.2s;
  margin-top: 8px;
}

.submit-btn:hover { background: var(--accent-dark); transform: translateY(-2px); }

.sub-error {
  color: #c04040;
  font-size: 0.9rem;
  margin-top: 8px;
  display: none;
}

.add-post-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 24px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 30px;
  font-family: 'Arial', sans-serif;
  font-size: 0.95rem;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.2s;
}

.add-post-btn:hover { background: var(--accent-dark); transform: translateY(-2px); }

/* =====================
   IMAGE UPLOAD SLOTS
   ===================== */
.img-upload-slots {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.img-upload-slot {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.img-upload-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border: 2px dashed var(--border);
  border-radius: 8px;
  color: var(--text-light);
  font-family: 'Arial', sans-serif;
  font-size: 0.82rem;
  cursor: pointer;
  transition: all 0.2s;
  background: #fff;
  white-space: nowrap;
  user-select: none;
}

.img-upload-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.img-upload-btn.has-image {
  border-color: var(--accent);
  border-style: solid;
  color: var(--accent-dark);
}

.img-preview {
  width: 100px;
  height: 72px;
  object-fit: cover;
  border-radius: 6px;
  border: 2px solid var(--border);
  display: none;
}

/* =====================
   LANGUAGE TOGGLE
   ===================== */
.lang-toggle {
  padding: 6px 14px;
  border: 2px solid rgba(255,255,255,0.4);
  border-radius: 20px;
  background: transparent;
  color: #f5dfc0;
  font-family: 'Arial', sans-serif;
  font-size: 0.8rem;
  font-weight: bold;
  letter-spacing: 1px;
  cursor: pointer;
  transition: all 0.2s;
}
.lang-toggle:hover { background: rgba(255,255,255,0.15); color: #fff; border-color: #fff; }

/* =====================
   CARD AUTHOR + ACTIONS
   ===================== */
.validated-badge {
  display: inline-block;
  background: #d4edda;
  color: #2d6a3f;
  font-size: 0.72rem;
  font-style: normal;
  font-weight: bold;
  padding: 1px 7px;
  border-radius: 10px;
  margin-left: 4px;
  vertical-align: middle;
}
.guest-badge {
  display: inline-block;
  background: #f0e8dc;
  color: #7a5c3e;
  font-size: 0.72rem;
  font-style: normal;
  font-family: monospace;
  padding: 1px 7px;
  border-radius: 10px;
  margin-left: 4px;
  vertical-align: middle;
}
.card-author {
  font-size: 0.8rem !important;
  color: var(--light-brown) !important;
  font-family: 'Arial', sans-serif;
  margin-bottom: 4px !important;
  font-style: italic;
}

.card-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.like-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.like-btn {
  padding: 7px 14px;
  border: 2px solid #e8c0c8;
  border-radius: 20px;
  background: #fff;
  color: #c06080;
  font-family: 'Arial', sans-serif;
  font-size: 0.82rem;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}
.like-btn:hover { background: #fde8f0; border-color: #e07090; }
.like-btn.liked { background: #fde8f0; border-color: #e07090; color: #c03060; }

.like-count {
  font-family: 'Arial', sans-serif;
  font-size: 0.85rem;
  color: var(--text-light);
  font-weight: bold;
  min-width: 16px;
}

.modal-like-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 20px;
}

/* =====================
   POST BODY (non-recipe)
   ===================== */
.post-body { color: var(--text); line-height: 1.8; }
.post-body p { margin-bottom: 12px; }
.post-body ul, .post-body ol { padding-left: 22px; margin-bottom: 12px; }
.post-body li { margin-bottom: 6px; }
.post-body strong { color: var(--warm-brown); }

.empty-note { color: var(--text-light); font-style: italic; font-size: 0.93rem; }

/* =====================
   COMMENTS
   ===================== */
.comments-section {
  margin-top: 28px;
  padding-top: 24px;
  border-top: 2px solid var(--border);
}
.comments-section h3 { color: var(--warm-brown); font-size: 1.1rem; margin-bottom: 14px; }

.comment {
  background: #f5ece0;
  border-radius: 10px;
  padding: 12px 16px;
  margin-bottom: 10px;
}
.comment-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
  font-family: 'Arial', sans-serif;
  font-size: 0.85rem;
}
.comment-header strong { color: var(--warm-brown); }
.comment-header span { color: var(--text-light); font-size: 0.78rem; }
.comment p { font-size: 0.93rem; color: var(--text); margin: 0; }

.comment-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 14px;
}
.comment-form input,
.comment-form textarea {
  padding: 10px 14px;
  border: 2px solid var(--border);
  border-radius: 8px;
  font-size: 0.93rem;
  font-family: 'Georgia', serif;
  background: #fff;
  color: var(--text);
  outline: none;
  transition: border-color 0.2s;
  resize: vertical;
}
.comment-form input:focus,
.comment-form textarea:focus { border-color: var(--accent); }

.captcha-row {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #f5ece0;
  border: 2px solid var(--border);
  border-radius: 8px;
  padding: 10px 14px;
}
.captcha-label {
  font-family: 'Arial', sans-serif;
  font-size: 0.9rem;
  font-weight: bold;
  color: var(--warm-brown);
  flex: 1;
}
.captcha-row input {
  padding: 7px 10px !important;
  border-radius: 6px !important;
  text-align: center;
  font-weight: bold;
}

/* =====================
   USER AREA (header)
   ===================== */
.user-area {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin: 8px 0;
  flex-wrap: wrap;
}

.user-greeting {
  color: #e8c9a8;
  font-family: 'Arial', sans-serif;
  font-size: 0.85rem;
}

.user-greeting strong { color: #fff; }

.user-btn {
  padding: 6px 16px;
  border: 2px solid rgba(255,255,255,0.4);
  border-radius: 20px;
  background: transparent;
  color: #f5dfc0;
  font-family: 'Arial', sans-serif;
  font-size: 0.82rem;
  font-weight: bold;
  letter-spacing: 0.5px;
  cursor: pointer;
  transition: all 0.2s;
}

.user-btn:hover {
  background: rgba(255,255,255,0.15);
  color: #fff;
  border-color: #fff;
}

.register-btn {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.register-btn:hover {
  background: var(--accent-dark);
  border-color: var(--accent-dark);
}

/* =====================
   SEARCH ROW
   ===================== */
.search-row {
  display: flex;
  gap: 10px;
  width: 100%;
  max-width: 600px;
  align-items: center;
}

.search-row #search { flex: 1; }

.likes-filter-btn {
  padding: 8px 18px;
  border: 2px solid var(--border);
  border-radius: 20px;
  background: #fff;
  color: #c06080;
  font-family: 'Arial', sans-serif;
  font-size: 0.85rem;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.likes-filter-btn:hover {
  background: #fde8f0;
  border-color: #e07090;
}

.likes-filter-btn.active {
  background: #fde8f0;
  border-color: #e07090;
  color: #c03060;
}

/* =====================
   AUTH MODAL
   ===================== */
.auth-error {
  color: #c04040;
  font-size: 0.9rem;
  margin-top: 8px;
  display: none;
}

.auth-switch {
  text-align: center;
  margin-top: 14px;
  font-family: 'Arial', sans-serif;
  font-size: 0.85rem;
  color: var(--accent);
  cursor: pointer;
  transition: color 0.2s;
}

.auth-switch:hover {
  color: var(--accent-dark);
  text-decoration: underline;
}

/* =====================
   RESPONSIVE
   ===================== */
@media (max-width: 600px) {
  header h1 { font-size: 1.7rem; }
  .about-inner { flex-direction: column; text-align: center; }
  .recipe-grid { grid-template-columns: 1fr; }
  nav { gap: 16px; }
  .form-row { grid-template-columns: 1fr; }
  .search-row { flex-direction: column; }
  .likes-filter-btn { width: 100%; }
  .user-area { font-size: 0.78rem; }
}
