/*
Theme Name: Osada
Description: Theme for osadasteve.com — ink on top, paper below.
Version: 1.0.0
Requires at least: 6.5
Requires PHP: 8.3
Text Domain: osada
*/

/* ---------- tokens ---------- */
*, *::before, *::after { box-sizing: border-box; }
:root {
	--ink: #141210; --paper: #fbfaf7; --mute: #6d665c; --line: #e3ded5; --red: #a3301f; --black: #0c0b0a;
	--edge: max(0px, calc((100vw - 1280px) / 2));
	--side: 108px;
	--display: 'Bodoni Moda', serif;
	--body: 'Zen Kaku Gothic New', sans-serif;
	--mincho: 'Shippori Mincho B1', serif;
}
body { margin: 0; background: var(--paper); color: var(--ink); font: 15px/1.6 var(--body); }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; height: auto; }
.serif { font-family: var(--display); font-weight: 400; }
.screen-reader-text { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- dark top ---------- */
.top { background: var(--black); color: #ece6db; position: relative; padding-left: 64px; }
.spine { position: absolute; left: 0; top: 0; bottom: 0; width: 64px; border-right: 1px solid #2a2622; display: flex; justify-content: center; padding-top: 26px; }
.spine b { writing-mode: vertical-rl; font-family: var(--mincho); font-weight: 800; font-size: 22px; letter-spacing: .18em; }
.site-nav { display: flex; justify-content: space-between; align-items: center; gap: 24px; padding: 22px calc(var(--edge) + 44px); font-size: 12px; letter-spacing: .1em; text-transform: uppercase; }
.lang-ja .site-nav .links { letter-spacing: .02em; gap: 10px 16px; font-size: 13px; }
.site-nav .links { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px; margin: 0; padding: 0; list-style: none; color: #a49c8f; }
.site-nav .links a:hover, .site-nav .links .current-menu-item > a, .site-nav .links .current_page_item > a { color: #ece6db; }
.site-nav .links a.ext { color: #ece6db; border-bottom: 1px solid var(--mute); padding-bottom: 2px; }
.site-nav .lang { color: #a49c8f; white-space: nowrap; }
.site-nav .lang b { color: #ece6db; font-weight: 500; }
.site-nav .lang a:hover { color: #ece6db; }
.nav-toggle { display: none; }

/* subpage title band; tall enough for the spine */
.page-head { padding: 34px calc(var(--edge) + 44px) 52px; min-height: 150px; display: flex; align-items: flex-end; }
.page-head h1 { margin: 0; font-family: var(--display); font-style: italic; font-weight: 400; font-size: 64px; line-height: 1; }
.lang-ja .page-head h1 { font-family: var(--mincho); font-style: normal; font-weight: 800; font-size: 46px; letter-spacing: .08em; }

/* ---------- paper ---------- */
.wrap { max-width: 1280px; margin: 0 auto; }
.page-main { padding: 64px var(--side) 96px; }

/* legacy page content */
.entry { max-width: 720px; display: flow-root; line-height: 1.75; }
.entry p { margin: 0 0 1.1em; }
.entry a { color: var(--ink); text-decoration: underline; text-decoration-color: #c9c1b4; text-underline-offset: 3px; }
.entry a:hover { text-decoration-color: currentColor; }
.entry h2, .entry h3, .entry h4 { font-family: var(--display); font-weight: 400; line-height: 1.2; margin: 1.6em 0 .6em; }
.entry h2 { font-size: 32px; } .entry h3 { font-size: 26px; } .entry h4 { font-size: 21px; }
.entry h5, .entry h6 { font-size: 15px; margin: 1.4em 0 .6em; }
.entry hr { border: 0; border-top: 1px solid var(--line); margin: 2.2em 0; clear: both; }
.entry ul, .entry ol { padding-left: 1.3em; }
.entry table { display: block; max-width: 100%; overflow-x: auto; border-collapse: collapse; }
.entry td, .entry th { padding: 6px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.entry .alignleft { float: left; margin: 6px 32px 20px 0; }
.entry .alignright { float: right; margin: 6px 0 20px 32px; }
.entry .aligncenter { display: block; margin: 20px auto; }
.entry .wp-caption { max-width: 100%; }
.entry .wp-caption img { display: block; }
.entry .wp-caption-text, .entry figcaption { font-size: 13px; color: var(--mute); margin-top: 8px; line-height: 1.5; }
.entry .wp-video, .entry .wp-video-shortcode, .entry video, .entry iframe, .entry embed, .entry object { max-width: 100% !important; }
.entry .wp-video { margin: 0 0 24px; }
.entry iframe { border: 0; }
.entry .entry-date { color: var(--mute); font-size: 13px; letter-spacing: .08em; }
/* old inline styling: pure red maps to the accent, foreign fonts and the 14px setting fall back to ours */
.entry span[style*="#ff0000"], .entry span[style*="color: red"], .entry a[style*="#ff0000"], .entry [style*="#ff0000"] a { color: var(--red) !important; }
.entry [style*="font-family"] { font-family: inherit !important; }
.entry span[style*="font-size: 14px"] { font-size: inherit !important; }
.entry p.title3 { font-size: inherit; font-weight: inherit; text-align: inherit; }
.entry .text_enji { color: var(--red); }
.post-list { list-style: none; padding: 0; }
.post-list li { padding: 12px 0; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; gap: 16px; }
.post-list a { text-decoration: none; font-family: var(--display); font-size: 21px; }
.post-list time { color: var(--mute); font-size: 13px; white-space: nowrap; }

.site-footer { padding: 34px calc(var(--edge) + var(--side)); border-top: 1px solid var(--line); display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; font-size: 12px; color: var(--mute); letter-spacing: .08em; }

/* ---------- breakpoints ---------- */
@media (max-width: 1100px) {
	:root { --side: 44px; }
	.site-nav { align-items: flex-start; }
}
@media (max-width: 760px) {
	:root { --side: 20px; }
	.top { padding-left: 0; }
	.spine { display: none; }
	.site-nav { padding: 16px 20px; flex-wrap: wrap; gap: 10px; }
	.nav-toggle { display: inline-block; order: 1; background: none; border: 1px solid #3a352f; color: #ece6db; font: inherit; letter-spacing: .13em; text-transform: uppercase; padding: 8px 14px; cursor: pointer; }
	.site-nav .lang { order: 2; margin-left: auto; }
	.site-nav .links { order: 3; width: 100%; flex-direction: column; align-items: flex-start; gap: 0; font-size: 13px; }
	.site-nav .links li { width: 100%; border-top: 1px solid #2a2622; }
	.site-nav .links a { display: block; padding: 12px 0; }
	.site-nav .links a.ext { border-bottom: 0; }
	.js .site-nav:not(.is-open) .links { display: none; }
	.page-head { padding: 20px 20px 34px; min-height: 0; }
	.page-head h1 { font-size: 42px; }
	.lang-ja .page-head h1 { font-size: 32px; }
	.page-main { padding-top: 36px; padding-bottom: 64px; }
	.entry .alignleft, .entry .alignright { float: none; display: block; margin: 0 0 20px; }
	.entry .wp-caption { width: auto !important; }
}

/* ---------- homepage: hero (inside .top) ---------- */
.hero { position: relative; height: min(700px, 82vh); overflow: hidden; display: flex; justify-content: flex-end; }
/* the photo keeps its own aspect ratio on wide screens: no upscaling, no cropped face */
.hero .ph { position: relative; height: 100%; aspect-ratio: var(--ratio, 1000 / 714); max-width: 100%; }
.hero .ph img { width: 100%; height: 100%; object-fit: cover; object-position: 75% 35%; filter: grayscale(1) contrast(1.05); display: block; }
.hero .ph::after { content: ''; position: absolute; inset: 0; background: linear-gradient(90deg, var(--black) 0%, rgba(12,11,10,.55) 22%, rgba(12,11,10,0) 45%); }
.hero .txt { position: absolute; left: calc(var(--edge) + 44px); bottom: 76px; z-index: 2; max-width: 500px; }
.kicker { font-size: 12px; letter-spacing: .3em; text-transform: uppercase; color: #a49c8f; margin-bottom: 18px; }
.hero h1 { font-style: italic; font-size: 96px; line-height: .92; margin: 0 0 22px; }
.hero p { color: #c4bcaf; font-size: 15.5px; line-height: 1.7; margin: 0; }
.hero h1, .hero p, .kicker { opacity: 0; transform: translateY(14px); animation: rise .9s ease forwards; }
.hero h1 { animation-delay: .15s; } .hero p { animation-delay: .3s; }
@keyframes rise { to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .hero h1, .hero p, .kicker { animation: none; opacity: 1; transform: none; } }

/* ---------- homepage: paper ---------- */
.home-section { padding: 84px var(--side); }
.home-section--tight { padding-top: 20px; }
.proof { padding: 40px var(--side); border-bottom: 1px solid var(--line); display: grid; grid-template-columns: repeat(3, 1fr) 1.5fr; gap: 32px; }
.proof b { display: block; font-family: var(--display); font-weight: 400; font-size: 46px; line-height: 1.05; white-space: nowrap; }
.proof span { font-size: 13px; color: var(--mute); }
.press { padding: 22px var(--side); border-bottom: 1px solid var(--line); display: flex; gap: 14px 34px; align-items: baseline; flex-wrap: wrap; font-family: var(--display); font-size: 22px; color: #8a8378; }
.press small { font-family: var(--body); font-size: 11px; letter-spacing: .25em; text-transform: uppercase; color: var(--mute); }

.sh { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; border-bottom: 1px solid var(--ink); padding-bottom: 14px; margin-bottom: 34px; }
.sh h2 { margin: 0; font-family: var(--display); font-style: italic; font-weight: 400; font-size: 44px; line-height: 1.1; }
.sh h2 small { font-family: var(--mincho); font-style: normal; font-size: 16px; color: var(--mute); margin-left: 14px; letter-spacing: .2em; }
.sh a { font-size: 12px; letter-spacing: .2em; text-transform: uppercase; color: var(--mute); white-space: nowrap; }
.sh a:hover { color: var(--ink); }
.lang-ja .sh h2 { font-family: var(--mincho); font-style: normal; font-weight: 800; font-size: 36px; letter-spacing: .06em; }
.lang-ja .sh h2 small { font-family: var(--display); font-style: italic; font-weight: 400; letter-spacing: .04em; }

.paths { display: grid; grid-template-columns: 1.15fr 1fr; border: 1px solid var(--ink); }
.path { padding: 44px; display: flex; flex-direction: column; }
.path + .path { border-left: 1px solid var(--ink); }
.path .eyebrow { font-size: 11.5px; letter-spacing: .28em; text-transform: uppercase; color: var(--mute); margin-bottom: 14px; }
.path h3 { font-family: var(--display); font-weight: 400; font-size: 36px; line-height: 1.1; margin: 0 0 16px; }
.lang-ja .path h3 { font-family: var(--mincho); font-weight: 800; font-size: 28px; line-height: 1.35; }
.path p { margin: 0 0 22px; color: #3d3832; line-height: 1.7; }
.path dl { display: grid; grid-template-columns: 150px 1fr; gap: 10px 18px; margin: 0 0 30px; font-size: 14px; }
.path dt { font-weight: 700; } .path dd { margin: 0; color: #4a443d; }
.path.academy { background: #f1eee8; }
.btn { margin-top: auto; align-self: flex-start; display: inline-block; padding: 14px 26px; font-size: 12px; letter-spacing: .2em; text-transform: uppercase; border: 1px solid var(--ink); transition: background .2s, color .2s; }
.btn.solid { background: var(--ink); color: var(--paper); }
.btn:hover { background: var(--ink); color: var(--paper); }
.btn.solid:hover { background: transparent; color: var(--ink); }

.prof { display: grid; grid-template-columns: 320px 1fr; gap: 64px; align-items: start; }
.prof img { width: 100%; display: block; }
.lead { font-family: var(--display); font-size: 31px; line-height: 1.3; margin: 0 0 30px; }
.lang-ja .lead { font-family: var(--mincho); font-weight: 800; font-size: 24px; line-height: 1.6; }
.lead em { color: var(--red); }
.tl { display: grid; grid-template-columns: 90px 1fr; row-gap: 14px; font-size: 14.5px; color: #4a443d; }
.tl b { font-family: var(--display); font-weight: 400; color: var(--ink); font-size: 19px; }

@media (max-width: 760px) {
	.hero { height: min(78vh, 620px); }
	.hero .ph { width: 100%; aspect-ratio: auto; }
	.hero .ph img { object-position: 70% 40%; }
	.hero .ph::after { background: linear-gradient(0deg, rgba(12,11,10,.95) 0%, rgba(12,11,10,.7) 42%, rgba(12,11,10,0) 70%); }
	.hero .txt { left: 20px; right: 20px; bottom: 36px; }
	.hero h1 { font-size: 64px; }
	.home-section { padding-top: 56px; padding-bottom: 56px; }
	.home-section--tight { padding-top: 12px; }
	.proof { grid-template-columns: repeat(3, 1fr); gap: 22px 16px; }
	.proof b { font-size: 30px; white-space: normal; }
	.proof span { display: block; font-size: 12px; line-height: 1.45; margin-top: 4px; }
	.proof > div:nth-child(4) { grid-column: 1 / -1; }
	.press { font-size: 18px; gap: 8px 20px; }
	.sh h2 { font-size: 32px; }
	.lang-ja .sh h2 { font-size: 26px; }
	.sh h2 small { display: block; margin: 6px 0 0; }
	.paths { grid-template-columns: 1fr; }
	.path { padding: 28px 22px; }
	.path + .path { border-left: 0; border-top: 1px solid var(--ink); }
	.path dl { grid-template-columns: 1fr; gap: 2px; }
	.path dd { margin-bottom: 12px; }
	.prof { grid-template-columns: 1fr; gap: 28px; }
	.prof img { max-width: 260px; }
	.lead { font-size: 25px; }
	.tl { grid-template-columns: 64px 1fr; }
}

/* ---------- galleries (native [gallery] + homepage excerpt) ---------- */
.entry > * { max-width: 720px; }
.entry { max-width: none; overflow-wrap: anywhere; } /* long URLs / mail addresses in legacy content must not widen the page */
.entry > .gallery-grid { max-width: none; margin: 8px 0 32px; }
.gallery-grid { display: grid; grid-template-columns: repeat(4, 1fr); grid-auto-rows: 100px; grid-auto-flow: dense; gap: 12px; }
/* even row spans (2/4) pack without holes; tile shapes normal 1.21, tall 0.59, wide 1.21 — landscapes lose a little
   at the sides, never top/bottom (heads). Keep in sync with osada_tile_sizes(). */
.gallery-grid .tile { margin: 0; overflow: hidden; background: #ece8e1; grid-row: span 2; }
.gallery-grid .tile a { display: block; height: 100%; }
.gallery-grid img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .6s; }
.gallery-grid .tile:hover img { transform: scale(1.04); }
.gallery-grid .tile--tall { grid-row: span 4; }
.gallery-grid .tile--wide { grid-column: span 2; grid-row: span 4; }
.gallery-grid .tile--fit img { object-fit: contain; }
.gallery-grid .tile--fit:hover img { transform: none; }
.gallery-grid a:focus-visible { outline: 2px solid var(--red); outline-offset: 2px; }

.lightbox { width: 100vw; height: 100vh; max-width: none; max-height: none; margin: 0; padding: 0; border: 0; background: rgba(12, 11, 10, .96); color: #ece6db; }
.lightbox::backdrop { background: transparent; }
.lightbox img { position: absolute; inset: 0; margin: auto; max-width: 94vw; max-height: 88vh; width: auto; height: auto; }
.lightbox button { position: absolute; background: none; border: 0; color: #ece6db; font: 300 44px/1 var(--display); padding: 14px 18px; cursor: pointer; opacity: .75; }
.lightbox button:hover, .lightbox button:focus-visible { opacity: 1; }
.lightbox .lb-prev { left: 8px; top: 50%; transform: translateY(-50%); }
.lightbox .lb-next { right: 8px; top: 50%; transform: translateY(-50%); }
.lightbox .lb-close { right: 8px; top: 8px; }
.lightbox .lb-count { position: absolute; left: 50%; bottom: 18px; transform: translateX(-50%); font-size: 12px; letter-spacing: .2em; color: #a49c8f; }
.lightbox.single .lb-prev, .lightbox.single .lb-next, .lightbox.single .lb-count { display: none; }

@media (max-width: 760px) {
	.gallery-grid { grid-template-columns: 1fr 1fr; grid-auto-rows: 76px; gap: 8px; }
	.lightbox .lb-prev, .lightbox .lb-next { top: auto; bottom: 6px; transform: none; }
}
