/*
Theme Name: TDNG Professional
Theme URI: https://trungtamdaynghe.edu.vn
Author: AWE Team
Description: Theme chuyên nghiệp cho Trung Tâm Dạy Nghề - đào tạo thiết kế nội thất, kiến trúc
Version: 1.0.0
Text Domain: tdng
*/

/* === CSS Variables === */
:root {
  --primary: #1a365d;
  --primary-light: #2a4a7f;
  --primary-dark: #0f2440;
  --accent: #0d9488;
  --accent-light: #14b8a6;
  --accent-dark: #0f766e;
  --text: #1e293b;
  --text-light: #64748b;
  --text-lighter: #94a3b8;
  --bg: #ffffff;
  --bg-alt: #f8fafc;
  --bg-dark: #f1f5f9;
  --border: #e2e8f0;
  --shadow: 0 1px 3px rgba(0,0,0,.1), 0 1px 2px rgba(0,0,0,.06);
  --shadow-md: 0 4px 6px rgba(0,0,0,.07), 0 2px 4px rgba(0,0,0,.06);
  --shadow-lg: 0 10px 15px rgba(0,0,0,.1), 0 4px 6px rgba(0,0,0,.05);
  --radius: 8px;
  --radius-lg: 12px;
  --max-width: 1200px;
  --header-height: 72px;
  --transition: .2s ease;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* === Reset & Base === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.7;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--accent-dark); }

h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  line-height: 1.3;
  color: var(--primary);
}

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

/* === Header === */
.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  height: var(--header-height);
  backdrop-filter: blur(8px);
  background: rgba(255,255,255,.95);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-height);
}

.site-branding {
  display: flex;
  align-items: center;
  gap: 12px;
}

.site-branding .custom-logo {
  height: 44px;
  width: auto;
}

.site-title {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--primary);
  letter-spacing: -0.02em;
}

.site-title a { color: inherit; }
.site-title a:hover { color: var(--accent); }

/* Navigation */
.main-nav ul {
  list-style: none;
  display: flex;
  gap: 4px;
}

.main-nav li { position: relative; }

.main-nav a {
  display: block;
  padding: 8px 16px;
  color: var(--text);
  font-size: .9rem;
  font-weight: 500;
  border-radius: 6px;
  transition: all var(--transition);
}

.main-nav a:hover,
.main-nav .current-menu-item > a,
.main-nav .current_page_item > a {
  color: var(--accent);
  background: rgba(13,148,136,.06);
}

/* Dropdown */
.main-nav .sub-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 220px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 6px;
  z-index: 100;
}

.main-nav li:hover > .sub-menu { display: block; }

.main-nav .sub-menu a {
  padding: 8px 14px;
  font-size: .85rem;
}

/* Mobile toggle */
.menu-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  color: var(--text);
}

.menu-toggle svg { width: 24px; height: 24px; }

/* === Hero Section === */
.hero {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 50%, var(--accent-dark) 100%);
  color: #fff;
  padding: 80px 0 90px;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.04'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

.hero-content {
  position: relative;
  z-index: 1;
  max-width: 700px;
}

.hero h1 {
  font-size: 2.75rem;
  color: #fff;
  margin-bottom: 18px;
  letter-spacing: -0.03em;
  line-height: 1.15;
}

.hero p {
  font-size: 1.15rem;
  opacity: .9;
  margin-bottom: 32px;
  line-height: 1.7;
}

.hero-actions {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 28px;
  border-radius: var(--radius);
  font-size: .95rem;
  font-weight: 600;
  cursor: pointer;
  border: 2px solid transparent;
  transition: all var(--transition);
}

.btn-primary {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.btn-primary:hover {
  background: var(--accent-light);
  border-color: var(--accent-light);
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(13,148,136,.3);
}

.btn-outline {
  background: transparent;
  color: #fff;
  border-color: rgba(255,255,255,.4);
}

.btn-outline:hover {
  background: rgba(255,255,255,.1);
  border-color: #fff;
  color: #fff;
}

/* === Stats Bar === */
.stats-bar {
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  padding: 28px 0;
  margin-top: -40px;
  position: relative;
  z-index: 2;
}

.stats-inner {
  background: var(--bg);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  overflow: hidden;
}

.stat-item {
  text-align: center;
  padding: 28px 20px;
  border-right: 1px solid var(--border);
}

.stat-item:last-child { border-right: none; }

.stat-number {
  font-size: 2rem;
  font-weight: 800;
  color: var(--accent);
  display: block;
  line-height: 1;
  margin-bottom: 6px;
}

.stat-label {
  font-size: .85rem;
  color: var(--text-light);
  font-weight: 500;
}

/* === Section Common === */
.section {
  padding: 70px 0;
}

.section-alt { background: var(--bg-alt); }

.section-header {
  text-align: center;
  margin-bottom: 48px;
}

.section-header h2 {
  font-size: 2rem;
  margin-bottom: 12px;
  letter-spacing: -0.02em;
}

.section-header p {
  color: var(--text-light);
  font-size: 1.05rem;
  max-width: 600px;
  margin: 0 auto;
}

.section-header .accent-line {
  width: 50px;
  height: 3px;
  background: var(--accent);
  margin: 16px auto 0;
  border-radius: 2px;
}

/* === Category Cards === */
.category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 24px;
}

