/*
Theme Name: うちのいきもの
Theme URI: https://uchinoikimono.com/
Author: Uchi no Ikimono
Description: 猫・昆虫・アクアリウムなど、いきものとの暮らしを一次情報とともに伝えるメディアテーマ。
Version: 0.4.0
Requires at least: 7.1
Requires PHP: 8.1
Text Domain: uchinoikimono
*/

:root {
    --uchi-ink: #203128;
    --uchi-muted: #667168;
    --uchi-paper: #fbfaf5;
    --uchi-surface: #ffffff;
    --uchi-leaf: #2f6f50;
    --uchi-leaf-dark: #24583f;
    --uchi-moss: #dce9df;
    --uchi-water: #dceef0;
    --uchi-sand: #f4e4c3;
    --uchi-amber: #d5853b;
    --uchi-line: #dfe5df;
    --uchi-shadow: 0 18px 50px rgba(34, 58, 43, 0.09);
    --uchi-radius: 22px;
    --uchi-content: 760px;
    --uchi-wide: 1180px;
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    background: var(--uchi-paper);
    color: var(--uchi-ink);
    font-family: "Hiragino Kaku Gothic ProN", "Yu Gothic", "YuGothic", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 16px;
    line-height: 1.85;
    text-rendering: optimizeLegibility;
}

img { max-width: 100%; height: auto; border-radius: 14px; }
a { color: var(--uchi-leaf); text-decoration-thickness: 0.08em; text-underline-offset: 0.16em; }
a:hover { color: var(--uchi-leaf-dark); }
button, input, textarea, select { font: 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;
}
.screen-reader-text:focus {
    width: auto; height: auto; clip: auto; overflow: visible;
    left: 16px; top: 16px; z-index: 100000; padding: 12px 16px;
    background: var(--uchi-surface); border-radius: 8px; box-shadow: var(--uchi-shadow);
}

.site-shell { width: min(calc(100% - 40px), var(--uchi-wide)); margin-inline: auto; }
.content-shell { width: min(calc(100% - 40px), var(--uchi-content)); margin-inline: auto; }

