/* ==========================================================================
   components.css — reusable pieces: icons, buttons, chips, search, header,
   navigation, cards and footer. Mobile rules sit next to the piece they change.
   ========================================================================== */


/* ---------- Icons ---------- */

.icon {
  display: block;
  flex: none;
  width: 1.25rem;
  height: 1.25rem;
  stroke-width: 1.75;                 /* slightly lighter than Tabler's default 2 */
}

[data-icon] {
  display: inline-flex;
}


/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  min-height: 2.75rem;                /* 44px: comfortable to tap */
  padding: 0.55rem 1.1rem;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  font: inherit;
  font-size: 0.9375rem;
  font-weight: 550;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  transition: transform var(--dur-fast) ease, background-color var(--dur-fast) ease,
    border-color var(--dur-fast) ease, color var(--dur-fast) ease;
}

.btn .icon {
  transition: transform var(--dur-base) var(--ease);
}

.btn:hover:not(:disabled) {
  transform: translateY(-1px);
}

.btn:hover:not(:disabled) .icon-nudge {
  transform: translateX(3px);         /* arrows move slightly on hover */
}

.btn:active:not(:disabled) {
  transform: scale(0.98);
}

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

.btn-primary:hover:not(:disabled) {
  background: var(--lime-hover);
}

.btn-secondary {
  background: var(--surface-2);
  border-color: var(--border);
  color: var(--text-1);
}

.btn-secondary:hover:not(:disabled) {
  background: var(--surface-3);
  border-color: var(--border-strong);
}

.btn-ghost {
  background: transparent;
  color: var(--text-2);
}

.btn-ghost:hover:not(:disabled) {
  background: var(--surface-2);
  color: var(--text-1);
}

.btn-sm {
  min-height: 2.25rem;
  padding: 0.35rem 0.9rem;
  font-size: 0.875rem;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}


/* ---------- Chips, badges and tags ---------- */

.chip {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  min-height: 1.75rem;
  padding: 0 0.65rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-1);
  color: var(--text-2);
  font: inherit;
  font-size: 0.8125rem;
  line-height: 1;
  white-space: nowrap;
}

.chip .icon {
  width: 0.875rem;
  height: 0.875rem;
}

/* A chip you can press (e.g. the search suggestions) */
.chip-button {
  cursor: pointer;
  transition: background-color var(--dur-fast) ease, border-color var(--dur-fast) ease,
    color var(--dur-fast) ease, transform var(--dur-fast) ease;
}

.chip-button:hover {
  background: var(--surface-2);
  border-color: var(--border-strong);
  color: var(--text-1);
}

.chip-button:active {
  transform: scale(0.97);
}

/* On touch screens, pressable chips get taller so they are easier to tap */
@media (pointer: coarse) {
  .chip-button {
    min-height: 2.25rem;
    padding: 0 0.85rem;
  }
}

/* Pricing badges: the only place colour carries meaning */
.chip-lime {
  background: var(--lime-tint);
  border-color: var(--lime-border);
  color: var(--lime);
}

.chip-violet {
  background: var(--violet-tint);
  border-color: var(--violet-border);
  color: var(--violet-text);
}

.chip-neutral {
  background: var(--surface-2);
  color: var(--text-2);
}

.chip-dashed {
  border-style: dashed;
  color: var(--text-3);
}

/* Small uppercase monospace text: counts, categories */
.mono-label {
  margin: 0;
  color: var(--text-3);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}


/* ---------- Search box ---------- */

.search-field {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  min-height: 3.5rem;
  padding: 0 0.6rem 0 1rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 14px;
  transition: border-color var(--dur-base) ease, box-shadow var(--dur-base) ease;
}

/* The whole field lights up when the input inside it has focus */
.search-field:focus-within {
  border-color: var(--lime);
  box-shadow: 0 0 0 3px rgba(184, 255, 106, 0.16);
}

.search-icon {
  color: var(--text-3);
  transition: color var(--dur-base) ease;
}

.search-field:focus-within .search-icon {
  color: var(--lime);
}

