/*
 * Shared layout contracts for the three sites.
 * Site-specific typography, colors, icons, and spacing remain in the themes.
 */

/* Base */
*,
*:before,
*:after {
  margin: 0;
  padding: 0;
  -webkit-box-sizing: border-box;
  box-sizing: border-box;
}

html {
  font-size: 100%;
}

body {
  font-family: "YakuHanJPs", "NotoSansJP", "Hiragino Sans", "ヒラギノ丸ゴ Pro",
    "Hiragino Maru Gothic Pro", "ヒラギノ角ゴ Pro", "Hiragino Kaku Gothic Pro",
    Meiryo, sans-serif;
  font-size: 1rem;
  color: #767164;
  line-height: 2;
  background: #d5ccb4;
  -webkit-text-size-adjust: 100%;
}

a {
  color: #767164;
  -webkit-transition: 0.3s;
  transition: 0.3s;
  word-break: break-all;

  &:hover {
    color: #c1b7a3;
  }
}

img {
  image-rendering: -webkit-optimize-contrast;
  max-width: 100%;
  height: auto;
  border: none;
  vertical-align: middle;
}

a:hover img {
  opacity: 0.6;
}

table {
  border-collapse: collapse;
  border-spacing: 0;
  word-break: break-all;

  & th {
    background: #e1e1e1;
    font-weight: bold;
  }
}

/* Shell */
#container {
  width: 95%;
  max-width: 1000px;
  margin: 0 auto;

  @media screen and (max-width: 450px) {
    width: 98%;
  }
}

header {
  text-align: center;
  padding: clamp(5px, 2%, 10px) 0px;
}

#logo {
  line-height: 1;
  padding: 0 20px;

  & img {
    width: 100%;
    max-width: 500px;
  }
}

.tegalog-title {
  clear: both;
  border-radius: 4px;
  line-height: 2;
  font-weight: 700;
  color: #fff;
  padding: 5px 20px;
  background: #767164;
  font-size: 1.125rem;
}

.tegalog-title a {
  color: #ffffff;
}

/* ナビドロワー */
#nav-drawer {
  position: fixed;
  z-index: 998;
  top: 10px;
  right: 10px;

  .nav-unshown {
    display: none;
  }

  #nav-open {
    display: block;
    width: 25px;
    height: 27px;
    background: #d5ccb4;
    box-sizing: content-box;
    border-radius: 20%;
    padding: 8px 5px 0px 5px;

    & span,
    & span:before,
    & span:after {
      position: absolute;
      display: block;
      height: 3px;
      width: 25px;
      border-radius: 3px;
      background: #767164;
      content: "";
      cursor: pointer;
    }

    & span:before {
      bottom: -8px;
    }

    & span:after {
      bottom: -16px;
    }
  }

  #nav-close {
    display: none;
    position: fixed;
    z-index: 999;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: black;
    opacity: 0;
    transition: 0.3s ease-in-out;
  }

  #nav-content {
    text-align: left;
    overflow: auto;
    position: fixed;
    top: 0;
    right: 0;
    z-index: 1000;
    width: 85%;
    max-width: 330px;
    height: 100%;
    background: #fff;
    transition: 0.3s ease-in-out;
    transform: translateX(105%);

    & p {
      margin: 10px;
      padding: 7px 10px 10px;
    }

    & ul {
      margin: 10px 0 0;
      padding: 0 10px 0 28px;
      line-height: 1.6;
    }

    & li > ul {
      margin: 0;
      padding: 0 0 0 20px;
    }

    & li {
      margin: 0;
      padding: 3px 0;

      &::marker {
        color: #c1b7a3;
        font-weight: bold;
      }
    }
  }

  #nav-input:checked ~ #nav-close {
    display: block;
    opacity: 0.5;
  }

  #nav-input:checked ~ #nav-content {
    transform: translateX(0%);
    box-shadow: -6px 0 25px rgba(0, 0, 0, 0.15);
  }
}

#nav-content h2,
#nav-content h3 {
  clear: both;
  margin: 10px;
  padding: 2px 10px;
  border-radius: 4px;
  line-height: 2;
  font-weight: 700;
}

:where(#nav-content) h2,
:where(#nav-content) h3 {
  font-size: 1.0625rem;
}

#nav-content h2 {
  border: 2px solid #767164;
  background: #d5ccb4;
}

