/* Content Catalog — Friendly HR Professional™
   Mobile-first, matches brand.css palette (navy, orange, cream)
*/

:root {
  --navy:       #1A3557;
  --navy-light: #2D4F7A;
  --orange:     #E8723A;
  --orange-lt:  #F5A574;
  --cream:      #FDF6EC;
  --cream-dk:   #F0DCC4;
  --white:      #FFFFFF;
  --text:       #2A2A2A;
  --text-soft:  #5A5A5A;
  --green:      #2E7D32;
  --green-lt:   #E8F5E9;
}

/* ── Base ─────────────────────────────────────────────────── */
body { font-size: 16px; }

/* ── Page wrapper ─────────────────────────────────────────── */
.catalog-page {
  min-height: 100vh;
  background: var(--cream);
  padding-bottom: 4rem;
}

/* ── Hero ─────────────────────────────────────────────────── */
.catalog-hero {
  background: var(--navy);
  color: var(--white);
  padding: 3rem 1.5rem 2.5rem;
  text-align: center;
}

.catalog-hero-eyebrow {
  display: inline-block;
  background: rgba(232,114,58,0.2);
  color: var(--orange-lt);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.3rem 0.8rem;
  border-radius: 999px;
  margin-bottom: 1rem;
}

.catalog-hero h1 {
  font-family: 'Lora', serif;
  font-size: clamp(1.75rem, 5vw, 2.75rem);
  font-weight: 600;
  line-height: 1.2;
  margin-bottom: 0.75rem;
}

.catalog-hero p {
  color: rgba(255,255,255,0.75);
  font-size: 1rem;
  max-width: 480px;
  margin: 0 auto 1.5rem;
}

/* ── Search bar ───────────────────────────────────────────── */
.catalog-search-wrap {
  max-width: 480px;
  margin: 0 auto;
}

.catalog-search-form {
  display: flex;
  gap: 0.5rem;
}

.catalog-search-form input {
  flex: 1;
  padding: 0.65rem 1rem;
  border-radius: 999px;
  border: 2px solid rgba(255,255,255,0.2);
  background: rgba(255,255,255,0.1);
  color: var(--white);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.2s;
}

.catalog-search-form input::placeholder { color: rgba(255,255,255,0.5); }
.catalog-search-form input:focus { border-color: var(--orange); }

.catalog-search-form button {
  background: var(--orange);
  color: var(--white);
  border: none;
  border-radius: 999px;
  padding: 0.65rem 1.25rem;
  font-family: 'DM Sans', sans-serif;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.2s;
}

.catalog-search-form button:hover { background: var(--orange-lt); }

/* ── Search results banner ────────────────────────────────── */
.search-results-banner {
  background: var(--white);
  border: 1px solid var(--cream-dk);
  border-radius: 8px;
  padding: 1rem 1.25rem;
  margin: 1.5rem;
  font-size: 0.9rem;
  color: var(--text-soft);
}

.search-results-banner strong { color: var(--navy); }
.search-results-banner a { color: var(--orange); }

/* ── Section headings ─────────────────────────────────────── */
.catalog-section {
  padding: 2rem 1.25rem 1rem;
}

.catalog-section + .catalog-section {
  padding-top: 1rem;
}

.catalog-section-title {
  font-family: 'Lora', serif;
  font-size: 1.35rem;
  font-weight: 600;
  color: var(--navy);
  margin-bottom: 0.25rem;
}

.catalog-section-sub {
  font-size: 0.875rem;
  color: var(--text-soft);
  margin-bottom: 1.25rem;
}

/* ── Category cards ────────────────────────────────────────── */
.category-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

@media (min-width: 600px) {
  .category-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 900px) {
  .category-grid { grid-template-columns: repeat(3, 1fr); }
}

.category-card {
  background: var(--white);
  border-radius: 12px;
  padding: 1.25rem;
  text-decoration: none;
  color: var(--text);
  border: 2px solid transparent;
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.category-card:hover {
  border-color: var(--orange);
  box-shadow: 0 4px 20px rgba(232,114,58,0.15);
  transform: translateY(-2px);
}

.category-card-icon {
  font-size: 2rem;
  line-height: 1;
  margin-bottom: 0.25rem;
}

.category-card-name {
  font-weight: 700;
  font-size: 1rem;
  color: var(--navy);
}

.category-card-meta {
  font-size: 0.8rem;
  color: var(--orange);
  font-weight: 600;
}

.category-card-desc {
  font-size: 0.875rem;
  color: var(--text-soft);
  line-height: 1.5;
}

.category-card-arrow {
  margin-top: auto;
  font-size: 0.85rem;
  color: var(--orange);
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

/* ── Featured items ────────────────────────────────────────── */
.featured-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.875rem;
}

@media (min-width: 600px) {
  .featured-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 900px) {
  .featured-grid { grid-template-columns: repeat(3, 1fr); }
}

.featured-item-card {
  background: var(--white);
  border-radius: 12px;
  padding: 1.125rem;
  text-decoration: none;
  color: var(--text);
  border: 1px solid var(--cream-dk);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  transition: box-shadow 0.2s, transform 0.2s;
}

.featured-item-card:hover {
  box-shadow: 0 4px 16px rgba(0,0,0,0.08);
  transform: translateY(-2px);
}

.item-type-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  width: fit-content;
}

