/* Base Reset & Global Styles (Mobile First) */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  line-height: 1.6;
  color: #333;
  background-color: #f8f9fa;
}

.container {
  width: 90%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 1rem 0;
}

a {
  color: #2D6A4F;
  text-decoration: none;
  transition: color 0.3s ease, background-color 0.3s ease;
}

a:hover {
  color: #1B4332;
}

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

h1,
h2,
h3,
h4 {
  line-height: 1.2;
  margin-bottom: 1rem;
  color: #222;
}

.section-title {
  font-size: 1.8rem;
  margin-bottom: 2rem;
  position: relative;
  padding-bottom: 0.5rem;
}

.section-title::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 60px;
  height: 3px;
  background-color: #F5A623;
}

.site-header {
  background-color: #fff;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  position: sticky;
  top: 0;
  z-index: 1000;
}

.header-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: nowrap;
  width: 100%;
}

.site-logo {
  font-size: 1.5rem;
  font-weight: 700;
  color: #2D6A4F;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  white-space: nowrap;
}

/* Mobile Menu Toggle */
.menu-toggle {
  background: none;
  border: none;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 4px;
  z-index: 1001;
}

.menu-icon {
  width: 24px;
  height: 3px;
  background-color: #333;
  transition: all 0.3s ease;
}

/* Main Navigation */
.main-nav {
  position: fixed;
  top: 0;
  right: 0;
  height: 100vh;
  width: 80%;
  background-color: #fff;
  box-shadow: -2px 0 10px rgba(0, 0, 0, 0.1);
  transform: translateX(100%);
  transition: transform 0.3s ease;
  padding: 3rem 1.5rem;
  overflow-y: auto;
}

.main-nav.active {
  transform: translateX(0);
}

.nav-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
  width: 100%;
}

.nav-link {
  display: block;
  font-size: 1.1rem;
  font-weight: 500;
  color: #333;
  padding: 0.5rem 0;
  border-bottom: 1px solid #eee;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nav-link:hover {
  color: #2D6A4F;
}

/* Footer Styles */
.site-footer {
  background-color: #222;
  color: #fff;
  padding: 2rem 0;
  margin-top: 3rem;
}

.footer-inner {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.footer-nav-list {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
}

.footer-nav-link {
  color: #ddd;
}

.footer-nav-link:hover {
  color: #F5A623;
}

.copyright-area {
  border-top: 1px solid #444;
  padding-top: 1rem;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 0.5rem;
}

.footer-link {
  color: #ddd;
  font-size: 0.9rem;
}

.copyright-text {
  font-size: 0.9rem;
  color: #888;
}

/* Featured Articles Section */
.featured-section {
  padding: 2rem 0;
}

.featured-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
  width: 100%;
}

.featured-card {
  background-color: #fff;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
  transition: all 0.3s ease;
  width: 100%;
  display: flex;
  flex-direction: column;
}

.featured-card {
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.1);
  border: 2px solid #F5A623;
}

.featured-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
}

.featured-img {
  width: 100%;
  aspect-ratio: 4/3;
  object-fit: cover;
  flex-shrink: 0;
}

.featured-content {
  padding: 1.8rem 1.5rem;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}

.featured-title {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 0.8rem;
  color: #222;
  line-height: 1.4;
}

.featured-date {
  font-size: 0.85rem;
  color: #777;
  margin-bottom: 0.8rem;
  display: block;
}

.featured-brief {
  color: #555;
  font-size: 0.95rem;
  line-height: 1.6;
  margin-bottom: 1.2rem;
  flex-grow: 1;
}

.featured-views {
  font-size: 0.85rem;
  color: #888;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: auto;
}

/* Categories Section */
.categories-section {
  padding: 2rem 0;
  background-color: #fff;
}

.categories-list {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.category-tag {
  background-color: #2D6A4F;
  color: #fff;
  padding: 0.5rem 1.2rem;
  border-radius: 20px;
  font-weight: 500;
  transition: background-color 0.3s ease;
  white-space: nowrap;
}

.category-tag:hover {
  background-color: #1B4332;
  color: #fff;
}

/* Latest Articles Section */
.latest-articles-section {
  padding: 2rem 0;
}

.articles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
  margin-bottom: 2rem;
  align-items: stretch;
}

.article-card {
  background-color: #fff;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  transition: transform 0.3s ease;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.article-card:hover {
  transform: translateY(-5px);
}

.article-img {
  width: 100%;
  aspect-ratio: 4/3;
  object-fit: cover;
}

.article-meta {
  padding: 1rem 1.5rem 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  font-size: 0.9rem;
  color: #666;
}

