/*
  CSSの`@import`は、複数ファイルの読み込みが遅いなどの理由で非推奨になっている
  ここでは1つのファイルだけを読み込む目的で使用することにする

  複数ファイルを読み込む場合は、

  - Sassの`@use`を使う
  - Frontmaterで複数のCSSファイルを指定できるようにする

  などの代替案を検討すること
*/
@import url("/assets/css/markdown.css");

html {
  scroll-padding-top: 100px;
  scroll-behavior: smooth;
}

main {
  background: #f3f3f3;
}
@media screen and (max-width: 519px) {
  main {
    padding: 15px;
  }
}
@media screen and (min-width: 750px) {
  main {
    --max-article-width: 660px;
    --aside-width: 250px;
    --column-gap: 60px;
    --w: calc(var(--max-article-width) + var(--column-gap) + var(--aside-width));
    display: grid;
    grid-template-columns: minmax(0, 1fr) var(--aside-width);
    row-gap: 30px; /* markdown.css側でも指定しているが、columnとの混同を防ぐため明示的に指定 */
    column-gap: var(--column-gap);
    padding-left: max(30px, calc((100vw - var(--w)) / 2));
    padding-right: max(30px, calc((100vw - var(--w)) / 2));
  }

  main > .page-header,
  main > .breadcrumbs {
    grid-column: 1 / -1;
  }

  main > .startups {
    grid-column: 1;
  }

  main > aside {
    grid-row: 2;
    grid-column: 2;
  }

  .startups ~ aside {
    grid-row: 3;
    padding-top: 20px;
  }
}

.page-header {
  display: flex;
  flex-direction: column;
  gap: 0.5em;
}

.page-header > h1 {
  margin: 0;
  font-size: 1.5em;
}

@media screen and (min-width: 520px) {
  .page-header > h1 {
    font-size: 2em;
  }
}

.page-header > p {
  line-height: 1.6;
}

.page-footer {
  padding: 20px 0;
  border-top: 1px solid #ddd;
  border-bottom: 1px solid #ddd;
}

.page-footer img {
  border-radius: 10px;
}

/* -----------------------------------------------------------------
オウンドメディア記事一覧
----------------------------------------------------------------- */

.startups {
  display: flex;
  flex-direction: column;
  row-gap: 1.5em;
}

.startups > p {
  color: #666;
}

.startups > article {
  padding: 1em;
  row-gap: 0.5em;
  text-decoration: none;
  border-radius: 0.5em;
  background: #fff;
  border: 1px solid hsl(0, 0%, 0%, 0.05);
}
@media screen and (min-width: 520px) {
  .startups > article {
    row-gap: 1em;
  }
}

.startups > article header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.startups > article .title {
  font-size: 18px;
  font-weight: bold;
}

.startups > article .meta {
  font-size: 14px;
  color: #999;
}

.startups > article .image-and-summary {
  display: grid;
  row-gap: 1em;
}
@media screen and (min-width: 520px) {
  .startups > article .image-and-summary {
    grid-template-columns: 120px 1fr;
    grid-template-rows: auto;
    align-items: center;
    column-gap: 1em;
  }
}
@media screen and (min-width: 960px) {
  .startups > article .image-and-summary {
    grid-template-columns: 180px 1fr;
  }
}

.startups > article .summary {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: auto auto;
  gap: 1em;
}

.startups > article .summary > li {
  display: grid;
  row-gap: 0.2em;
}

.startups > article .label {
  font-size: 14px;
  color: #999;
}

.startups > article img {
  display: block;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 1px;
  pointer-events: none;
  border: 1px solid #ddd;
}
@media screen and (min-width: 520px) {
  .startups > article img {
    aspect-ratio: 1 / 1;
  }
}
@media screen and (min-width: 960px) {
  .startups > article img {
    aspect-ratio: 3 / 2;
  }
}

.startups > article footer {
  padding-top: 1em;
  display: grid;
  grid-template-columns: auto 1fr;
  column-gap: 0.5em;
  border-top: 1px solid #ddd;
}
@media screen and (min-width: 414px) {
  .startups > article footer {
    grid-template-columns: 1fr 1fr;
  }
}
.startups > article footer > * {
  width: 100%;
  max-width: 100%;
}

.startups > article .link-button {
  background: #eee;
  color: #666;
}
.startups > article .link-button:hover {
  background: #ddd;
}

/* -----------------------------------------------------------------
サイドカラム
----------------------------------------------------------------- */

aside > .sticky-contents {
  display: flex;
  flex-direction: column;
  row-gap: 20px;
}

@media screen and (min-width: 750px) {
  aside > .sticky-contents {
    position: sticky;
    top: 100px;
  }
}

aside section {
  all: unset;
}

.industry-filter {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.industry-filter > header {
  font-size: 14px;
  font-weight: bold;
}

.industry-filter > ul {
  display: flex;
  flex-direction: column;
  border-radius: 2px;
  background: #fff;
  border: 1px solid #999;
}

.industry-filter a {
  display: block;
  padding: 0.5em 1em;
  font-size: 14px;
  white-space: nowrap;
  text-decoration: none;
  color: #666;
}
.industry-filter a:hover {
  background: #ddd;
}

/* pagination */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  background: #f3f3f3;
}
.pagination_button:not(.dots) {
  display: inline-block;
  text-align: center;
  font-size: 15px;
  margin: 10px 3px 0;
  height: 38px;
  min-width: 38px;
  line-height: 34px;
  background-color: #fff;
  border-radius: 38px;
  border: 2px solid #ddd;
  padding: 0 0.5em;
  font-weight: 700;
}
.pagination_button:not(.current):not(.dots):hover {
  background-color: #ececec;
}
.pagination_button.dots {
  width: 35px;
  text-align: center;
}
.article_index {
  margin: 20px 0 0;
  color: #666;
}
.pagination_button.current {
  color: var(--blue-2023);
  border-color: var(--blue-2023);
}
