/*
 * Hub archive styles.
 *
 * Loaded on is_post_type_archive() for all hub CPTs.
 * Shares the token namespace from theme.json; no base styles duplicated here.
 */

/* ── Shared container ─────────────────────────────────────────────────── */

.plinth-hub-inner {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 var(--wp--preset--spacing--20);
}

/* ── Directory Hub ────────────────────────────────────────────────────── */

.plinth-dir-header {
    padding: 64px 0 40px;
}

.plinth-dir-header h1 {
    font-size: var(--wp--preset--font-size--display);
    font-weight: 700;
    letter-spacing: -0.03em;
    line-height: 1.1;
    margin: 0 0 var(--wp--preset--spacing--16);
    overflow-wrap: anywhere;
    text-wrap: pretty;
}

.plinth-dir-count {
    font-size: var(--wp--preset--font-size--small);
    color: var(--wp--preset--color--text-muted);
    margin: 0 0 var(--wp--preset--spacing--12);
}

.plinth-dir-description {
    font-size: var(--wp--preset--font-size--body);
    line-height: 1.65;
    color: var(--wp--preset--color--text-secondary);
    max-width: 640px;
    margin: 0;
    overflow-wrap: anywhere;
    text-wrap: pretty;
}

/* Search */
.plinth-dir-search {
    padding: var(--wp--preset--spacing--24) 0 0;
    display: flex;
    flex-direction: column;
    gap: var(--wp--preset--spacing--12);
    max-width: 560px;
}

.plinth-dir-search-field {
    display: flex;
    align-items: center;
    gap: var(--wp--preset--spacing--12);
    border: 1.5px solid var(--wp--preset--color--border);
    border-radius: var(--wp--custom--radius--base);
    padding: 0 var(--wp--preset--spacing--16);
    height: 48px;
    background: #fff;
}

.plinth-dir-search-field:focus-within {
    border-color: var(--wp--preset--color--navy-700);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--wp--preset--color--navy-700) 12%, transparent);
}

.plinth-dir-search-field input {
    flex: 1;
    border: none;
    outline: none;
    font-size: var(--wp--preset--font-size--body);
    background: transparent;
    color: var(--wp--preset--color--navy-900);
    min-width: 0;
}

.plinth-dir-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.plinth-dir-chips a {
    display: inline-flex;
    align-items: center;
    height: 32px;
    padding: 0 12px;
    font-size: var(--wp--preset--font-size--small);
    border: 1px solid var(--wp--preset--color--border);
    border-radius: 100px;
    color: var(--wp--preset--color--navy-700);
    text-decoration: none;
    white-space: nowrap;
    background: #fff;
    transition: border-color 120ms, background 120ms;
}

.plinth-dir-chips a:hover,
.plinth-dir-chips a:focus {
    background: var(--wp--preset--color--surface);
    border-color: var(--wp--preset--color--navy-300);
    color: var(--wp--preset--color--navy-700);
}

/* Filter bar — sticky, full-bleed, opaque */
.plinth-dir-filters {
    position: sticky;
    top: 56px;
    z-index: 25;
    background: #fff;
    border-bottom: 1px solid var(--wp--preset--color--border);
}

.plinth-dir-filter-inner {
    display: flex;
    align-items: center;
    gap: var(--wp--preset--spacing--8);
    height: 52px;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 var(--wp--preset--spacing--20);
}

.plinth-dir-filter-inner::-webkit-scrollbar { display: none; }

.plinth-dir-filter-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    height: 32px;
    padding: 0 12px;
    font-size: var(--wp--preset--font-size--small);
    font-weight: 500;
    border-radius: 100px;
    text-decoration: none;
    white-space: nowrap;
    flex: none;
    transition: background 120ms, color 120ms, border-color 120ms;
    border: 1px solid var(--wp--preset--color--border);
    color: var(--wp--preset--color--text-secondary);
    background: var(--wp--preset--color--surface);
}

.plinth-dir-filter-pill:hover,
.plinth-dir-filter-pill:focus,
.plinth-dir-filter-pill[aria-current="true"] {
    background: var(--wp--preset--color--navy-900);
    color: #fff;
    border-color: var(--wp--preset--color--navy-900);
}

.plinth-dir-filter-pill-all {
    background: var(--wp--preset--color--navy-900);
    color: #fff;
    border-color: var(--wp--preset--color--navy-900);
}

