/* =========================================================
   ITNEWS — ITmedia NEWS 同型レイアウト / 緑アクセント
   ========================================================= */

:root {
  --itn-green: #009944;
  --itn-green-hover: #007a36;
  --itn-green-soft: #e8f7ee;
  --itn-black: #000;
  --itn-text: #333;
  --itn-muted: #555;
  --itn-muted-2: #888;
  --itn-border: #e4e4e4;
  --itn-border-soft: #eee;
  --itn-bg: #fff;
  --itn-max: 1128px;
  --itn-main: 728px;
  --itn-side: 336px;
  --itn-gap: 64px;
  --itn-gutter: 16px;
  --font-sans: "Noto Sans JP", "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic", YuGothic, Meiryo, sans-serif;
}

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.55;
  color: var(--itn-text);
  background: var(--itn-bg);
  overflow-x: clip;
}
body.is-nav-open {
  overflow: hidden;
  touch-action: none;
  position: fixed;
  inset: 0;
  width: 100%;
}

img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
a:hover { color: var(--itn-green); }
button, input, select, textarea { font: inherit; }
ul, ol { margin: 0; padding: 0; list-style: none; }
h1, h2, h3, h4 { margin: 0; font-weight: 700; line-height: 1.4; }
p { margin: 0 0 1em; }

.home-main, .home-side, .single-article__inner, .single-aside, .itn-card__body, .page-article { min-width: 0; }

.single-article__content img,
.single-article__content figure,
.page-article img,
.page-article figure { max-width: 100%; height: auto; }
.single-article__content table,
.page-article table { display: block; max-width: 100%; overflow-x: auto; }
.single-article__content iframe,
.page-article iframe { max-width: 100%; }

.screen-reader-text {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); border: 0;
}
.skip-link {
  position: absolute; left: -999px; top: 0; background: #000; color: #fff; padding: 8px 12px; z-index: 9999;
}
.skip-link:focus { left: 8px; top: 8px; }

.container {
  width: 100%;
  max-width: var(--itn-max);
  margin: 0 auto;
  padding: 0 var(--itn-gutter);
}

.demo-notice {
  background: #053b1f;
  color: #b7f0c9;
  font-size: 12px;
  text-align: center;
  padding: 8px 12px;
}

.reading-progress {
  position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 300; pointer-events: none;
}
.reading-progress span {
  display: block; height: 100%; width: 0; background: var(--itn-green);
}

/* ========== Header ========== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: #fff;
  border-bottom: 1px solid var(--itn-black);
}

.site-header__bar {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr) 64px;
  align-items: center;
  height: 72px;
  gap: 4px;
}
.site-header__bar > .menu-toggle,
.site-header__bar > .site-header__actions {
  min-width: 44px;
}

.menu-toggle {
  grid-column: 1;
  justify-self: start;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  min-width: 44px;
  padding: 6px 8px;
  border: 0;
  background: transparent;
  color: var(--itn-text);
  cursor: pointer;
}
.menu-toggle__icon {
  position: relative;
  display: block;
  width: 18px;
  height: 14px;
}
.menu-toggle__icon span {
  position: absolute;
  left: 0;
  display: block;
  width: 100%;
  height: 2px;
  background: currentColor;
  transition: transform .28s cubic-bezier(.22,1,.36,1), opacity .2s, top .28s cubic-bezier(.22,1,.36,1);
}
.menu-toggle__icon span:nth-child(1) { top: 0; }
.menu-toggle__icon span:nth-child(2) { top: 6px; }
.menu-toggle__icon span:nth-child(3) { top: 12px; }
.menu-toggle[aria-expanded="true"] .menu-toggle__icon span:nth-child(1) {
  top: 6px; transform: rotate(45deg);
}
.menu-toggle[aria-expanded="true"] .menu-toggle__icon span:nth-child(2) {
  opacity: 0; transform: scaleX(.4);
}
.menu-toggle[aria-expanded="true"] .menu-toggle__icon span:nth-child(3) {
  top: 6px; transform: rotate(-45deg);
}

.site-logo {
  display: flex;
  justify-content: center;
  align-items: center;
  justify-self: center;
  margin: 0;
  font-size: inherit;
  font-weight: inherit;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  grid-column: 2;
}
.site-logo a {
  display: flex;
  max-width: 100%;
}
.site-logo__img {
  width: auto;
  max-width: 180px;
  height: auto;
  max-height: 48px;
  object-fit: contain;
}

.site-header__actions {
  grid-column: 3;
  position: relative;
  justify-self: stretch;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  min-width: 44px !important;
  overflow: visible;
  z-index: 2;
}
.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  width: 44px;
  min-width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--itn-text);
  cursor: pointer;
  border-radius: 2px;
  flex-shrink: 0;
}
.icon-btn svg { width: 22px; height: 22px; }
.icon-search {
  position: relative;
  display: block;
  width: 18px;
  height: 18px;
  border: 2px solid currentColor;
  border-radius: 50%;
  box-sizing: border-box;
}
.icon-search::after {
  content: "";
  position: absolute;
  right: -5px;
  bottom: -3px;
  width: 7px;
  height: 2px;
  background: currentColor;
  transform: rotate(45deg);
  border-radius: 1px;
}
.icon-btn__label {
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
}
@media (min-width: 769px) {
  .site-header__bar {
    grid-template-columns: 72px minmax(0, 1fr) 72px;
    height: 68px;
  }
  .site-logo__img {
    max-width: 200px;
    max-height: 52px;
  }
  .site-header__actions .icon-btn {
    width: auto;
    min-width: 52px;
    height: auto;
    min-height: 44px;
    padding: 6px 8px;
    flex-direction: column;
    gap: 4px;
  }
}

/* Global nav — green (ITNEWS brand) */
.primary-nav {
  background: var(--itn-green);
}
.primary-nav .container {
  padding-left: 0;
  padding-right: 0;
}
.primary-nav__list {
  display: flex;
  flex-wrap: nowrap;
  overflow-x: auto;
  scrollbar-width: none;
  padding: 0 var(--itn-gutter);
}
.primary-nav__list::-webkit-scrollbar { display: none; }
.primary-nav__list a {
  display: block;
  padding: 12px 20px;
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.04em;
  white-space: nowrap;
}
.primary-nav__list a:hover,
.primary-nav__list a.is-current {
  background: rgba(0,0,0,.14);
  color: #fff;
}
.mobile-nav__list a.is-current { color: var(--itn-green); }

