/**
 * Kitsune Default Stylesheet
 * クリーンで読みやすいデフォルト。クライアントCSSで上書き可能。
 */

/* ============================================================
   Reset & Base
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans JP", sans-serif;
  line-height: 1.7;
  color: #333;
  background: #fff;
}

a { color: #0066cc; text-decoration: none; }
a:hover { text-decoration: underline; }

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

/* ============================================================
   Site Structure
   ============================================================ */
.kitsune-site {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.kitsune-content {
  flex: 1;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
}

/* ============================================================
   Header
   ============================================================ */
.kitsune-header {
  background: #fff;
  border-bottom: 1px solid #e5e5e5;
  position: sticky;
  top: 0;
  z-index: 100;
}

.kitsune-header-image {
  width: 100%;
  overflow: hidden;
  max-height: 400px;
}

.kitsune-header-image img {
  width: 100%;
  height: auto;
  object-fit: cover;
}

.kitsune-branding {
  padding: 1rem 1.5rem;
  text-align: center;
}

.kitsune-logo-link {
  display: inline-block;
  color: inherit;
}

.kitsune-logo-link:hover { text-decoration: none; }

.kitsune-logo {
  max-height: 60px;
  width: auto;
  display: inline-block;
}

.kitsune-site-title {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.kitsune-site-description {
  font-size: 0.85rem;
  color: #666;
  margin-top: 0.25rem;
}

/* ============================================================
   Navigation
   ============================================================ */
.kitsune-nav {
  border-top: 1px solid #f0f0f0;
  padding: 0 1.5rem;
}

.kitsune-menu-toggle {
  display: none;
  width: 100%;
  padding: 0.75rem;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1rem;
  color: #333;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.kitsune-menu {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0;
}

.kitsune-menu-item a {
  display: block;
  padding: 0.75rem 1rem;
  color: #333;
  font-size: 0.9rem;
  transition: background 0.15s;
}

.kitsune-menu-item a:hover {
  background: #f5f5f5;
  text-decoration: none;
}

/* ============================================================
   Content Layout
   ============================================================ */
.kitsune-main {
  width: 100%;
}

.kitsune-has-sidebar {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 2rem;
}

.kitsune-has-sidebar .kitsune-main {
  min-width: 0;
}

/* ============================================================
   Entry (Article)
   ============================================================ */
.kitsune-entry {
  margin-bottom: 3rem;
}

.kitsune-entry-header {
  margin-bottom: 1.5rem;
}

.kitsune-entry-title {
  font-size: 1.8rem;
  line-height: 1.3;
  font-weight: 700;
}

.kitsune-entry-title a {
  color: inherit;
}

.kitsune-entry-title a:hover {
  color: #0066cc;
  text-decoration: none;
}

.kitsune-entry-meta {
  margin-top: 0.5rem;
  font-size: 0.85rem;
  color: #888;
}

.kitsune-entry-thumbnail {
  margin-bottom: 1.5rem;
  border-radius: 4px;
  overflow: hidden;
}

.kitsune-entry-content {
  font-size: 1rem;
  line-height: 1.8;
}

.kitsune-entry-content h1,
.kitsune-entry-content h2,
.kitsune-entry-content h3,
.kitsune-entry-content h4 {
  margin-top: 2rem;
  margin-bottom: 0.75rem;
  font-weight: 700;
  line-height: 1.3;
}

.kitsune-entry-content h2 { font-size: 1.4rem; }
.kitsune-entry-content h3 { font-size: 1.2rem; }
.kitsune-entry-content h4 { font-size: 1.05rem; }

.kitsune-entry-content p {
  margin-bottom: 1rem;
}

.kitsune-entry-content ul,
.kitsune-entry-content ol {
  margin: 1rem 0;
  padding-left: 1.5rem;
}

.kitsune-entry-content li {
  margin-bottom: 0.25rem;
}

.kitsune-entry-content blockquote {
  margin: 1.5rem 0;
  padding: 1rem 1.5rem;
  border-left: 4px solid #ddd;
  color: #555;
  background: #fafafa;
}

.kitsune-entry-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0;
}

.kitsune-entry-content th,
.kitsune-entry-content td {
  padding: 0.5rem 0.75rem;
  border: 1px solid #ddd;
  text-align: left;
}

.kitsune-entry-content th {
  background: #f5f5f5;
  font-weight: 600;
}

.kitsune-entry-footer {
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid #eee;
  font-size: 0.85rem;
  color: #888;
}

.kitsune-entry-footer a {
  color: #666;
}

/* ============================================================
   Page Header (archive / category / tag)
   ============================================================ */
.kitsune-page-header {
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 2px solid #333;
}

.kitsune-page-title {
  font-size: 1.5rem;
  font-weight: 700;
}

/* ============================================================
   Sidebar
   ============================================================ */
.kitsune-sidebar {
  font-size: 0.9rem;
}

.kitsune-widget {
  margin-bottom: 2rem;
}

.kitsune-widget-title {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid #333;
}

.kitsune-widget ul {
  list-style: none;
}

.kitsune-widget li {
  padding: 0.4rem 0;
  border-bottom: 1px solid #f0f0f0;
}

.kitsune-widget li a {
  color: #333;
}

.kitsune-widget .post-date {
  display: block;
  font-size: 0.8rem;
  color: #999;
}

.kitsune-tagcloud {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.kitsune-tagcloud a {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  background: #f0f0f0;
  border-radius: 3px;
  font-size: 0.8rem;
  color: #555;
}

.kitsune-tagcloud a:hover {
  background: #e0e0e0;
  text-decoration: none;
}

/* ============================================================
   Pagination
   ============================================================ */
.kitsune-pagination {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
  margin-top: 2rem;
}

.kitsune-pagination a,
.kitsune-pagination span {
  display: inline-block;
  padding: 0.5rem 0.75rem;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 0.9rem;
  color: #333;
}

.kitsune-pagination .is-current {
  background: #333;
  color: #fff;
  border-color: #333;
}

.kitsune-pagination a:hover {
  background: #f5f5f5;
  text-decoration: none;
}

/* ============================================================
   Search Form
   ============================================================ */
.kitsune-search-form {
  display: flex;
  gap: 0.5rem;
}

.kitsune-search-input {
  flex: 1;
  padding: 0.5rem 0.75rem;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 0.9rem;
}

.kitsune-search-submit {
  padding: 0.5rem 1rem;
  background: #333;
  color: #fff;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.9rem;
}

.kitsune-search-submit:hover { background: #555; }

/* ============================================================
   Footer
   ============================================================ */
.kitsune-footer {
  background: #f8f8f8;
  border-top: 1px solid #e5e5e5;
  padding: 2rem 1.5rem;
  margin-top: auto;
}

.kitsune-footer-inner {
  max-width: 1200px;
  margin: 0 auto;
}

.kitsune-footer-nav {
  margin-bottom: 1.5rem;
}

.kitsune-footer-menu {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.25rem 1rem;
}

.kitsune-footer-menu a {
  font-size: 0.85rem;
  color: #555;
}

.kitsune-footer-widgets {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

.kitsune-footer-widget h3 {
  font-size: 0.9rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.kitsune-footer-widget {
  font-size: 0.85rem;
  color: #666;
}

.kitsune-social {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-bottom: 1rem;
}

.kitsune-social-link {
  display: inline-block;
  padding: 0.4rem 0.8rem;
  background: #999;
  color: #fff !important;
  border-radius: 3px;
  font-size: 0.8rem;
}

.kitsune-social-link:hover {
  background: #666;
  text-decoration: none;
}

.kitsune-copyright {
  text-align: center;
  font-size: 0.8rem;
  color: #999;
}

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 768px) {
  .kitsune-menu-toggle {
    display: flex;
  }

  .kitsune-menu {
    display: none;
    flex-direction: column;
  }

  .kitsune-menu.is-open {
    display: flex;
  }

  .kitsune-menu-item a {
    padding: 0.6rem 0;
    border-bottom: 1px solid #f0f0f0;
  }

  .kitsune-has-sidebar {
    grid-template-columns: 1fr;
  }

  .kitsune-entry-title {
    font-size: 1.4rem;
  }
}
