@charset "UTF-8";

/*!
Theme Name: Cocoon Child
Description: NoritamaTech - Tech blog child theme based on Cocoon
Theme URI: https://wp-cocoon.com/
Author: NoritamaTech
Author URI: https://nelog.jp/
Template:   cocoon-master
Version:    1.0.0
*/

/* ============================================================
   Design tokens
   ============================================================ */
:root {
  --nt-bg:           #ffffff;
  --nt-bg-soft:      #f5f6f8;
  --nt-surface:      #ffffff;
  --nt-text:         #2c3e50;
  --nt-text-muted:   #6b7785;
  --nt-border:       #e5e8ec;
  --nt-accent:       #2563eb;
  --nt-accent-hover: #1d4ed8;
  --nt-accent-soft:  #dbeafe;
  --nt-footer-bg:    #1f2937;
  --nt-footer-text:  #cbd5e1;
  --nt-footer-head:  #ffffff;
  --nt-footer-border:#374151;
  --nt-radius:       6px;
  --nt-shadow:       0 1px 3px rgba(0, 0, 0, 0.06);
  --nt-shadow-hover: 0 4px 12px rgba(0, 0, 0, 0.10);
}

/* ============================================================
   Base
   ============================================================ */
body,
.body {
  background: var(--nt-bg);
  color: var(--nt-text);
  font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue",
               "Hiragino Sans", "Hiragino Kaku Gothic ProN",
               "Noto Sans JP", "Yu Gothic UI", "Meiryo", sans-serif;
  -webkit-font-smoothing: antialiased;
  line-height: 1.6;
}

a { color: var(--nt-text); text-decoration: none; }
a:hover { color: var(--nt-accent); }

/* ============================================================
   Header
   ============================================================ */
#header,
.header {
  background: var(--nt-surface);
  border-bottom: 1px solid var(--nt-border);
  box-shadow: var(--nt-shadow);
}

.hlt-center-logo .header-in,
#header-in,
.header-in {
  padding: 18px 24px !important;
  text-align: left !important;
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  justify-content: flex-start !important;
  flex-wrap: nowrap !important;
  max-width: 1200px !important;
  margin: 0 auto !important;
}

.hlt-center-logo .logo-header,
.hlt-center-logo .logo.logo-header,
.logo-header,
.logo.logo-header.logo-text {
  text-align: left !important;
  margin: 0 !important;
  padding: 0 !important;
  flex: 0 0 auto !important;
  order: 1 !important;
  width: auto !important;
  float: none !important;
}

.logo-header a,
.logo-header .site-name,
.logo-header .site-name-text-link {
  text-align: left !important;
  display: inline-block !important;
  margin: 0 !important;
}

.site-name-text,
.site-name-text-link,
.site-name a {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: 0.3px;
  color: var(--nt-text) !important;
}

.site-name-text-link:hover { color: var(--nt-accent) !important; }

.hlt-center-logo .tagline,
.header-in .tagline {
  order: 2 !important;
  margin: 4px 0 0 16px !important;
  padding: 0 !important;
  font-size: 12px !important;
  color: var(--nt-text-muted) !important;
  line-height: 1.4 !important;
  flex: 1 1 auto !important;
  align-self: center !important;
  text-align: left !important;
  width: auto !important;
}

/* ============================================================
   Global navigation — hide Cocoon's default below-header nav,
   we render our own inside the header.
   ============================================================ */
#navi,
.navi {
  display: none !important;
}

/* In-header nav (injected via wp_header_logo_after_open) */
.nt-header-nav {
  order: 3 !important;
  margin-left: auto !important;
  display: flex;
  align-items: center;
  gap: 4px;
}

.nt-header-nav__menu {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  align-items: center;
  gap: 4px;
}

.nt-header-nav__menu > li {
  position: relative;
}

.nt-header-nav__menu > li > a {
  display: inline-block;
  padding: 8px 14px;
  color: var(--nt-text) !important;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.3px;
  text-decoration: none;
  border-radius: 4px;
  transition: color 0.15s ease, background 0.15s ease;
}

.nt-header-nav__menu > li > a:hover {
  color: var(--nt-accent) !important;
  background: transparent;
}

.nt-header-nav__menu > li.menu-item-has-children > a::after {
  content: " ▾";
  font-size: 10px;
  margin-left: 2px;
  color: var(--nt-text-muted);
}

.nt-header-nav__menu .sub-menu {
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 200px;
  background: #fff;
  border: 1px solid var(--nt-border);
  border-radius: var(--nt-radius);
  box-shadow: 0 8px 24px rgba(0,0,0,0.08);
  padding: 8px 0;
  margin: 0;
  list-style: none;
  z-index: 100;
  opacity: 0;
  visibility: hidden;
  transform: translateY(4px);
  transition: opacity 0.15s ease, transform 0.15s ease, visibility 0.15s ease;
}

.nt-header-nav__menu > li:hover > .sub-menu,
.nt-header-nav__menu > li:focus-within > .sub-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.nt-header-nav__menu .sub-menu li a {
  display: block;
  padding: 8px 16px;
  color: var(--nt-text);
  font-size: 13px;
  text-decoration: none;
}

.nt-header-nav__menu .sub-menu li a:hover {
  background: var(--nt-bg-soft);
  color: var(--nt-accent);
}

.nt-header-search {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  margin-left: 6px;
  border: none;
  background: transparent;
  color: var(--nt-text);
  cursor: pointer;
  border-radius: 4px;
}

