/* Resources (/resources/*): guides, USPTO news, glossary, and topics. Sits on tokens.css and shares the
   homepage vocabulary: hairline rows, 12px panels, sentence-case pills, teal for links and state. */

.resources-page [hidden] { display: none !important; }
.resources-page { padding: clamp(2.5rem, 2rem + 2vw, 4rem) 0 var(--s-9); min-height: 100vh; }
.res-container { max-width: 74rem; }

/* ---------- Index head ---------- */
.resources-page .section-title {
    font-size: var(--t-h2); font-weight: 600; letter-spacing: -0.032em; line-height: 1.1;
    text-align: left; margin: 0 0 var(--s-4);
}
.resources-page .section-subtitle {
    max-width: 46rem; margin: 0 0 var(--s-7); text-align: left;
    font-size: 1.0625rem; line-height: 1.65; color: var(--c-ink-2);
}

/* ---------- Controls ---------- */
.res-controls { display: grid; gap: var(--s-4); max-width: 52rem; margin: 0 0 var(--s-8); }
.res-search {
    display: flex; align-items: center; gap: 0.6rem; padding: 0 1rem;
    background: var(--c-white); border-radius: var(--r-2);
    box-shadow: 0 0 0 1px var(--c-rule-strong), 0 1px 2px rgba(11, 31, 39, 0.05);
    transition: box-shadow var(--dur-1) var(--ease-out);
}
.res-search:focus-within { box-shadow: 0 0 0 1px var(--c-teal), 0 0 0 4px rgba(40, 103, 125, 0.16); }
.res-search svg { width: 1.1rem; height: 1.1rem; color: var(--c-ink-2); flex: none; }
.res-search input {
    flex: 1; min-width: 0; border: 0; outline: 0; background: transparent;
    font: inherit; font-size: 1rem; padding: 0.8rem 0; color: var(--c-ink);
}
.res-search input::placeholder { color: var(--c-ink-2); opacity: 0.85; }

.res-tabs {
    display: inline-flex; flex-wrap: wrap; gap: 0.25rem; padding: 0.25rem; justify-self: start;
    border-radius: 10px; background: var(--c-paper-2);
}
.res-tab {
    font: inherit; font-size: 0.875rem; font-weight: 500; padding: 0.45rem 0.95rem;
    border: 0; border-radius: 7px; background: transparent; color: var(--c-ink-2); cursor: pointer;
    transition: background-color var(--dur-1) var(--ease-out), color var(--dur-1) var(--ease-out);
}
.res-tab:hover { color: var(--c-ink); }
.res-tab[aria-selected="true"] { background: var(--c-white); color: var(--c-ink); font-weight: 550; box-shadow: 0 1px 2px rgba(11, 31, 39, 0.12); }
.res-tag-filter { display: flex; flex-wrap: wrap; gap: 0.4rem; }

