/*
Theme Name: Main Page Coffee
Version: 1.0.0
Requires at least: 6.6
*/
:root {
    color-scheme: light;
    --paper: #f5eee0;
    --ink: #251d17;
    --coffee: #72462c;
    --rule: #a39481;
    --sans: system-ui, "Hiragino Kaku Gothic ProN", Meiryo, sans-serif;
    --mincho: "Yu Mincho", YuMincho, "Hiragino Mincho ProN", "Noto Serif CJK JP", "MS PMincho", serif;
}
*, *::before, *::after { box-sizing: border-box; }
html { scroll-padding-top: 1.5rem; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 1rem/1.8 var(--mincho); }
a { color: inherit; text-underline-offset: .28em; }
a:hover { color: var(--coffee); }
a:focus-visible, button:focus-visible { outline: 2px solid var(--coffee); outline-offset: 4px; }
img { max-width: 100%; height: auto; }
h1, h2, h3 { font-weight: 500; line-height: 1.45; }
.wrap { width: min(1120px, calc(100% - 64px)); margin-inline: auto; }
.skip { position: absolute; transform: translateY(-150%); background: var(--paper); padding: .5rem; }
.skip:focus { transform: none; z-index: 10; }
.mast { display: flex; align-items: end; justify-content: space-between; gap: 1rem; padding: 1.35rem 0 1rem; border-bottom: 1px solid var(--ink); }
.brand { font: 1.75rem/.95 Georgia, serif; text-decoration: none; }
.brand i { margin-left: 1.05rem; }
.mast nav, .colophon nav, .formats { display: flex; flex-wrap: wrap; gap: .45rem 1.6rem; font: .83rem/1.5 var(--sans); }
.mast nav a, .formats a { text-decoration: none; }
.mast nav a:hover, .formats a:hover { text-decoration: underline; }
.cover { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 1fr); padding: 1.8rem 0 3.25rem; }
.cover-image { background: #35271d; min-height: 23rem; }
.cover-image img { display: block; width: 100%; height: 100%; object-fit: cover; aspect-ratio: 1.85; }
.cover-type { border-block: 1px solid var(--rule); display: grid; justify-items: center; align-content: start; padding: .8rem .35rem; }
.folio, .running span { font: .72rem/1.5 var(--sans); letter-spacing: .14em; color: var(--coffee); }
.cover h1 { writing-mode: vertical-rl; margin: 1.2rem 0 0; font-size: clamp(1.25rem, 2.45vw, 2rem); letter-spacing: .07em; }
.preface { max-width: 50ch; padding: .8rem 0 0; }
.text-link { color: var(--coffee); }
.running { display: flex; align-items: baseline; justify-content: space-between; border-block: 1px solid var(--ink); }
.running h2 { margin: .55rem 0; font-size: 1.2rem; }
.chapter { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: 6%; padding: 2rem 0; border-bottom: 1px solid var(--rule); }
.chapter:nth-of-type(odd) { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.chapter:nth-of-type(odd) .chapter-lead { grid-column: 2; grid-row: 1; }
.chapter h3 { font-size: clamp(1.5rem, 3vw, 2.4rem); margin: .2rem 0 .7rem; }
.chapter-lead p { margin: 0; max-width: 30ch; }
.contents-list { list-style: none; margin: 0; padding: 0; }
.contents-list li + li { border-top: 1px dotted var(--rule); }
.contents-list a { display: grid; grid-template-columns: 1fr auto; gap: 1rem; text-decoration: none; padding: .7rem 0; }
.contents-list a:hover > span:first-child { text-decoration: underline; }
.contents-list small { display: block; font: .77rem/1.6 var(--sans); }
.contents-list .price { white-space: nowrap; color: var(--coffee); font-size: .88rem; }
.price .woocommerce-price-suffix { display: inline; white-space: nowrap; }
.next-page { text-align: right; margin-block: 1.4rem 3rem; }
.backmatter { border: 1px solid var(--rule); padding: 1rem; display: flex; gap: 1rem; flex-wrap: wrap; }
.colophon { border-top: 3px double var(--ink); margin-top: 4rem; padding: 1.5rem 0 3rem; display: flex; justify-content: space-between; gap: 2rem; }
.colophon-brand { font: 1.35rem Georgia, serif; }
.interior { padding-block: 2.5rem; }
.interior article { max-width: 760px; }
.interior article:has(.woocommerce) { max-width: none; }
.interior table { border-collapse: collapse; overflow-wrap: anywhere; width: 100%; }
.interior th, .interior td { padding: .55rem; border-bottom: 1px solid var(--rule); }
.formats { border-bottom: 1px solid var(--rule); padding-bottom: .8rem; margin-bottom: 1rem; }
.woocommerce ul.products li.product a img { aspect-ratio: 4/3; object-fit: contain; background: #fff; }
.woocommerce ul.products li.product .price, .woocommerce div.product p.price { color: var(--coffee); }
.woocommerce ul.products li.product .woocommerce-loop-product__title { font-weight: 500; }
.woocommerce a.button, .woocommerce button.button, .woocommerce input.button,
.woocommerce a.button.alt, .woocommerce button.button.alt, .woocommerce input.button.alt {
    background: var(--coffee); color: #fff9ec; border-radius: 0; font-family: var(--sans);
}
.woocommerce a.button:hover, .woocommerce button.button:hover, .woocommerce button.button.alt:hover { background: var(--ink); color: #fff; }
@media (max-width: 640px) {
    .wrap { width: calc(100% - 32px); }
    .mast, .colophon { flex-direction: column; align-items: start; }
    .mast nav { gap: .5rem 1rem; font-size: .8rem; }
    .cover { grid-template-columns: minmax(0, 1fr) 74px; padding-bottom: 2rem; }
    .cover-image { min-height: 320px; }
    .cover h1 { font-size: 1rem; }
    .cover-type .folio { font-size: .53rem; white-space: nowrap; letter-spacing: .03em; }
    .preface { grid-column: 1 / -1; }
    .chapter, .chapter:nth-of-type(odd) { grid-template-columns: minmax(0, 1fr); gap: .6rem; }
    .chapter:nth-of-type(odd) .chapter-lead { grid-column: auto; grid-row: auto; }
    .chapter-lead p { max-width: none; }
    .contents-list .price { font-size: .77rem; }
    .interior td { padding: .4rem; }
}
