/******************************************************************************/
/* Fonts and colors                                                           */
/******************************************************************************/

@import url('https://fonts.googleapis.com/css2?family=Dancing+Script&display=swap');

:root {
  --bg: #ffffff;
  --text: #1f2933;
  --muted: #5b6470;
  --accent: #D76652;
  --accent-dark: #2899AD;
  --border: #d9dde3;
  --soft-bg: #f7f8fa;
  --card-bg: #ffffff;
}

/******************************************************************************/
/* Base page                                                                  */
/******************************************************************************/

html {
  scroll-padding-top: 4rem;
}

body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Georgia, "Times New Roman", Times, serif;
  line-height: 1.6;
  text-align: center;
}

a {
  color: var(--accent);
}

a:hover {
  color: var(--accent-dark);
}

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

/******************************************************************************/
/* Header and navigation                                                      */
/******************************************************************************/

header {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 1000;

  width: 100%;
  box-sizing: border-box;

  background: var(--bg);
  color: var(--text);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);

  padding: 0.9rem 2rem;
}

.header-content {
  max-width: 1060px;
  margin: 0 auto;

  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
}

.header-left {
  color: var(--text);
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  font-family: "Dancing Script", cursive;
}

nav {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 0.75rem;

  font-size: 1rem;
}

nav a {
  color: var(--accent);
  padding: 0.35rem 0.2rem;
  font-weight: 600;
  text-decoration: none;
}

nav a:hover {
  color: var(--accent-dark);
}

nav a.active {
  color: var(--accent);
  border-bottom: 2px solid var(--accent);
}

/******************************************************************************/
/* Containers                                                                 */
/******************************************************************************/

.container-wrapper {
  width: 100%;
}

.container,
.container-main-page,
.container-smaller-top-margin {
  max-width: 1060px;
  width: calc(100% - 2rem);
  box-sizing: border-box;

  margin-left: auto;
  margin-right: auto;

  background: var(--soft-bg);
  color: var(--text);

  padding: 2rem;
  text-align: left;
}

.container,
.container-main-page {
  margin-top: 6.5rem;
}

.container-smaller-top-margin {
  margin-top: 6.5rem;
}

.container-main-page {
  display: flex;
  gap: 2rem;
  align-items: center;
}

.container-content {
  flex: 1;
  border-right: 1px solid var(--border);
  padding-right: 2rem;
}

.container-sidebar {
  width: 35%;
}

img.profile {
  width: 230px;
  border-radius: 12px;
  display: block;
  margin: 0.5rem auto 1rem auto;
}

/******************************************************************************/
/* Homepage three-column section                                              */
/******************************************************************************/

#three-column {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;

  margin-top: 2rem;
  padding: 0;
  text-align: center;
}

#three-column #tbox1,
#three-column #tbox2,
#three-column #tbox3 {
  box-sizing: border-box;
  padding: 1.5rem;

  background: var(--card-bg);
  border: 1px solid var(--border);
}

#three-column h2 {
  margin: 0.5em 0;
  color: var(--text);
  font-size: 1.5rem;
}

#three-column img {
  width: 220px;
  display: block;
  margin: 0 auto 1rem auto;
}

/******************************************************************************/
/* Buttons                                                                    */
/******************************************************************************/

.button,
.recipe-button {
  display: inline-block;

  background: var(--accent);
  color: white;

  border: none;
  border-radius: 4px;

  padding: 0.65rem 1.2rem;

  font-size: 0.95rem;
  line-height: 1.4;
  text-decoration: none;
  cursor: pointer;
}

.button:hover,
.recipe-button:hover {
  background: var(--accent-dark);
  color: white;
  text-decoration: none;
}

/******************************************************************************/
/* Recipe list pages                                                          */
/******************************************************************************/

.recipe-list {
  list-style-type: none;
  margin: 0;
  padding: 0;
}

