/*
Theme Name:  GiaXang Green
Theme URI:   https://anvinasoft.com/giaxang
Description: Theme theo dõi giá xăng dầu – chuẩn SEO, Accessibility & Performance
Author:      Anvinasoft
Author URI:  https://anvinasoft.com
Version:     1.0.0
License:     GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: giaxang
Tags:        fuel-price, seo, accessibility, responsive, green
*/

/* ═══════════════════════════════════════════════
   0. CUSTOM PROPERTIES
═══════════════════════════════════════════════ */
:root {
  --green-50 : #f0faf0;
  --green-100: #d9f2d9;
  --green-200: #b3e5b3;
  --green-400: #4caf50;
  --green-500: #2e9e2e;
  --green-600: #1e7e1e;
  --green-700: #155a15;
  --green-800: #0e400e;

  --orange-400: #ff9800;
  --orange-500: #e65c00;

  --fuel-petrol : #e65c00;   /* xăng RON */
  --fuel-diesel : #2055aa;   /* dầu diesel */
  --fuel-e5     : #27a065;   /* E5 RON */
  --fuel-heavy  : #6b4c2a;   /* dầu mazut */

  --text-dark  : #1a2b1a;
  --text-mid   : #3d5a3d;
  --text-soft  : #6b7b6b;
  --text-light : #9aaa9a;

  --bg-page    : #f7faf7;
  --bg-card    : #ffffff;
  --bg-hero    : #f0faf0;

  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --shadow-sm : 0 1px 4px rgba(0,0,0,.06);
  --shadow-md : 0 4px 20px rgba(0,0,0,.09);
  --shadow-lg : 0 8px 36px rgba(0,0,0,.12);

  --font-sans : 'Be Vietnam Pro', 'Nunito', 'Inter', system-ui, sans-serif;
  --font-serif: 'Merriweather', Georgia, serif;
  --font-mono : 'JetBrains Mono', monospace;

  --container : 1180px;
  --transition: .22s ease;
}

/* ═══════════════════════════════════════════════
   1. RESET / BASE
═══════════════════════════════════════════════ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; }

body {
  font-family: var(--font-sans);
  background : var(--bg-page);
  color      : var(--text-dark);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

img, svg { max-width: 100%; height: auto; display: block; }
a { color: var(--green-600); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--green-500); }
ul { list-style: none; }

/* Skip link */
.skip-link {
  position: absolute;
  top: -100px;
  left: 1rem;
  background: var(--green-600);
  color: #fff;
  padding: .5rem 1rem;
  border-radius: var(--radius-sm);
  z-index: 9999;
  transition: top .2s;
  font-size: .875rem;
}
.skip-link:focus { top: .75rem; }

/* ═══════════════════════════════════════════════
   2. LAYOUT — CONTAINER
═══════════════════════════════════════════════ */
.container {
  max-width: var(--container);
  margin   : 0 auto;
  padding  : 0 1.25rem;
}

