/*
Theme Name: GiaTieu Theme
Theme URI: https://giatieu.vn
Author: giatieu.vn
Description: Theme tin tức + giá tiêu cho giatieu.vn, dùng kèm plugin GiaTieu Prices.
Version: 1.2.6
Text Domain: giatieu
*/

:root {
  --green: #0a4d32;
  --green-mid: #138050;
  --green-bright: #1fa86a;
  --gold: #c9a227;
  --gold-soft: #e8d48b;
  --bg: #f3f6f4;
  --bg-accent: radial-gradient(1200px 500px at 10% -10%, rgba(26, 122, 79, 0.09), transparent 55%),
    radial-gradient(900px 400px at 90% 0%, rgba(201, 162, 39, 0.08), transparent 50%),
    #f3f6f4;
  --text: #0f2419;
  --muted: #5c6b62;
  --card: rgba(255, 255, 255, 0.92);
  --card-solid: #fff;
  --line: rgba(13, 93, 57, 0.12);
  --shadow: 0 4px 24px rgba(10, 77, 50, 0.07);
  --shadow-lg: 0 22px 50px rgba(10, 77, 50, 0.12);
  --radius: 20px;
  --radius-lg: 28px;
  --header-h: 72px;
  --header-bg: rgba(255, 255, 255, 0.78);
  --font: "Plus Jakarta Sans", system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  color-scheme: light;
}

[data-theme="dark"] {
  --green: #3dd68c;
  --green-mid: #2eb87a;
  --green-bright: #5ee9ad;
  --gold: #e8c96a;
  --gold-soft: #f0dfa0;
  --bg: #0c1210;
  --bg-accent: radial-gradient(1000px 480px at 8% 0%, rgba(46, 184, 122, 0.12), transparent 55%),
    radial-gradient(800px 360px at 92% 5%, rgba(232, 201, 106, 0.06), transparent 50%),
    #0c1210;
  --text: #e8f0eb;
  --muted: #94a398;
  --card: rgba(18, 28, 24, 0.92);
  --card-solid: #141c19;
  --line: rgba(94, 214, 160, 0.14);
  --shadow: 0 4px 28px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 24px 56px rgba(0, 0, 0, 0.45);
  --header-bg: rgba(18, 28, 24, 0.88);
  color-scheme: dark;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

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

a {
  text-decoration: none;
  color: inherit;
  transition: color 0.15s ease, opacity 0.15s ease;
}

a:hover {
  color: var(--green-mid);
}

.wrap {
  max-width: 1160px;
  margin: 0 auto;
  padding: 0 22px;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--header-bg);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}

.nav {
  display: flex;
  align-items: center;
  gap: 12px 18px;
  min-height: var(--header-h);
  flex-wrap: wrap;
}

.nav-toggle {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-weight: 800;
  font-size: 1.15rem;
  letter-spacing: -0.02em;
  color: var(--green);
}

.logo:hover {
  color: var(--green-mid);
}

.logo-icon {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: linear-gradient(145deg, var(--green), var(--green-bright));
  display: grid;
  place-items: center;
  color: #fff;
  box-shadow: 0 8px 22px rgba(10, 77, 50, 0.28);
}

.logo-icon svg {
  display: block;
}

.nav-toggle:focus-visible ~ .nav-cluster .nav-burger {
  outline: 2px solid var(--green-mid);
  outline-offset: 3px;
}

.nav-cluster {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--card-solid);
  color: var(--green);
  cursor: pointer;
  box-shadow: var(--shadow);
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.theme-toggle:hover {
  border-color: rgba(19, 128, 80, 0.28);
  color: var(--green-mid);
}

.theme-toggle:focus-visible {
  outline: 2px solid var(--green-mid);
  outline-offset: 3px;
}

.theme-toggle svg {
  display: block;
}

[data-theme="dark"] .theme-toggle__moon {
  display: none;
}

[data-theme="light"] .theme-toggle__sun {
  display: none;
}

.menu {
  flex: 1 1 auto;
  display: flex;
  justify-content: center;
  align-items: center;
  min-width: 0;
}

.nav-burger {
  display: none;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--card-solid);
  cursor: pointer;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 6px;
  box-shadow: var(--shadow);
}

.nav-burger span {
  display: block;
  width: 20px;
  height: 2px;
  border-radius: 2px;
  background: var(--green);
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.nav-toggle:checked ~ .nav-cluster .nav-burger span:nth-child(1) {
  transform: translateY(8px) rotate(45deg);
}

.nav-toggle:checked ~ .nav-cluster .nav-burger span:nth-child(2) {
  opacity: 0;
}

.nav-toggle:checked ~ .nav-cluster .nav-burger span:nth-child(3) {
  transform: translateY(-8px) rotate(-45deg);
}

.menu-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 8px;
  align-items: center;
}

.menu-list a {
  display: inline-flex;
  align-items: center;
  padding: 10px 14px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.875rem;
  color: #2d4a3a;
  background: transparent;
  transition: background 0.15s ease, color 0.15s ease;
}