.nt-header-search:hover {
  color: var(--nt-accent);
  background: var(--nt-bg-soft);
}

/* ============================================================
   Main wrap — transparent, no double border / no white block
   ============================================================ */
#content,
#content-in,
.content,
.content-in {
  background: transparent !important;
}

#main,
.main {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  padding: 0 16px !important;
}

#main .article,
.main .article,
.article {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  padding: 0 !important;
  margin: 0 !important;
}

#list,
.list,
.ect-entry-card {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  padding: 0 !important;
}

/* Section title (新着記事 / 人気カテゴリー) */
.nt-section-title {
  font-size: 22px;
  font-weight: 800;
  color: var(--nt-text);
  margin: 0 0 20px;
  padding-left: 12px;
  border-left: 5px solid var(--nt-accent);
  line-height: 1.3;
}

.nt-section-title--main {
  margin-top: 6px;
  margin-bottom: 24px;
}

/* ============================================================
   Article cards (list-index) — override Cocoon's float-based layout
   ============================================================ */
/* Outer wrapper: card visuals — stacked tightly, borders collapse, no shadow gap */
.list .a-wrap,
.entry-card-wrap {
  background: var(--nt-surface) !important;
  border: 1px solid var(--nt-border) !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  margin: 0 !important;
  padding: 0 !important;
  transition: background 0.15s ease;
  display: block !important;
  width: 100% !important;
  box-sizing: border-box !important;
  overflow: hidden;
  position: relative;
}

/* Round only the first/last card so the stack reads as one panel */
.list .a-wrap:first-of-type,
.entry-card-wrap:first-of-type {
  border-top-left-radius: var(--nt-radius) !important;
  border-top-right-radius: var(--nt-radius) !important;
}

.list .a-wrap:last-of-type,
.entry-card-wrap:last-of-type {
  border-bottom-left-radius: var(--nt-radius) !important;
  border-bottom-right-radius: var(--nt-radius) !important;
}

/* Inner article: layout only — strip Cocoon's duplicate border/shadow/margin */
.entry-card {
  background: transparent !important;
  border: none !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  margin: 0 !important;
  padding: 0 !important;
  display: flex !important;
  flex-direction: row !important;
  gap: 0 !important;
  align-items: stretch !important;
  width: 100% !important;
  box-sizing: border-box !important;
}

.entry-card-wrap:hover,
.entry-card:hover,
.list .a-wrap:hover {
  background: var(--nt-bg-soft) !important;
}

/* clearfix neutralised inside flex container */
.entry-card-wrap.cf::before,
.entry-card-wrap.cf::after { content: none !important; }

/* Square thumbnail flush with the card's left edge (no gap, no border-radius) */
#main .entry-card-thumb,
#list .entry-card-thumb,
.entry-card-wrap > article > .entry-card-thumb,
.entry-card-wrap .entry-card-thumb:not(.popular-entry-card-thumb):not(.new-entry-card-thumb) {
  flex: 0 0 96px !important;
  width: 96px !important;
  height: 96px !important;
  max-width: 96px !important;
  min-width: 96px !important;
  margin: 0 !important;
  padding: 0 !important;
  display: block !important;
  position: relative;
  overflow: hidden;
  border-radius: 0 !important;
  background: #0a1929;
  float: none !important;
  align-self: stretch;
}

.entry-card-thumb a,
.entry-card-thumb-link {
  display: block;
  width: 100%;
  height: 100%;
}

#main .entry-card-thumb img,
#main .entry-card-thumb-image,
#main .entry-card-thumb a img,
#list .entry-card-thumb img,
#list .entry-card-thumb-image {
  width: 96px !important;
  height: 96px !important;
  max-width: 96px !important;
  max-height: 96px !important;
  object-fit: cover !important;
  display: block !important;
  border-radius: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
}

/* Content side — match the 96px thumbnail height, distribute spacing evenly */
.entry-card-content,
.card-content,
.entry-card-wrap .entry-card-content {
  flex: 1 1 auto !important;
  display: flex !important;
  flex-direction: column !important;
  justify-content: space-between !important;
  align-items: stretch !important;
  min-width: 0 !important;
  padding: 10px 16px !important;
  margin: 0 !important;
  width: auto !important;
  float: none !important;
  min-height: 96px !important;
  height: 96px !important;
  max-height: 96px !important;
  overflow: hidden !important;
  gap: 0 !important;
  box-sizing: border-box !important;
}

.entry-card-categorys,
.entry-card-info {
  margin: 0 0 6px !important;
}

