/* base */

html {
  font-variant-ligatures: contextual;
  -moz-font-feature-settings: "calt";
  -webkit-font-feature-settings: "calt";
  font-feature-settings: "calt";
}

body {
  font-family: "YakuCaltGothic", "Plusquam Sans", -apple-system, BlinkMacSystemFont, "avenir next", avenir, "helvetica neue", helvetica, ubuntu, roboto, noto, "segoe ui", arial, sans-serif;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: "Plusquam Sans", -apple-system, BlinkMacSystemFont, "avenir next", avenir, "helvetica neue", helvetica, ubuntu, roboto, noto, "segoe ui", arial, sans-serif;
}

a {
  text-decoration: underline;
}

hr {
  border: none;
  color: inherit;
  margin: var(--spacing-default) 0;
}

hr::before {
  content: "***";
  letter-spacing: var(--spacing-default);
  margin-inline-start: var(--spacing-2x);
}

.url {
  word-break: break-all;
}


/* style */

body {
  background-color: var(--bg);
  color: var(--tx);
}

a {
  color: var(--bl);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.125em;
}

a:hover,
a:active {
  color: var(--bl-2);
}

ul, ol {
  padding-left: 2em;
  padding-inline-start: 2em;
}

.wrapper {
  display: grid;
  background-color: var(--bg);
  grid-template-columns: repeat(auto-fill, 1em);
  justify-content: center;
  margin-inline: auto;
  width: min(40em, 95vw);
  grid-template-rows: auto 1fr auto;
  row-gap: 2rem;
  min-height: 100%;
  padding: 1rem 0;
}

.wrapper > * {
  grid-column: 1 / -1;
}

/* --------------- header ----------------- */
header {
  display: grid;
  grid-template-columns: 1fr auto auto;
  grid-template-rows: auto auto auto;
  justify-items: end;
  gap: .25em;
}

header a {
  display: inline-block;
  color: var(--tx);
  text-decoration: none;
}

header a:hover,
header a:focus,
header a:active {
  color: var(--tx-2);
  text-decoration: underline;
}

.header__siteName {
  grid-column: 1 / 4;
  grid-row: 1 / 2;
}

.header__siteName a {
  display: block;
  align-items: center;
  text-decoration: none;
  border-bottom: 2px solid transparent; /* 通常時は透明 */
  transition: border-color .15s ease-in;
}

.header__siteName a svg {
  display: block;
  height: var(--f-huge);
  width: auto;
  fill: var(--tx);
  transition: fill .15s ease-in;
}

.header__siteName a:hover,
.header__siteName a:focus,
.header__siteName a:active {
  border-bottom-color: var(--tx-2); /* ホバー時に下線を表示 */
}

.header__siteName a:hover svg,
.header__siteName a:focus svg,
.header__siteName a:active svg {
  fill: var(--tx-2);
}

header nav {
  grid-column: 1 / 2;
  grid-row: 2 / 3;
}

.header__nav ul {
  list-style: none;
  display: flex;
  justify-content: left;
  gap: .5em;
  padding: 0;
  margin: 0;
}

.header__nav ul > li::after {
  content: "･";
  padding-left: .5em;
}

.header__nav ul li a {
  display: inline-block;
}

span#admin {
  grid-column: 2;
  grid-row: 2;
  justify-self: end;
}

span#theme-switch {
  grid-column: 3;
  grid-row: 2;
  justify-self: end;
}

#admin svg,
#theme-switch svg {
  fill: var(--tx);
}

.quickpost {
  grid-column: 1 / 4;
  grid-row: 3;
}

/* --------------- main ----------------- */

main {
  line-height: var(--height-default);
}

main h1 {
  font-size: var(--f-huge);
  margin-bottom: var(--spacing-default);
}

.situation {
  display: none;
}

.situation:empty {
  display: none;
}

.situation-catname,
.situation-tagname {
  font-weight: 700;
}

body:not(.onelog) .forOnePost {
  display: none;
}

body.onelog .forPostList {
  display: none;
}

body.selected-cat .postList__category {
  display: none;
}

.article:not(:first-of-type) {
  border-top: dotted 1px var(--ui-3);
  margin-top: var(--spacing-2x);
  padding-top: var(--spacing-default);
}

.article__content {
  padding-top: var(--spacing-small);
}

.article__content .taglink {
  display: inline-block;
  word-break: break-all;
}

.readmorebutton {
  display: inline-block;
  color: var(--bl);
}

.readmoreclose {
  display: block;
}

.article__header time{
  font-size: var(--f-h4);
  font-weight: 700;
}

.article__header span {
  font-size: var(--f-small);
  vertical-align: middle;
  color: var(--tx-3);
}

.article__header span {
  font-size: var(--f-small);
  vertical-align: middle;
  color: var(--tx-3);
}

.article__header span a {
  color: var(--tx-3);
}

.article__header span a:hover,
.article__header span a:active,
.article__header span a:focus {
  color: var(--tx-3);
}

.article__footer {
  margin-top: var(--spacing-small);
}

.article__footer,
.article__footer a {
  color: var(--tx-3);
}

.article__footer a:hover,
.article__footer a:active,
.article__footer a:focus {
  color: var(--tx-2);
}

.article__category::before {
  font-family: "Material Symbols Outlined";
  font-size: 20px;
  margin-right: .5em;
  position: relative;
  top: .2em;
}

