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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Hiragino Kaku Gothic ProN", "Hiragino Sans", Meiryo, sans-serif;
  line-height: 1.8;
  color: #333;
  background-color: #F8F7F2;
  font-size: 16px;
  max-width: 680px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
}

/* ========================================
   Layout
   ======================================== */
header {
  margin-bottom: 3rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid #e5e5e5;
}

main {
  margin-bottom: 4rem;
}

footer {
  margin-top: 4rem;
  padding-top: 2rem;
  border-top: 1px solid #e5e5e5;
  text-align: center;
  font-size: 0.9rem;
  color: #888;
}

/* ========================================
   Navigation
   ======================================== */
nav {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
}

nav a {
  color: #666;
  font-size: 0.95rem;
  text-decoration: underline;
  text-decoration-style: dotted;
  text-decoration-color: rgba(102, 102, 102, 0.4);
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
  transition: color 0.2s, text-decoration-color 0.2s;
}

nav a:hover {
  color: #333;
  text-decoration-color: rgba(51, 51, 51, 0.6);
}

/* ========================================
   Typography
   ======================================== */
main > h1 {
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 1rem;
  color: #222;
}

article {
  margin-bottom: 1rem;
}

.post-icon {
  margin-bottom: 0.4rem;
}

.post-icon-text {
  font-size: 2rem;
  line-height: 1;
  display: inline-block;
}

article h1 {
  font-size: 1.75rem;
  font-weight: 600;
  line-height: 1.4;
  margin-bottom: 0.5rem;
  color: #222;
}

article time {
  display: block;
  font-size: 0.9rem;
  color: #888;
  margin-bottom: 1.5rem;
}

/* Content Typography */
.content {
  font-size: 1rem;
  line-height: 1.9;
}

.content h1,
.content h2,
.content h3,
.content h4,
.content h5,
.content h6 {
  margin-top: 2rem;
  margin-bottom: 1rem;
  font-weight: 600;
  line-height: 1.4;
  color: #222;
}

.content h1 { font-size: 1.5rem; }
.content h2 { font-size: 1.3rem; }
.content h3 { font-size: 1.15rem; }

.content p {
  margin-bottom: 1.5rem;
}

.content ul,
.content ol {
  margin-bottom: 1.5rem;
  padding-left: 1.5rem;
}

.content li {
  margin-bottom: 0.5rem;
}

.content blockquote {
  border-left: 3px solid #ddd;
  padding-left: 1rem;
  margin-left: 0;
  margin-bottom: 1.5rem;
  color: #666;
}

.content hr {
  border: none;
  border-top: 1px solid #e5e5e5;
  margin: 2rem 0;
}

.content code {
  font-family: "SF Mono", Monaco, "Cascadia Code", "Roboto Mono", Consolas, "Courier New", monospace;
  font-size: 0.9em;
  background-color: #f5f5f5;
  padding: 0.2em 0.4em;
  border-radius: 3px;
}

.content pre {
  background-color: #f5f5f5;
  padding: 1rem;
  border-radius: 4px;
  overflow-x: auto;
  margin-bottom: 1.5rem;
}

.content pre code {
  background-color: transparent;
  padding: 0;
}

.content img {
  max-width: 100%;
  height: auto;
  margin: 1.5rem 0;
  border-radius: 4px;
}

/* ========================================
   Links (Common Styles)
   ======================================== */
.content a {
  color: #0066cc;
  text-decoration: underline;
  text-decoration-style: dotted;
  text-decoration-color: #0066cc;
  text-decoration-thickness: 1px;
  text-underline-offset: 5px;
  transition: text-decoration-color 0.2s, color 0.2s;
}

.content a:hover {
  color: #0052a3;
  text-decoration-color: #0052a3;
}

/* List Links (共通スタイル) */
.post-list article h2 a,
.recent-posts-list a,
.note-posts-list a {
  color: #222;
  text-decoration: underline;
  text-decoration-style: dotted;
  text-decoration-color: rgba(34, 34, 34, 0.3);
  text-decoration-thickness: 1px;
  text-underline-offset: 5px;
  font-size: 1.1rem;
  transition: color 0.2s, text-decoration-color 0.2s;
}

.post-list article h2 a:hover,
.recent-posts-list a:hover,
.note-posts-list a:hover {
  color: #0066cc;
  text-decoration-color: #0066cc;
}

.more-link a {
  color: #666;
  text-decoration: underline;
  text-decoration-style: dotted;
  text-decoration-color: rgba(102, 102, 102, 0.4);
  text-decoration-thickness: 1px;
  text-underline-offset: 5px;
  font-size: 1rem;
  transition: color 0.2s, text-decoration-color 0.2s;
}

.more-link a:hover {
  color: #0066cc;
  text-decoration-color: #0066cc;
}

/* ========================================
   Components
   ======================================== */