.search-input {
  flex: 1;
  min-width: 0;
  height: 3.25rem;
  padding: 0;
  border: 0;
  outline: 0;                         /* the field's lime border replaces it */
  background: transparent;
  color: var(--text-1);
  font: inherit;
  font-size: 1rem;                    /* 16px stops iPhones zooming in */
}

.search-input::placeholder {
  color: var(--text-3);
  opacity: 1;
}

/* Hide the browser's own clear button; we have a nicer one */
.search-input::-webkit-search-cancel-button,
.search-input::-webkit-search-decoration {
  -webkit-appearance: none;
  appearance: none;
}

.search-hint {
  padding: 0.1rem 0.5rem;
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  color: var(--text-2);
  font-family: var(--font-mono);
  font-size: 0.75rem;
}

/* No keyboard on touch screens, so no hint there */
@media (hover: none) {
  .search-hint {
    display: none;
  }
}

.search-field.has-value .search-hint {
  display: none;
}

.search-clear,
.search-submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;                     /* 44px: easy to tap */
  height: 2.75rem;
  padding: 0;
  border: 0;
  border-radius: var(--radius-md);
  background: transparent;
  color: var(--text-2);
  cursor: pointer;
  transition: background-color var(--dur-fast) ease, color var(--dur-fast) ease,
    transform var(--dur-fast) ease;
}

.search-clear:hover {
  background: var(--surface-3);
  color: var(--text-1);
}

.search-submit {
  background: var(--surface-3);
}

/* The arrow turns lime once there is something to search for */
.search-field.has-value .search-submit {
  background: var(--lime);
  color: var(--on-lime);
}

.search-submit:active,
.search-clear:active {
  transform: scale(0.94);
}

.search-suggestions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
  margin-top: var(--space-3);
}


/* ---------- Header and navigation ---------- */

.site-header {
  position: sticky;                   /* stays at the top while scrolling */
  top: 0;
  z-index: 50;
  min-height: var(--header-height);   /* reserves space so the page doesn't jump */
  background: rgba(9, 9, 13, 0.72);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  backdrop-filter: blur(14px) saturate(140%);
  border-bottom: 1px solid transparent;
  transition: border-color var(--dur-base) ease, background-color var(--dur-base) ease;
}

/* app.js adds this class once the visitor scrolls */
.site-header.is-scrolled {
  background: rgba(9, 9, 13, 0.88);
  border-bottom-color: var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  min-height: var(--header-height);
}

/* Brand (logo mark + name) */
.brand {
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
  color: var(--text-1);
  font-size: 1.0625rem;
  font-weight: 650;
  letter-spacing: -0.02em;
  text-decoration: none;
}

.brand-mark {
  width: 1.5rem;
  height: 1.5rem;
  color: var(--lime);
}

/* --- Navigation: desktop layout first --- */
.site-nav {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  margin-left: auto;
}

.nav-list {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  margin: 0;
  padding: 0;
  list-style: none;
}

.nav-item {
  position: relative;                 /* the dropdown is positioned against this */
}

.nav-link {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: 0.5rem 0.75rem;
  color: var(--text-2);
  font-size: 0.9375rem;
  font-weight: 500;
  text-decoration: none;
  transition: color var(--dur-fast) ease;
}

.nav-link:hover {
  color: var(--text-1);
}

/* Current page: brighter text plus a small lime dot underneath */
.nav-link[aria-current="page"] {
  color: var(--text-1);
}

.nav-link[aria-current="page"]::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -0.4rem;
  width: 4px;
  height: 4px;
  margin-left: -2px;
  border-radius: 50%;
  background: var(--lime);
}

/* Little number bubble next to "Saved" */
.count-badge {
  min-width: 1.4rem;
  padding: 0 0.4rem;
  border-radius: 6px;
  background: var(--surface-3);
  color: var(--text-1);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  line-height: 1.4rem;
  text-align: center;
}

/* --- Categories: a link plus a small arrow button that opens the dropdown --- */
.nav-split {
  display: inline-flex;
  align-items: center;
}

.nav-split .nav-link {
  padding-right: 0.15rem;
}

