/*
 Theme Name:   南米おやじ Child Theme
 Theme URI:    https://nambei-oyaji.com
 Description:  GeneratePress子テーマ — TCD風ブログ + Apple風トップページ
 Author:       南米おやじ
 Author URI:   https://nambei-oyaji.com
 Template:     generatepress
 Version:      1.0.0
 License:      GNU General Public License v2 or later
 Text Domain:  nambei-oyaji-child
*/

/* ============================================
   0. CSS Variables
   ============================================ */
:root {
  --color-primary: #1a1a2e;
  --color-accent: #e94560;
  --color-accent-hover: #d63851;
  --color-bg: #f8f9fa;
  --color-card: #ffffff;
  --color-text: #333333;
  --color-text-light: #666666;
  --color-border: #e0e0e0;
  --color-gradient-start: #667eea;
  --color-gradient-end: #764ba2;
  --radius: 12px;
  --shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  --shadow-hover: 0 8px 30px rgba(0, 0, 0, 0.15);
  --transition: 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  --max-width: 1200px;
  --content-width: 780px;
  --sidebar-width: 340px;
}

/* ============================================
   1. Reset & Base
   ============================================ */
*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  font-family: "Noto Sans JP", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--color-text);
  background: var(--color-bg);
  line-height: 1.8;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--color-accent);
  text-decoration: none;
  transition: color var(--transition);
}

a:hover {
  color: var(--color-accent-hover);
}

img {
  max-width: 100%;
  height: auto;
}

/* ============================================
   2. Header
   ============================================ */
.site-header {
  background: var(--color-primary);
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 70px;
}

.site-logo a {
  font-size: 1.5rem;
  font-weight: 900;
  color: #fff;
  letter-spacing: 0.05em;
}

.site-logo .logo-accent {
  background: linear-gradient(135deg, var(--color-gradient-start), var(--color-gradient-end));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Navigation */
.nav-primary ul {
  list-style: none;
  display: flex;
  gap: 28px;
  margin: 0;
  padding: 0;
}

.nav-primary a {
  color: rgba(255, 255, 255, 0.85);
  font-size: 0.9rem;
  font-weight: 500;
  padding: 8px 0;
  position: relative;
}

.nav-primary a::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--color-accent);
  transition: width var(--transition);
}

.nav-primary a:hover {
  color: #fff;
}

.nav-primary a:hover::after {
  width: 100%;
}

/* Hamburger */
.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
}

.hamburger span {
  display: block;
  width: 24px;
  height: 2px;
  background: #fff;
  transition: var(--transition);
}

.hamburger.active span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}

.hamburger.active span:nth-child(2) {
  opacity: 0;
}

.hamburger.active span:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
}

/* Breadcrumb */
.breadcrumb {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 12px 20px;
  font-size: 0.8rem;
  color: var(--color-text-light);
}

.breadcrumb a {
  color: var(--color-text-light);
}

.breadcrumb .separator {
  margin: 0 8px;
}

/* ============================================
   3. Two-Column Layout (TCD Style)
   ============================================ */
.site-content {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 30px 20px;
  display: grid;
  grid-template-columns: 1fr var(--sidebar-width);
  gap: 40px;
}

.site-content.full-width {
  display: block;
  max-width: 100%;
  padding: 0;
}

/* ============================================
   4. Article Card Grid (Index/Archive)
   ============================================ */
.article-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}

.article-card {
  background: var(--color-card);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform var(--transition), box-shadow var(--transition);
}

.article-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
}

.article-card__thumb {
  aspect-ratio: 16 / 9;
  overflow: hidden;
}

.article-card__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition);
}

.article-card:hover .article-card__thumb img {
  transform: scale(1.05);
}

.article-card__body {
  padding: 20px;
}

.article-card__cat {
  display: inline-block;
  background: var(--color-accent);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 20px;
  margin-bottom: 8px;
}

