/*
Theme Name: Hamster Care Guide
Theme URI: https://hamstercareguide.com
Description: A warm, natural WordPress theme for hamster care content with affiliate marketing focus
Version: 1.0.0
Author: Hamster Care
Text Domain: hamster-theme
Domain Path: /languages
*/

:root {
  /* --- MAU CHINH (Brand colors) --- */
  --color-primary: #FF6B35;        /* Cam do sang - primary brand color */
  --color-primary-dark: #E55A1A;   /* Cam do dam - hover */
  --color-primary-light: #FFB399;  /* Cam do nhe */

  /* --- MAU NHAN / CTA (Accent) --- */
  --color-cta: #FF6B35;            /* Cam do - nut affiliate */
  --color-cta-dark: #E55A1A;       /* Hover cua CTA */
  --color-cta-light: #FFE5D9;      /* Nen nhat */

  /* --- NEN (Backgrounds) --- */
  --color-bg: #FFFFFF;             /* Nen chinh - trang trang */
  --color-bg-card: #FFFFFF;        /* Nen card */
  --color-bg-soft: #F5F5F5;        /* Nen phu */

  /* --- CHU (Text) --- */
  --color-text: #2C2C2C;           /* Chu chinh - den chuyên nghiệp */
  --color-text-muted: #666666;     /* Chu phu */
  --color-text-light: #999999;     /* Chu nhat */

  /* --- DUONG VIEN (Borders) --- */
  --color-border: #DDDDDD;         /* Vien nhat */
  --color-border-strong: #CCCCCC;  /* Vien dam */

  /* --- MAU TRANG THAI (Semantic) --- */
  --color-success: #27AE60;
  --color-success-bg: #E8F5E9;
  --color-danger: #E74C3C;
  --color-danger-bg: #FADBD8;
  --color-warning: #F39C12;
  --color-warning-bg: #FEF5E7;

  /* --- TYPOGRAPHY --- */
  --font-heading: 'Poppins', 'Segoe UI', sans-serif;
  --font-body: 'Inter', 'Segoe UI', sans-serif;

  --text-h1: 2rem;       /* 32px */
  --text-h2: 1.5rem;     /* 24px */
  --text-h3: 1.25rem;    /* 20px */
  --text-body: 1rem;     /* 16px */
  --text-small: 0.8rem;  /* 13px */

  --line-height-body: 1.7;
  --line-height-heading: 1.3;

  /* --- SPACING --- */
  --space-xs: 0.375rem;  /* 6px */
  --space-sm: 0.75rem;   /* 12px */
  --space-md: 1.25rem;   /* 20px */
  --space-lg: 2rem;      /* 32px */
  --space-xl: 3rem;      /* 48px */

  /* --- BO GOC (Border radius) --- */
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 20px;

  /* --- DO BONG (Shadow) --- */
  --shadow-card: 0 2px 12px rgba(61, 46, 34, 0.08);
  --shadow-hover: 0 4px 20px rgba(61, 46, 34, 0.12);

  /* --- BE RONG (Width) --- */
  --content-width: 720px;
  --site-width: 1200px;
}

/* =====================================================================
   RESET & BASE
   ===================================================================== */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  background: #FFFFFF;
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: var(--text-body);
  line-height: var(--line-height-body);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: var(--color-primary);
  text-decoration: none;
  transition: color 0.2s;
}

a:hover {
  color: var(--color-primary-dark);
}

/* =====================================================================
   TYPOGRAPHY
   ===================================================================== */

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  line-height: var(--line-height-heading);
  color: var(--color-text);
  margin-bottom: var(--space-md);
  margin-top: var(--space-lg);
}

h1 {
  font-size: var(--text-h1);
  font-weight: 700;
}

h2 {
  font-size: var(--text-h2);
  font-weight: 700;
}

h3 {
  font-size: var(--text-h3);
  font-weight: 600;
}

h4 {
  font-size: 1.25rem;
  font-weight: 600;
}

h1:first-child,
h2:first-child,
h3:first-child {
  margin-top: 0;
}

p {
  margin-bottom: var(--space-md);
}

strong {
  font-weight: 600;
}

em {
  font-style: italic;
}

/* =====================================================================
   LAYOUT
   ===================================================================== */

