@media only screen and (max-width: 680px) {
  .column {
    width: 100% !important;
    margin-left: 0 !important;
  }
}

* {
  box-sizing: border-box;
}

h1, h2, h3, h4 {
  line-height: 1.2;
  margin-bottom: 1px;
  padding: 3px 2px;
}

ul, ol {
  margin: 0;
}

li {
  margin: 2px 0;
}

/** For experiment: */

/* .column {
  margin-left: 46px;
}

.column:first-child {
  margin-left: 0;
} */

.page-cover {
  position: absolute;
  top: 0;
  right: 0;
  /* Firefox need this while Chrome doesn't. */
  left: 0;
  z-index: -1;
}

.page-cover img {
  width: 100%;
  height: 30vh;
  object-fit: cover;
}

/* On Android Firefox, emoji can't be displayed if font-size > 77px. */

.page-icon {
  line-height: 1.1;
  font-size: 75px;
}

.page-title {
  margin-top: calc(30vh - 65px);
}

.page-title--nocover {
  margin-top: 2.5rem;
}

.page-title>h1 {
  margin-top: 1em;
  line-height: 1.2;
}

.column {
  padding: 12px 0;
}

.column div:first-child h1, .column div:first-child h2, .column div:first-child h3, .column div:first-child h4 {
  margin-top: 1px;
}

.block {
  border-radius: 5px;
}

.block--indent, ul, ol {
  padding-left: 28px;
}

.block--text {
  min-height: 30px;
  margin: 2px auto;
  padding: 3px 2px;
}

.block--toggle {
  padding: 3px 0 3px 6px;
}

.block--bulleted_list_item {
  padding: 2px 0;
}

.block--numbered_list_item {
  padding: 3px 0;
}

.block--divider {
  padding: 6px 0;
  width: 100%;
}

.block--callout {
  display: flex;
  border-radius: 5px;
  padding: 16px 16px 16px 12px;
}

.block--bookmark {
  margin: 8px 0;
  border: 1px solid rgba(55, 53, 47, 0.16);
  border-radius: 5px;
  padding: 12px 14px 14px;
  transition: background 120ms ease-in 0s;
}

.block--bookmark:hover {
  background: rgba(55, 53, 47, 0.08);
}

.block--bookmark h5, .block--bookmark p {
  margin: 0;
}

.block--bookmark p {
  font-size: 0.75rem; /* Notion: 12/16 */
  line-height: 1rem; /* Notion: 16px with global base 16px */
}

.block--bookmark h5.title {
  margin-bottom: 2px;
  font-size: 0.875rem; /* Notion: 14/16 */
  font-weight: normal;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.block--bookmark p.description {
  opacity: 0.6;
  height: 2rem; /* Notion: 32px with global base 16px */
  overflow: hidden;
}

.block--bookmark p.link {
  margin-top: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.block--video, .block--embed {
  margin: 4px auto;
  display: flex;
  justify-content: center;
}

.block--audio audio {
  width: 100%;
}

.block--equation {
  margin: 1em 0;
}

.collection-view-table {
  overflow-x: scroll;
}

.collection-view-table table {
  font-size: 0.875rem; /* Notion: 14px (table) / 16px (global) */
  border-collapse: collapse; /* No double border */
  table-layout: fixed; /* Force table respect width of <th> */
  margin-bottom: 10px; /* Make space between table and scrollbar */
}

.collection-view-table table td, .collection-view-table table th {
  padding: 0 8px; /* For <th> and unknown <td> */
  height: 2rem; /* Notion: 32px */
  border: 1px solid rgba(55, 53, 47, 0.09);
  overflow: hidden;
  word-break: break-word;
}

.collection-view-table table td:first-child, .collection-view-table table th:first-child {
  border-left: none;
}

.collection-view-table table td:last-child, .collection-view-table table th:last-child {
  border-right: none;
}

.collection-view-table table th {
  text-align: left;
  font-weight: normal;
  opacity: 0.6;
}

.collection-view-table table td.cell-type-text {
  padding: 6px 8px;
  line-height: 1.5;
}

.collection-view-table table td.cell-type-select {
  padding: 3px 8px; /* 3px + 3px (margin of span) = 6px (desired) */
}

.collection-view-table table td.cell-type-select > span {
  padding: 0 6px;
  border-radius: 3px;
  white-space: nowrap;
  display: inline-block;
  margin: 3px 0; /* margin of inline-block doesn't collapse */
  margin-right: 6px;
}

.collection-view-table table td.cell-type-checkbox {
  padding: 6px 8px;
}

.collection-view-table table td.cell-type-checkbox > div {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 1rem;
  height: 1rem;
}

.collection-view-table table td.cell-type-checkbox > div.check-yes {
  background: rgb(46, 170, 220);
}

.collection-view-gallery .grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  grid-auto-rows: 1fr;
  gap: 16px;
  border-top: 1px solid rgba(55, 53, 47, 0.16);
  padding-top: 16px;
  padding-bottom: 4px;
}

.collection-view-gallery .grid-item {
  box-shadow: rgba(15, 15, 15, 0.1) 0px 0px 0px 1px, rgba(15, 15, 15, 0.1) 0px 2px 4px;
  border-radius: 5px;
  transition: background 120ms ease-in 0s;
  position: relative;
  padding-top: 70%; /* 10:7 */
}

.collection-view-gallery .grid-item:hover {
  background: rgba(55, 53, 47, 0.03);
}

.collection-view-gallery .gird-item-content {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
}

/* This is the key to make the layout robust. */
.collection-view-gallery .gird-item-content > div {
  /* grid-item-title has padding-top 8px, padding-bottom 10px, and its line-height.
     Since we can't get line-height with CSS, so just assign a large enough value. */
  height: calc(100% - 18px - 2rem);
}

.collection-view-gallery .grid-item-cover {
  box-shadow: rgba(55, 53, 47, 0.09) 0px -1px 0px 0px inset;
  height: 100%; 
}

.collection-view-gallery .grid-item-cover > img {
  width: 100%;
  height: 100%;
  border-radius: 5px 5px 0 0;
  object-fit: cover;
  object-position: center 50%;
  padding-bottom: 1px;
}

.collection-view-gallery .grid-item-cover--contain > img {
  object-fit: contain;
}

.collection-view-gallery .grid-item-title {
  padding-top: 8px;
  padding-left: 10px;
  padding-right: 10px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

@supports not (display: grid) {
  .collection-view-gallery .grid-item {
    margin-top: 16px;
  }
}