/*
Theme Name: Yukuharu Clean
Theme URI: https://yukuharu.lsv.jp/
Author: sori
Description: A lightweight custom classic theme for the yukuharu illustration and ZINE site.
Version: 3.2.3
Requires at least: 6.0
Requires PHP: 7.4
Text Domain: yukuharu
*/

:root {
  --paper: #f8efe7;
  --panel: #fffdfa;
  --ink: #171717;
  --orange: #e84e0a;
  --blue: #0c9dc3;
  --pink: #f69eb7;
  --cream: #ffede3;
  --white: #f3f3f3;
}

* { box-sizing: border-box; }
html, body { width: 100%; height: 100%; margin: 0; }
html { overflow: hidden; }
body {
  min-height: 0;
  overflow: hidden;
  background: var(--paper);
  color: var(--ink);
  font-family: "Noto Sans JP", "Yu Gothic", sans-serif;
}
a, button { -webkit-tap-highlight-color: transparent; }

.yukuharu-site {
  position: fixed;
  top: 12px;
  right: 0;
  bottom: 12px;
  left: 0;
  width: min(940px, 92vw);
  height: auto;
  margin: 0 auto;
  transform: none;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  overflow: hidden;
}

.site-logo { margin: 0 0 7px; text-align: center; }
.site-logo img {
  display: block;
  width: min(290px, 52vw);
  max-height: 60px;
  margin: auto;
  object-fit: contain;
}

.image-menu {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 9px;
  flex-wrap: wrap;
  margin: 0 auto 13px;
}
.image-menu__item {
  display: block;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  text-decoration: none;
}
.image-menu__item img {
  display: block;
  width: auto;
  height: 27px;
  transition: filter .15s ease, transform .15s ease;
}
.image-menu__item:hover img,
.image-menu__item:focus-visible img,
.image-menu__item[aria-current="page"] img {
  filter: invert(50%) sepia(93%) saturate(1827%) hue-rotate(347deg) brightness(102%) contrast(91%);
  transform: translateY(-1px);
}
.image-menu__item:focus-visible { outline: 1px dotted var(--ink); outline-offset: 4px; }