article.logstatus-fixed .article__category::before {
  color: var(--re-2);
}

body.dark article.logstatus-fixed .article__category::before {
  color: var(--re); 
}

.article__category:has(.cat-note)::before {
  content: "sticky_note_2";
}

.article__category:has(.cat-website)::before {
  content: "web";
}

.article__category:has(.cat-dojin)::before {
  content: "stylus_fountain_pen";
}

.article__category:has(.cat-game)::before {
  content: "sports_esports";
}

.article__category:has(.cat-book)::before {
  content: "book_2";
}

.article__category:has(.cat-screen)::before {
  content: "movie";
}

.article__category:has(.cat-video)::before {
  content: "live_tv";
}

.article__category:has(.cat-music)::before {
  content: "music_note";
}

.article__category:has(.cat-reply)::before {
  content: "mark_email_read";
}

/* 先頭固定postは一律ピン留めアイコンに */
article.logstatus-fixed .article__category::before {
  content: "keep";
  display: inline-block;
  transform: rotate(-35deg);
}

.categorylink {
  display: inline;
  margin-right: .5em;
}

.categorylink::before {
  content: '#';
}

.article__editlink {
  flex-basis: content;
}

.article__editlink a {
  text-decoration: underline;
}

.article__postID {
  flex-basis: content;
}

.article__date {
  flex-basis: content;
  white-space: nowrap;
}

.article__content img {
  margin: var(--spacing-default) auto 0 auto;
}

.article__content img+* {
  margin-top: var(--spacing-default);
}

.article__content img+br {
  display: none;
}

.deco-figcaption {
  margin-top: calc(var(--spacing-default) / 8);
  margin-bottom: var(--spacing-default);
  font-size: var(--f-small);
  color: var(--tx-2);
  display: block;
  text-align: center;
}

.deco-figcaption+br {
  display: none;
}

iframe.embeddedmovie { /* YouTube埋め込みのアスペクト比をいい感じにする */
  max-width: 100%;
  height: auto;
  aspect-ratio: 16/9;
}

.decorationL + br {
  display: none;
}

/* --------------- aside ----------------- */

.pagelinks {
  display: flex;
  justify-content: center;
  gap: .5em;
}

.prevlink {
  order: 1;
}

.nextlink {
  order: 3;
}

.linkseparator {
  order: 2;
}

body.onelog .prevlink {
  order: 3;
}

body.onelog .nextlink {
  order: 1;
}

/*
.pagenums a {
  margin: 0 .5em;
}

a.pagenumhere {
  text-decoration: none;
}
*/


/* --------------- footer ----------------- */

footer {
  display: grid;
  width: 100%;
  grid-template-columns: auto auto;
  justify-content: space-between;
  font-size: var(--f-small);
}

.footer__copyright > a {
  margin: 0 .5em;
}

@media only screen and (max-width:599px) {
  footer {
    grid-template-columns: none;
    grid-template-rows: auto auto;
    row-gap: var(--spacing-small);
  }

  .footer__copyright {
    font-size: var(--f-tiny);
  }
}


/* ---------------- QUICKPOST ---------------- */
.quickpost {
  background-color: var(--bg-2);
  padding: .25rem;
  text-align: left;
}

/* Q:引用 */
.decorationQ {
  display: block;
  /* ↑必須 */
  margin: var(--spacing-default) 0 var(--spacing-default) var(--spacing-small);
  padding-left: 1rem;
  border-left-style: solid;
  border-left-width: .125rem;
  border-color: var(--ye);
}

.decorationQ::before,
.decorationQ::after {
  content: '';
  /* 標準で付加されてしまう引用符を無効にする */
}

.decorationQ+br {
  display: none;
}

blockquote.twitter-tweet {
  border: 1px dashed var(--ui-3);
  border-radius: 9px;
  margin: 0.3em 0;
  padding: 1em;
  font-size: var(--f-small);
  color: var(--tx-3);
}

/* QUICKPOST入力欄 */

.quickpost {
  margin-top: 1rem;
}

.quickpost form {
  padding: 10px;
}
textarea.tegalogpost {
  width: 100%;
  border: 1px solid var(--ui-3);
  padding: 8px;
  line-height: 1.6em;
}
.quickpost p.line-textarea {
  margin: 0;
}
.quickpost p.line-control {
  margin: 10px 0 0;
}
.quickpost input.postbutton {
  background: var(--bl);
  color: white;
  border: none;
  border-radius: 3px;
  padding: 3px 15px;
  cursor: pointer;
  transition: .3s;
  font-size: .875rem;
}
.quickpost input.postbutton:hover {
  background: var(--bl-2);
}
.decoBtns input[type=button] {
  border-radius: 3px;
  border: 1px solid var(--ui-3);
  background: white;
  margin: 0 2px 10px;
  padding: 3px 5px;
  font-size: .875rem;
}
span.catChecks label {
  margin-right: 5px;
  font-size: var(--f-small);
}

/* QUICKPOSTプレースホルダ */
textarea.tegalogpost:placeholder-shown {
  color: var(--tx-3);
}

textarea.tegalogpost:focus:placeholder-shown {
  color: var(--tx-3);
}

@media all and (max-width: 800px) {
  textarea.tegalogpost {
    font-size: 16px;
    padding: 0.4em;
  }
}