.search-panel {
  display: none;
  padding: 12px 0;
  background: #fff;
  border-bottom: 1px solid var(--itn-border);
}
.search-panel.is-open,
.search-panel:not([hidden]) { display: block; }
.search-panel[hidden] { display: none !important; }
.search-panel__form { display: flex; gap: 8px; }
.search-panel__form input {
  flex: 1;
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid var(--itn-border);
  border-radius: 2px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 18px;
  border: 1px solid transparent;
  border-radius: 4px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
}
.btn--primary {
  background: var(--itn-green);
  color: #fff;
}
.btn--primary:hover {
  background: var(--itn-green-hover);
  color: #fff;
}
.btn--more {
  position: relative;
  width: 100%;
  background: #fff;
  border: 1px solid var(--itn-border);
  color: var(--itn-text);
}
.btn--more:hover {
  border-color: #999;
  color: var(--itn-text);
}
.btn--center {
  width: auto;
  min-width: 220px;
  margin-inline: auto;
}
.btn--pill {
  border-radius: 999px;
  position: relative;
  gap: 10px;
}
.btn__arrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(255,255,255,.2);
}
.btn--ghost {
  background: #fff;
  border-color: var(--itn-border);
  color: var(--itn-text);
}

/* ========== Home ========== */
.site-main { padding: 40px 0 68px; }

.home-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--itn-side);
  align-items: start;
  gap: var(--itn-gap);
}

.home-section {
  margin-top: 64px;
  scroll-margin-top: 130px;
}
#ranking { scroll-margin-top: 130px; }
.home-section--first {
  margin-top: 0;
}

/* Headings — gray full line + green 32px accent */
.itn-heading {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0;
  padding-bottom: 15px;
  font-size: 26px;
  font-weight: 700;
  line-height: 1.4;
  letter-spacing: 0.04em;
  color: var(--itn-black);
}
.itn-heading__more {
  flex-shrink: 0;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--itn-green);
}
.itn-heading__more::after { content: " ›"; }
.itn-heading__more:hover { text-decoration: underline; }
.itn-heading::before,
.itn-heading::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  height: 2px;
}
.itn-heading::before {
  width: 100%;
  background: var(--itn-border);
}
.itn-heading::after {
  width: 32px;
  background: var(--itn-green);
}

.side-heading {
  display: flex;
  align-items: center;
  margin: 0 0 20px;
  padding: 4px 11px 4px 15px;
  background: #f5f5f5;
  border-radius: 1px;
  font-size: 16px;
  font-weight: 500;
  color: var(--itn-black);
}
.rank-period {
  margin: -8px 0 14px;
  font-size: 12px;
  line-height: 1.5;
  color: var(--itn-muted);
}
.rank-period--side {
  margin: -12px 0 12px;
  padding-left: 2px;
}