.site-layout {
  min-height: 0;
  height: 100%;
  display: grid;
  grid-template-columns: 145px minmax(0, 1fr);
  gap: 28px;
  align-items: stretch;
  overflow: hidden;
}
.site-sidebar {
  min-height: 0;
  padding-top: 10px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.news { font-family: Georgia, "Times New Roman", serif; }
.news__title {
  margin: 0 0 18px;
  font-size: 19px;
  font-weight: normal;
  font-style: italic;
  letter-spacing: .08em;
}
.news__item { margin: 0 0 19px; font-size: 12px; line-height: 1.55; }
.news__date { display: block; font-weight: bold; letter-spacing: .03em; }
.news__link, .news__archive { color: inherit; text-decoration: none; }
.news__archive { display: inline-block; font-size: 12px; }

.social-links {
  margin-top: 54px;
  display: flex;
  flex-direction: column;
  gap: 11px;
  align-items: flex-start;
}
.social-link {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 20px;
  color: var(--ink);
  text-decoration: none;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 12px;
}
.social-link__dot { width: 14px; height: 14px; flex: 0 0 auto; border-radius: 50%; transition: transform .16s ease; }
.social-link__dot[style*="--cream"],
.social-link__dot--light { border: 1px solid rgba(23,23,23,.72); }
.social-link__label { opacity: 0; transform: translateX(-7px); white-space: nowrap; transition: opacity .16s ease, transform .16s ease; }
.social-link:hover .social-link__dot, .social-link:focus-visible .social-link__dot { transform: scale(1.16); }
.social-link:hover .social-link__label, .social-link:focus-visible .social-link__label { opacity: 1; transform: translateX(0); }
.site-copyright {
  margin-top: 26px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 9px;
  line-height: 1.45;
  letter-spacing: .03em;
  color: rgba(0, 0, 0, .58);
  white-space: nowrap;
}

.content-frame {
  min-width: 0;
  min-height: 0;
  height: 100%;
  padding: 20px 26px 24px;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  background: var(--panel);
  border: 1.7px solid var(--ink);
  border-radius: 26px;
  scrollbar-width: thin;
  scrollbar-color: rgba(23,23,23,.27) transparent;
  animation: yukuharuFadeIn .18s ease both;
}
.content-frame::-webkit-scrollbar { width: 9px; }
.content-frame::-webkit-scrollbar-thumb {
  background: rgba(23,23,23,.25);
  border: 3px solid var(--panel);
  border-radius: 99px;
}
.content-frame::-webkit-scrollbar-track { background: transparent; }
body.is-leaving .content-frame { opacity: 0; transform: translateY(2px); transition: opacity .12s ease, transform .12s ease; }
@keyframes yukuharuFadeIn { from { opacity: .35; transform: translateY(2px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  .content-frame { animation: none; }
  body.is-leaving .content-frame { transition: none; }
}

.front-copy { padding: 2px 12px 19px; text-align: center; }
.front-copy h1, .entry-content h1:first-child { margin-top: 0; }
.front-copy h1 {
  margin-bottom: 10px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 22px;
  font-weight: normal;
  font-style: italic;
}
.front-copy p { margin: 0; font-size: 13px; line-height: 1.85; }
.front-copy .english {
  margin-top: 8px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 12px;
  line-height: 1.65;
  font-style: italic;
  letter-spacing: .015em;
}
.front-rule { height: 1px; margin: 0 0 20px; background: var(--ink); opacity: .42; }
.front-art { margin: 0; display: flex; justify-content: center; }
.front-art img { display: block; width: 100%; height: auto; max-height: 440px; object-fit: contain; }

.entry-header h1 {
  margin: 0 0 20px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 24px;
  font-weight: normal;
  font-style: italic;
}
.entry-content { max-width: 700px; font-size: 14px; line-height: 1.9; }
.entry-content img { max-width: 100%; height: auto; }
.entry-content a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 3px; }

/* BOOKS: styles only the dedicated WordPress Columns pattern.
   Ordinary groups and paragraphs are left untouched. */
.entry-content .book-entry {
  gap: 28px;
  align-items: flex-start;
  margin: 0 0 30px;
  padding: 0 0 30px;
  border-bottom: 1px solid rgba(0,0,0,.25);
}
.entry-content .book-entry:last-child { margin-bottom: 0; }
.entry-content .book-entry .wp-block-column { min-width: 0; }
.entry-content .book-entry .wp-block-image { margin: 0; }
.entry-content .book-entry .wp-block-image img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--ink);
}
.entry-content .book-entry h2,
.entry-content .book-entry h3 {
  margin: 0 0 7px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 19px;
  font-weight: normal;
  font-style: italic;
  line-height: 1.35;
}
.entry-content .book-entry p { margin-top: 0; margin-bottom: 10px; }
.entry-content .book-entry .book-meta {
  margin-bottom: 12px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 12px;
  line-height: 1.5;
}
.entry-content .book-entry .wp-block-buttons { margin-top: 14px; }
.entry-content .book-entry .wp-block-button__link,
.entry-content .booth-button .wp-block-button__link {
  min-width: 92px;
  padding: 8px 18px;
  border: 1px solid var(--ink);
  border-radius: 999px;
  background: transparent;
  color: var(--ink);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 12px;
  line-height: 1.2;
  text-decoration: none;
  transition: background .15s ease, color .15s ease;
}
.entry-content .book-entry .wp-block-button__link:hover,
.entry-content .book-entry .wp-block-button__link:focus-visible,
.entry-content .booth-button .wp-block-button__link:hover,
.entry-content .booth-button .wp-block-button__link:focus-visible {
  background: var(--ink);
  color: var(--panel);
}

/* Contact Form 7 */
.wpcf7 p { margin: 0 0 14px; }
.wpcf7 label { font-size: 12px; }
.wpcf7 input[type="text"],
.wpcf7 input[type="email"],
.wpcf7 input[type="url"],
.wpcf7 textarea {
  width: 100%;
  margin-top: 4px;
  padding: 9px 10px;
  border: 1px solid rgba(23,23,23,.65);
  border-radius: 0;
  background: #fff;
  color: var(--ink);
  font: inherit;
}
.wpcf7 textarea { min-height: 140px; resize: vertical; }
.wpcf7 input[type="submit"] {
  padding: 8px 21px;
  border: 1px solid var(--ink);
  border-radius: 999px;
  background: transparent;
  color: var(--ink);
  font-family: Georgia, "Times New Roman", serif;
  cursor: pointer;
}
.wpcf7 input[type="submit"]:hover { background: var(--ink); color: var(--panel); }

