/*
Theme Name: TruyenFull HD
Theme URI: https://truyenfullhd.com
Author: TruyenFull HD
Author URI: https://truyenfullhd.com
Description: Theme WordPress cho thư viện đọc truyện chữ và nghe truyện audio TruyenFull HD. Cấu trúc chuẩn với header, footer, sidebar, template-parts tách rõ; layout đầy đủ cho page, bài viết, chuyên mục, tìm kiếm; tối ưu đọc trên di động.
Version: 1.0.1
Requires at least: 6.0
Tested up to: 6.7
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: kira-truyenfullhd
Tags: blog, news, two-columns, right-sidebar, custom-menu, featured-images, translation-ready
*/

:root {
  --tf-accent: #147a66;
  --tf-accent-dark: #0e5b4c;
  --tf-orange: #e8943a;
  --tf-ink: #22303c;
  --tf-muted: #64748b;
  --tf-bg: #f4f6f8;
  --tf-card: #ffffff;
  --tf-line: #e2e8f0;
  --tf-radius: 10px;
  --tf-shadow: 0 1px 3px rgba(15, 23, 42, .08);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 17px;
  line-height: 1.7;
  color: var(--tf-ink);
  background: var(--tf-bg);
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--tf-accent); text-decoration: none; }
a:hover { color: var(--tf-accent-dark); }
h1, h2, h3, h4 { line-height: 1.3; color: var(--tf-ink); }
.screen-reader-text {
  border: 0; clip: rect(1px,1px,1px,1px); clip-path: inset(50%);
  height: 1px; width: 1px; margin: -1px; overflow: hidden;
  padding: 0; position: absolute;
}

.tf-container { max-width: 1180px; margin: 0 auto; padding: 0 20px; }

/* ===== Header ===== */
.site-header { background: var(--tf-card); border-bottom: 1px solid var(--tf-line); position: sticky; top: 0; z-index: 50; }
.site-header .tf-container { display: flex; align-items: center; gap: 14px; min-height: 64px; }
.site-branding { flex-shrink: 0; }
.site-branding img.custom-logo, .site-branding img { max-height: 40px; width: auto; }
.site-branding .site-title { font-size: 22px; font-weight: 800; margin: 0; white-space: nowrap; }
.site-branding .site-title a { color: var(--tf-ink); }