.site {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.site-content {
  flex: 1;
}

.container {
  width: 100%;
  max-width: var(--site-width);
  margin: 0 auto;
  padding: 0 var(--space-md);
}

.article-body {
  max-width: var(--content-width);
  margin: 0 auto;
}

/* =====================================================================
   HEADER & NAVIGATION
   ===================================================================== */

.site-header {
  background: #FFFFFF;
  border-bottom: 1px solid var(--color-border);
  padding: 0;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.header-wrapper {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: var(--site-width);
  margin: 0 auto;
  padding: 1rem var(--space-md);
  gap: 2rem;
}

/* BRANDING */
.site-branding {
  flex-shrink: 0;
}

.site-logo-link {
  display: flex;
  align-items: center;
  text-decoration: none;
  transition: opacity 0.2s;
}

.site-logo-link:hover {
  opacity: 0.8;
}

.site-logo {
  height: 40px;
  width: auto;
}

.site-title-text {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 700;
  color: #FF6B35;
}

/* MAIN NAVIGATION */
.main-navigation {
  flex: 1;
  display: flex;
  align-items: center;
}

.menu-wrapper {
  display: flex;
  align-items: center;
  width: 100%;
}

.menu {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 0;
  width: 100%;
}

.menu > li {
  margin: 0;
  padding: 0;
}

.menu > li > a {
  display: block;
  padding: 1rem 1.25rem;
  color: #2C2C2C;
  font-weight: 500;
  font-size: 0.95rem;
  text-decoration: none;
  transition: all 0.2s;
  position: relative;
  border-bottom: 3px solid transparent;
}

.menu > li > a:hover,
.menu > li.current-menu-item > a {
  color: #FF6B35;
  border-bottom-color: #FF6B35;
}

.menu > li > a::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  right: 0;
  height: 3px;
  background: #FF6B35;
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.3s ease;
}

.menu > li > a:hover::after {
  transform: scaleX(1);
  transform-origin: left;
}

/* MOBILE MENU TOGGLE */
.menu-toggle {
  display: none;
  flex-direction: column;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  gap: 4px;
}

.menu-toggle span {
  width: 24px;
  height: 2px;
  background: #2C2C2C;
  transition: all 0.3s;
  border-radius: 2px;
}

.menu-toggle.active span:nth-child(1) {
  transform: rotate(45deg) translate(10px, 10px);
}

.menu-toggle.active span:nth-child(2) {
  opacity: 0;
}

.menu-toggle.active span:nth-child(3) {
  transform: rotate(-45deg) translate(7px, -7px);
}

/* HEADER ACTIONS */
.header-actions {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.header-search-link {
  color: #2C2C2C;
  transition: color 0.2s;
  padding: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.header-search-link:hover {
  color: #FF6B35;
}

/* RESPONSIVE MENU */
@media (max-width: 768px) {
  .header-wrapper {
    flex-wrap: wrap;
    gap: 1rem;
  }

  .menu-toggle {
    display: flex;
  }

  .menu-wrapper {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #FFFFFF;
    flex-direction: column;
    border-bottom: 1px solid var(--color-border);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    width: 100%;
  }

  .menu-wrapper.active {
    display: flex;
  }

  .menu {
    flex-direction: column;
    width: 100%;
  }

  .menu > li > a {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--color-border);
    border-right: 3px solid transparent;
  }

  .menu > li > a:hover,
  .menu > li.current-menu-item > a {
    border-bottom-color: var(--color-border);
    border-right-color: #FF6B35;
  }
}

/* =====================================================================
   FOOTER
   ===================================================================== */

.site-footer {
  background: #F5F5F5;
  border-top: 1px solid var(--color-border);
  padding: var(--space-xl) 0 var(--space-lg);
  margin-top: var(--space-xl);
  color: var(--color-text-muted);
}

.footer-content {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: var(--space-lg);
  margin-bottom: var(--space-xl);
}

.footer-section h3 {
  font-size: 1.125rem;
  color: var(--color-text);
  margin-bottom: var(--space-md);
}

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

.footer-section li {
  margin-bottom: var(--space-sm);
}

.footer-section a {
  color: var(--color-text-muted);
  font-size: var(--text-small);
}

.footer-section a:hover {
  color: var(--color-primary);
}

.footer-bottom {
  border-top: 1px solid var(--color-border);
  padding-top: var(--space-lg);
  text-align: center;
  font-size: var(--text-small);
  color: var(--color-text-muted);
}

/* =====================================================================
   BUTTONS & FORMS
   ===================================================================== */

.btn {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  font-size: 1rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s;
  font-family: var(--font-heading);
}

.btn-primary {
  background: var(--color-primary);
  color: white;
}

.btn-primary:hover {
  background: var(--color-primary-dark);
  transform: translateY(-1px);
}

.btn-cta {
  background: var(--color-cta);
  color: white;
  padding: 0.875rem 1.75rem;
  font-size: var(--text-body);
}

.btn-cta:hover {
  background: var(--color-cta-dark);
  transform: translateY(-1px);
}

.btn-secondary {
  background: var(--color-bg-soft);
  color: var(--color-text);
  border: 1px solid var(--color-border-strong);
}

.btn-secondary:hover {
  background: var(--color-bg-card);
  border-color: var(--color-primary);
  color: var(--color-primary);
}

input[type="text"],
input[type="email"],
input[type="search"],
textarea {
  width: 100%;
  padding: var(--space-sm);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 1rem;
  color: var(--color-text);
  background: var(--color-bg-card);
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="search"]:focus,
textarea:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(200, 120, 62, 0.1);
}

/* =====================================================================
   HERO SECTION
   ===================================================================== */

.hero {
  background: #FF6B35;
  padding: var(--space-xl) var(--space-md);
  text-align: center;
  margin-bottom: var(--space-xl);
}

.hero-content {
  max-width: 800px;
  margin: 0 auto;
}

.hero h1 {
  font-size: 2.75rem;
  margin-bottom: var(--space-md);
  color: #FFFFFF;
}

.hero p {
  font-size: 1.25rem;
  color: rgba(255, 255, 255, 0.95);
  margin-bottom: var(--space-lg);
}

/* =====================================================================
   POST/ARTICLE STYLES
   ===================================================================== */

.single-post-wrapper {
  display: flex;
  gap: var(--space-lg);
  align-items: flex-start;
}

@media (max-width: 1199px) {
  .single-post-wrapper {
    flex-direction: column;
  }
}

.post {
  margin: var(--space-xl) 0;
  flex: 1;
}

.post-header {
  margin-bottom: var(--space-xl);
}

.post-title {
  margin: 0 0 var(--space-md) 0;
}

.post-meta {
  font-size: var(--text-small);
  color: var(--color-text-muted);
  display: flex;
  gap: var(--space-md);
  flex-wrap: wrap;
}

.post-meta-item {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.post-thumbnail {
  margin-bottom: var(--space-lg);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.post-thumbnail img {
  width: 100%;
  height: auto;
  display: block;
}

.post-featured-image {
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: var(--radius-md);
  margin-bottom: var(--space-lg);
  background: #E8E8E8;
}

.post-featured-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.post-content {
  margin-bottom: var(--space-xl);
}

.post-content img {
  max-width: 100%;
  height: auto;
  margin: var(--space-md) 0;
  border-radius: var(--radius-md);
}

/* =====================================================================
   CARD
   ===================================================================== */

.post-card {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: all 0.2s;
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
}

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

.post-card-image {
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--color-bg-soft);
}

.post-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.post-card-body {
  padding: var(--space-md);
  flex: 1;
  display: flex;
  flex-direction: column;
}

.post-card-category {
  display: inline-block;
  font-size: var(--text-small);
  color: var(--color-primary);
  font-weight: 600;
  margin-bottom: var(--space-sm);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.post-card-title {
  font-size: 1.25rem;
  margin: 0 0 var(--space-sm) 0;
}

.post-card-title a {
  color: var(--color-text);
}

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

.post-card-excerpt {
  color: var(--color-text-muted);
  margin-bottom: var(--space-md);
  flex: 1;
  font-size: 0.95rem;
}

.post-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: var(--space-md);
  border-top: 1px solid var(--color-border);
  font-size: var(--text-small);
  color: var(--color-text-muted);
}

/* =====================================================================
   BOX COMPONENTS (Safe, Danger, Warning)
   ===================================================================== */

.box-safe,
.box-danger,
.box-warning {
  padding: var(--space-md);
  margin: var(--space-md) 0;
  border-left: 4px solid;
  border-radius: 0;
  font-size: 0.95rem;
}

.box-safe {
  background: var(--color-success-bg);
  border-left-color: var(--color-success);
  color: var(--color-text);
}

.box-danger {
  background: var(--color-danger-bg);
  border-left-color: var(--color-danger);
  color: var(--color-text);
}

.box-warning {
  background: var(--color-warning-bg);
  border-left-color: var(--color-warning);
  color: var(--color-text);
}

.box-safe strong,
.box-danger strong,
.box-warning strong {
  color: var(--color-text);
}

/* =====================================================================
   PRODUCT BOX (Review & Affiliate)
   ===================================================================== */

.product-box {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-md);
  margin: var(--space-md) 0;
  box-shadow: var(--shadow-card);
  transition: all 0.2s;
}

.product-box:hover {
  box-shadow: var(--shadow-hover);
}

.product-box-header {
  display: flex;
  gap: var(--space-md);
  margin-bottom: var(--space-md);
  align-items: flex-start;
}

.product-box-image {
  flex-shrink: 0;
  width: 120px;
  height: 120px;
  background: var(--color-bg-soft);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.product-box-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.product-box-title {
  flex: 1;
  margin: 0;
  font-size: 1.25rem;
}

.badge-best {
  display: inline-block;
  background: var(--color-primary);
  color: white;
  font-size: var(--text-small);
  font-weight: 600;
  padding: 0.25rem 0.75rem;
  border-radius: var(--radius-sm);
  margin-bottom: var(--space-sm);
}

.product-box-meta {
  font-size: var(--text-small);
  color: var(--color-text-muted);
  margin-bottom: var(--space-sm);
}

.product-box-description {
  color: var(--color-text);
  margin-bottom: var(--space-md);
}

.product-box-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: var(--space-md);
  border-top: 1px solid var(--color-border);
}

.product-price {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--color-primary);
}

