/*
Theme Name: Tahseen Ashrafi Theme
Theme URI: https://example.com/tahseen-ashrafi-theme
Author: Tahseen Ashrafi
Author URI: https://example.com
Description: A professional news website theme with dark/light mode support, optimized for Google AdSense
Version: 1.2
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: tahseen-ashrafi
Tags: news, blog, custom-menu, featured-images, threaded-comments, translation-ready, responsive-design
*/

:root {
  --accent-color: #efc51b;
  --text-color: #000000;
  --bg-color: #ffffff;
  --card-bg: #f8f8f8;
  --border-color: #e0e0e0;
  --hover-color: #efc51b;
}

[data-theme="dark"] {
  --text-color: #ffffff;
  --bg-color: #1a1a1a;
  --card-bg: #2a2a2a;
  --border-color: #3a3a3a;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Arial', sans-serif;
  line-height: 1.6;
  color: var(--text-color);
  background-color: var(--bg-color);
  transition: background-color 0.3s ease, color 0.3s ease;
}

.container-main {
  width: 80%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 15px;
}

a {
  color: var(--text-color);
  text-decoration: none;
  transition: color 0.3s ease;
}

a:hover {
  color: var(--accent-color);
}

/* Header Styles */
.site-header {
  background: var(--bg-color);
  padding: 20px 0 0;
}

.header-wrapper {
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 15px;
}

/* Centered Logo */
.site-logo-center {
  text-align: center;
  margin-bottom: 20px;
}

.site-logo-center img {
  max-width: 250px;
  height: auto;
}

.site-logo-center h1 {
  font-size: 32px;
  font-weight: bold;
}

/* Edge Hover Tools (Search + Theme Toggle) */
.header-edge-tools {
  position: fixed;
  top: 20px;
  right: -200px;
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--card-bg);
  padding: 8px 15px;
  border-radius: 25px 0 0 25px;
  z-index: 1000;
  transition: right 0.3s ease;
  box-shadow: -2px 2px 10px rgba(0,0,0,0.1);
}

.header-edge-tools:hover {
  right: 0;
}

.search-form-header {
  display: flex;
  align-items: center;
  gap: 5px;
}

.search-form-header input[type="search"] {
  border: none;
  background: transparent;
  padding: 5px;
  outline: none;
  color: var(--text-color);
  width: 120px;
}

.search-form-header button {
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--text-color);
  font-size: 16px;
}

.theme-toggle {
  background: var(--accent-color);
  border: none;
  padding: 6px 12px;
  border-radius: 15px;
  cursor: pointer;
  color: #000;
  font-weight: bold;
  font-size: 16px;
}

/* Navigation Menu */
.main-navigation {
  background: var(--card-bg);
  padding: 12px 0;
  margin-bottom: 30px;
}

.nav-menu-wrapper {
  width: 80%;
  max-width: 1200px;
  margin: 0 auto;
}

.main-navigation ul.primary-menu {
  list-style: none;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 25px;
  flex-wrap: wrap;
  margin: 0;
  padding: 0;
}

.main-navigation li {
  position: relative;
  margin: 0;
}

.main-navigation a {
  padding: 8px 12px;
  display: block;
  font-weight: 500;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.main-navigation a:hover {
  color: var(--accent-color);
  border-bottom: 2px solid var(--accent-color);
}

/* Post Category Tag */
.post-category {
  position: absolute;
  top: 10px;
  left: 10px;
  background: var(--accent-color);
  padding: 4px 12px;
  border-radius: 4px;
  font-size: 11px;
  color: #000;
  font-weight: bold;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  z-index: 2;
}

.image-credit {
  font-size: 10px;
  color: #666;
  text-align: right;
  padding: 5px 10px;
  font-style: italic;
  background: rgba(0, 0, 0, 0.05);
}

[data-theme="dark"] .image-credit {
  color: #999;
  background: rgba(255, 255, 255, 0.05);
}

/* Section Styles */
.news-section {
  margin: 40px 0;
}

.section-heading {
  font-size: 28px;
  font-weight: bold;
  margin-bottom: 25px;
  text-align: left;
  border-bottom: 3px solid var(--accent-color);
  padding-bottom: 10px;
  text-transform: uppercase;
}

/* TOP News Grid - 6 boxes (3 x 2) */
.top-news-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 25px;
}

