* {
  box-sizing: border-box;
}

body {
  --side-line-inset: 160px;
  --side-line-width: 8px;
  margin: 0;
  min-height: 100vh;
  background: #ffffff;
  border-left: 0 !important;
  border-right: 0 !important;
  color: #1f2933;
  font-family: Arial, Helvetica, sans-serif;
  line-height: 1.6;
}

body::before,
body::after {
  content: "";
  position: fixed;
  top: 0;
  bottom: 0;
  z-index: 0;
  width: var(--side-line-width);
  background: #1f5fbf;
  pointer-events: none;
}

body::before {
  left: var(--side-line-inset);
}

body::after {
  right: var(--side-line-inset);
}

.site-header {
  position: relative;
  z-index: 1;
  padding: 28px 20px 18px;
  text-align: center;
}

.site-title {
  margin: 0;
  color: #4f7d24;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 56px;
  font-weight: 700;
  line-height: 1.05;
  text-align: center;
}

.page-shell {
  position: relative;
  z-index: 1;
  width: min(900px, calc(100% - 48px));
  margin: 0 auto;
  padding: 48px 0 60px;
}

.landing-page {
  width: min(980px, calc(100% - 72px));
}

.intro,
.recipe-section,
.recipe-detail {
  background: #ffffff;
}

.intro {
  margin: 0 auto 28px;
  text-align: center;
}

.intro h2,
.section-heading h2,
.recipe-detail h2 {
  margin: 0 0 8px;
  color: #1f5fbf;
}

.intro h2 {
  color: #4f7d24;
  font-size: 56px;
  line-height: 1.05;
}

.intro p,
.section-heading p {
  margin: 0;
  color: #52606d;
}

.section-heading {
  margin-bottom: 18px;
  text-align: center;
}

.search-section {
  width: min(420px, 100%);
  margin: 0;
}

.landing-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 420px);
  gap: 32px;
  align-items: start;
  margin-bottom: 62px;
}

.landing-header.stacked-header {
  grid-template-columns: 1fr;
  gap: 34px;
}

.landing-header.stacked-header .landing-title {
  max-width: 100%;
}

.landing-header.stacked-header .search-section {
  width: min(560px, 100%);
}

.recipe-page-header {
  margin-bottom: 34px;
}

.landing-title {
  margin: 0;
  color: #1f5fbf;
  font-family: "Bradley Hand", "Segoe Print", "Comic Sans MS", cursive;
  font-size: 72px;
  font-weight: 700;
  line-height: 0.95;
}

.blog-brand {
  min-width: 0;
}

.blog-subtitle {
  margin: 10px 0 0;
  color: #52606d;
  font-size: 16px;
  font-weight: 700;
}

.blog-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.blog-nav a {
  padding: 7px 10px;
  border: 1px solid #d7e2f2;
  border-radius: 6px;
  color: #1f5fbf;
  text-decoration: none;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.2;
}

.blog-nav a:hover,
.blog-nav a.active {
  border-color: #1f5fbf;
  background: rgba(31, 95, 191, 0.08);
}

.search-results {
  position: relative;
  z-index: 2;
  gap: 10px;
}

.search-results .recipe-list-item {
  padding: 14px 16px;
}

.search-results .recipe-list-item h3 {
  font-size: 18px;
}

.site-search .search-input {
  margin-bottom: 0;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.search-label {
  display: block;
  margin-bottom: 8px;
  font-weight: 700;
}

.search-input {
  width: 100%;
  margin-bottom: 18px;
  padding: 12px 14px;
  border: 1px solid #b8c7dc;
  border-radius: 6px;
  font: inherit;
}

.search-input:focus {
  border-color: #1f5fbf;
  outline: 2px solid rgba(31, 95, 191, 0.18);
}

.recipe-list {
  display: grid;
  gap: 18px;
}

.recipe-list-item {
  padding: 22px;
  border: 1px solid #d7e2f2;
  border-radius: 10px;
  background: #ffffff;
}

.recipe-list-item h3 {
  margin: 0 0 8px;
  font-size: 22px;
}

.recipe-list-item h3 a,
.back-link a {
  color: #1f5fbf;
  text-decoration: none;
}

.recipe-list-item h3 a:hover,
.back-link a:hover {
  text-decoration: underline;
}

.post-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  margin: 0 0 14px;
  color: #52606d;
  font-size: 14px;
}