.entry-card-title,
.card-title {
  color: var(--nt-text) !important;
  font-size: 15px !important;
  font-weight: 700 !important;
  line-height: 1.4 !important;
  margin: 0 !important;
  display: -webkit-box !important;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.entry-card-snippet {
  display: none !important;
}

.entry-card-meta,
.card-meta {
  margin-top: auto !important;
  padding-top: 8px !important;
  font-size: 12px !important;
  color: var(--nt-text-muted) !important;
  display: flex !important;
  align-items: center !important;
  flex-wrap: wrap !important;
  gap: 8px !important;
}

.entry-card-meta a,
.card-meta a {
  color: var(--nt-text-muted) !important;
}

/* Inline meta row (date + tag pills) — rendered via hook */
.nt-card-meta-row {
  display: flex !important;
  flex-wrap: wrap !important;
  align-items: center !important;
  gap: 8px !important;
  margin: 10px 0 0 !important;
  font-size: 12px;
  color: var(--nt-text-muted);
}

.nt-card-date {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: var(--nt-text-muted);
  margin-right: 4px;
}

.nt-card-tag {
  display: inline-block;
  font-size: 11px;
  color: var(--nt-text-muted);
  background: var(--nt-bg-soft);
  border: 1px solid var(--nt-border);
  border-radius: 3px;
  padding: 2px 8px;
  font-weight: 500;
  line-height: 1.5;
}

/* Hide all default Cocoon category/date/meta — we render our own clean version */
.entry-card-thumb .cat-label,
.entry-card-meta {
  display: none !important;
}

/* Custom category label rendered at top of content */
.nt-card-cat {
  margin: 0 0 4px !important;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.4;
  order: -1;
}

.nt-card-cat__label {
  color: var(--nt-accent) !important;
  text-decoration: none !important;
}

.entry-card-wrap:hover .nt-card-cat__label {
  color: var(--nt-accent-hover) !important;
  text-decoration: underline !important;
}

/* Category label — text-only, blue (matches mock) */
.cat-label,
.entry-category a,
.entry-card-meta .cat-label,
.entry-card-categorys .cat-label {
  background: transparent !important;
  color: var(--nt-accent) !important;
  font-size: 12px !important;
  font-weight: 700 !important;
  padding: 0 !important;
  border-radius: 0 !important;
  letter-spacing: 0 !important;
  line-height: 1.4 !important;
  display: inline-block;
  border: none !important;
}

.cat-label:hover,
.entry-category a:hover {
  color: var(--nt-accent-hover) !important;
  text-decoration: underline;
}

/* Hide category icon prefix (folder icon) for cleaner mock-style label */
.cat-label::before,
.entry-card-categorys .cat-label::before { display: none !important; }

/* Hide "NO IMAGE" placeholder cleanly */
.entry-card-thumb .no-image-color {
  background: var(--nt-bg-soft) !important;
  color: var(--nt-text-muted);
}

/* Tag pills inside each card (injected by entry_card_snippet_after / related_entry_card_snippet_after) */
.nt-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 8px 0 6px;
}

.nt-card-tag {
  display: inline-block;
  font-size: 11px;
  line-height: 1;
  padding: 5px 9px;
  background: var(--nt-bg-soft);
  color: var(--nt-text-muted);
  border-radius: 999px;
  border: 1px solid var(--nt-border);
  white-space: nowrap;
}

/* ============================================================
   Sidebar widgets
   ============================================================ */
.sidebar {
  padding-top: 6px;
}

.sidebar .widget {
  background: var(--nt-surface);
  border: 1px solid var(--nt-border);
  border-radius: var(--nt-radius);
  padding: 18px;
  margin-bottom: 20px;
  box-shadow: var(--nt-shadow);
}

.sidebar .widget h3,
.sidebar .widget-title,
.sidebar .widget h2 {
  font-size: 15px !important;
  font-weight: 700 !important;
  color: var(--nt-text) !important;
  border-left: 4px solid var(--nt-accent) !important;
  padding: 0 0 0 10px !important;
  margin: 0 0 14px !important;
  background: transparent !important;
  text-align: left !important;
}

.sidebar .widget ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.sidebar .widget li {
  border-bottom: 1px dashed var(--nt-border);
  padding: 8px 0;
  font-size: 13px;
  line-height: 1.5;
}

.sidebar .widget li:last-child { border-bottom: none; }

.sidebar .widget li a {
  color: var(--nt-text);
}

.sidebar .widget li a:hover { color: var(--nt-accent); }

/* ===== Sidebar Cocoon entry widgets (popular_entries / new_entries) =====
   Layout: ranking number (left) + title (middle) + thumbnail (right) */

.sidebar .new-entry-cards,
.sidebar .popular-entry-cards {
  display: flex !important;
  flex-direction: column !important;
  gap: 4px !important;
}

.sidebar .new-entry-card-link,
.sidebar .popular-entry-card-link {
  display: block !important;
  padding: 10px 0 !important;
  border-bottom: 1px dashed var(--nt-border) !important;
}

.sidebar .new-entry-card-link:last-child,
.sidebar .popular-entry-card-link:last-child {
  border-bottom: none !important;
}

.sidebar .new-entry-card,
.sidebar .popular-entry-card {
  display: flex !important;
  flex-direction: row !important;
  gap: 10px !important;
  align-items: center !important;
  background: transparent !important;
  border: none !important;
  padding: 0 !important;
  margin: 0 !important;
  box-shadow: none !important;
  width: 100% !important;
  position: relative;
}

/* Ranking number badge for popular_entries — CSS counter over .no-1/.no-2/... */
.sidebar .popular-entry-cards.ranking-visible {
  counter-reset: nt-rank;
}

.sidebar .popular-entry-cards.ranking-visible .popular-entry-card-link {
  position: relative;
  padding-left: 36px !important;
}

.sidebar .popular-entry-cards.ranking-visible .popular-entry-card-link::before {
  counter-increment: nt-rank;
  content: counter(nt-rank);
  position: absolute;
  left: 0;
  top: 18px;
  width: 26px;
  height: 26px;
  background: var(--nt-accent);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 3px;
}

/* Thumbnail on the RIGHT */
.sidebar .new-entry-card-thumb,
.sidebar .popular-entry-card-thumb,
.sidebar figure.new-entry-card-thumb,
.sidebar figure.popular-entry-card-thumb {
  flex: 0 0 60px !important;
  width: 60px !important;
  height: 60px !important;
  margin: 0 !important;
  padding: 0 !important;
  display: block !important;
  order: 2 !important;
  overflow: hidden;
  border-radius: 4px;
  background: #0a1929;
  float: none !important;
}