/* ---------- Pills ---------- */
.res-tag, .res-kind {
    display: inline-flex; align-items: center; white-space: nowrap;
    padding: 0.22rem 0.6rem; border-radius: 999px;
    font-size: 0.75rem; font-weight: 550; line-height: 1.25;
}
.res-tag {
    color: var(--c-ink-2); background: var(--c-white); box-shadow: inset 0 0 0 1px var(--c-rule-strong);
    text-decoration: none; transition: color var(--dur-1) var(--ease-out), box-shadow var(--dur-1) var(--ease-out), background-color var(--dur-1) var(--ease-out);
}
a.res-tag:hover, .res-tag-btn:hover { color: var(--c-teal-700); box-shadow: inset 0 0 0 1px var(--c-teal); }
.res-tag-btn { font-family: inherit; border: 0; cursor: pointer; }
.res-tag-btn[aria-pressed="true"] { background: var(--c-teal); color: var(--c-white); box-shadow: none; }
.res-draft { background: var(--c-yellow-soft); color: var(--c-yellow-ink, #6a520f); box-shadow: none; }

.res-kind { background: var(--c-teal-50); color: var(--c-teal-700); box-shadow: inset 0 0 0 1px var(--c-teal-100); }
.res-kind-final-rule { background: var(--c-ink); color: var(--c-white); box-shadow: none; }
.res-kind-proposed-rule { background: var(--c-yellow-soft); color: #6a520f; box-shadow: none; }
.res-kind-guidance, .res-kind-notice { background: var(--c-paper-2); color: var(--c-ink); box-shadow: none; }
.res-kind-ext { background: var(--c-white); color: var(--c-ink-2); box-shadow: inset 0 0 0 1px var(--c-rule-strong); }

/* ---------- Sections ---------- */
.res-section { margin-bottom: clamp(3rem, 2.5rem + 2vw, 4.5rem); scroll-margin-top: calc(var(--header-h) + 1.5rem); }
.res-section-title {
    display: flex; align-items: center; gap: var(--s-3);
    font-size: clamp(1.4rem, 1.2rem + 0.6vw, 1.75rem); font-weight: 600; letter-spacing: -0.025em;
    margin-bottom: var(--s-5); padding-bottom: var(--s-4); border-bottom: 1px solid var(--c-rule);
}
.res-rss {
    margin-left: auto; padding: 0.22rem 0.6rem; border-radius: 999px;
    font-size: 0.75rem; font-weight: 550; letter-spacing: 0; text-decoration: none;
    color: var(--c-teal-700); box-shadow: inset 0 0 0 1px var(--c-teal-100); background: var(--c-teal-50);
}
.res-rss:hover { box-shadow: inset 0 0 0 1px var(--c-teal); }
.res-section-intro { color: var(--c-ink-2); margin: calc(-1 * var(--s-2)) 0 var(--s-5); max-width: 70ch; }
.res-section-intro a { color: var(--c-teal-700); }

/* Guide cards: quiet panels, no lift */
.res-card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 19rem), 1fr)); gap: var(--s-4); }
.res-card {
    display: flex; flex-direction: column; align-items: flex-start; gap: 0.6rem;
    padding: 1.35rem 1.4rem 1.2rem; text-decoration: none; color: inherit;
    background: var(--c-white); border-radius: var(--r-3); box-shadow: 0 0 0 1px var(--c-rule);
    transition: box-shadow var(--dur-2) var(--ease-out);
}
.res-card:hover { box-shadow: 0 0 0 1px var(--c-rule-strong), var(--sh-1); }
.res-card:hover h3 { color: var(--c-teal-700); }
.res-card h3 { font-size: 1.0625rem; font-weight: 600; line-height: 1.35; letter-spacing: -0.012em; transition: color var(--dur-1) var(--ease-out); }
.res-card p { flex: 1; font-size: 0.9375rem; line-height: 1.55; color: var(--c-ink-2); }
.res-card-foot { font-size: 0.8125rem; color: var(--c-ink-2); font-variant-numeric: tabular-nums; }

/* News: hairline rows */
.res-news-list { display: grid; border-top: 1px solid var(--c-rule); }
.res-news-row {
    display: grid; grid-template-columns: 9.5rem minmax(0, 1fr); gap: var(--s-5);
    padding: 1.2rem 0.5rem; text-decoration: none; color: inherit;
    border-bottom: 1px solid var(--c-rule); transition: background-color var(--dur-1) var(--ease-out);
}
.res-news-row:hover { background: var(--c-paper); }
.res-news-row:hover h3 { color: var(--c-teal-700); }
.res-news-row time { padding-top: 0.15rem; font-size: 0.875rem; font-weight: 500; color: var(--c-ink-2); font-variant-numeric: tabular-nums; }
.res-news-row h3 { margin: 0.5rem 0 0.3rem; font-size: 1.0625rem; font-weight: 600; line-height: 1.4; letter-spacing: -0.01em; transition: color var(--dur-1) var(--ease-out); }
.res-news-row p { font-size: 0.9375rem; line-height: 1.55; color: var(--c-ink-2); }
.res-empty { padding: var(--s-6) 0; text-align: center; color: var(--c-ink-2); }

/* Show 9, then View all / Collapse */
.res-section.is-collapsed:not(.is-filtering) .res-card-grid > :nth-child(n+10),
.res-section.is-collapsed:not(.is-filtering) .res-news-list > :nth-child(n+10) { display: none; }
.res-more-wrap { display: flex; justify-content: center; margin-top: var(--s-5); }
.res-section.is-filtering .res-more-wrap { display: none; }
.res-more { cursor: pointer; font-family: inherit; }
.res-more::after {
    content: ""; width: 0.45rem; height: 0.45rem; margin: -0.2rem 0 0 0.15rem;
    border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor;
    transform: rotate(45deg); transition: transform var(--dur-2) var(--ease-out);
}
.res-more[aria-expanded="true"]::after { transform: translateY(0.25rem) rotate(-135deg); }