.site-header {
    position: sticky; top: 0; z-index: 100;
    background: rgba(251, 250, 245, 0.94);
    border-bottom: 1px solid rgba(47, 111, 80, 0.12);
    backdrop-filter: blur(15px);
}
.site-header__inner { min-height: 76px; display: flex; align-items: center; justify-content: space-between; gap: 28px; }
.site-brand { display: inline-flex; align-items: center; gap: 11px; color: var(--uchi-ink); text-decoration: none; font-weight: 800; letter-spacing: 0.03em; }
.site-brand__mark { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 14px 14px 14px 5px; background: var(--uchi-leaf); color: #fff; font-size: 20px; transform: rotate(-3deg); }
.site-brand__name { font-size: 18px; }
.site-brand__sub { display: block; margin-top: -4px; color: var(--uchi-muted); font-size: 10px; font-weight: 600; letter-spacing: 0.08em; }

.menu-toggle { display: none; border: 1px solid var(--uchi-line); background: var(--uchi-surface); border-radius: 10px; padding: 8px 12px; color: var(--uchi-ink); }
.primary-nav ul { display: flex; align-items: center; gap: 24px; margin: 0; padding: 0; list-style: none; }
.primary-nav a { color: var(--uchi-ink); text-decoration: none; font-weight: 700; font-size: 14px; }
.primary-nav a:hover { color: var(--uchi-leaf); }

.hero { padding: clamp(64px, 9vw, 120px) 0 56px; overflow: hidden; }
.hero__inner { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(300px, 0.9fr); align-items: center; gap: clamp(44px, 8vw, 96px); }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; margin: 0 0 16px; color: var(--uchi-leaf); font-size: 13px; font-weight: 800; letter-spacing: 0.12em; text-transform: uppercase; }
.eyebrow::before { content: ""; width: 28px; height: 2px; background: currentColor; }
.hero h1 { max-width: 760px; margin: 0; font-size: clamp(40px, 6vw, 76px); line-height: 1.14; letter-spacing: -0.045em; }
.hero h1 em { color: var(--uchi-leaf); font-style: normal; }
.hero__lead { max-width: 660px; margin: 24px 0 0; color: var(--uchi-muted); font-size: clamp(16px, 2vw, 20px); }
.hero__actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }
.button, .ae-button {
    display: inline-flex; align-items: center; justify-content: center;
    min-height: 48px; padding: 11px 22px; border-radius: 999px;
    background: var(--uchi-leaf); color: #fff; text-decoration: none; font-weight: 800;
    border: 1px solid var(--uchi-leaf); transition: transform .2s ease, background .2s ease;
}
.button:hover, .ae-button:hover { color: #fff; background: var(--uchi-leaf-dark); transform: translateY(-2px); }
.button--ghost { background: transparent; color: var(--uchi-ink); border-color: var(--uchi-line); }
.button--ghost:hover { color: var(--uchi-leaf); background: var(--uchi-surface); }

.hero-orbit { position: relative; min-height: 420px; }
.hero-orbit::before { content: ""; position: absolute; inset: 25px; border-radius: 50%; background: var(--uchi-moss); }
.hero-orbit::after { content: ""; position: absolute; inset: 76px; border: 1px dashed rgba(47, 111, 80, .35); border-radius: 50%; }
.orbit-card { position: absolute; z-index: 2; width: 172px; min-height: 156px; padding: 22px; border: 1px solid rgba(32, 49, 40, .08); border-radius: 30px; background: rgba(255,255,255,.92); box-shadow: var(--uchi-shadow); text-decoration: none; color: var(--uchi-ink); }
.orbit-card:hover { color: var(--uchi-ink); transform: translateY(-4px) rotate(1deg); }
.orbit-card__icon { display: block; font-size: 40px; line-height: 1; }
.orbit-card strong { display: block; margin-top: 14px; font-size: 18px; }
.orbit-card small { display: block; margin-top: 4px; color: var(--uchi-muted); }
.orbit-card--cats { top: 0; left: 18%; }
.orbit-card--aquarium { right: 0; top: 33%; background: #f4fbfb; }
.orbit-card--insects { left: 3%; bottom: 0; background: #fffaf0; }

.section { padding: clamp(56px, 8vw, 96px) 0; }
.section--white { background: var(--uchi-surface); }
.section--moss { background: var(--uchi-moss); }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin-bottom: 34px; }
.section-heading h2 { margin: 0; font-size: clamp(28px, 4vw, 46px); line-height: 1.25; letter-spacing: -0.03em; }
.section-heading p { max-width: 520px; margin: 0; color: var(--uchi-muted); }

.category-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.category-card { position: relative; min-height: 260px; padding: 30px; border-radius: var(--uchi-radius); color: var(--uchi-ink); text-decoration: none; overflow: hidden; transition: transform .25s ease; }
.category-card:hover { color: var(--uchi-ink); transform: translateY(-5px); }
.category-card--cats { background: var(--uchi-sand); }
.category-card--aquarium { background: var(--uchi-water); }
.category-card--insects { background: var(--uchi-moss); }
.category-card__icon { position: absolute; right: 24px; bottom: 10px; font-size: 92px; opacity: .82; transform: rotate(-5deg); }
.category-card h3 { margin: 0; font-size: 26px; }
.category-card p { position: relative; z-index: 1; max-width: 210px; color: rgba(32,49,40,.72); }
.category-card__arrow { position: absolute; left: 30px; bottom: 28px; font-weight: 800; }

.post-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px; }
.post-card { display: flex; flex-direction: column; min-width: 0; border: 1px solid var(--uchi-line); border-radius: var(--uchi-radius); background: var(--uchi-surface); overflow: hidden; box-shadow: 0 10px 30px rgba(34,58,43,.04); }
.post-card__media { display: block; aspect-ratio: 16 / 10; background: linear-gradient(135deg, var(--uchi-moss), var(--uchi-water)); overflow: hidden; }
.post-card__media img { width: 100%; height: 100%; object-fit: cover; border-radius: 0; transition: transform .35s ease; }
.post-card:hover .post-card__media img { transform: scale(1.03); }
.post-card__placeholder { width: 100%; height: 100%; display: grid; place-items: center; font-size: 50px; }
.post-card__body { display: flex; flex-direction: column; flex: 1; padding: 22px; }
.post-card__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 10px; color: var(--uchi-muted); font-size: 12px; }
.post-card h2, .post-card h3 { margin: 0; font-size: 20px; line-height: 1.5; }
.post-card h2 a, .post-card h3 a { color: var(--uchi-ink); text-decoration: none; }
.post-card__excerpt { margin: 12px 0 0; color: var(--uchi-muted); font-size: 14px; }
.post-card__more { margin-top: auto; padding-top: 18px; font-weight: 800; font-size: 13px; text-decoration: none; }

