/*
Theme Name: xudua news
Theme URI: https://example.com/my-custom-theme
Author: Nhóm Sáng tạo trẻ
Author URI: https://example.com
Description: A modern starter theme for WordPress.
Version: 1.3.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: xudua-news
Tags: custom-background, custom-logo, custom-menu, featured-images, threaded-comments, translation-ready
*/

/* Reset & Basic Styles */
:root {
  --primary-color: #333333;
  --text-color: #000000;
  --bg-color: #ffffff;
  --brand-color: #d1111a; 
  --border-color: #e5e5e5;
  --meta-color: #888888;
  --font-family: Arial, Helvetica, sans-serif;
  --font-family-serif: Arial, Helvetica, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 0;
  font-family: var(--font-family);
  color: var(--text-color);
  background-color: var(--bg-color);
  line-height: 1.5;
}

.site-container {
  max-width: 1140px;
  margin: 0 auto;
  padding: 0 15px;
}

/* Header & Navigation */
.site-header {
  background: var(--brand-color);
  position: relative;
}

.site-nav {
  display: flex;
  align-items: center;
  padding: 10px 0;
  position: relative;
}

.home-icon {
  margin-right: 15px;
}

.home-icon svg {
  fill: var(--bg-color);
}

.home-icon a {
  display: flex;
  align-items: center;
}

.custom-logo-link {
  display: inline-block;
}

.custom-logo {
  max-height: 40px;
  width: auto;
  display: block;
}

.menu-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--bg-color);
  cursor: pointer;
  padding: 5px;
}

.site-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  flex: 1;
}

.site-nav a {
  text-decoration: none;
  color: var(--bg-color);
  font-size: 15px;
  font-weight: bold;
  text-transform: uppercase;
  transition: opacity 0.2s;
}

.site-nav a:hover, .site-nav li.current-menu-item > a {
  opacity: 0.8;
  text-decoration: underline;
}

.search-toggle {
  display: flex;
  align-items: center;
  cursor: pointer;
  color: var(--bg-color);
  margin-left: 25px; /* Increase spacing from menu */
}

/* Search Overlay Styling */
.search-overlay {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  width: 100%;
  background: #fff;
  padding: 15px 0;
  z-index: 1000;
  box-shadow: 0 10px 20px rgba(0,0,0,0.1);
  border-top: 1px solid #eee;
}

.search-overlay.active {
  display: block;
}

.search-overlay .search-form {
  display: flex;
  align-items: center;
  gap: 10px;
  position: relative;
}

.search-overlay .search-field {
  flex: 1;
  padding: 12px 15px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 16px;
  outline: none;
}

.search-overlay .search-submit {
  background: var(--brand-color);
  color: #fff;
  border: none;
  padding: 12px 20px;
  border-radius: 4px;
  cursor: pointer;
}

.search-overlay .search-close {
  font-size: 30px;
  cursor: pointer;
  color: #888;
  padding: 0 10px;
}

/* Main Content Area */
.main-news-area {
  margin-top: 30px;
  display: flex;
  flex-direction: column;
}

/* Featured Top Post */
.featured-post {
  display: grid;
  grid-template-columns: 65% 32%;
  gap: 3%;
  margin-bottom: 20px;
  padding-bottom: 20px;
  border-bottom: 2px solid var(--border-color);
}

.featured-post-thumb img {
  width: 100%;
  height: auto;
  aspect-ratio: 16/9;
  object-fit: cover;
  display: block;
}

.featured-post-content {
  display: flex;
  flex-direction: column;
}

.featured-post-title {
  margin: 0 0 10px 0;
  font-size: 32px;
  font-family: var(--font-family-serif);
  font-weight: bold;
  line-height: 1.3;
}

.featured-post-title a {
  text-decoration: none;
  color: #000000;
}

.featured-post-title a:hover {
  color: var(--brand-color);
}

.featured-post-excerpt {
  font-size: 16px;
  color: #444;
  margin: 0;
}

/* 3 Column Grid Posts */
.grid-posts-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-bottom: 40px;
}

.grid-post {
  display: flex;
  flex-direction: column;
}

.grid-post-thumb {
  margin-bottom: 10px;
}