/* Topics */
.res-topic-grid { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.res-topic-grid a {
    padding: 0.5rem 0.9rem; border-radius: var(--r-2); text-decoration: none;
    font-size: 0.9375rem; font-weight: 500; color: var(--c-ink);
    background: var(--c-white); box-shadow: inset 0 0 0 1px var(--c-rule-strong);
    transition: box-shadow var(--dur-1) var(--ease-out), color var(--dur-1) var(--ease-out);
}
.res-topic-grid a:hover { color: var(--c-teal-700); box-shadow: inset 0 0 0 1px var(--c-teal); }
.res-topic-title { margin-bottom: var(--s-3); font-size: var(--t-h2); font-weight: 600; letter-spacing: -0.032em; line-height: 1.1; }
.res-topic-lede { margin-bottom: var(--s-7); }

/* ---------- Article pages ---------- */
.res-breadcrumb { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: var(--s-6); font-size: 0.875rem; color: var(--c-ink-2); }
.res-breadcrumb a { color: var(--c-ink-2); text-decoration: none; font-weight: 500; }
.res-breadcrumb a:hover { color: var(--c-teal-700); text-decoration: underline; }

.res-article-grid { display: grid; grid-template-columns: minmax(0, 1fr) 15rem; gap: clamp(2.5rem, 1rem + 4vw, 5rem); align-items: start; }
.res-article { max-width: 70ch; min-width: 0; }
.res-article-narrow { margin: 0 auto; }
.res-article-wide { max-width: 56rem; margin: 0 auto; }

.res-article-header { margin-bottom: var(--s-6); padding-bottom: var(--s-6); border-bottom: 1px solid var(--c-rule); }
.res-meta { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-bottom: var(--s-4); }
.res-article-header h1 {
    margin-bottom: var(--s-4); font-size: clamp(2rem, 1.4rem + 2.2vw, 3rem);
    font-weight: 600; line-height: 1.08; letter-spacing: -0.035em; text-wrap: balance;
}
.res-lede { font-size: 1.125rem; line-height: 1.65; color: var(--c-ink-2); }
.res-byline { margin-top: var(--s-4); font-size: 0.875rem; color: var(--c-ink-2); }

.res-tldr { margin-bottom: var(--s-6); padding: 1.25rem 1.5rem; border-radius: var(--r-3); background: var(--c-paper); box-shadow: inset 0 0 0 1px var(--c-rule); }
.res-tldr h2 { margin-bottom: var(--s-3); font-size: 0.9375rem; font-weight: 600; letter-spacing: -0.005em; }
.res-tldr ul { display: grid; gap: 0.5rem; }
.res-tldr li { position: relative; padding-left: 1.4rem; line-height: 1.6; }
.res-tldr li::before { content: ""; position: absolute; left: 0.2rem; top: 0.62em; width: 0.4rem; height: 0.4rem; border-radius: 50%; background: var(--c-teal); }

.res-keydates { display: grid; grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr)); margin-bottom: var(--s-6); border-radius: var(--r-3); box-shadow: inset 0 0 0 1px var(--c-rule); overflow: hidden; }
.res-keydates div { padding: 0.85rem 1.1rem; box-shadow: -1px 0 0 var(--c-rule); }
.res-keydates dt { font-size: 0.8125rem; font-weight: 500; color: var(--c-ink-2); }
.res-keydates dd { margin: 0.15rem 0 0; font-weight: 600; font-variant-numeric: tabular-nums; }