.trust-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.trust-item { padding: 26px; border-radius: var(--uchi-radius); background: rgba(255,255,255,.72); }
.trust-item__number { color: var(--uchi-leaf); font-weight: 900; letter-spacing: .08em; }
.trust-item h3 { margin: 9px 0; font-size: 20px; }
.trust-item p { margin: 0; color: var(--uchi-muted); }

.archive-header { padding: 72px 0 36px; }
.archive-header h1 { margin: 0; font-size: clamp(36px, 5vw, 58px); line-height: 1.2; }
.archive-header p { max-width: 700px; margin: 16px 0 0; color: var(--uchi-muted); }
.archive-content { padding-bottom: 90px; }

.entry { padding: 68px 0 96px; }
.breadcrumbs { margin: 0 0 24px; color: var(--uchi-muted); font-size: 12px; }
.breadcrumbs ol { display: flex; flex-wrap: wrap; gap: 7px; margin: 0; padding: 0; list-style: none; }
.breadcrumbs li { display: inline-flex; align-items: center; min-width: 0; }
.breadcrumbs li:not(:last-child)::after { content: "/"; margin-left: 7px; color: #a4ada6; }
.breadcrumbs a { color: var(--uchi-muted); text-decoration: none; }
.breadcrumbs span { display: inline-block; max-width: min(58vw, 480px); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.entry-header { margin-bottom: 40px; }
.entry-kicker { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 16px; }
.entry-header h1 { margin: 0; font-size: clamp(34px, 5.6vw, 58px); line-height: 1.28; letter-spacing: -0.035em; }
.entry-answer { margin: 26px 0 0; padding: 22px 24px; border: 1px solid #cbdccd; border-radius: 18px; background: linear-gradient(135deg, #f4faf5, #fbfaf5); }
.entry-answer__label { margin: 0 0 6px !important; color: var(--uchi-leaf); font-size: 12px; font-weight: 900; letter-spacing: .12em; }
.entry-answer > p:last-child { margin: 0; color: var(--uchi-ink); font-size: 17px; font-weight: 700; line-height: 1.8; }
.entry-byline { display: flex; flex-wrap: wrap; gap: 16px; margin-top: 20px; color: var(--uchi-muted); font-size: 13px; }
.entry-byline a { color: inherit; font-weight: 800; }
.entry-thumbnail { margin: 36px 0 48px; }
.entry-thumbnail img { width: 100%; border-radius: 28px; }
.entry-toc { margin: 0 0 48px; padding: 24px 26px; border: 1px solid var(--uchi-line); border-radius: 18px; background: var(--uchi-surface); }
.entry-toc__title { margin: 0 0 10px; color: var(--uchi-ink); font-weight: 900; }
.entry-toc ol { display: grid; gap: 8px; margin: 0; padding-left: 1.4em; }
.entry-toc a { color: var(--uchi-ink); text-decoration: none; }
.entry-toc a:hover { color: var(--uchi-leaf); text-decoration: underline; }
.entry-content { font-size: 17px; }
.entry-content > * { max-width: 100%; }
.entry-content h2 { margin: 2.6em 0 .8em; font-size: clamp(26px, 4vw, 36px); line-height: 1.4; scroll-margin-top: 100px; }
.entry-content h3 { margin: 2em 0 .6em; font-size: 23px; line-height: 1.5; }
.entry-content p, .entry-content ul, .entry-content ol { margin: 1.2em 0; }
.entry-content blockquote { margin: 2em 0; padding: 20px 24px; border-left: 4px solid var(--uchi-leaf); background: var(--uchi-moss); border-radius: 0 16px 16px 0; }
.entry-content table { width: 100%; border-collapse: collapse; margin: 2em 0; font-size: 15px; }
.entry-content th, .entry-content td { padding: 14px; border: 1px solid var(--uchi-line); text-align: left; }
.entry-content th { background: var(--uchi-moss); }
.entry-content .source-list { margin-top: 1em; padding: 22px 24px 22px 46px; border: 1px solid var(--uchi-line); border-radius: 16px; background: #f7f7f3; font-size: 14px; }
.entry-content .source-list a { overflow-wrap: anywhere; }
.related-articles { border-top: 1px solid var(--uchi-line); }

.author-box { display: grid; grid-template-columns: 112px 1fr; gap: 24px; align-items: start; margin-top: 56px; padding: 26px; border: 1px solid var(--uchi-line); border-radius: var(--uchi-radius); background: var(--uchi-surface); box-shadow: 0 10px 30px rgba(34,58,43,.05); }
.author-box__avatar img { display: block; width: 112px; height: 112px; object-fit: cover; border-radius: 36px 36px 36px 12px; }
.author-box__label { margin: 0 0 4px; color: var(--uchi-leaf); font-size: 11px; font-weight: 900; letter-spacing: .12em; }
.author-box h2 { margin: 0; font-size: 22px; line-height: 1.4; }
.author-box h2 a { color: var(--uchi-ink); text-decoration: none; }
.author-box__body > p:not(.author-box__label) { margin: 8px 0 0; color: var(--uchi-muted); font-size: 14px; }
.author-box__link { display: inline-block; margin-top: 10px; font-size: 13px; font-weight: 800; text-decoration: none; }

.page-type-badge, .ae-evidence-badge, .term-chip { display: inline-flex; align-items: center; min-height: 28px; padding: 4px 11px; border-radius: 999px; font-size: 11px; font-weight: 800; letter-spacing: .03em; }
.page-type-badge--info { background: var(--uchi-water); }
.page-type-badge--product { background: var(--uchi-sand); }
.page-type-badge--money { background: #f4d8d5; }
.ae-evidence-badge--verified { background: #d8ecdf; color: #22543a; }
.ae-evidence-badge--pending, .ae-evidence-badge--candidate { background: #fff0cc; color: #735315; }
.ae-evidence-badge--research { background: #e9ecea; color: #536159; }
.term-chip { background: var(--uchi-surface); border: 1px solid var(--uchi-line); color: var(--uchi-ink); text-decoration: none; }

.ae-disclosure { margin: 0 0 28px; padding: 14px 17px; border: 1px solid var(--uchi-line); border-radius: 12px; background: #f7f7f3; color: var(--uchi-muted); font-size: 12px; }
.ae-product-card { display: grid; grid-template-columns: 180px 1fr; gap: 24px; margin: 32px 0; padding: 22px; border: 1px solid var(--uchi-line); border-radius: var(--uchi-radius); background: var(--uchi-surface); box-shadow: 0 10px 30px rgba(34,58,43,.05); }
.ae-product-card__media img { width: 100%; }
.ae-product-card__title { margin: 10px 0 4px !important; font-size: 22px !important; }
.ae-product-card__title a { color: var(--uchi-ink); text-decoration: none; }
.ae-cta { margin: 34px 0; padding: 28px; border-radius: var(--uchi-radius); background: var(--uchi-moss); text-align: center; }
.ae-cta h3 { margin-top: 0; }
.ae-cta--position-lead { margin-top: 24px; }
.ae-cta--position-end { margin-bottom: 0; }
.ae-provided-link { display: flex; align-items: center; justify-content: center; gap: 8px; overflow: hidden; }
.ae-provided-link > a:not(:has(img)) {
    display: inline-flex; align-items: center; justify-content: center; min-height: 46px; padding: 11px 22px;
    border-radius: 999px; background: var(--uchi-leaf); color: #fff; font-weight: 800; text-decoration: none;
}
.ae-provided-link > a:not(:has(img)):hover { background: var(--uchi-leaf-dark); color: #fff; transform: translateY(-2px); }
.ae-provided-link > a > img { display: block; max-width: 100%; height: auto; }
.ae-comparison { margin: 32px 0; overflow-x: auto; }
.ae-comparison table { min-width: 640px; }
.ae-marketplace-comparison { margin: 34px 0; padding: 28px; border: 1px solid var(--uchi-line); border-radius: var(--uchi-radius); background: var(--uchi-surface); }
.ae-marketplace-comparison h3 { margin-top: 0; text-align: center; }
.ae-marketplace-comparison__links { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; }
.ae-info-route { margin: 42px 0 0; padding: 28px; border: 1px solid var(--uchi-line); border-radius: var(--uchi-radius); background: linear-gradient(135deg, #f4faf5, var(--uchi-surface)); }
.ae-info-route h2 { margin: 6px 0 12px; font-size: 25px; }
.ae-info-route__label { margin: 0; color: var(--uchi-leaf); font-size: 12px; font-weight: 900; letter-spacing: .1em; }

.product-hero { display: grid; grid-template-columns: minmax(260px, .8fr) minmax(0, 1.2fr); gap: clamp(34px, 6vw, 70px); align-items: center; }
.product-hero__media { aspect-ratio: 1; display: grid; place-items: center; padding: 26px; border-radius: 32px; background: var(--uchi-surface); }
.product-hero__media img { max-height: 100%; object-fit: contain; }
.product-facts { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin: 26px 0; }
.product-fact { padding: 14px 16px; border-radius: 12px; background: var(--uchi-surface); }
.product-fact dt { color: var(--uchi-muted); font-size: 11px; font-weight: 800; }
.product-fact dd { margin: 4px 0 0; font-weight: 700; }

.pagination { display: flex; justify-content: center; gap: 8px; margin-top: 44px; }
.pagination .page-numbers { min-width: 42px; height: 42px; display: grid; place-items: center; border: 1px solid var(--uchi-line); border-radius: 50%; background: var(--uchi-surface); text-decoration: none; }
.pagination .current { background: var(--uchi-leaf); color: #fff; border-color: var(--uchi-leaf); }

.search-form { display: flex; gap: 8px; max-width: 620px; }
.search-form label { flex: 1; }
.search-field { width: 100%; min-height: 48px; padding: 10px 16px; border: 1px solid var(--uchi-line); border-radius: 999px; background: var(--uchi-surface); }
.search-submit { min-height: 48px; padding: 10px 20px; border: 0; border-radius: 999px; background: var(--uchi-leaf); color: #fff; font-weight: 800; }

.empty-state { padding: 60px 28px; border: 1px dashed #b9c8bc; border-radius: var(--uchi-radius); text-align: center; }
.empty-state h2 { margin-top: 0; }
.not-found { min-height: 65vh; display: grid; place-items: center; padding: 70px 0; text-align: center; }
.not-found__number { margin: 0; color: var(--uchi-leaf); font-size: clamp(90px, 18vw, 180px); font-weight: 900; line-height: .9; opacity: .15; }

.contact-form { margin-top: 32px; }
.contact-form__field { display: grid; gap: 7px; }
.contact-form__field label { font-weight: 800; }
.contact-form__field input, .contact-form__field textarea {
    width: 100%; padding: 12px 14px; border: 1px solid var(--uchi-line); border-radius: 12px;
    background: var(--uchi-surface); color: var(--uchi-ink);
}
.contact-form__field input:focus, .contact-form__field textarea:focus { outline: 3px solid var(--uchi-moss); border-color: var(--uchi-leaf); }
.contact-form__website { position: absolute !important; left: -10000px !important; width: 1px; height: 1px; overflow: hidden; }
.contact-form__consent { font-size: 14px; }
.contact-form__notice { padding: 14px 17px; border-radius: 12px; font-weight: 700; }
.contact-form__notice--success { border: 1px solid #a9cfb6; background: #edf8f0; }
.contact-form__notice--error { border: 1px solid #d9a6a1; background: #fff0ee; }

.site-footer { padding: 58px 0 28px; background: var(--uchi-ink); color: #eef4ef; }
.site-footer a { color: #eef4ef; }
.site-footer__grid { display: grid; grid-template-columns: 1.4fr .6fr .6fr; gap: 40px; }
.site-footer__about { max-width: 510px; color: #bdc9c0; }
.site-footer h2, .site-footer h3 { color: #fff; }
.site-footer ul { padding: 0; list-style: none; }
.site-footer li + li { margin-top: 8px; }
.site-footer__bottom { display: flex; justify-content: space-between; gap: 20px; margin-top: 44px; padding-top: 22px; border-top: 1px solid rgba(255,255,255,.14); color: #a9b6ac; font-size: 12px; }

@media (max-width: 900px) {
    .hero__inner { grid-template-columns: 1fr; }
    .hero-orbit { min-height: 360px; max-width: 520px; width: 100%; margin-inline: auto; }
    .category-grid, .post-grid, .trust-grid { grid-template-columns: repeat(2, 1fr); }
    .category-card:last-child, .trust-item:last-child { grid-column: 1 / -1; }
    .product-hero { grid-template-columns: 1fr; }
    .site-footer__grid { grid-template-columns: 1fr 1fr; }
    .site-footer__brand { grid-column: 1 / -1; }
}

@media (max-width: 700px) {
    .site-shell, .content-shell { width: min(calc(100% - 28px), var(--uchi-wide)); }
    .site-header__inner { min-height: 66px; }
    .menu-toggle { display: inline-flex; }
    .primary-nav { display: none; position: absolute; left: 14px; right: 14px; top: 68px; padding: 18px; border: 1px solid var(--uchi-line); border-radius: 16px; background: var(--uchi-surface); box-shadow: var(--uchi-shadow); }
    .primary-nav.is-open { display: block; }
    .primary-nav ul { align-items: stretch; flex-direction: column; gap: 4px; }
    .primary-nav a { display: block; padding: 10px; }
    .hero { padding-top: 48px; }
    .hero-orbit { min-height: 330px; }
    .orbit-card { width: 145px; min-height: 132px; padding: 17px; }
    .orbit-card__icon { font-size: 32px; }
    .orbit-card strong { font-size: 15px; }
    .category-grid, .post-grid, .trust-grid { grid-template-columns: 1fr; }
    .category-card:last-child, .trust-item:last-child { grid-column: auto; }
    .section-heading { align-items: start; flex-direction: column; }
    .entry { padding-top: 46px; }
    .entry-answer { padding: 18px; }
    .entry-toc { padding: 20px; }
    .entry-content { font-size: 16px; }
    .ae-product-card { grid-template-columns: 1fr; }
    .author-box { grid-template-columns: 72px 1fr; gap: 16px; padding: 20px; }
    .author-box__avatar img { width: 72px; height: 72px; border-radius: 24px 24px 24px 8px; }
    .product-facts { grid-template-columns: 1fr; }
    .site-footer__grid { grid-template-columns: 1fr; }
    .site-footer__brand { grid-column: auto; }
    .site-footer__bottom { flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