.post-list { list-style: none; margin: 0; padding: 0; }
.post-list li { padding: 0 0 18px; margin: 0 0 18px; border-bottom: 1px solid rgba(0,0,0,.18); }
.post-list time { display: block; margin-bottom: 4px; font-family: Georgia, "Times New Roman", serif; font-size: 12px; }
.post-list a { color: inherit; }
.screen-reader-text {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}


/*
 * Keep the desktop canvas fixed between the admin toolbar and the
 * bottom of the viewport. This avoids relying on viewport-height maths.
 */
@media (min-width: 783px) {
  body.admin-bar .yukuharu-site {
    top: 44px;
  }
}

@media (min-width: 721px) and (max-width: 782px) {
  body.admin-bar .yukuharu-site {
    top: 58px;
  }
}

@media (max-width: 720px) {
  html, body { height: auto; min-height: 100%; }
  html, body { overflow: auto; }
  .yukuharu-site {
    position: static;
    width: 94vw;
    height: auto;
    min-height: 100vh;
    margin: 10px auto 24px;
    transform: none;
    display: block;
    overflow: visible;
  }
  .site-logo img { width: min(235px, 59vw); max-height: 49px; }
  .image-menu { gap: 6px; margin-bottom: 14px; }
  .image-menu__item img { height: 20px; }
  .site-layout { height: auto; display: flex; flex-direction: column; gap: 18px; overflow: visible; }
  .content-frame {
    order: 1;
    width: 100%;
    min-height: 62vh;
    height: auto;
    max-height: none;
    padding: 16px 14px 20px;
    overflow: visible;
    border-radius: 19px;
  }
  .site-sidebar { order: 2; width: 100%; padding: 0 2px; overflow: visible; }
  .news__title { margin-bottom: 12px; font-size: 15px; }
  .news__item { margin-bottom: 12px; font-size: 10px; }
  .news__archive, .social-link { font-size: 10px; }
  .social-links { margin-top: 28px; flex-direction: row; gap: 18px; }
  .social-link__dot { width: 12px; height: 12px; }
  .social-link__label { opacity: 1; transform: none; }
  .site-copyright { margin-top: 20px; font-size: 8px; }
  .front-copy h1 { font-size: 18px; }
  .front-copy p { font-size: 11px; }
  .front-copy .english { font-size: 10px; }
  .entry-content .book-entry {
    gap: 20px;
    margin-bottom: 26px;
    padding-bottom: 26px;
  }
  .entry-content .book-entry h2, .entry-content .book-entry h3 { font-size: 16px; }
  .entry-content .book-entry p { font-size: 12px; line-height: 1.65; }
}

@media (max-width: 430px) {
  .entry-content .book-entry .wp-block-button__link { min-width: 76px; padding: 7px 13px; }
}


/* NOTE archive and reusable Note card */
.note-card,
.post-list li {
  padding: 0 0 20px;
  margin: 0 0 20px;
  border-bottom: 1px solid rgba(0,0,0,.20);
}
.note-card time,
.post-list time,
.entry-header time {
  display:block;
  margin-bottom:6px;
  font-family: Georgia, "Times New Roman", serif;
  font-size:12px;
  letter-spacing:.03em;
}
.note-card h2, .note-card h3 { margin:0 0 8px; font-family:Georgia,"Times New Roman",serif; font-size:18px; font-weight:normal; }
.note-card p { margin:0 0 8px; }
.note-card a, .post-list a { color:inherit; text-underline-offset:3px; }

@media (max-width:720px) {
  .entry-content .book-entry { flex-wrap: wrap !important; }
  .entry-content .book-entry > .wp-block-column:first-child { flex-basis: 100% !important; }
  .entry-content .book-entry > .wp-block-column:first-child .wp-block-image { width:min(230px,76%); margin:0 auto 20px; }
  .entry-content .book-entry > .wp-block-column:last-child { flex-basis: 100% !important; }
  .social-links { flex-wrap:wrap; }
}


