:root {
  --radius: 0.2rem;
}

/* Overall Styling */
* {
  box-sizing: border-box;
  padding: 0;
  margin: 0;
}

body {
  background-color: #2A0A0A;
  color: #FDF6EC;
  font-family: 'Helvetica Neue', Arial, sans-serif;
}

a {
    color: #C23A3A;
}

a:hover {
    color: #2A0A0A;
}

a:visited {
    color: #2A0A0A;
}

h1, h2, h3, h4, h5, h6 {
  font-family: 'Helvetica Neue', Arial, sans-serif;
  line-height: 1.4;
}

li {
  list-style: disc;
  margin-left: 24px;
  margin-top: 12px;
  margin-bottom: 12px;
}

.card-overlay {
  border-radius: var(--radius);
  overflow: hidden;
  background-color: rgba(0, 0, 0, 0.35);
  box-shadow: 0 0 88px 0 rgba(0, 0, 0, 0.52);
  color: #FDF6EC;
  padding: 0.5rem 1rem;
}

/* Navigation Bar */
header {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  margin: 0;
  padding: 0.5rem 1rem;
  background-color: rgba(22,5,5,0.8);
  font-family: 'Helvetica Neue', Arial, sans-serif;
  font-weight: normal;
  font-style: normal;
  box-shadow: 0 0 88px 0 rgba(0, 0, 0, 0.52);
}

@media screen and (min-width: 1081px) {
  header {
    padding: 1rem 3rem;
    flex-wrap: nowrap;
  }
}

header h1 {
  text-transform: uppercase;
  font-size: 1rem;
  margin: 0;
  padding: 0.4rem 0;
  flex-shrink: 0;
}

header h1 a {
  text-decoration: none;
  color: #FDF6EC;
}

/* Hamburger button */
.nav-toggle {
  display: block;
  background: none;
  border: none;
  color: #FDF6EC;
  font-size: 1.4rem;
  cursor: pointer;
  padding: 0.2rem 0.4rem;
  line-height: 1;
  margin-left: auto;
}

@media screen and (min-width: 1081px) {
  .nav-toggle {
    display: none;
  }
}

/* Nav: hidden on mobile by default, full-width drop-down when open */
#site-nav {
  display: none;
  width: 100%;
}


#site-nav ul {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  list-style: none;
  padding: 0.5rem 1rem;
  gap: 0.6rem;
}

/* Desktop nav */
@media screen and (min-width: 1081px) {
  #site-nav {
    display: block;
    width: auto;
  }

  #site-nav ul {
    flex-direction: row;
    align-items: center;
    gap: 0;
    padding: 0;
  }
}

.nav__item {
  list-style: none;
}

.nav__link, .nav__link:visited {
  text-decoration: none;
  font-size: 0.9rem;
  color: #FDF6EC;
  text-transform: uppercase;
  font-weight: 700;
}

.nav__link:hover {
  color: #F5D98B;
}

.nav__item + .nav__item {
  margin-left: 0;
}

@media screen and (min-width: 1081px) {
  .nav__link, .nav__link:visited {
    font-size: 0.9rem;
  }

  .nav__item + .nav__item {
    margin-left: 2rem;
  }
}

/* Kafkaesque submenu */
.nav__sub-label {
  cursor: default;
}

.nav__sub-label::after {
  content: " \25BE";
}

/* Mobile: submenu always expanded, indented under its label */
#site-nav .nav__sub {
  list-style: none;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.6rem;
  margin: 0.6rem 0 0;
  padding: 0 1rem 0 0;
}

#site-nav .nav__sub .nav__item {
  margin: 0;
}

#site-nav .nav__sub .nav__link {
  font-size: 0.8rem;
}

/* Desktop: submenu as hover/focus dropdown */
@media screen and (min-width: 1081px) {
  .nav__item--has-sub {
    position: relative;
  }

  #site-nav .nav__sub {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.6rem;
    background-color: rgba(22, 5, 5, 0.95);
    box-shadow: 0 0 88px 0 rgba(0, 0, 0, 0.52);
    margin: 0;
    padding: 0.8rem 1rem;
    min-width: max-content;
    z-index: 10;
  }

  #site-nav .nav__item--has-sub:hover .nav__sub,
  #site-nav .nav__item--has-sub:focus-within .nav__sub {
    display: flex;
  }

  #site-nav .nav__sub .nav__link {
    font-size: 0.9rem;
  }
}

/* Cards */
.recipe-container {
  margin: 2.0rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(27rem, 0.3fr));
  grid-gap: 1.5rem;
  justify-content: center;
}