.news-box {
  background: var(--card-bg);
  border-radius: 10px;
  overflow: hidden;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.news-box:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

.news-box-image {
  position: relative;
  width: 100%;
  height: 250px;
  overflow: hidden;
}

.news-box-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.news-box-content {
  padding: 15px;
}

.news-box-title {
  font-size: 16px;
  font-weight: bold;
  margin-bottom: 10px;
  line-height: 1.4;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.news-box-title a:hover {
  color: var(--accent-color);
}

.post-date {
  font-size: 12px;
  color: #888;
  margin-top: 8px;
}

/* Category Sections - 3 boxes per row */
.category-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 25px;
}

.category-box {
  background: var(--card-bg);
  border-radius: 10px;
  overflow: hidden;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.category-box:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

.category-box-image {
  position: relative;
  width: 100%;
  height: 250px;
  overflow: hidden;
}

.category-box-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.category-box-content {
  padding: 15px;
}

.category-box-title {
  font-size: 16px;
  font-weight: bold;
  margin-bottom: 10px;
  line-height: 1.4;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.category-box-title a:hover {
  color: var(--accent-color);
}

.category-box-excerpt {
  font-size: 14px;
  margin: 12px 0;
  line-height: 1.6;
  color: var(--text-color);
  opacity: 0.85;
}

.see-more-btn {
  display: inline-block;
  background: var(--accent-color);
  color: #000;
  padding: 8px 20px;
  border-radius: 5px;
  font-weight: bold;
  font-size: 13px;
  margin-top: 10px;
  transition: background 0.3s ease;
}

.see-more-btn:hover {
  background: #d4b018;
  color: #000;
}

/* Single Post Layout */
.single-post-layout {
  margin-top: 30px;
}

.single-post-wrapper {
  display: flex;
  gap: 30px;
}

.single-post-main {
  flex: 1;
  max-width: 70%;
}

.single-post-sidebar {
  width: 30%;
  min-width: 280px;
}

.single-post-content {
  background: var(--card-bg);
  padding: 40px;
  border-radius: 10px;
  margin-bottom: 30px;
}

.single-post-content .entry-header {
  margin-bottom: 20px;
}

.entry-title {
  font-size: 32px;
  font-weight: bold;
  margin-bottom: 15px;
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
}

.entry-meta {
  font-size: 13px;
  color: #888;
  margin-bottom: 20px;
}

.single-post-content .post-thumbnail {
  position: relative;
  width: 100%;
  height: 450px;
  overflow: hidden;
  border-radius: 10px;
  margin-bottom: 10px;
}

.single-post-content .post-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.entry-content {
  line-height: 1.8;
  font-size: 17px;
}

.entry-content p {
  margin-bottom: 20px;
  min-height: 80px;
}

.entry-content img {
  max-width: 100%;
  height: auto;
  border-radius: 10px;
  margin: 20px 0;
}

/* Sidebar */
.sidebar {
  background: var(--card-bg);
  padding: 20px;
  border-radius: 10px;
  position: sticky;
  top: 20px;
}

.widget {
  margin-bottom: 30px;
}

.widget-title {
  font-size: 18px;
  font-weight: bold;
  margin-bottom: 15px;
  border-bottom: 2px solid var(--accent-color);
  padding-bottom: 8px;
}

.sidebar-post-card {
  display: flex;
  gap: 10px;
  margin-bottom: 15px;
  padding: 10px;
  background: var(--bg-color);
  border-radius: 8px;
  transition: transform 0.3s ease;
}

.sidebar-post-card:hover {
  transform: translateX(3px);
  box-shadow: 0 2px 8px rgba(239, 197, 27, 0.2);
}

.sidebar-post-image {
  width: 80px;
  height: 60px;
  flex-shrink: 0;
  border-radius: 5px;
  overflow: hidden;
}

.sidebar-post-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.sidebar-post-content {
  flex: 1;
}

.sidebar-post-title {
  font-size: 13px;
  font-weight: bold;
  line-height: 1.4;
}

.sidebar-post-title a:hover {
  color: var(--accent-color);
}

/* Footer */
.site-footer {
  background: var(--card-bg);
  padding: 30px 0 20px;
  text-align: center;
  margin-top: 60px;
  border-top: 3px solid var(--accent-color);
}

.footer-content {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.footer-menu {
  margin-bottom: 10px;
}

.footer-nav {
  display: flex;
  justify-content: center;
  gap: 20px;
  flex-wrap: wrap;
}

.footer-nav a {
  font-size: 13px;
  font-weight: 500;
  padding: 5px 10px;
  transition: color 0.3s ease;
}

.footer-nav a:hover {
  color: var(--accent-color);
}

.footer-copyright {
  font-size: 13px;
  color: #888;
}

.footer-copyright strong {
  color: var(--text-color);
  font-weight: bold;
}

/* Back to Top Button */
.back-to-top {
  position: fixed;
  bottom: 30px;
  right: 30px;
  background: var(--accent-color);
  color: #000;
  padding: 15px;
  border-radius: 50%;
  cursor: pointer;
  display: none;
  z-index: 1000;
  border: none;
  font-size: 20px;
  width: 50px;
  height: 50px;
  box-shadow: 0 3px 10px rgba(0,0,0,0.2);
  transition: transform 0.3s ease;
}

.back-to-top.show {
  display: block;
}

.back-to-top:hover {
  transform: translateY(-3px);
}

/* Comments */
.comments-area {
  background: var(--card-bg);
  padding: 30px;
  border-radius: 10px;
  margin-top: 30px;
}

.comment-list {
  list-style: none;
}

.comment {
  margin-bottom: 20px;
  padding: 15px;
  background: var(--bg-color);
  border-radius: 8px;
}

/* Responsive Design */
@media (max-width: 1024px) {
  .container-main,
  .nav-menu-wrapper {
    width: 90%;
  }

  .top-news-grid,
  .category-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .single-post-main {
    max-width: 65%;
  }

  .single-post-sidebar {
    width: 35%;
  }
}

@media (max-width: 768px) {
  .container-main,
  .nav-menu-wrapper {
    width: 95%;
  }

  .site-logo-center img {
    max-width: 180px;
  }

  .main-navigation ul.primary-menu {
    flex-direction: column;
    gap: 10px;
    text-align: center;
  }

  .top-news-grid,
  .category-grid {
    grid-template-columns: 1fr;
  }

  .single-post-wrapper {
    flex-direction: column;
  }

  .single-post-main,
  .single-post-sidebar {
    max-width: 100%;
    width: 100%;
  }

  .single-post-content {
    padding: 20px;
  }

  .entry-title {
    font-size: 24px;
  }

  .section-heading {
    font-size: 22px;
  }

  .footer-nav {
    flex-direction: column;
    gap: 10px;
  }

  .header-edge-tools {
    right: -180px;
  }
}

@media (max-width: 480px) {
  .news-box-image,
  .category-box-image {
    height: 200px;
  }

  .single-post-content .post-thumbnail {
    height: 250px;
  }

  .header-edge-tools {
    padding: 6px 10px;
  }

  .search-form-header input[type="search"] {
    width: 100px;
  }
}