/* GALLERY filter: add `filter-gallery` to the Gallery block and
   `original`, `fanart`, `commission`, or `other` to each image block. */
.gallery-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  margin: 0 0 22px;
  padding: 0;
}
.gallery-filter__button {
  appearance: none;
  border: 0;
  border-bottom: 1px solid transparent;
  padding: 2px 0 3px;
  background: transparent;
  color: inherit;
  font: 12px/1.4 Georgia, "Times New Roman", serif;
  letter-spacing: .08em;
  cursor: pointer;
}
.gallery-filter__button:hover,
.gallery-filter__button:focus-visible,
.gallery-filter__button.is-active { border-bottom-color: currentColor; }
.gallery-filter__button:focus-visible { outline: 1px dotted currentColor; outline-offset: 4px; }
.filter-gallery .wp-block-image.is-filter-hidden { display: none !important; }


/* WordPress core lightbox compatibility.
   Keep the overlay independent from the fixed site canvas so full images,
   close control, and previous/next controls are not clipped. */
.wp-lightbox-overlay {
  z-index: 1000000 !important;
  max-width: none !important;
  max-height: none !important;
}
.wp-lightbox-overlay img {
  width: auto !important;
  height: auto !important;
  max-width: calc(100vw - 72px) !important;
  max-height: calc(100vh - 72px) !important;
  object-fit: contain !important;
}
@media (max-width: 720px) {
  .wp-lightbox-overlay img {
    max-width: calc(100vw - 28px) !important;
    max-height: calc(100vh - 72px) !important;
  }
}


/* Theme-native gallery lightbox for media-file links inside filter-gallery. */
html.has-yukuharu-lightbox,
html.has-yukuharu-lightbox body { overflow: hidden !important; }
.yukuharu-lightbox[hidden] { display: none !important; }
.yukuharu-lightbox {
  position: fixed;
  inset: 0;
  z-index: 2147483000;
  display: grid;
  place-items: center;
  background: rgba(255,255,255,.96);
  color: var(--ink);
}
.yukuharu-lightbox__stage {
  position: absolute;
  inset: 48px 76px;
  display: grid;
  place-items: center;
  cursor: zoom-out;
}
.yukuharu-lightbox__image {
  display: block;
  flex: 0 0 auto;
  width: auto;
  height: auto;
  max-width: calc(100vw - 152px);
  max-height: calc(100vh - 96px);
  object-fit: contain;
  box-shadow: 0 8px 30px rgba(0,0,0,.10);
  cursor: default;
}
.yukuharu-lightbox__close,
.yukuharu-lightbox__prev,
.yukuharu-lightbox__next {
  position: fixed;
  z-index: 2;
  appearance: none;
  border: 0;
  padding: 0;
  background: transparent;
  color: currentColor;
  font-family: Arial, sans-serif;
  font-weight: 300;
  line-height: 1;
  cursor: pointer;
}
.yukuharu-lightbox__close { top: 18px; right: 23px; font-size: 40px; }
.yukuharu-lightbox__prev,
.yukuharu-lightbox__next { top: 50%; transform: translateY(-50%); font-size: 60px; }
.yukuharu-lightbox__prev { left: 18px; }
.yukuharu-lightbox__next { right: 18px; }
.yukuharu-lightbox__counter {
  position: fixed;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  font: 11px/1.4 Georgia, "Times New Roman", serif;
  letter-spacing: .08em;
}
.yukuharu-lightbox button:hover,
.yukuharu-lightbox button:focus-visible { opacity: .55; }
.yukuharu-lightbox button:focus-visible { outline: 1px dotted currentColor; outline-offset: 5px; }
@media (max-width: 720px) {
  .yukuharu-lightbox__stage { inset: 54px 22px 50px; }
  .yukuharu-lightbox__image {
    max-width: calc(100vw - 44px);
    max-height: calc(100vh - 104px);
  }
  .yukuharu-lightbox__close { top: 13px; right: 16px; font-size: 36px; }
  .yukuharu-lightbox__prev,
  .yukuharu-lightbox__next { top: auto; bottom: 8px; transform: none; font-size: 44px; }
  .yukuharu-lightbox__prev { left: 16px; }
  .yukuharu-lightbox__next { right: 16px; }
  .yukuharu-lightbox__counter { bottom: 17px; }
}