.plinth-dir-filter-pill-all:hover { opacity: 0.88; color: #fff; }

/* opacity:0.65 dropped this below the AA contrast threshold. The count is
   secondary information, not decoration, so it uses a lighter colour token
   that still passes rather than a transparency that does not. */
.plinth-dir-filter-count { color: var(--wp--preset--color--text-secondary); font-weight: 400; }

.plinth-dir-filter-clear {
    margin-left: auto;
    flex: none;
    font-size: var(--wp--preset--font-size--small);
    color: var(--wp--preset--color--text-muted);
    text-decoration: underline;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px 8px;
    white-space: nowrap;
}

.plinth-dir-filter-clear:hover { color: var(--wp--preset--color--navy-900); }

/* Sections */
.plinth-dir-section {
    padding: var(--wp--preset--spacing--48) 0;
    border-top: 1px solid var(--wp--preset--color--border);
}

.plinth-dir-section-label {
    font-size: var(--wp--preset--font-size--caption);
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--wp--preset--color--text-muted);
    margin: 0 0 var(--wp--preset--spacing--24);
}

.plinth-dir-section-heading {
    font-size: var(--wp--preset--font-size--h2);
    font-weight: 700;
    letter-spacing: -0.02em;
    margin: 0 0 var(--wp--preset--spacing--32);
    overflow-wrap: anywhere;
    text-wrap: pretty;
}

/* Featured grid — 3 columns */
.plinth-dir-featured-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: var(--wp--preset--spacing--24);
}

/* Group listing */
.plinth-dir-group {
    margin-bottom: var(--wp--preset--spacing--48);
}

.plinth-dir-group:last-child { margin-bottom: 0; }

.plinth-dir-group-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: var(--wp--preset--spacing--16);
    flex-wrap: wrap;
    margin-bottom: var(--wp--preset--spacing--4);
}

.plinth-dir-group-heading {
    font-size: var(--wp--preset--font-size--h3);
    font-weight: 700;
    margin: 0;
    overflow-wrap: anywhere;
}

.plinth-dir-group-desc {
    font-size: var(--wp--preset--font-size--small);
    color: var(--wp--preset--color--text-secondary);
    margin: 0 0 var(--wp--preset--spacing--20);
    overflow-wrap: anywhere;
}

.plinth-dir-card-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: var(--wp--preset--spacing--16);
}

/* Show-all <details> — JS-free, crawlable */
details.plinth-dir-show-all { margin-top: var(--wp--preset--spacing--16); }

details.plinth-dir-show-all > summary {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 40px;
    padding: 0 var(--wp--preset--spacing--16);
    font-size: var(--wp--preset--font-size--small);
    font-weight: 500;
    border: 1px solid var(--wp--preset--color--border);
    border-radius: var(--wp--custom--radius--base);
    cursor: pointer;
    list-style: none;
    color: var(--wp--preset--color--navy-700);
    background: #fff;
}

details.plinth-dir-show-all > summary::-webkit-details-marker { display: none; }

details.plinth-dir-show-all > summary .show-lbl { display: inline; }
details.plinth-dir-show-all > summary .hide-lbl { display: none; }
details.plinth-dir-show-all[open] > summary .show-lbl { display: none; }
details.plinth-dir-show-all[open] > summary .hide-lbl { display: inline; }

.plinth-dir-show-all-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: var(--wp--preset--spacing--16);
    margin-top: var(--wp--preset--spacing--16);
}

/* Popular now */
.plinth-dir-popular {
    list-style: none;
    margin: 0;
    padding: 0;
    counter-reset: popular-counter;
    display: flex;
    flex-direction: column;
    columns: 2;
}

.plinth-dir-popular-item {
    counter-increment: popular-counter;
    display: flex;
    align-items: center;
    gap: var(--wp--preset--spacing--16);
    min-height: 48px;
    border-bottom: 1px solid var(--wp--preset--color--border);
    min-width: 0;
}

.plinth-dir-popular-item::before {
    content: counter(popular-counter, decimal-leading-zero);
    font-size: var(--wp--preset--font-size--caption);
    font-weight: 700;
    letter-spacing: 0.04em;
    color: var(--wp--preset--color--text-muted);
    flex: none;
    width: 28px;
    text-align: right;
}

.plinth-dir-popular-item a {
    font-size: var(--wp--preset--font-size--body);
    color: var(--wp--preset--color--navy-900);
    text-decoration: none;
    overflow-wrap: anywhere;
    min-width: 0;
    flex: 1;
    padding: var(--wp--preset--spacing--12) 0;
}