.article-card__title {
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.5;
  margin: 0 0 10px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.article-card__meta {
  font-size: 0.78rem;
  color: var(--color-text-light);
}

/* ============================================
   5. Single Article (TCD Blog Style)
   ============================================ */
.single-article {
  background: var(--color-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.single-article__header {
  padding: 40px 40px 0;
}

.single-article__cat {
  display: inline-block;
  background: var(--color-accent);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 4px 14px;
  border-radius: 20px;
  margin-bottom: 16px;
}

.single-article__title {
  font-size: 1.8rem;
  font-weight: 900;
  line-height: 1.4;
  margin: 0 0 16px;
}

.single-article__meta {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 0.82rem;
  color: var(--color-text-light);
  padding-bottom: 20px;
  border-bottom: 1px solid var(--color-border);
}

.single-article__eyecatch {
  margin: 0;
}

.single-article__eyecatch img {
  width: 100%;
  display: block;
}

.single-article__content {
  padding: 40px;
  font-size: 1rem;
  line-height: 2;
}

.single-article__content h2 {
  font-size: 1.5rem;
  font-weight: 800;
  margin: 48px 0 20px;
  padding-bottom: 12px;
  border-bottom: 3px solid var(--color-accent);
}

.single-article__content h3 {
  font-size: 1.25rem;
  font-weight: 700;
  margin: 36px 0 16px;
  padding-left: 14px;
  border-left: 4px solid var(--color-accent);
}

.single-article__content p {
  margin: 0 0 24px;
}

.single-article__content blockquote {
  margin: 24px 0;
  padding: 20px 24px;
  background: #f5f5f5;
  border-left: 4px solid var(--color-accent);
  border-radius: 0 var(--radius) var(--radius) 0;
}

.single-article__content ul,
.single-article__content ol {
  margin: 0 0 24px;
  padding-left: 24px;
}

.single-article__content li {
  margin-bottom: 8px;
}

/* TOC */
.toc-wrap {
  background: #f8f9fb;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 24px;
  margin: 24px 0 32px;
}

.toc-wrap__title {
  font-size: 1rem;
  font-weight: 700;
  margin: 0 0 12px;
  text-align: center;
}

.toc-wrap ol {
  margin: 0;
  padding-left: 20px;
}

.toc-wrap li {
  margin-bottom: 6px;
  font-size: 0.9rem;
}

.toc-wrap a {
  color: var(--color-text);
}

.toc-wrap a:hover {
  color: var(--color-accent);
}

/* Author Box */
.author-box {
  display: flex;
  gap: 20px;
  padding: 30px 40px;
  background: #f8f9fb;
  border-top: 1px solid var(--color-border);
}

.author-box__avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.author-box__name {
  font-size: 1rem;
  font-weight: 700;
  margin: 0 0 8px;
}

.author-box__bio {
  font-size: 0.85rem;
  color: var(--color-text-light);
  line-height: 1.7;
  margin: 0;
}

/* Share Buttons */
.share-buttons {
  display: flex;
  gap: 10px;
  padding: 20px 40px;
  border-top: 1px solid var(--color-border);
}

.share-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 0.82rem;
  font-weight: 600;
  color: #fff;
  transition: opacity var(--transition);
}

.share-btn:hover {
  opacity: 0.8;
  color: #fff;
}

.share-btn--x { background: #000; }
.share-btn--fb { background: #1877f2; }
.share-btn--line { background: #06c755; }
.share-btn--hatena { background: #00a4de; }

/* Related Posts */
.related-posts {
  margin-top: 40px;
}

.related-posts__title {
  font-size: 1.3rem;
  font-weight: 800;
  margin: 0 0 20px;
  padding-bottom: 10px;
  border-bottom: 3px solid var(--color-primary);
}

.related-posts__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.related-card {
  background: var(--color-card);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform var(--transition);
}

.related-card:hover {
  transform: translateY(-3px);
}

.related-card__thumb {
  aspect-ratio: 16 / 9;
  overflow: hidden;
}

.related-card__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.related-card__title {
  padding: 12px;
  font-size: 0.85rem;
  font-weight: 600;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ============================================
   6. Sidebar
   ============================================ */
.sidebar {
  position: sticky;
  top: 90px;
  align-self: start;
}

.sidebar-widget {
  background: var(--color-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px;
  margin-bottom: 24px;
}

.sidebar-widget__title {
  font-size: 1rem;
  font-weight: 800;
  margin: 0 0 16px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--color-primary);
}

/* Search */
.search-form {
  display: flex;
}

.search-form input[type="search"] {
  flex: 1;
  border: 1px solid var(--color-border);
  border-right: none;
  border-radius: var(--radius) 0 0 var(--radius);
  padding: 10px 14px;
  font-size: 0.9rem;
  outline: none;
}

.search-form button {
  background: var(--color-accent);
  color: #fff;
  border: none;
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 10px 16px;
  cursor: pointer;
  font-size: 0.9rem;
}

/* Tab */
.tab-nav {
  display: flex;
  border-bottom: 2px solid var(--color-border);
  margin-bottom: 16px;
}

.tab-nav__btn {
  flex: 1;
  background: none;
  border: none;
  padding: 10px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  color: var(--color-text-light);
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: var(--transition);
}

.tab-nav__btn.active {
  color: var(--color-accent);
  border-bottom-color: var(--color-accent);
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
}

.sidebar-post-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.sidebar-post-item {
  display: flex;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid #f0f0f0;
}

.sidebar-post-item:last-child {
  border-bottom: none;
}

.sidebar-post-item__thumb {
  width: 80px;
  height: 56px;
  border-radius: 6px;
  overflow: hidden;
  flex-shrink: 0;
}

.sidebar-post-item__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.sidebar-post-item__title {
  font-size: 0.82rem;
  font-weight: 600;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Category List */
.category-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.category-list li {
  border-bottom: 1px solid #f0f0f0;
}

.category-list li:last-child {
  border-bottom: none;
}

.category-list a {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  color: var(--color-text);
  font-size: 0.9rem;
}

.category-list a:hover {
  color: var(--color-accent);
}

.category-list .count {
  background: #f0f0f0;
  font-size: 0.75rem;
  padding: 2px 8px;
  border-radius: 10px;
}

/* ============================================
   7. Footer
   ============================================ */
.site-footer {
  background: var(--color-primary);
  color: rgba(255, 255, 255, 0.7);
  margin-top: 60px;
}

.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 50px 20px 30px;
}

.footer-columns {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 40px;
  margin-bottom: 40px;
}

.footer-column__title {
  color: #fff;
  font-size: 1rem;
  font-weight: 700;
  margin: 0 0 16px;
}

.footer-column ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer-column li {
  margin-bottom: 8px;
}

.footer-column a {
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.85rem;
}

.footer-column a:hover {
  color: #fff;
}

.footer-sns {
  display: flex;
  gap: 16px;
  margin-top: 12px;
}

.footer-sns a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  color: rgba(255, 255, 255, 0.7);
  font-size: 1.1rem;
  transition: background var(--transition);
}

.footer-sns a:hover {
  background: var(--color-accent);
  color: #fff;
}

.footer-bottom {
  text-align: center;
  padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 0.8rem;
}

/* ============================================
   8. Front Page (Apple Style)
   ============================================ */

/* Hero */
.fp-hero {
  background: linear-gradient(160deg, #0a0a1a 0%, #1a1a3e 50%, #0a0a1a 100%);
  min-height: 80vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 100px 20px;
  position: relative;
  overflow: hidden;
}

.fp-hero::before {
  content: "";
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle at 30% 50%, rgba(102, 126, 234, 0.15) 0%, transparent 50%),
              radial-gradient(circle at 70% 50%, rgba(118, 75, 162, 0.15) 0%, transparent 50%);
  animation: heroGlow 8s ease-in-out infinite alternate;
}

@keyframes heroGlow {
  from { transform: rotate(0deg); }
  to { transform: rotate(3deg); }
}

.fp-hero__inner {
  position: relative;
  z-index: 1;
  max-width: 800px;
}

.fp-hero__subtitle {
  font-size: 1rem;
  color: rgba(255, 255, 255, 0.5);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  margin-bottom: 20px;
}

.fp-hero__title {
  font-size: clamp(2.5rem, 6vw, 4rem);
  font-weight: 900;
  line-height: 1.2;
  margin: 0 0 24px;
  background: linear-gradient(135deg, #fff 0%, #667eea 50%, #764ba2 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.fp-hero__desc {
  font-size: 1.15rem;
  color: rgba(255, 255, 255, 0.65);
  line-height: 1.8;
  margin-bottom: 36px;
}

.fp-hero__btn {
  display: inline-block;
  background: linear-gradient(135deg, var(--color-gradient-start), var(--color-gradient-end));
  color: #fff;
  padding: 14px 40px;
  border-radius: 50px;
  font-weight: 700;
  font-size: 1rem;
  transition: transform var(--transition), box-shadow var(--transition);
}

.fp-hero__btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
  color: #fff;
}

/* Section Common */
.fp-section {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 80px 20px;
}

.fp-section__label {
  font-size: 0.85rem;
  color: var(--color-accent);
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.fp-section__heading {
  font-size: 2rem;
  font-weight: 900;
  margin: 0 0 40px;
}

/* Featured Cards */
.fp-featured-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.fp-featured-card {
  background: var(--color-card);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform var(--transition), box-shadow var(--transition);
}

.fp-featured-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-hover);
}

.fp-featured-card__thumb {
  aspect-ratio: 16 / 9;
  overflow: hidden;
}

.fp-featured-card__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.fp-featured-card:hover .fp-featured-card__thumb img {
  transform: scale(1.08);
}

.fp-featured-card__body {
  padding: 24px;
}

.fp-featured-card__cat {
  display: inline-block;
  background: linear-gradient(135deg, var(--color-gradient-start), var(--color-gradient-end));
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 3px 12px;
  border-radius: 20px;
  margin-bottom: 10px;
}

.fp-featured-card__title {
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.5;
  margin: 0 0 12px;
}

.fp-featured-card__excerpt {
  font-size: 0.85rem;
  color: var(--color-text-light);
  line-height: 1.7;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Category Pillars */
.fp-pillars {
  background: var(--color-primary);
  padding: 80px 20px;
}

.fp-pillars__inner {
  max-width: var(--max-width);
  margin: 0 auto;
}

.fp-pillars .fp-section__label {
  color: rgba(255, 255, 255, 0.5);
}

.fp-pillars .fp-section__heading {
  color: #fff;
}

.fp-pillars-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 30px;
}

.fp-pillar-card {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius);
  padding: 40px;
  transition: background var(--transition), border-color var(--transition);
}

.fp-pillar-card:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.2);
}

.fp-pillar-card__icon {
  font-size: 2.5rem;
  margin-bottom: 16px;
}

.fp-pillar-card__title {
  color: #fff;
  font-size: 1.3rem;
  font-weight: 800;
  margin: 0 0 12px;
}

.fp-pillar-card__desc {
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.9rem;
  line-height: 1.7;
  margin: 0;
}

/* Scroll Animation */
.scroll-fade {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.scroll-fade.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* Scroll-to-top */
.scroll-top {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 48px;
  height: 48px;
  background: var(--color-accent);
  color: #fff;
  border: none;
  border-radius: 50%;
  font-size: 1.2rem;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--transition), visibility var(--transition), transform var(--transition);
  box-shadow: 0 4px 15px rgba(233, 69, 96, 0.4);
  z-index: 999;
}

.scroll-top.visible {
  opacity: 1;
  visibility: visible;
}

.scroll-top:hover {
  transform: translateY(-3px);
}

/* ============================================
   9. Pagination
   ============================================ */
.pagination {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 40px;
}

.pagination .page-numbers {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--color-text);
  background: var(--color-card);
  box-shadow: var(--shadow);
  transition: var(--transition);
}

.pagination .page-numbers.current,
.pagination .page-numbers:hover {
  background: var(--color-accent);
  color: #fff;
}

/* ============================================
   10. Archive Header
   ============================================ */
.archive-header {
  margin-bottom: 30px;
}

.archive-header__title {
  font-size: 1.5rem;
  font-weight: 800;
  margin: 0;
}

.archive-header__desc {
  color: var(--color-text-light);
  font-size: 0.9rem;
  margin-top: 8px;
}

/* ============================================
   11. Responsive
   ============================================ */
@media (max-width: 1024px) {
  .site-content {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
  }

  .fp-featured-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .related-posts__grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .hamburger {
    display: flex;
  }

  .nav-primary {
    display: none;
    position: absolute;
    top: 70px;
    left: 0;
    right: 0;
    background: var(--color-primary);
    padding: 20px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  }

  .nav-primary.open {
    display: block;
  }

  .nav-primary ul {
    flex-direction: column;
    gap: 0;
  }

  .nav-primary a {
    display: block;
    padding: 12px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  }

  .article-grid,
  .fp-featured-grid {
    grid-template-columns: 1fr;
  }

  .fp-pillars-grid {
    grid-template-columns: 1fr;
  }

  .related-posts__grid {
    grid-template-columns: 1fr;
  }

  .footer-columns {
    grid-template-columns: 1fr;
    gap: 30px;
  }

  .single-article__header,
  .single-article__content,
  .share-buttons,
  .author-box {
    padding-left: 20px;
    padding-right: 20px;
  }

  .single-article__title {
    font-size: 1.4rem;
  }

  .fp-hero {
    min-height: 60vh;
    padding: 60px 20px;
  }

  .fp-hero__title {
    font-size: 2rem;
  }
}
