.photo-credit{font-size:.68rem;line-height:1.65;color:#64645e;margin:9px 0 0;overflow-wrap:anywhere}.photo-credit a{text-underline-offset:2px}.hero-credit{margin:10px auto 0}.castle-photo{margin:0;min-width:0}.castle-photo figcaption{font-size:.76rem;line-height:1.7;color:#595950;margin-top:10px}.castle-photo .story-image{width:100%}.story-section{align-items:start}.story-section-reverse .castle-photo{order:1}.story-section-reverse .story-copy{order:2}@media(min-width:901px){.castle-photo{position:sticky;top:24px}}@media(max-width:900px){.story-section-reverse .castle-photo,.story-section-reverse .story-copy{order:initial}}
/* Castle catalog: landscape photo cards */
.catalog .book-thumbnail{
  padding:14px 13px 2px;
  perspective:none;
}

.catalog .book-cover{
  aspect-ratio:8/5;
  transform:none;
  border-radius:7px;
  overflow:hidden;
  background:#eee;
  box-shadow:0 3px 10px rgba(44,39,27,.14);
}

.catalog .book-cover::before,
.catalog .book-cover::after{
  display:none;
}

.catalog .book-cover img{
  width:100%;
  height:100%;
  object-fit:cover;
  object-position:center;
  border-radius:7px;
}

/* Himeji: keep the main keep in frame */
.catalog a[href="/castles/himeji/"] .book-cover img{
  object-position:50% 45%;
}

/* Matsumoto: keep the keep centered rather than the moat */
.catalog a[href="/castles/matsumoto/"] .book-cover img{
  object-position:50% 38%;
}

/* Castle catalog card */
.catalog .book-card{
  display:block;
  background:#fff;
  border-radius:10px;
  overflow:hidden;
  box-shadow:0 4px 14px rgba(44,39,27,.10);
}

.catalog .book-thumbnail{
  padding:0;
}

.catalog .book-cover{
  aspect-ratio:8/5;
  border-radius:0;
  box-shadow:none;
}

.catalog .book-cover img{
  border-radius:0;
}

.catalog .book-meta{
  background:#fff;
  padding:14px 16px 18px;
}

/* Castle SUB hero: remove dark overlay */
.hero::before{
  display:none;
}

/* Castle SUB hero: soft gradient only for title readability */
.hero::before{
  display:block;
  width:52%;
  background:linear-gradient(
    90deg,
    rgba(20,30,27,.38) 0%,
    rgba(20,30,27,.20) 45%,
    rgba(20,30,27,.06) 75%,
    rgba(20,30,27,0) 100%
  );
}

/* Castle article end navigation */
.article-end-nav{
  display:flex;
  justify-content:center;
  align-items:center;
  gap:28px;
  margin-top:56px;
  padding:26px 0 10px;
  border-top:1px solid #ddd9cf;
}

.article-end-nav a,
.article-end-primary,
.article-end-top{
  display:inline-block;
  width:auto;
  min-width:0;
  padding:0;
  border:0;
  border-radius:0;
  background:none;
  box-shadow:none;
  color:#315044;
  font-size:.9rem;
  font-weight:600;
  text-decoration:none;
}

.article-end-nav a:hover{
  text-decoration:underline;
  text-underline-offset:4px;
}

@media(max-width:560px){
  .article-end-nav{
    gap:20px;
    margin-top:40px;
    padding-top:22px;
  }

  .article-end-nav a{
    font-size:.82rem;
  }
}

/* Castle article end navigation - final */
.article-end-nav{
  display:flex !important;
  justify-content:center !important;
  align-items:center !important;
  gap:0 !important;
  margin:52px auto 20px !important;
  padding:24px 0 0 !important;
  border-top:1px solid #ddd9cf !important;
}

.article-end-nav a{
  display:inline !important;
  flex:none !important;
  width:auto !important;
  min-width:0 !important;
  height:auto !important;
  margin:0 !important;
  padding:0 18px !important;
  border:0 !important;
  border-radius:0 !important;
  background:transparent !important;
  box-shadow:none !important;
  color:#315044 !important;
  font-size:.88rem !important;
  line-height:1.5 !important;
  font-weight:600 !important;
  text-decoration:none !important;
}

.article-end-nav a + a{
  border-left:1px solid #c9c5ba !important;
}

.article-end-nav a:hover{
  text-decoration:underline !important;
  text-underline-offset:4px !important;
}

@media(max-width:560px){
  .article-end-nav{
    margin-top:40px !important;
    padding-top:20px !important;
  }

  .article-end-nav a{
    padding:0 12px !important;
    font-size:.8rem !important;
  }
}

/* Castle catalog shared grid: desktop 6 / mobile 2 */
.catalog.shell {
  max-width: 1200px !important;
}

.catalog .castle-grid {
  display: grid !important;
  grid-template-columns: repeat(6, minmax(0, 1fr)) !important;
  gap: 16px !important;
}

@media (max-width: 560px) {
  .catalog .castle-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 11px !important;
  }
}

/* Castle article HERO: fill entire frame */
.article-page .hero .hero-image,
body:has(.breadcrumb a[href="/castles/"]) .hero .hero-image {
  width: 100% !important;
  height: 100% !important;
}

.article-page .hero .hero-image img,
body:has(.breadcrumb a[href="/castles/"]) .hero .hero-image img {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  object-position: center center !important;
}

/* Castle article section photos: fill entire frame */
.castle-photo .story-image {
  overflow: hidden !important;
}

.castle-photo .story-image img {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  object-position: center center !important;
}

/* Castle catalog: equal card height */
.catalog .castle-grid > div {
  display: flex !important;
}

.catalog .castle-grid > div > .book-card {
  display: flex !important;
  flex-direction: column !important;
  width: 100% !important;
  height: 100% !important;
}

.catalog .castle-grid .book-meta {
  flex: 1 1 auto !important;
}