.sidebar .new-entry-card-thumb img,
.sidebar .new-entry-card-thumb .wp-post-image,
.sidebar .popular-entry-card-thumb img,
.sidebar .popular-entry-card-thumb .wp-post-image {
  width: 60px !important;
  height: 60px !important;
  max-width: 60px !important;
  max-height: 60px !important;
  object-fit: cover !important;
  display: block !important;
  border-radius: 4px;
  margin: 0 !important;
  padding: 0 !important;
}

/* Content (title) — middle, flex grow, with ranking offset when visible */
.sidebar .new-entry-card-content,
.sidebar .popular-entry-card-content {
  flex: 1 1 auto !important;
  min-width: 0 !important;
  min-height: 0 !important;
  height: auto !important;
  margin: 0 !important;
  padding: 0 !important;
  order: 1 !important;
  align-self: center !important;
}

.sidebar .popular-entry-cards.ranking-visible .popular-entry-card-content {
  padding-left: 0 !important;
}

.sidebar .new-entry-card-title,
.sidebar .popular-entry-card-title {
  font-size: 13px !important;
  font-weight: 600 !important;
  line-height: 1.5 !important;
  color: var(--nt-text) !important;
  margin: 0 !important;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Hide widget meta + snippet to keep cards compact */
.sidebar .new-entry-card-meta,
.sidebar .popular-entry-card-meta,
.sidebar .new-entry-card-snippet,
.sidebar .popular-entry-card-snippet,
.sidebar .widget-entry-card-date {
  display: none !important;
}

/* Hide Cocoon's ranking number overlay on the thumbnail
   (we already render our own number badge on the LEFT) */
.sidebar .popular-entry-card-link .card-thumb::before,
.sidebar .popular-entry-card-link .popular-entry-card-thumb::before,
.sidebar .no-1 .card-thumb::before,
.sidebar .no-2 .card-thumb::before,
.sidebar .no-3 .card-thumb::before,
.sidebar .no-4 .card-thumb::before,
.sidebar .no-5 .card-thumb::before,
.sidebar .no-6 .card-thumb::before,
.sidebar .no-7 .card-thumb::before,
.sidebar .no-8 .card-thumb::before,
.sidebar .no-9 .card-thumb::before,
.sidebar .no-10 .card-thumb::before {
  content: none !important;
  display: none !important;
  background: none !important;
  width: 0 !important;
  height: 0 !important;
}

/* Hide Cocoon's tag-icon prefix in tag cloud */
.tagcloud a .fa,
.widget_tag_cloud a .fa,
.tagcloud a > .fa-tag {
  display: none !important;
}

/* Tag cloud pills (no border, light gray, simple) */
.tagcloud a,
.widget_tag_cloud a {
  background: var(--nt-bg-soft) !important;
  border: none !important;
  color: var(--nt-text-muted) !important;
  font-size: 12px !important;
  padding: 4px 10px !important;
  border-radius: 999px !important;
  margin: 3px 2px !important;
  display: inline-block !important;
  text-decoration: none !important;
}

.tagcloud a:hover {
  background: var(--nt-accent) !important;
  color: #fff !important;
  border-color: var(--nt-accent) !important;
}

/* ============================================================
   Pagination (index / archive bottom)
   ============================================================ */

/* Hide Cocoon's full-width "次のページ" button — the design only uses
   the numeric pagination below it. */
.pagination-next {
  display: none !important;
}

.pagination {
  display: flex !important;
  justify-content: center;
  align-items: center;
  gap: 6px;
  margin: 16px 0 0;
  padding: 0 0 50px;
  background: transparent !important;
  border: none !important;
}

.pagination .page-numbers {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 38px;
  height: 38px;
  padding: 0 12px;
  font-size: 14px;
  font-weight: 600;
  color: var(--nt-text);
  background: var(--nt-bg);
  border: 1px solid var(--nt-border);
  border-radius: 6px;
  text-decoration: none;
  line-height: 1;
  transition: background-color .15s, color .15s, border-color .15s;
}

.pagination a.page-numbers:hover {
  background: var(--nt-accent-soft);
  color: var(--nt-accent);
  border-color: var(--nt-accent-soft);
}

.pagination .page-numbers.current {
  background: var(--nt-accent);
  color: #fff;
  border-color: var(--nt-accent);
}

.pagination .page-numbers.dots {
  border: none;
  background: transparent;
  color: var(--nt-text-muted);
}

.pagination .page-numbers .fa {
  font-size: 12px;
}

/* Search box — input + button as a single bar; button fills input height */
.sidebar .search-box,
.sidebar form.search-box {
  display: flex !important;
  align-items: stretch !important;
  border: 1px solid var(--nt-border) !important;
  border-radius: var(--nt-radius) !important;
  overflow: hidden !important;
  background: var(--nt-bg-soft);
  padding: 0 !important;
}

.sidebar .search-box .search-edit,
.sidebar input[type="search"],
.sidebar input[type="text"].search-edit {
  flex: 1 1 auto !important;
  border: none !important;
  border-radius: 0 !important;
  padding: 10px 14px !important;
  font-size: 14px !important;
  background: transparent !important;
  outline: none !important;
  margin: 0 !important;
  min-width: 0 !important;
  height: auto !important;
}

.sidebar .search-box .search-submit,
.sidebar .search-submit,
.sidebar form button.search-submit,
.sidebar form input[type="submit"].search-submit {
  flex: 0 0 auto !important;
  align-self: stretch !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  background: var(--nt-accent) !important;
  color: #fff !important;
  border: none !important;
  border-radius: 0 !important;
  margin: 0 !important;
  padding: 0 14px !important;
  height: 100% !important;
  min-height: 100% !important;
  min-width: 44px !important;
  width: auto !important;
  line-height: 1 !important;
  cursor: pointer;
  box-sizing: border-box !important;
  position: absolute !important;
  top: auto !important;
  right: 0 !important;
  bottom: 0 !important;
}

.sidebar .search-box {
  position: relative !important;
}

.sidebar .search-box .search-edit {
  padding-right: 60px !important;
}

.sidebar .search-submit:hover {
  background: var(--nt-accent-hover) !important;
}

.sidebar .search-submit .fa,
.sidebar .search-submit .fa-search {
  color: #fff !important;
  font-size: 14px;
  line-height: 1;
}

/* ============================================================
   Popular categories (4-column section before footer)
   ============================================================ */
.nt-popular-categories {
  background: var(--nt-surface);
  border-top: 1px solid var(--nt-border);
  padding: 56px 16px;
}

.nt-popular-categories__inner {
  max-width: 1200px;
  margin: 0 auto;
}

.nt-popular-categories__grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
}

