/* ============================================================
   CSS CUSTOM PROPERTIES (VARIABLES)
   ============================================================ */
:root {
  /* Colors */
  --color-bg:             #ffffff;
  --color-text:           #000000;
  --color-text-muted:     #666;
  --color-text-faint:     #888;
  --color-border:         #e0e0e0;
  --color-red:            #d73634;
  --color-red-dark:       #a83c3c;
  --color-tab-active:     #a83c3c;
  --color-table-head-bg:  #e8c5c5;
  --color-table-head-text:#a83c3c;
  --color-table-cell-red: #f5e5e5;
  --color-table-row-gap:  #ffffff;
  --color-page-inactive:  #e5e7eb;
  --color-page-inactive-hover: #d1d5db;
  --color-page-text:      #6b7280;
  --color-page-arrow:     #9ca3af;
  --color-page-arrow-hover: #4b5563;
  --color-page-placeholder: #f3f4f6;

  /* Typography */
  --font-system: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-body:   "Roboto", sans-serif;

  /* Transitions */
  --transition-fast: 0.2s;
  --transition-base: 0.2s ease;
  --transition-slow: 0.3s ease;
}


/* ============================================================
   Base
   ============================================================ */
body {
  font-family: var(--font-system);
  background-color: var(--color-bg);
  color: var(--color-text);
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
}

a { text-decoration: none; color: var(--color-text); }

/* These sections exist in the shared HTML but are not shown on this page */
.total-value-section,
.HOME,
.subtitle { display: none; }

/* Floating search button from layout.css not needed here */
.search-wrapper { display: none; }

/* Screen-reader-only text for accessibility */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}


/* ============================================================
   Page Container
   ============================================================ */
.main-container {
  max-width: 1100px;
  width: 90%;
  margin: 2rem auto;
  padding: 0 1rem;
}

@media (max-width: 568px) {
  .main-container { width: 95%; padding: 0 0.3rem; }
}


/* ============================================================
   Category Tabs
   Horizontally scrollable on mobile. The active tab gets a
   red underline that sits flush on the shared border-bottom
   by using position: relative; bottom: -2px.
   ============================================================ */
.category-tabs {
  display: flex;
  gap: 0;
  margin-bottom: 50px;
  border-bottom: 2px solid var(--color-border);
}

.tab-btn {
  padding: 1rem 2.5rem;
  font-family: var(--font-system);
  font-size: 1.1rem;
  font-weight: 400;
  background-color: transparent;
  border: none;
  border-bottom: 3px solid transparent;
  cursor: pointer;
  transition: all var(--transition-slow);
  color: var(--color-text-muted);
  position: relative;
  bottom: -2px; /* overlaps the container border to create a flush underline */
}

.tab-btn:hover { color: #333; }

.tab-btn.active {
  color: var(--color-tab-active);
  border-bottom: 1.5px solid var(--color-tab-active);
  font-weight: 500;
}


/* ============================================================
   Resources Section & Table
   Four-column layout: Resource | Value | Description | Apply.
   Columns 1 & 4 use a soft red tint; 2 & 3 are white.
   White row gaps (border-bottom on tr) create a card-row look.
   ============================================================ */
.resources-section {
  width: 100%;
  min-height: 400px;
}

/* Fades in when the active tab switches */
.resources-table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--font-system);
  animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Header row — all headers use the softer cell-red tint */
.resources-table thead th {
  padding: 1.3rem 1.5rem;
  text-align: left;
  font-weight: 400;
  font-size: 1.15rem;
  color: var(--color-table-head-text);
  text-transform: capitalize;
  background-color: #e8c5c5;

}

/* Column widths */
.resources-table thead th:nth-child(1) { width: 22%; }
.resources-table thead th:nth-child(2) { width: 15%; }
.resources-table thead th:nth-child(3) { width: 48%; }
.resources-table thead th:nth-child(4) { width: 15%; }

.resources-table thead th:nth-child(3) {
    background-color: #f5e5e5;
}

.resources-table thead th:nth-child(2) {
    background-color: #f5e5e5;
}


/* White gap between rows */
.resources-table tbody tr { border-bottom: 4px solid var(--color-table-row-gap); }

.resources-table tbody td {
  padding: 1.5rem;
  font-size: 1rem;
  color: var(--color-text);
}