.nav-chevron {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  align-self: stretch;
  padding: 0 0.5rem 0 0.15rem;
  border: 0;
  background: transparent;
  color: var(--text-2);
  cursor: pointer;
  transition: color var(--dur-fast) ease;
}

.nav-split:hover .nav-chevron,
.nav-split:hover .nav-link,
.nav-item.is-open .nav-chevron {
  color: var(--text-1);
}

.nav-chevron .icon {
  width: 1rem;
  height: 1rem;
  transition: transform var(--dur-base) var(--ease);
}

.nav-item.is-open .nav-chevron .icon {
  transform: rotate(180deg);
}

/* The dropdown panel (desktop). It is always in the page but invisible; opening
   it fades and slides it in. "visibility" also hides it from keyboards. */
.dropdown-panel {
  position: absolute;
  top: calc(100% + 0.75rem);
  left: 50%;
  width: 23.75rem;                    /* 380px */
  margin-left: -11.875rem;            /* half the width, so it is centred */
  padding: var(--space-2);
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: 0 24px 48px -16px rgba(0, 0, 0, 0.7);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px) scale(0.98);
  transform-origin: top center;
  transition: opacity var(--dur-fast) ease,
    transform var(--dur-base) var(--ease),
    visibility 0s linear var(--dur-base);
}

.nav-item.is-open .dropdown-panel {
  opacity: 1;
  visibility: visible;
  transform: none;
  transition-delay: 0s;
}

.dropdown-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.dropdown-link {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: 0.6rem 0.65rem;
  border-radius: var(--radius-md);
  color: var(--text-1);
  text-decoration: none;
  transition: background-color var(--dur-fast) ease;
}

.dropdown-link:hover,
.dropdown-link:focus-visible {
  background: var(--surface-2);
}

.dropdown-link:focus-visible {
  outline-offset: -2px;
}

.dropdown-link strong {
  display: block;
  font-size: 0.9375rem;
  font-weight: 600;
  line-height: 1.3;
}

.dropdown-link small {
  display: block;
  color: var(--text-2);
  font-size: 0.875rem;
  line-height: 1.4;
}

/* Rounded square that holds an icon */
.icon-tile {
  display: flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 2.375rem;
  height: 2.375rem;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  background: var(--surface-3);
  color: var(--text-1);
  transition: color var(--dur-base) ease;
}

.dropdown-link:hover .icon-tile {
  color: var(--lime);
}

/* Hamburger button: hidden on desktop */
.menu-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: transparent;
  color: var(--text-1);
  cursor: pointer;
  transition: background-color var(--dur-fast) ease, border-color var(--dur-fast) ease;
}

.menu-toggle:hover {
  background: var(--surface-2);
  border-color: var(--border-strong);
}

.menu-toggle-bars,
.menu-toggle-bars::before,
.menu-toggle-bars::after {
  display: block;
  width: 1.125rem;
  height: 2px;
  background: currentColor;
  border-radius: 2px;
  transition: transform var(--dur-base) var(--ease), background-color var(--dur-base) ease;
}

.menu-toggle-bars {
  position: relative;
}

.menu-toggle-bars::before,
.menu-toggle-bars::after {
  content: "";
  position: absolute;
  left: 0;
}

.menu-toggle-bars::before { top: -6px; }
.menu-toggle-bars::after  { top: 6px; }

/* The three bars turn into an X while the menu is open */
.menu-toggle[aria-expanded="true"] .menu-toggle-bars {
  background: transparent;
}
.menu-toggle[aria-expanded="true"] .menu-toggle-bars::before {
  transform: translateY(6px) rotate(45deg);
}
.menu-toggle[aria-expanded="true"] .menu-toggle-bars::after {
  transform: translateY(-6px) rotate(-45deg);
}