.nt-cat-card {
  background: var(--nt-surface);
  border: 1px solid var(--nt-border);
  border-radius: var(--nt-radius);
  padding: 28px 18px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  box-shadow: var(--nt-shadow);
  color: var(--nt-text) !important;
  text-decoration: none;
}

.nt-cat-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--nt-shadow-hover);
  color: var(--nt-text) !important;
}

.nt-cat-card__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  border-radius: 12px;
  font-size: 24px;
  line-height: 1;
}

.nt-cat-card__icon svg { display: block; }

.nt-cat-card__label {
  font-size: 15px;
  font-weight: 700;
  color: var(--nt-text);
}

.nt-cat-card__desc {
  font-size: 12px;
  color: var(--nt-text-muted);
  line-height: 1.6;
  text-align: center;
  margin-top: 4px;
}

@media screen and (max-width: 834px){
  .nt-popular-categories__grid { grid-template-columns: repeat(2, 1fr); }
}

/* ============================================================
   Footer
   ============================================================ */
#footer,
.footer {
  background: var(--nt-footer-bg) !important;
  color: var(--nt-footer-text) !important;
  border-top: none;
}

#footer a,
.footer a {
  color: var(--nt-footer-text) !important;
}

#footer a:hover,
.footer a:hover {
  color: #fff !important;
}

.footer-widgets {
  background: var(--nt-footer-bg) !important;
  color: var(--nt-footer-text) !important;
  padding: 48px 0 32px !important;
  display: grid !important;
  grid-template-columns: 1.6fr 1fr 1fr 1.2fr;
  gap: 36px;
  max-width: 1200px;
  margin: 0 auto;
}

.footer-widgets .footer-left,
.footer-widgets .footer-center,
.footer-widgets .footer-menu-col,
.footer-widgets .footer-right {
  background: transparent !important;
  padding: 0 16px !important;
  width: auto !important;
  float: none !important;
  margin: 0 !important;
}

.footer-widgets .widget {
  background: transparent !important;
  border: none !important;
  padding: 0 !important;
  margin: 0 0 24px !important;
  box-shadow: none !important;
}

.footer-widgets .widget h3,
.footer-widgets .widget-title,
.footer-widgets .widget h2 {
  color: var(--nt-footer-head) !important;
  border-left: 3px solid var(--nt-accent) !important;
  padding: 0 0 0 10px !important;
  font-size: 14px !important;
  font-weight: 700 !important;
  margin: 0 0 16px !important;
  background: transparent !important;
}

.footer-widgets .widget ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.footer-widgets .widget li {
  padding: 6px 0;
  border-bottom: 1px solid var(--nt-footer-border);
  font-size: 13px;
}

.footer-widgets .widget li:last-child { border-bottom: none; }

.footer-bottom,
.footer-bottom-content {
  background: var(--nt-footer-bg) !important;
  color: var(--nt-footer-text) !important;
  border-top: 1px solid var(--nt-footer-border);
  padding: 16px 0 !important;
  font-size: 12px;
  max-width: 1200px;
  margin: 0 auto;
}

.copyright,
.footer-bottom .copy {
  color: var(--nt-footer-text) !important;
  font-size: 12px;
}

/* Footer logo text */
.logo-footer .site-name-text-link,
.logo-footer .site-name-text,
#footer .site-name-text-link,
#footer .site-name-text {
  color: #fff !important;
  font-size: 20px;
  font-weight: 800;
}

/* Footer brand block (custom_html widget) */
.nt-footer-brand {
  color: var(--nt-footer-text);
}

.nt-footer-brand__logo {
  color: #fff;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: 0.3px;
  margin-bottom: 12px;
}

.nt-footer-brand__desc {
  color: var(--nt-footer-text);
  font-size: 13px;
  line-height: 1.7;
  margin: 0 0 16px;
}

.nt-footer-sns {
  display: flex;
  gap: 10px;
}

.nt-footer-sns__link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  color: var(--nt-footer-text) !important;
  transition: background 0.15s ease, color 0.15s ease;
}

.nt-footer-sns__link:hover {
  background: var(--nt-accent);
  color: #fff !important;
}

.nt-footer-sns__link svg {
  display: block;
}

