/* ============================================
   RESOURCE PROFILE (2026-11 redesign, matches the wireframe)
   Desktop: two columns, about 70/30, max 1200px. Phones: one column in the order a parent needs it.
   Loaded after resource-detail.css, which still styles the shared pieces (comments, gallery, programs, documents).
   ============================================ */
.rp {
  --rp-line: #e6def8;
  --rp-soft: #f4effe;
  --rp-ink: var(--brand-ink, #1f1636);
  --rp-text: var(--text-medium, #4b4266);
  --rp-muted: var(--text-light, #6b6385);
  --rp-brand: var(--brand, #5b2fb8);
  display: block;
  background: var(--bg-cream, #f7f3ff);
  color: var(--rp-ink);
  padding-bottom: 32px;
}
.rp-wrap { max-width: 1200px; margin: 0 auto; padding: 0 16px; }
.rp-icon { flex: none; width: 20px; height: 20px; }

/* Hero */
.rp-hero { background: linear-gradient(180deg, var(--brand-softer, #ebe2fc) 0%, var(--rp-soft) 100%); border-bottom: 1px solid var(--rp-line); padding: 18px 0 22px; }
.rp-hero-grid { display: grid; gap: 18px; }
.rp-back { display: inline-flex; align-items: center; gap: 6px; color: var(--rp-brand); font-weight: 600; font-size: 15px; text-decoration: none; min-height: 40px; }
.rp-back .rp-icon { width: 18px; height: 18px; }
.rp-badges { margin: 6px 0 10px; }
.rp-category { display: inline-block; background: #fff; border: 1px solid var(--primary-blue-lighter, #c4b3f0); color: var(--rp-brand); font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; padding: 5px 12px; border-radius: 999px; }
.rp-title-row { display: flex; align-items: center; gap: 14px; }
.rp-logo { width: 56px; height: 56px; object-fit: contain; border-radius: 12px; background: #fff; border: 1px solid var(--rp-line); padding: 4px; }
.rp-title { font-size: clamp(28px, 6vw, 40px); line-height: 1.15; margin: 0; color: var(--rp-ink); font-weight: 800; letter-spacing: -0.01em; overflow-wrap: anywhere; }
.rp-meta { display: flex; flex-wrap: wrap; gap: 8px 18px; margin: 12px 0 0; font-size: 15px; color: var(--rp-text); }
.rp-meta-item { display: inline-flex; align-items: center; gap: 6px; }
.rp-meta-item .rp-icon { width: 18px; height: 18px; color: var(--rp-brand); }
.rp-verified { color: var(--rp-ink); font-weight: 600; }
.rp-summary { font-size: 17px; line-height: 1.6; color: var(--rp-text); margin: 14px 0 0; max-width: 62ch; }
.rp-tags { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0 0; padding: 0; }
.rp-tags li { background: #fff; border: 1px solid var(--rp-line); border-radius: 999px; padding: 6px 14px; font-size: 14px; color: var(--rp-ink); }
.rp-hero-actions { display: flex; flex-direction: column; gap: 10px; align-self: center; }
.rp-hero-photo { width: 100%; max-height: 180px; object-fit: cover; border-radius: 14px; border: 1px solid var(--rp-line); }

/* Buttons */
.rp-btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 48px; padding: 10px 18px; border-radius: 10px; font-size: 16px; font-weight: 700; text-decoration: none; cursor: pointer; border: 1.5px solid var(--rp-brand); transition: background .15s, color .15s, transform .1s; width: 100%; font-family: inherit; margin: 0; }
.rp-btn:active { transform: scale(.98); }
.rp-btn-primary { background: var(--rp-brand); color: #fff; }
.rp-btn-primary:hover { background: var(--brand-dark, #3f1f86); color: #fff; }
.rp-btn-outline { background: #fff; color: var(--rp-brand); }
.rp-btn-outline:hover, .rp-btn-ghost:hover { background: var(--rp-soft); }
.rp-btn-ghost { background: #fff; color: var(--rp-ink); border-color: var(--rp-line); font-weight: 600; }
.rp-btn:focus-visible, .rp-text-link:focus-visible, .rp-section > summary:focus-visible { outline: 3px solid var(--primary-blue-light, #7c5cd6); outline-offset: 2px; }
.rp-text-link { background: none; border: 0; padding: 6px 0; color: var(--rp-brand); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; font-size: 15px; font-family: inherit; }

/* Layout */
.rp-layout { display: flex; flex-direction: column; gap: 14px; margin-top: 16px; }
.rp-main, .rp-side { display: contents; }
.rp-card { background: #fff; border: 1px solid var(--rp-line); border-radius: 14px; padding: 18px; box-shadow: 0 1px 2px rgba(63, 31, 134, .04); }
.rp-card-title { display: flex; align-items: center; gap: 10px; font-size: 20px; font-weight: 800; margin: 0 0 14px; color: var(--rp-ink); }
.rp-card-title .rp-icon { color: var(--rp-brand); }

/* Phone order: the facts first, then how to reach them, then trust and discussion */
.rp .org-updates { order: 1; }
.rp-glance { order: 2; }
.rp-about { order: 3; }
.rp-section { order: 4; }
.rp-contact { order: 10; }
.rp .org-contacts { order: 11; }
.rp-actions { order: 12; }
.rp-trust { order: 20; }
.rp-feedback { order: 21; }
.rp-claim { order: 22; }
.rp #discussionSection { order: 30; }

/* At a glance */
.rp-glance-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.rp-glance-tile { display: flex; flex-direction: column; gap: 4px; padding: 14px; border: 1px solid var(--rp-line); border-radius: 12px; background: var(--card-bg, #fbf9ff); min-width: 0; }
.rp-glance-tile strong { font-size: 15px; color: var(--rp-ink); }
.rp-glance-tile span { font-size: 14px; line-height: 1.45; color: var(--rp-text); overflow-wrap: anywhere; }
.rp-glance-icon { width: 26px; height: 26px; color: var(--rp-brand); margin-bottom: 4px; }

/* Collapsible sections */
.rp-section { padding: 0; }
.rp-section > summary { list-style: none; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 18px; min-height: 56px; cursor: pointer; border-radius: 14px; }
.rp-section > summary::-webkit-details-marker { display: none; }
.rp-sec-title { display: flex; align-items: center; gap: 12px; }
.rp-sec-title .rp-icon { color: var(--rp-brand); }
.rp-sec-title h2 { font-size: 18px; font-weight: 800; margin: 0; color: var(--rp-ink); }
.rp-chevron { color: var(--rp-ink); transition: transform .2s; }
.rp-section[open] > summary .rp-chevron { transform: rotate(180deg); }
.rp-section[open] > summary { border-bottom: 1px solid var(--rp-line); border-radius: 14px 14px 0 0; }
.rp-section-body { padding: 16px 18px 18px; font-size: 16px; line-height: 1.6; color: var(--rp-text); }
.rp-section-body > :first-child { margin-top: 0; }
.rp-sub { display: flex; align-items: center; gap: 8px; font-size: 15px; font-weight: 800; color: var(--rp-ink); margin: 18px 0 8px; }
.rp-sub .rp-icon { width: 18px; height: 18px; color: var(--rp-brand); }
.rp-muted { color: var(--rp-muted); font-size: 14px; }

/* Facts */
.rp-facts { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.rp-facts li { position: relative; padding-left: 22px; }
.rp-facts li::before { content: ""; position: absolute; left: 4px; top: .62em; width: 8px; height: 8px; border-radius: 50%; background: var(--primary-blue-lighter, #c4b3f0); }
.rp-steps { counter-reset: rpstep; }
.rp-steps li { padding-left: 38px; counter-increment: rpstep; min-height: 26px; }
.rp-steps li::before { content: counter(rpstep); width: 26px; height: 26px; top: 0; left: 0; background: var(--rp-soft); color: var(--rp-brand); font-weight: 800; font-size: 14px; display: flex; align-items: center; justify-content: center; }
.rp-fact-value { color: var(--rp-ink); white-space: pre-line; }
.rp-fact-link { color: var(--rp-brand); font-weight: 600; overflow-wrap: anywhere; }
.rp-fact-origin { display: inline; margin-left: 6px; font-size: 13px; color: var(--rp-muted); }
.rp-fact-origin a { color: var(--rp-muted); }
.rp-dl { margin: 12px 0 0; display: grid; gap: 10px; }
.rp-dl div { border-left: 3px solid var(--primary-blue-lighter, #c4b3f0); padding-left: 12px; }
.rp-dl dt { font-weight: 700; color: var(--rp-ink); }
.rp-dl dd { margin: 2px 0 0; }
.rp-chips { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; }
.rp-chips li { background: var(--rp-soft); border-radius: 999px; padding: 6px 12px; font-size: 14px; color: var(--rp-ink); }
.rp-apply-inline { margin-top: 16px; width: auto; }
.rp-section .org-programs, .rp-section .org-documents { margin: 0; padding: 0; border: 0; box-shadow: none; background: none; }
.rp-section .org-programs-title, .rp-section .org-documents-title { display: none; }
.rp-about .formatted-description { font-size: 16px; line-height: 1.7; color: var(--rp-text); }
.rp-about .language-tabs { margin-bottom: 12px; }
.rp-about .resource-gallery { margin-top: 18px; }

/* Sources and verification: a closed section like the others, with the review date on the closed bar */
.rp-sum-meta { margin-left: auto; font-size: 13px; color: var(--rp-muted); text-align: right; }
.rp-trust > summary .rp-chevron { margin-left: 8px; }
.rp-review-line { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; margin: 0 0 6px; }
.rp-review-line > .rp-icon { color: var(--rp-brand); }
.rp-source-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.rp-source-list li { min-width: 0; }
.rp-source-list a { display: block; color: var(--rp-brand); font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding: 2px 0; }
.rp-verified-pill { display: inline-flex; align-items: center; gap: 4px; font-weight: 700; color: var(--rp-ink); background: var(--rp-soft); border-radius: 999px; padding: 2px 10px; font-size: 14px; }
.rp-verified-pill .rp-icon { width: 16px; height: 16px; color: var(--rp-brand); }
.rp-disclaimer { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--rp-line); font-size: 14px; color: var(--rp-muted); }
.rp-disclaimer strong { color: var(--rp-ink); }
.rp-disclaimer p { margin: 4px 0 0; }
@media (max-width: 420px) { .rp-sum-meta { display: none; } }

/* Sidebar cards */
.rp-contact-list { list-style: none; margin: 0; padding: 0; }
.rp-contact-list li { display: flex; gap: 12px; padding: 12px 0; border-top: 1px solid var(--rp-line); }
.rp-contact-list li:first-child { border-top: 0; padding-top: 0; }
.rp-contact-list .rp-icon { color: var(--rp-brand); margin-top: 2px; }
.rp-contact-list div { display: flex; flex-direction: column; min-width: 0; font-size: 15px; }
.rp-contact-list strong { color: var(--rp-ink); }
.rp-contact-list a, .rp-contact-list span { color: var(--rp-text); overflow-wrap: anywhere; }
.rp-contact-list a { min-height: 32px; display: inline-flex; align-items: center; }
.rp-contact-list li.rp-contact-area { background: var(--rp-soft); border-radius: 10px; padding: 12px; border-top: 0; margin-top: 4px; }
.rp-actions { display: flex; flex-direction: column; gap: 10px; }
.rp-actions .rp-card-title { margin-bottom: 4px; }
.rp-actions .btn-save-large.saved { background: var(--rp-soft); }
.rp-feedback-q { margin: 0 0 10px; font-weight: 600; }
.rp-feedback-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 8px; }
.rp-feedback-row .rp-btn { min-height: 44px; font-size: 15px; }
.rp-count { font-weight: 600; opacity: .85; }
.rp-feedback .btn-helpful-large.voted { background: var(--brand-dark, #3f1f86); }
.rp-claim p { margin: 0 0 4px; }
.rp-claim .claim-status { display: flex; align-items: center; gap: 8px; font-weight: 700; }
.rp .save-hint { font-size: 14px; color: var(--rp-muted); margin: 0; }

/* Discussion inside a card */
.rp .post-comments { max-width: none; margin: 0; }
.rp .comments-header { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; }
.rp .comments-header .rp-card-title { margin: 0; }

/* Related, smaller than the listing itself */
.rp-related { margin-top: 18px; }
.rp-related-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.rp-related-grid { display: grid; grid-template-columns: 1fr; gap: 10px; }
.rp-related-card { display: flex; flex-direction: column; gap: 4px; padding: 14px; border: 1px solid var(--rp-line); border-radius: 12px; text-decoration: none; color: var(--rp-ink); background: var(--card-bg, #fbf9ff); }
.rp-related-card:hover { border-color: var(--primary-blue-lighter, #c4b3f0); }
.rp-related-cat { font-size: 12px; font-weight: 700; color: var(--rp-brand); text-transform: uppercase; letter-spacing: .04em; }
.rp-related-desc { font-size: 14px; color: var(--rp-text); line-height: 1.45; }

/* Phone quick-action row: line icons instead of emoji */
.resource-quick-actions .qa-icon { width: 20px; height: 20px; }

/* Phones: the row under the header already has save, report and share */
@media (max-width: 767px) { .rp-actions { display: none; } }

@media (min-width: 560px) {
  .rp-related-grid { grid-template-columns: 1fr 1fr; }
}
@media (min-width: 768px) {
  .rp-hero { padding: 22px 0 30px; }
  .rp-hero-grid { grid-template-columns: minmax(0, 1fr) 280px; gap: 32px; align-items: end; }
  .rp-glance-grid { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
  .rp-card { padding: 20px 22px; }
  .rp-section { padding: 0; }
}
@media (min-width: 1000px) {
  .rp-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 22px; align-items: start; margin-top: 22px; }
  .rp-main, .rp-side { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
  .rp-hero-grid { grid-template-columns: minmax(0, 1fr) 300px; }
  .rp-related-grid { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
}
@media print {
  .rp-hero-actions, .resource-quick-actions, .rp-actions, .rp-feedback, .rp-claim, .rp #discussionSection, .rp-related { display: none !important; }
}

/* Thumb-sized taps and readable numbers on phones (found in the size sweep) */
.resource-quick-actions .qa-count-pill { font-size: 12px; padding: 1px 7px; }
.rp-source-list a { padding: 9px 0; }
.rp-contact-list a { min-height: 40px; }
.rp-text-link { min-height: 44px; display: inline-flex; align-items: center; }
.rp .language-tabs .lang-tab { min-height: 44px; }

/* Narrow phones (320 to 379px): five labels fit in full instead of being cut off */
@media (max-width: 379px) {
  .resource-quick-actions { padding-left: 4px; padding-right: 4px; gap: 2px; }
  .resource-quick-actions .qa-btn { padding: 4px 0; }
  .resource-quick-actions .qa-label { overflow: visible; text-overflow: clip; letter-spacing: -0.3px; font-size: 12px; }
}
