/*
1. Prevent padding and border from affecting element width. (https://github.com/mozdevs/cssremedy/issues/4)
2. Allow adding a border to an element by just adding a border-width. (https://github.com/tailwindcss/tailwindcss/pull/116)
*/

*,
::before,
::after {
  box-sizing: border-box; /* 1 */
  border-width: 0; /* 2 */
  border-style: solid; /* 2 */
  border-color: #e5e7eb; /* 2 */
}

/*
1. Use a consistent sensible line-height in all browsers.
2. Prevent adjustments of font size after orientation changes in iOS.
3. Use a more readable tab size.
4. Use the user's configured `sans` font-family by default.
5. Use the user's configured `sans` font-feature-settings by default.
*/

html {
  line-height: 1.5; /* 1 */
  -webkit-text-size-adjust: 100%; /* 2 */
  -moz-tab-size: 4; /* 3 */
  -o-tab-size: 4;
  tab-size: 4; /* 3 */
  font-family:
    ui-sans-serif,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    'Segoe UI',
    Roboto,
    'Helvetica Neue',
    Arial,
    'Noto Sans',
    sans-serif,
    'Apple Color Emoji',
    'Segoe UI Emoji',
    'Segoe UI Symbol',
    'Noto Color Emoji'; /* 4 */
  font-feature-settings: normal; /* 5 */
}

/*
1. Remove the margin in all browsers.
2. Inherit line-height from `html` so users can set them as a class directly on the `html` element.
*/

body {
  margin: 0; /* 1 */
  line-height: inherit; /* 2 */
}

/*
Remove the default font size and weight for headings.
*/

h1,
h2,
h3,
h4,
h5,
h6 {
  font-size: inherit;
  font-weight: inherit;
}

/*
Reset links to optimize for opt-in styling instead of opt-out.
*/

a {
  color: inherit;
  text-decoration: inherit;
}

/*
Add the correct font weight in Edge and Safari.
*/

b,
strong {
  font-weight: bolder;
}

/*
Add the correct font size in all browsers.
*/

small {
  font-size: 80%;
}

/*
1. Remove text indentation from table contents in Chrome and Safari. (https://bugs.chromium.org/p/chromium/issues/detail?id=999088, https://bugs.webkit.org/show_bug.cgi?id=201297)
2. Correct table border color inheritance in all Chrome and Safari. (https://bugs.chromium.org/p/chromium/issues/detail?id=935729, https://bugs.webkit.org/show_bug.cgi?id=195016)
3. Remove gaps between table borders by default.
*/

table {
  text-indent: 0; /* 1 */
  border-color: inherit; /* 2 */
  border-collapse: collapse; /* 3 */
}

/*
1. Change the font styles in all browsers.
2. Remove the margin in Firefox and Safari.
3. Remove default padding in all browsers.
*/

button,
input,
optgroup,
select,
textarea {
  font-family: inherit; /* 1 */
  font-size: 100%; /* 1 */
  font-weight: inherit; /* 1 */
  line-height: inherit; /* 1 */
  color: inherit; /* 1 */
  margin: 0; /* 2 */
  padding: 0; /* 3 */
}

/*
Remove the inheritance of text transform in Edge and Firefox.
*/

button,
select {
  text-transform: none;
}

/*
1. Correct the inability to style clickable types in iOS and Safari.
2. Remove default button styles.
*/

button,
[type='button'],
[type='reset'],
[type='submit'] {
  -webkit-appearance: button; /* 1 */
  background-color: transparent; /* 2 */
  background-image: none; /* 2 */
}

/*
Use the modern Firefox focus style for all focusable elements.
*/

:-moz-focusring {
  outline: auto;
}

/*
1. Correct the odd appearance in Chrome and Safari.
2. Correct the outline style in Safari.
*/

[type='search'] {
  border: 1px solid;
  padding: 4px 8px;
  border-radius: 4px;
}

/*
Remove the inner padding in Chrome and Safari on macOS.
*/

::-webkit-search-decoration {
  -webkit-appearance: none;
}

/*
Removes the default spacing and border for appropriate elements.
*/

blockquote,
dl,
dd,
h1,
h2,
h3,
h4,
h5,
h6,
hr,
figure,
p,
pre {
  margin: 0;
}

fieldset {
  margin: 0;
  padding: 0;
}

legend {
  padding: 0;
}

ol,
ul,
menu {
  list-style: none;
  margin: 0;
  padding: 0;
}

/*
1. Reset the default placeholder opacity in Firefox. (https://github.com/tailwindlabs/tailwindcss/issues/3300)
2. Set the default placeholder color to the user's configured gray 400 color.
*/

input::-moz-placeholder,
textarea::-moz-placeholder {
  opacity: 1; /* 1 */
  color: #9ca3af; /* 2 */
}

input::placeholder,
textarea::placeholder {
  opacity: 1; /* 1 */
  color: #9ca3af; /* 2 */
}

/*
Set the default cursor for buttons.
*/

button,
[role='button'] {
  cursor: pointer;
}

/*
Make sure disabled buttons don't get the pointer cursor.
*/
:disabled {
  cursor: default;
}