.grid-post-thumb img {
  width: 100%;
  height: auto;
  aspect-ratio: 16/10;
  object-fit: cover;
  display: block;
}

.grid-post-title {
  margin: 0;
  font-size: 18px;
  font-weight: bold;
  line-height: 1.3;
}

.grid-post-title a {
  text-decoration: none;
  color: #000000;
}

.grid-post-title a:hover {
  color: var(--brand-color);
}

/* Category Sections */
.category-section {
  margin-top: 40px;
  margin-bottom: 40px;
}

.category-header {
  border-bottom: 2px solid var(--brand-color);
  margin-bottom: 20px;
  display: flex;
  align-items: center;
}

.category-title {
  background-color: var(--brand-color);
  color: var(--bg-color);
  margin: 0;
  padding: 5px 15px;
  font-size: 18px;
  font-weight: bold;
  text-transform: uppercase;
}

.category-title a {
  color: var(--bg-color);
  text-decoration: none;
}

.category-posts-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}

.cat-post {
  display: flex;
  flex-direction: column;
}

.cat-post-thumb {
  margin-bottom: 10px;
}

.cat-post-thumb img {
  width: 100%;
  height: auto;
  aspect-ratio: 16/10;
  object-fit: cover;
}

.cat-post-title {
  font-size: 16px;
  font-weight: bold;
  margin: 0;
  line-height: 1.3;
}

.cat-post-title a {
  color: #000000;
  text-decoration: none;
}

.cat-post-title a:hover {
  color: var(--brand-color);
}

/* Single Post Layout */
.single-layout-wrapper {
  display: grid;
  grid-template-columns: 74% 23%;
  gap: 3%;
  margin-top: 40px;
  margin-bottom: 60px;
}

.single-main-content {
  display: flex;
  flex-direction: column;
}

.single-main-content .entry-title {
  font-size: 32px;
  margin-bottom: 15px;
  font-weight: bold;
}

.single-main-content .entry-meta {
  font-size: 14px;
  color: var(--meta-color);
  margin-bottom: 20px;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 10px;
}

.single-sidebar .widget-title {
  font-size: 20px;
  border-bottom: 2px solid var(--brand-color);
  padding-bottom: 10px;
  margin-bottom: 20px;
}

.sidebar-latest-posts {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.sidebar-latest-post {
  display: flex;
  gap: 15px;
  align-items: center;
  border-bottom: 1px dotted var(--border-color);
  padding-bottom: 15px;
}

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

.sidebar-thumb {
  width: 80px;
  flex-shrink: 0;
}

.sidebar-thumb img {
  width: 100%;
  height: auto;
  aspect-ratio: 1/1;
  object-fit: cover;
}

.sidebar-info .sidebar-post-title {
  margin: 0;
  font-size: 15px;
  line-height: 1.3;
}

.sidebar-info .sidebar-post-title a {
  text-decoration: none;
  color: var(--text-color);
}

.sidebar-info .sidebar-post-title a:hover {
  color: var(--brand-color);
}

/* Article Action Bar */
.article-action-bar {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 15px;
  width: 60px;
  flex-shrink: 0;
  position: sticky;
  top: 100px;
  height: max-content;
  z-index: 10;
}

.action-btn-group {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: #fff;
  border: 1px solid #eee;
  border-radius: 30px;
  padding: 5px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.font-zoom-group {
  gap: 5px;
  padding: 10px 5px;
}

.font-zoom-group button {
  background: none;
  border: 1px solid #f0f0f0;
  border-radius: 50%;
  width: 28px;
  height: 28px;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #333;
}

.zoom-indicator {
  font-size: 14px;
  font-weight: bold;
  margin: 5px 0;
}

.action-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid #eee;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #555;
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(0,0,0,0.05);
  transition: all 0.2s;
}

.action-btn:hover {
  border-color: var(--brand-color);
  color: var(--brand-color);
}

.comment-anchor-group {
  padding: 5px;
  gap: 2px;
}

.comment-anchor-group .action-btn {
  border: none;
  box-shadow: none;
  height: 38px;
}

.share-btns {
  gap: 10px;
  padding: 5px 10px;
}

.share-btns .action-btn {
  box-shadow: none;
  border: 1px solid #eee;
}

.comment-count-indicator {
  font-size: 12px;
  color: #888;
  font-weight: bold;
}

.action-divider {
  width: 30px;
  border: 0;
  border-top: 1px solid #eee;
  margin: 5px 0;
}

@media (max-width: 992px) {
  .article-action-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    top: auto;
    width: 100%;
    flex-direction: row;
    justify-content: space-around;
    background: #fff;
    padding: 10px;
    box-shadow: 0 -2px 15px rgba(0,0,0,0.1);
    height: auto;
    gap: 0;
  }
  .action-btn-group, .action-btn {
    flex-direction: row;
    border-radius: 20px;
    box-shadow: none;
    border-color: #f0f0f0;
  }
  .share-btns {
    flex-direction: row;
  }
  .font-zoom-group {
    flex-direction: row;
    padding: 2px 8px;
  }
  .action-divider {
    display: none;
  }
  .single-main-content {
    padding-bottom: 80px; /* Space for sticky bar */
  }
}

