/*
Theme Name: Duh Beat Games
Theme URI: https://duhbeatgames.com
Author: Duh Beat Games Team
Author URI: https://duhbeatgames.com
Description: Custom WordPress theme converted from HTML/CSS/JS for Duh Beat Games community hub and blog posts.
Version: 1.0.0
Text Domain: duhbeatgames
*/

/* ==========================================================================
   Global CSS Variables & Layout Reset
   ========================================================================== */
:root {
  --bg-card: rgba(20, 20, 25, 0.85);
  --border-color: rgba(255, 255, 255, 0.1);
  --accent-blue: #1a73e8;
  --accent-gold: #f5c518;
  --text-color: #ffffff;
  --text-light: #cccccc;
  --text-muted: #a0a0a0;
}

#primary.dbg-container {
  padding-top: 20px;
}

/* ==========================================================================
   Header Layout - Fixed 210px Height
   ========================================================================== */
.site-header {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  height: 210px;
  padding: 0 20px;
  background-color: var(--bg-card);
  border-bottom: 1px solid var(--border-color);
  box-sizing: border-box;
  overflow: hidden;
}

.toggle-btn {
  justify-self: start;
  padding: 8px 16px;
  font-size: 0.9rem;
}

.logo-container,
.logo-link {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100%;
}

.site-logo {
  display: block;
  max-height: 190px;
  width: auto;
  max-width: 100%;
  object-fit: contain;
}

.header-admin-btn {
  justify-self: end;
  background-color: var(--accent-blue);
  color: #ffffff;
  font-size: 0.85rem;
  font-weight: 700;
  padding: 8px 16px;
  border-radius: 6px;
  text-decoration: none;
  white-space: nowrap;
}

/* ==========================================================================
   WordPress Sidebar Menu Styling
   ========================================================================== */
.sidebar-nav ul,
.sidebar-menu-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.sidebar-nav li {
  margin: 0;
  padding: 0;
  width: 100%;
}

.sidebar-nav a,
.sidebar-menu-list a {
  display: block;
  padding: 12px 18px;
  color: var(--text-color);
  font-size: 1.1rem;
  font-weight: 600;
  text-decoration: none;
  border-radius: 8px;
  background-color: transparent;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.sidebar-nav a:hover,
.sidebar-menu-list a:hover {
  background-color: rgba(255, 255, 255, 0.08);
  color: var(--accent-blue);
}

.sidebar-nav .current-menu-item > a,
.sidebar-nav .current_page_item > a,
.sidebar-menu-list .current-menu-item > a,
.sidebar-menu-list .current_page_item > a {
  background-color: var(--accent-blue);
  color: #ffffff;
  font-weight: 700;
}

/* ==========================================================================
   Single Post & Content Styling
   ========================================================================== */
.single-post-container {
  padding: 40px 0;
  max-width: 860px;
  margin: 0 auto;
}

.post-banner {
  text-align: center;
  padding: 30px 20px;
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  margin-bottom: 35px;
}

.post-title {
  font-size: 2.2rem;
  color: #ffffff;
  margin-bottom: 10px;
  line-height: 1.3;
}

.post-categories a {
  display: inline-block;
  background-color: var(--accent-blue);
  color: #ffffff;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 4px;
  text-decoration: none;
  text-transform: uppercase;
  margin: 0 3px;
}

.post-body-content {
  font-size: 1.05rem;
  line-height: 1.7;
  color: var(--text-light);
  margin-bottom: 35px;
}

.post-body-content p {
  margin-bottom: 20px;
}

.post-body-content h2, 
.post-body-content h3 {
  color: #ffffff;
  margin: 30px 0 15px 0;
}

.post-top-banner-wrapper {
  position: relative;
  width: 100%;
  height: 280px;
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 35px;
  border: 1px solid var(--border-color);
}

.post-top-banner-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.post-banner-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.85) 0%, rgba(0, 0, 0, 0.2) 100%);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 25px;
  box-sizing: border-box;
}

.post-banner-overlay .post-title {
  margin: 0 0 10px 0;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.6);
}

/* ==========================================================================
   Embedded Media / YouTube Frames (Modern Aspect-Ratio Fix)
   ========================================================================== */
/* Force outer embed wrappers to full width */
.wp-block-embed,
.wp-block-embed-youtube,
.embed-youtube,
.wp-block-embed__wrapper {
  width: 100% !important;
  max-width: 100% !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
}

/* Use native CSS aspect-ratio so height is automatically calculated from full width */
.wp-block-embed-youtube,
.embed-youtube,
.wp-block-embed-youtube .wp-block-embed__wrapper,
.wp-block-embed.is-type-video .wp-block-embed__wrapper,
.post-body-content iframe[src*="youtube.com"],
.post-body-content iframe[src*="youtube-nocookie.com"] {
  position: relative !important;
  width: 100% !important;
  height: auto !important;
  aspect-ratio: 16 / 9 !important;
  margin: 2rem 0 !important;
  padding: 0 !important;
  overflow: hidden !important;
  border-radius: 8px;
}

/* Force iframe to strictly fill the aspect ratio box */
.wp-block-embed iframe,
.wp-block-embed-youtube iframe,
.embed-youtube iframe,
.post-body-content iframe {
  width: 100% !important;
  height: 100% !important;
  max-width: 100% !important;
  border: 0 !important;
  display: block !important;
}

/* ==========================================================================
   Search Engine Page
   ========================================================================== */
.search-engine-page {
  padding: 40px 20px;
  max-width: 1100px;
  margin: 0 auto;
}

.search-header {
  text-align: center;
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  padding: 35px 20px;
  border-radius: 12px;
  margin-bottom: 40px;
}

