/*
Theme Name: Shelter Press
Theme URI: https://shelterpress.net
Author: Media Dev Team
Description: 不動産・住まい専門メディア「SHELTER PRESS」（https://shelterpress.net）。住まいのいまを、正しく伝えるテーマ。
Version: 4.6.1
Requires at least: 6.0
Tested up to: 6.7
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: estate-view
Tags: blog, two-columns, custom-menu, featured-images, translation-ready
*/

:root {
  --navy: #1d3a5f;
  --navy-deep: #142844;
  --accent: #b08d3e;
  --text: #1f2933;
  --muted: #6b7280;
  --line: #e2e6ec;
  --bg: #f4f6f8;
  --surface: #ffffff;
  --font: "Noto Sans JP", "Hiragino Kaku Gothic ProN", "Yu Gothic", Meiryo, sans-serif;
  --font-serif: "Shippori Mincho", "Hiragino Mincho ProN", "Yu Mincho", serif;
  --max: 1100px;
  --side: 280px;
  --pad: 20px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; overflow-x: clip; }
body {
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  font-size: 16px;
  line-height: 1.8;
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "palt";
  overflow-x: clip;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--navy); text-decoration: none; transition: color .2s var(--ease); }
a:hover { color: var(--accent); }
ul, ol { list-style: none; }

.skip-link { position: absolute; left: -9999px; }
.skip-link:focus {
  position: fixed; left: 8px; top: 8px; z-index: 9999;
  background: var(--surface); padding: 8px 14px; border: 1px solid var(--line);
}
::selection { background: rgba(29, 58, 95, 0.18); }

/* ===== Header ===== */
.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}
.site-header__inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 32px var(--pad) 22px;
  text-align: center;
}
.site-brand a {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  color: var(--text);
}
.site-brand__en {
  font-family: var(--font-serif);
  font-size: clamp(1.8rem, 3.5vw, 2.3rem);
  font-weight: 700;
  letter-spacing: .2em;
  color: var(--navy);
  line-height: 1.2;
}
.site-logo {
  display: block;
  height: 72px;
  width: auto;
  max-width: min(480px, 92vw);
  margin: 0 auto;
  object-fit: contain;
}
.site-desc {
  margin-top: 10px;
  font-size: .82rem;
  color: var(--muted);
  letter-spacing: .04em;
}

.site-nav { border-top: 1px solid var(--line); }
.site-nav__inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 var(--pad);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}
.site-nav__search {
  flex: 0 1 260px;
  min-width: 180px;
  margin: 8px 0;
}
.site-nav__search .search-form {
  width: 100%;
}
.nav-toggle {
  display: none;
  background: var(--surface);
  border: 1px solid var(--line);
  padding: 8px 14px;
  font: inherit;
  font-size: .85rem;
  cursor: pointer;
  margin: 10px 0;
}
.nav-menu ul {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
}
.nav-menu a {
  display: block;
  padding: 13px 16px;
  font-size: .9rem;
  font-weight: 600;
  color: var(--text);
}
.nav-menu a:hover {
  color: var(--navy);
  background: rgba(29, 58, 95, 0.06);
}

/* ===== Hero ===== */
.hero {
  max-width: var(--max);
  margin: 0 auto;
  padding: 28px var(--pad) 8px;
  animation: fade-up .6s var(--ease) both;
}
.hero__media {
  display: block;
  overflow: hidden;
  background: var(--navy-deep);
  line-height: 0;
}
.hero__img,
.hero__media .noimg--hero {
  width: 100%;
  aspect-ratio: 21 / 10;
  object-fit: cover;
  min-height: 240px;
  max-height: 480px;
}
.hero__body {
  background: var(--surface);
  border: 1px solid var(--line);
  border-top: none;
  padding: 24px 28px 28px;
}
.hero__cat {
  font-size: .78rem;
  font-weight: 700;
  color: var(--navy);
  letter-spacing: .06em;
}
.hero__title {
  font-family: var(--font-serif);
  font-size: clamp(1.4rem, 2.8vw, 1.9rem);
  font-weight: 600;
  line-height: 1.45;
  margin: 8px 0 12px;
  letter-spacing: .02em;
}
.hero__title a { color: var(--text); }
.hero__title a:hover { color: var(--navy); }
.hero__ex {
  font-size: .95rem;
  color: var(--muted);
  max-width: 42em;
}
.hero__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px 20px;
  margin-top: 18px;
  font-size: .82rem;
  color: var(--muted);
}
.hero__more {
  font-weight: 700;
  color: var(--navy);
  border-bottom: 1px solid var(--accent);
  padding-bottom: 2px;
}
.hero__more:hover { color: var(--accent); }