.category-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px 24px;
  text-align: center;
  transition: all var(--transition);
}

.category-card:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.category-icon {
  width: 56px;
  height: 56px;
  background: rgba(13,148,136,.08);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
  color: var(--accent);
  font-size: 1.5rem;
}

.category-icon svg {
  width: 28px !important;
  height: 28px !important;
  flex-shrink: 0;
}

.category-card h3 {
  font-size: 1.1rem;
  margin-bottom: 8px;
}

.category-card h3 a { color: var(--primary); }
.category-card h3 a:hover { color: var(--accent); }

.category-card p {
  color: var(--text-light);
  font-size: .9rem;
}

.category-count {
  display: inline-block;
  margin-top: 12px;
  font-size: .8rem;
  font-weight: 600;
  color: var(--accent);
  background: rgba(13,148,136,.08);
  padding: 4px 12px;
  border-radius: 20px;
}

/* === Post Cards === */
.posts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 28px;
}

.post-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: all var(--transition);
}

.post-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.post-card-thumb {
  aspect-ratio: 16/9;
  overflow: hidden;
  background: var(--bg-dark);
}

.post-card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .3s ease;
}

.post-card:hover .post-card-thumb img {
  transform: scale(1.03);
}

.post-card-body {
  padding: 22px 24px;
}

.post-card-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
  font-size: .8rem;
  color: var(--text-light);
}

.post-card-cat {
  background: rgba(13,148,136,.08);
  color: var(--accent);
  padding: 3px 10px;
  border-radius: 20px;
  font-weight: 600;
  font-size: .75rem;
  text-transform: uppercase;
}

.post-card h3 {
  font-size: 1.1rem;
  margin-bottom: 8px;
  line-height: 1.4;
}

.post-card h3 a { color: var(--primary); }
.post-card h3 a:hover { color: var(--accent); }

.post-card-excerpt {
  color: var(--text-light);
  font-size: .9rem;
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.read-more {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 14px;
  font-size: .85rem;
  font-weight: 600;
  color: var(--accent);
}

.read-more:hover { gap: 8px; }

/* === CTA Section === */
.cta-section {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  color: #fff;
  padding: 70px 0;
  text-align: center;
}

.cta-section h2 {
  color: #fff;
  font-size: 2rem;
  margin-bottom: 14px;
}

.cta-section p {
  opacity: .85;
  font-size: 1.05rem;
  margin-bottom: 28px;
  max-width: 500px;
  margin-left: auto;
  margin-right: auto;
}

.cta-section .btn-primary {
  background: var(--accent);
  font-size: 1rem;
  padding: 14px 36px;
}

/* === Footer === */
.site-footer {
  background: var(--primary-dark);
  color: rgba(255,255,255,.7);
  padding: 60px 0 0;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1fr;
  gap: 40px;
  padding-bottom: 40px;
}

.footer-col h4 {
  color: #fff;
  font-size: 1rem;
  margin-bottom: 18px;
  font-weight: 600;
}

.footer-about p {
  font-size: .9rem;
  line-height: 1.7;
  margin-bottom: 16px;
}

.footer-col ul {
  list-style: none;
}

.footer-col li {
  margin-bottom: 10px;
}

.footer-col a {
  color: rgba(255,255,255,.7);
  font-size: .9rem;
  transition: color var(--transition);
}

.footer-col a:hover {
  color: var(--accent-light);
}

.footer-contact-item {
  display: flex;
  gap: 10px;
  margin-bottom: 12px;
  font-size: .9rem;
}

.footer-contact-item svg {
  width: 18px !important;
  height: 18px !important;
  min-width: 18px;
  color: var(--accent-light);
  flex-shrink: 0;
  margin-top: 3px;
}

/* Force inline SVGs to respect explicit sizing */

.footer-bottom {
  border-top: 1px solid rgba(255,255,255,.1);
  padding: 20px 0;
  text-align: center;
  font-size: .85rem;
}

/* === Blog Archive === */
.page-header {
  background: var(--primary);
  color: #fff;
  padding: 50px 0;
  margin-bottom: 50px;
}

.page-header h1 {
  color: #fff;
  font-size: 2rem;
  margin-bottom: 8px;
}

.page-header p,
.page-header .archive-description {
  opacity: .8;
  font-size: 1rem;
}

.breadcrumb {
  font-size: .85rem;
  opacity: .7;
  margin-bottom: 12px;
}

.breadcrumb a { color: rgba(255,255,255,.8); }
.breadcrumb a:hover { color: #fff; }

.content-area {
  padding: 50px 0;
}

.content-layout {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 48px;
  align-items: start;
}

.content-full { grid-template-columns: 1fr; }

/* === Single Post === */
.single-header {
  background: var(--primary);
  color: #fff;
  padding: 50px 0 60px;
}

.single-header .post-cat {
  display: inline-block;
  background: rgba(13,148,136,.8);
  color: #fff;
  padding: 4px 14px;
  border-radius: 20px;
  font-size: .8rem;
  font-weight: 600;
  margin-bottom: 14px;
}

.single-header h1 {
  color: #fff;
  font-size: 2.2rem;
  max-width: 800px;
  margin-bottom: 16px;
}

.single-meta {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: .9rem;
  opacity: .8;
}

.single-content {
  max-width: 800px;
  margin: 0 auto;
  padding: 48px 0;
}

.single-content .entry-content {
  font-size: 1.05rem;
  line-height: 1.8;
}

.single-content .entry-content h2 {
  margin: 36px 0 16px;
  font-size: 1.5rem;
}

.single-content .entry-content h3 {
  margin: 28px 0 12px;
  font-size: 1.25rem;
}

.single-content .entry-content p {
  margin-bottom: 18px;
}

.single-content .entry-content ul,
.single-content .entry-content ol {
  margin: 0 0 18px 24px;
}

.single-content .entry-content li {
  margin-bottom: 6px;
}

.single-content .entry-content img {
  border-radius: var(--radius);
  margin: 24px 0;
}

.single-content .entry-content blockquote {
  border-left: 4px solid var(--accent);
  padding: 16px 24px;
  margin: 24px 0;
  background: var(--bg-alt);
  border-radius: 0 var(--radius) var(--radius) 0;
  font-style: italic;
  color: var(--text-light);
}

/* Post navigation */
.post-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-top: 48px;
  padding-top: 32px;
  border-top: 1px solid var(--border);
}

.post-nav a {
  display: block;
  padding: 16px 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: all var(--transition);
}

.post-nav a:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow);
}

