/*
Theme Name: BuildPress
Description: A custom WordPress theme for blogs and websites.
Version: 1.0.0
Author: Danjo Syu
Requires at least: 6.0
Requires PHP: 7.4
License: GPL-2.0-or-later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: buildpress
*/

:root {
  --color-text: #222;
  --color-muted: #666;
  --color-border: #ddd;
  --color-background: #fff;
  --color-surface: #f7f7f7;
  --color-link: #135caa;
  --content-width: 1080px;
}

* {
  box-sizing: border-box;
}

html {
  font-size: 100%;
}

body {
  margin: 0;
  color: var(--color-text);
  background: var(--color-background);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.8;
}

a {
  color: var(--color-link);
}

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

.site {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.site-footer {
  padding: 1.5rem 1rem;
}

.category-nav {
  background-color: #1e3a8a !important;
  padding: 0.7rem 1rem;
}

.category-nav__link {
  display: block;
  padding: 0.25rem 0.4rem;
  font-size: 0.875rem;
  font-weight: 500;
  white-space: nowrap;
}

.category-nav__link:hover,
.category-nav__link:focus-visible {
  color: #bfdbfe !important;
}

.site-footer {
  border-top: 1px solid var(--color-border);
  border-bottom: 0;
  margin-top: auto;
}

.site-footer__inner,
.site-main {
  max-width: 1280px;
  margin: 0 auto;
}

.site-title {
  margin: 0;
  font-size: 1.5rem;
}

.site-description {
  margin: 0.25rem 0 0;
  color: var(--color-muted);
}

.site-main {
  display: flex;
  gap: 3rem;
  padding: 3rem 0;
}

.content-area {
  width: 70%;
}

.entry-meta,
.archive-title,
.nav-links {
  color: var(--color-muted);
}

.widget {
  padding: 1rem;
  background: var(--color-surface);
}

.widget + .widget {
  margin-top: 1rem;
}

/* Sidebar Widgets Styles */
.custom-shadow {
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.widget-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0 0 1rem;
  font-size: 1.1rem;
  font-weight: 600;
  border-bottom: 1px solid var(--color-border);
  padding-bottom: 0.75rem;
  color: var(--color-text);
}

.widget-icon {
  font-size: 1.3rem;
  line-height: 1;
}

/* Popular Posts */
.posts-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.post-item {
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--color-border);
}

.post-item:last-child {
  border-bottom: none;
}

.post-item a {
  text-decoration: none;
  font-size: 0.95rem;
  line-height: 1.4;
  display: block;
  transition: color 0.2s ease;
}

.post-item a:hover {
  color: #135caa;
  text-decoration: underline;
}

/* Categories */
.categories-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.category-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--color-border);
  font-size: 0.95rem;
}

.category-item:last-child {
  border-bottom: none;
}

.category-item a {
  flex: 1;
  text-decoration: none;
  transition: color 0.2s ease;
}

.category-item a:hover {
  color: #135caa;
  text-decoration: underline;
}

.category-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  height: 24px;
  background-color: #e8f0fe;
  color: var(--color-link);
  border-radius: 4px;
  font-size: 0.85rem;
  font-weight: 600;
  margin-left: 0.75rem;
}

/* Tags Cloud */
.tags-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.tag-item {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.4rem 0.75rem;
  background-color: #e8f0fe;
  color: var(--color-link);
  border-radius: 4px;
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 500;
  transition: all 0.2s ease;
  border: 1px solid transparent;
}

.tag-item:hover {
  background-color: var(--color-link);
  color: #fff;
  text-decoration: none;
  transform: translateY(-2px);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.tag-item.tag-large {
  font-size: 1rem;
  font-weight: 600;
  padding: 0.5rem 0.9rem;
}

.tag-item.tag-medium {
  font-size: 0.9rem;
  font-weight: 550;
}

.tag-item.tag-small {
  font-size: 0.8rem;
  font-weight: 500;
}

.posts-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(276px, 1fr));
  gap: 1.5rem;
}

.article-card {
  width: 100%;
  border-radius: 12px;
  background-color: #fff;
  box-shadow:
    0 1px 3px rgba(0, 0, 0, 0.1),
    0 2px 8px rgba(0, 0, 0, 0.06);
}

.article-card__link {
  display: block;
  color: inherit;
  text-decoration: none;
}

.article-card__image {
  display: block;
  width: 100%;
  height: 130px;
  object-fit: cover;
}

.article-card__badge {
  padding: 5px 10px;
  background-color: #0d47a1;
  color: #fff;
  font-size: 10px;
  font-weight: 600;
}

.article-card__date {
  color: #6c757d;
  font-size: 11px;
}

.article-card__title {
  color: #111827;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.45;
}

.article-card__description {
  color: #4b5563;
  font-size: 0.75rem;
  line-height: 1.65;
}

.article-card__link:hover .article-card__title {
  opacity: 0.75;
}

.article ul {
  border: 0.5px solid #1e3a8a;
  border-radius: 4px;
  background-color: #f8f9ff;
  display: grid;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  padding-left: 2rem;
  margin: 2rem 0;
}

.article nav ul {
  border: none;
}

.article ul li p {
  margin-bottom: 0;
}

.article table {
  width: 100%;
  border-collapse: collapse;
  color: #333;
  font-size: 16px;
}

.article table th,
.article table td {
  padding: 16px;
  border: 1px solid #e5e7eb;
  line-height: 1.6;
  text-align: left;
  vertical-align: middle;
}

.article table thead {
  background-color: #fafbfc;
}

.article table th {
  font-weight: 700;
  text-align: center;
}

.directory-tree-wrapper {
  position: relative;
  margin: 32px 0;
}

.directory-tree {
  margin: 0;
  padding: 32px;
  padding-top: 56px;
  overflow-x: auto;
  color: #f8fafc;
  background-color: #111827;
  border-radius: 8px;
  font-family: "SFMono-Regular",Consolas,"Liberation Mono",Menlo,monospace;
  font-size: 16px;
  line-height: 1.8;
  white-space: pre;
  tab-size: 2;
}

.directory-tree-copy {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 1;
  padding: 6px 10px;
  color: #cbd5e1;
  background: transparent;
  border: 1px solid #475569;
  border-radius: 6px;
  font-size: 13px;
  cursor: pointer;
  transition:
    color 0.2s,
    background-color 0.2s;
}

.directory-tree-copy:hover {
  color: #fff;
  background-color: #1e293b;
}

@media (max-width: 720px) {
  .site-header {
    padding: 1rem;
  }

  .site-header__inner {
    align-items: stretch !important;
    flex-direction: column;
    gap: 0.75rem !important;
  }

  .site-search {
    width: 100%;
  }

  .category-nav__list {
    justify-content: flex-start !important;
    overflow-x: auto;
    flex-wrap: nowrap !important;
    padding-bottom: 0.25rem;
  }

  .site-main {
    display: block;
  }

  .content-area {
    width: 90%;
    margin: 0 auto;
  }

  .site-sidebar {
    margin-top: 3rem;
  }

  .directory-tree {
    padding: 52px 20px 20px;
    font-size: 14px;
    line-height: 1.7;
  }

  .directory-tree-copy {
    top: 12px;
    right: 12px;
  }
}