.menu-list a:hover,
.menu-list .current-menu-item > a {
  background: rgba(19, 128, 80, 0.1);
  color: var(--green);
}

/* Hero */
.hero {
  margin-top: 28px;
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-lg);
  padding: clamp(32px, 5vw, 52px);
  color: #f4fff9;
  background: linear-gradient(125deg, var(--green) 0%, var(--green-mid) 42%, #15775a 72%, #2a8f5c 100%);
  box-shadow: var(--shadow-lg);
}

.hero::after {
  content: "";
  position: absolute;
  inset: -40% 40% auto -20%;
  height: 120%;
  background: radial-gradient(circle, rgba(232, 212, 139, 0.35) 0%, transparent 65%);
  pointer-events: none;
}

.hero > * {
  position: relative;
  z-index: 1;
}

.hero h1 {
  font-size: clamp(1.75rem, 4vw, 2.65rem);
  line-height: 1.12;
  margin: 0 0 14px;
  font-weight: 800;
  letter-spacing: -0.03em;
  max-width: 18ch;
}

.hero p {
  font-size: 1.05rem;
  line-height: 1.75;
  max-width: 42rem;
  margin: 0;
  color: rgba(244, 255, 249, 0.88);
}

.hero-kicker {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 12px 18px;
  margin-bottom: 16px;
}

.hero-kicker--tabs {
  align-items: center;
}

.hero-kicker .badge {
  margin-bottom: 0;
}

.hero-kicker__box {
  position: relative;
  flex: 1;
  min-width: min(100%, 320px);
  max-width: 420px;
}

.hero-kicker__radio {
  position: absolute;
  left: 0;
  top: 0;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.hero-kicker__toggles {
  display: inline-flex;
  gap: 6px;
  margin-bottom: 10px;
}

.hero-kicker__pill {
  cursor: pointer;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  color: rgba(244, 255, 249, 0.88);
  border: 1px solid rgba(255, 255, 255, 0.28);
  background: rgba(0, 0, 0, 0.12);
  transition: background 0.15s ease, color 0.15s ease;
}

.hero-kicker__panels {
  position: relative;
}

.hero-kicker__pane {
  display: none;
}

.hero-kicker__pane--chart .gt-chart-wrap {
  margin: 0;
}

.hero-kicker__pane--chart .gt-chart {
  padding: 10px 12px;
  border-radius: 14px;
}

.hero-kicker__pane--chart .gt-chart__canvas-wrap--compact {
  height: 140px;
}

.hero-kicker__avg {
  display: inline-flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 6px 10px;
  padding: 8px 16px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.22);
  font-size: 0.82rem;
  color: rgba(244, 255, 249, 0.92);
}

.hero-kicker__avg-label {
  font-weight: 600;
  text-transform: none;
  letter-spacing: 0;
  opacity: 0.92;
}

.hero-kicker__avg strong {
  font-size: 1.02rem;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.02em;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.22);
  padding: 8px 14px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.8rem;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  margin-bottom: 16px;
}

.badge::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--gold-soft);
  box-shadow: 0 0 0 3px rgba(232, 212, 139, 0.35);
}

/* Sections */
.section {
  margin-top: 40px;
}

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.section-head h2 {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.section-kicker {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--muted);
}

.grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 26px;
  align-items: start;
}

.panel,
.post-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(8px);
}

.post-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.post-card {
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.post-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
  border-color: rgba(19, 128, 80, 0.22);
}

.post-card h2,
.post-card h3 {
  margin: 0 0 10px;
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.35;
}

.post-card h2 a:hover,
.post-card h3 a:hover {
  color: var(--green);
}

.post-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.65;
}

.entry {
  background: var(--card-solid);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: clamp(22px, 4vw, 34px);
  box-shadow: var(--shadow);
  line-height: 1.85;
}

.entry h1 {
  font-size: clamp(1.75rem, 3.5vw, 2.35rem);
  line-height: 1.15;
  margin-top: 0;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.meta {
  color: var(--muted);
  font-size: 0.875rem;
  margin-bottom: 22px;
}

.sidebar-box {
  background: var(--card-solid);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  margin-bottom: 20px;
  box-shadow: var(--shadow);
}

.sidebar-box h3 {
  margin: 0 0 14px;
  font-size: 1rem;
  font-weight: 800;
}

.site-footer {
  text-align: center;
  color: var(--muted);
  padding: 40px 0 48px;
  font-size: 0.9rem;
  border-top: 1px solid var(--line);
  margin-top: 48px;
  background: linear-gradient(180deg, transparent, rgba(255, 255, 255, 0.65));
}

[data-theme="dark"] .site-footer {
  background: linear-gradient(180deg, transparent, rgba(0, 0, 0, 0.2));
}

.breadcrumb {
  margin: 8px 0 20px;
  color: var(--muted);
  font-size: 0.875rem;
}

.breadcrumb a:hover {
  color: var(--green);
}

.province-links {
  display: grid;
  gap: 10px;
}

.province-links a {
  background: rgba(19, 128, 80, 0.06);
  border: 1px solid var(--line);
  padding: 12px 14px;
  border-radius: 12px;
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--green);
  transition: background 0.15s ease, border-color 0.15s ease;
}