/* Link Card */
.link-card {
  margin: 1.5rem 0;
  border: 1px solid #e5e5e5;
  border-radius: 8px;
  background-color: #fff;
  overflow: hidden;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.link-card:hover {
  border-color: #ccc;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.link-card-content {
  display: flex;
  align-items: stretch;
  text-decoration: none;
  color: inherit;
}

.link-card-image {
  width: 120px;
  min-width: 120px;
  min-height: 120px;
  height: auto;
  align-self: stretch;
  overflow: hidden;
  background-color: #fff;
  flex-shrink: 0;
  margin-left: 1.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.link-card-image img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
}

.link-card-info {
  flex: 1;
  min-width: 0;
  padding: 1rem 1.25rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.link-card-title {
  font-size: 0.95rem;
  font-weight: 500;
  color: #222;
  margin-bottom: 0.25rem;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  line-height: 1.4;
}

.link-card-description {
  font-size: 0.85rem;
  color: #666;
  margin-bottom: 0.5rem;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  line-height: 1.4;
}

.link-card-url {
  font-size: 0.8rem;
  color: #888;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-top: auto;
}

.link-card-icon {
  font-size: 1.2rem;
  color: #999;
  margin: 1rem 1.25rem;
  flex-shrink: 0;
  transition: transform 0.2s;
  align-self: center;
}

.link-card:hover .link-card-icon {
  transform: translateX(4px);
  color: #666;
}

.link-card-content:not(:has(.link-card-image)) {
  align-items: center;
}

.link-card-content:not(:has(.link-card-image)) .link-card-info {
  padding-right: 0;
}

/* Post List */
.post-list {
  display: flex;
  flex-direction: column;
}

.post-list article {
  margin-bottom: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid #e5e5e5;
}

.post-list article:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.post-list article h2 {
  font-size: 1.3rem;
  font-weight: 600;
}

.post-list article time {
  font-size: 0.85rem;
  color: #888;
  margin-top: 0.25rem;
  margin-bottom: 0.75rem;
}

.post-list article p {
  font-size: 0.95rem;
  color: #666;
  margin-bottom: 0.5rem;
}

/* Tags */
.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1rem;
}

.tag {
  font-size: 0.85rem !important;
  color: #666;
  text-decoration: none;
  padding: 0.25rem 0.5rem;
  background-color: #f5f5f5;
  border-radius: 3px;
  transition: background-color 0.2s;
}

.tag:hover {
  background-color: #e5e5e5;
}

/* Social Links */
.social-links {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.75rem;
  margin-bottom: 2rem;
  flex-wrap: wrap;
}

.social-link {
  display: inline-block;
  transition: opacity 0.2s, transform 0.2s;
}

.social-link:hover {
  opacity: 0.7;
  transform: translateY(-2px);
}

.social-icon {
  width: 24px;
  height: 24px;
  background-color: #fff;
  padding: 0.25rem;
  border-radius: 4px;
  object-fit: contain;
}

/* ========================================
   Pages
   ======================================== */

/* Index Page */
.intro {
  margin-bottom: 3rem;
  line-height: 1.9;
}

.intro p {
  margin-bottom: 1rem;
}

/* Recent Posts */
.recent-posts {
  margin-top: 3rem;
}

.recent-posts h2 {
  font-size: 1.3rem;
  font-weight: 600;
  margin-bottom: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid #e5e5e5;
  color: #222;
}

.recent-posts h3 {
  font-size: 1rem;
  font-weight: 600;
  margin-top: 0.75rem;
  margin-bottom: 0.75rem;
  color: #666;
}

.recent-posts-list,
.note-posts-list {
  list-style: none;
  padding: 0;
  margin: 0 0 1.5rem 0;
}

.recent-posts-list li,
.note-posts-list li {
  margin-bottom: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid #e5e5e5;
}

.recent-posts-list li:last-child,
.note-posts-list li:last-child {
  border-bottom: none;
}

.post-date {
  font-size: 0.85rem;
  color: #888;
  margin-top: 0.25rem;
  display: block;
}

.more-link {
  margin-top: 2rem;
  padding-top: 2rem;
  border-top: 1px solid #e5e5e5;
  text-align: center;
}

/* Note Posts */
.note-posts {
  margin-top: 3rem;
  padding-top: 3rem;
  border-top: 1px solid #e5e5e5;
}

.note-posts h2 {
  font-size: 1.3rem;
  font-weight: 600;
  margin-bottom: 1.5rem;
  color: #222;
}

.note-posts-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.note-icon {
  width: 1.5rem;
  height: 1.5rem;
  background-color: #fff;
  padding: 0.25rem;
  border-radius: 4px;
  object-fit: contain;
}

/* ========================================
   Responsive
   ======================================== */
@media (max-width: 768px) {
  body {
    padding: 1.5rem 1rem;
  }

  article h1 {
    font-size: 1.5rem;
  }

  .content {
    font-size: 0.95rem;
  }

  nav {
    gap: 1rem;
  }
}
