/*
Theme Name: Tin Hoc De Hieu Guide
Theme URI: https://tinhocdehieu.com/
Author: BKAP AI & ChatGPT
Author URI: https://tinhocdehieu.com/
Description: Theme WordPress dạng blog/kho hướng dẫn tin học cho người mới. Bố cục lấy cảm hứng chung từ các trang thủ thuật Việt Nam nhưng được thiết kế riêng cho Tin Học Dễ Hiểu, không sao chép nhận diện của bên thứ ba.
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.6
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: tinhocdehieu
Tags: blog, education, grid-layout, custom-logo, featured-images, right-sidebar, two-columns
*/

:root {
  --tdh-blue: #1f73d0;
  --tdh-blue-dark: #185da8;
  --tdh-blue-soft: #eef6ff;
  --tdh-orange: #ff8a00;
  --tdh-text: #1f2937;
  --tdh-muted: #6b7280;
  --tdh-line: #e5e7eb;
  --tdh-bg: #f5f7fa;
  --tdh-card: #ffffff;
  --tdh-shadow: 0 8px 24px rgba(15, 23, 42, .06);
  --tdh-radius: 14px;
  --tdh-radius-sm: 10px;
  --tdh-wrap: 1180px;
  --tdh-font: Arial, Helvetica, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--tdh-font);
  font-size: 16px;
  line-height: 1.65;
  color: var(--tdh-text);
  background: var(--tdh-bg);
  text-rendering: optimizeLegibility;
}
img { max-width: 100%; height: auto; vertical-align: middle; }
a { color: var(--tdh-blue); text-decoration: none; transition: .18s ease; }
a:hover { color: var(--tdh-orange); }
.screen-reader-text { position: absolute; left: -9999px; }
.tdh-wrap { width: min(var(--tdh-wrap), calc(100% - 32px)); margin: 0 auto; }

/* Header */
.tdh-topbar {
  background: #14213d;
  color: #dbeafe;
  font-size: 14px;
}
.tdh-topbar .tdh-wrap {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 8px 0;
}
.tdh-topbar a { color: #fff; font-weight: 600; }
.tdh-site-header {
  background: #fff;
  border-bottom: 1px solid var(--tdh-line);
}
.tdh-brand-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 18px 0;
}
.tdh-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 220px;
}
.tdh-logo-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--tdh-blue), #50a6ff);
  color: #fff;
  font-weight: 800;
  letter-spacing: -.5px;
}
.tdh-site-title {
  margin: 0;
  font-size: 27px;
  line-height: 1.15;
  font-weight: 800;
  letter-spacing: -.4px;
}
.tdh-site-title a { color: var(--tdh-text); }
.tdh-tagline {
  margin: 2px 0 0;
  color: var(--tdh-muted);
  font-size: 14px;
}
.tdh-search-form {
  display: flex;
  align-items: center;
  max-width: 440px;
  width: 100%;
  background: #f3f6fb;
  border: 1px solid var(--tdh-line);
  border-radius: 999px;
  overflow: hidden;
}
.tdh-search-form input[type="search"] {
  width: 100%;
  border: 0;
  background: transparent;
  padding: 12px 16px;
  outline: none;
  font-size: 15px;
}
.tdh-search-form button {
  border: 0;
  background: var(--tdh-blue);
  color: #fff;
  padding: 12px 18px;
  cursor: pointer;
  font-weight: 700;
}
.tdh-nav-wrap {
  background: var(--tdh-blue);
  box-shadow: 0 10px 20px rgba(31, 115, 208, .12);
}
.tdh-main-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
}
.tdh-main-nav a {
  display: block;
  color: #fff;
  font-weight: 700;
  padding: 13px 15px;
  font-size: 15px;
}
.tdh-main-nav a:hover,
.tdh-main-nav .current-menu-item > a,
.tdh-main-nav .current-menu-parent > a {
  background: rgba(255,255,255,.14);
  color: #fff;
}
.tdh-menu-toggle { display: none; }

