/* ============================================================
   Burningfood.com — Styles
   ============================================================ */

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Raleway', sans-serif;
  color: #333;
  background-color: #fafafa;
  line-height: 1.6;
}

/* ---- Brand Header ---- */
.brand {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 60px;
  background: #2c2c2c;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1rem;
  z-index: 300;
}

.brand-link {
  display: flex;
  align-items: center;
  text-decoration: none;
  gap: 0.5rem;
}

.brand-logo {
  height: 40px;
  width: auto;
}

.brand-text {
  font-size: 1.4rem;
  font-weight: 700;
  color: orange;
}

/* ---- Navigation ---- */
.main-nav {
  position: fixed;
  top: 60px;
  left: 0;
  width: 100%;
  background: #fff;
  display: flex;
  justify-content: center;
  gap: 0;
  z-index: 254;
  border-bottom: 1px solid #eee;
}

.nav-link {
  padding: 0.75rem 1rem;
  text-decoration: none;
  color: #555;
  font-weight: 600;
  font-size: 0.9rem;
  transition: color 200ms, border-bottom 200ms;
  border-bottom: 3px solid transparent;
  -webkit-tap-highlight-color: transparent;
}

.nav-link:hover,
.nav-link.active {
  color: orange;
  border-bottom-color: orange;
}

/* ---- Main Content Area ---- */
#app {
  margin-top: 105px;
  padding: 1rem 0.6rem;
  width: 100%;
  min-height: calc(100vh - 105px);
}

/* ---- Home Page ---- */
.home-wrapper {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.home-wrapper h1 {
  color: orange;
  font-size: 1.2rem;
  padding: 0.5rem 0;
}

.home-content {
  width: 100%;
  padding: 10px;
  line-height: 1.8;
}

@media (min-width: 40em) {
  .home-wrapper h1 {
    font-size: 2rem;
  }
  .home-content {
    width: 65%;
  }
}

/* ---- Categories Grid ---- */
.categories-wrapper {
  width: 100%;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
}

.category-card {
  border-radius: 0.25rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  padding: 12px 5px;
  background-color: #fff;
  color: #333;
  width: calc(50% - 16px);
  min-width: 0;
  text-align: center;
  text-decoration: none;
  margin: 6px;
  font-weight: bold;
  border: 1px solid orange;
  box-shadow: 1px 3px 6px rgba(0,0,0,0.08);
  transition: background-color 200ms ease-out, transform 150ms;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.category-card:hover,
.category-card:active {
  background-color: #fff8ee;
  transform: translateY(-2px);
}

.category-card img {
  width: 40%;
  max-width: 80px;
  margin: 4% 0 2%;
}

/* Tablet */
@media (min-width: 600px) {
  .category-card {
    width: calc(33.33% - 20px);
    margin: 8px;
  }
}

/* Desktop */
@media (min-width: 900px) {
  .category-card {
    width: 20%;
    margin: 10px;
  }
}

/* ---- Recipe Cards Grid ---- */
.recipe-cards-wrapper {
  width: 100%;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
}

.recipe-card {
  border-radius: 0.25rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  font-size: 14px;
  padding: 5px;
  background-color: #fff;
  color: #333;
  width: calc(50% - 10px);
  text-align: center;
  text-decoration: none;
  margin: 4px;
  font-weight: bold;
  border: 1px solid orange;
  box-shadow: 1px 3px 6px rgba(0,0,0,0.08);
  transition: all 250ms;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  overflow: hidden;
}

.recipe-card:hover,
.recipe-card:active {
  background-color: #fff8ee;
  transform: translateY(-2px);
}

.recipe-card img {
  padding: 4px;
  width: 100%;
  height: auto;
  aspect-ratio: 4/3;
  object-fit: cover;
}

.recipe-card .card-title {
  padding: 4px 4px 8px;
  font-size: 0.8rem;
  line-height: 1.3;
  word-wrap: break-word;
}

/* Tablet */
@media (min-width: 600px) {
  .recipe-card {
    width: calc(33.33% - 12px);
    margin: 5px;
  }
  .recipe-card .card-title {
    font-size: 0.9rem;
  }
}

/* Desktop */
@media (min-width: 900px) {
  .recipe-card {
    width: 300px;
    margin: 5px;
  }
  .recipe-card img {
    height: 187px;
    width: 250px;
    aspect-ratio: auto;
  }
  .recipe-card .card-title {
    font-size: 15px;
  }
}

/* Back link above recipe cards */
.back-link {
  display: inline-block;
  margin: 0 0 0.8rem 0.3rem;
  padding: 0.4rem 0;
  color: orange;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
  -webkit-tap-highlight-color: transparent;
}

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

/* ---- Single Recipe Detail ---- */
.recipe-wrapper {
  width: 100%;
}

.recipe-image-wrapper {
  max-height: 481px;
  overflow: hidden;
  display: flex;
  width: 100%;
}

.recipe-image-wrapper img {
  width: 100%;
  height: 66.875vw;
  object-fit: cover;
}

@media (min-width: 40em) {
  .recipe-image-wrapper img {
    height: auto;
  }
}

.recipe-content {
  background-color: #eee;
  padding: 10px;
  margin-top: 5px;
  min-height: 300px;
  font-size: 0.95rem;
  line-height: 1.7;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.recipe-content ul,
.recipe-content ol {
  margin-left: 1.2rem;
  margin-bottom: 0.5rem;
}

.recipe-content img {
  max-width: 100%;
  height: auto;
}

@media (min-width: 40em) {
  .recipe-content {
    margin-top: 10px;
    padding: 15px;
    min-height: 500px;
  }
}

.recipe-content h2 {
  color: orange;
  margin-bottom: 0.5rem;
}

.recipe-content a {
  color: orange;
}

.recipe-source {
  margin-bottom: 0.8rem;
  font-size: 0.9rem;
}

.recipe-source a {
  color: #1a0dab;
  text-decoration: underline;
  word-break: break-all;
}

.recipe-source a:hover {
  color: #1a0dab;
}

/* ---- Contact Form ---- */
.contact-wrapper {
  max-width: 600px;
  margin: 0 auto;
  padding: 1rem;
}

.contact-wrapper h1 {
  color: orange;
  font-size: 1.4rem;
  margin-bottom: 1rem;
}

.form-group {
  margin-bottom: 1rem;
}

.form-group label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.3rem;
  color: #555;
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 0.6rem;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-family: 'Raleway', sans-serif;
  font-size: 16px; /* prevents iOS zoom on focus */
  transition: border-color 200ms;
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: orange;
}

.form-group textarea {
  min-height: 150px;
  resize: vertical;
}

.form-error {
  color: #d9534f;
  font-size: 0.85rem;
  margin-top: 0.2rem;
}

.btn-submit {
  background-color: orange;
  color: #fff;
  border: none;
  padding: 0.75rem 2rem;
  font-size: 1rem;
  font-weight: 600;
  border-radius: 4px;
  cursor: pointer;
  font-family: 'Raleway', sans-serif;
  transition: background-color 200ms;
  -webkit-tap-highlight-color: transparent;
  min-height: 44px; /* touch-friendly */
}

.btn-submit:hover {
  background-color: #e08900;
}

.btn-submit:disabled {
  background-color: #ccc;
  cursor: not-allowed;
}

.form-success {
  color: #5cb85c;
  font-weight: 600;
  margin-top: 1rem;
}

/* ---- Loading Spinner ---- */
.loading {
  text-align: center;
  padding: 3rem;
  color: #999;
  font-size: 1.1rem;
}