/* ===== Home layout ===== */
.home-layout {
  max-width: var(--max);
  margin: 0 auto;
  padding: 36px var(--pad) 56px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--side);
  gap: 40px;
  align-items: start;
}
.section-head { margin-bottom: 18px; }
.section-head__title {
  font-family: var(--font-serif);
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: .04em;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--navy);
}

/* ===== Post list ===== */
.post-list { display: flex; flex-direction: column; }
.post-item {
  display: grid;
  grid-template-columns: 200px minmax(0, 1fr);
  gap: 20px;
  padding: 20px 0;
  border-bottom: 1px solid var(--line);
  align-items: start;
}
.post-item:first-child { border-top: 1px solid var(--line); }
.post-item__thumb {
  display: block;
  overflow: hidden;
  background: var(--navy-deep);
  line-height: 0;
}
.post-item__thumb img,
.post-item__thumb .noimg {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  transition: transform .4s var(--ease);
}
.post-item:hover .post-item__thumb img { transform: scale(1.04); }
.post-item__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  align-items: center;
  margin-bottom: 6px;
  font-size: .78rem;
  color: var(--muted);
}
.cat {
  font-weight: 700;
  color: var(--navy);
  letter-spacing: .04em;
}
.post-item__title {
  font-family: var(--font-serif);
  font-size: 1.15rem;
  font-weight: 600;
  line-height: 1.5;
  letter-spacing: .02em;
}
.post-item__title a { color: var(--text); }
.post-item__title a:hover { color: var(--navy); }
.post-item__ex {
  margin-top: 8px;
  font-size: .88rem;
  color: var(--muted);
  line-height: 1.75;
}

/* ===== Sidebar ===== */
.home-side {
  display: flex;
  flex-direction: column;
  gap: 28px;
  position: sticky;
  top: 16px;
}
.rank-box,
.cat-box,
.search-box {
  background: var(--surface);
  border: 1px solid var(--line);
  padding: 20px;
}
.rank-list__item {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}
.rank-list__item:last-child { border-bottom: none; }
.rank-list__num {
  font-family: var(--font-serif);
  font-weight: 700;
  color: var(--accent);
  font-size: 1.05rem;
  line-height: 1.4;
  text-align: center;
}
.rank-list__link {
  font-size: .9rem;
  font-weight: 600;
  line-height: 1.55;
  color: var(--text);
}
.rank-list__link:hover { color: var(--navy); }
.cat-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0;
  padding: 0;
}
.cat-list li { margin: 0; list-style: none; }
.cat-list a {
  display: block;
  font-size: .9rem;
  font-weight: 600;
  color: var(--text);
  padding: 6px 0;
  border-bottom: 1px solid var(--line);
}
.cat-list a:hover { color: var(--navy); }

/* ===== Archive wrap ===== */
.content-wrap {
  max-width: 820px;
  margin: 0 auto;
  padding: 36px var(--pad) 56px;
}
.page-header { margin-bottom: 24px; }
.page-title {
  font-family: var(--font-serif);
  font-size: 1.5rem;
  font-weight: 600;
  letter-spacing: .04em;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--navy);
  display: inline-block;
}
.archive-description {
  margin-top: 10px;
  font-size: .9rem;
  color: var(--muted);
}
.empty-note {
  padding: 32px 0;
  text-align: center;
  color: var(--muted);
}

/* ===== Placeholder ===== */
.noimg {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 120px;
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-deep) 55%, #3a5575 100%);
  position: relative;
}
.noimg::after {
  content: "SHELTER PRESS";
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .2em;
  color: rgba(255, 255, 255, 0.55);
}
.noimg--hero {
  min-height: 240px;
  aspect-ratio: 21 / 10;
  max-height: 480px;
}

/* ===== Single ===== */
.single-wrap {
  max-width: 740px;
  margin: 36px auto 64px;
  padding: 0 var(--pad);
}
.breadcrumb {
  font-size: .78rem;
  color: var(--muted);
  margin-bottom: 16px;
}
.breadcrumb ol { display: flex; flex-wrap: wrap; align-items: center; }
.breadcrumb li { display: flex; align-items: center; }
.breadcrumb li + li::before { content: "›"; margin: 0 8px; opacity: .45; }
.breadcrumb a { color: var(--muted); }
.breadcrumb a:hover { color: var(--navy); }
.breadcrumb [aria-current="page"] { color: var(--text); }