#nav-content h3 {
  color: #fff;
  border: 1px solid #767164;
  background: #767164;
}

:where(#nav-content) h3 a {
  color: #ffffff;
}

ul.mainlist > li {
  font-weight: bold;
  padding-bottom: 7px;

  & ul {
    list-style-type: circle;
    font-weight: normal;
    padding-left: 15px;
  }
}

#contents {
  margin-bottom: 15px;
  padding: 2% 2% calc(2% + 15px);
  line-height: 1.8;
  border: 5px solid #767164;
  background: #fff;
  border-radius: 10px;
  white-space: normal;
  line-break: strict;
  word-break: break-word;
  overflow-wrap: break-word;
  word-wrap: break-word;
}

footer {
  clear: both;
  text-align: center;
  padding: 10px 0px;
  color: #767164;

  & a {
    text-decoration: none;
    border: none;
    color: #767164;
  }

  & .site-credit {
    display: block;
  }
}

.status-label {
  color: #ff0000;
  font-size: 0.75rem;
}

/* TeGaLog generated UI */
.searchbox {
  margin: 0px 10px;
}

.tegalogpost {
  width: 100%;
}

.line-control {
  margin: 7px 0 0;
}

.updatedbox {
  display: flex;
  justify-content: flex-end;
  margin: 7px 0 -10px;
  padding-inline: 5px;
  font-size: 0.75rem;
}

.postform {
  margin: 7px 0 0;
}

.searcharea {
  margin: 21px 0 0;
}

/* ページ送り */
.pagenavi {
  margin: 21px 14px;
}

.pagelinks {
  margin: 0.15em;

  & a {
    font-weight: bold;
  }
}

a.pagenumhere {
  text-decoration: none;
  background-color: #747474;
  color: white;
  border-radius: 1em;
}

a.pagenumlink:hover {
  text-decoration: none;
  background-color: #747474;
  color: white;
  border-radius: 0.3em;
}

a.pagenumlink {
  padding: 0 3px;
}

/* 投稿ボタン */
.postbutton {
  display: inline-block;
  background: #363636;
  color: white;
  font-weight: bold;
  text-decoration: none;
  border: none;
  padding: 5px 14px;
  border-radius: 3px;
  cursor: pointer;
  transition: 0.3s;

  &:hover {
    background-color: #747474;
  }
}

/* 年月一覧 */
.datelimitlist {
  margin: 21px 0;
}

.datelimitlist,
.cattree {
  padding: 0 10px 0 28px;
  line-height: 1.6;
}

.datelimitsublist {
  margin: 0;
  padding: 0 0 0 5px;
  list-style-type: none;
  font-size: 0.9em;
}

.datelimitlist .datelimitsublist .datelimit-month {
  display: inline-block;
  margin-right: 0.9em;
}

.datelimitlist .datelimitsublist .year {
  display: none;
}

.datelimitlist .num {
  font-size: 0.85em;
  color: #c1b7a3;
  margin-left: 0.3em;
}

.tegalog-filter-links {
  margin: 7px 0;
  font-size: 0.875rem;
}

/* カード共通骨格 */
.cardlink {
  display: inline-block;
  width: 100%;
  max-width: 500px;
  text-decoration: none;
  vertical-align: middle;
  font-size: 0.875rem;
}

.cardlinkbox {
  border: 1px solid #ccc;
  border-radius: 7px;
  background-color: white;
  display: flex;
}

.cardlinkbox:hover {
  background-color: #f5fff5;
  border-color: #8c8;
}