/* Article tag on image */
.article-tag {
  position: absolute;
  left: 8px;
  top: 10px;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  padding: 2px 14px;
  background: #fff;
  border: 1px solid var(--itn-border);
  border-radius: 4px;
  font-size: 12px;
  font-weight: 500;
  color: var(--itn-black);
  line-height: 1.6;
}

/* Pickup columns */
.article-col-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 32px 24px;
  margin-top: 32px;
}
.article-col__link {
  display: block;
  color: inherit;
}
.article-col__link:hover { color: inherit; }
.article-col__link:hover .article-col__title {
  color: var(--itn-green);
  text-decoration: underline;
}
.article-col__image {
  position: relative;
  overflow: hidden;
  background: #eee;
}
.article-col__image img {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
}
.article-col__body { margin-top: 12px; }
.article-col__title {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  overflow: hidden;
  font-size: 18px;
  font-weight: 400;
  line-height: 1.55;
  color: var(--itn-text);
}
.article-col__date {
  display: block;
  margin-top: 12px;
  font-size: 12px;
  font-weight: 400;
  color: var(--itn-muted);
}

/* Article rows */
.article-row-list {
  display: grid;
  gap: 32px;
  margin-top: 32px;
}
.article-row-list--after-cols {
  margin-top: 44px;
}
.article-row-list--side {
  margin-top: 24px;
  gap: 16px;
}

.article-row__link {
  display: grid;
  grid-template-columns: 225px minmax(0, 1fr);
  gap: 20px;
  align-items: start;
  color: inherit;
}
.article-row__link:hover { color: inherit; }
.article-row__link:hover .article-row__title {
  color: var(--itn-green);
  text-decoration: underline;
}

.article-row--m .article-row__link {
  grid-template-columns: 140px minmax(0, 1fr);
  gap: 16px;
}
.article-row--side .article-row__link {
  grid-template-columns: 116px minmax(0, 1fr);
  gap: 16px;
}

.article-row__image {
  position: relative;
  overflow: hidden;
  background: #eee;
}
.article-row__image img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}
.article-row__sub {
  display: block;
  margin-bottom: 4px;
  font-size: 14px;
  color: var(--itn-muted);
  letter-spacing: 0.04em;
}
.article-row--m .article-row__sub,
.article-row--side .article-row__sub {
  font-size: 12px;
}
.article-row__title {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  overflow: hidden;
  font-size: 18px;
  font-weight: 400;
  line-height: 1.55;
  color: var(--itn-text);
}
h3.article-row__title,
h3.article-col__title {
  font-weight: 400;
}
.article-row--m .article-row__title { font-size: 16px; }
.article-row--side .article-row__title {
  font-size: 14px;
  -webkit-line-clamp: 3;
}
.article-row__date {
  display: block;
  margin-top: 10px;
  font-size: 12px;
  color: var(--itn-muted);
}

/* Topics buttons */
.topics-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 20px;
}
.topics-grid > li:first-child { grid-column: 1 / -1; }
.topics-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  min-height: 60px;
  padding: 18px 16px;
  border: 1px solid var(--itn-green);
  border-radius: 4px;
  background: #fff;
  color: var(--itn-text);
  transition: background .15s ease, color .15s ease, border-color .15s ease;
}
.topics-btn__label {
  flex: 1;
  font-size: 16px;
  font-weight: 400;
  line-height: 1.4;
  text-align: left;
}
.topics-btn__count {
  flex-shrink: 0;
  font-size: 12px;
  color: var(--itn-muted);
}
.topics-btn__icon {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--itn-green);
  border-radius: 50%;
  color: var(--itn-green);
}
.topics-btn:hover {
  background: var(--itn-green-soft);
  color: var(--itn-text);
}
.topics-btn:hover .topics-btn__icon {
  background: var(--itn-green);
  color: #fff;
}

.home-more {
  display: grid;
  gap: 20px;
  margin-top: 28px;
  justify-items: stretch;
}
.home-more-link {
  margin: 20px 0 0;
  text-align: right;
  font-size: 14px;
  font-weight: 700;
}
.home-more-link a { color: var(--itn-text); }
.home-more-link a:hover { color: var(--itn-green); }