/* Col 1 — Resource name (soft red) */
.resources-table tbody td:nth-child(1) {
  background-color: var(--color-table-cell-red);
  font-weight: 400;
  width: 22%;
}

/* Col 2 — Value / price (white, bold) */
.resources-table tbody td:nth-child(2) {
  background-color: var(--color-table-row-gap);
  font-weight: 700;
  font-size: 1.25rem;
  width: 15%;
}

/* Col 3 — Description (white) */
.resources-table tbody td:nth-child(3) {
  background-color: var(--color-table-row-gap);
  font-size: 1rem;
  line-height: 1.5;
  width: 48%;
}

/* Col 4 — Apply link (soft red, centred) */
.resources-table tbody td:nth-child(4) {
  background-color: var(--color-table-cell-red);
  text-align: center;
  width: 15%;
}

.apply-link {
  color: var(--color-red-dark);
  font-weight: 400;
  font-size: 1rem;
  transition: color var(--transition-fast);
}

.apply-link:hover { color: var(--color-red); }


/* ============================================================
   Loading & Empty States
   ============================================================ */
.loading-state,
.no-results {
  text-align: center;
  padding: 3rem;
  font-family: var(--font-body);
  font-size: 1.2rem;
  color: var(--color-text-faint);
}


/* ============================================================
   Pagination
   Identical pattern to articles.css — page circles with
   prev/next arrows. Active circle is larger and red.
   ============================================================ */
.pagination-bar {
  width: 100%;
  display: flex;
  justify-content: center;
  padding: 3rem 0;
  margin-top: 1rem;
}

.pagination-wrapper {
  display: flex;
  align-items: center;
  gap: 1rem;
  user-select: none;
}

.arrow-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--color-page-arrow);
  padding: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color var(--transition-base);
}

.arrow-btn:hover { color: var(--color-page-arrow-hover); }

.arrow-btn svg {
  width: 12px;
  height: 12px;
  fill: currentColor;
}

#pages-container {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.page-circle {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 500;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease-in-out;
  font-family: var(--font-body);
  font-size: 1rem;
}

.page-circle.inactive {
  background-color: var(--color-page-inactive);
  color: var(--color-page-text);
}

.page-circle.inactive:hover { background-color: var(--color-page-inactive-hover); }

.page-circle.active {
  width: 3.5rem;
  height: 3.5rem;
  background-color: #A93836;
  color: #fff;
  font-size: 1.25rem;
  font-weight: 700;
  z-index: 2;
  transform: scale(1.1);
}

.page-circle.placeholder {
  background-color: var(--color-page-placeholder);
  cursor: default;
}


/* ============================================================
   Responsive
   ============================================================ */

/* Tablet */
@media (max-width: 768px) {
  .main-container { width: 95%; }

  /* Allow tabs to scroll horizontally without wrapping */
  .category-tabs { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .tab-btn       { padding: 0.9rem 1.5rem; font-size: 1rem; white-space: nowrap; }

  .resources-table thead th          { padding: 1rem 0.8rem;   font-size: 1rem; }
  .resources-table tbody td          { padding: 1.2rem 0.8rem; font-size: 0.95rem; }
  .resources-table tbody td:nth-child(2) { font-size: 1.1rem; }
  .resources-table tbody td:nth-child(3) { font-size: 0.9rem; }
  .apply-link                        { font-size: 0.95rem; }

  .pagination-bar     { padding: 1.5rem 0; }
  .pagination-wrapper { gap: 0.75rem; }
  .page-circle        { width: 2.25rem; height: 2.25rem; }
  .page-circle.active { width: 3rem; height: 3rem; font-size: 1.1rem; }
}

/* Small mobile */
@media (max-width: 480px) {
  .pagination-bar {
    padding: 1rem 0 1.25rem;
    background: linear-gradient(to top, #f9fafb 90%, transparent);
  }

  .pagination-wrapper { gap: 0.5rem; }
  #pages-container    { gap: 0.25rem; }

  .page-circle        { width: 2rem;    height: 2rem;    font-size: 0.9rem; }
  .page-circle.active { width: 2.75rem; height: 2.75rem; font-size: 1rem; transform: scale(1.05); }
  .arrow-btn          { padding: 0.25rem; }
}