/* Prose */
.res-prose { font-size: 1.0625rem; line-height: 1.75; }
.res-prose > * + * { margin-top: 1.1rem; }
.res-prose h2 { position: relative; margin-top: 2.75rem; font-size: 1.5rem; font-weight: 600; line-height: 1.25; letter-spacing: -0.022em; scroll-margin-top: calc(var(--header-h) + 1.5rem); }
.res-prose h3 { position: relative; margin-top: 2rem; font-size: 1.1875rem; font-weight: 600; letter-spacing: -0.015em; scroll-margin-top: calc(var(--header-h) + 1.5rem); }
.res-prose .anchor { position: absolute; left: -1.1em; color: var(--c-ink-3); text-decoration: none; opacity: 0; transition: opacity var(--dur-1) var(--ease-out); }
.res-prose h2:hover .anchor, .res-prose h3:hover .anchor { opacity: 1; }
.res-prose a { color: var(--c-teal-700); text-decoration-color: rgba(40, 103, 125, 0.4); }
.res-prose a:hover { text-decoration-color: currentColor; }
.res-prose ul, .res-prose ol { padding-left: 1.4rem; }
.res-prose ul { list-style: disc; }
.res-prose ol { list-style: decimal; }
.res-prose li::marker { color: var(--c-ink-2); }
.res-prose li + li { margin-top: 0.4rem; }
.res-prose strong { font-weight: 600; }
.res-prose code { font-size: 0.88em; padding: 0.1em 0.35em; border-radius: 4px; background: var(--c-paper-2); }
.res-prose blockquote { padding: 1rem 1.25rem; border-radius: var(--r-2); background: var(--c-teal-50); box-shadow: inset 0 0 0 1px var(--c-teal-100); }
.res-prose blockquote > * + * { margin-top: 0.6rem; }

.table-wrap { overflow-x: auto; border-radius: var(--r-3); background: var(--c-white); box-shadow: inset 0 0 0 1px var(--c-rule); }
.res-prose table { width: 100%; border-collapse: collapse; font-size: 0.9375rem; line-height: 1.5; font-variant-numeric: tabular-nums; }
.res-prose th, .res-prose td { padding: 0.75rem 1rem; text-align: left; vertical-align: top; border-bottom: 1px solid var(--c-rule); }
.res-prose th { background: var(--c-paper); font-size: 0.875rem; font-weight: 550; color: var(--c-ink-2); white-space: nowrap; }
.res-prose tr:last-child td { border-bottom: 0; }

/* FAQ */
.res-faq { display: grid; border-top: 1px solid var(--c-rule); }
.res-faq-item { padding: 1.1rem 0; border-bottom: 1px solid var(--c-rule); }
.res-prose .res-faq-item h3 { margin-top: 0; font-size: 1.0625rem; }
.res-faq-item p { margin-top: 0.4rem; color: var(--c-ink-2); }

/* Sources, further reading, related news */
.res-sources, .res-related-news { margin-top: var(--s-7); padding-top: var(--s-5); border-top: 1px solid var(--c-rule); }
.res-sources h2, .res-further h2, .res-related-news h2 { margin-bottom: var(--s-3); font-size: 0.9375rem; font-weight: 600; letter-spacing: -0.005em; }
.res-sources ul, .res-further ul, .res-related-news ul { display: grid; gap: 0.7rem; }
.res-sources a, .res-related-news a, .res-further a {
    color: var(--c-ink); font-weight: 500; text-decoration: underline;
    text-decoration-color: var(--c-rule-strong); transition: color var(--dur-1) var(--ease-out), text-decoration-color var(--dur-1) var(--ease-out);
}
.res-sources a:hover, .res-related-news a:hover, .res-further a:hover { color: var(--c-teal-700); text-decoration-color: currentColor; }
.res-sources a::after {
    content: ""; display: inline-block; width: 0.55em; height: 0.55em; margin-left: 0.35em;
    border-top: 1.5px solid var(--c-ink-3); border-right: 1.5px solid var(--c-ink-3); transform: translateY(-0.1em);
}
.res-related-news time { display: block; margin-top: 0.15rem; font-size: 0.8125rem; color: var(--c-ink-2); font-variant-numeric: tabular-nums; }
.res-further { margin-top: var(--s-7); padding: 1.25rem 1.5rem; border-radius: var(--r-3); background: var(--c-white); box-shadow: inset 0 0 0 1px var(--c-rule); }
.res-further p { margin-top: 0.25rem; font-size: 0.9375rem; line-height: 1.55; color: var(--c-ink-2); }
.res-further-site { margin-left: 0.35rem; padding: 0.15rem 0.5rem; border-radius: 999px; font-size: 0.75rem; font-weight: 550; white-space: nowrap; color: var(--c-ink-2); background: var(--c-paper-2); }

