:root {
  --primary-blue: #0052cc;
  --hero-gradient: linear-gradient(135deg, #0061ff 0%, #0033aa 100%);
  --bg-light: #f8fafc;
  --white: #ffffff;
  --text-main: #1e293b;
  --text-muted: #64748b;
  --border-color: #e2e8f0;
  --shadow-sm: 0 2px 4px rgba(0,0,0,0.05);
  --shadow-md: 0 10px 15px -3px rgba(0,0,0,0.1);
  --radius: 12px;
  --transition: all 0.3s ease;
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', sans-serif;
  color: var(--text-main);
  background: #f6f9fc;
  line-height: 1.7;
  overflow-x: hidden;
}

a {
  text-decoration: none;
  color: inherit;
}

img {
  max-width: 100%;
  display: block;
}

.container {
  max-width: 1220px;
  margin: 0 auto;
  padding: 0 16px;
}

.section-padding {
  padding: 72px 0;
}

/* -----------------------------------
   HERO
----------------------------------- */
.guides-hero-alt {
  background:
    radial-gradient(circle at top left, rgba(255,255,255,0.18), transparent 30%),
    var(--hero-gradient);
  color: var(--white);
  padding: 64px 0 72px;
}

.guides-hero-simple {
  max-width: 900px;
}

.guides-hero-main {
  max-width: 820px;
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 20px;
  font-size: 0.95rem;
  color: rgba(255,255,255,0.86);
}

.breadcrumb a {
  color: rgba(255,255,255,0.96);
}

.guides-hero-main h1 {
  font-size: clamp(2.2rem, 5vw, 4rem);
  line-height: 1.08;
  max-width: 820px;
  margin-bottom: 18px;
}

.hero-lead {
  max-width: 760px;
  font-size: 1.05rem;
  color: rgba(255,255,255,0.9);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 28px;
}

.hero-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 22px;
  border-radius: 999px;
  font-weight: 700;
  border: 1px solid transparent;
  transition: var(--transition);
}

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

.hero-btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.hero-btn-secondary {
  background: rgba(255,255,255,0.1);
  color: var(--white);
  border-color: rgba(255,255,255,0.22);
}

.hero-btn-secondary:hover {
  background: rgba(255,255,255,0.16);
}

/* -----------------------------------
   GUIDE HUB LAYOUT
----------------------------------- */
.guides-content {
  padding-top: 56px;
}

.guides-hub-layout,
.three-column-hub {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 28px;
  align-items: start;
}

.guides-hub-main {
  min-width: 0;
  width: 100%;
}

/* -----------------------------------
   LEFT CATEGORY NAV
----------------------------------- */
.guide-category-nav {
  position: sticky;
  top: 100px;
  align-self: start;
}

.category-nav-inner {
  background: var(--white);
  border: 1px solid var(--border-color);
  border-radius: 22px;
  padding: 20px;
  box-shadow: var(--shadow-sm);
}

.category-nav-inner h2 {
  font-size: 1.05rem;
  margin-bottom: 4px;
}

.category-nav-inner p {
  color: var(--text-muted);
  font-size: 0.92rem;
  margin-bottom: 16px;
}

.category-links {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.category-links a {
  display: block;
  padding: 10px 12px;
  border-radius: 10px;
  color: var(--text-muted);
  font-weight: 700;
  font-size: 0.95rem;
  transition: var(--transition);
}

.category-links a:hover,
.category-links a.active {
  background: #eef4ff;
  color: var(--primary-blue);
}

/* -----------------------------------
   SECTION INTRO
----------------------------------- */
.section-intro {
  margin-bottom: 22px;
}

.section-kicker {
  display: inline-block;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 800;
  color: var(--primary-blue);
  margin-bottom: 10px;
}

.section-intro h2 {
  font-size: clamp(1.8rem, 3vw, 2.5rem);
  line-height: 1.2;
  margin-bottom: 10px;
}

.section-intro p {
  color: var(--text-muted);
  max-width: 760px;
}

/* -----------------------------------
   SEARCH
----------------------------------- */
.guide-search-wrap {
  margin-bottom: 14px;
}

.guide-search-box {
  position: relative;
}

.search-icon {
  position: absolute;
  top: 50%;
  left: 16px;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-weight: 800;
}

.guide-search-box input {
  width: 100%;
  min-height: 54px;
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 0 18px 0 46px;
  font-size: 0.96rem;
  background: var(--white);
  outline: none;
  transition: var(--transition);
}

.guide-search-box input:focus {
  border-color: var(--primary-blue);
  box-shadow: 0 0 0 4px rgba(0, 82, 204, 0.08);
}

.guide-count-row {
  margin: 0 0 18px;
}

.guide-count-row p {
  color: var(--text-muted);
  font-size: 0.94rem;
}

/* -----------------------------------
   GUIDE LIST
----------------------------------- */
.editorial-guide-list {
  display: flex;
  flex-direction: column;
  gap: 18px;
  width: 100%;
}

.editorial-guide-card {
  background: var(--white);
  border: 1px solid var(--border-color);
  border-radius: 22px;
  padding: 24px;
  display: none;
  justify-content: space-between;
  gap: 22px;
  align-items: center;
  transition: var(--transition);
  box-shadow: var(--shadow-sm);
  width: 100%;
  min-width: 0;
  overflow: hidden;
}

.editorial-guide-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

.editorial-guide-left {
  flex: 1;
  min-width: 0;
}

.editorial-tag {
  display: inline-block;
  margin-bottom: 12px;
  padding: 6px 10px;
  background: #eef4ff;
  color: var(--primary-blue);
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
}

.editorial-guide-card h3 {
  font-size: 1.28rem;
  line-height: 1.3;
  margin-bottom: 10px;
}

.editorial-guide-card h3 a:hover {
  color: var(--primary-blue);
}

.editorial-guide-card p {
  color: var(--text-muted);
  margin-bottom: 14px;
  max-width: 760px;
}

.editorial-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  font-size: 0.92rem;
  color: var(--text-muted);
}