.plinth-dir-popular-item a:hover { color: var(--wp--preset--color--rust-600); text-decoration: underline; }

/* Can't find */
.plinth-dir-cant-find {
    background: var(--wp--preset--color--surface);
    border: 1px solid var(--wp--preset--color--border);
    border-radius: var(--wp--custom--radius--card);
    padding: var(--wp--preset--spacing--32);
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: var(--wp--preset--spacing--20);
}

.plinth-dir-cant-find h2 {
    font-size: var(--wp--preset--font-size--h3);
    font-weight: 700;
    margin: 0;
}

.plinth-dir-cant-find-links {
    display: flex;
    flex-wrap: wrap;
    gap: var(--wp--preset--spacing--12);
    list-style: none;
    margin: 0;
    padding: 0;
}

.plinth-dir-cant-find-links a {
    display: inline-flex;
    align-items: center;
    height: 44px;
    padding: 0 var(--wp--preset--spacing--20);
    font-size: var(--wp--preset--font-size--body);
    font-weight: 500;
    border: 1.5px solid var(--wp--preset--color--navy-300);
    border-radius: var(--wp--custom--radius--base);
    color: var(--wp--preset--color--navy-700);
    text-decoration: none;
    background: #fff;
    transition: border-color 120ms, background 120ms;
}

.plinth-dir-cant-find-links a:hover { background: var(--wp--preset--color--navy-50); border-color: var(--wp--preset--color--navy-700); color: var(--wp--preset--color--navy-700); }

/* Related grid */
.plinth-dir-related-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: var(--wp--preset--spacing--16);
}

/* Coming soon */
.plinth-hub-coming-soon {
    padding: 88px 0;
    text-align: center;
    max-width: 480px;
    margin: 0 auto;
}

.plinth-hub-coming-soon h1 {
    font-size: var(--wp--preset--font-size--h1);
    font-weight: 700;
    margin: 0 0 var(--wp--preset--spacing--16);
    overflow-wrap: anywhere;
}

/* ── Index Hub ────────────────────────────────────────────────────────── */

.plinth-idx-header {
    padding: 64px 0 48px;
    border-bottom: 1px solid var(--wp--preset--color--border);
}

.plinth-idx-header h1 {
    font-size: var(--wp--preset--font-size--display);
    font-weight: 700;
    letter-spacing: -0.03em;
    line-height: 1.1;
    margin: 0 0 var(--wp--preset--spacing--20);
    overflow-wrap: anywhere;
    text-wrap: pretty;
}

.plinth-idx-count {
    font-size: var(--wp--preset--font-size--small);
    color: var(--wp--preset--color--text-muted);
    margin: 0 0 var(--wp--preset--spacing--12);
}

.plinth-idx-orientation {
    font-size: var(--wp--preset--font-size--body);
    line-height: 1.7;
    color: var(--wp--preset--color--text-secondary);
    max-width: 680px;
    overflow-wrap: anywhere;
    text-wrap: pretty;
}

.plinth-idx-orientation p { margin: 0 0 var(--wp--preset--spacing--12); }
.plinth-idx-orientation p:last-child { margin-bottom: 0; }

/* Start here */
.plinth-idx-section {
    padding: var(--wp--preset--spacing--48) 0;
    border-bottom: 1px solid var(--wp--preset--color--border);
}

.plinth-idx-section-heading {
    font-size: var(--wp--preset--font-size--h2);
    font-weight: 700;
    letter-spacing: -0.02em;
    margin: 0 0 var(--wp--preset--spacing--32);
    overflow-wrap: anywhere;
    text-wrap: pretty;
}

.plinth-idx-start-card {
    display: flex;
    gap: var(--wp--preset--spacing--32);
    background: #fff;
    border: 2px solid var(--wp--preset--color--rust-300);
    border-radius: var(--wp--custom--radius--card);
    padding: var(--wp--preset--spacing--32);
    align-items: flex-start;
    min-width: 0;
}

.plinth-idx-start-card-body { flex: 1; min-width: 0; }

.plinth-idx-start-eyebrow {
    font-size: var(--wp--preset--font-size--caption);
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--wp--preset--color--rust-600);
    margin: 0 0 var(--wp--preset--spacing--8);
}

