/* ============================================
   北方領土ニュースまとめ - Nikkei Style
   ============================================ */

:root {
  --color-primary: #B22234;
  --color-bg: #ffffff;
  --color-bg-hover: #f8f8f8;
  --color-text: #333333;
  --color-text-sub: #666666;
  --color-text-muted: #999999;
  --color-border: #e5e5e5;
  --font-main: 'Noto Sans JP', -apple-system, BlinkMacSystemFont, sans-serif;
  --max-width: 960px;
}

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

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

body {
  font-family: var(--font-main);
  color: var(--color-text);
  background: var(--color-bg);
  line-height: 1.6;
}

/* Header */
.header {
  background: #000000;
  border-bottom: none;
  position: sticky;
  top: 0;
  z-index: 100;
}

.header__inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 16px 16px 12px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
}

.header__title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--color-text);
  line-height: 1;
}

.header__link {
  display: block;
  line-height: 0;
}

.header__logo {
  display: block;
  width: 160px;
  height: 40px;
}

.header__search {
  flex: 1;
  max-width: 280px;
  margin-left: auto;
  margin-right: 16px;
}

.header__meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  font-size: 0.75rem;
  color: #999999;
  white-space: nowrap;
}

.header__update::before {
  content: '更新 ';
}

.header__count {
  font-size: 0.6875rem;
}

/* Main */
.main__inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 16px;
}

.search-box {
  position: relative;
}

.search-box__icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: #888888;
}

.search-box__input {
  width: 100%;
  font-family: var(--font-main);
  font-size: 14px;
  padding: 8px 32px;
  border: 1px solid #333333;
  border-radius: 4px;
  background: #1a1a1a;
  color: #ffffff;
}

.search-box__input:focus {
  outline: none;
  border-color: #666666;
  background: #222222;
}

.search-box__input::placeholder {
  color: #888888;
}

.search-box__input::-webkit-search-cancel-button {
  display: none;
}

.search-box__clear {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  width: 20px;
  height: 20px;
  border: none;
  background: none;
  color: #888888;
  cursor: pointer;
}

.search-box__clear:hover {
  color: #ffffff;
}

.search-box__clear[hidden] { display: none; }
.search-box__clear svg { width: 100%; height: 100%; }

/* Article List - 2 column grid on PC */
.article-list {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0;
}

.article-item {
  border-bottom: 1px solid var(--color-border);
  opacity: 0;
  animation: fadeIn 0.25s ease forwards;
}

/* Alternating left border for visual separation */
.article-item:nth-child(odd) {
  border-right: 1px solid var(--color-border);
}

@keyframes fadeIn {
  to { opacity: 1; }
}

/* Article Card */
.article-card {
  display: block;
  padding: 16px;
  text-decoration: none;
  color: inherit;
  height: 100%;
  transition: background 0.15s;
}

.article-card:hover {
  background: var(--color-bg-hover);
}

.article-card__content {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.article-card__header {
  flex: 1;
  margin-bottom: 8px;
}

.article-card__title {
  font-size: 0.9375rem;
  font-weight: 700;
  line-height: 1.5;
  color: var(--color-text);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.article-card:hover .article-card__title {
  color: var(--color-primary);
}

.article-card__external { display: none; }
.article-card__thumb { display: none; }

.article-card__meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: auto;
}

/* Source Tag */
.article-card__source {
  display: inline-block;
  font-size: 0.6875rem;
  font-weight: 700;
  color: #fff;
  background: var(--color-primary);
  padding: 2px 8px;
  border-radius: 2px;
}

.article-card__source::before { display: none; }

.article-card__date {
  font-size: 0.75rem;
  color: var(--color-text-muted);
}

/* Loading */
.loading {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 32px 0;
  gap: 12px;
}

.loading[hidden] { display: none; }

.loading__spinner {
  width: 28px;
  height: 28px;
  border: 2px solid var(--color-border);
  border-top-color: var(--color-primary);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.loading__text {
  font-size: 0.875rem;
  color: var(--color-text-muted);
}

/* Empty */
.empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 32px 0;
}

.empty[hidden] { display: none; }

.empty__icon {
  width: 48px;
  height: 48px;
  color: var(--color-text-muted);
  opacity: 0.4;
  margin: 0 auto 12px;
}

.empty__text {
  font-size: 0.875rem;
  color: var(--color-text-muted);
}

/* Load More */
.load-more-trigger {
  grid-column: 1 / -1;
  display: flex;
  justify-content: center;
  padding: 16px 0;
}

.load-more-spinner .loading__spinner {
  width: 24px;
  height: 24px;
}

/* Footer */
.footer {
  background: #f5f5f5;
  border-top: 1px solid var(--color-border);
  margin-top: 24px;
}

.footer__inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 24px 16px;
}

.footer__content {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.footer__notice {
  font-size: 0.75rem;
  color: var(--color-text-sub);
  line-height: 1.7;
}

.footer__links {
  display: flex;
  gap: 12px;
}

.footer__link {
  font-size: 0.75rem;
  color: var(--color-primary);
  text-decoration: none;
}

.footer__link:hover {
  text-decoration: underline;
}

.external-icon {
  font-size: 0.625rem;
  margin-left: 2px;
}

.footer__copyright {
  font-size: 0.6875rem;
  color: var(--color-text-muted);
  padding-top: 12px;
  border-top: 1px solid var(--color-border);
}

.wave-bg { display: none; }

/* Mobile: single column */
@media (max-width: 640px) {
  .header__inner {
    padding: 12px 12px 8px;
    flex-wrap: wrap;
    gap: 8px;
  }

  .header__logo {
    width: 120px;
    height: 30px;
  }

  .header__search {
    order: 3;
    flex: 1 1 100%;
    max-width: none;
    margin: 4px 0 0;
  }

  .header__meta {
    font-size: 0.6875rem;
  }

  .main__inner {
    padding: 0 12px;
  }

  .article-list {
    grid-template-columns: 1fr;
  }

  .article-item:nth-child(odd) {
    border-right: none;
  }

  .article-card {
    padding: 12px 0;
  }

  .article-card__title {
    font-size: 0.9375rem;
  }

  .footer__content {
    flex-direction: column;
  }
}

@media print {
  .header { position: static; }
  .header__search, .footer__links { display: none; }
  .article-list { display: block; }
  .article-item { border-right: none !important; }
  .article-card:hover { background: none; }
}