.type-template   { background: #E3F2FD; color: #1565C0; }
.type-guide       { background: #E8F5E9; color: #2E7D32; }
.type-tracker     { background: #FFF3E0; color: #E65100; }
.type-checklist   { background: #F3E5F5; color: #6A1B9A; }
.type-directory   { background: #E0F7FA; color: #00695C; }

.item-card-title {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--navy);
  line-height: 1.35;
}

.item-card-desc {
  font-size: 0.825rem;
  color: var(--text-soft);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.item-card-category {
  font-size: 0.75rem;
  color: var(--text-soft);
  margin-top: auto;
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.item-card-category span:first-child { font-size: 0.9rem; }

/* ── Search results list ──────────────────────────────────── */
.search-results-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 0 0 1rem;
}

.search-result-item {
  background: var(--white);
  border-radius: 10px;
  padding: 1rem 1.125rem;
  text-decoration: none;
  color: var(--text);
  border: 1px solid var(--cream-dk);
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  transition: box-shadow 0.2s;
}

.search-result-item:hover { box-shadow: 0 2px 12px rgba(0,0,0,0.07); }

.search-result-icon {
  font-size: 1.4rem;
  flex-shrink: 0;
}

.search-result-body { flex: 1; min-width: 0; }

.search-result-meta {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  margin-bottom: 0.2rem;
}

.search-result-title {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--navy);
  margin-bottom: 0.2rem;
}

.search-result-desc {
  font-size: 0.825rem;
  color: var(--text-soft);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ── Category page ────────────────────────────────────────── */
.category-header {
  background: var(--navy);
  color: var(--white);
  padding: 2.5rem 1.25rem 2rem;
  text-align: center;
}

.category-header-back {
  font-size: 0.8rem;
  color: rgba(255,255,255,0.6);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  margin-bottom: 1rem;
}

.category-header-back:hover { color: var(--orange-lt); }

.category-header-icon { font-size: 2.5rem; margin-bottom: 0.5rem; }

.category-header h1 {
  font-family: 'Lora', serif;
  font-size: 1.75rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.category-header-desc {
  color: rgba(255,255,255,0.75);
  font-size: 0.9rem;
  max-width: 420px;
  margin: 0 auto;
}

.category-items-list {
  display: flex;
  flex-direction: column;
  gap: 0.875rem;
  padding: 1.5rem 1.25rem;
}

.category-item-row {
  background: var(--white);
  border-radius: 12px;
  padding: 1.125rem 1.25rem;
  text-decoration: none;
  color: var(--text);
  border: 1px solid var(--cream-dk);
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  transition: box-shadow 0.2s, border-color 0.2s;
}

.category-item-row:hover {
  border-color: var(--orange);
  box-shadow: 0 3px 14px rgba(232,114,58,0.12);
}

.item-row-icon { font-size: 1.5rem; flex-shrink: 0; }

.item-row-body { flex: 1; min-width: 0; }

.item-row-header {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  margin-bottom: 0.25rem;
  flex-wrap: wrap;
}

.item-row-title {
  font-weight: 700;
  font-size: 1rem;
  color: var(--navy);
}

.item-row-desc {
  font-size: 0.875rem;
  color: var(--text-soft);
  line-height: 1.5;
}

/* ── Detail page ───────────────────────────────────────────── */
.detail-page {
  min-height: 100vh;
  background: var(--cream);
}

.detail-header {
  background: var(--navy);
  color: var(--white);
  padding: 2rem 1.25rem;
}

.detail-header-back {
  font-size: 0.8rem;
  color: rgba(255,255,255,0.6);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  margin-bottom: 1.25rem;
}

.detail-header-back:hover { color: var(--orange-lt); }

.detail-header-meta {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  margin-bottom: 0.75rem;
  flex-wrap: wrap;
}

.detail-header h1 {
  font-family: 'Lora', serif;
  font-size: 1.65rem;
  font-weight: 600;
  line-height: 1.3;
  margin-bottom: 0.75rem;
}

.detail-header-desc {
  color: rgba(255,255,255,0.8);
  font-size: 0.95rem;
  line-height: 1.6;
}

.detail-body {
  max-width: 680px;
  margin: 0 auto;
  padding: 2rem 1.25rem 3rem;
}

.detail-content {
  font-size: 0.95rem;
  line-height: 1.75;
  color: var(--text);
}

.detail-content h2 {
  font-family: 'Lora', serif;
  font-size: 1.25rem;
  color: var(--navy);
  margin: 1.5rem 0 0.5rem;
}

.detail-content h3 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--navy);
  margin: 1.25rem 0 0.4rem;
}

.detail-content p { margin-bottom: 1rem; }

.detail-content ul, .detail-content ol {
  margin: 0.75rem 0 1rem 1.25rem;
}

.detail-content li { margin-bottom: 0.35rem; }

.detail-content strong { color: var(--navy); }

.detail-content blockquote {
  border-left: 4px solid var(--orange);
  padding: 0.75rem 1rem;
  background: rgba(232,114,58,0.07);
  border-radius: 0 6px 6px 0;
  margin: 1rem 0;
  font-style: italic;
}

/* ── Action buttons ───────────────────────────────────────── */
.detail-actions {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--cream-dk);
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  background: var(--orange);
  color: var(--white);
  padding: 0.85rem 1.5rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: background 0.2s;
  text-align: center;
}

.btn-primary:hover { background: var(--navy-light); }

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  background: var(--white);
  color: var(--navy);
  padding: 0.85rem 1.5rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
  border: 2px solid var(--navy);
  cursor: pointer;
  transition: background 0.2s;
  text-align: center;
}

.btn-secondary:hover { background: var(--cream); }

.detail-meta-info {
  font-size: 0.8rem;
  color: var(--text-soft);
  display: flex;
  gap: 1rem;
  margin-top: 0.75rem;
}

/* ── Admin page ───────────────────────────────────────────── */
.admin-page {
  min-height: 100vh;
  background: var(--cream);
  padding: 2rem 1.25rem;
}

.admin-header {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

@media (min-width: 600px) {
  .admin-header { flex-direction: row; align-items: center; justify-content: space-between; }
}

.admin-header h1 {
  font-family: 'Lora', serif;
  font-size: 1.5rem;
  color: var(--navy);
}

.admin-filters {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 1.25rem;
}

.admin-filter-label {
  font-size: 0.875rem;
  color: var(--text-soft);
}

select.filter-select {
  padding: 0.45rem 0.75rem;
  border-radius: 8px;
  border: 1px solid var(--cream-dk);
  background: var(--white);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.875rem;
  color: var(--text);
  cursor: pointer;
}

.admin-table-wrap {
  overflow-x: auto;
  border-radius: 12px;
  background: var(--white);
  box-shadow: 0 2px 12px rgba(0,0,0,0.05);
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.admin-table th {
  background: var(--navy);
  color: var(--white);
  padding: 0.75rem 1rem;
  text-align: left;
  font-weight: 600;
  white-space: nowrap;
}

.admin-table td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--cream-dk);
  vertical-align: middle;
}

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

.admin-table tr:nth-child(even) td { background: rgba(253,246,236,0.5); }

.admin-table .title-cell { font-weight: 600; color: var(--navy); max-width: 240px; }

.admin-table .badge-free { background: #E8F5E9; color: #2E7D32; padding: 0.15rem 0.5rem; border-radius: 999px; font-size: 0.75rem; font-weight: 600; }
.badge-tier {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  background: #5A4A3A;
  color: #fff;
}
.admin-table .badge-paid  { background: #FFF3E0; color: #E65100; padding: 0.15rem 0.5rem; border-radius: 999px; font-size: 0.75rem; font-weight: 600; }
.admin-table .badge-featured { background: #FFF8E1; color: #F57F17; padding: 0.15rem 0.5rem; border-radius: 999px; font-size: 0.75rem; font-weight: 600; }

.admin-actions { display: flex; gap: 0.5rem; }

.btn-edit, .btn-delete {
  padding: 0.35rem 0.75rem;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  font-family: 'DM Sans', sans-serif;
  text-decoration: none;
  display: inline-block;
}

.btn-edit { background: #E3F2FD; color: #1565C0; }
.btn-edit:hover { background: #BBDEFB; }
.btn-delete { background: #FFEBEE; color: #C62828; }
.btn-delete:hover { background: #FFCDD2; cursor: pointer; }

.btn-add-new {
  background: var(--orange);
  color: var(--white);
  padding: 0.6rem 1.25rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.9rem;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  transition: background 0.2s;
}

.btn-add-new:hover { background: var(--navy-light); }

/* ── Add/Edit form modal ─────────────────────────────────── */
.form-modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  padding: 1rem;
  display: none;
}

.form-modal.open { display: flex; }

.form-modal-inner {
  background: var(--white);
  border-radius: 16px;
  padding: 1.75rem;
  max-width: 560px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
}

.form-modal h2 {
  font-family: 'Lora', serif;
  font-size: 1.25rem;
  color: var(--navy);
  margin-bottom: 1.25rem;
}

.form-group { margin-bottom: 1rem; }

.form-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--navy);
  margin-bottom: 0.35rem;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 0.6rem 0.85rem;
  border: 1px solid var(--cream-dk);
  border-radius: 8px;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.9rem;
  color: var(--text);
  background: var(--white);
  outline: none;
  transition: border-color 0.2s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--orange);
}

.form-group textarea { resize: vertical; min-height: 100px; }

.form-row { display: flex; gap: 0.75rem; }
.form-row .form-group { flex: 1; }

.toggle-row {
  display: flex;
  gap: 1rem;
  align-items: center;
  margin-bottom: 1rem;
}

.toggle-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
}

.toggle-label input[type="checkbox"] { width: 18px; height: 18px; cursor: pointer; }

.form-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: flex-end;
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid var(--cream-dk);
}

/* ── Empty states ─────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--text-soft);
}

.empty-state-icon { font-size: 3rem; margin-bottom: 1rem; }
.empty-state h3 { font-size: 1.1rem; color: var(--navy); margin-bottom: 0.5rem; }
.empty-state p { font-size: 0.9rem; }

/* ── 404 page ─────────────────────────────────────────────── */
.not-found-page {
  min-height: 100vh;
  background: var(--cream);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

.not-found-inner {
  text-align: center;
  max-width: 420px;
}

.not-found-inner h1 {
  font-family: 'Lora', serif;
  font-size: 3rem;
  color: var(--navy);
  margin-bottom: 0.5rem;
}

.not-found-inner p {
  color: var(--text-soft);
  margin-bottom: 1.5rem;
}

.not-found-inner a {
  color: var(--orange);
  font-weight: 600;
}

/* ── Print styles for trackers and checklists ───────────────── */
@media print {
  body { background: white; color: #000; }

  /* Hide non-essential elements */
  .catalog-hero, .detail-header-back, .detail-actions,
  .detail-meta-info, .navbar, .navbar-links, .navbar-cta,
  .detail-header-meta .item-type-badge { display: none !important; }

  /* Header becomes a simple page header */
  .detail-header {
    background: white !important;
    color: #000 !important;
    padding: 0.5rem 0;
    border-bottom: 2px solid #1A3557;
    text-align: left;
  }
  .detail-header h1 { font-size: 18pt; color: #1A3557; }
  .detail-header-desc { display: none; }

  /* Content area */
  .detail-body { max-width: 100%; padding: 1rem 0; }

  /* Tables print with visible borders */
  .detail-content table {
    border-collapse: collapse;
    font-size: 10pt;
    width: 100%;
  }
  .detail-content table th {
    background: #1A3557 !important;
    color: white !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
  .detail-content table td,
  .detail-content table th {
    border: 1px solid #ccc;
    padding: 4pt 6pt;
  }

  /* Headings */
  .detail-content h2 { font-size: 13pt; page-break-after: avoid; }
  .detail-content h3 { font-size: 11pt; }

  /* Blockquotes stay styled */
  .detail-content blockquote {
    border-left: 3pt solid #E8723A;
    padding: 4pt 8pt;
    font-style: italic;
  }

  /* Grid/box templates print well */
  .detail-content > div[style*="background:#F8F8F8"] {
    background: #f5f5f5 !important;
    border: 1pt solid #ccc !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  /* Page breaks */
  h2 { page-break-before: auto; }
  h2:first-child { page-break-before: avoid; }
  table { page-break-inside: avoid; }
}

/* ── 480px small phone refinement ─────────────────── */
@media (max-width: 480px) {
  .catalog-hero { padding: 2.5rem 1rem 2rem; }
  .detail-header { padding: 1.5rem 1rem; }
  .detail-body { padding: 1.5rem 1rem 2.5rem; }
  .detail-header h1 { font-size: 1.4rem; }
  .btn-primary, .btn-secondary { min-height: 44px; }
}