/* =====================================================================
   GRID LAYOUTS
   ===================================================================== */

.posts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: var(--space-lg);
  margin: var(--space-xl) 0;
}

@media (max-width: 768px) {
  .posts-grid {
    grid-template-columns: 1fr;
  }
}

/* =====================================================================
   ARCHIVE & CATEGORY
   ===================================================================== */

.archive-header,
.category-header {
  background: #FF6B35;
  padding: var(--space-xl) var(--space-md);
  margin-bottom: var(--space-xl);
  text-align: center;
}

.archive-header h1,
.category-header h1 {
  margin: 0;
  color: #FFFFFF;
}

.archive-header p,
.category-header p {
  margin: var(--space-md) 0 0 0;
  color: rgba(255, 255, 255, 0.95);
  font-size: 1.1rem;
}

/* =====================================================================
   TABLE OF CONTENTS
   ===================================================================== */

.toc {
  background: var(--color-bg-soft);
  border-left: 4px solid var(--color-primary);
  border-radius: var(--radius-md);
  padding: var(--space-md);
  margin: var(--space-xl) 0;
}

.toc-title {
  font-weight: 600;
  font-size: 1.1rem;
  margin-bottom: var(--space-md);
  margin-top: 0;
}

.toc ol {
  margin: 0;
  padding-left: 1.5rem;
}