/* Footer subscribe form */
.nt-footer-sub__lead {
  color: var(--nt-footer-text);
  font-size: 13px;
  line-height: 1.7;
  margin: 0 0 12px;
}

.nt-footer-sub__form {
  display: flex;
  gap: 6px;
}

.nt-footer-sub__form input[type="email"] {
  flex: 1 1 auto;
  background: #ffffff;
  border: none;
  border-radius: var(--nt-radius);
  padding: 8px 12px;
  font-size: 13px;
  color: #111827;
  min-width: 0;
}

.nt-footer-sub__form input[type="email"]::placeholder { color: #9ca3af; }

.nt-footer-sub__form button {
  background: var(--nt-accent);
  color: #fff;
  border: none;
  border-radius: var(--nt-radius);
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s ease;
}

.nt-footer-sub__form button:hover {
  background: var(--nt-accent-hover);
}

/* Footer menu (top-level only via depth=1 in footer.php) */
.nt-footer-menu {
  list-style: none;
  margin: 0;
  padding: 0;
}

.nt-footer-menu li {
  padding: 6px 0;
  border-bottom: 1px solid var(--nt-footer-border);
  font-size: 13px;
}

.nt-footer-menu li:last-child { border-bottom: none; }

.nt-footer-menu a {
  color: var(--nt-footer-text) !important;
  text-decoration: none !important;
}

.nt-footer-menu a:hover {
  color: #fff !important;
}

/* Footer-menu-col uses widget-style heading */
.footer-menu-col .widget-title {
  color: var(--nt-footer-head) !important;
  border-left: 3px solid var(--nt-accent) !important;
  padding: 0 0 0 10px !important;
  font-size: 14px !important;
  font-weight: 700 !important;
  margin: 0 0 16px !important;
  background: transparent !important;
}

.footer-right .widget-title {
  color: var(--nt-footer-head) !important;
  border-left: 3px solid var(--nt-accent) !important;
  padding: 0 0 0 10px !important;
  font-size: 14px !important;
  font-weight: 700 !important;
  margin: 0 0 16px !important;
  background: transparent !important;
}

/* Footer bottom: copyright centered */
#footer .footer-bottom,
.footer .footer-bottom {
  background: var(--nt-footer-bg) !important;
  text-align: center !important;
  border-top: 1px solid var(--nt-footer-border) !important;
  padding: 16px 0 !important;
  margin: 24px auto 0 !important;
  max-width: 1200px;
  display: block !important;
  width: 100% !important;
}

#footer .footer-bottom-content,
.footer .footer-bottom-content {
  text-align: center !important;
  color: var(--nt-footer-text) !important;
  font-size: 12px !important;
  border: none !important;
  padding: 0 !important;
  display: block !important;
  width: 100% !important;
  margin: 0 auto !important;
  float: none !important;
}

#footer .footer-bottom .copyright,
#footer .footer-bottom .source-org,
.footer .footer-bottom .copyright,
.footer .footer-bottom .source-org {
  color: var(--nt-footer-text) !important;
  text-align: center !important;
  display: block !important;
  width: 100% !important;
  float: none !important;
  margin: 0 !important;
}

/* Footer search box */
.footer-widgets .search-box .search-edit,
.footer-widgets input[type="search"] {
  background: #111827 !important;
  border: 1px solid var(--nt-footer-border) !important;
  color: #fff !important;
  border-radius: var(--nt-radius) !important;
  padding: 10px 12px !important;
  font-size: 13px !important;
}

.footer-widgets .search-submit {
  background: var(--nt-accent) !important;
  color: #fff !important;
  border: none !important;
  border-radius: var(--nt-radius) !important;
}

/* Hide the footer's automatic logo (we use the custom_html widget instead) */
.footer-bottom .logo-footer { display: none; }

/* ============================================================
   Article detail page (single)
   ============================================================ */

/* Article body sits on a white surface card */
.single .article,
.single #main .article {
  background: var(--nt-surface) !important;
  border: 1px solid var(--nt-border) !important;
  border-radius: var(--nt-radius) !important;
  box-shadow: var(--nt-shadow) !important;
  padding: 32px !important;
  margin: 0 0 24px !important;
  box-sizing: border-box;
}

.single .entry-title {
  font-size: 26px;
  font-weight: 800;
  line-height: 1.4;
  margin: 8px 0 16px;
  color: var(--nt-text);
}

/* Categories + tags row — never clip tags */
.entry-categories-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 10px;
  align-items: center;
  margin: 12px 0 18px;
  overflow: visible !important;
}

.entry-categories,
.entry-tags {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0 !important;
  padding: 0 !important;
  overflow: visible !important;
  white-space: normal !important;
}

.entry-tags .tag-link,
.entry-categories .cat-link,
a.tag-link {
  display: inline-flex !important;
  align-items: center;
  gap: 4px;
  background: var(--nt-bg-soft) !important;
  color: var(--nt-text-muted) !important;
  border: 1px solid var(--nt-border) !important;
  font-size: 12px !important;
  font-weight: 500 !important;
  line-height: 1.2 !important;
  padding: 5px 10px !important;
  border-radius: 999px !important;
  text-decoration: none !important;
  white-space: nowrap;
  max-width: 100%;
  box-sizing: border-box;
}

