/*
Theme Name: Midokore Foundation
Description: ミドコレのトップページと上部メニュー。作品と人気計測の接続前に使う、アイボリーと深緑の軽量テーマです。
Version: 1.1.0
Requires at least: 6.0
Requires PHP: 7.4
Author: ミドコレ
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: midokore-foundation
*/

:root {
  --paper: #fffefa;
  --background: #faf9f5;
  --ink: #243b32;
  --muted: #626e66;
  --line: #dce2d8;
  --soft: #edf1e8;
  --green: #315a44;
  --green-dark: #254835;
  --warm: #f0e9df;
  --radius: 14px;
}
* { box-sizing: border-box; }
html { scroll-padding-top: 24px; }
body { margin: 0; background: var(--background); color: var(--ink); font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Hiragino Kaku Gothic ProN", "Yu Gothic", Meiryo, sans-serif; font-size: 15px; line-height: 1.8; -webkit-text-size-adjust: 100%; }
[hidden] { display: none !important; }
img, video, iframe { max-width: 100%; }
img { height: auto; }
svg { display: block; }
a { color: var(--green); text-underline-offset: 4px; }
button { font: inherit; color: inherit; }
a, button { -webkit-tap-highlight-color: transparent; }
a:focus, button:focus, summary:focus { outline: 3px solid #987747; outline-offset: 5px; }
a:focus:not(:focus-visible), button:focus:not(:focus-visible), summary:focus:not(:focus-visible) { outline: none; }
a:focus-visible, button:focus-visible, summary:focus-visible { outline: 3px solid #987747; outline-offset: 5px; }
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { overflow-wrap: anywhere; }
ul, ol { margin-top: 0; }
.site-width { width: min(1120px, calc(100% - 80px)); margin-inline: auto; }
.site-main { padding-bottom: 78px; min-height: 60vh; }
.site-main:focus { outline: none; }
.icon { width: 24px; height: 24px; flex: 0 0 auto; }
.skip-link { position: fixed; z-index: 100000; top: 12px; left: 12px; padding: 10px 20px; transform: translateY(-160%); background: var(--green); color: white; border-radius: 6px; }
.skip-link:focus { transform: translateY(0); }

/* Brand and navigation */
.site-header { background: var(--paper); border-top: 4px solid var(--green); }
.brand-row { display: flex; align-items: center; justify-content: space-between; min-height: 110px; gap: 24px; padding-block: 22px; }
.site-brand { display: inline-flex; align-items: center; gap: 14px; text-decoration: none; color: var(--ink); min-width: 0; border-radius: 5px; }
.brand-symbol { display: grid; place-items: center; width: 48px; height: 52px; background: var(--green); color: var(--paper); border-radius: 16px 4px 16px 4px; flex: none; }
.brand-symbol .icon { width: 27px; height: 27px; }
.brand-copy { display: flex; flex-direction: column; gap: 1px; }
.brand-name { font-size: 29px; font-weight: 700; letter-spacing: .14em; line-height: 1.35; }
.brand-tagline { font-size: 11px; letter-spacing: .1em; color: var(--muted); }
.brand-caption { font-size: 11px; line-height: 1.8; letter-spacing: .08em; color: var(--muted); }
.navigation-row { border-top: 1px solid #edf0e8; border-bottom: 1px solid var(--line); }
.primary-menu { display: flex; flex-wrap: wrap; align-items: stretch; list-style: none; padding: 0; margin: 0; gap: 10px; }
.primary-menu li { margin: 0; }
.primary-menu a { position: relative; display: flex; align-items: center; justify-content: center; min-height: 55px; padding: 12px 22px; color: var(--muted); font-size: 13px; font-weight: 500; text-decoration: none; border-bottom: 2px solid transparent; }
.primary-menu a:hover { color: var(--green); background: #f6f7f0; }
.primary-menu .current-menu-item > a, .primary-menu a[aria-current="page"] { color: var(--green); border-bottom-color: var(--green); font-weight: 700; }
.menu-toggle { display: inline-flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px; width: 64px; min-height: 56px; border: 1px solid var(--line); border-radius: 9px; background: var(--paper); font-size: 10px; cursor: pointer; flex: none; }
.menu-toggle-lines { display: block; width: 21px; height: 12px; border-top: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; position: relative; }
.menu-toggle-lines::before { content: ""; position: absolute; top: 4px; left: 0; width: 21px; border-top: 1.5px solid currentColor; }
.menu-toggle[aria-expanded="true"] .menu-toggle-lines { border: none; }
.menu-toggle[aria-expanded="true"] .menu-toggle-lines::before, .menu-toggle[aria-expanded="true"] .menu-toggle-lines::after { content: ""; position: absolute; top: 5px; left: 0; width: 21px; border-top: 1.5px solid currentColor; transform: rotate(45deg); }
.menu-toggle[aria-expanded="true"] .menu-toggle-lines::after { transform: rotate(-45deg); }

/* Home concept and editorial guide */
.home-hero { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 72px; align-items: center; padding-block: 64px 60px; border-bottom: 1px solid var(--line); }
.eyebrow { color: var(--green); font-family: Georgia, "Times New Roman", serif; font-size: 11px; line-height: 1.5; letter-spacing: .17em; }
.hero-copy > .eyebrow { margin-bottom: 18px; }
.home-hero h1 { font-family: "Yu Mincho", "Hiragino Mincho ProN", "Noto Serif JP", Georgia, serif; font-size: clamp(29px, 3.5vw, 43px); font-weight: 500; line-height: 1.65; letter-spacing: .045em; }
.hero-description { margin-top: 21px; font-size: 13px; line-height: 2; color: var(--muted); }
.button-primary { display: inline-flex; align-items: center; justify-content: space-between; gap: 28px; padding: 13px 20px; min-height: 48px; margin-top: 28px; background: var(--green); color: var(--paper); border: 1px solid var(--green); border-radius: 7px; font-size: 13px; text-decoration: none; }
.button-primary .icon { width: 19px; height: 19px; }
.button-primary:hover { background: var(--green-dark); }
.guide-card { padding: 26px 28px 22px; background: var(--soft); border: 1px solid #dce4d7; border-radius: 3px var(--radius) var(--radius) var(--radius); }
.guide-card > .eyebrow { font-size: 10px; margin-bottom: 8px; }
.guide-card > h2 { font-family: "Yu Mincho", "Hiragino Mincho ProN", Georgia, serif; font-size: 21px; font-weight: 600; letter-spacing: .04em; }
.guide-intro { margin-top: 4px; font-size: 11px; color: var(--muted); }
.guide-list { padding: 0; margin: 17px 0 0; list-style: none; }
.guide-list li { display: flex; gap: 14px; padding-block: 13px; border-top: 1px solid #d4ddcf; }
.guide-list li:last-child { padding-bottom: 0; }
.guide-list > li > span { flex: none; color: #718568; font: italic 19px/1.5 Georgia, serif; }
.guide-list h3 { font-size: 12px; font-weight: 600; line-height: 1.8; }
.guide-list p { font-size: 11px; line-height: 1.9; color: var(--muted); margin-top: 1px; }

/* Sections and honest empty states */
.content-section { margin-top: 44px; }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 12px 24px; margin-bottom: 22px; flex-wrap: wrap; }
.section-heading .eyebrow { margin-bottom: 5px; font-size: 10px; }
.section-heading h2 { font-size: 23px; line-height: 1.5; font-weight: 600; letter-spacing: .04em; }
.text-link { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; font-size: 12px; text-decoration: none; }
.text-link .icon { width: 18px; height: 18px; }
.text-link:hover { text-decoration: underline; }
.heading-note { color: var(--muted); font-size: 12px; padding-bottom: 3px; }
.period-controls { display: flex; gap: 7px; flex-wrap: wrap; margin-bottom: 10px; }
.period-controls button { padding: 8px 22px; border: 1px solid var(--line); border-radius: 6px; min-height: 44px; background: #f3f3ed; color: #70776d; font-size: 12px; }
.period-controls button:disabled { cursor: not-allowed; opacity: 1; }
.section-note { color: var(--muted); font-size: 11px; line-height: 1.9; overflow-wrap: anywhere; }
.empty-state { display: flex; align-items: center; justify-content: center; gap: 19px; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 34px 28px; min-height: 146px; margin-top: 22px; }
.empty-icon { display: grid; place-items: center; width: 52px; height: 52px; flex: none; background: var(--soft); border-radius: 50%; color: #6a8267; }
.empty-icon .icon { width: 25px; height: 25px; }
.empty-state h3 { font-size: 14px; font-weight: 600; }
.empty-state p { font-size: 12px; color: var(--muted); margin-top: 6px; max-width: 580px; }
.explore-section { padding-top: 38px; border-top: 1px solid var(--line); }
.explore-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; list-style: none; padding: 0; margin: 0; }
.explore-grid li { min-width: 0; }
.explore-card { position: relative; display: flex; flex-direction: column; align-items: flex-start; min-height: 158px; height: 100%; padding: 22px 18px 24px; border: 1px solid var(--line); border-radius: 10px; background: var(--paper); color: var(--ink); text-decoration: none; }
a.explore-card:hover { border-color: #80987a; background: #f3f5ec; }
.explore-card > .icon { margin-bottom: 15px; color: var(--green); width: 23px; height: 23px; }
.explore-card strong { font-size: 14px; font-weight: 600; }
.explore-card > span { color: var(--muted); font-size: 10px; line-height: 1.7; margin-top: 3px; overflow-wrap: anywhere; }
.explore-card > .card-arrow { position: absolute; right: 16px; top: 23px; width: 16px; height: 16px; color: #84907c; }
.fresh-section { padding-top: 38px; border-top: 1px solid var(--line); }
.fresh-section .empty-state { margin-top: 0; }
.status-badge { display: inline-flex; padding: 5px 11px; border: 1px solid var(--line); border-radius: 30px; background: var(--soft); color: var(--muted); font-size: 10px; }

/* Pages, existing editorial content, and footer */
.breadcrumbs { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; padding-block: 16px; font-size: 11px; color: var(--muted); overflow-wrap: anywhere; }
.breadcrumbs a { display: inline-flex; align-items: center; min-height: 44px; }
.page-heading { padding-top: 30px; margin-bottom: 32px; }
.breadcrumbs + .inner-page .page-heading { padding-top: 7px; }
.page-heading .eyebrow { margin-bottom: 12px; }
.page-heading h1 { font-family: "Yu Mincho", "Hiragino Mincho ProN", Georgia, serif; font-weight: 500; font-size: clamp(27px, 3.4vw, 37px); line-height: 1.6; letter-spacing: .04em; }
.page-heading > p:last-child:not(.eyebrow) { margin-top: 11px; font-size: 13px; color: var(--muted); }
.page-listing { margin-top: 28px; }
.page-listing .empty-state { min-height: 190px; }
.period-note { margin-top: 15px; }
.back-link { margin-top: 24px; }
.entry-content { max-width: 820px; margin-block: 24px; overflow-wrap: anywhere; }
.entry-content p, .entry-content ul, .entry-content ol, .entry-content blockquote, .entry-content figure { margin-bottom: 1.3em; }
.entry-content h2, .entry-content h3 { margin-block: 1.5em .6em; }
.entry-content pre { white-space: pre-wrap; overflow-x: auto; }
.entry-content table { width: 100%; border-collapse: collapse; }
.entry-content td, .entry-content th { border: 1px solid var(--line); padding: 10px; }
.entry-content .alignwide, .entry-content .alignfull { max-width: 100%; }
.site-footer { background: #f0f1e9; border-top: 1px solid var(--line); }
.footer-inner { display: flex; justify-content: space-between; align-items: center; gap: 24px; padding-block: 32px; }
.footer-brand { color: var(--ink); font-size: 18px; font-weight: 600; letter-spacing: .12em; text-decoration: none; display: inline-flex; min-height: 30px; align-items: center; }
.footer-inner p { font-size: 10px; color: var(--muted); line-height: 2; }
.footer-note { text-align: right; }

@media (max-width: 1020px) {
  .site-width { width: calc(100% - 56px); }
  .home-hero { gap: 36px; }
  .primary-menu { gap: 3px; }
  .primary-menu a { padding-inline: 18px; }
  .guide-card { padding-inline: 22px; }
  .explore-grid { gap: 9px; }
  .explore-card { padding-inline: 15px; }
  .explore-card > span { font-size: 9px; }
}
@media (max-width: 760px) {
  .site-width { width: calc(100% - 40px); }
  .site-main { padding-bottom: 48px; }
  .brand-row { min-height: 92px; padding-block: 17px; gap: 12px; }
  .brand-symbol { width: 39px; height: 45px; border-radius: 13px 3px 13px 3px; }
  .brand-symbol .icon { width: 24px; height: 24px; }
  .site-brand { gap: 10px; }
  .brand-name { font-size: 25px; }
  .brand-tagline { font-size: 9px; letter-spacing: .05em; }
  .brand-caption { display: none; }
  .site-navigation { padding-block: 8px 14px; }
  .primary-menu { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2px 10px; }
  .primary-menu a { justify-content: flex-start; min-height: 48px; padding: 10px 12px; font-size: 13px; }
  .primary-menu .current-menu-item > a, .primary-menu a[aria-current="page"] { border-bottom-color: transparent; background: var(--soft); border-radius: 6px; }
  .home-hero { grid-template-columns: minmax(0, 1fr); padding-block: 38px 36px; gap: 30px; }
  .home-hero h1 { font-size: clamp(27px, 5.7vw, 38px); line-height: 1.65; }
  .hero-copy > .eyebrow { margin-bottom: 13px; }
  .hero-description { margin-top: 15px; font-size: 12px; }
  .button-primary { margin-top: 23px; }
  .guide-card { padding: 22px 24px 20px; }
  .guide-card > h2 { font-size: 20px; }
  .guide-list li { padding-block: 12px; }
  .guide-list h3 { font-size: 12px; }
  .guide-list p { font-size: 11px; }
  .content-section { margin-top: 32px; }
  .section-heading { margin-bottom: 18px; gap: 7px 15px; }
  .section-heading h2 { font-size: 21px; }
  .heading-note { font-size: 11px; }
  .text-link { font-size: 11px; }
  .period-controls { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
  .period-controls button { padding: 8px 4px; }
  .section-note { font-size: 10px; }
  .empty-state { margin-top: 18px; padding: 27px 19px; gap: 14px; justify-content: flex-start; }
  .empty-icon { width: 43px; height: 43px; }
  .empty-state h3 { font-size: 13px; }
  .empty-state p { font-size: 11px; }
  .explore-section, .fresh-section { padding-top: 29px; }
  .explore-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
  .explore-card { min-height: 143px; padding: 18px 14px; }
  .explore-card > .card-arrow { right: 12px; top: 20px; }
  .explore-card strong { font-size: 13px; }
  .explore-card > span { font-size: 10px; }
  .page-listing .empty-state { min-height: 170px; }
  .footer-inner { padding-block: 26px; gap: 18px; }
}
@media (max-width: 440px) {
  .site-width { width: calc(100% - 32px); }
  .brand-symbol { width: 34px; height: 40px; }
  .brand-name { font-size: 23px; }
  .menu-toggle { width: 58px; min-height: 54px; }
  .home-hero h1 { font-size: 28px; letter-spacing: .02em; }
  .hero-description { font-size: 11px; }
  .desktop-break { display: none; }
  .guide-card { padding: 20px 18px; }
  .guide-list { margin-top: 14px; }
  .guide-list li { gap: 11px; }
  .guide-list h3 { font-size: 11px; }
  .guide-list p { font-size: 10px; }
  .section-heading h2 { font-size: 20px; }
  .explore-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .explore-card { min-height: 142px; padding: 20px 17px; }
  .explore-card strong { font-size: 14px; }
  .explore-card > span { font-size: 10px; }
  .empty-state { flex-direction: column; align-items: flex-start; padding: 24px; gap: 13px; }
  .empty-icon { width: 38px; height: 38px; }
  .empty-icon .icon { width: 21px; height: 21px; }
  .empty-state p { margin-top: 5px; }
  .footer-inner { align-items: flex-start; flex-direction: column; gap: 12px; }
  .footer-note { text-align: left; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; }
}

/* Site search remains visible even when the mobile navigation is collapsed. */
.screen-reader-text { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.header-search { width: min(390px, 48%); }
.site-search { display: flex; align-items: stretch; gap: 6px; margin: 0; min-width: 0; }
.site-search-input { width: 100%; min-width: 0; flex: 1; min-height: 46px; padding: 10px 13px; border: 1px solid var(--line); border-radius: 7px; background: var(--background); color: var(--ink); font: inherit; font-size: 16px; line-height: 1.4; }
.site-search-input::placeholder { color: var(--muted); font-size: 13px; opacity: 1; }
.site-search-input:focus { outline: 3px solid #987747; outline-offset: 3px; }
.site-search-submit { display: inline-flex; gap: 6px; align-items: center; justify-content: center; flex: none; min-width: 76px; min-height: 46px; padding: 9px 12px; background: var(--green); color: var(--paper); border: 1px solid var(--green); border-radius: 7px; cursor: pointer; font-size: 12px; }
.site-search-submit:hover { background: var(--green-dark); }
.site-search-submit .icon { width: 18px; height: 18px; }
.search-heading .search-summary { font-size: 16px; color: var(--ink); overflow-wrap: anywhere; }
.search-count { display: inline-block; margin-left: 10px; font-size: 13px; font-weight: 600; }
.search-results { display: grid; gap: 16px; }
.search-result { padding: 25px 28px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); min-width: 0; }
.search-result-type { font-size: 11px; color: var(--muted); }
.search-result h2 { font-size: 20px; line-height: 1.6; margin-top: 4px; }
.search-result h2 a { display: inline-block; padding-block: 6px; }
.search-excerpt { font-size: 13px; color: var(--muted); margin-top: 7px; overflow-wrap: anywhere; }
.pagination { margin-top: 28px; }
.nav-links { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.page-numbers { display: inline-flex; align-items: center; justify-content: center; min-width: 44px; min-height: 44px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 6px; text-decoration: none; }
.page-numbers.current { background: var(--green); color: var(--paper); }
@media (max-width: 760px) {
  .brand-row { flex-wrap: wrap; }
  .site-brand { order: 1; }
  .menu-toggle { order: 2; }
  .header-search { order: 3; width: 100%; flex: 0 0 100%; }
  .search-result { padding: 20px; }
  .search-result h2 { font-size: 18px; }
}