.plinth-idx-start-card h2 {
    font-size: var(--wp--preset--font-size--h2);
    font-weight: 700;
    margin: 0 0 var(--wp--preset--spacing--12);
    overflow-wrap: anywhere;
    text-wrap: pretty;
}

.plinth-idx-start-card p {
    font-size: var(--wp--preset--font-size--body);
    line-height: 26px;
    color: var(--wp--preset--color--text-secondary);
    margin: 0 0 var(--wp--preset--spacing--20);
    overflow-wrap: anywhere;
}

.plinth-idx-start-cta {
    display: inline-flex;
    align-items: center;
    height: 44px;
    padding: 0 var(--wp--preset--spacing--20);
    background: var(--wp--preset--color--rust-600);
    color: #fff;
    font-size: var(--wp--preset--font-size--body);
    font-weight: 600;
    border-radius: var(--wp--custom--radius--base);
    text-decoration: none;
    transition: opacity 120ms;
}

.plinth-idx-start-cta:hover { opacity: 0.88; color: #fff; }

/* Index groups */
.plinth-idx-group { margin-bottom: var(--wp--preset--spacing--40); }
.plinth-idx-group:last-child { margin-bottom: 0; }

.plinth-idx-group-heading {
    font-size: var(--wp--preset--font-size--h3);
    font-weight: 700;
    margin: 0 0 4px;
    overflow-wrap: anywhere;
}

.plinth-idx-group-desc {
    font-size: var(--wp--preset--font-size--small);
    color: var(--wp--preset--color--text-secondary);
    margin: 0 0 var(--wp--preset--spacing--4);
    overflow-wrap: anywhere;
}

.plinth-idx-row-list { border-top: 1px solid var(--wp--preset--color--border); }

/* Editorial */
.plinth-idx-editorial-inner {
    max-width: 720px;
    overflow-wrap: anywhere;
}

.plinth-idx-editorial-inner h2 {
    font-size: var(--wp--preset--font-size--h2);
    font-weight: 700;
    letter-spacing: -0.02em;
    margin: 0 0 var(--wp--preset--spacing--24);
    text-wrap: pretty;
}

.plinth-idx-editorial-inner p {
    font-size: var(--wp--preset--font-size--body);
    line-height: 1.7;
    color: var(--wp--preset--color--text-secondary);
    margin: 0 0 var(--wp--preset--spacing--16);
}

.plinth-idx-editorial-inner ul,
.plinth-idx-editorial-inner ol {
    padding-left: var(--wp--preset--spacing--24);
    display: flex;
    flex-direction: column;
    gap: var(--wp--preset--spacing--8);
    color: var(--wp--preset--color--text-secondary);
    font-size: var(--wp--preset--font-size--body);
    line-height: 1.65;
}

.plinth-idx-editorial-inner table {
    width: 100%;
    border-collapse: collapse;
    font-size: var(--wp--preset--font-size--small);
    margin-top: var(--wp--preset--spacing--16);
}

.plinth-idx-editorial-inner th,
.plinth-idx-editorial-inner td {
    padding: var(--wp--preset--spacing--12) var(--wp--preset--spacing--16);
    border: 1px solid var(--wp--preset--color--border);
    text-align: left;
    overflow-wrap: anywhere;
}

.plinth-idx-editorial-inner th { font-weight: 600; background: var(--wp--preset--color--surface); }

/* Index FAQ */
.plinth-idx-faq-heading {
    font-size: var(--wp--preset--font-size--h2);
    font-weight: 700;
    letter-spacing: -0.02em;
    margin: 0 0 var(--wp--preset--spacing--32);
    overflow-wrap: anywhere;
}

/* Index related */
.plinth-idx-related-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: var(--wp--preset--spacing--16);
}

/* ── Responsive ───────────────────────────────────────────────────────── */

@media (max-width: 1200px) {
    .plinth-dir-card-grid,
    .plinth-dir-show-all-grid,
    .plinth-dir-related-grid,
    .plinth-idx-related-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 900px) {
    .plinth-dir-header,
    .plinth-idx-header { padding: 48px 0 32px; }

    .plinth-dir-header h1,
    .plinth-idx-header h1 { font-size: var(--wp--preset--font-size--h1); }

    .plinth-dir-featured-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }

    .plinth-dir-card-grid,
    .plinth-dir-show-all-grid,
    .plinth-dir-related-grid,
    .plinth-idx-related-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }

    .plinth-idx-start-card { flex-direction: column; gap: var(--wp--preset--spacing--20); }

    .plinth-dir-cant-find { padding: var(--wp--preset--spacing--24); }
}