.post-nav .nav-label {
  font-size: .8rem;
  color: var(--text-light);
  margin-bottom: 4px;
}

.post-nav .nav-title {
  color: var(--primary);
  font-weight: 600;
  font-size: .95rem;
}

.post-nav .next { text-align: right; }

/* === Sidebar === */
.sidebar .widget {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 24px;
}

.sidebar .widget-title {
  font-size: 1rem;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--border);
  color: var(--primary);
}

.sidebar .widget ul {
  list-style: none;
}

.sidebar .widget li {
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  font-size: .9rem;
}

.sidebar .widget li:last-child { border-bottom: none; }
.sidebar .widget a { color: var(--text); }
.sidebar .widget a:hover { color: var(--accent); }

/* === Pagination === */
.pagination {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-top: 48px;
}

.pagination .page-numbers {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-size: .9rem;
  font-weight: 500;
  transition: all var(--transition);
}

.pagination .page-numbers:hover,
.pagination .page-numbers.current {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

/* === Page Template === */
.page-content {
  max-width: 800px;
  margin: 0 auto;
  padding: 48px 0;
}

.page-content .entry-content {
  font-size: 1.05rem;
  line-height: 1.8;
}

/* === Search Form === */
.search-form {
  display: flex;
}

.search-form input[type="search"] {
  flex: 1;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius) 0 0 var(--radius);
  font-size: .9rem;
  outline: none;
}

.search-form input[type="search"]:focus {
  border-color: var(--accent);
}

.search-form button {
  padding: 10px 18px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 0 var(--radius) var(--radius) 0;
  cursor: pointer;
  font-weight: 600;
  font-size: .9rem;
}

/* === 404 === */
.error-404 {
  text-align: center;
  padding: 80px 0;
}

.error-404 h1 {
  font-size: 6rem;
  color: var(--accent);
  line-height: 1;
  margin-bottom: 12px;
}

.error-404 h2 {
  font-size: 1.5rem;
  margin-bottom: 16px;
}

.error-404 p {
  color: var(--text-light);
  margin-bottom: 28px;
}

/* === Responsive === */
@media (max-width: 1024px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .content-layout { grid-template-columns: 1fr; }
  .stats-inner { grid-template-columns: repeat(2, 1fr); }
  .stat-item:nth-child(2) { border-right: none; }
}

@media (max-width: 768px) {
  :root { --header-height: 64px; }

  .menu-toggle { display: block; }

  .main-nav {
    display: none;
    position: absolute;
    top: var(--header-height);
    left: 0;
    right: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-lg);
    padding: 12px;
  }

  .main-nav.active { display: block; }

  .main-nav ul {
    flex-direction: column;
    gap: 2px;
  }

  .main-nav .sub-menu {
    position: static;
    box-shadow: none;
    border: none;
    padding-left: 16px;
    display: none;
  }

  .main-nav li.open > .sub-menu { display: block; }

  .hero { padding: 50px 0 70px; }
  .hero h1 { font-size: 2rem; }

  .posts-grid { grid-template-columns: 1fr; }

  .footer-grid { grid-template-columns: 1fr; gap: 28px; }

  .single-header h1 { font-size: 1.6rem; }
  .post-nav { grid-template-columns: 1fr; }

  .stats-inner { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 480px) {
  .hero-actions { flex-direction: column; }
  .hero-actions .btn { justify-content: center; }
  .category-grid { grid-template-columns: 1fr; }
}