.province-links a:hover {
  background: rgba(19, 128, 80, 0.12);
  border-color: rgba(19, 128, 80, 0.25);
  color: var(--green);
}

/* Tin tức — card danh sách */
.news-section {
  margin-top: 44px;
}

.news-panel {
  max-width: 720px;
  margin: 0 auto;
  background: var(--card-solid);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: clamp(22px, 4vw, 32px) clamp(22px, 4vw, 36px);
  box-shadow:
    0 1px 2px rgba(10, 77, 50, 0.04),
    0 16px 48px rgba(10, 77, 50, 0.08);
}

.news-panel__head {
  margin-bottom: 22px;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--line);
}

.news-panel__title {
  margin: 0 0 6px;
  font-size: clamp(1.2rem, 2.5vw, 1.45rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text);
}

.news-panel__kicker {
  margin: 0;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--muted);
}

.news-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.news-list__item {
  margin: 0;
}

.news-row {
  display: flex;
  align-items: center;
  gap: 16px 18px;
  padding: 14px 16px;
  border-radius: 16px;
  background: rgba(15, 36, 25, 0.028);
  border: 1px solid rgba(13, 93, 57, 0.08);
  text-decoration: none;
  color: inherit;
  transition:
    background 0.2s ease,
    border-color 0.2s ease,
    box-shadow 0.2s ease,
    transform 0.2s ease;
}

.news-row:hover {
  background: rgba(19, 128, 80, 0.06);
  border-color: rgba(19, 128, 80, 0.16);
  box-shadow: 0 6px 22px rgba(10, 77, 50, 0.08);
  transform: translateY(-1px);
}

.news-row:focus-visible {
  outline: 2px solid var(--green-mid);
  outline-offset: 2px;
}

.news-row--static {
  cursor: default;
  pointer-events: none;
}

.news-row--static:hover {
  transform: none;
  box-shadow: none;
}

.news-row__thumb {
  flex-shrink: 0;
  width: 56px;
  height: 56px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  overflow: hidden;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.65);
}

.news-row__thumb--v0 {
  background: linear-gradient(135deg, #d8f5e8 0%, #fff5e4 100%);
}

.news-row__thumb--v1 {
  background: linear-gradient(135deg, #e3f2fd 0%, #fce4ec 95%);
}

.news-row__thumb--v2 {
  background: linear-gradient(135deg, #efebe9 0%, #e8f5e9 100%);
}

.news-row__thumb--has-photo {
  padding: 0;
  background: #eceff1;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.04);
}

.news-row__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.news-row__icon {
  display: grid;
  place-items: center;
}

.news-row__body {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
  flex: 1;
}

.news-row__title {
  font-size: 1.02rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.35;
  color: var(--text);
  transition: color 0.15s ease;
}

.news-row:hover .news-row__title {
  color: var(--green);
}

.news-row__excerpt {
  font-size: 0.875rem;
  line-height: 1.55;
  color: var(--muted);
  font-weight: 500;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.news-list__item--empty .news-row {
  opacity: 0.92;
}

[data-theme="dark"] .news-panel {
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.35);
}

[data-theme="dark"] .news-row {
  background: rgba(255, 255, 255, 0.04);
  border-color: var(--line);
}

[data-theme="dark"] .news-row:hover {
  background: rgba(94, 233, 173, 0.08);
  border-color: rgba(94, 233, 173, 0.2);
}

[data-theme="dark"] .news-row__thumb--has-photo {
  background: #2a3832;
}

.hub-children {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}

.hub-child-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 22px 20px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--card-solid);
  box-shadow: var(--shadow);
  text-decoration: none;
  color: var(--text);
  font-weight: 800;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.hub-child-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
  border-color: rgba(19, 128, 80, 0.22);
  color: var(--green);
}

.hub-child-card__title {
  font-size: 1.05rem;
  letter-spacing: -0.02em;
}

.hub-child-card__hint {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--green-mid);
  margin-top: auto;
}

@media (max-width: 860px) {
  .hub-children {
    grid-template-columns: 1fr;
  }

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

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

  .logo {
    flex: 1 1 auto;
    min-width: 0;
  }

  .nav-burger {
    display: inline-flex;
  }

  .menu {
    flex: 1 0 100%;
    order: 5;
    display: none;
    width: 100%;
    justify-content: stretch;
    padding: 8px 0 16px;
    border-top: 1px solid var(--line);
  }

  .menu-list {
    flex-direction: column;
    align-items: stretch;
    width: 100%;
  }

  .menu-list a {
    border-radius: 12px;
  }

  .nav-toggle:checked ~ .menu {
    display: flex;
  }
}

@media (min-width: 861px) {
  .nav-burger {
    display: none !important;
  }
}

@media (max-width: 540px) {
  .wrap {
    padding: 0 16px;
  }

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

  .hero {
    padding: 28px 22px;
  }
}