/* ═══════════════════════════════════════════════
   3. TOP BAR
═══════════════════════════════════════════════ */
#topbar {
  background: var(--green-800);
  color     : rgba(255,255,255,.88);
  font-size : .8125rem;
  padding   : .45rem 0;
}
.topbar-inner {
  display        : flex;
  align-items    : center;
  justify-content: space-between;
  gap            : 1rem;
  flex-wrap      : wrap;
}
.topbar-item {
  display    : flex;
  align-items: center;
  gap        : .4rem;
}
.topbar-item svg { width: 14px; height: 14px; fill: rgba(255,255,255,.7); flex-shrink: 0; }
.topbar-item a { color: rgba(255,255,255,.88); }
.topbar-item a:hover { color: #fff; }
.topbar-hotline {
  display    : flex;
  align-items: center;
  gap        : .4rem;
  font-weight: 600;
  color      : #fff;
}
.topbar-hotline .dot {
  width : 8px; height: 8px;
  background   : #4dff6e;
  border-radius: 50%;
  animation    : pulse 1.6s infinite;
}
.topbar-hotline svg { width: 14px; height: 14px; fill: #fff; }
.topbar-hotline a { color: #fff; font-weight: 700; }

@keyframes pulse {
  0%,100% { opacity:1; transform:scale(1); }
  50%      { opacity:.55; transform:scale(1.3); }
}

/* ═══════════════════════════════════════════════
   4. SITE HEADER
═══════════════════════════════════════════════ */
#site-header {
  background: linear-gradient(135deg, var(--green-700) 0%, var(--green-500) 100%);
  position  : sticky;
  top       : 0;
  z-index   : 999;
  box-shadow: 0 2px 12px rgba(0,0,0,.18);
}
.header-inner {
  display        : flex;
  align-items    : center;
  justify-content: space-between;
  padding        : .85rem 0;
  gap            : 1.5rem;
}

/* Logo */
.site-logo {
  display    : flex;
  align-items: center;
  gap        : .7rem;
  color      : #fff;
  font-weight: 800;
  font-size  : 1.05rem;
}
.site-logo:hover { color: #fff; opacity: .9; }
.logo-flame {
  width     : 44px; height: 44px;
  background: rgba(255,255,255,.12);
  border-radius: var(--radius-sm);
  display   : grid; place-items: center;
  flex-shrink: 0;
}
.logo-flame svg { width: 26px; height: 26px; fill: #fff; }
.site-logo .sub {
  display  : block;
  font-size: .7rem;
  font-weight: 400;
  opacity  : .78;
  margin-top: .1rem;
}

/* Primary nav */
.primary-nav ul {
  display   : flex;
  gap       : .25rem;
  align-items: center;
}
.primary-nav a {
  color      : rgba(255,255,255,.88);
  font-size  : .9rem;
  font-weight: 600;
  padding    : .45rem .8rem;
  border-radius: var(--radius-sm);
  transition : background var(--transition), color var(--transition);
}
.primary-nav a:hover,
.primary-nav .current-menu-item > a {
  background: rgba(255,255,255,.14);
  color     : #fff;
}

/* Mobile toggle */
.menu-toggle {
  display       : none;
  flex-direction: column;
  gap           : 5px;
  background    : transparent;
  border        : none;
  cursor        : pointer;
  padding       : .4rem;
}
.menu-toggle span {
  display   : block;
  width     : 24px; height: 2px;
  background: #fff;
  border-radius: 2px;
  transition: transform .22s, opacity .22s;
}
.menu-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.menu-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.menu-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

@media (max-width: 820px) {
  .menu-toggle { display: flex; }
  .primary-nav {
    display   : none;
    position  : absolute;
    top       : 100%;
    left      : 0; right: 0;
    background: var(--green-700);
    padding   : 1rem 1.25rem;
    box-shadow: 0 8px 24px rgba(0,0,0,.2);
  }
  .primary-nav.open { display: block; }
  .primary-nav ul   { flex-direction: column; gap: .2rem; }
  .primary-nav a    { display: block; padding: .6rem 1rem; }
  #site-header      { position: sticky; }
}

/* ═══════════════════════════════════════════════
   5. BREADCRUMB + PAGE HERO
═══════════════════════════════════════════════ */
.page-hero {
  background: linear-gradient(135deg, var(--green-700) 0%, var(--green-500) 55%, var(--orange-400) 100%);
  padding   : 2.5rem 0 2rem;
  color     : #fff;
}
.breadcrumb {
  display  : flex;
  align-items: center;
  gap      : .4rem;
  font-size: .8125rem;
  opacity  : .82;
  margin-bottom: .85rem;
}
.breadcrumb a { color: #fff; }
.breadcrumb .sep { font-size: .75rem; }

.page-hero h1 {
  font-family: var(--font-serif);
  font-size  : clamp(1.6rem, 3.5vw, 2.4rem);
  font-weight: 900;
  line-height: 1.25;
  margin-bottom: .5rem;
}
.page-hero .subtitle {
  font-size  : 1rem;
  opacity    : .88;
  max-width  : 600px;
}

/* ═══════════════════════════════════════════════
   6. PRICE HERO — Thẻ giá lớn
═══════════════════════════════════════════════ */
.price-hero-section {
  background: var(--bg-card);
  padding   : 2.25rem 0 1.75rem;
  border-bottom: 1px solid #e5ede5;
}
.price-hero-grid {
  display              : grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap                  : 1.25rem;
  margin-bottom        : 1.5rem;
}

.price-card {
  background   : var(--bg-card);
  border-radius: var(--radius-md);
  box-shadow   : var(--shadow-md);
  padding      : 1.5rem 1.75rem;
  text-align   : center;
  border-top   : 4px solid transparent;
  transition   : transform var(--transition), box-shadow var(--transition);
  position     : relative;
  overflow     : hidden;
}
.price-card::before {
  content : '';
  position: absolute;
  inset   : 0;
  opacity : .035;
  pointer-events: none;
}
.price-card.petrol { border-top-color: var(--fuel-petrol); }
.price-card.e5     { border-top-color: var(--fuel-e5); }
.price-card.diesel { border-top-color: var(--fuel-diesel); }
.price-card:hover  { transform: translateY(-3px); box-shadow: var(--shadow-lg); }

.price-card .label {
  font-size  : .8125rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  color      : var(--text-soft);
  margin-bottom: .4rem;
}
.price-card .value {
  font-family: var(--font-mono);
  font-size  : clamp(1.7rem, 3.5vw, 2.3rem);
  font-weight: 700;
  color      : var(--text-dark);
  line-height : 1.1;
  margin-bottom: .25rem;
}
.price-card .unit {
  font-size: .8125rem;
  color    : var(--text-soft);
  margin-bottom: .6rem;
}
.price-card.petrol .value { color: var(--fuel-petrol); }
.price-card.e5     .value { color: var(--fuel-e5);     }
.price-card.diesel .value { color: var(--fuel-diesel); }

.change-badge {
  display     : inline-flex;
  align-items : center;
  gap         : .25rem;
  font-size   : .8125rem;
  font-weight : 700;
  padding     : .25rem .65rem;
  border-radius: 20px;
}
.change-badge.up   { background: #e8f5e9; color: #1b5e20; }
.change-badge.down { background: #fce4ec; color: #880e4f; }
.change-badge.flat { background: #f5f5f5; color: var(--text-soft); }

/* Effective date row */
.effective-date {
  text-align : center;
  font-size  : .825rem;
  color      : var(--text-soft);
  margin-top : .5rem;
}
.effective-date strong { color: var(--green-600); }

/* ═══════════════════════════════════════════════
   7. TRUST BADGES
═══════════════════════════════════════════════ */
.trust-section {
  background: var(--green-700);
  padding   : 1.5rem 0;
}
.trust-grid {
  display              : grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap                  : 1rem;
}
.trust-item {
  display    : flex;
  align-items: center;
  gap        : .85rem;
  color      : rgba(255,255,255,.9);
}
.trust-icon {
  width        : 44px; height: 44px;
  background   : rgba(255,255,255,.12);
  border-radius: 50%;
  display      : grid; place-items: center;
  flex-shrink  : 0;
}
.trust-item strong {
  display  : block;
  font-size: .875rem;
  color    : #fff;
}
.trust-item span {
  display  : block;
  font-size: .775rem;
  opacity  : .75;
}

/* ═══════════════════════════════════════════════
   8. BẢNG GIÁ XĂNG DẦU
═══════════════════════════════════════════════ */
.table-section {
  padding: 3rem 0;
}
.table-header {
  display        : flex;
  align-items    : center;
  justify-content: space-between;
  flex-wrap      : wrap;
  gap            : .75rem;
  margin-bottom  : 1.25rem;
}
.section-title {
  font-family: var(--font-serif);
  font-size  : clamp(1.15rem, 2.5vw, 1.5rem);
  font-weight: 700;
  color      : var(--text-dark);
  position   : relative;
  padding-left: 1rem;
}
.section-title::before {
  content   : '';
  position  : absolute;
  left      : 0; top: .15em; bottom: .15em;
  width     : 4px;
  background: var(--green-500);
  border-radius: 3px;
}
.update-time {
  display    : flex;
  align-items: center;
  gap        : .45rem;
  font-size  : .8125rem;
  color      : var(--text-soft);
}
.update-dot {
  width : 8px; height: 8px;
  background   : #4caf50;
  border-radius: 50%;
  animation    : pulse 1.8s infinite;
}

.price-table-wrap {
  overflow-x   : auto;
  border-radius: var(--radius-md);
  box-shadow   : var(--shadow-md);
  background   : var(--bg-card);
}
.price-table {
  width          : 100%;
  border-collapse: collapse;
  font-size      : .9rem;
}
.price-table thead th {
  background : var(--green-600);
  color      : #fff;
  padding    : .85rem 1.1rem;
  text-align : left;
  font-weight: 700;
  font-size  : .8125rem;
  text-transform: uppercase;
  letter-spacing: .04em;
  white-space: nowrap;
}
.price-table thead th:first-child { border-radius: var(--radius-md) 0 0 0; }
.price-table thead th:last-child  { border-radius: 0 var(--radius-md) 0 0; }
.price-table tbody tr { border-bottom: 1px solid #eef2ee; }
.price-table tbody tr:last-child { border-bottom: none; }
.price-table tbody tr:hover { background: var(--green-50); }
.price-table tbody td {
  padding   : .85rem 1.1rem;
  color     : var(--text-dark);
  vertical-align: middle;
}
.price-table .group-head td {
  background   : var(--green-50);
  font-weight  : 700;
  font-size    : .8125rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  color        : var(--green-600);
  padding      : .55rem 1.1rem;
}

.product-name { font-weight: 600; color: var(--text-dark); }
.product-name .tag {
  display      : inline-block;
  font-size    : .7rem;
  font-weight  : 700;
  padding      : .1rem .45rem;
  border-radius: 4px;
  margin-left  : .4rem;
  vertical-align: middle;
}
.tag.petrol { background: #fff3e0; color: var(--fuel-petrol); }
.tag.e5     { background: #e8f5e9; color: var(--fuel-e5);     }
.tag.diesel { background: #e3f2fd; color: var(--fuel-diesel); }
.tag.heavy  { background: #efebe9; color: var(--fuel-heavy);  }

.fuel-price {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size  : 1rem;
}
.fuel-price.petrol { color: var(--fuel-petrol); }
.fuel-price.e5     { color: var(--fuel-e5);     }
.fuel-price.diesel { color: var(--fuel-diesel); }
.fuel-price.heavy  { color: var(--fuel-heavy);  }
.fuel-price.updating { color: var(--text-soft); font-style: italic; font-family: var(--font-sans); font-size: .875rem; }

.region-label {
  font-size : .775rem;
  color     : var(--text-soft);
  background: var(--green-50);
  padding   : .2rem .55rem;
  border-radius: 4px;
  display   : inline-block;
}

/* ═══════════════════════════════════════════════
   9. BIỂU ĐỒ
═══════════════════════════════════════════════ */
.chart-section {
  background: var(--bg-card);
  padding   : 2.5rem 0;
  border-top: 1px solid #e5ede5;
}
.chart-header {
  display        : flex;
  align-items    : center;
  justify-content: space-between;
  flex-wrap      : wrap;
  gap            : .75rem;
  margin-bottom  : 1.5rem;
}
.chart-title {
  font-family: var(--font-serif);
  font-size  : clamp(1.1rem, 2.2vw, 1.4rem);
  font-weight: 700;
  color      : var(--text-dark);
}
.chart-range-btns { display: flex; gap: .4rem; flex-wrap: wrap; }
.range-btn {
  background   : #f0f0f0;
  border       : 1px solid #d8e0d8;
  border-radius: var(--radius-sm);
  padding      : .35rem .75rem;
  font-size    : .8rem;
  font-weight  : 600;
  cursor       : pointer;
  transition   : all var(--transition);
  color        : var(--text-mid);
}
.range-btn.active,
.range-btn:hover {
  background: var(--green-500);
  border-color: var(--green-500);
  color     : #fff;
}
.chart-wrapper {
  position: relative;
  height  : 320px;
}

/* Fuel type selector for chart */
.chart-fuel-tabs {
  display   : flex;
  gap       : .5rem;
  flex-wrap : wrap;
  margin-bottom: 1rem;
}
.fuel-tab {
  display     : flex;
  align-items : center;
  gap         : .35rem;
  padding     : .3rem .75rem;
  border-radius: 20px;
  font-size   : .8125rem;
  font-weight : 600;
  cursor      : pointer;
  border      : 2px solid transparent;
  transition  : all var(--transition);
  background  : #f5f5f5;
  color       : var(--text-soft);
}
.fuel-tab .dot-sm { width: 10px; height: 10px; border-radius: 50%; }
.fuel-tab.active.petrol { background: #fff3e0; border-color: var(--fuel-petrol); color: var(--fuel-petrol); }
.fuel-tab.active.e5     { background: #e8f5e9; border-color: var(--fuel-e5);     color: var(--fuel-e5);     }
.fuel-tab.active.diesel { background: #e3f2fd; border-color: var(--fuel-diesel); color: var(--fuel-diesel); }

/* ═══════════════════════════════════════════════
   10. BANNER
═══════════════════════════════════════════════ */
.banner-section { padding: 2rem 0; }
.banner-link {
  display      : block;
  border-radius: var(--radius-md);
  overflow     : hidden;
  box-shadow   : var(--shadow-md);
  transition   : transform var(--transition), box-shadow var(--transition);
}
.banner-link:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.banner-link img   { width: 100%; height: auto; border-radius: var(--radius-md); }

/* ═══════════════════════════════════════════════
   11. CONTENT / ARTICLE
═══════════════════════════════════════════════ */
.content-section {
  padding: 2.5rem 0 3rem;
}
.content-section .entry-content {
  max-width: 820px;
}
.content-section h2 {
  font-family: var(--font-serif);
  font-size  : 1.35rem;
  font-weight: 700;
  color      : var(--text-dark);
  margin     : 1.75rem 0 .65rem;
  padding-left: .85rem;
  border-left : 4px solid var(--green-500);
}
.content-section h3 { font-size: 1.1rem; margin: 1.35rem 0 .5rem; color: var(--text-mid); }
.content-section p  { color: var(--text-mid); margin-bottom: 1rem; }
.content-section ul, .content-section ol {
  padding-left: 1.5rem;
  margin-bottom: 1rem;
  color: var(--text-mid);
}
.content-section li { margin-bottom: .4rem; }

/* ═══════════════════════════════════════════════
   12. INFO CARDS — FAQ / note
═══════════════════════════════════════════════ */
.info-grid {
  display              : grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap                  : 1.25rem;
  padding              : 2rem 0;
}
.info-card {
  background   : var(--bg-card);
  border-radius: var(--radius-md);
  box-shadow   : var(--shadow-sm);
  padding      : 1.5rem;
  border-left  : 4px solid var(--green-400);
}
.info-card h3 {
  font-size  : 1rem;
  font-weight: 700;
  color      : var(--text-dark);
  margin-bottom: .5rem;
}
.info-card p { font-size: .875rem; color: var(--text-soft); }

/* ═══════════════════════════════════════════════
   13. FOOTER
═══════════════════════════════════════════════ */
#site-footer { background: var(--green-800); }
.footer-main  { padding: 3rem 0 2rem; }
.footer-inner {
  display              : grid;
  grid-template-columns: 1.6fr 1fr 1fr;
  gap                  : 2.5rem;
}
.footer-logo-text {
  font-size  : 1.15rem;
  font-weight: 800;
  color      : #fff;
  margin-bottom: .75rem;
}
.footer-desc {
  font-size  : .875rem;
  color      : rgba(255,255,255,.7);
  line-height: 1.7;
  margin-bottom: 1rem;
}
.footer-contact-item {
  display    : flex;
  align-items: center;
  gap        : .5rem;
  color      : rgba(255,255,255,.82);
  font-size  : .875rem;
  margin-bottom: .45rem;
}
.footer-contact-item svg { width: 15px; height: 15px; fill: rgba(255,255,255,.55); flex-shrink: 0; }
.footer-contact-item a   { color: rgba(255,255,255,.9); }
.footer-contact-item a:hover { color: #fff; }

.footer-heading {
  font-size    : .9rem;
  font-weight  : 700;
  color        : #fff;
  text-transform: uppercase;
  letter-spacing: .06em;
  margin-bottom : 1rem;
  padding-bottom: .5rem;
  border-bottom : 1px solid rgba(255,255,255,.1);
}
.footer-links { display: flex; flex-direction: column; gap: .4rem; }
.footer-links a {
  color    : rgba(255,255,255,.72);
  font-size: .875rem;
  transition: color var(--transition), padding-left var(--transition);
}
.footer-links a:hover { color: #fff; padding-left: .35rem; }

.footer-bottom {
  border-top: 1px solid rgba(255,255,255,.08);
  padding   : 1rem 0;
}
.footer-bottom-inner {
  display        : flex;
  align-items    : center;
  justify-content: space-between;
  flex-wrap      : wrap;
  gap            : .5rem;
  font-size      : .8125rem;
  color          : rgba(255,255,255,.55);
}
.footer-bottom-inner a { color: rgba(255,255,255,.72); }
.footer-bottom-inner a:hover { color: #fff; }

@media (max-width: 900px) {
  .footer-inner { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 600px) {
  .footer-inner { grid-template-columns: 1fr; gap: 1.5rem; }
}

/* ═══════════════════════════════════════════════
   14. MISC / 404 / SINGULAR
═══════════════════════════════════════════════ */
.singular-main { padding: 3rem 0; }
.singular-main .entry-header { margin-bottom: 1.5rem; }
.singular-main .entry-title  { font-family: var(--font-serif); font-size: clamp(1.4rem, 3vw, 2rem); font-weight: 900; }
.singular-main .entry-content p { color: var(--text-mid); margin-bottom: 1rem; }

.error-404-content { text-align: center; padding: 5rem 0; }
.error-404-content h1 { font-family: var(--font-serif); font-size: 5rem; color: var(--green-500); line-height: 1; }
.error-404-content h2 { font-size: 1.5rem; margin: 1rem 0 .75rem; }
.error-404-content p  { color: var(--text-soft); margin-bottom: 2rem; }
.btn-primary {
  display     : inline-block;
  background  : var(--green-500);
  color       : #fff;
  padding     : .75rem 2rem;
  border-radius: var(--radius-md);
  font-weight : 700;
  transition  : background var(--transition);
}
.btn-primary:hover { background: var(--green-600); color: #fff; }

/* ═══════════════════════════════════════════════
   15. RESPONSIVE TWEAKS
═══════════════════════════════════════════════ */
@media (max-width: 768px) {
  .price-hero-grid       { grid-template-columns: 1fr; }
  .chart-wrapper         { height: 240px; }
  .table-header          { flex-direction: column; align-items: flex-start; }
  .chart-header          { flex-direction: column; align-items: flex-start; }
  .topbar-inner          { flex-direction: column; gap: .35rem; }
}
@media (max-width: 480px) {
  .price-card { padding: 1.15rem 1.25rem; }
  .price-card .value { font-size: 1.6rem; }
}

/* ═══════════════════════════════════════════════
   16. PRINT
═══════════════════════════════════════════════ */
@media print {
  #topbar, #site-header, .chart-section, .banner-section, #site-footer { display: none; }
  .price-table { font-size: 11pt; }
}