.post-meta span::before {
  content: "\2022";
  margin-right: 12px;
  color: #8ca6c8;
}

.recipe-excerpt {
  margin: 0;
}

.recipe-ingredients {
  margin: 0;
  color: #52606d;
}

.popular-section {
  margin-top: 0;
}

.popular-section h2 {
  margin: 0 0 18px;
  color: #1f5fbf;
  font-size: 28px;
  line-height: 1.2;
}

.popular-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.popular-tile {
  min-width: 0;
}

.popular-tile a {
  display: grid;
  gap: 9px;
  color: #1f2933;
  text-decoration: none;
}

.popular-tile img,
.popular-tile-placeholder {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 8px;
  background: #e8eef8;
}

.popular-tile span:last-child {
  color: #1f5fbf;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.25;
}

.popular-tile a:hover span:last-child {
  text-decoration: underline;
}

.category-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0 0 34px;
  padding: 10px 0;
  border-top: 1px solid #d7e2f2;
  border-bottom: 1px solid #d7e2f2;
}

.category-nav a {
  padding: 7px 10px;
  border: 1px solid #d7e2f2;
  border-radius: 6px;
  color: #1f5fbf;
  text-decoration: none;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.2;
}

.category-nav a:hover,
.category-nav a.active {
  border-color: #1f5fbf;
  background: rgba(31, 95, 191, 0.08);
}

.empty-state {
  padding: 18px;
  border: 1px solid #d7e2f2;
  border-radius: 8px;
  color: #52606d;
  text-align: center;
}

.back-link {
  margin: 0 0 24px;
}

.recipe-detail {
  max-width: 900px;
  margin: 0 auto;
  padding: 28px;
  border: 1px solid #d7e2f2;
  border-radius: 10px;
}

.recipe-hero-image {
  max-width: 1100px;
  margin: 0 auto 30px;
}

.recipe-hero-image img {
  display: block;
  float: none;
  width: 100%;
  height: auto;
  margin: 0;
  border-radius: 8px;
}

.recipe-detail-header {
  margin: 0 0 24px;
  text-align: center;
}

.recipe-detail-header h2 {
  font-size: 34px;
  line-height: 1.15;
}

.language-switcher {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin: 10px 0 14px;
}

.language-switcher a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border: 1px solid #d7e2f2;
  border-radius: 6px;
  background: #ffffff;
  text-decoration: none;
}

.language-switcher a.active {
  border-color: #1f5fbf;
  outline: 2px solid rgba(31, 95, 191, 0.18);
}

.recipe-actions {
  display: flex;
  justify-content: center;
  margin-top: 14px;
}

.ingredients-list {
  margin: 0 0 20px;
}

.ingredients-list p {
  margin: 0 0 6px;
}

.ingredients-list ul {
  margin: 0 0 0 20px;
  padding: 0;
}

.blog-post {
  white-space: normal;
}

.blog-post p:first-child {
  margin-top: 0;
}

.blog-post h3,
.blog-post h4,
.blog-post h5 {
  clear: none;
  color: #1f5fbf;
  line-height: 1.2;
}

.blog-post h3 {
  margin: 24px 0 8px;
  font-size: 24px;
}

.blog-post h4 {
  margin: 20px 0 8px;
  font-size: 19px;
}

.blog-post h5 {
  margin: 16px 0 6px;
  font-size: 16px;
}

@media (max-width: 900px) {
  body {
    --side-line-inset: 48px;
    --side-line-width: 7px;
  }

  .page-shell {
    width: min(100% - 120px, 760px);
    padding: 40px 0 56px;
  }

  .site-header {
    padding: 24px 20px 12px;
  }

  .site-title,
  .intro h2 {
    font-size: 48px;
  }

  .landing-page {
    width: min(100% - 120px, 760px);
  }

  .landing-header {
    grid-template-columns: 1fr;
    gap: 34px;
    margin-bottom: 48px;
  }

  .landing-title {
    font-size: 62px;
  }

  .search-section {
    width: 100%;
  }

  .popular-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .recipe-detail {
    max-width: 100%;
  }

}