@media screen and (min-width: 1081px) {
  .recipe-container {
    grid-template-columns: repeat(auto-fit, minmax(33rem, 0.3fr));
    grid-gap: 1.5rem;
  }
}

.card {
  overflow: visible;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  cursor: pointer;
  position: relative;
  border-radius: var(--radius);
  padding-bottom: 30%;
}

.card a {
  text-decoration: none;
}

.card__image {
  height: 24rem;
  width: 100%;
  object-fit: cover;
}

.card__body {
  width: 100%;
  font-family: 'Helvetica Neue', Arial, sans-serif;
  text-align: center;
  padding: 0.5rem 0.5rem;
  position: absolute;
  top: 20rem;
  height: 50%;
  background: #FDF6EC;
  color: #1A1A1A;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.card__body h2 {
  padding-bottom: 0.3rem;
  font-family: 'Helvetica Neue', Arial, sans-serif;
  font-weight: normal;
  font-style: normal;
  font-size: 1.0em;
  color: #2A0A0A;
}

.card__body__in__page {
  width: 100%;
  font-family: 'Helvetica Neue', Arial, sans-serif;
  text-align: center;
  padding: 0.5rem 0.5rem;
  position: absolute;
  top: 85%;
  background: #2A0A0A;
  color: #FDF6EC;
}

.card__body__in__page h2 {
  margin-top: 0rem;
  padding: 0rem;
  font-family: 'Helvetica Neue', Arial, sans-serif;
  font-weight: normal;
  font-style: normal;
  font-size: 1.0em;
}

.card__body p {
  padding: 0;
  font-family: 'Helvetica Neue', Arial, sans-serif;
  font-weight: normal;
  font-style: normal;
  font-size: 1.0em;
}

.recipe-title-long {
  font-size: 1.2rem;
  padding-bottom: 0.3rem;
  padding-top: 0.3rem;
}

.recipe-title-extra-long {
  font-size: 1.0rem;
  padding-bottom: 0.55rem;
}

.card__body p {
  font-weight: normal;
}

.recipe-badge {
  border-radius: 6px;
  padding: 4px;
  display: inline-block;
  font-size: 0.8em;
  margin-top: 6px;
}

.badge1 {
  background-color: #C23A3A;
  color: #FDF6EC;
}

.badge2 {
  background-color: #F5D98B;
  color: #2A0A0A;
}

/* Footer */
footer {
  font-family: 'Helvetica Neue', Arial, sans-serif;
  text-align: center;
  margin: 2rem 0;
  padding: 1rem 0;
  background-color: #2A0A0A;
}

footer a {
  text-decoration: none;
  color: rgba(253,246,236,0.6);
}

footer a:hover {
  text-decoration: none;
  color: #FDF6EC;
}

/* Error Page Styling */
.errorpage-title {
  text-align: center;
  margin-top: 2rem;
  margin-bottom: 1em;
}

.errorpage-section {
  text-align: center;
  font-size: 1.15rem;
  margin-bottom: 1em;
}

/* Code Styling */

pre {
  display: flex;
  flex-wrap: wrap;
}

code {
  font-family: monospace;
  font-size: inherit;
  margin: 0.1rem 0;
}

p > code,
li > code,
dd > code,
td > code {
  background: transparent;
  word-wrap: break-word;
  box-decoration-break: clone;
  padding: .1rem .1rem .2rem;
  border-radius: .2rem;
}

pre code {
  display: block;
  background: none;
  white-space: pre;
  -webkit-overflow-scrolling: touch;
  overflow-x: scroll;
  max-width: 100%;
  min-width: 100px;
  padding: 0;
}

@media print {
	pre {
		overflow-x: auto;
		white-space: pre-wrap;
		white-space: -moz-pre-wrap !important;
		white-space: -pre-wrap;
		white-space: -o-pre-wrap;
		word-wrap: break-word;
		background: #FDF6EC;
	}
}

/* Banner styling */
.news-banner {
    position: relative;
    max-width: 1081px;
    margin: 0 auto;
    overflow: hidden;
    white-space: nowrap;
    padding: 0.5rem 1rem;
    background-color: transparent;
    border-radius: var(--radius);
    color: #FDF6EC;
    font-family: 'Helvetica Neue', Arial, sans-serif;
    display: flex;
    align-items: center;
}

.news-items-wrapper {
    display: inline-flex;
    animation: scroll-items 42s linear infinite;
    animation-timing-function: ease-in-out;
}

.news-banner:hover .news-items-wrapper {
    animation-play-state: paused;
}

.news-item {
    margin-right: 2rem;
    display: flex;
    align-items: center;
}