/* --- Mobile and small tablet: the nav becomes a sheet under the header --- */
@media (max-width: 860px) {
  :root {
    --header-height: 3.75rem;
  }

  .menu-toggle {
    display: inline-flex;
  }

  .site-nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: var(--space-4);
    max-height: calc(100vh - var(--header-height));
    max-height: calc(100dvh - var(--header-height));
    overflow-y: auto;
    padding: var(--space-3) var(--gutter) var(--space-5);
    background: var(--surface-1);
    border-bottom: 1px solid var(--border);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: opacity var(--dur-fast) ease,
      transform var(--dur-base) var(--ease),
      visibility 0s linear var(--dur-base);
  }

  .site-nav.is-open {
    opacity: 1;
    visibility: visible;
    transform: none;
    transition-delay: 0s;
  }

  .nav-list {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
  }

  .nav-item + .nav-item {
    border-top: 1px solid var(--border-subtle);
  }

  .nav-link {
    display: flex;
    flex: 1;
    justify-content: space-between;
    min-height: 3.25rem;              /* big, easy tap targets */
    padding: 0.5rem 0.25rem 0.5rem 1rem;
    font-size: 1.0625rem;
  }

  /* Current page marker moves to the left edge on mobile */
  .nav-link[aria-current="page"]::after {
    left: 0;
    top: 50%;
    bottom: auto;
    margin: -2px 0 0;
  }

  .nav-split {
    display: flex;
  }

  .nav-chevron {
    width: 3.25rem;
    padding: 0;
  }

  /* On mobile the Categories list opens inline, pushing the rows below it down.
     "grid-template-rows: 0fr to 1fr" is the CSS trick that animates the height. */
  .dropdown-panel {
    position: static;
    display: grid;
    grid-template-rows: 0fr;
    width: auto;
    margin: 0;
    padding: 0;
    background: none;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    opacity: 1;
    transform: none;
    transition: grid-template-rows var(--dur-base) var(--ease),
      visibility 0s linear var(--dur-base);
  }

  .nav-item.is-open .dropdown-panel {
    grid-template-rows: 1fr;
  }

  .dropdown-list {
    min-height: 0;
    overflow: hidden;
  }

  .dropdown-link {
    padding-left: 1rem;
    min-height: 3.5rem;
  }

  .site-nav > .btn {
    width: 100%;
    min-height: 2.75rem;              /* the small button is full size on touch screens */
  }
}


/* ---------- Cards ---------- */

/* Category card: the whole card is one link */
.category-card {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  padding: 1.25rem;
  background: var(--surface-1);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  color: var(--text-1);
  text-decoration: none;
  transition: transform var(--dur-base) var(--ease), background-color var(--dur-base) ease,
    border-color var(--dur-base) ease;
}

.category-card:hover {
  transform: translateY(-2px);
  background: var(--surface-2);
  border-color: var(--border-strong);
}

.category-card .icon-tile { color: var(--category-accent, var(--lime)); }
.category-card:hover .icon-tile { color: var(--lime); }

.category-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
}

.category-card .arrow {
  color: var(--text-3);
  transition: transform var(--dur-base) var(--ease), color var(--dur-base) ease;
}

.category-card:hover .arrow {
  color: var(--text-1);
  transform: translate(2px, -2px);
}

.category-card h3 {
  margin: var(--space-2) 0 0;
}

.category-card p {
  margin: 0;
  font-size: 0.9375rem;
}

.category-card .mono-label {
  margin-top: auto;
  padding-top: var(--space-2);
}

/* Phones: category cards become compact rows, icon on the left, text on the right.
   "display: contents" lets the icon and arrow join the card's grid directly. */
@media (max-width: 639px) {
  .category-card {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    column-gap: var(--space-4);
    row-gap: var(--space-1);
    align-items: start;
    padding: 1rem;
  }

  .category-card-top {
    display: contents;
  }

  .category-card .icon-tile {
    grid-column: 1;
    grid-row: 1 / span 3;
  }

  .category-card .arrow {
    grid-column: 3;
    grid-row: 1;
  }

  .category-card h3 {
    grid-column: 2;
    grid-row: 1;
    margin: 0;
  }

  .category-card p {
    grid-column: 2;
    grid-row: 2;
  }

  .category-card .mono-label {
    grid-column: 2;
    grid-row: 3;
    margin-top: 0;
  }
}