.form-panel {
  max-width: 760px;
  margin: 0 auto;
  padding: 28px;
  border: 1px solid #d7e2f2;
  border-radius: 10px;
  background: #ffffff;
}

.form-panel h2 {
  margin: 0 0 8px;
  color: #1f5fbf;
}

.form-help,
.field-help {
  margin: 0 0 20px;
  color: #52606d;
}

.field-help {
  font-size: 14px;
}

.form-message {
  padding: 12px 14px;
  border-radius: 8px;
  font-weight: 700;
}

.form-message-error {
  border: 1px solid #f2b8b8;
  background: #fff1f1;
  color: #9f1d1d;
}

.form-message-success {
  border: 1px solid #b7dfbf;
  background: #f0fff3;
  color: #226b33;
}

.recipe-form {
  display: grid;
  gap: 10px;
}

.recipe-form h3 {
  margin: 0 0 6px;
  color: #1f5fbf;
}

.import-form {
  margin-bottom: 18px;
}

.json-example {
  margin: 8px 0 24px;
  color: #52606d;
}

.json-example summary {
  cursor: pointer;
  font-weight: 700;
}

.json-example pre {
  overflow: auto;
  margin: 10px 0 0;
  padding: 14px;
  border: 1px solid #d7e2f2;
  border-radius: 8px;
  background: #f8fafc;
  color: #1f2933;
  font-size: 13px;
  line-height: 1.45;
}

.form-divider {
  width: 100%;
  margin: 28px 0;
  border: 0;
  border-top: 1px solid #d7e2f2;
}

.recipe-form label {
  font-weight: 700;
}

.recipe-form .checkbox-field {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
}

.recipe-form input,
.recipe-form textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid #b8c7dc;
  border-radius: 6px;
  font: inherit;
}

.recipe-form .checkbox-field input {
  width: auto;
}

.recipe-form textarea {
  resize: vertical;
}

.recipe-form input:focus,
.recipe-form textarea:focus {
  border-color: #1f5fbf;
  outline: 2px solid rgba(31, 95, 191, 0.18);
}

.primary-button {
  justify-self: start;
  margin-top: 8px;
  padding: 12px 18px;
  border: 0;
  border-radius: 6px;
  background: #1f5fbf;
  color: #ffffff;
  cursor: pointer;
  font: inherit;
  font-weight: 700;
}

.primary-button:hover {
  background: #184b98;
}

.secondary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 14px;
  border: 1px solid #1f5fbf;
  border-radius: 6px;
  background: #ffffff;
  color: #1f5fbf;
  cursor: pointer;
  font: inherit;
  font-weight: 700;
  line-height: 1.2;
  text-decoration: none;
}

.secondary-button:hover {
  background: rgba(31, 95, 191, 0.08);
}

@media (max-width: 640px) {
  body {
    --side-line-inset: 18px;
    --side-line-width: 6px;
  }

  .page-shell {
    width: min(100% - 64px, 900px);
    padding: 30px 0 44px;
  }

  .search-section {
    margin-top: 0;
  }

  .intro h2 {
    font-size: 38px;
  }

  .site-title {
    font-size: 38px;
  }

  .landing-page {
    width: min(100% - 64px, 900px);
  }

  .landing-header {
    gap: 28px;
    margin-bottom: 42px;
  }

  .landing-title {
    font-size: 48px;
  }

  .popular-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
  }

  .popular-section h2 {
    font-size: 24px;
  }

  .recipe-detail-header h2 {
    font-size: 28px;
  }

  .form-panel,
  .recipe-detail,
  .recipe-list-item {
    padding: 18px;
  }

  .recipe-detail {
    border-radius: 8px;
  }

  .post-meta {
    justify-content: center;
  }
}

@media (max-width: 390px) {
  body {
    --side-line-inset: 10px;
    --side-line-width: 4px;
  }

  .page-shell {
    width: min(100% - 40px, 900px);
  }

  .search-section {
    margin-top: 0;
  }

  .recipe-detail-header h2 {
    font-size: 24px;
  }

  .landing-page {
    width: min(100% - 40px, 900px);
  }

  .landing-title {
    font-size: 42px;
  }

  .popular-grid {
    grid-template-columns: 1fr;
  }
}