.news-item a {
    color: #FDF6EC;
    text-decoration: none;
}

.news-item a:hover {
    color: #FDF6EC;
}

@media (prefers-reduced-motion: reduce) {
  .news-items-wrapper {
    animation: none;
  }
}

@keyframes scroll-items {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

.news-item small {
    margin-left: 0.25rem;
    color: rgba(253,246,236,0.6);
}


/* Search Page Styles */
.search-page {
    max-width: 900px;
    margin: 2rem auto;
    padding: 1rem;
    background-color: #FDF6EC;
    color: #1A1A1A;
}

.search-page h1 {
    color: #2A0A0A;
    text-align: center;
    margin-bottom: 2rem;
}

.search-form {
    max-width: 600px;
    margin: 0 auto 2rem;
}

#search-input {
    width: 100%;
    padding: 1rem;
    font-size: 1.1rem;
    border: 2px solid #2A0A0A;
    border-radius: 4px;
    background-color: #FDF6EC;
    color: #1A1A1A;
    transition: all 0.3s ease;
}

#search-input:focus {
    outline: none;
    background-color: #FDF6EC;
    border-color: #C23A3A;
}

#search-input::placeholder {
    color: #666;
}

.results-count {
    color: #666;
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.search-result {
    background-color: #FDF6EC;
    border: 1px solid #2a0a0a;
    padding: 1rem;
    margin-bottom: 1.5rem;
    border-radius: 4px;
    transition: background-color 0.2s ease;
}

.search-result:hover {
    background-color: #FDF6EC;
}

.result-site-badge {
    display: inline-block;
    background-color: #C23A3A;
    color: #FDF6EC;
    padding: 0.2rem 0.6rem;
    border-radius: 3px;
    font-size: 0.75rem;
    font-weight: bold;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
}

/* Colored site badges */
.result-site-badge[data-site="Blue"] {
    background-color: #3F6FA6;
    color: #FDF6EC;
}

.result-site-badge[data-site="Green"] {
    background-color: #5E8C61;
    color: #FDF6EC;
}

.result-site-badge[data-site="Purple"] {
    background-color: #6E4B8B;
    color: #FDF6EC;
}

.result-site-badge[data-site="Red"] {
    background-color: #C23A3A;
    color: #FDF6EC;
}

.result-site-badge[data-site="Indigo"] {
    background-color: #3E3A78;
    color: #FDF6EC;
}

.result-site-badge[data-site="Broomstick"] {
    background-color: #F5D98B;
    color: #2A0A0A;
}

.result-snippet {
    margin: 0.35rem 0 0.4rem;
    font-size: 0.9rem;
    color: #2A0A0A;
    line-height: 1.5;
}

.result-snippet mark {
    background-color: #F5D98B;
    color: inherit;
    border-radius: 2px;
    padding: 0 0.15em;
}

.search-pagination {
    margin-top: 2rem;
    padding: 1rem 0;
}

.pagination-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.page-btn {
    background-color: #FDF6EC;
    border: 1px solid rgba(42, 10, 10, 0.25);
    color: #2A0A0A;
    padding: 0.5rem 1rem;
    cursor: pointer;
    border-radius: 4px;
    font-size: 0.9rem;
    transition: all 0.2s ease;
    min-width: 2.5rem;
}

.page-btn:hover {
    background-color: rgba(0, 0, 0, 0.04);
    border-color: #2A0A0A;
}

.page-btn.active {
    background-color: #2A0A0A;
    color: #FDF6EC;
    font-weight: bold;
    border-color: #2A0A0A;
    cursor: default;
}

.page-dots {
    color: #1A1A1A;
    padding: 0 0.25rem;
    user-select: none;
}

.result-title {
    margin: 0.5rem 0;
}

.result-title a {
    color: #2A0A0A;
    text-decoration: none;
    font-size: 1.2rem;
}

.result-title a:hover {
    color: #2A0A0A;
    text-decoration: underline;
    opacity: 0.75;
}

.result-url {
    color: #1A1A1A;
    opacity: 0.6;
    font-size: 0.85rem;
    text-decoration: none;
    word-break: break-all;
    display: inline-block;
    margin-top: 0.3rem;
}

.result-excerpt {
    color: #444;
    line-height: 1.6;
    margin: 0.75rem 0 0.5rem 0;
    font-size: 0.95rem;
}

.result-excerpt.loading {
    color: #888;
    font-style: italic;
}

.result-excerpt mark {
    background-color: #F5D98B;
    color: #2A0A0A;
    padding: 0.1rem 0.3rem;
    border-radius: 2px;
    font-weight: bold;
}