/* Ranking */
.rank-list {
  display: grid;
  gap: 16px;
  margin-top: 20px;
}
.rank-list--main {
  gap: 18px;
  margin-top: 20px;
}
.rank-item {
  display: grid;
  grid-template-columns: 32px 96px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  color: var(--itn-text);
}
.rank-list--main .rank-item {
  grid-template-columns: 36px 140px minmax(0, 1fr);
  gap: 14px;
}
.rank-item:hover { color: inherit; }
.rank-item:hover .rank-item__label { color: var(--itn-green); }
.rank-item__num {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--itn-border-soft);
  font-size: 14px;
  font-weight: 700;
  color: var(--itn-text);
}
.rank-list--main .rank-item__num {
  width: 36px;
  height: 36px;
  font-size: 15px;
}
.rank-item--top .rank-item__num {
  background: var(--itn-green);
  color: #fff;
}
.rank-item__thumb {
  display: block;
  overflow: hidden;
  background: #eee;
  aspect-ratio: 16 / 9;
  border-radius: 2px;
}
.rank-item__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform .25s ease;
}
.rank-item:hover .rank-item__thumb img {
  transform: scale(1.04);
}
.rank-item__label {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  overflow: hidden;
  font-size: 14px;
  line-height: 1.5;
  letter-spacing: 0.02em;
}
.rank-list--main .rank-item__label {
  font-size: 15px;
  line-height: 1.55;
}

/* Sidebar */
.side-section { margin-top: 40px; }
.side-section:first-child,
.side-section--search { margin-top: 0; }

.side-search {
  position: relative;
  display: flex;
}
.side-search input {
  width: 100%;
  min-height: 48px;
  padding: 0 48px 0 14px;
  border: 1px solid var(--itn-border);
  border-radius: 4px;
  background: #fff;
}
.side-search button {
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  border: 0;
  background: transparent;
  color: #999;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.side-search button svg { width: 22px; height: 22px; }

.side-more {
  margin: 16px 0 0;
  text-align: right;
  font-size: 13px;
  font-weight: 700;
}
.side-cats a {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 12px 0;
  border-bottom: 1px solid var(--itn-border-soft);
  font-size: 14px;
  font-weight: 700;
}
.side-cats__count {
  font-size: 12px;
  font-weight: 400;
  color: var(--itn-muted);
}

/* Legacy cards for archive/single */
.itn-section-head {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
  padding-bottom: 15px;
}
.itn-section-head::before,
.itn-section-head::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  height: 2px;
}
.itn-section-head::before { width: 100%; background: var(--itn-border); }
.itn-section-head::after { width: 32px; background: var(--itn-green); }
.itn-section-title { font-size: 22px; font-weight: 700; color: var(--itn-black); }
.itn-section-more { font-size: 12px; font-weight: 700; color: var(--itn-green); }

.related-box__note {
  margin: 8px 0 14px;
  font-size: 12px;
  line-height: 1.6;
  color: var(--itn-muted);
}
.related-box__list {
  display: grid;
  gap: 14px;
}
.related-box__list .itn-card--list .itn-card__cat {
  display: inline-block;
  margin-bottom: 4px;
  font-size: 11px;
  font-weight: 700;
  color: var(--itn-green);
}

.block-main, .cat-block, .side-box {
  background: transparent;
  border: 0;
  margin-bottom: 28px;
  padding: 0;
}

.itn-card { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.itn-card__media { overflow: hidden; background: #eee; }
.itn-card__media img { width: 100%; aspect-ratio: 16/9; object-fit: cover; }
.itn-card__cat {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  color: var(--itn-green);
  margin-bottom: 4px;
}
.itn-card__title { font-size: 15px; font-weight: 700; overflow-wrap: anywhere; }
.itn-card__title a:hover { color: var(--itn-green); }
.itn-card__excerpt { margin: 0; font-size: 12px; color: var(--itn-muted-2); }
.itn-card__time { font-size: 11px; color: var(--itn-muted-2); }
.itn-card--hero .itn-card__title { font-size: 22px; font-weight: 900; }
.itn-card--list, .itn-card--rank {
  flex-direction: row;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--itn-border-soft);
}
.itn-card--list:last-child, .itn-card--rank:last-child { border-bottom: 0; }
.itn-card--list .itn-card__title, .itn-card--rank .itn-card__title { font-size: 13px; }
.itn-card--list .itn-card__body, .itn-card--rank .itn-card__body { flex: 1; min-width: 0; }
.itn-rank {
  flex-shrink: 0;
  width: 22px; height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--itn-green);
  color: #fff;
  font-size: 12px;
  font-weight: 900;
  border-radius: 50%;
}

.headline-list li { border-bottom: 1px solid var(--itn-border-soft); }
.headline-list li:last-child { border-bottom: 0; }
.headline-list a {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 0;
}
.headline-list__title { font-weight: 700; font-size: 14px; overflow-wrap: anywhere; }
.headline-list time { flex-shrink: 0; font-size: 11px; color: var(--itn-muted-2); }