a.tag-link:hover {
  background: var(--nt-accent-soft, #dbeafe) !important;
  color: var(--nt-accent) !important;
  border-color: var(--nt-accent) !important;
}

.entry-tags .tag-link .tag-icon,
a.tag-link .tag-icon {
  font-size: 11px;
}

/* Defense in depth: even if PHP filter is bypassed, hide SNS/share/follow/comments on single */
.single .sns-share,
.single .sns-share-buttons,
.single .sns-follow,
.single .sns-follow-buttons,
.single .comments-area,
.single #comments,
.single #respond,
.single .comment-respond,
.single .comment-form { display: none !important; }

/* ============================================================
   Related entries — match homepage "新着記事" block layout
   ============================================================ */
.related-entries {
  margin: 32px 0 0 !important;
  padding: 0 !important;
  background: transparent !important;
  border: none !important;
}

.related-entry-heading {
  font-size: 22px;
  font-weight: 800;
  color: var(--nt-text);
  margin: 0 0 20px !important;
  padding-left: 12px;
  border-left: 5px solid var(--nt-accent);
  line-height: 1.3;
  background: transparent !important;
}

.related-entry-heading .related-entry-main-heading,
.related-entry-heading .main-caption {
  font-size: 22px;
  font-weight: 800;
}

.related-entry-heading .related-entry-sub-heading,
.related-entry-heading .sub-caption {
  display: block;
  font-size: 12px;
  font-weight: 500;
  color: var(--nt-text-muted);
  margin-top: 4px;
}

/* Same vertical stack as homepage list */
.related-list {
  display: flex !important;
  flex-direction: column !important;
  gap: 10px !important;
  margin: 0 !important;
  padding: 0 !important;
}

/* Card wrap mirrors .entry-card-wrap */
.related-list .related-entry-card-wrap,
.related-entry-card-wrap,
.related-entry-card {
  background: var(--nt-surface) !important;
  border: 1px solid var(--nt-border) !important;
  border-radius: var(--nt-radius) !important;
  box-shadow: var(--nt-shadow) !important;
  margin: 0 0 10px !important;
  padding: 14px !important;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  display: flex !important;
  flex-direction: row !important;
  gap: 14px !important;
  align-items: flex-start !important;
  width: 100% !important;
  box-sizing: border-box !important;
}

.related-entry-card-wrap:hover {
  transform: translateY(-2px);
  box-shadow: var(--nt-shadow-hover) !important;
}

.related-entry-card-wrap.cf::before,
.related-entry-card-wrap.cf::after,
.related-entry-card.cf::before,
.related-entry-card.cf::after { content: none !important; }

/* Inner article — neutralise nested card frame */
.related-entry-card-wrap > .related-entry-card {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  padding: 0 !important;
  margin: 0 !important;
  display: flex !important;
  flex-direction: row !important;
  gap: 14px !important;
  align-items: flex-start !important;
  width: 100% !important;
}

/* Thumbnail (mirror entry-card-thumb) */
.related-entry-card-thumb,
figure.related-entry-card-thumb {
  flex: 0 0 140px !important;
  width: 140px !important;
  height: 140px !important;
  max-width: 140px !important;
  min-width: 140px !important;
  margin: 0 !important;
  padding: 0 !important;
  display: block !important;
  position: relative;
  overflow: hidden;
  border-radius: 4px;
  background: var(--nt-bg-soft);
  float: none !important;
}

.related-entry-card-thumb img,
.related-entry-card-thumb-image,
.related-entry-card-thumb .wp-post-image {
  width: 140px !important;
  height: 140px !important;
  max-width: 140px !important;
  max-height: 140px !important;
  object-fit: cover !important;
  display: block !important;
  border-radius: 4px;
  margin: 0 !important;
  padding: 0 !important;
}

/* Content side (mirror entry-card-content) */
.related-entry-card-content {
  flex: 1 1 auto !important;
  display: flex !important;
  flex-direction: column !important;
  justify-content: flex-start !important;
  min-width: 0 !important;
  margin: 0 !important;
  padding: 0 4px !important;
  width: auto !important;
  float: none !important;
}

.related-entry-card-title {
  color: var(--nt-text) !important;
  font-size: 17px !important;
  font-weight: 700 !important;
  line-height: 1.5 !important;
  margin: 4px 0 8px !important;
  display: block !important;
}

.related-entry-card-snippet {
  color: var(--nt-text-muted) !important;
  font-size: 13px !important;
  line-height: 1.7 !important;
  margin: 0 !important;
}

.related-entry-card-meta {
  margin-top: auto;
  font-size: 12px;
  color: var(--nt-text-muted);
  padding-top: 6px;
}

/* Override Cocoon grid variants that would force horizontal columns */
.rect-mini-card .related-list,
.rect-vertical-card .related-list,
.rect-vertical-card-3 .related-list,
.rect-vertical-card-4 .related-list {
  display: flex !important;
  flex-direction: column !important;
  flex-wrap: nowrap !important;
}

.rect-mini-card .related-entry-card-wrap,
.rect-vertical-card .related-entry-card-wrap,
.rect-vertical-card-3 .related-entry-card-wrap,
.rect-vertical-card-4 .related-entry-card-wrap {
  width: 100% !important;
}

/* ============================================================
   Responsive
   ============================================================ */
@media screen and (max-width: 1023px){
  .site-name-text { font-size: 22px; }
  .header-in { padding: 12px 16px !important; }
  .footer-widgets { grid-template-columns: 1fr !important; gap: 18px !important; }
}

/* ===== Tablet / Mobile (≤ 1023px) ===== */
@media screen and (max-width: 1023px){
  /* Sidebar wraps BELOW main (override Cocoon's no-mobile-sidebar hiding) */
  .no-mobile-sidebar .sidebar,
  #sidebar,
  .sidebar {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    margin: 24px 0 0 !important;
    padding: 0 16px !important;
    box-sizing: border-box !important;
    float: none !important;
  }

  /* Make main/sidebar stack vertically */
  #content-in,
  .content-in {
    display: block !important;
  }

  #main,
  .main {
    width: 100% !important;
    max-width: 100% !important;
    float: none !important;
    margin: 0 !important;
  }
}

/* ===== Tablet / Mobile (≤ 834px) ===== */
@media screen and (max-width: 834px){
  /* Header: stack nav below logo, hide tagline */
  .hlt-center-logo .header-in,
  #header-in,
  .header-in {
    flex-wrap: wrap !important;
    justify-content: space-between !important;
    padding: 10px 14px !important;
    gap: 8px 12px !important;
  }
  .hlt-center-logo .tagline,
  .header-in .tagline {
    display: none !important;
  }
  .nt-header-nav {
    order: 2 !important;
    margin-left: auto !important;
    flex-wrap: wrap;
  }
  .nt-header-nav__menu {
    gap: 0 !important;
  }
  .nt-header-nav__menu > li > a {
    padding: 6px 10px !important;
    font-size: 13px !important;
  }

  /* Hide Cocoon's mobile footer menu buttons (the 5-icon strip that floats in the content) */
  #mobile-menu-buttons,
  .mobile-menu-buttons,
  #mobile-footer-menu-buttons,
  .mobile-footer-menu-buttons,
  .menu-button-in,
  .mblt-footer-mobile-buttons .menu-icon-buttons {
    display: none !important;
  }

  /* Article cards: smaller thumb, hide snippet to fit small screens */
  #main .entry-card-thumb,
  #list .entry-card-thumb,
  .entry-card-wrap > article > .entry-card-thumb,
  .entry-card-wrap .entry-card-thumb:not(.popular-entry-card-thumb):not(.new-entry-card-thumb) {
    flex: 0 0 96px !important;
    width: 96px !important;
    height: 96px !important;
    min-width: 96px !important;
    max-width: 96px !important;
  }
  #main .entry-card-thumb img,
  #main .entry-card-thumb-image,
  #list .entry-card-thumb img,
  #list .entry-card-thumb-image {
    width: 96px !important;
    height: 96px !important;
    max-width: 96px !important;
    max-height: 96px !important;
  }
  .entry-card-content,
  .card-content,
  .entry-card-wrap .entry-card-content {
    min-height: 96px !important;
    height: 96px !important;
    max-height: 96px !important;
    padding: 8px 12px !important;
    justify-content: space-between !important;
  }
  /* Thumb should stay square — don't stretch to fill */
  .entry-card {
    align-items: flex-start !important;
  }
  .entry-card-title,
  .card-title {
    font-size: 13px !important;
    line-height: 1.4 !important;
    -webkit-line-clamp: 2;
  }
  .entry-card-snippet {
    display: none !important;
  }
  .nt-card-meta-row {
    font-size: 10px !important;
    gap: 4px !important;
    margin: 4px 0 0 !important;
  }
  .nt-card-tag {
    font-size: 10px !important;
    padding: 1px 6px !important;
  }
  .nt-card-cat {
    font-size: 11px !important;
  }

  /* Popular categories: 2-col on tablet/mobile */
  .nt-popular-categories {
    padding: 32px 12px !important;
  }
  .nt-popular-categories__grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 12px !important;
  }
  .nt-cat-card {
    padding: 20px 12px !important;
  }
  .nt-cat-card__icon {
    width: 48px !important;
    height: 48px !important;
  }

  /* Section titles a touch smaller */
  .nt-section-title { font-size: 18px; margin-bottom: 14px; padding-left: 10px; }

  /* Sidebar widget padding shrink */
  .sidebar .widget { padding: 14px; }

  /* Single post layout */
  .single .article,
  .single #main .article { padding: 18px !important; }
  .single .entry-title { font-size: 20px; }

  /* Tag cloud smaller pills */
  .tagcloud a, .widget_tag_cloud a {
    font-size: 11px !important;
    padding: 3px 8px !important;
  }
}