.main-navigation { margin-left: auto; }
.main-navigation ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 2px; }
.main-navigation li { position: relative; }
.main-navigation a {
  display: block; padding: 8px 11px; font-weight: 600; font-size: 14px;
  white-space: nowrap; color: var(--tf-ink); border-radius: 8px;
}
.main-navigation a:hover,
.main-navigation .current-menu-item > a,
.main-navigation .current_page_item > a { background: #eaf4f1; color: var(--tf-accent-dark); }
.main-navigation ul ul {
  position: absolute; left: 0; top: 100%; min-width: 220px; background: var(--tf-card);
  border: 1px solid var(--tf-line); border-radius: 8px; box-shadow: var(--tf-shadow);
  display: none; flex-direction: column; padding: 6px;
}
.main-navigation li:hover > ul, .main-navigation li:focus-within > ul { display: flex; }

.header-search { flex-shrink: 0; }
.menu-toggle {
  display: none; margin-left: auto; background: var(--tf-accent); color: #fff;
  border: 0; border-radius: 8px; padding: 10px 14px; font-size: 15px; font-weight: 700; cursor: pointer;
}

/* ===== Search form ===== */
.search-form { display: flex; gap: 8px; }
.search-form .search-field {
  border: 1px solid var(--tf-line); border-radius: 8px; padding: 8px 12px;
  font-size: 14px; min-width: 140px; background: #fff; color: var(--tf-ink);
}
.search-form .search-field:focus { outline: 2px solid var(--tf-accent); border-color: var(--tf-accent); }
.search-form .search-submit {
  background: var(--tf-accent); color: #fff; border: 0; border-radius: 8px;
  padding: 9px 16px; font-weight: 700; cursor: pointer;
}
.search-form .search-submit:hover { background: var(--tf-accent-dark); }

/* ===== Hero ===== */
.tf-hero { position: relative; color: #fff; overflow: hidden; }
.tf-hero .tf-hero-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.tf-hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(10,35,30,.88) 0%, rgba(10,35,30,.55) 60%, rgba(10,35,30,.25) 100%); }
.tf-hero-inner { position: relative; z-index: 2; padding: 90px 0; max-width: 640px; }
.tf-hero h1 { color: #fff; font-size: 42px; margin: 0 0 16px; }
.tf-hero p { font-size: 19px; color: #e4ece9; margin: 0 0 28px; }
.tf-btn {
  display: inline-block; background: var(--tf-orange); color: #fff !important;
  padding: 13px 26px; border-radius: 9px; font-weight: 700; font-size: 16px;
}
.tf-btn:hover { filter: brightness(1.08); }
.tf-btn.tf-btn-ghost { background: rgba(255,255,255,.14); border: 1px solid rgba(255,255,255,.5); margin-left: 10px; }

/* ===== Layout ===== */
.site-main { padding: 44px 0 64px; }
.tf-layout { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 36px; }
.tf-layout.tf-no-sidebar { grid-template-columns: minmax(0, 1fr); }

/* ===== Sections / headings ===== */
.tf-section { margin-bottom: 48px; }
.tf-section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 22px; }
.tf-section-head h2 { font-size: 26px; margin: 0; padding-left: 14px; border-left: 5px solid var(--tf-orange); }
.tf-section-head .tf-more { font-weight: 700; font-size: 15px; white-space: nowrap; }

/* ===== Cards ===== */
.tf-grid { display: grid; gap: 24px; }
.tf-grid-3 { grid-template-columns: repeat(3, 1fr); }
.tf-grid-4 { grid-template-columns: repeat(4, 1fr); }
.tf-card {
  background: var(--tf-card); border: 1px solid var(--tf-line); border-radius: var(--tf-radius);
  overflow: hidden; box-shadow: var(--tf-shadow); display: flex; flex-direction: column;
  transition: transform .15s ease, box-shadow .15s ease;
}
.tf-card:hover { transform: translateY(-3px); box-shadow: 0 8px 20px rgba(15,23,42,.12); }
.tf-card-thumb { display: block; aspect-ratio: 16/10; overflow: hidden; }
.tf-card-thumb img { width: 100%; height: 100%; object-fit: cover; }
.tf-card-body { padding: 16px 18px 20px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.tf-card-cat { font-size: 12.5px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; color: var(--tf-orange); }
.tf-card-title { font-size: 17.5px; margin: 0; font-weight: 700; }
.tf-card-title a { color: var(--tf-ink); }
.tf-card-title a:hover { color: var(--tf-accent); }
.tf-card-excerpt { font-size: 14.5px; color: var(--tf-muted); margin: 0; }
.tf-card-meta { margin-top: auto; font-size: 13px; color: var(--tf-muted); }

/* Category tiles */
.tf-cat-tile { position: relative; border-radius: var(--tf-radius); overflow: hidden; aspect-ratio: 4/3; display: block; }
.tf-cat-tile img { width: 100%; height: 100%; object-fit: cover; transition: transform .2s ease; }
.tf-cat-tile:hover img { transform: scale(1.05); }
.tf-cat-tile span {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 22px 16px 12px;
  background: linear-gradient(transparent, rgba(8,20,17,.85)); color: #fff; font-weight: 700; font-size: 16px;
}

/* ===== Article ===== */
.tf-article {
  background: var(--tf-card); border: 1px solid var(--tf-line); border-radius: var(--tf-radius);
  padding: 34px 38px; box-shadow: var(--tf-shadow);
}
.tf-article .entry-title { font-size: 32px; margin: 0 0 12px; }
.entry-meta { font-size: 14px; color: var(--tf-muted); margin-bottom: 20px; display: flex; flex-wrap: wrap; gap: 6px 16px; }
.entry-meta a { color: var(--tf-accent); font-weight: 600; }
.tf-featured { margin: 0 0 26px; border-radius: 8px; overflow: hidden; }
.entry-content { font-size: 17px; }
.entry-content > * { max-width: 72ch; }
.entry-content img { border-radius: 8px; }
.entry-content h2 { margin-top: 38px; font-size: 25px; }
.entry-content h3 { margin-top: 30px; font-size: 20px; }
.entry-content blockquote {
  border-left: 4px solid var(--tf-accent); margin: 24px 0; padding: 8px 20px;
  background: #f0f7f5; border-radius: 0 8px 8px 0; color: #33424e;
}
.entry-content ul, .entry-content ol { padding-left: 26px; }
.entry-content table { border-collapse: collapse; width: 100%; }
.entry-content th, .entry-content td { border: 1px solid var(--tf-line); padding: 10px 14px; text-align: left; }
.entry-content th { background: #eef4f2; }
.entry-tags { margin-top: 26px; font-size: 14px; }
.entry-tags a {
  display: inline-block; background: #eef4f2; color: var(--tf-accent-dark);
  border-radius: 999px; padding: 4px 14px; margin: 0 6px 8px 0; font-weight: 600;
}

/* Breadcrumb */
.tf-breadcrumb { font-size: 14px; color: var(--tf-muted); margin-bottom: 18px; }
.tf-breadcrumb a { color: var(--tf-muted); }
.tf-breadcrumb a:hover { color: var(--tf-accent); }
.tf-breadcrumb .sep { margin: 0 8px; color: #9aa7b4; }

/* Archive header */
.tf-archive-head { margin-bottom: 28px; }
.tf-archive-head h1 { font-size: 30px; margin: 0 0 8px; }
.tf-archive-head .tf-archive-desc { color: var(--tf-muted); max-width: 76ch; }

/* ===== Sidebar ===== */
.tf-sidebar .widget {
  background: var(--tf-card); border: 1px solid var(--tf-line); border-radius: var(--tf-radius);
  padding: 22px; margin-bottom: 26px; box-shadow: var(--tf-shadow);
}
.tf-sidebar .widget-title { font-size: 18px; margin: 0 0 16px; padding-left: 12px; border-left: 4px solid var(--tf-orange); }
.tf-sidebar ul { list-style: none; margin: 0; padding: 0; }
.tf-sidebar li { padding: 9px 0; border-bottom: 1px dashed var(--tf-line); font-size: 15px; }
.tf-sidebar li:last-child { border-bottom: 0; }
.tf-sidebar a { color: var(--tf-ink); font-weight: 600; }
.tf-sidebar a:hover { color: var(--tf-accent); }
.widget_recent_entries .post-date { display: block; font-size: 13px; color: var(--tf-muted); }

/* ===== Related posts ===== */
.tf-related { margin-top: 42px; }
.tf-related h2 { font-size: 22px; margin-bottom: 18px; padding-left: 12px; border-left: 4px solid var(--tf-orange); }

/* ===== Pagination ===== */
.tf-pagination { margin-top: 36px; display: flex; justify-content: center; }
.tf-pagination .nav-links { display: flex; gap: 8px; flex-wrap: wrap; }
.tf-pagination .page-numbers {
  display: inline-block; min-width: 42px; text-align: center; padding: 9px 12px;
  background: var(--tf-card); border: 1px solid var(--tf-line); border-radius: 8px;
  color: var(--tf-ink); font-weight: 700;
}
.tf-pagination .page-numbers.current, .tf-pagination .page-numbers:hover { background: var(--tf-accent); color: #fff; border-color: var(--tf-accent); }
.post-navigation .nav-links { display: flex; justify-content: space-between; gap: 20px; margin-top: 30px; font-weight: 600; }

/* ===== 404 & none ===== */
.tf-notfound { text-align: center; padding: 60px 20px; }
.tf-notfound .tf-404 { font-size: 96px; font-weight: 900; color: var(--tf-accent); margin: 0; line-height: 1; }
.tf-notfound p { color: var(--tf-muted); max-width: 60ch; margin: 16px auto 26px; }

/* ===== Footer ===== */
.site-footer { background: #142430; color: #c7d2da; margin-top: 20px; }
.tf-footer-cols { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 40px; padding: 52px 0 40px; }
.site-footer h3 { color: #fff; font-size: 17px; margin: 0 0 16px; }
.site-footer p { font-size: 14.5px; margin: 0 0 12px; }
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { padding: 6px 0; }
.site-footer a { color: #c7d2da; }
.site-footer a:hover { color: var(--tf-orange); }
.tf-footer-logo img { max-height: 44px; width: auto; margin-bottom: 14px; }
.tf-footer-bottom { border-top: 1px solid rgba(255,255,255,.12); padding: 18px 0; font-size: 14px; text-align: center; color: #9fb0bc; }

/* ===== Responsive ===== */
@media (max-width: 1160px) {
  .header-search { display: none; }
}
@media (max-width: 1000px) {
  .tf-layout { grid-template-columns: 1fr; }
  .tf-grid-4 { grid-template-columns: repeat(2, 1fr); }
  .tf-grid-3 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 920px) {
  body { font-size: 16px; }
  .menu-toggle { display: inline-block; }
  .main-navigation { display: none; position: absolute; top: 100%; left: 0; right: 0;
    background: var(--tf-card); border-bottom: 1px solid var(--tf-line); margin: 0; padding: 10px 16px 16px; }
  .main-navigation.toggled { display: block; }
  .main-navigation ul { flex-direction: column; }
  .main-navigation ul ul { position: static; display: block; border: 0; box-shadow: none; padding-left: 16px; }
  .main-navigation a { font-size: 15px; padding: 10px 12px; }
  .tf-hero-inner { padding: 56px 0; }
  .tf-hero h1 { font-size: 30px; }
  .tf-hero p { font-size: 16.5px; }
  .tf-article { padding: 22px 18px; }
  .tf-article .entry-title { font-size: 25px; }
  .tf-footer-cols { grid-template-columns: 1fr; gap: 26px; padding: 36px 0 28px; }
}
@media (max-width: 540px) {
  .tf-grid-3, .tf-grid-4 { grid-template-columns: 1fr; }
  .tf-btn.tf-btn-ghost { margin-left: 0; margin-top: 10px; }
}