/* Single / archive */
.single-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 300px);
  gap: 40px;
  align-items: start;
  padding-top: 8px;
  padding-bottom: 40px;
}
.single-article__inner, .page-article {
  background: #fff;
  border: 0;
  padding: 0;
}
.itn-breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  font-size: 12px;
  color: var(--itn-muted-2);
  margin-bottom: 14px;
}
.single-article__cat {
  display: inline-block;
  color: var(--itn-green);
  font-weight: 700;
  font-size: 13px;
  margin-bottom: 8px;
}
.single-article__title {
  font-size: clamp(1.4rem, 3vw, 1.85rem);
  font-weight: 900;
  margin-bottom: 12px;
  overflow-wrap: anywhere;
}
.single-article__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  color: var(--itn-muted-2);
  font-size: 12px;
  margin-bottom: 14px;
}
.article-ai {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 12px;
  margin: -6px 0 14px;
  font-size: 12px;
  line-height: 1.6;
  color: var(--itn-muted);
}
.article-ai a {
  color: var(--itn-green);
  font-weight: 700;
}
.ai-welcome__text {
  margin: -8px 0 10px;
  font-size: 13px;
  line-height: 1.75;
  color: var(--itn-text);
}
.ai-welcome__link {
  display: inline-block;
  font-size: 13px;
  font-weight: 700;
  color: var(--itn-green);
}
.article-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 14px 20px;
  justify-content: space-between;
  padding: 12px 0;
  margin-bottom: 16px;
  border-top: 1px solid var(--itn-border);
  border-bottom: 1px solid var(--itn-border);
}
.toolbar-label { font-size: 12px; font-weight: 700; color: var(--itn-muted-2); margin-right: 4px; }
.font-size-controls, .share-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.font-size-controls button, .share-btn {
  min-width: 40px;
  min-height: 36px;
  padding: 0 10px;
  border: 1px solid var(--itn-border);
  background: #fff;
  border-radius: 2px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  color: var(--itn-text);
}
.font-size-controls button.is-active,
.share-btn:hover,
.font-size-controls button:hover {
  border-color: var(--itn-green);
  color: var(--itn-green);
}
a.share-btn { display: inline-flex; align-items: center; text-decoration: none; }
.single-article__hero { margin: 0 0 20px; }
.single-article__hero img { width: 100%; aspect-ratio: 16/9; object-fit: cover; }
.single-article__content { font-size: 16px; line-height: 1.9; }
.single-article__content p { margin-bottom: 1.25em; }
.single-article__content.font-s { font-size: 15px; }
.single-article__content.font-m { font-size: 16px; }
.single-article__content.font-l { font-size: 18px; line-height: 1.95; }
.post-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid var(--itn-border);
}
.post-nav__item { display: flex; flex-direction: column; gap: 6px; }
.post-nav__item a { font-weight: 700; overflow-wrap: anywhere; }
.post-nav__item--next { text-align: right; }
.aside-more { display: flex; width: 100%; margin-top: 12px; }

.archive-page, .page-shell { padding-bottom: 40px; }
.archive-header { padding: 12px 0 16px; }
.archive-header h1 { font-size: 28px; font-weight: 900; }
.archive-desc, .search-summary { color: var(--itn-muted-2); margin-top: 8px; }
.archive-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}
.archive-grid .itn-card { background: #fff; border: 0; padding: 0; }
.archive-grid > .empty-state { grid-column: 1 / -1; }
.pagination { display: flex; justify-content: center; padding: 24px 0; }
.pagination:empty { display: none; padding: 0; }
.pagination ul { display: flex; gap: 6px; flex-wrap: wrap; }
.pagination .page-numbers {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 40px;
  padding: 0 10px;
  border: 1px solid var(--itn-border);
  background: #fff;
  font-weight: 700;
}
.pagination .current {
  background: var(--itn-green);
  color: #fff;
  border-color: var(--itn-green);
}
.search-hero-form { display: flex; gap: 8px; margin-top: 14px; max-width: 560px; }
.search-hero-form input {
  flex: 1;
  min-height: 46px;
  padding: 0 12px;
  border: 1px solid var(--itn-border);
  border-radius: 2px;
}
.empty-state { text-align: center; padding: 48px 16px; background: #fafafa; }
.empty-state--large { padding: 64px 16px; }
.empty-kicker { font-size: 48px; font-weight: 900; color: var(--itn-green); margin: 0 0 8px; }
.empty-state__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin-top: 18px;
}
.contact-form { display: grid; gap: 14px; max-width: 640px; }
.contact-form label { display: grid; gap: 6px; font-weight: 700; }
.contact-form em { color: #d00; font-style: normal; }
.contact-form input,
.contact-form textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--itn-border);
  border-radius: 2px;
}