.res-cta {
    display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s-4);
    margin-top: var(--s-7); padding: 1.4rem 1.6rem; border-radius: var(--r-3);
    background: var(--c-dark); color: var(--c-on-ink);
}
.res-cta p { flex: 1 1 18rem; line-height: 1.55; color: var(--c-on-ink); }
.res-cta .btn-primary { background: var(--c-white); color: var(--c-ink); box-shadow: none; }
.res-cta .btn-primary:hover { background: var(--c-teal-50); }
.res-cta .btn-ghost { background: transparent; color: var(--c-on-ink); border-color: rgba(255, 255, 255, 0.28); }
.res-cta :focus-visible { outline-color: var(--c-yellow); }
.res-disclaimer { margin-top: var(--s-6); font-size: 0.8125rem; line-height: 1.55; color: var(--c-ink-2); }

/* Sidebar contents */
.res-sidebar { position: sticky; top: calc(var(--header-h) + 2rem); }
.res-toc h2 { margin-bottom: var(--s-3); font-size: 0.875rem; font-weight: 600; }
.res-toc ol { border-left: 1px solid var(--c-rule); }
.res-toc a {
    display: block; margin-left: -1px; padding: 0.35rem 0 0.35rem 0.9rem; border-left: 1px solid transparent;
    font-size: 0.875rem; line-height: 1.4; color: var(--c-ink-2); text-decoration: none;
    transition: color var(--dur-1) var(--ease-out), border-color var(--dur-1) var(--ease-out);
}
.res-toc a:hover { color: var(--c-ink); }
.res-toc a.current { color: var(--c-teal-700); border-left-color: var(--c-teal); font-weight: 550; }

.res-related { margin-top: var(--s-8); padding-top: var(--s-6); border-top: 1px solid var(--c-rule); }
.res-related h2 { margin-bottom: var(--s-5); font-size: 1.5rem; font-weight: 600; letter-spacing: -0.022em; }

/* ---------- Glossary ---------- */
.res-glossary-search { margin: var(--s-6) 0 var(--s-4); }
.res-az {
    position: sticky; top: var(--header-h); z-index: 5;
    display: flex; flex-wrap: wrap; gap: 0.25rem; margin-bottom: var(--s-6); padding: 0.6rem 0;
    background: var(--c-white); border-bottom: 1px solid var(--c-rule);
}
.res-az a {
    display: inline-flex; align-items: center; justify-content: center; width: 2rem; height: 2rem;
    border-radius: 6px; font-size: 0.875rem; font-weight: 550; color: var(--c-ink-2); text-decoration: none;
    transition: background-color var(--dur-1) var(--ease-out), color var(--dur-1) var(--ease-out);
}
.res-az a:hover { background: var(--c-teal-50); color: var(--c-teal-700); }
.res-glossary-group { margin-bottom: var(--s-6); scroll-margin-top: calc(var(--header-h) + 4rem); }
.res-glossary-group > h2 { margin-bottom: var(--s-2); padding-bottom: var(--s-2); font-size: 1.5rem; font-weight: 600; color: var(--c-teal-700); border-bottom: 1px solid var(--c-rule); }
.res-glossary dl { display: grid; }
.res-term { padding: 0.9rem 0; border-bottom: 1px solid var(--c-rule); scroll-margin-top: calc(var(--header-h) + 4rem); }
.res-term:target { margin: 0 -0.75rem; padding-inline: 0.75rem; border-radius: var(--r-2); background: var(--c-yellow-soft); }
.res-term dt a { font-size: 1.0625rem; font-weight: 600; color: var(--c-ink); text-decoration: none; }
.res-term dd { margin: 0.25rem 0 0; line-height: 1.65; color: var(--c-ink-2); }
.res-term dd a { color: var(--c-teal-700); }
.res-term-see { font-weight: 550; white-space: nowrap; }

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
    .res-article-grid { grid-template-columns: minmax(0, 1fr); gap: 0; }
    .res-sidebar { display: none; }
}
@media (max-width: 640px) {
    .res-news-row { grid-template-columns: minmax(0, 1fr); gap: 0.35rem; padding: 1rem 0; }
    .res-news-row:hover { background: transparent; }
    .res-prose { font-size: 1rem; }
    .res-prose .anchor { display: none; }
    .res-cta .btn { width: 100%; }
    .res-tabs { display: flex; }
}
