/* ===========================
   AI News Portal - CSS
   PC-first responsive design
   =========================== */

/* --- Reset & Base --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Hiragino Sans", "Noto Sans JP", sans-serif;
    background: #f0f2f5;
    color: #1a1a2e;
    line-height: 1.7;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; height: auto; display: block; }
ul, ol { list-style: none; }

/* --- Container --- */
.site-container { max-width: 1200px; margin: 0 auto; padding: 0 24px; width: 100%; }

/* --- Layout: 2-column --- */
.layout { display: grid; grid-template-columns: 1fr 300px; gap: 32px; margin: 24px 0; }
.layout__main { min-width: 0; }

/* =========================
   HEADER
   ========================= */
.site-header { background: #010005; border-bottom: 1px solid #1e1e3a; position: sticky; top: 0; z-index: 100; }
.site-header__inner { display: flex; align-items: center; gap: 24px; height: auto; }

.site-header__logo { display: flex; align-items: center; flex-shrink: 0; margin: -1px 0; }
.site-header__logo img { height: 52px; width: auto; display: block; }

/* Nav */
.site-nav { display: flex; align-items: center; gap: 4px; }
.site-nav__link {
    padding: 6px 14px; font-size: 0.9rem; font-weight: 500; color: #94a3b8;
    border-radius: 6px; border: none; background: none; cursor: pointer;
    transition: background 0.15s;
}
.site-nav__link:hover { background: #1e1e3a; color: #fff; }
.site-nav__dropdown { position: relative; }
.site-nav__link--dropdown::after { content: ' ▾'; font-size: 0.7em; }
.site-nav__dropdown-menu {
    display: none; position: absolute; top: 100%; left: 0;
    background: #fff; border: 1px solid #e5e7eb; border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.08); min-width: 160px; z-index: 200;
    padding: 6px 0;
}
.site-nav__dropdown::after {
    content: ''; position: absolute; top: 100%; left: 0; right: 0; height: 8px;
}
.site-nav__dropdown:hover .site-nav__dropdown-menu { display: block; }
.site-nav__dropdown-menu a {
    display: block; padding: 8px 16px; font-size: 0.85rem; color: #374151;
}
.site-nav__dropdown-menu a:hover { background: #f3f4f6; }

/* Search */
.site-search {
    display: flex; align-items: center; margin-left: auto;
    border: 1px solid #2d2d4a; border-radius: 8px; overflow: hidden;
    background: #1a1a2e; transition: border-color 0.15s;
}
.site-search:focus-within { border-color: #4361ee; background: #1e1e3a; }
.site-search__input {
    border: none; outline: none; background: transparent; color: #e5e7eb;
    padding: 8px 12px; font-size: 0.85rem; width: 220px;
}
.site-search__input::placeholder { color: #6b7280; }
.site-search__btn {
    border: none; background: none; padding: 8px 10px;
    cursor: pointer; color: #6b7280; display: flex;
}
.site-search__btn:hover { color: #4361ee; }

.site-header__mobile-menu { display: none; border: none; background: none; cursor: pointer; color: #94a3b8; padding: 4px; }

/* =========================
   HERO SECTION
   ========================= */
.hero { display: grid; grid-template-columns: 1.6fr 1fr; gap: 16px; margin-bottom: 8px; }

/* =========================
   CARDS
   ========================= */

/* --- Hero card --- */
.card--hero { border-radius: 12px; overflow: hidden; }
.card--hero .card__link { display: block; }
.card--hero .card__image {
    height: 380px; background-size: cover; background-position: center;
    position: relative; display: flex; align-items: flex-end;
}
.card--hero .card__overlay {
    width: 100%; padding: 24px;
    background: linear-gradient(transparent, rgba(0,0,0,0.75));
    color: #fff;
}
.card--hero .card__title { font-size: 1.4rem; font-weight: 700; line-height: 1.4; margin-top: 8px; }
.card--hero .card__meta { font-size: 0.8rem; opacity: 0.85; display: flex; gap: 10px; align-items: center; margin-top: 8px; }
.card--hero .card__cat {
    background: #4361ee; color: #fff; padding: 2px 10px; border-radius: 4px;
    font-size: 0.7rem; font-weight: 600;
}

/* --- Medium card --- */
.card--medium {
    background: #fff; border-radius: 10px; overflow: hidden;
    border: 1px solid #e5e7eb; transition: box-shadow 0.15s;
}
.card--medium:hover { box-shadow: 0 2px 12px rgba(0,0,0,0.06); }
.card--medium .card__link { display: flex; height: 100%; }
.card--medium .card__image-wrap { width: 140px; flex-shrink: 0; overflow: hidden; }
.card--medium .card__img { width: 100%; height: 100%; object-fit: cover; }
.card--medium .card__icon {
    width: 100%; height: 100%; display: flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, #4361ee, #7c3aed); color: #fff;
    font-size: 1.5rem; font-weight: 800;
}
.card--medium .card__body { padding: 14px 16px; display: flex; flex-direction: column; justify-content: center; }
.card--medium .card__cat {
    background: #eef2ff; color: #4361ee; padding: 2px 8px; border-radius: 3px;
    font-size: 0.65rem; font-weight: 600; display: inline-block; margin-bottom: 4px; width: fit-content;
}
.card--medium .card__title { font-size: 0.9rem; font-weight: 600; line-height: 1.45; }
.card--medium .card__meta { font-size: 0.72rem; color: #9ca3af; margin-top: 6px; display: flex; gap: 8px; align-items: center; }

/* --- Grid card --- */
.card--grid {
    background: #fff; border-radius: 10px; overflow: hidden;
    border: 1px solid #e5e7eb; transition: box-shadow 0.15s, border-color 0.15s;
    display: flex; flex-direction: column;
}
.card--grid:hover { box-shadow: 0 2px 12px rgba(0,0,0,0.06); border-color: #c7d2fe; }
.card--grid .card__link { display: flex; flex-direction: column; height: 100%; }
.card--grid .card__image-wrap { height: 180px; overflow: hidden; background: #f3f4f6; }
.card--grid .card__img { width: 100%; height: 100%; object-fit: cover; }
.card--grid .card__icon {
    width: 100%; height: 100%; display: flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, #4361ee, #7c3aed); color: #fff;
    font-size: 2rem; font-weight: 800;
}
.card--grid .card__body { padding: 14px 16px; flex: 1; display: flex; flex-direction: column; }
.card--grid .card__meta { display: flex; gap: 6px; align-items: center; margin-bottom: 6px; flex-wrap: wrap; }
.card--grid .card__cat {
    background: #eef2ff; color: #4361ee; padding: 2px 8px; border-radius: 3px;
    font-size: 0.65rem; font-weight: 600;
}
.card--grid .card__lang {
    font-size: 0.6rem; font-weight: 700; color: #b45309; background: #fef3c7;
    padding: 1px 6px; border-radius: 3px;
}
.card--grid .card__title { font-size: 0.95rem; font-weight: 600; line-height: 1.5; }
.card--grid .card__summary { font-size: 0.8rem; color: #6b7280; margin-top: 8px; line-height: 1.6; flex: 1; }
.card--grid .card__footer {
    display: flex; justify-content: space-between; align-items: center;
    margin-top: 10px; padding-top: 10px; border-top: 1px solid #f3f4f6;
    font-size: 0.72rem; color: #9ca3af;
}
.card--grid .card__source { font-weight: 500; }

/* Common card elements */
.card__lang {
    font-size: 0.6rem; font-weight: 700; color: #b45309; background: #fef3c7;
    padding: 1px 6px; border-radius: 3px;
}
.card__source { font-weight: 500; }

/* --- Article grid layout --- */
.article-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; margin-bottom: 24px; }

/* =========================
   CATEGORY TABS
   ========================= */
.cat-tabs { display: flex; gap: 6px; margin-bottom: 20px; overflow-x: auto; padding-bottom: 4px; }
.cat-tabs__link {
    padding: 6px 16px; border-radius: 20px; font-size: 0.82rem; font-weight: 500;
    white-space: nowrap; border: 1px solid #e5e7eb; color: #6b7280;
    background: #fff; transition: all 0.15s;
}
.cat-tabs__link:hover { border-color: #4361ee; color: #4361ee; }
.cat-tabs__link--active {
    background: #4361ee; color: #fff; border-color: #4361ee;
}

/* =========================
   SECTION HEADERS
   ========================= */
.section-header {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 16px; padding-bottom: 12px; border-bottom: 2px solid #1a1a2e;
}
.section-header__title { font-size: 1.1rem; font-weight: 700; }
.section-header__more { font-size: 0.8rem; color: #4361ee; font-weight: 500; }

/* =========================
   SIDEBAR
   ========================= */
.sidebar__section {
    background: #fff; border-radius: 10px; border: 1px solid #e5e7eb;
    padding: 20px; margin-bottom: 20px;
}
.sidebar__title {
    font-size: 0.9rem; font-weight: 700; margin-bottom: 12px;
    padding-bottom: 8px; border-bottom: 2px solid #4361ee;
}
.sidebar__cat-list { display: flex; flex-direction: column; gap: 2px; }
.sidebar__cat-link {
    display: flex; justify-content: space-between; align-items: center;
    padding: 8px 12px; border-radius: 6px; font-size: 0.85rem;
    transition: background 0.15s;
}
.sidebar__cat-link:hover { background: #f3f4f6; }
.sidebar__cat-link--active { background: #eef2ff; color: #4361ee; font-weight: 600; }
.sidebar__cat-count {
    font-size: 0.7rem; background: #f3f4f6; padding: 2px 8px;
    border-radius: 10px; color: #6b7280;
}
.sidebar__trending { counter-reset: trending; display: flex; flex-direction: column; gap: 2px; }
.sidebar__trending li { counter-increment: trending; }
.sidebar__trend-link {
    display: flex; gap: 12px; align-items: flex-start; padding: 8px 0;
    border-bottom: 1px solid #f3f4f6;
}
.sidebar__trend-rank {
    flex-shrink: 0; width: 24px; height: 24px; border-radius: 6px;
    background: #f3f4f6; color: #6b7280; font-size: 0.75rem; font-weight: 700;
    display: flex; align-items: center; justify-content: center;
}
.sidebar__trending li:nth-child(-n+3) .sidebar__trend-rank {
    background: #4361ee; color: #fff;
}
.sidebar__trend-source { font-size: 0.7rem; color: #9ca3af; display: block; }
.sidebar__trend-title { font-size: 0.82rem; font-weight: 500; line-height: 1.4; display: block; }

/* =========================
   PAGINATION
   ========================= */
.pagination {
    display: flex; justify-content: center; align-items: center;
    gap: 6px; margin: 24px 0 32px;
}
.pagination__link {
    padding: 8px 14px; border-radius: 6px; font-size: 0.85rem; font-weight: 500;
    border: 1px solid #e5e7eb; background: #fff; color: #4b5563; transition: all 0.15s;
}
.pagination__link:hover { border-color: #4361ee; color: #4361ee; }
.pagination__link--current {
    background: #4361ee; color: #fff; border-color: #4361ee;
}
.pagination__link--prev, .pagination__link--next { font-weight: 600; }
.pagination__dots { color: #9ca3af; padding: 0 4px; }

/* =========================
   BREADCRUMB
   ========================= */
.breadcrumb { margin: 16px 0 8px; }
.breadcrumb ol { display: flex; gap: 4px; flex-wrap: wrap; font-size: 0.8rem; color: #9ca3af; }
.breadcrumb__item + .breadcrumb__item::before { content: '/'; margin-right: 4px; }
.breadcrumb__item a { color: #6b7280; }
.breadcrumb__item a:hover { color: #4361ee; }
.breadcrumb__item--current { color: #4b5563; }

/* =========================
   ARTICLE DETAIL
   ========================= */
.article-detail { background: #fff; border-radius: 12px; border: 1px solid #e5e7eb; padding: 32px; margin-bottom: 24px; }
.article-detail__meta { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }
.article-detail__cat {
    background: #4361ee; color: #fff; padding: 3px 12px; border-radius: 4px;
    font-size: 0.75rem; font-weight: 600;
}
.article-detail__source { font-size: 0.8rem; color: #6b7280; font-weight: 500; }
.article-detail__date { font-size: 0.8rem; color: #9ca3af; }
.article-detail__lang {
    font-size: 0.65rem; font-weight: 700; color: #b45309; background: #fef3c7;
    padding: 2px 8px; border-radius: 3px;
}
.article-detail__title { font-size: 1.6rem; font-weight: 700; line-height: 1.45; margin-bottom: 8px; }
.article-detail__title-orig { font-size: 0.85rem; color: #9ca3af; margin-bottom: 20px; line-height: 1.4; }
.article-detail__hero-img { width: 100%; border-radius: 8px; margin-bottom: 24px; }
.article-detail__section { margin-bottom: 24px; }
.article-detail__section h2 {
    font-size: 0.9rem; font-weight: 600; color: #4361ee;
    margin-bottom: 10px; padding-bottom: 8px; border-bottom: 2px solid #eef2ff;
}
.article-detail__summary {
    font-size: 1rem; line-height: 1.9; color: #374151;
    background: #f8fafc; padding: 24px; border-radius: 8px; border-left: 4px solid #4361ee;
}

/* 3行要約 */
.summary-points { margin-bottom: 16px; }
.summary-point {
    padding: 10px 0;
    border-bottom: 1px solid #e5e7eb;
}
.summary-point:last-child { border-bottom: none; }
.summary-point__label {
    display: inline-block; font-size: 0.75rem; font-weight: 700; color: #4361ee;
    background: #eef2ff; padding: 3px 10px; border-radius: 4px; margin-bottom: 4px;
}
.summary-point__text { display: block; font-size: 0.95rem; line-height: 1.7; color: #1a1a2e; }

/* 補足 */
.summary-detail {
    font-size: 0.92rem; line-height: 1.9; color: #4b5563;
    padding-top: 4px;
}
.article-detail__description { font-size: 0.9rem; line-height: 1.8; color: #4b5563; }
.article-detail__actions { display: flex; gap: 12px; margin-top: 24px; padding-top: 20px; border-top: 1px solid #e5e7eb; flex-wrap: wrap; align-items: center; }

/* Buttons */
.btn {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 10px 20px; border-radius: 8px; font-size: 0.9rem;
    font-weight: 600; transition: opacity 0.15s;
}
.btn:hover { opacity: 0.85; }
.btn--primary { background: #4361ee; color: #fff; }
.btn--secondary { background: #f3f4f6; color: #374151; }

/* =========================
   SHARE BUTTONS
   ========================= */
.share-buttons { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.share-buttons__label { font-size: 0.8rem; color: #9ca3af; }
.share-btn {
    width: 36px; height: 36px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    transition: transform 0.15s, background 0.15s;
}
.share-btn:hover { transform: scale(1.1); }
.share-btn--x { background: #000; color: #fff; }
.share-btn--fb { background: #1877f2; color: #fff; }
.share-btn--line { background: #06c755; color: #fff; }

/* =========================
   AD SLOTS
   ========================= */
.ad-slot { min-height: 0; }
.ad-slot--header { text-align: center; padding: 8px 0; }
.ad-slot--sidebar { min-height: 250px; background: #f9fafb; border: 1px dashed #e5e7eb; border-radius: 8px; margin-top: 20px;
    display: flex; align-items: center; justify-content: center; font-size: 0.75rem; color: #d1d5db; }
.ad-slot--infeed { grid-column: 1 / -1; min-height: 100px; background: #f9fafb; border: 1px dashed #e5e7eb; border-radius: 8px;
    display: flex; align-items: center; justify-content: center; font-size: 0.75rem; color: #d1d5db; }

/* =========================
   SEARCH RESULTS
   ========================= */
.search-header { margin-bottom: 20px; }
.search-header__query { font-size: 1.2rem; font-weight: 700; }
.search-header__count { font-size: 0.85rem; color: #6b7280; margin-top: 4px; }

/* =========================
   STATIC PAGES
   ========================= */
.static-page { background: #fff; border-radius: 12px; border: 1px solid #e5e7eb; padding: 40px; margin: 24px 0; }
.static-page h1 { font-size: 1.5rem; margin-bottom: 24px; padding-bottom: 16px; border-bottom: 2px solid #e5e7eb; }
.static-page h2 { font-size: 1.1rem; margin: 24px 0 12px; color: #1a1a2e; }
.static-page p { margin-bottom: 16px; line-height: 1.8; color: #4b5563; }
.static-page ul { margin: 0 0 16px 24px; list-style: disc; }
.static-page li { margin-bottom: 6px; line-height: 1.7; color: #4b5563; }

/* =========================
   FOOTER
   ========================= */
.site-footer { background: #1a1a2e; color: #94a3b8; padding: 40px 0 24px; margin-top: auto; }
.site-footer__inner { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 40px; margin-bottom: 32px; }
.site-footer__logo { font-size: 1.2rem; font-weight: 700; color: #fff; display: block; margin-bottom: 8px; }
.site-footer__desc { font-size: 0.8rem; line-height: 1.6; }
.site-footer__links h4 { font-size: 0.8rem; font-weight: 600; color: #e5e7eb; margin-bottom: 12px; }
.site-footer__links a { display: block; font-size: 0.8rem; color: #94a3b8; padding: 3px 0; }
.site-footer__links a:hover { color: #fff; }
.site-footer__bottom { padding-top: 20px; border-top: 1px solid #2d2d4a; font-size: 0.75rem; }

/* =========================
   RESPONSIVE
   ========================= */
@media (max-width: 1023px) {
    .layout { grid-template-columns: 1fr; }
    .hero { grid-template-columns: 1fr; }
    .card--hero .card__image { height: 280px; }
    .hero .card--medium { display: none; }
    .article-grid { grid-template-columns: repeat(2, 1fr); }
    .site-footer__inner { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 767px) {
    .site-container { padding: 0 16px; }
    .site-nav { display: none; }
    .site-search { display: none; }
    .site-header__mobile-menu { display: flex; margin-left: auto; }
    .site-header__inner { gap: 12px; }

    /* Mobile nav overlay */
    .site-nav.is-open {
        display: flex; flex-direction: column; position: fixed;
        top: 60px; left: 0; right: 0; bottom: 0;
        background: #fff; padding: 20px; z-index: 300; gap: 8px;
    }
    .site-search.is-open {
        display: flex; position: absolute; top: 60px; left: 0; right: 0;
        padding: 12px 16px; background: #fff; border-bottom: 1px solid #e5e7eb; z-index: 250;
    }
    .site-search.is-open .site-search__input { width: 100%; }

    .card--hero .card__image { height: 220px; }
    .card--hero .card__title { font-size: 1.1rem; }
    .article-grid { grid-template-columns: 1fr; }
    .article-detail { padding: 20px; }
    .article-detail__title { font-size: 1.2rem; }
    .article-detail__actions { flex-direction: column; }
    .share-buttons { margin-left: 0; }
    .site-footer__inner { grid-template-columns: 1fr; gap: 24px; }
}

.site-catch {
    text-align: center;
    padding: 20px 10px 10px;
}

.site-catch__main {
    font-size: 1.2rem;
    font-weight: 600;
    color: #031d3b; /* 少し明るめ */
    margin: 0;
}

.site-catch__sub {
    font-size: 0.9rem;
    color: #203d5f; /* グレー */
    margin-top: 5px;
}