/*
Theme Name: YouTube Mag
Theme URI: https://example.com
Author: Custom Developer
Version: 1.3.0
Description: Full end-to-end YouTube Light Mode theme for standard WordPress posts.
Text Domain: yt-style-theme
*/

:root {
  --yt-bg: #ffffff;
  --yt-surface: #f2f2f2;
  --yt-text-primary: #0f0f0f;
  --yt-text-secondary: #606060;
  --yt-border: #e5e5e5;
  --yt-hover: #e5e5e5;
  --yt-font: Roboto, Arial, sans-serif;
  --header-height: 56px;
  --filter-height: 48px;
  --bottom-nav-height: 52px;
}

/* Global Reset & Full Light Enforcements */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  background-color: var(--yt-bg) !important;
  color: var(--yt-text-primary) !important;
  font-family: var(--yt-font);
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
}

body {
  padding-top: calc(var(--header-height) + var(--filter-height));
  padding-bottom: var(--bottom-nav-height);
}

@media (min-width: 792px) {
  body {
    padding-bottom: 0;
  }
}

a {
  color: var(--yt-text-primary);
  text-decoration: none;
}

a:hover {
  color: #065fd4;
}

/* Header Navbar */
.yt-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-height);
  background: var(--yt-bg);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  z-index: 1000;
  border-bottom: 1px solid var(--yt-border);
}

.yt-logo-group {
  display: flex;
  align-items: center;
  gap: 12px;
}

.yt-menu-toggle {
  background: transparent;
  border: none;
  font-size: 1.2rem;
  padding: 8px;
  border-radius: 50%;
  cursor: pointer;
  color: var(--yt-text-primary);
  display: flex;
  align-items: center;
  justify-content: center;
}

.yt-menu-toggle:hover {
  background: var(--yt-surface);
}

.yt-logo a {
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: -0.5px;
  color: var(--yt-text-primary);
  display: flex;
  align-items: center;
  gap: 6px;
}

.yt-logo-badge {
  background: #ff0000;
  color: #fff;
  font-size: 0.75rem;
  padding: 2px 6px;
  border-radius: 4px;
}

.yt-search-form {
  display: flex;
  align-items: center;
  max-width: 600px;
  width: 100%;
  margin: 0 16px;
}

.yt-search-input {
  width: 100%;
  padding: 8px 16px;
  background: #fff;
  border: 1px solid var(--yt-border);
  border-radius: 40px 0 0 40px;
  color: var(--yt-text-primary);
  font-size: 0.95rem;
  outline: none;
}

.yt-search-input:focus {
  border-color: #1c62b9;
}

.yt-search-button {
  background: var(--yt-surface);
  border: 1px solid var(--yt-border);
  border-left: none;
  padding: 8px 20px;
  border-radius: 0 40px 40px 0;
  color: var(--yt-text-primary);
  cursor: pointer;
}

.yt-search-button:hover {
  background: var(--yt-hover);
}

/* Category Filter Bar (Below Header) */
.yt-filter-bar {
  position: fixed;
  top: var(--header-height);
  left: 0;
  right: 0;
  height: var(--filter-height);
  background: var(--yt-bg);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 16px;
  border-bottom: 1px solid var(--yt-border);
  z-index: 999;
  overflow-x: auto;
  scrollbar-width: none;
}

.yt-filter-bar::-webkit-scrollbar {
  display: none;
}

/* Styled Pill Buttons */
.yt-tab-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 12px;
  background-color: var(--yt-surface);
  color: var(--yt-text-primary);
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 500;
  white-space: nowrap;
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: background-color 0.2s ease;
}

.yt-tab-pill:hover {
  background-color: var(--yt-hover);
  color: var(--yt-text-primary);
}

.yt-tab-pill.active {
  background-color: var(--yt-text-primary);
  color: #ffffff;
}

.yt-menu-tab-btn {
  background-color: var(--yt-surface);
}

/* Page Outer Wrapper */
.yt-app-container {
  display: flex;
  min-height: calc(100vh - var(--header-height) - var(--filter-height));
  background-color: var(--yt-bg);
}

/* Collapsible Left Sidebar Navigation */
.yt-sidebar {
  width: 240px;
  background: var(--yt-bg);
  padding: 12px;
  flex-shrink: 0;
  border-right: 1px solid var(--yt-border);
  transition: margin-left 0.25s ease-in-out;
}

.yt-sidebar.collapsed {
  margin-left: -240px;
}

.yt-sidebar-menu {
  list-style: none;
}

.yt-sidebar-menu li a {
  display: flex;
  align-items: center;
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--yt-text-primary);
}

.yt-sidebar-menu li a:hover {
  background: var(--yt-surface);
}

/* Main Feed & Grid */
.yt-main-content {
  flex-grow: 1;
  padding: 24px 16px;
  width: 100%;
  background-color: var(--yt-bg);
}

.yt-posts-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px 16px;
}

@media (min-width: 600px) {
  .yt-posts-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 960px) {
  .yt-posts-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (min-width: 1280px) {
  .yt-posts-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* YouTube Light Post Card */
.yt-card {
  display: flex;
  flex-direction: column;
  background-color: transparent;
}

.yt-card-thumbnail {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 12px;
  overflow: hidden;
  background-color: var(--yt-surface);
}

.yt-card-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.2s ease;
}

.yt-card-thumbnail:hover img {
  transform: scale(1.03);
}

.yt-card-badge {
  position: absolute;
  bottom: 8px;
  right: 8px;
  background: rgba(0, 0, 0, 0.8);
  color: #fff;
  font-size: 0.75rem;
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 600;
}

.yt-card-details {
  display: flex;
  margin-top: 12px;
  gap: 12px;
}

.yt-card-avatar img {
  border-radius: 50%;
  width: 36px;
  height: 36px;
  object-fit: cover;
}

.yt-card-meta {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.yt-card-title {
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.3;
  margin-bottom: 4px;
  color: var(--yt-text-primary);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.yt-card-author,
.yt-card-stats {
  font-size: 0.8rem;
  color: var(--yt-text-secondary);
}

/* Mobile Bottom Navigation */
.yt-bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: var(--bottom-nav-height);
  background: var(--yt-bg);
  border-top: 1px solid var(--yt-border);
  display: flex;
  justify-content: space-around;
  align-items: center;
  z-index: 1000;
}

@media (min-width: 792px) {
  .yt-bottom-nav {
    display: none;
  }
}

.yt-bottom-nav a {
  font-size: 0.75rem;
  color: var(--yt-text-secondary);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.yt-bottom-nav a:hover {
  color: var(--yt-text-primary);
}