/* Resource card */
.resource-card {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  padding: 1.25rem;
  background: var(--surface-1);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  transition: transform var(--dur-base) var(--ease), background-color var(--dur-base) ease,
    border-color var(--dur-base) ease;
}

.resource-card:hover {
  transform: translateY(-2px);
  background: var(--surface-2);
  border-color: var(--border-strong);
}

.resource-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
}

/* Letter tile used instead of a logo */
.monogram {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface-3);
  color: var(--text-1);
  font-size: 1.125rem;
  font-weight: 600;
}

.heart {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  color: var(--text-3);
}

.heart.is-saved {
  color: var(--lime);
}

.resource-card h3 {
  margin: 0;
  font-size: 1.0625rem;
}

.resource-card-body {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.resource-card p {
  margin: 0;
  font-size: 0.9375rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;              /* keeps every card the same height */
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.resource-card-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
  margin-top: auto;
  padding-top: var(--space-2);
}

.resource-card-footer .visit {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  margin-left: auto;
  color: var(--text-1);
  font-size: 0.9375rem;
  font-weight: 500;
}

.resource-card-footer .visit .icon {
  width: 1rem;
  height: 1rem;
}


/* ---------- Footer ---------- */

.site-footer {
  margin-top: var(--space-8);
  padding-top: var(--space-7);
  background: var(--bg-section);
  border-top: 1px solid var(--border-subtle);
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr 1.6fr;
  gap: var(--space-6);
}

.footer-brand {
  margin-bottom: var(--space-2);
  color: var(--text-1);
  font-size: 1.0625rem;
  font-weight: 650;
  letter-spacing: -0.02em;
}

.footer-heading {
  margin: 0 0 var(--space-3);
  color: var(--text-3);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.footer-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.footer-list li {
  margin-bottom: var(--space-2);
}

.footer-list a {
  color: var(--text-2);
  text-decoration: none;
}

.footer-list a:hover {
  color: var(--text-1);
  text-decoration: underline;
  text-decoration-color: var(--lime);
}

.footer-text {
  color: var(--text-2);
  font-size: 0.9375rem;
}

.footer-bottom {
  margin-top: var(--space-6);
  padding-block: var(--space-5);
  border-top: 1px solid var(--border-subtle);
}

.footer-bottom p {
  margin: 0;
  color: var(--text-3);
  font-size: 0.875rem;
}

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

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


/* ---------- Page sections ---------- */

.section-head {
  margin-bottom: var(--space-5);
}

.section-head p {
  margin: 0;
  max-width: 40rem;
}

/* Section heading on the left, a "View all" link on the right */
.section-head-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--space-4);
  margin-bottom: var(--space-5);
}

.section-head-row .section-head {
  margin-bottom: 0;
}

/* Text link with a small arrow that slides on hover */
.link-arrow {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  color: var(--text-1);
  font-size: 0.9375rem;
  font-weight: 500;
  text-decoration: none;
}

.link-arrow .icon {
  width: 1rem;
  height: 1rem;
  transition: transform var(--dur-base) var(--ease);
}

/* On touch screens the whole row is at least 44px tall, so it is easy to tap */
@media (pointer: coarse) {
  .link-arrow {
    min-height: 2.75rem;
  }
}

.link-arrow:hover {
  color: var(--lime);
}

.link-arrow:hover .icon {
  transform: translateX(3px);
}

/* Card grid: 1 column on phones, 2 on tablets, 3 on desktop */
.card-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-4);
  margin: 0;
  padding: 0;
  list-style: none;
}

@media (min-width: 640px) {
  .card-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 960px) {
  .card-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* Make every card stretch to the height of the tallest card in its row */
.card-grid > li {
  display: flex;
}

.card-grid > li > * {
  flex: 1;
}

/* An item that only appears on desktop (used so the placeholder rows are not too tall on phones) */
.card-grid > li.only-desktop {
  display: none;
}

@media (min-width: 960px) {
  .card-grid > li.only-desktop {
    display: flex;
  }
}

/* Shown inside a grid when something could not be loaded */
.grid-message {
  grid-column: 1 / -1;
  padding: var(--space-5);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-lg);
}