.search-header h1 {
  font-size: 2.2rem;
  color: #ffffff;
  margin-bottom: 8px;
}

.search-header p {
  color: var(--text-muted);
  margin-bottom: 25px;
}

.search-input-group {
  display: flex;
  gap: 10px;
  max-width: 700px;
  margin: 0 auto;
  flex-wrap: wrap;
}

.search-input,
.search-select {
  padding: 12px 16px;
  background-color: #1a1a1a;
  border: 1px solid var(--border-color);
  color: #ffffff;
  border-radius: 8px;
  font-size: 0.95rem;
}

.search-input {
  flex: 1;
  min-width: 240px;
}

.search-btn {
  background-color: var(--accent-blue);
  color: #ffffff;
  font-weight: 700;
  border: none;
  padding: 12px 24px;
  border-radius: 8px;
  cursor: pointer;
  transition: opacity 0.2s;
}

.search-btn:hover {
  opacity: 0.9;
}

/* Results Grid */
.posts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 25px;
}

.post-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.card-image-link {
  display: block;
  height: 180px;
  overflow: hidden;
}

.card-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.card-content {
  padding: 20px;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.card-tags a {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--accent-blue);
  text-decoration: none;
  margin-right: 5px;
}

.card-title {
  font-size: 1.25rem;
  margin: 8px 0 10px 0;
}

.card-title a {
  color: #ffffff;
  text-decoration: none;
}

.card-excerpt {
  color: #aaaaaa;
  font-size: 0.9rem;
  line-height: 1.5;
  margin-bottom: 20px;
  flex-grow: 1;
}

.card-footer {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  color: var(--text-muted);
  border-top: 1px solid var(--border-color);
  padding-top: 12px;
}

/* ==========================================================================
   Homepage Specific Styles
   ========================================================================== */
.hero-bio-section {
  display: flex;
  justify-content: center;
  padding-top: 2.5rem;
  margin-bottom: 3rem;
}

.bio-card {
  width: 100%;
  max-width: 900px;
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 2.5rem;
  text-align: center;
}

.bio-card h1 {
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
}

.accent-text {
  color: var(--accent-gold);
}

.bio-subtitle {
  font-size: 1.2rem;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}

.bio-content p {
  line-height: 1.7;
  color: var(--text-light);
  font-size: 1.05rem;
  margin-bottom: 2rem;
}

.hero-actions {
  display: flex;
  justify-content: center;
  gap: 15px;
  flex-wrap: wrap;
}

.works-section, 
.news-section {
  margin-bottom: 4rem;
}

.section-header {
  text-align: center;
  margin-bottom: 2rem;
}

.section-header h2 {
  font-size: 2rem;
  margin-bottom: 0.25rem;
}

.section-header p {
  color: var(--text-muted);
}

/* Works Grid */
.works-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  padding-left: 80px;
  padding-right: 80px;
}

.work-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 2rem;
  display: flex;
  flex-direction: column;
}

.work-icon .dashicons {
  font-size: 2.2rem;
  width: auto;
  height: auto;
  color: var(--accent-gold);
  margin-bottom: 1rem;
}

.work-card h3 {
  font-size: 1.4rem;
  margin-bottom: 0.75rem;
}

.work-card p {
  color: var(--text-light);
  line-height: 1.6;
  flex-grow: 1;
  margin-bottom: 1.25rem;
}

.work-link {
  color: var(--accent-gold);
  text-decoration: none;
  font-weight: 600;
}

/* ==========================================================================
   News Grid - Fixed 3x2 Grid Format
   ========================================================================== */
.news-grid-square {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 400px));
  grid-template-rows: repeat(2, auto);
  gap: 20px;
  justify-content: center;
  max-width: 1240px;
  margin: 0 auto;
}

.news-card-square {
  width: 100%;
  max-width: 400px;
  height: 260px;
  border-radius: 10px;
  overflow: hidden;
  position: relative;
  border: 1px solid var(--border-color);
  background-color: var(--bg-card);
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.news-card-square:hover {
  transform: translateY(-4px);
  border-color: var(--accent-gold);
}

.news-square-link {
  display: block;
  width: 100%;
  height: 100%;
  position: relative;
  text-decoration: none;
}

.news-square-thumb {
  width: 100%;
  height: 100%;
}

.news-square-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.placeholder-thumb {
  background: linear-gradient(135deg, #1e1e24 0%, #0d0d11 100%);
  height: 100%;
}

.news-square-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.95) 0%, rgba(0, 0, 0, 0.65) 60%, rgba(0, 0, 0, 0.2) 100%);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 16px;
  box-sizing: border-box;
}

.news-square-date {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--accent-gold);
  text-transform: uppercase;
  margin-bottom: 4px;
}

.news-square-title {
  font-size: 1.15rem;
  line-height: 1.3;
  color: #ffffff;
  margin: 0 0 6px 0;
  font-weight: 700;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
}

.news-square-excerpt {
  font-size: 0.85rem;
  line-height: 1.4;
  color: var(--text-light, #cccccc);
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ==========================================================================
   Media Queries & Responsiveness
   ========================================================================== */
@media (max-width: 1260px) {
  .news-grid-square {
    grid-template-columns: repeat(auto-fit, minmax(280px, 400px));
  }
}

@media (max-width: 768px) {
  .works-grid {
    padding-left: 10px;
    padding-right: 10px;
  }
}

@media (max-width: 600px) {
  .site-header {
    height: 140px;
  }
  
  .site-logo {
    max-height: 120px;
  }

  .news-square-title {
    font-size: 0.95rem;
  }

  .news-square-excerpt {
    display: none;
  }
}