/* Layout */
.tdh-main { padding: 28px 0 40px; }
.tdh-content-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 28px;
  align-items: start;
}
.tdh-card {
  background: var(--tdh-card);
  border: 1px solid var(--tdh-line);
  border-radius: var(--tdh-radius);
  box-shadow: var(--tdh-shadow);
}
.tdh-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 0 0 16px;
}
.tdh-section-title {
  margin: 0;
  font-size: 22px;
  line-height: 1.25;
  font-weight: 800;
  color: var(--tdh-text);
}
.tdh-section-title::before {
  content: '';
  display: inline-block;
  width: 5px;
  height: 22px;
  margin-right: 10px;
  border-radius: 99px;
  background: var(--tdh-orange);
  vertical-align: -4px;
}

/* Front page */
.tdh-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(280px, .8fr);
  gap: 22px;
  margin-bottom: 26px;
}
.tdh-hero-main {
  padding: 28px;
  background: linear-gradient(135deg, #ffffff 0%, #eef6ff 100%);
  border-radius: var(--tdh-radius);
  border: 1px solid var(--tdh-line);
  box-shadow: var(--tdh-shadow);
}
.tdh-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--tdh-blue-dark);
  background: #dbeafe;
  border-radius: 999px;
  padding: 5px 12px;
  font-weight: 800;
  font-size: 13px;
}
.tdh-hero h1 {
  font-size: clamp(30px, 4vw, 44px);
  line-height: 1.15;
  letter-spacing: -.8px;
  margin: 14px 0 12px;
}
.tdh-hero p { color: var(--tdh-muted); font-size: 17px; margin: 0 0 18px; }
.tdh-hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.tdh-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 999px;
  padding: 11px 16px;
  font-weight: 800;
  border: 1px solid transparent;
}
.tdh-btn-primary { background: var(--tdh-blue); color: #fff; }
.tdh-btn-primary:hover { background: var(--tdh-blue-dark); color: #fff; }
.tdh-btn-light { background: #fff; border-color: var(--tdh-line); color: var(--tdh-text); }
.tdh-hero-side {
  padding: 20px;
}
.tdh-hero-side h2 { margin: 0 0 12px; font-size: 20px; }
.tdh-hot-list { list-style: none; padding: 0; margin: 0; }
.tdh-hot-list li + li { border-top: 1px solid var(--tdh-line); }
.tdh-hot-list a { display: block; padding: 10px 0; color: var(--tdh-text); font-weight: 700; }
.tdh-hot-list a:hover { color: var(--tdh-blue); }

.tdh-category-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin: 0 0 26px;
}
.tdh-cat-card {
  padding: 18px;
  border-radius: var(--tdh-radius-sm);
  background: #fff;
  border: 1px solid var(--tdh-line);
  box-shadow: var(--tdh-shadow);
  color: var(--tdh-text);
  min-height: 105px;
}
.tdh-cat-icon {
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--tdh-blue-soft);
  border-radius: 12px;
  margin-bottom: 10px;
  font-size: 20px;
}
.tdh-cat-card strong { display: block; font-size: 17px; color: var(--tdh-text); line-height: 1.3; }
.tdh-cat-card span { color: var(--tdh-muted); font-size: 13px; }
.tdh-cat-card:hover { transform: translateY(-2px); border-color: #bfdbfe; }

/* Posts */
.tdh-post-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}
.tdh-post-card {
  overflow: hidden;
  background: #fff;
  border: 1px solid var(--tdh-line);
  border-radius: var(--tdh-radius);
  box-shadow: var(--tdh-shadow);
  height: 100%;
}
.tdh-post-thumb {
  display: block;
  position: relative;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  background: linear-gradient(135deg, #dbeafe, #fff7ed);
}
.tdh-post-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .25s ease;
}
.tdh-post-card:hover .tdh-post-thumb img { transform: scale(1.035); }
.tdh-post-body { padding: 14px 15px 16px; }
.tdh-post-meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  color: var(--tdh-muted);
  font-size: 13px;
  margin-bottom: 7px;
}
.tdh-post-title {
  margin: 0 0 8px;
  font-size: 18px;
  line-height: 1.35;
  font-weight: 800;
}
.tdh-post-title a { color: var(--tdh-text); }
.tdh-post-title a:hover { color: var(--tdh-blue); }
.tdh-excerpt { color: var(--tdh-muted); margin: 0; font-size: 14.5px; }
.tdh-featured-list {
  display: grid;
  gap: 14px;
}
.tdh-featured-list .tdh-post-card {
  display: grid;
  grid-template-columns: 210px minmax(0,1fr);
}
.tdh-featured-list .tdh-post-thumb { aspect-ratio: 4 / 3; }