@media (max-width: 640px) {
    .plinth-dir-header,
    .plinth-idx-header { padding: 36px 0 24px; }

    .plinth-dir-featured-grid,
    .plinth-dir-card-grid,
    .plinth-dir-show-all-grid,
    .plinth-dir-related-grid,
    .plinth-idx-related-grid { grid-template-columns: minmax(0, 1fr); }
}


/* Hub "Related sections" cards.
   related_sections points at post-type archives, which are not posts, so these
   are plain label + link cards rather than content cards (defect F3-06). */
.plinth-hub-section-link {
  display: flex;
  align-items: center;
  min-height: 56px;
  padding: var(--wp--preset--spacing--16) var(--wp--preset--spacing--20);
  border: 1px solid var(--wp--preset--color--border);
  border-radius: var(--wp--custom--radius--card, 8px);
  background: var(--wp--preset--color--paper);
  color: var(--wp--preset--color--navy-700);
  font-size: var(--wp--preset--font-size--body);
  font-weight: 600;
  text-decoration: none;
  min-width: 0;
  overflow-wrap: anywhere;
  transition: border-color 150ms ease, box-shadow 150ms ease;
}
.plinth-hub-section-link:hover,
.plinth-hub-section-link:focus-visible {
  border-color: var(--wp--preset--color--border-strong);
  box-shadow: var(--wp--preset--shadow--card);
}

/* ---------------------------------------------------------------------------
   Hub cards.

   These declarations were inline style attributes inside the card renderers,
   which meant they were re-sent for every card on every request and were never
   cacheable. Measured on the 24-item directory hub before this change: 712
   inline style attributes, 103.6 KB, 44.1% of the document. That is the
   evidence the Owner asked for before touching the remaining inline-styled
   blocks — this is the loop-repeated case, where the cost multiplies by the
   number of cards, not a cosmetic rewrite.
   --------------------------------------------------------------------------- */

.plinth-hub-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  background: #fff;
  border: 1px solid var(--wp--preset--color--border);
  border-radius: var(--wp--custom--radius--card);
  height: 100%;
  overflow: hidden;
}
.plinth-hub-card__body {
  padding: var(--wp--preset--spacing--20);
  display: flex;
  flex-direction: column;
  gap: var(--wp--preset--spacing--8);
  flex: 1;
  min-width: 0;
}
.plinth-hub-card__meta {
  font-size: var(--wp--preset--font-size--caption);
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--wp--preset--color--text-muted);
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.plinth-hub-card__title {
  font-size: var(--wp--preset--font-size--h4);
  font-weight: 600;
  line-height: 1.3;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-width: 0;
}
.plinth-hub-card__title > a,
.plinth-hub-feat__title > a {
  color: var(--wp--preset--color--navy-900);
  text-decoration: none;
}
.plinth-hub-card__excerpt {
  font-size: var(--wp--preset--font-size--small);
  line-height: 22px;
  color: var(--wp--preset--color--text-secondary);
  margin: 0;
  flex: 1;
  overflow-wrap: anywhere;
}
.plinth-hub-card__foot {
  padding: var(--wp--preset--spacing--12) var(--wp--preset--spacing--20);
  border-top: 1px solid var(--wp--preset--color--border);
}
.plinth-hub-card__more {
  font-size: var(--wp--preset--font-size--small);
  font-weight: 500;
  color: var(--wp--preset--color--rust-600);
  text-decoration: none;
}

.plinth-hub-feat__meta {
  font-size: var(--wp--preset--font-size--caption);
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--wp--preset--color--rust-600);
  margin: 0;
}
.plinth-hub-feat__title {
  font-size: var(--wp--preset--font-size--h3);
  font-weight: 700;
  line-height: 1.25;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.plinth-hub-feat__excerpt {
  font-size: var(--wp--preset--font-size--body);
  line-height: 26px;
  color: var(--wp--preset--color--text-secondary);
  margin: 0;
  flex: 1;
  overflow-wrap: anywhere;
}
.plinth-hub-feat__foot {
  padding: var(--wp--preset--spacing--16) var(--wp--preset--spacing--24);
  border-top: 1px solid var(--wp--preset--color--border);
}
.plinth-hub-feat__more {
  font-size: var(--wp--preset--font-size--body);
  font-weight: 600;
  color: var(--wp--preset--color--rust-600);
  text-decoration: none;
}