.article {
  background: var(--surface);
  border: 1px solid var(--line);
  padding: 32px 36px;
}
.article__cat {
  font-size: .78rem;
  font-weight: 700;
  color: var(--navy);
}
.article__title {
  font-family: var(--font-serif);
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 600;
  line-height: 1.4;
  margin: 10px 0 12px;
  letter-spacing: .02em;
}
.article__meta {
  font-size: .82rem;
  color: var(--muted);
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.article__thumb { margin: 24px 0; line-height: 0; }
.article__thumb img { width: 100%; }
.article__thumb .noimg { aspect-ratio: 16 / 9; min-height: 0; }

.entry-content { font-size: 1.02rem; }
.entry-content > * + * { margin-top: 1.4em; }
.entry-content h2 {
  font-family: var(--font-serif);
  font-size: 1.3rem;
  font-weight: 600;
  padding: 10px 14px;
  background: rgba(29, 58, 95, 0.08);
  border-left: 4px solid var(--navy);
  line-height: 1.5;
}
.entry-content h3 {
  font-family: var(--font-serif);
  font-size: 1.15rem;
  font-weight: 600;
  padding-bottom: 6px;
  border-bottom: 2px solid var(--accent);
}
.entry-content h4 { font-size: 1.05rem; font-weight: 700; }
.entry-content ul,
.entry-content ol { padding-left: 1.5em; }
.entry-content ul { list-style: disc; }
.entry-content ol { list-style: decimal; }
.entry-content blockquote {
  border-left: 3px solid var(--navy);
  padding: 8px 0 8px 18px;
  color: var(--muted);
  background: rgba(29, 58, 95, 0.04);
}
.entry-content a {
  color: var(--navy);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.entry-content table {
  border-collapse: collapse;
  width: 100%;
  display: block;
  overflow-x: auto;
}
.entry-content th,
.entry-content td {
  border: 1px solid var(--line);
  padding: 10px 14px;
  font-size: .9rem;
}
.entry-content th { background: rgba(29, 58, 95, 0.06); }
.entry-content code {
  background: rgba(29, 58, 95, 0.06);
  padding: 2px 6px;
  font-size: .9em;
}
.wp-block-image figcaption {
  font-size: .8rem;
  color: var(--muted);
  text-align: center;
  margin-top: 8px;
}

.article__footer {
  margin-top: 32px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}
.article__tags a {
  display: inline-block;
  font-size: .76rem;
  color: var(--muted);
  border: 1px solid var(--line);
  padding: 3px 12px;
  margin: 0 6px 6px 0;
}
.article__share {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 14px;
}
.article__share-label {
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .12em;
  color: var(--muted);
}
.share-btn {
  display: inline-block;
  font-size: .76rem;
  font-weight: 700;
  color: #fff;
  padding: 6px 14px;
}
.share-btn:hover { opacity: .88; color: #fff; }
.share-btn--x { background: #0f1419; }
.share-btn--fb { background: #1877f2; }
.share-btn--line { background: #06c755; }
.share-btn--hatena { background: #00a4de; }

.related-posts { margin-top: 40px; }
.related-posts__title {
  font-family: var(--font-serif);
  font-size: 1.15rem;
  font-weight: 600;
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--navy);
}
.related-posts__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}
.rcard {
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: var(--surface);
  border: 1px solid var(--line);
  padding-bottom: 12px;
}
.rcard:hover { border-color: var(--navy); }
.rcard__thumb { display: block; line-height: 0; overflow: hidden; }
.rcard__thumb img,
.rcard__thumb .noimg {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
}
.rcard__title {
  font-size: .88rem;
  font-weight: 700;
  line-height: 1.5;
  padding: 0 12px;
  color: var(--text);
}
.rcard__date {
  font-size: .72rem;
  color: var(--muted);
  padding: 0 12px;
  margin-top: auto;
}

.post-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 24px;
}
.post-nav a {
  display: block;
  background: var(--surface);
  border: 1px solid var(--line);
  padding: 14px 16px;
  font-size: .85rem;
  color: var(--text);
}
.post-nav a:hover { border-color: var(--navy); }
.post-nav .nav-label {
  display: block;
  font-size: .72rem;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 4px;
}
.post-nav .nav-next { text-align: right; }

/* ===== Search / pagination ===== */
.search-form { display: flex; gap: 8px; width: 100%; }
.search-form .search-field {
  flex: 1;
  min-width: 0;
  border: 1px solid var(--line);
  padding: 9px 12px;
  font: inherit;
  font-size: .88rem;
  background: var(--surface);
  color: var(--text);
  border-radius: 0;
}
.search-form .search-field:focus {
  outline: 2px solid rgba(29, 58, 95, 0.25);
  outline-offset: 1px;
  border-color: var(--navy);
}
.search-form .search-submit {
  border: none;
  background: var(--navy);
  color: #fff;
  padding: 9px 14px;
  font: inherit;
  font-size: .85rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}
.search-form .search-submit:hover { background: var(--navy-deep); }
.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;
}
.error-page__search {
  margin-top: 20px;
  max-width: 420px;
  margin-left: auto;
  margin-right: auto;
}
.pagination { margin: 32px 0 0; text-align: center; }
.pagination .nav-links {
  display: inline-flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: center;
}
.pagination .page-numbers {
  display: inline-block;
  min-width: 40px;
  padding: 8px 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  font-size: .88rem;
  color: var(--text);
}
.pagination a.page-numbers:hover {
  border-color: var(--navy);
  color: var(--navy);
}
.pagination .page-numbers.current {
  background: var(--navy);
  color: #fff;
  border-color: var(--navy);
}

/* ===== Footer ===== */
.site-footer {
  background: var(--navy-deep);
  color: rgba(255, 255, 255, 0.72);
  margin-top: 0;
}
.site-footer__inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 44px var(--pad) 0;
}
.footer-brand { margin-bottom: 32px; max-width: 34em; }
.footer-brand__name {
  font-family: var(--font-serif);
  font-size: 1.25rem;
  font-weight: 600;
  color: #fff;
  letter-spacing: .06em;
}
.footer-brand__name a { color: inherit; }
.footer-brand__tagline { margin-top: 8px; font-size: .85rem; }
.footer-brand__desc {
  margin-top: 12px;
  font-size: .82rem;
  line-height: 1.9;
  opacity: .8;
}
.footer-cols {
  display: block;
  padding: 24px 0 32px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}
.footer-col__title {
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .1em;
  color: #fff;
  margin-bottom: 12px;
}
.footer-col ul,
.footer-cat-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.footer-col a,
.footer-cat-list a {
  color: rgba(255, 255, 255, 0.85) !important;
  font-size: .9rem;
  font-weight: 500;
  line-height: 1.5;
  border: 0 !important;
  padding: 0;
}
.footer-col a:hover,
.footer-cat-list a:hover {
  color: #fff !important;
}
.site-footer__bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  padding: 14px 0 18px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.copyright { font-size: .76rem; opacity: .7; }
.footer-totop {
  font-size: .76rem;
  color: rgba(255, 255, 255, 0.7);
}
.footer-totop:hover { color: #fff; }

/* ===== 404 ===== */
.error-page {
  max-width: 640px;
  margin: 40px auto;
  background: var(--surface);
  border: 1px solid var(--line);
  padding: 48px 32px;
  text-align: center;
}
.error-code {
  font-family: var(--font-serif);
  font-size: 3rem;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 12px;
}

/* ===== Motion ===== */
@keyframes fade-up {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
  }
}

/* ===== Responsive ===== */
@media (max-width: 900px) {
  .home-layout {
    grid-template-columns: 1fr;
    gap: 32px;
  }
  .home-side { position: static; }
  .related-posts__grid { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  body { font-size: 15px; }
  .site-header__inner { padding: 22px var(--pad) 14px; }
  .nav-toggle { display: inline-block; }
  .site-nav__inner {
    flex-wrap: wrap;
    justify-content: flex-start;
  }
  .nav-menu { display: none; width: 100%; order: 3; }
  .nav-menu.is-open { display: block; padding-bottom: 8px; }
  .nav-menu ul { flex-direction: column; }
  .nav-menu a {
    padding: 12px 4px;
    border-bottom: 1px solid var(--line);
  }
  .site-nav__search {
    flex: 1 1 auto;
    min-width: 0;
    order: 2;
    margin-left: auto;
  }

  .hero { padding-top: 18px; }
  .hero__body { padding: 18px 16px 22px; }
  .hero__img,
  .hero__media .noimg--hero,
  .noimg--hero {
    aspect-ratio: 16 / 10;
    max-height: 280px;
  }

  .post-item {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .article { padding: 22px 16px; }
  .post-nav { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  :root { --pad: 16px; }
  .site-brand__en { font-size: 1.55rem; }
  .site-logo { height: 52px; max-width: 320px; }
}