/* Article */
.tdh-article {
  padding: 26px;
}
.tdh-breadcrumb {
  color: var(--tdh-muted);
  font-size: 14px;
  margin-bottom: 12px;
}
.tdh-breadcrumb a { color: var(--tdh-muted); }
.tdh-entry-title {
  margin: 0 0 10px;
  font-size: clamp(28px, 3vw, 40px);
  line-height: 1.2;
  letter-spacing: -.6px;
}
.tdh-entry-meta {
  color: var(--tdh-muted);
  font-size: 14px;
  margin-bottom: 18px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.tdh-entry-thumb {
  margin: 0 0 22px;
  border-radius: var(--tdh-radius);
  overflow: hidden;
  border: 1px solid var(--tdh-line);
}
.tdh-entry-content {
  font-size: 18px;
}
.tdh-entry-content h2 {
  margin-top: 1.6em;
  font-size: 28px;
  line-height: 1.3;
  border-left: 5px solid var(--tdh-orange);
  padding-left: 12px;
}
.tdh-entry-content h3 { margin-top: 1.4em; font-size: 23px; line-height: 1.35; }
.tdh-entry-content p { margin: 0 0 1.05em; }
.tdh-entry-content ul,
.tdh-entry-content ol { padding-left: 1.25em; }
.tdh-entry-content li { margin-bottom: .45em; }
.tdh-entry-content blockquote {
  margin: 1.4em 0;
  padding: 16px 18px;
  border-left: 5px solid var(--tdh-blue);
  background: var(--tdh-blue-soft);
  border-radius: 0 var(--tdh-radius-sm) var(--tdh-radius-sm) 0;
}
.tdh-entry-content table { width: 100%; border-collapse: collapse; margin: 1.2em 0; font-size: 16px; }
.tdh-entry-content th,
.tdh-entry-content td { border: 1px solid var(--tdh-line); padding: 10px; }
.tdh-entry-content th { background: #f8fafc; }
.tdh-entry-content code { background: #f3f4f6; padding: 2px 5px; border-radius: 5px; }
.tdh-entry-content pre { overflow: auto; padding: 16px; background: #111827; color: #f9fafb; border-radius: var(--tdh-radius-sm); }
.tdh-tags { margin-top: 22px; }
.tdh-tags a { display: inline-block; margin: 0 6px 8px 0; padding: 5px 10px; border-radius: 999px; background: #f3f4f6; color: var(--tdh-muted); font-size: 14px; }
.tdh-author-box,
.tdh-related-box,
.tdh-comment-box {
  margin-top: 22px;
  padding: 20px;
}
.tdh-author-box h3,
.tdh-related-box h3,
.tdh-comment-box h3 { margin-top: 0; }

/* Archive */
.tdh-archive-head { padding: 22px; margin-bottom: 18px; }
.tdh-archive-head h1 { margin: 0 0 6px; font-size: 30px; }
.tdh-pagination { margin: 28px 0 0; text-align: center; }
.tdh-pagination .page-numbers {
  display: inline-flex;
  min-width: 40px;
  height: 40px;
  align-items: center;
  justify-content: center;
  margin: 0 3px;
  border-radius: 10px;
  background: #fff;
  border: 1px solid var(--tdh-line);
  color: var(--tdh-text);
  font-weight: 700;
}
.tdh-pagination .current { background: var(--tdh-blue); color: #fff; border-color: var(--tdh-blue); }

/* Sidebar */
.tdh-sidebar { display: grid; gap: 18px; }
.widget,
.tdh-widget {
  background: #fff;
  border: 1px solid var(--tdh-line);
  border-radius: var(--tdh-radius);
  box-shadow: var(--tdh-shadow);
  padding: 18px;
}
.widget-title,
.tdh-widget-title {
  margin: 0 0 12px;
  font-size: 19px;
  font-weight: 800;
}
.widget ul { list-style: none; padding: 0; margin: 0; }
.widget li { padding: 8px 0; border-bottom: 1px solid var(--tdh-line); }
.widget li:last-child { border-bottom: 0; }
.tdh-small-post { display: grid; grid-template-columns: 82px minmax(0,1fr); gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--tdh-line); }
.tdh-small-post:last-child { border-bottom: 0; }
.tdh-small-thumb { aspect-ratio: 4/3; border-radius: 9px; background: var(--tdh-blue-soft); overflow: hidden; }
.tdh-small-thumb img { width: 100%; height: 100%; object-fit: cover; }
.tdh-small-title { margin: 0; font-size: 14px; line-height: 1.35; font-weight: 800; }
.tdh-small-title a { color: var(--tdh-text); }
.tdh-small-date { color: var(--tdh-muted); font-size: 12px; }

/* Footer */
.tdh-footer {
  background: #111827;
  color: #d1d5db;
  padding: 34px 0 0;
}
.tdh-footer a { color: #f9fafb; }
.tdh-footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 26px;
  padding-bottom: 26px;
}
.tdh-footer h3 { color: #fff; margin: 0 0 10px; }
.tdh-footer ul { list-style: none; padding: 0; margin: 0; }
.tdh-footer li { margin-bottom: 8px; }
.tdh-copyright {
  border-top: 1px solid rgba(255,255,255,.1);
  padding: 14px 0;
  font-size: 14px;
  color: #9ca3af;
}
.tdh-backtop {
  position: fixed;
  right: 18px;
  bottom: 18px;
  width: 42px;
  height: 42px;
  border-radius: 999px;
  background: var(--tdh-blue);
  color: #fff;
  display: none;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  box-shadow: var(--tdh-shadow);
}
.tdh-backtop.is-visible { display: flex; }

/* WP defaults */
.aligncenter { display: block; margin-left: auto; margin-right: auto; }
.alignleft { float: left; margin: .4em 1em .8em 0; }
.alignright { float: right; margin: .4em 0 .8em 1em; }
.wp-caption { max-width: 100%; color: var(--tdh-muted); font-size: 14px; }
.gallery { display: grid; gap: 10px; }

@media (max-width: 1024px) {
  .tdh-content-layout { grid-template-columns: 1fr; }
  .tdh-sidebar { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .tdh-post-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .tdh-category-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
}
@media (max-width: 760px) {
  .tdh-topbar .tdh-wrap { display: block; }
  .tdh-brand-row { display: block; }
  .tdh-search-form { margin-top: 14px; max-width: none; }
  .tdh-menu-toggle { display: block; border: 0; background: var(--tdh-blue-dark); color: #fff; padding: 12px 14px; width: 100%; text-align: left; font-weight: 800; }
  .tdh-main-nav ul { display: none; }
  .tdh-main-nav.is-open ul { display: block; }
  .tdh-main-nav a { border-top: 1px solid rgba(255,255,255,.14); }
  .tdh-hero { grid-template-columns: 1fr; }
  .tdh-post-grid, .tdh-featured-list .tdh-post-card, .tdh-footer-grid, .tdh-sidebar { grid-template-columns: 1fr; }
  .tdh-category-grid { grid-template-columns: 1fr; }
  .tdh-article { padding: 18px; }
  .tdh-entry-content { font-size: 17px; }
  .tdh-entry-content h2 { font-size: 24px; }
}