.cardlinkimage {
  background-image: linear-gradient(-30deg, #8a8, #e0f0e0);
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;
}

.cardlinktextbox {
  display: flex;
  flex-direction: column;
  padding: 0.5em 1em;
}

.cardlinktitle,
.cardlinkdescription,
.cardlinkurl {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-clamp: 1;
  -webkit-line-clamp: 1;
  text-overflow: ellipsis;
}

.cardlinktitle {
  padding-bottom: 0.25em;
}

.cardlinkdescription {
  line-height: 1.3;
  color: #555;
  line-clamp: 2;
  -webkit-line-clamp: 2;
}

.cardlinkurl {
  color: #999;
  font-size: 0.75rem;
}

/* カードのS配置 */
.cardsize-S {
  flex-direction: row;
}

.cardsize-S .cardlinkimage {
  min-width: 100px;
  min-height: 100px;
  border-radius: 6px 0 0 6px;
  flex-shrink: 0;
}

.cardsize-S .cardlinktextbox {
  border-left: 1px solid #ccc;
  justify-content: center;
}

.cardsize-S .cardlinktitle {
  order: 2;
}

.cardsize-S .cardlinkdescription {
  order: 3;
}

.cardsize-S .cardlinkurl {
  order: 1;
}

/* standard-skin common UI */
.onelog_commentbox .taglink {
  font-size: 0.8em;
}

.onelogbox {
  margin: 14px 0 0;
}

.onelog_commentbox {
  margin: 7px 0 0;
}

.situation {
  clear: both;
  background: #fff;
  line-height: 2;
  font-weight: bold;
  font-size: 1.0625rem;
}

.dateseparator {
  clear: both;
  margin: 21px 0 0;
  padding: 3px 20px;
  background: #fff;
  line-height: 2;
  font-weight: bold;
  font-size: 1.0625rem;
}

.passkeyform {
  margin: 0;
}

.onelog_commentbox h2,
.onelog_commentbox h3,
.onelog_commentbox h4 {
  clear: both;
  border-radius: 4px;
  line-height: 2;
  font-weight: 700;
  margin-top: 30px;
}

.onelog_commentbox h2 + :is(h2, h3),
.onelog_commentbox h3 + h4 {
  margin-top: 15px;
}

.onelog_commentbox h2 {
  padding: 3px 20px;
  border: 2px solid #767164;
  background: #fff;
  font-size: 1.0625rem;
}

.onelog_commentbox h3 {
  color: #fff;
  background: #767164;
  padding: 2px 20px;
  border: 1px solid #767164;
  font-size: 1.0625rem;
}

.onelog_commentbox h3 a {
  color: #ffffff;
}

.onelog_commentbox h4 {
  padding: 2px 20px;
  border: 1px solid #c1b7a3;
  font-size: 1rem;
}

.list_emoji {
  margin-top: 0;
  padding: 0 5px;
}

.list_emoji img {
  max-width: 24px;
}

.cemoji img {
  margin: 0 2px 2px 0;
  max-width: 18px;
}

.mainguide {
  margin: 21px 0 0;
  padding: 0 0 7px 7px;
  border-bottom: 1px solid #767164;
}

ul.hashtaglist {
  display: flex;
  flex-wrap: wrap;
  margin: 7px 0;
  padding: 0 14px;
}

ul.hashtaglist * {
  list-style: none;
  padding: 0;
}

ul.hashtaglist li {
  margin: 0 5px 5px 0;
  padding: 4px 0;
  line-height: 1;
  font-size: 0.875rem;
}

ul.hashtaglist li::before {
  content: "#";
  display: inline-block;
  margin-right: -5px;
  width: 14px;
  height: 14px;
}

span.embeddedmovie {
  padding-top: 5px;
  display: inline-block;
  width: 100%;
  aspect-ratio: 16 / 9;
  max-width: 560px;
  max-height: 315px;
}

span.embeddedmovie iframe {
  width: 100%;
  height: 100%;
  margin: 0;
}

/* ミニウィンドウ（ポップアップ） */
#popup {
  display: none;
  position: absolute;
  padding: 10px 0;
  background-color: white;
  border: 2px solid #ccc;
  box-shadow: 0px 4px 10px rgba(0, 0, 0, 0.1);
  z-index: 1000;
  width: 300px;
  transform: translateY(-100%);
  font-size: 0.875rem;
}

#popupContent {
  max-height: 400px;
  overflow: auto;
}

/* 画像グリッド */
.image-grid {
  display: grid;
  gap: 5px;
  margin-top: 5px;
  width: 100%;
  grid-template-columns: repeat(4, 1fr);
  grid-auto-flow: row;
}

.image-grid .imagelink {
  display: block;
  width: 100%;
  height: auto;
}

.image-grid .imagelink img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 4px;
  border: 2px solid #ccc;
  aspect-ratio: 1/1;
}

.pagehome {
  margin: 0.15em;
  font-weight: bold;
}

/* 移行互換 */
/* 旧 .pr / .color_red は併用中の旧 style.css が互換を所有する。 */