/* Custom Comments Area */
.comments-area {
  margin-top: 60px;
  border-top: 2px solid #eee;
  padding-top: 40px;
}

.comments-header-wrapper {
  margin-bottom: 30px;
}

.comments-title {
  font-size: 24px;
  font-weight: bold;
  margin: 0;
}

.comments-title .red-bar {
  color: var(--brand-color);
  font-weight: 900;
  margin-right: 5px;
}

.comment-input-wrapper {
  display: flex;
  gap: 15px;
  margin-bottom: 15px;
  border: 1px solid #e0e0e0;
  padding: 10px;
  border-radius: 5px;
  background: #fdfdfd;
}

.comment-avatar {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
}

.comment-avatar img, .comment-avatar svg {
  border-radius: 50%;
  display: block;
  width: 100%;
  height: 100%;
}

.comment-form-field {
  flex: 1;
}

.comment-form-field textarea {
  width: 100%;
  border: none;
  outline: none;
  resize: vertical;
  background: transparent;
  font-family: inherit;
  font-size: 15px;
}

.form-submit-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.char-limit {
  font-size: 13px;
  color: #666;
  font-weight: bold;
}

.submit-btn.red-btn {
  background-color: var(--brand-color);
  color: white;
  border: none;
  padding: 10px 25px;
  font-size: 15px;
  font-weight: bold;
  cursor: pointer;
  border-radius: 3px;
}

.submit-btn.red-btn:hover {
  opacity: 0.9;
}

.comment-form-author, .comment-form-email {
  margin-bottom: 10px;
}
.comment-form-author input, .comment-form-email input {
  padding: 10px;
  width: 100%;
  max-width: 300px;
  border: 1px solid #ccc;
  border-radius: 4px;
}

/* Responsive */
@media (max-width: 992px) {
  .article-body-wrapper {
    flex-direction: column;
  }
  .article-action-bar {
    flex-direction: row;
    width: 100%;
    position: static;
    justify-content: center;
    margin-bottom: 20px;
  }
  .action-divider {
    transform: rotate(90deg);
  }
  .single-layout-wrapper {
    grid-template-columns: 100%;
  }
  .featured-post {
    grid-template-columns: 100%;
  }
  .featured-post-thumb { margin-bottom: 15px; }
  .category-posts-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 768px) {
  .grid-posts-row {
    grid-template-columns: 100%;
  }
  .category-posts-grid {
    grid-template-columns: 100%;
  }
  .menu-toggle {
    display: block;
  }
  .site-nav ul {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background: var(--brand-color);
    flex-direction: column;
    padding: 15px;
    z-index: 100;
  }
  .site-nav.toggled ul {
    display: flex;
  }
}

/* General Layout Fallbacks */
.site-content {
  padding: 40px 0;
}
.post-item {
  margin-bottom: 40px;
  border-bottom: 1px solid #eeeeee;
  padding-bottom: 20px;
}
@media (max-width: 992px) {
  .single-main-content {
    padding-bottom: 80px; /* Space for sticky bar */
  }
  .single-sidebar {
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid #eee;
  }
}

.site-footer {
  margin-top: 60px;
  padding: 40px 0;
  clear: both;
  border-top: 1px solid #eeeeee;
  text-align: center;
  font-size: 14px;
  color: #666666;
}