/* ===== Small mobile (≤ 480px) ===== */
@media screen and (max-width: 480px){
  .site-name-text { font-size: 18px !important; }
  .header-in { padding: 8px 12px !important; }
  .nt-header-nav__menu > li > a {
    padding: 5px 8px !important;
    font-size: 12px !important;
  }

  /* Even smaller thumb on phones */
  #main .entry-card-thumb,
  #list .entry-card-thumb,
  .entry-card-wrap > article > .entry-card-thumb,
  .entry-card-wrap .entry-card-thumb:not(.popular-entry-card-thumb):not(.new-entry-card-thumb) {
    flex: 0 0 80px !important;
    width: 80px !important;
    height: 80px !important;
    min-width: 80px !important;
    max-width: 80px !important;
  }
  #main .entry-card-thumb img,
  #list .entry-card-thumb img,
  #main .entry-card-thumb-image,
  #list .entry-card-thumb-image {
    width: 80px !important;
    height: 80px !important;
    max-width: 80px !important;
    max-height: 80px !important;
  }
  .entry-card-content,
  .entry-card-wrap .entry-card-content {
    min-height: 80px !important;
    height: 80px !important;
    max-height: 80px !important;
    padding: 6px 10px !important;
  }
  .entry-card-title { font-size: 12px !important; }

  /* Popular categories: 1-col on phones */
  .nt-popular-categories__grid {
    grid-template-columns: 1fr !important;
  }
}