/* Footer — light ITmedia-style with green accents */
.site-footer {
  margin-top: 48px;
  background: #fff;
  border-top: 1px solid var(--itn-border);
  color: var(--itn-text);
}
.footer-inner {
  padding: 0 0 32px;
}
.footer-pagetop {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 48px;
  margin: 0 0 28px;
  border-bottom: 1px solid var(--itn-border-soft);
  color: var(--itn-text);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
  transition: color .15s ease, background .15s ease;
}
.footer-pagetop:hover {
  color: var(--itn-green);
  background: var(--itn-green-soft);
}
.footer-pagetop__icon {
  position: relative;
  display: block;
  width: 12px;
  height: 12px;
}
.footer-pagetop__icon::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 4px;
  width: 8px;
  height: 8px;
  border-left: 2px solid currentColor;
  border-top: 2px solid currentColor;
  transform: rotate(45deg);
}

.footer-main {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1.4fr);
  gap: 40px 48px;
  align-items: start;
  padding-bottom: 28px;
}
.footer-brand {
  display: grid;
  gap: 12px;
}
.footer-logo {
  display: inline-flex;
  max-width: 200px;
}
.footer-logo img {
  width: 100%;
  height: auto;
  max-height: 56px;
  object-fit: contain;
  object-position: left center;
}
.footer-brand__text {
  margin: 0;
  font-size: 13px;
  line-height: 1.7;
  color: var(--itn-muted);
  max-width: 360px;
}

.footer-nav {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 28px 32px;
}
.footer-nav__label {
  margin: 0 0 12px;
  font-size: 13px;
  font-weight: 700;
  color: var(--itn-black);
  letter-spacing: 0.04em;
}
.footer-nav__list {
  display: grid;
  gap: 10px;
}
.footer-nav__list a {
  font-size: 13px;
  color: var(--itn-text);
}
.footer-nav__list a:hover {
  color: var(--itn-green);
}

.footer-legal {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  gap: 0;
  padding: 18px 0;
  border-top: 1px solid var(--itn-border-soft);
  border-bottom: 1px solid var(--itn-border-soft);
}
.footer-legal li {
  position: relative;
  display: inline-flex;
  align-items: center;
}
.footer-legal li:not(:last-child) {
  margin-right: 14px;
  padding-right: 14px;
}
.footer-legal li:not(:last-child)::after {
  content: "";
  position: absolute;
  right: 0;
  top: 50%;
  width: 1px;
  height: 12px;
  background: var(--itn-border);
  transform: translateY(-50%);
}
.footer-legal a {
  font-size: 13px;
  color: var(--itn-text);
}
.footer-legal a:hover { color: var(--itn-green); }

.footer-copy {
  margin: 16px 0 0;
  font-size: 12px;
  line-height: 1.6;
  color: var(--itn-muted-2);
}
.footer-ai {
  margin: 6px 0 0;
  font-size: 12px;
  line-height: 1.6;
  color: var(--itn-muted);
}
.footer-ai a {
  color: var(--itn-green);
  font-weight: 700;
}

.back-to-top {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 90;
  width: 46px;
  height: 46px;
  border: 0;
  border-radius: 50%;
  background: var(--itn-green);
  color: #fff;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(0, 153, 68, 0.28);
}
.back-to-top span {
  position: absolute;
  left: 50%;
  top: 54%;
  width: 10px;
  height: 10px;
  border-left: 2px solid #fff;
  border-top: 2px solid #fff;
  transform: translate(-50%, -50%) rotate(45deg);
}
.back-to-top[hidden] { display: none; }