.recipe-item {
  display: flex;
  align-items: center;
  gap: 2rem;

  border-bottom: 1px solid var(--border);
  padding: 1.25rem 0;
}

.recipe-item img {
  width: 300px;
  border: 1px solid var(--border);
}

.recipe-description {
  flex: 1;
}

.recipe-description h2 {
  margin-top: 0;
}

.recipe-description h3,
.recipe-below-image h3 {
  margin-top: 0;
  margin-bottom: 0;
}


/******************************************************************************/
/* Single recipe pages                                                        */
/******************************************************************************/

.recipe-item.single-recipe {
  align-items: flex-start;
}

.recipe-left {
  width: 350px;
  flex-shrink: 0;
}

.recipe-left img {
  width: 100%;
  height: auto;
  margin: 0;
  border: 1px solid var(--border);
}

.recipe-below-image {
  margin-top: 1rem;
  padding: 1rem;
  background: var(--card-bg);
  border: 1px solid var(--border);
}

.recipe-below-image h3 {
  margin-top: 0;
}

.recipe-below-image ul {
  margin-bottom: 0;
  padding-left: 1.2rem;
}

.recipe-item.single-recipe .recipe-description {
  flex: 1;
}

/******************************************************************************/
/* Search                                                                     */
/******************************************************************************/

#search-input {
  width: 100%;
  max-width: 520px;
  box-sizing: border-box;

  padding: 0.85rem 1rem;
  margin: 1rem 0 2rem 0;

  font-family: inherit;
  font-size: 1rem;
  line-height: 1.4;

  border: 1px solid #d8cfc5;
  border-radius: 999px;

  background-color: #fffaf5;
  color: #333;

  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  outline: none;
}

#search-input::placeholder {
  color: #9a8d82;
}

#search-input:focus {
  border-color: #b88768;
  box-shadow: 0 0 0 3px rgba(184, 135, 104, 0.18);
}



.home-search input {
  width: 100%;
  max-width: 520px;
  box-sizing: border-box;

  padding: 0.85rem 1rem;
  margin: 1rem 0;

  font-family: inherit;
  font-size: 1rem;
  line-height: 1.4;

  border: 1px solid #d8cfc5;
  border-radius: 999px;

  background-color: #fffaf5;
  color: #333;

  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  outline: none;
}

.home-search input::placeholder {
  color: #9a8d82;
}

.home-search input:focus {
  border-color: #b88768;
  box-shadow: 0 0 0 3px rgba(184, 135, 104, 0.18);
}


/******************************************************************************/
/* Footer                                                                     */
/******************************************************************************/

.container-footer {
  max-width: 1060px;
  width: calc(100% - 2rem);
  box-sizing: border-box;

  margin: 2rem auto 0 auto;
  padding: 1rem;

  background: var(--text);
  color: white;
  text-align: center;
}

/******************************************************************************/
/* Mobile                                                                     */
/******************************************************************************/

@media screen and (max-width: 768px) {
  header {
    position: static;
    padding: 1rem;
  }

  .header-content {
    flex-direction: column;
    gap: 0.75rem;
    text-align: center;
  }

  nav {
    justify-content: center;
    gap: 0.35rem 0.8rem;
    font-size: 0.95rem;
  }

  .container,
  .container-main-page,
  .container-smaller-top-margin {
    width: calc(100% - 1rem);
    margin-top: 1rem;
    padding: 1.25rem;
  }

  .container-main-page {
    flex-direction: column;
  }

  .container-content,
  .container-sidebar {
    width: 100%;
    padding: 0;
    border-right: none;
  }

  #three-column {
    grid-template-columns: 1fr;
  }

  #three-column img {
    width: 180px;
  }

  .recipe-item {
    flex-direction: column;
    text-align: center;
  }

  .recipe-item img {
    width: min(260px, 100%);
  }

  .recipe-description {
    width: 100%;
  }

  .recipe-left {
      width: 100%;
  }

  .recipe-item.single-recipe {
      flex-direction: column;
  }
}
