/*
Theme Name: Video Affiliate Minimal
Theme URI: https://example.com/
Author: Codex
Author URI: https://example.com/
Description: 動画紹介とアフィリエイト導線に特化した、シンプルなWordPressテーマです。
Version: 1.1.0
Requires at least: 6.0
Tested up to: 6.7
Requires PHP: 7.4
Text Domain: video-affiliate-minimal
*/

:root {
  --bg: #f7f1e8;
  --surface: #fffaf3;
  --surface-strong: #fff;
  --text: #231815;
  --muted: #6f6157;
  --line: #dbcdbf;
  --accent: #bc4b31;
  --accent-strong: #8b2f1b;
  --chip: #efe3d5;
  --shadow: 0 12px 30px rgba(35, 24, 21, 0.05);
  --radius: 8px;
  --max: 1120px;
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background:
    radial-gradient(circle at top left, rgba(188, 75, 49, 0.12), transparent 30%),
    linear-gradient(180deg, #fbf6ef 0%, var(--bg) 100%);
  color: var(--text);
  font-family: "Hiragino Sans", "Yu Gothic", sans-serif;
  line-height: 1.5;
}

p, ul, ol {
  margin: 0 0 12px 0;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

.site-shell {
  min-height: 100vh;
}

.site-header,
.site-main,
.site-footer {
  width: min(calc(100% - 32px), var(--max));
  margin: 0 auto;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 24px 0 20px;
}

.site-branding h1,
.site-branding p {
  margin: 0;
}

.site-branding h1 {
  font-size: clamp(1.35rem, 3vw, 2rem);
  line-height: 1.2;
}

.site-branding p {
  color: var(--muted);
  font-size: 0.95rem;
  margin-top: 6px;
}

.header-nav {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.header-link,
.tag-chip,
.meta-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border-radius: 4px;
  padding: 4px 8px;
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.8rem;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(280px, 0.85fr);
  gap: 24px;
  padding: 10px 0 36px;
}

.panel {
  background: rgba(255, 250, 243, 0.92);
  border: 1px solid rgba(219, 205, 191, 0.85);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.hero-copy,
.hero-featured,
.section-block,
.entry-card,
.single-entry,
.archive-header,
.empty-state {
  padding: 16px 20px;
}

.eyebrow {
  display: inline-block;
  margin-bottom: 10px;
  color: var(--accent);
  font-weight: 700;
  letter-spacing: 0.08em;
  font-size: 0.78rem;
}

.hero h2,
.section-title,
.entry-title,
.single-title,
.archive-title {
  margin: 0;
  line-height: 1.25;
}

.hero h2 {
  font-size: clamp(2rem, 5vw, 3.5rem);
}

.hero p {
  margin: 14px 0 0;
  color: var(--muted);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 24px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 12px;
  border-radius: 4px;
  border: 1px solid transparent;
  font-weight: 700;
  font-size: 0.85rem;
  line-height: 1.2;
  transition: transform 0.2s ease, background 0.2s ease;
}

.button:hover {
  transform: translateY(-1px);
}

.button-primary {
  background: var(--accent);
  color: #fff;
}

.button-primary:hover {
  background: var(--accent-strong);
}

.button-secondary {
  background: transparent;
  border-color: var(--line);
}

.hero-featured .featured-label,
.card-label {
  color: var(--accent);
  font-size: 0.82rem;
  font-weight: 700;
}

.featured-title,
.entry-title {
  margin-top: 10px;
  font-size: clamp(1.3rem, 3vw, 1.7rem);
}

.featured-excerpt,
.entry-excerpt,
.single-summary {
  color: var(--muted);
}

.featured-meta,
.entry-meta,
.single-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.site-main section + section,
.site-main article + article,
.site-main .archive-loop {
  margin-top: 28px;
}

.section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.section-note {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.tag-cloud,
.entry-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.post-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.entry-card {
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.entry-card.has-thumb {
  padding-top: 0;
  overflow: hidden;
}

.entry-card img {
  aspect-ratio: 16 / 9;
  object-fit: cover;
  width: 100%;
}

.entry-card-body {
  padding: 14px 16px 16px;
}

.price-text {
  margin-top: 12px;
  color: var(--accent-strong);
  font-weight: 700;
}

.single-entry {
  background: rgba(255, 255, 255, 0.86);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.single-thumbnail {
  margin: 16px auto;
  border-radius: 6px;
  overflow: hidden;
  max-width: 500px;
}

.single-thumbnail img {
  width: 100%;
}

.affiliate-box {
  margin: 20px 0;
  padding: 16px;
  border-radius: 8px;
  background: #f4e6d8;
  border: 1px solid #e2c9b2;
}

.affiliate-box p {
  margin: 0 0 14px;
}

.content-body > *:first-child {
  margin-top: 0;
}

.content-body > *:last-child {
  margin-bottom: 0;
}

.site-footer {
  padding: 28px 0 40px;
  color: var(--muted);
  font-size: 0.92rem;
}

.footer-panel {
  padding: 18px 22px;
}

.notice-list {
  margin: 0;
  padding-left: 18px;
}

.archive-loop {
  display: grid;
  gap: 18px;
}

.ranking-list {
  counter-reset: ranking;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.ranking-list .compact-card {
  position: relative;
  background: rgba(255, 255, 255, 0.6);
  border-color: rgba(219, 205, 191, 0.5);
}
.ranking-list .compact-card::before {
  counter-increment: ranking;
  content: counter(ranking);
  position: absolute;
  top: -8px;
  left: -8px;
  width: 26px;
  height: 26px;
  background: var(--accent);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 0.85rem;
  z-index: 10;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}
.ranking-list .compact-card:nth-child(1)::before { background: #d4af37; } /* Gold */
.ranking-list .compact-card:nth-child(2)::before { background: #c0c0c0; color: #333; } /* Silver */
.ranking-list .compact-card:nth-child(3)::before { background: #cd7f32; } /* Bronze */

.search-form {
  display: flex;
  gap: 8px;
  margin-top: 18px;
}

.search-field {
  flex: 1;
  min-height: 30px;
  padding: 4px 10px;
  border-radius: 4px;
  border: 1px solid var(--line);
  background: #fff;
  font-size: 0.85rem;
}

.screen-reader-text {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.compact-card {
  display: flex !important;
  flex-direction: row;
  gap: 16px;
  padding: 12px !important;
  align-items: center;
}
.compact-thumb {
  flex-shrink: 0;
  width: 120px;
  aspect-ratio: 16 / 9;
  border-radius: 4px;
  overflow: hidden;
  background: #eee;
}
.compact-thumb img, .compact-thumb-placeholder {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.compact-thumb-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  color: #aaa;
  text-decoration: none;
}
.compact-body {
  flex-grow: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-width: 0; /* allows text truncation */
}
.compact-title {
  margin: 0 !important;
  font-size: 1.05rem !important;
  line-height: 1.4 !important;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.compact-button {
  flex-shrink: 0;
  white-space: nowrap;
  padding: 6px 14px;
}

@media (max-width: 640px) {
  .compact-card {
    align-items: stretch;
  }
  .compact-thumb {
    width: 90px;
  }
  .compact-body {
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: 8px;
  }
  .compact-title {
    font-size: 0.95rem !important;
  }
}

@media (max-width: 960px) {
  .hero,
  .post-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .site-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .hero-copy,
  .hero-featured,
  .section-block,
  .entry-card,
  .single-entry,
  .archive-header,
  .empty-state {
    padding: 14px;
  }

  .entry-card-body {
    padding: 12px;
  }

  .search-form {
    flex-direction: column;
  }
}
