/* EX REDESiGN — assets/css/sidebar.css
 * FSE-native sidebar wrapper + widgets (search, banner, recent-posts cards).
 *
 * Selectors: .ex-recent-button, .ex-recent-card, .ex-recent-date, .ex-recent-thumb, .ex-recent-title, .exr-recent-list, .exr-sidebar, .exr-sidebar-slot, .exr-widget, .exr-widget-banner, .exr-widget-search, .exr-widget-title
 * Variables consumed: --color-surface, --color-text-muted, --color-text-primary, --color-text-secondary, --wp--preset--color--border-subtle, --wp--preset--color--surface-raised, --wp--preset--color--text-muted, --wp--preset--color--text-primary, …
 *
 * Sections (search anchors — grep `@section <name>`):
 *   (no sub-sections)
 */

/* ================================================================
   Sidebar (FSE native) — single.html / home.html 用
   ================================================================ */

/* template-part wrapper (<aside class="wp-block-template-part exr-sidebar-slot">) */
.exr-sidebar-slot { min-width: 0; }

/* sidebar inner container */
.exr-sidebar { display: flex; flex-direction: column; gap: 2rem; }

/* each widget */
.exr-widget { margin: 0; }
.exr-widget .exr-widget-title {
  font-size: var(--exr-fs-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--wp--preset--color--text-secondary);
  margin: 0 0 0.75rem;
}

/* search widget */
/* flex-wrap: nowrap forces the input + button to stay on one line; the input
   takes flex:1 and uses min-width:0 so it can shrink down to fit the narrow
   sidebar width without bumping the button to the next row. */
.exr-widget-search .wp-block-search__inside-wrapper {
  gap: 0.5rem;
  flex-wrap: nowrap;
}
.exr-widget-search .wp-block-search__input {
  flex: 1;
  min-width: 0;
  border: 1px solid var(--wp--preset--color--border-subtle);
  border-radius: 4px;
  padding: 0.5rem 0.75rem;
  font-size: var(--exr-fs-sm);
  background: var(--wp--preset--color--surface);
}
.exr-widget-search .wp-block-search__button {
  flex-shrink: 0;
  background: var(--wp--preset--color--text-primary);
  color: var(--wp--preset--color--surface);
  border: none;
  border-radius: 4px;
  padding: 0.5rem 1rem;
  font-size: var(--exr-fs-sm);
  cursor: pointer;
  white-space: nowrap;
}
.exr-widget-search .wp-block-search__button:hover { opacity: 0.85; }

/* recent posts widget (default sidebar) — each post renders as a small card
   with thumbnail, title, date, and a "詳細を見る" button. */
/* core/post-template renders as <ul><li>…</li></ul>. We strip the browser's
   default ul indent (padding-inline-start: 40px) and bullets so the cards
   align flush with the sidebar card padding edge — matching the main
   content's left edge. !important is used to defeat WP-generated layout
   rules that occasionally re-add list spacing. */
.exr-recent-list .wp-block-post-template,
.exr-recent-list .wp-block-post-template > li {
  list-style: none !important;
  padding: 0 !important;
  margin: 0 !important;
}
.exr-recent-list .wp-block-post-template {
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
}
.ex-recent-card {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin: 0;
}
.ex-recent-thumb {
  margin: 0 0 0.25rem;
}
.ex-recent-thumb img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 4px;
  aspect-ratio: 16/9;
  object-fit: cover;
}
.ex-recent-thumb a { display: block; }
.ex-recent-title {
  font-size: var(--exr-fs-sm) !important;
  font-weight: 400 !important;
  line-height: 1.4 !important;
  letter-spacing: -0.01em;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
}
.ex-recent-title a {
  color: var(--color-text-primary);
  text-decoration: none;
}
.ex-recent-title a:hover { color: var(--color-text-secondary); }
.ex-recent-date {
  font-size: var(--exr-fs-xs);
  color: var(--color-text-muted);
  letter-spacing: 0.05em;
  margin: 0;
}
.ex-recent-date time { display: inline; }
.ex-recent-button {
  display: inline-block;
  align-self: center;
  margin: 0.25rem 0 0;
  padding: 0.45rem 1rem;
  background: var(--color-text-primary);
  color: var(--color-surface) !important;
  font-size: var(--exr-fs-xs);
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border-radius: 9999px;
  text-decoration: none;
  transition: opacity 200ms;
}
.ex-recent-button:hover { opacity: 0.85; }

/* banner widget */
.exr-widget-banner .wp-block-image { margin: 0; }
.exr-widget-banner .wp-block-image img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 4px;
}
.exr-widget-banner .wp-block-image figure:empty {
  min-height: 160px;
  background: var(--wp--preset--color--surface-raised);
  border: 1px dashed var(--wp--preset--color--border-subtle);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.exr-widget-banner .wp-block-image figure:empty::after {
  content: "Banner placeholder";
  font-size: var(--exr-fs-xs);
  color: var(--wp--preset--color--text-muted);
  letter-spacing: 0.1em;
}