.article-category {
  background-color: #F5A623;
  color: #fff;
  padding: 0.2rem 0.8rem;
  border-radius: 12px;
  font-size: 0.8rem;
  white-space: nowrap;
}

.article-title {
  padding: 0.5rem 1.5rem;
  font-size: 1.2rem;
}

.article-brief {
  padding: 0 1.5rem 1.5rem;
  color: #555;
}

/* Pagination Styles */
.pagination-container {
  margin-top: 2rem;
  text-align: center;
}

.post-pagination {
  list-style: none;
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.pagination-item {
  display: inline-block;
}

.pagination-link {
  display: block;
  padding: 0.5rem 1rem;
  border-radius: 4px;
  background-color: #fff;
  color: #2D6A4F;
  font-weight: 500;
  transition: all 0.3s ease;
  white-space: nowrap;
}

.pagination-link:hover {
  background-color: #2D6A4F;
  color: #fff;
}

.pagination-link.current {
  background-color: #2D6A4F;
  color: #fff;
  pointer-events: none;
}

.pagination-link.disabled {
  color: #ccc;
  pointer-events: none;
}

.pagination-ellipsis {
  padding: 0.5rem 1rem;
  color: #666;
}

/* Breadcrumb Styles */
.breadcrumb-nav {
  margin-bottom: 1.5rem;
  padding: 1rem 0;
}

.breadcrumb-list {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  font-size: 0.9rem;
}

.breadcrumb-item {
  color: #666;
  white-space: nowrap;
}

.breadcrumb-item.active {
  color: #333;
  font-weight: 500;
}

/* Layout Grid (Main + Sidebar) */
.layout-grid {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

/* Sidebar Styles */
.sidebar {
  background-color: #fff;
  padding: 1.5rem;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  width: 100%;
}

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

.widget-title {
  font-size: 1.2rem;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid #F5A623;
}

.category-list,
.popular-list {
  list-style: none;
}

.category-item,
.popular-item {
  margin-bottom: 0.8rem;
  padding-bottom: 0.8rem;
  border-bottom: 1px solid #eee;
}

.category-link {
  font-weight: 500;
}

.popular-item {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.article-date {
  font-size: 0.8rem;
  color: #888;
}

/* Category Page Styles */
.post_tag_name {
  font-size: 2rem;
  margin-bottom: 2rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.category-articles {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.category-article-item {
  background-color: #fff;
  padding: 1.5rem;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.article-item-inner {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.item-img {
  width: 100%;
  aspect-ratio: 4/3;
  object-fit: cover;
  border-radius: 4px;
}

.item-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  font-size: 0.9rem;
  color: #666;
  margin-bottom: 0.5rem;
}

.item-title {
  font-size: 1.2rem;
  margin-bottom: 0.5rem;
}

.item-brief {
  color: #555;
}

/* Article Detail Page Styles */
.article-detail {
  background-color: #fff;
  padding: 2rem;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.article-detail-title {
  font-size: 2rem;
  margin-bottom: 1.5rem;
  white-space: normal;
  line-height: 1.3;
}

.article-meta-detail {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  font-size: 0.9rem;
  color: #666;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid #eee;
}

.author-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 2rem;
  padding: 1rem;
  background-color: #f8f9fa;
  border-radius: 8px;
  flex-wrap: wrap;
}

.author-avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.author-name {
  font-size: 1.2rem;
  margin-bottom: 0.3rem;
  font-weight: 700;
  display: block;
}

.author-bio {
  color: #555;
  font-size: 0.95rem;
}

.article-content {
  line-height: 1.8;
  color: #444;
  margin-bottom: 2rem;
}

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

.article-content h2 {
  font-size: 1.6rem;
  margin-top: 2rem;
  margin-bottom: 1rem;
}

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

/* Related Articles */
.related-articles {
  margin-bottom: 2rem;
  padding-top: 2rem;
  border-top: 1px solid #eee;
}

.related-title {
  font-size: 1.5rem;
  margin-bottom: 1rem;
}

.related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1rem;
  align-items: stretch;
}

.related-card {
  padding: 1rem;
  border: 1px solid #eee;
  border-radius: 4px;
  transition: border-color 0.3s ease;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.related-card:hover {
  border-color: #2D6A4F;
}

/* Article Navigation (Prev/Next) */
.article-nav {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 2rem;
  padding-top: 2rem;
  border-top: 1px solid #eee;
}

.prev-article,
.next-article {
  flex: 1;
}

.nav-label {
  font-size: 0.9rem;
  color: #888;
  display: block;
}

.nav-title {
  font-weight: 500;
  font-size: 1.1rem;
  white-space: normal;
}

/* Comment Section */
.comment-section {
  margin-top: 2rem;
  padding-top: 2rem;
  border-top: 1px solid #eee;
}

.comment-title {
  font-size: 1.5rem;
  margin-bottom: 1.5rem;
}

.comment-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.form-label {
  font-weight: 500;
}

.form-input,
.form-textarea {
  padding: 0.8rem;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-family: inherit;
  font-size: 1rem;
  width: 100%;
}

.form-input:focus,
.form-textarea:focus {
  outline: none;
  border-color: #2D6A4F;
  box-shadow: 0 0 0 2px rgba(45, 106, 79, 0.2);
}

.form-submit {
  background-color: #2D6A4F;
  color: #fff;
  border: none;
  padding: 0.8rem 1.5rem;
  border-radius: 4px;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.3s ease;
  white-space: nowrap;
}

.form-submit:hover {
  background-color: #1B4332;
}

/* Author Profile Page */
.author-profile {
  background-color: #fff;
  padding: 2rem;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.author-header {
  text-align: center;
  margin-bottom: 2rem;
}

.author-profile-img {
  width: 150px;
  height: 150px;
  border-radius: 50%;
  object-fit: cover;
  margin: 0 auto 1rem;
}

.author-profile-name {
  font-size: 2rem;
  margin-bottom: 0.5rem;
}

.author-profile-bio {
  font-size: 1.1rem;
  color: #555;
  max-width: 800px;
  margin: 0 auto;
}

.author-details-title {
  font-size: 1.6rem;
  margin-bottom: 1rem;
}

.author-details-content {
  line-height: 1.8;
  color: #444;
}

/* Alone Page (About Us) */
.alone-page {
  background-color: #fff;
  padding: 2rem;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.alone-title {
  font-size: 2rem;
  margin-bottom: 1.5rem;
}

.alone-content {
  line-height: 1.8;
  color: #444;
}

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

/* More Articles Page */
.more-articles-title {
  font-size: 2rem;
  margin-bottom: 2rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.more-articles-list {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.more-article-item {
  background-color: #fff;
  padding: 1.5rem;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.more-article-img {
  width: 100%;
  aspect-ratio: 4/3;
  object-fit: cover;
  border-radius: 4px;
  margin-bottom: 1rem;
  max-height: 240px;
}

.more-article-content {
  width: 100%;
}

.more-item-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  font-size: 0.9rem;
  color: #666;
  margin-bottom: 0.5rem;
}

.more-item-title {
  font-size: 1.2rem;
  margin-bottom: 0.5rem;
}

.more-item-brief {
  color: #555;
}

/* All Articles Page */
.all-articles-title {
  font-size: 2rem;
  margin-bottom: 2rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.all-articles-list {
  background-color: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.all-article-item {
  padding: 1.5rem;
  border-bottom: 1px solid #eee;
}

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

.all-item-title {
  font-size: 1.2rem;
  margin-bottom: 0.5rem;
  white-space: normal;
  line-height: 1.3;
}

.all-item-date {
  font-size: 0.9rem;
  color: #666;
}

/* Responsive Breakpoints */
@media (min-width: 768px) {

  /* Desktop Menu */
  .menu-toggle {
    display: none;
  }

  .main-nav {
    position: static;
    height: auto;
    width: auto;
    transform: none;
    padding: 0;
    box-shadow: none;
    background: none;
    overflow-y: visible;
  }

  .nav-list {
    flex-direction: row;
    gap: 1.8rem;
    align-items: center;
  }

  .nav-link {
    border-bottom: none;
    padding: 0.5rem 0;
  }

  /* Layout Grid */
  .layout-grid {
    flex-direction: row;
  }

  .main-content {
    flex: 3;
  }

  .sidebar {
    flex: 1;
    position: sticky;
    top: 80px;
    align-self: flex-start;
    height: fit-content;
  }

  .article-item-inner {
    flex-direction: row;
    gap: 1.5rem;
  }

  .article-item-img {
    flex: 1;
  }

  .article-item-content {
    flex: 2;
  }

  .article-nav {
    flex-direction: row;
    justify-content: space-between;
  }

  /* More Article */
  .more-article-link {
    display: flex;
    gap: 1.5rem;
    align-items: flex-start;
  }

  .more-article-img {
    max-width: 300px;
    margin-bottom: 0;
  }

}

.error {
  border-color: #e53e3e !important;
  box-shadow: 0 0 0 2px rgba(229, 62, 62, 0.2) !important;
}

@media (max-width: 768px) {
  .site-header {
    padding: .5rem 0;
  }

  .site-header .container {
    padding: 0;
  }

  .featured-section {
    padding-top: 1rem;
  }

  .breadcrumb-nav {
    padding: 0;
    margin-bottom: .8rem;
  }

  h1.post_tag_name {
    font-size: 1.3rem;
  }
}