.toc li {
  margin-bottom: var(--space-sm);
}

.toc a {
  color: var(--color-primary);
  text-decoration: underline;
}

/* =====================================================================
   PAGINATION
   ===================================================================== */

.pagination {
  display: flex;
  justify-content: center;
  gap: var(--space-sm);
  margin: var(--space-xl) 0;
  flex-wrap: wrap;
}

.pagination a,
.pagination .page-numbers {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  height: 44px;
  padding: 0 var(--space-sm);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  color: var(--color-text);
  text-decoration: none;
  font-weight: 500;
  transition: all 0.2s;
}

.pagination a:hover,
.pagination .page-numbers.current {
  background: var(--color-primary);
  color: white;
  border-color: var(--color-primary);
}

/* =====================================================================
   SIDEBAR
   ===================================================================== */

.sidebar {
  background: var(--color-bg-soft);
  padding: var(--space-md);
  border-radius: var(--radius-md);
  margin-top: var(--space-lg);
}

.widget {
  margin-bottom: var(--space-lg);
}

.widget:last-child {
  margin-bottom: 0;
}

.widget-title {
  font-size: 1.25rem;
  font-weight: 600;
  margin: 0 0 var(--space-md) 0;
  color: var(--color-text);
  border-bottom: 2px solid var(--color-primary);
  padding-bottom: var(--space-sm);
}

.widget ul {
  list-style: none;
}

.widget li {
  margin-bottom: var(--space-sm);
}

.widget a {
  color: var(--color-text);
  display: block;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--color-border);
  transition: color 0.2s;
}

.widget a:hover {
  color: var(--color-primary);
}

.widget li:last-child a {
  border-bottom: none;
}

/* =====================================================================
   RESPONSIVE
   ===================================================================== */

@media (max-width: 768px) {
  :root {
    --text-h1: 1.75rem;
    --text-h2: 1.375rem;
    --text-h3: 1.125rem;
    --text-body: 1rem;
    --space-xl: 2.5rem;
    --space-lg: 1.5rem;
  }

  .header-wrapper {
    flex-direction: column;
    gap: var(--space-md);
  }

  .main-navigation {
    flex-direction: column;
    gap: var(--space-sm);
    width: 100%;
  }

  .main-navigation a {
    padding: var(--space-sm) 0;
  }

  .hero h1 {
    font-size: 1.75rem;
  }

  .product-box-header {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .product-box-footer {
    flex-direction: column;
    gap: var(--space-md);
  }

  .product-price {
    width: 100%;
    text-align: center;
  }
}

@media (max-width: 480px) {
  :root {
    --space-md: 1rem;
    --space-lg: 1.5rem;
  }

  .container {
    padding: 0 var(--space-sm);
  }

  h1 {
    font-size: 1.5rem;
  }

  .posts-grid {
    grid-template-columns: 1fr;
    gap: var(--space-md);
  }
}

/* =====================================================================
   UTILITY
   ===================================================================== */

.text-center {
  text-align: center;
}

.text-muted {
  color: var(--color-text-muted);
}

.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }
.mt-lg { margin-top: var(--space-lg); }
.mb-lg { margin-bottom: var(--space-lg); }

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