/*
1. Make replaced elements `display: block` by default. (https://github.com/mozdevs/cssremedy/issues/14)
2. Add `vertical-align: middle` to align replaced elements more sensibly by default. (https://github.com/jensimmons/cssremedy/issues/14#issuecomment-634934210)
   This can trigger a poorly considered lint error in some tools but is included by design.
*/

img,
svg,
video,
canvas,
audio,
iframe,
embed,
object {
  display: block; /* 1 */
  vertical-align: middle; /* 2 */
}

/*
Constrain images and videos to the parent width and preserve their intrinsic aspect ratio. (https://github.com/mozdevs/cssremedy/issues/14)
*/

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

/* Make elements with the HTML hidden attribute stay hidden by default */
[hidden] {
  display: none;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  margin-top: 0.75rem;
  margin-bottom: 0.25rem;
  font-weight: 700;
}

h2 {
  font-size: 1.5rem;
  line-height: 2rem;
}

h3 {
  font-size: 1.25rem;
  line-height: 1.75rem;
}

ul,
ol {
  list-style-position: inside;
}

ul {
  list-style-type: disc;
}

ol {
  list-style-type: decimal;
}

.container {
  width: 100%;
  margin-left: auto;
  margin-right: auto;
}

@media (min-width: 640px) {
  .container {
    max-width: 640px;
  }
}
@media (min-width: 768px) {
  .container {
    max-width: 80%;
  }
}
@media (min-width: 1500px) {
  .container {
    max-width: 1200px;
  }
}

.rounded-r-sm {
  border-top-right-radius: 0.125rem;
  border-bottom-right-radius: 0.125rem;
}
.rounded-l-sm {
  border-top-left-radius: 0.125rem;
  border-bottom-left-radius: 0.125rem;
}

.border-r {
  border-right-width: 1px;
}
.border-l {
  border-left-width: 1px;
}

.site-nav {
  background-color: #32cd32;
  margin-bottom: 0.75rem;
}

.site-nav > .container {
  padding: 0.75rem;
}

.site-link {
  font-weight: 700;
  font-size: 1.875rem;
  line-height: 2.25rem;
  color: rgb(255 255 255 / 1);
}

a:hover {
  text-decoration-line: underline;
}

main {
  margin-bottom: 1rem;
  padding: 0.75rem;
}

.recipe-container {
  display: grid;
  grid-template-columns: repeat(1, minmax(0, 1fr));
}

.recipe {
  padding: 1.25rem;
  order: 9999;
  border-width: 1px;
  border-style: solid;

  border-color: rgb(229 231 235 / 1);
  border-radius: 0.25rem;
}

.recipe > header {
  margin-bottom: 1rem;
  padding-bottom: 1rem;
  border-top-left-radius: 0.25rem;
  border-top-right-radius: 0.25rem;
  border-bottom-width: 1px;
  border-style: solid;
  border-color: rgb(156 163 175 / 1);
}

.recipe > header .title-container {
  padding-right: 3rem;
  padding-bottom: 0.5rem;
}

.recipe > header .title {
  margin-top: 0px;
  margin-bottom: 0.5rem;
  margin-left: -1.25rem;
  padding: 0.5rem;
  padding-left: 1.25rem;
  font-weight: 700;
  font-size: 1.875rem;
  line-height: 2.25rem;
  background-color: rgb(229 231 235 / 1);
  opacity: 0.75;
  border-top-right-radius: 0.125rem;
  border-bottom-right-radius: 0.125rem;
}

.recipe h2 {
  font-weight: 700;
  font-size: 1.5rem;
  line-height: 2rem;
  margin-top: 0px;
}

.category {
  background-color: rgb(229 231 235 / 1);
  opacity: 0.75;
  margin-left: -1.25rem;
  padding-top: 0.25rem;
  padding-bottom: 0.25rem;
  padding-right: 0.75rem;
  padding-left: 1.25rem;
  font-size: 0.875rem;
  line-height: 1.25rem;
  font-weight: 600;
  border-top-right-radius: 0.125rem;
  border-bottom-right-radius: 0.125rem;
}

.recipe .infos {
  padding-bottom: 0.75rem;
  display: flex;
  flex-direction: column;
}

.recipe .infos > div {
  flex: 1 1 auto;
}

.recipe .infos table {
  table-layout: auto;
  border-collapse: collapse;
  width: 100%;
}

.recipe .infos table th,
.recipe .infos table td {
  padding-left: 1rem;
  padding-right: 1rem;
  padding-top: 0.5rem;
  padding-bottom: 0.5rem;
}

.recipe .infos table th {
  background-color: rgb(229 231 235 / 1);
  border-bottom-width: 1px;
}

.recipe .infos table td {
  text-align: center;
  border-top-width: 1px;
}

.recipe .ingredients ul {
  margin-top: 1rem;
  list-style-type: none;
}

.recipe .instructions {
  margin-top: 0.5rem;
}

.recipe-picture {
  margin-bottom: 1.5rem;
}

#no-results {
  margin: 16px 0;
}

@media (min-width: 1024px) {
  .recipe-container {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1.5rem;
  }

  .recipe {
    order: -9999;
    grid-column: span 2 / span 2;
  }

  .recipe .infos {
    flex-direction: row-reverse;
  }

  .recipe .infos .table-container {
    margin-left: 1rem;
  }

  .recipe-picture {
    grid-column: span 1 / span 1;
  }
}