.editorial-guide-right {
  flex-shrink: 0;
}

.read-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 18px;
  border-radius: 999px;
  background: var(--primary-blue);
  color: var(--white);
  font-weight: 700;
  transition: var(--transition);
  white-space: nowrap;
}

.read-btn:hover {
  opacity: 0.94;
  transform: translateY(-1px);
}

/* -----------------------------------
   EMPTY STATE
----------------------------------- */
.empty-guides-message {
  display: none;
  text-align: center;
  background: var(--white);
  border: 1px dashed var(--border-color);
  border-radius: 20px;
  padding: 42px 20px;
  margin-top: 18px;
}

.empty-guides-message.show {
  display: block;
}

.empty-guides-message h3 {
  margin-bottom: 8px;
}

.empty-guides-message p {
  color: var(--text-muted);
}

.popular-guides-section {
  margin-top: 60px;
}

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

/* -----------------------------------
   CALCULATOR GRID
----------------------------------- */
.guides-calculator-section {
  margin-top: 64px;
}

.calculator-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
}

.calculator-card {
  background: var(--white);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  padding: 22px;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
  min-width: 0;
}

.calculator-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: #cfe0ff;
}

.calculator-card span {
  display: inline-block;
  margin-bottom: 10px;
  font-size: 0.76rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--primary-blue);
}

.calculator-card h3 {
  font-size: 1.12rem;
  line-height: 1.3;
  margin-bottom: 8px;
}

.calculator-card p {
  color: var(--text-muted);
  font-size: 0.95rem;
}

/* -----------------------------------
   RESPONSIVE
----------------------------------- */
@media (max-width: 1180px) {
  .guides-hub-layout,
  .three-column-hub {
    grid-template-columns: 220px minmax(0, 1fr);
  }

  .popular-guides-sidebar {
    grid-column: 1 / -1;
    position: static;
  }

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

  .calculator-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 900px) {
  .guides-hub-layout,
  .three-column-hub {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .guide-category-nav,
  .popular-guides-sidebar {
    position: static;
    width: 100%;
  }

  .category-links {
    display: flex;
    flex-direction: row;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 6px;
    scrollbar-width: thin;
  }

  .category-links a {
    flex: 0 0 auto;
    white-space: nowrap;
  }

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

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

/* FORCE MOBILE CARD FIX */
@media (max-width: 768px) {
  html,
  body {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden !important;
  }

  .container {
    width: 100% !important;
    max-width: 100% !important;
    padding-left: 16px !important;
    padding-right: 16px !important;
    overflow-x: hidden !important;
  }

  .guides-hub-layout,
  .three-column-hub {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
  }

  .guide-category-nav,
  .guides-hub-main,
  .popular-guides-sidebar {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    position: static !important;
    overflow: hidden !important;
  }

  .editorial-guide-list {
    width: 100% !important;
    max-width: 100% !important;
    overflow: hidden !important;
  }

  .editorial-guide-card {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    display: none;
    flex-direction: column !important;
    align-items: stretch !important;
    justify-content: flex-start !important;
    gap: 16px !important;
    padding: 20px 16px !important;
    overflow: hidden !important;
  }

  .editorial-guide-left,
  .editorial-guide-right {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    flex: none !important;
  }

  .editorial-guide-card h3,
  .editorial-guide-card h3 a,
  .editorial-guide-card p,
  .editorial-meta {
    width: 100% !important;
    max-width: 100% !important;
    overflow-wrap: break-word !important;
    word-break: normal !important;
  }

  .editorial-guide-card h3 {
    font-size: 1.05rem !important;
    line-height: 1.35 !important;
  }

  .editorial-guide-card p {
    font-size: 0.94rem !important;
    line-height: 1.6 !important;
  }

  .read-btn {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    display: flex !important;
    white-space: normal !important;
  }

  .guide-search-box input,
  input,
  select,
  textarea {
    font-size: 16px !important;
  }

  .guide-search-box input {
    min-height: 52px;
  }

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

@media (max-width: 560px) {
  .container {
    padding: 0 14px;
  }

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

  .category-nav-inner,
  .calculator-card {
    padding: 18px;
  }
}

@media (max-width: 480px) {
  .guides-hero-main h1 {
    font-size: 2rem;
  }

  .hero-lead {
    font-size: 0.98rem;
  }

  .section-intro h2 {
    font-size: 1.6rem;
  }

  .editorial-guide-card {
    padding: 18px 14px;
    border-radius: 18px;
  }

  .editorial-tag {
    font-size: 0.72rem;
  }

  .guide-search-box input {
    font-size: 0.92rem;
  }
}