.site-toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  background: #0f172a;
  color: #fff;
  padding: 12px 16px;
  border-radius: 2px;
  z-index: 400;
  opacity: 0;
  transition: opacity .2s;
}
.site-toast.is-visible,
.site-toast.is-static {
  opacity: 1;
  position: static;
  transform: none;
  margin-bottom: 16px;
}
.site-toast.is-success { background: #065f46; }
.site-toast.is-error { background: #7f1d1d; }
.site-toast[hidden]:not(.is-static) { display: none; }

/* Mobile nav */
.mobile-nav {
  position: fixed;
  inset: 0;
  z-index: 200;
  width: 100%;
  height: 100%;
  height: 100dvh;
  background: rgba(15, 23, 42, 0);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  overflow: hidden;
  transition: background .28s ease, opacity .28s ease, visibility 0s linear .28s;
}
.mobile-nav.is-open {
  background: rgba(15, 23, 42, .5);
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transition: background .28s ease, opacity .28s ease, visibility 0s;
}
.mobile-nav[hidden] { display: none; }
.mobile-nav.is-animating[hidden] { display: block; }
.mobile-nav__panel {
  width: min(340px, calc(100% - 56px));
  height: 100%;
  max-height: 100dvh;
  background: #fff;
  padding: 12px 16px 24px;
  overflow-y: auto;
  padding-top: max(12px, env(safe-area-inset-top));
  padding-bottom: max(24px, env(safe-area-inset-bottom));
  padding-left: max(16px, env(safe-area-inset-left));
  box-shadow: 8px 0 32px rgba(0,0,0,.18);
  transform: translate3d(-104%, 0, 0);
  transition: transform .34s cubic-bezier(.22, 1, .36, 1);
  will-change: transform;
  -webkit-overflow-scrolling: touch;
}
.mobile-nav.is-open .mobile-nav__panel { transform: translate3d(0, 0, 0); }
.mobile-nav__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.mobile-nav__search {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 12px;
}
.mobile-nav__search input {
  width: 100%;
  min-height: 46px;
  padding: 0 12px;
  border: 1px solid var(--itn-border);
  font-size: 16px;
}
.mobile-nav__list a {
  display: flex;
  align-items: center;
  min-height: 48px;
  padding: 12px 0;
  border-bottom: 1px solid var(--itn-border);
  font-weight: 700;
  font-size: 16px;
}

/* ========== Responsive ========== */
@media (max-width: 1024px) {
  .home-layout {
    grid-template-columns: minmax(0, 1fr);
    gap: 48px;
  }
  .side-section--search { display: none; }
  .side-section--search + .side-section { margin-top: 0; }
}
@media (max-width: 1128px) {
  :root { --itn-gap: 40px; }
  .single-layout {
    grid-template-columns: minmax(0, 1fr);
  }
  .archive-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* --- Smartphone (ITmedia NEWS SP 相当) --- */
@media (max-width: 768px) {
  :root {
    --itn-gutter: 16px;
    --itn-gap: 40px;
  }

  .demo-notice { display: none; }

  /* Header: 52px / 検索維持 */
  .site-header__bar {
    height: 52px;
    min-height: 52px;
    grid-template-columns: 56px minmax(0, 1fr) 56px;
    padding-top: 0;
    padding-bottom: 0;
  }
  .menu-toggle {
    min-width: 44px;
    padding: 8px 10px;
  }
  .icon-btn__label { display: none; }
  .site-header__actions .icon-btn {
    width: 44px;
    height: 44px;
  }
  .site-logo__img {
    width: auto;
    max-width: 148px;
    max-height: 40px;
  }

  .primary-nav__list {
    padding-left: max(var(--itn-gutter), env(safe-area-inset-left));
    padding-right: max(var(--itn-gutter), env(safe-area-inset-right));
    overscroll-behavior-x: contain;
    -webkit-overflow-scrolling: touch;
  }
  .primary-nav__list a {
    padding: 12px 16px;
    font-size: 14px;
    min-height: 44px;
  }

  .site-main {
    padding: 24px 0 64px;
    overflow-x: clip;
  }
  .home-layout { gap: 40px; }
  .home-section { margin-top: 40px; }
  .home-section--first { margin-top: 0; }

  .itn-heading {
    font-size: 20px;
    padding-bottom: 12px;
    margin-bottom: 0;
  }

  /* Pickup: 1列フル幅 */
  .article-col-list {
    grid-template-columns: minmax(0, 1fr);
    gap: 28px;
    margin-top: 24px;
  }
  .article-col__body { margin-top: 8px; }
  .article-col__title {
    font-size: 16px;
    -webkit-line-clamp: 4;
  }
  .article-col__date { margin-top: 10px; }

  /* Rows: 96px サムネ（SPサイズ） */
  .article-row-list {
    margin-top: 24px;
    gap: 0;
  }
  .article-row-list--after-cols {
    margin-top: 28px;
  }
  .article-row-list--side {
    margin-top: 16px;
    gap: 0;
  }
  .article-row {
    position: relative;
    padding: 14px 0;
  }
  .article-row-list > li:not(:last-child) .article-row::after {
    content: "";
    position: absolute;
    left: calc(var(--itn-gutter) * -1);
    right: calc(var(--itn-gutter) * -1);
    bottom: 0;
    height: 1px;
    background: var(--itn-border-soft);
  }
  .article-row__link,
  .article-row--m .article-row__link,
  .article-row--side .article-row__link {
    grid-template-columns: 132px minmax(0, 1fr);
    gap: 12px;
    align-items: start;
  }
  .article-row__title,
  .article-row--m .article-row__title,
  .article-row--side .article-row__title {
    font-size: 15.5px;
    -webkit-line-clamp: 3;
  }
  .article-row__sub {
    font-size: 11px;
    margin-bottom: 2px;
  }
  .article-row__date { margin-top: 8px; }
  .article-tag {
    left: 4px;
    top: 4px;
    padding: 1px 8px;
    font-size: 11px;
  }

  /* Topics: 2列維持・小さめ */
  .topics-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin-top: 16px;
  }
  .topics-btn {
    min-height: 52px;
    padding: 12px 10px;
  }
  .topics-btn__label { font-size: 12px; }
  .topics-btn__icon {
    width: 22px;
    height: 22px;
  }
  .topics-btn__icon svg {
    width: 12px;
    height: 12px;
  }

  .home-more {
    margin-top: 24px;
    gap: 16px;
  }
  .btn--more { min-height: 48px; font-size: 14px; }
  .btn--center {
    width: 100%;
    max-width: 280px;
    min-width: 0;
  }

  /* Ranking */
  .rank-list,
  .rank-list--main {
    gap: 14px;
    margin-top: 16px;
  }
  .rank-item {
    grid-template-columns: 32px 120px minmax(0, 1fr);
    gap: 12px;
  }
  .rank-list--main .rank-item {
    grid-template-columns: 32px 140px minmax(0, 1fr);
    gap: 12px;
  }
  .rank-item__num,
  .rank-list--main .rank-item__num {
    width: 32px;
    height: 32px;
    font-size: 14px;
  }
  .rank-item__label,
  .rank-list--main .rank-item__label {
    font-size: 15px;
    -webkit-line-clamp: 3;
  }

  /* Sidebar blocks full width */
  .side-section { margin-top: 32px; }
  .side-section--search { margin-top: 0; }
  .side-heading {
    font-size: 15px;
    margin-bottom: 12px;
  }
  .side-search input { min-height: 48px; font-size: 16px; }

  /* Archive / single */
  .archive-grid,
  .post-nav {
    grid-template-columns: minmax(0, 1fr) !important;
  }
  .archive-header h1 { font-size: 1.4rem; }
  .single-article__title { font-size: 1.35rem; }
  .single-article__content {
    font-size: 16px;
    overflow-wrap: anywhere;
  }
  .article-toolbar { flex-direction: column; align-items: stretch; gap: 12px; }
  .font-size-controls button,
  .share-btn {
    min-width: 44px;
    min-height: 44px;
  }
  .post-nav__item--next { text-align: left; }

  .search-panel__form,
  .mobile-nav__search,
  .search-hero-form,
  .empty-state__actions,
  .contact-form {
    flex-direction: column;
  }
  .search-panel__form input,
  .search-panel__form .btn,
  .mobile-nav__search input,
  .mobile-nav__search .btn,
  .search-hero-form input,
  .search-hero-form .btn,
  .empty-state__actions .btn {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    font-size: 16px;
  }

  .footer-inner { padding-bottom: max(28px, env(safe-area-inset-bottom)); }
  .footer-pagetop { margin-bottom: 24px; min-height: 52px; }
  .footer-main {
    grid-template-columns: minmax(0, 1fr);
    gap: 28px;
    text-align: center;
    justify-items: center;
  }
  .footer-brand {
    justify-items: center;
  }
  .footer-logo { max-width: 168px; }
  .footer-logo img { object-position: center; max-height: 48px; }
  .footer-brand__text {
    max-width: 100%;
    text-align: center;
  }
  .footer-nav {
    width: 100%;
    grid-template-columns: minmax(0, 1fr);
    gap: 24px 16px;
    text-align: left;
  }
  .footer-legal {
    justify-content: center;
    gap: 0;
  }
  .footer-copy,
  .footer-ai {
    text-align: center;
    padding: 0 8px;
  }

  .back-to-top {
    right: max(12px, env(safe-area-inset-right));
    bottom: max(12px, env(safe-area-inset-bottom));
    width: 44px;
    height: 44px;
  }

  .mobile-nav__panel {
    width: min(300px, calc(100% - 40px));
  }

  .container {
    padding-left: max(var(--itn-gutter), env(safe-area-inset-left));
    padding-right: max(var(--itn-gutter), env(safe-area-inset-right));
  }
}

@media (max-width: 380px) {
  .topics-btn__label { font-size: 13px; }
  .article-row__link,
  .article-row--m .article-row__link,
  .article-row--side .article-row__link {
    grid-template-columns: 120px minmax(0, 1fr);
    gap: 10px;
  }
  .site-logo__img {
    max-width: 132px;
    max-height: 36px;
  }
}

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