/* Huge shout out to VS Code autocomplete */

/*
Not really a CSS reset, but inspiration from:
https://css-tricks.com/poll-results-what-css-reset-do-you-use/
*/
* {
  margin: 0;
}

/* https://css-tricks.com/the-css-box-model/ */
body {
  font-family: system-ui, sans-serif;
  color: #303030;
  background-color: #f6f6f6;
  width: 60%;
  margin: auto;
  margin-top: 80px;
  margin-bottom: 80px;
  display: flex;
  flex-direction: column;
  gap: 48px;
}

header {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
}

.heading {
  font-size: 24pt;
  font-weight: bold;
}

.input-form {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.input-label {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.input-field {
  border-radius: 0px;
  border-style: solid;
  border-width: 1px;
  border-color: #b0b0b0;
  padding: 8px 10px;
}

/* https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/textarea#controlling_whether_a_textarea_is_resizable */
.input-area {
  font-family: system-ui, sans-serif;
  resize: vertical;
  min-height: fit-content;
  max-height: 128px;
}

/* 
https://developer.mozilla.org/en-US/docs/Web/CSS/Reference/Properties/cursor
 */
.primary-button {
  border-radius: 0px;
  border-style: none;
  padding: 10px 24px;
  background-color: #303030;
  color: white;
  cursor: pointer;
  margin-top: 6px;
  width: fit-content;
}

/*
https://developer.mozilla.org/en-US/docs/Web/CSS/Reference/Selectors/Pseudo-classes
*/
.primary-button:disabled {
  opacity: 50%;
  cursor: default;
}

.secondary-button {
  border-radius: 0px;
  border-style: solid;
  border-width: 1px;
  border-color: #303030;
  padding: 6px 16px;
  background-color: transparent;
  color: #303030;
  cursor: pointer;
  margin-top: 6px;
  width: fit-content;
  height: fit-content;
}

.secondary-button:disabled {
  opacity: 30%;
  cursor: default;
}

.page-top {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.page-top-title {
  font-size: 20pt;
}

.page-top-credits-link {
  color: #303030;
  text-decoration: none;
}

.add-image-collapser {
  display: flex;
  flex-direction: row;
  gap: 8px;
}

/* https://developer.mozilla.org/en-US/docs/Web/CSS/Reference/Properties/user-select */
.clickable-text {
  user-select: none;
  font-weight: bold;
  cursor: pointer;
}

.clickable-text:hover {
  text-decoration: underline;
}

.text-button {
  border-style: none;
  background-color: transparent;
  padding: 0;
  font-size: medium;
}

/*
https://developer.mozilla.org/en-US/docs/Web/CSS/Reference/Properties/transition
https://stackoverflow.com/questions/44846614/trigger-css-animations-in-javascript
*/
.add-image-collapser-icon {
  user-select: none;
  transition: rotate 0.1s ease-out;
}

.add-image-collapser-icon-collapsed {
  rotate: 0deg;
}

.add-image-collapser-icon-expanded {
  rotate: 90deg;
}

/* https://developer.mozilla.org/en-US/docs/Web/CSS/Reference/Properties/overflow */
.add-image-form {
  display: flex;
  flex-direction: column;
  background-color: #ececec;
  padding: 48px;
  margin-top: -32px;
  overflow: hidden;
}

/* 
https://developer.mozilla.org/en-US/docs/Web/CSS/Reference/Properties/clip-path
https://developer.mozilla.org/en-US/docs/Web/CSS/Reference/Values/calc-size
*/
.add-image-form-collapsed {
  /* Height = 0 continues to show a visible region, so clip-path is needed.
  Height still needs to change since it determines the position of bottom elements.
  */
  clip-path: rect(0 100% 0 0);
  height: 0;
  /* Make bottom content go above padding and margin. */
  margin-bottom: calc(-48px - 48px - 32px - 16px);
  /* ease out quartic */
  transition: all 0.3s cubic-bezier(0.25, 1, 0.5, 1);
}

.add-image-form-expanded {
  clip-path: rect(0 100% 100% 0);
  height: calc-size(fit-content, size);
  margin-bottom: 0px;
  /* ease out quartic, slower when expanding */
  transition: all 0.5s cubic-bezier(0.25, 1, 0.5, 1);
}

.image-gallery {
  display: flex;
  flex-direction: row;
  gap: 48px;
}

/* https://developer.mozilla.org/en-US/docs/Web/CSS/Reference/Selectors/Child_combinator */
.image-gallery > * {
  display: flex;
  flex-direction: column;
  width: 0px;
  flex-grow: 1;
  gap: 16px;
}

.image-section-info {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
}

.image-section-attribution {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.image-section-title {
  font-size: 24pt;
}

.image-section-image {
  width: 100%;
}

.nav-buttons {
  display: flex;
  flex-direction: row;
  gap: 8px;
}

.comment-section {
  display: flex;
  flex-direction: column;
  gap: 48px;
}

.comments {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.comments-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* https://css-tricks.com/snippets/css/a-guide-to-flexbox/ */
.comment-info {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
}

.comment {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 24px;
  background-color: white;
  border-radius: 0px;
  border-style: solid;
  border-width: 1px;
  border-color: #30303033;
}

.comment-author {
  font-weight: bold;
}

.comment-date {
  opacity: 50%;
}
