/* ============================================
   CIRCLE FOR WORK — RESOURCES HUB STYLES
   ============================================ */

:root {
  --green-deep: #0d3a2e;
  --green-darker: #02403D;
  --green-mid: #144a3a;
  --green-soft: #1a5040;
  --lime: #c4f53d;
  --lime-alt: #b8e836;
  --cream: #ffffff;
  --bg-gray: #F6F5F4;
  --text-dark: #1a1a1a;
  --text-muted: #4a4a4a;
  --border-light: rgba(2, 64, 61, 0.15);
  --radius-pill: 999px;
  --radius-card: 20px;
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.08);
  --shadow-md: 0 8px 24px rgba(0,0,0,0.10);
  --shadow-lg: 0 16px 40px rgba(0,0,0,0.16);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body { font-family: 'Inter', sans-serif; color: var(--text-dark); background: #fff; line-height: 1.7; -webkit-font-smoothing: antialiased; }
img { display: block; max-width: 100%; height: auto; }

/* Page Hero */
.page-hero {
  position: relative; isolation: isolate;
  background: 
    radial-gradient(ellipse 70% 45% at 75% 25%, rgba(11, 99, 83, 0.6) 0%, rgba(11, 99, 83, 0) 70%), 
    linear-gradient(180deg, rgba(3, 65, 62, 0.2) 0%, rgba(6, 75, 67, 0.5) 100%),
    url('../assets/hero_bg_texture.png') center/cover no-repeat;
  background-color: #03413E; /* Fallback */
  color: #fff; padding: 28px clamp(16px, 5vw, 48px) clamp(64px, 9vw, 112px); text-align: center;
}
.page-nav { display: flex; justify-content: center; margin-bottom: clamp(40px, 6vw, 72px); }
.nav-pill { display: inline-flex; align-items: center; gap: 8px; background: var(--green-deep); border-radius: var(--radius-pill); padding: 8px 8px 8px 14px; box-shadow: var(--shadow-md); }
.nav-logo { display: inline-flex; align-items: center; gap: 8px; color: #fff; font-size: 13px; font-weight: 600; text-decoration: none; padding-right: 12px; }
.nav-logo .logo-mark { width: 32px; height: 32px; display: inline-flex; align-items: center; justify-content: center; }
.nav-logo .logo-text { display: flex; flex-direction: column; line-height: 1.1; }
.nav-logo .logo-text small { font-size: 9px; opacity: .8; }
.nav-back { display: inline-flex; align-items: center; gap: 6px; background: var(--lime); color: var(--text-dark); border-radius: var(--radius-pill); padding: 8px 16px; font-size: 12px; font-weight: 600; text-decoration: none; box-shadow: var(--shadow-sm); transition: transform .15s ease, background .15s ease; }
.nav-back:hover { transform: translateY(-1px); background: var(--lime-alt); }

.page-hero h1 { font-family: 'Lora', serif; font-weight: 500; font-size: clamp(36px, 6vw, 64px); line-height: 1.05; margin-bottom: 16px; }
.page-hero h1 .accent {  margin-left: 8px; }
.page-hero .subtitle { font-size: clamp(16px, 2vw, 20px); max-width: 600px; margin: 0 auto 40px; color: rgba(255, 255, 255, 0.9); }


.dropdown-wrapper { position: relative; display: inline-block; z-index: 100; }
.browse-categories-btn { display: inline-flex; align-items: center; color: #fff; background: transparent; border: none; font: inherit; text-decoration: underline; text-decoration-color: var(--lime); text-underline-offset: 4px; font-weight: 500; cursor: pointer; padding: 0; outline: none; transition: color 0.2s ease; }
.browse-categories-btn:focus-visible { outline: 2px solid var(--lime); border-radius: 4px; outline-offset: 4px; }
.browse-categories-btn.active { color: var(--lime); text-decoration-color: #fff; }
.dropdown-chevron { transition: transform 0.25s ease; margin-left: 6px; }
.browse-categories-btn[aria-expanded="true"] .dropdown-chevron { transform: rotate(180deg); }

.categories-popup {
  position: absolute; top: calc(100% + 16px); left: 50%; transform: translateX(-50%) translateY(-10px);
  background: #fff; border-radius: 20px; box-shadow: var(--shadow-lg); border: 1px solid var(--border-light);
  width: max-content; max-width: calc(100vw - 32px); padding: 24px;
  opacity: 0; visibility: hidden; pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s ease;
}
.categories-popup[aria-hidden="false"] { opacity: 1; visibility: visible; transform: translateX(-50%) translateY(0); pointer-events: auto; }
.categories-popup .chip-wrapper { justify-content: center; max-width: 600px; margin: 0 auto; }

/* Main Content Structure */
.page-body { background: #fff; padding: 0 clamp(16px, 5vw, 32px) clamp(64px, 10vw, 120px); }
.body-inner { max-width: 1200px; margin: 0 auto; padding-top: clamp(40px, 6vw, 72px); }

/* Section Headers */
.section-header { display: flex; justify-content: space-between; align-items: flex-end; margin-bottom: 32px; border-bottom: 1px solid var(--border-light); padding-bottom: 16px; }
.section-header h2 { font-family: 'Lora', serif;  font-weight: 600; font-size: clamp(28px, 4vw, 36px); color: var(--green-darker); margin: 0; }
.section-link { color: var(--green-darker); font-weight: 600; text-decoration: none; display: inline-flex; align-items: center; gap: 4px; transition: color 0.15s ease; }
.section-link:hover { color: var(--lime); }
.section-link svg { fill: currentColor; }

/* Grid Systems */
.grid-featured { display: grid; grid-template-columns: 2fr 1fr; gap: 24px; margin-bottom: 64px; }
.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 24px; margin-bottom: 64px; }
.grid-4 { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 20px; margin-bottom: 64px; }

/* Resource Cards */
.res-card { background: var(--bg-gray); border-radius: var(--radius-card); overflow: hidden; display: flex; flex-direction: column; transition: transform 0.2s ease, box-shadow 0.2s ease; border: 1px solid transparent; text-decoration: none; color: inherit; }
.res-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); border-color: rgba(2, 64, 61, 0.1); }
.res-card-img-wrap { position: relative; width: 100%; aspect-ratio: 16 / 9; overflow: hidden; background: #e0e0e0; }
.res-card-img-wrap img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.4s ease; }
.res-card:hover .res-card-img-wrap img { transform: scale(1.05); }
.res-card-cat { position: absolute; top: 16px; left: 16px; background: rgba(255, 255, 255, 0.9); color: var(--green-darker); font-size: 12px; font-weight: 700; padding: 4px 12px; border-radius: var(--radius-pill); text-transform: uppercase; letter-spacing: 0.05em; backdrop-filter: blur(4px); }
.res-card-content { padding: 24px; display: flex; flex-direction: column; flex-grow: 1; }
.res-card-title { font-family: 'Lora', serif; font-weight: 600; font-size: 22px; color: var(--green-darker); line-height: 1.3; margin-bottom: 12px; }
.res-card-desc { font-size: 15px; color: var(--text-muted); line-height: 1.6; margin-bottom: 20px; flex-grow: 1; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.res-card-meta { display: flex; align-items: center; justify-content: space-between; font-size: 13px; color: var(--text-muted); font-weight: 500; border-top: 1px solid rgba(0,0,0,0.05); padding-top: 16px; }
.res-card-author { display: flex; align-items: center; gap: 8px; }
.res-card-author img { width: 24px; height: 24px; border-radius: 50%; object-fit: cover; }
.res-card-read-btn { color: var(--green-darker); font-weight: 600; text-decoration: underline; text-decoration-color: var(--lime); text-decoration-thickness: 2px; text-underline-offset: 4px; }

/* Featured Card Override */
.res-card.featured { grid-column: 1 / -1; flex-direction: row; align-items: stretch; max-height: 320px; }
.res-card.featured .res-card-img-wrap { width: 45%; height: auto; aspect-ratio: 16 / 10; min-height: 100%; object-fit: cover; }
.res-card.featured .res-card-content { width: 55%; padding: 32px 40px; display: flex; flex-direction: column; justify-content: space-between; }
.res-card.featured .res-card-title { font-size: 26px; margin-bottom: 12px; }
.res-card.featured .res-card-desc { font-size: 16px; margin-bottom: 24px; -webkit-line-clamp: 3; flex-grow: 0; }
.res-card.featured .res-card-meta { margin-top: auto; border-top: 1px solid var(--border-light); padding-top: 20px; }

/* Accordion */
.accordion-btn { display: flex; align-items: center; justify-content: space-between; width: 100%; background: none; border: none; font: inherit; color: inherit; cursor: pointer; padding: 0; text-align: left; outline: none; border-radius: 4px; }
.accordion-btn:focus-visible { outline: 2px solid var(--lime); outline-offset: 4px; }
.accordion-icon { transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1); fill: currentColor; }
.accordion-btn[aria-expanded="true"] .accordion-icon { transform: rotate(180deg); }
.accordion-content { display: grid; grid-template-rows: 0fr; transition: grid-template-rows 0.35s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.35s ease, margin-bottom 0.35s ease; opacity: 0; margin-bottom: 0; }
.accordion-content[data-expanded="true"] { grid-template-rows: 1fr; opacity: 1; margin-bottom: 64px; }
.accordion-content > .accordion-inner { overflow: hidden; }

/* Category Blocks */
.cat-block { background: var(--bg-gray); padding: 24px; border-radius: 16px; border-top: 4px solid var(--green-darker); text-decoration: none; color: inherit; transition: transform 0.15s ease, background 0.15s ease; display: flex; flex-direction: column; }
.cat-block:hover { transform: translateY(-3px); background: #f0efee; border-top-color: var(--lime); }
.cat-block h3 { font-size: 18px; color: var(--green-darker); margin-bottom: 8px; display: flex; align-items: center; justify-content: space-between; }
.cat-block p { font-size: 14px; margin: 0; color: var(--text-muted); }

/* Trending Chips */
.trending-container {
  margin-bottom: 64px;
  max-height: 118px;
  overflow: hidden;
}
.chip-wrapper {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.chip {
  display: inline-flex;
  align-items: center;
  padding: 8px 16px;
  background: #fff;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-pill);
  font-size: 13px;
  font-weight: 500;
  line-height: 1.2;
  color: var(--green-darker);
  text-decoration: none;
  transition: all 0.2s ease;
  box-shadow: var(--shadow-sm);
}
.chip:hover {
  background: var(--green-darker);
  color: #fff;
  border-color: var(--green-darker);
}

@media (max-width: 768px) {
  .trending-container {
    max-height: 98px;
  }
  .chip-wrapper {
    gap: 6px;
  }
  .chip {
    padding: 6px 12px;
    font-size: 12px;
  }
  .categories-popup {
    padding: 12px;
    border-radius: 16px;
  }
  .categories-popup .chip-wrapper {
    padding: 4px !important;
  }
  .categories-popup .chip {
    padding: 6px 10px;
    font-size: 11px;
  }
}

/* Newsletter CTA & Empty State */
.cta-box { background: #f4f8f7; padding: clamp(32px, 5vw, 56px); border-radius: clamp(24px, 4vw, 40px); text-align: center; border: 1px solid rgba(2,64,61,0.15); margin-top: 64px; }
.cta-box h2 { font-family: 'Lora', serif;  font-weight: 600; font-size: clamp(28px, 4vw, 36px); color: var(--green-darker); margin-bottom: 16px; }
.cta-box p { font-size: 16px; color: var(--text-dark); max-width: 600px; margin: 0 auto 32px; }
.cta-box a { display: inline-block; background: #c4f53d; color: #082c30; padding: 16px 36px; border-radius: 999px; font-weight: 600; text-decoration: none; box-shadow: 0 4px 12px rgba(0,0,0,0.1); transition: transform .15s ease, box-shadow .15s ease, background .15s ease; font-size: 15px; }
.cta-box a:hover { background: #b8e836; transform: translateY(-2px); box-shadow: 0 6px 16px rgba(0,0,0,0.15); }

.empty-state { text-align: center; padding: 64px 20px; background: var(--bg-gray); border-radius: var(--radius-card); border: 1px dashed var(--border-light); margin: 40px 0 64px; }
.empty-state svg { width: 64px; height: 64px; color: rgba(2, 64, 61, 0.4); margin-bottom: 24px; }
.empty-state h3 { font-family: 'Lora', serif; font-size: 24px; color: var(--green-darker); margin-bottom: 12px; }
.empty-state p { color: var(--text-muted); margin-bottom: 24px; max-width: 400px; margin-left: auto; margin-right: auto; }

/* Article Template Specific */
.article-hero-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; align-items: center; max-width: 1200px; margin: 0 auto 64px; padding: clamp(40px, 6vw, 80px) 0 0; }
.article-header { text-align: left; max-width: none; padding: 0; margin: 0; }
.breadcrumb { margin-bottom: 24px; font-size: 13px; font-weight: 500; color: var(--text-muted); }
.breadcrumb a { color: var(--green-darker); text-decoration: none; transition: color 0.15s ease; }
.breadcrumb a:hover { color: var(--lime); }
.breadcrumb .separator { margin: 0 8px; color: #ccc; }
.article-header h1 { font-family: 'Lora', serif; font-size: clamp(36px, 4vw, 52px); color: var(--green-darker); line-height: 1.15; margin-bottom: 16px; }
.article-subtitle { font-size: clamp(16px, 2vw, 18px); color: var(--text-muted); margin-bottom: 32px; line-height: 1.5; }
.article-meta-large { display: flex; align-items: center; justify-content: flex-start; gap: 24px; font-size: 14px; color: var(--text-muted); flex-wrap: wrap; }
.article-meta-large .author { display: flex; align-items: center; gap: 12px; font-weight: 600; color: var(--green-darker); }
.article-meta-large .author img { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; }
.article-featured-img { width: 100%; border-radius: 32px; overflow: hidden; background: var(--bg-gray); margin: 0; aspect-ratio: 16 / 10; box-shadow: var(--shadow-md); }
.article-featured-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.article-layout { display: grid; grid-template-columns: 280px 1fr; gap: 64px; align-items: start; max-width: 1200px; margin: 0 auto; padding-bottom: 64px; border-bottom: 1px solid var(--border-light); }
.toc-sidebar { position: sticky; top: 100px; background: var(--bg-gray); padding: 24px; border-radius: 16px; border: 1px solid var(--border-light); }
.toc-sidebar h3 { font-size: 16px; color: var(--green-darker); margin-bottom: 16px; text-transform: uppercase; letter-spacing: 0.05em; }
.toc-sidebar ul { list-style: none; padding: 0; margin: 0; }
.toc-sidebar li { margin-bottom: 12px; }
.toc-sidebar a { color: var(--text-muted); text-decoration: none; font-size: 14px; transition: color 0.15s ease; display: block; line-height: 1.4; }
.toc-sidebar a:hover, .toc-sidebar a.active { color: var(--green-darker); font-weight: 600; }
.article-content { min-width: 0; width: 100%; max-width: 760px; font-size: 17px; line-height: 1.8; color: var(--text-dark); }
.article-content h2 { font-family: 'Lora', serif; font-size: 32px; color: var(--green-darker); margin: 48px 0 24px; line-height: 1.2; }
.article-content h3 { font-size: 22px; color: var(--green-darker); margin: 32px 0 16px; }
.article-content p { margin-bottom: 24px; }
.article-content ul, .article-content ol { margin-bottom: 24px; padding-left: 24px; }
.article-content li { margin-bottom: 12px; }
.article-content img { border-radius: 12px; margin: 32px 0; width: 100%; height: auto; }

/* Responsive Tables */
.table-responsive {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 32px 0;
  border-radius: 12px;
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-sm);
  background: #fff;
}

.table-responsive table {
  width: 100%;
  min-width: 600px;
  border-collapse: collapse;
  text-align: left;
}

.table-responsive th {
  background: var(--bg-gray);
  padding: 16px 20px;
  font-weight: 600;
  color: var(--green-darker);
  border-bottom: 2px solid var(--border-light);
  font-family: 'Inter', sans-serif;
  white-space: nowrap;
}

.table-responsive td {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-light);
  color: var(--text-dark);
  font-size: 15px;
  vertical-align: top;
  line-height: 1.6;
}

.table-responsive tr:last-child td {
  border-bottom: none;
}

.table-responsive tbody tr:hover {
  background: var(--bg-gray);
}

.article-content blockquote { font-family: 'Lora', serif;  font-size: 24px; color: var(--green-darker); border-left: 4px solid var(--lime); padding-left: 24px; margin: 40px 0; line-height: 1.4; }
.key-takeaways { background: #f4f8f7; border: 1px solid var(--border-light); padding: 32px; border-radius: 20px; margin: 48px 0; }
.key-takeaways h3 { margin-top: 0; font-family: 'Lora', serif; font-size: 24px; color: var(--green-darker); }
.article-footer { display: flex; justify-content: space-between; align-items: center; padding: 32px 0; border-bottom: 1px solid var(--border-light); margin-bottom: 64px; max-width: 760px; }
.share-buttons { display: flex; align-items: center; gap: 12px; }
.share-btn { width: 40px; height: 40px; border-radius: 50%; background: var(--bg-gray); display: flex; align-items: center; justify-content: center; color: var(--green-darker); text-decoration: none; transition: all 0.15s ease; border: 1px solid var(--border-light); }
.share-btn:hover { background: var(--green-darker); color: #fff; }
.article-nav { display: flex; justify-content: space-between; max-width: 1200px; margin: 0 auto 64px; }
.nav-article-card { width: 48%; padding: 24px; background: var(--bg-gray); border-radius: 16px; text-decoration: none; color: inherit; transition: background 0.15s ease; border: 1px solid transparent; }
.nav-article-card:hover { background: #fff; border-color: var(--lime); box-shadow: var(--shadow-sm); }
.nav-label { font-size: 12px; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 8px; display: block; }
.nav-title { font-family: 'Lora', serif; font-weight: 600; font-size: 20px; color: var(--green-darker); }

/* Explore Slider */
.explore-section { margin-top: 64px; }
.explore-slider-container { overflow-x: auto; scroll-behavior: smooth; scroll-snap-type: x mandatory; scrollbar-width: none; -ms-overflow-style: none; display: flex; gap: 20px; padding: 16px 16px 40px 16px; margin: -16px -16px 0 -16px; }
.explore-slider-container::-webkit-scrollbar { display: none; }
.explore-card { scroll-snap-align: start; flex: 0 0 calc(20% - 16px); background: #fff; padding: 20px; border-radius: 12px; border: 1px solid var(--border-light); text-decoration: none; color: inherit; display: flex; flex-direction: column; transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease; cursor: pointer; user-select: none; height: 160px; justify-content: space-between; align-items: flex-start; margin-bottom: 8px; }
.explore-card:hover { transform: translateY(-4px); box-shadow: 0 12px 24px rgba(0,0,0,0.06); border-color: var(--lime); }
.explore-icon { color: var(--green-darker); display: flex; width: 32px; height: 32px; stroke-width: 1.5; }
.explore-title { font-size: 15px; color: var(--text-dark); font-weight: 500; line-height: 1.3; max-width: 100%; }
.explore-controls { display: flex; align-items: center; justify-content: center; gap: 16px; margin-bottom: 64px; }
.explore-btn { background: var(--green-darker); color: #fff; border: none; width: 36px; height: 36px; border-radius: 50%; display: flex; align-items: center; justify-content: center; cursor: pointer; transition: background 0.15s ease; }
.explore-btn:hover:not(:disabled) { background: var(--green-deep); }
.explore-btn:disabled { opacity: 0.3; cursor: not-allowed; }
.explore-dots { display: flex; gap: 8px; }
.explore-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--border-light); transition: background 0.15s ease; border: none; cursor: pointer; padding: 0; }
.explore-dot.active { background: var(--green-darker); transform: scale(1.2); }

/* Utilities */
.hidden { display: none !important; }

/* Responsive Overrides */
@media (max-width: 992px) {
  .article-hero-grid { grid-template-columns: 1fr; gap: 32px; padding: clamp(24px, 4vw, 40px) 0 0; }
  .article-header { text-align: left; }
  .article-featured-img { aspect-ratio: 16 / 9; border-radius: 20px; }
  .grid-featured { grid-template-columns: 1fr; }
  .res-card.featured { flex-direction: column; max-height: none; }
  .res-card.featured .res-card-img-wrap { width: 100%; aspect-ratio: 16 / 9; min-height: auto; }
  .res-card.featured .res-card-content { width: 100%; padding: 24px; }
  .article-layout { grid-template-columns: 1fr; gap: 40px; }
  .toc-sidebar { position: static; margin-bottom: 40px; }
  .explore-card { flex: 0 0 calc(50% - 12px); }
}
@media (max-width: 768px) {
  .article-nav { flex-direction: column; gap: 20px; }
  .nav-article-card { width: 100%; }
  .explore-card { flex: 0 0 calc(60% - 12px); height: 120px; padding: 16px; }

  /* Stacked Card Tables */
  .table-responsive {
    border: none;
    background: transparent;
    box-shadow: none;
    overflow-x: hidden;
  }
  .table-responsive table {
    min-width: 0;
  }
  .table-responsive table, .table-responsive thead, .table-responsive tbody, .table-responsive th, .table-responsive td, .table-responsive tr {
    display: block;
  }
  .table-responsive thead {
    display: none;
  }
  .table-responsive tr {
    margin-bottom: 32px;
    background: #fff;
    border: 1px solid var(--border-light);
    border-radius: 16px;
    padding: 24px;
    box-shadow: var(--shadow-sm);
  }
  .table-responsive td:first-child {
    font-size: 20px;
    font-family: 'Lora', serif;
    font-weight: 600;
    color: var(--green-darker);
    border-bottom: 2px solid var(--border-light);
    margin-bottom: 20px;
    padding: 0 0 16px 0;
  }
  .table-responsive td:not(:first-child) {
    border-bottom: none;
    padding: 12px 0;
    position: relative;
    padding-left: 0;
  }
  .table-responsive td:not(:first-child)::before {
    content: attr(data-label);
    display: block;
    font-size: 13px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 8px;
  }
}