.grid-message p {
  margin: 0;
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
}


/* ---------- Placeholders for content that has not arrived yet ----------
   Grey shapes in the layout of the finished content. They carry no text, so
   they cannot make claims. When Stage 3 loads real data, JavaScript simply
   replaces them. */

.skeleton {
  display: block;
  height: 0.75rem;
  border-radius: 6px;
  background: var(--surface-3);
}

.skeleton-lg { height: 1rem; }
.skeleton-pill { width: 4rem; height: 1.5rem; border-radius: var(--radius-sm); }
.push-right { margin-left: auto; }

.w-20 { width: 20%; }
.w-30 { width: 30%; }
.w-40 { width: 40%; }
.w-50 { width: 50%; }
.w-60 { width: 60%; }
.w-80 { width: 80%; }
.w-100 { width: 100%; }

/* A resource card that is only a placeholder: no hover effect, not interactive */
.resource-card.is-skeleton:hover {
  transform: none;
  background: var(--surface-1);
  border-color: var(--border-subtle);
}

.resource-card.is-skeleton .heart {
  opacity: 0.45;
}

.resource-card.is-skeleton .resource-card-body {
  gap: var(--space-3);
  padding-block: var(--space-1);
}

.section-note {
  margin: var(--space-4) 0 0;
  color: var(--text-3);
  font-size: 0.9375rem;
}


/* ---------- Shared page intro (Explore, Saved and About) ---------- */

.page-intro {
  padding-block: clamp(2.5rem, 1.5rem + 5vw, 5rem) var(--space-5);
  max-width: 48rem;
}

/* Shared, accessible resource save control used on Home, Explore and Saved. */
.save-button {
  width: 2.35rem;
  height: 2.35rem;
  flex: none;
  display: inline-grid;
  place-items: center;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface-2);
  color: var(--text-3);
  cursor: pointer;
  transition: color var(--dur-fast) ease, border-color var(--dur-fast) ease,
    background var(--dur-fast) ease, transform var(--dur-fast) ease;
}
.save-button:hover {
  transform: translateY(-1px);
  color: var(--lime);
  border-color: var(--lime-border);
  background: var(--lime-tint);
}
.save-button[aria-pressed="true"] { color: var(--lime); border-color: var(--lime-border); }
.save-button:focus-visible { outline: 2px solid var(--lime); outline-offset: 3px; }
.save-button .icon { width: 1.15rem; height: 1.15rem; }

.save-feedback {
  position: fixed;
  z-index: 100;
  left: 50%;
  bottom: 1.25rem;
  max-width: min(90vw, 28rem);
  padding: .8rem 1rem;
  border: 1px solid var(--lime-border);
  border-radius: 12px;
  background: #1b2115;
  color: #eaffd5;
  box-shadow: 0 12px 36px rgba(0, 0, 0, .35);
  font-size: .82rem;
  font-weight: 600;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, .5rem);
  transition: opacity var(--dur-base) ease, transform var(--dur-base) ease;
}
.save-feedback.is-visible { opacity: 1; transform: translate(-50%, 0); }

.directory-card-icon { position: relative; overflow: hidden; }
.directory-card-icon.has-image .directory-card-fallback { visibility: hidden; }
.directory-card-fallback { display: grid; place-items: center; }
.directory-card-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: .3rem;
  background: var(--surface-2);
}
.monogram { position: relative; overflow: hidden; }
.resource-card-image { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; padding: .25rem; background: var(--surface-3); }

.resource-card-footer .resource-access-type { color: #c7b5ff; }

/* Stage 7 shared resource-card actions (Explore, Saved and related cards). */
.directory-card-actions { display: grid; gap: .45rem; margin-top: 1rem; padding-top: .8rem; border-top: 1px solid var(--border-subtle); }
.directory-card-actions .directory-card-link { margin-top: 0; padding-top: .25rem; border-top: 0; }
.directory-card-details { color: var(--lime); font-size: .8rem; font-weight: 650; text-decoration: none; }
.directory-card-details:hover { color: var(--lime-hover); }
.directory-card-link[hidden] { display: none; }
