/*
 * PSGCA portal: WordPress + PeepSo bridge styles.
 * portal.css is the compiled React portal stylesheet; this file adds the pieces
 * that only exist in WordPress (native dialog, links used as buttons, PeepSo theme).
 */

body.psgca-portal { margin: 0; background: var(--background); }
body.psgca-portal .wp-site-blocks { padding: 0; }
.portal-main > .psgca-flash, .public-directory-shell > .psgca-flash { max-width: 1120px; margin: 0 auto 18px; }
.psgca-flash { padding: 11px 14px; border-radius: 10px; font-size: 0.86rem; line-height: 1.5; }
.psgca-flash.auth-success { color: #075c4c; background: #e8f7f1; border: 1px solid #b9e3d4; }
.psgca-flash.info { color: #6a4a07; background: #fff8e8; border: 1px solid #f0d49a; }
.psgca-publish-status { display: flex; align-items: center; gap: 10px; cursor: default; }
.psgca-publish-status > svg { width: 18px; height: 18px; flex: none; color: #b7791f; }
.psgca-publish-status.is-published > svg { color: #08624f; }
.profile-save-row { flex-wrap: wrap; }
.psgca-join-card { width: min(100%, 640px); margin: 0 auto; }
.psgca-join-card form { display: grid; gap: 4px; }
.psgca-join-card .psgca-check { display: flex !important; gap: 10px; align-items: flex-start; margin: 10px 0 0 !important; font-weight: 500 !important; line-height: 1.5; color: var(--slate); }
.psgca-join-card .psgca-check input { width: auto; height: auto; margin-top: 4px; }
.psgca-hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; overflow: hidden; }
.psgca-join-door { margin-top: 10px; text-align: center; font-size: 0.8rem; }
.psgca-join-door a { color: var(--primary); font-weight: 700; }
.psgca-join-wrap { padding: 32px 24px 56px; }
.psgca-flash.form-error { color: #8d1d2c; background: #fdeef0; border: 1px solid #f2c4cb; }
.login-card .psgca-flash { margin: -10px 0 18px; }

/* Links that use button styles (portal.css sets a { color: inherit } outside Tailwind layers) */
a.bg-primary.text-primary-foreground:not(.light-action) { color: var(--primary-foreground); }
a.bg-secondary.text-secondary-foreground { color: var(--secondary-foreground); }
.play-button svg { fill: currentColor; }
a.brand { color: inherit; text-decoration: none; }
.section-heading > a { display: inline-flex; align-items: center; gap: 6px; }
.welcome-copy a.light-action { text-decoration: none; }
.sidebar nav a { text-decoration: none; }
.psgca-nav-badge { min-width: 20px; height: 20px; margin-left: auto; padding: 0 6px; display: inline-grid; place-items: center; border-radius: 10px; color: #fff; background: #d9534f; font-size: 0.68rem; font-weight: 800; }
.psgca-nav-badge[hidden] { display: none; }
.sidebar nav a .psgca-nav-badge:not([hidden]) + .nav-arrow { margin-left: 6px; }
.sidebar-membership.inactive .membership-dot { background: #d08a1e; box-shadow: 0 0 0 4px rgb(208 138 30 / 18%); }
.psgca-sidebar-backdrop { position: fixed; inset: 0; z-index: 30; background: rgb(0 30 36 / 35%); }
.psgca-sidebar-backdrop[hidden] { display: none; }
.psgca-plain-link { color: inherit; text-decoration: none; }
.psgca-plain-link:hover { color: var(--primary); }
.psgca-remember { display: flex !important; align-items: center; gap: 8px; margin: 14px 0 4px !important; font-weight: 500 !important; font-size: 0.8rem !important; color: var(--slate); }
.auth-mode-links a.mode-link { display: inline-block; }
.directory-door a { width: 100%; }
.psgca-access-inline { margin: 20px auto; }
.access-actions a { text-decoration: none; }

/* Home notices */
.psgca-home-notice { display: flex; align-items: center; gap: 14px; padding: 14px 18px; border: 1px solid #b7e1dd; border-radius: 14px; color: var(--deep-teal); background: #e9f7f5; text-decoration: none; }
.psgca-home-notice > svg { width: 20px; height: 20px; flex: none; color: var(--primary); }
.psgca-home-notice > svg:last-child { margin-left: auto; }
.psgca-home-notice span { display: grid; gap: 2px; }
.psgca-home-notice strong { font-size: 0.9rem; }
.psgca-home-notice small { color: var(--slate); font-size: 0.78rem; }
.psgca-home-notice.warning { border-color: #f0d49a; background: #fff8e8; color: #6a4a07; }
.psgca-home-notice.warning > svg { color: #b7791f; }
.psgca-days-left { color: #b7791f; font-style: normal; font-weight: 600; font-size: 0.85em; }

/* Native dialog = React dialog */
dialog.psgca-dialog { position: fixed; inset: 0; margin: auto; border: 0; display: none; gap: 16px; border-radius: 0.95rem; background: var(--popover); color: var(--popover-foreground); box-shadow: 0 0 0 1px rgb(22 54 59 / 10%), var(--shadow); font-size: 0.875rem; }
dialog.psgca-dialog[open] { display: grid; animation: psgca-zoom 0.12s ease-out; }
dialog.psgca-dialog::backdrop { background: rgb(0 0 0 / 10%); backdrop-filter: blur(4px); }
.psgca-dialog-close { position: absolute; top: 8px; right: 8px; }
.psgca-dialog-header { display: grid; gap: 6px; padding-right: 32px; }
.psgca-dialog-header h2 { margin: 0; font-size: 1rem; font-weight: 500; line-height: 1.3; }
.psgca-dialog-header p { margin: 0; color: var(--muted-foreground); }
.video-frame[hidden], .video-unavailable[hidden] { display: none; }
@keyframes psgca-zoom { from { opacity: 0; transform: scale(0.96); } to { opacity: 1; transform: none; } }

/* Directory */
.psgca-connect-link { display: inline-flex; align-items: center; gap: 6px; margin-top: auto; padding-top: 6px; color: var(--primary); font-size: 0.76rem; font-weight: 750; text-decoration: none; }
.psgca-connect-link svg { width: 14px; height: 14px; }
.psgca-connect-link:hover { text-decoration: underline; }
[data-psgca-profile][hidden], [data-psgca-webinar][hidden], [data-psgca-row][hidden] { display: none !important; }
.directory-state[hidden], .directory-result-count[hidden] { display: none; }

/* Membership / directory choices */
.psgca-profile-form { display: contents; }
label.visibility-control { position: relative; cursor: pointer; margin: 0; }
label.visibility-control:focus-within { outline: 2px solid var(--ring); outline-offset: 1px; }
.membership-card-top [data-slot=badge].status-expired, .membership-card-top [data-slot=badge].status-suspended { color: #8d1d2c; background: #fdeef0; }
.membership-card-top [data-slot=badge].status-pending { color: #6a4a07; background: #fff3d6; }

/* Inbox */
a.inbox-thread { display: grid; gap: 3px; color: inherit; text-decoration: none; }
.inbox-message.system { border-left: 3px solid var(--aqua); }
.inbox-message { white-space: normal; }
.inbox-message p { margin: 0; white-space: pre-wrap; }
.inbox-messages > a { justify-self: center; }

/* Committee workspace */
.psgca-csv-upload { margin: 0; }
.psgca-inline-form { display: inline-flex; align-items: center; gap: 10px; margin: 0; }
.psgca-row-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.psgca-actions-cell { white-space: normal !important; }
.psgca-edit-row > td { padding: 16px 18px 20px !important; background: #f6faf9; }
.psgca-edit-row[hidden] { display: none; }
.psgca-edit-grid { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)) !important; }
.psgca-edit-form label, .quick-form-grid label { display: grid; gap: 6px; }
.psgca-edit-grid select, .psgca-edit-grid textarea { width: 100%; }
.psgca-edit-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 14px; }
.psgca-edit-actions.secondary { margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--border); color: var(--slate); font-size: 0.76rem; }
.psgca-status-filter { padding: 0 22px 14px; }
.psgca-issue { color: #a62336; font-weight: 650; }
.psgca-soon { display: block; color: #b7791f !important; font-weight: 650; }
.psgca-table-empty { padding: 18px 22px; color: var(--slate); font-size: 0.85rem; }
.psgca-table-empty[hidden] { display: none; }
.psgca-card-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 12px; padding: 16px 22px; border-top: 1px solid var(--border); }
.psgca-field-hint { color: var(--slate); font-size: 0.7rem; font-weight: 500; }
.psgca-field-hint.good { color: #08624f; }
.psgca-field-hint.bad { color: #a62336; }
.psgca-link-card { display: flex; gap: 16px; padding: 22px; border: 1px solid #b7e1dd; border-radius: 16px; background: #eef9f7; }
.psgca-link-card > svg { width: 22px; height: 22px; flex: none; color: var(--primary); }
.psgca-link-card h2 { margin: 0 0 4px; font-size: 1rem; font-weight: 600; }
.psgca-link-card p { margin: 0 0 12px; color: var(--slate); font-size: 0.82rem; }
.psgca-link-card > div { flex: 1; min-width: 0; }
.psgca-copy-row { display: flex; gap: 8px; }
.psgca-copy-row input { background: white; }
.psgca-example-toggles { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.psgca-seed-actions { display: flex; flex-direction: column; gap: 8px; align-items: stretch; }
.seed-card p { max-width: 640px; }
.quick-admin-card .publish-checkbox { margin-top: 2px; }

/* WordPress page content inside the portal */
.psgca-wp-content { color: var(--foreground); line-height: 1.7; }
.psgca-public-content { max-width: 960px; margin: 0 auto; padding: 32px 24px 56px; }
.psgca-wp-content > .page-heading { margin-bottom: 18px; }
.psgca-wp-content h2, .psgca-wp-content h3 { margin: 1.4em 0 0.5em; line-height: 1.25; letter-spacing: -0.02em; font-weight: 500; }
.psgca-wp-content p { margin: 0 0 1em; }
.psgca-wp-content a { color: var(--primary); }
.psgca-wp-content ul, .psgca-wp-content ol { padding-left: 1.4em; list-style: revert; }
.psgca-wp-content img { max-width: 100%; height: auto; }

/* PeepSo, in portal colours --------------------------------------------- */
body.psgca-portal {
  --COLOR--PRIMARY: #006b78;
  --COLOR--PRIMARY--SHADE: #e3f4f2;
  --COLOR--PRIMARY--LIGHT: #4ec8ca;
  --COLOR--PRIMARY--ULTRALIGHT: #e8f7f5;
  --COLOR--PRIMARY--DARK: #004a56;
  --PS-COLOR--PRIMARY: #006b78;
  --PS-COLOR--PRIMARY--SHADE: #e3f4f2;
  --PS-COLOR--PRIMARY--LIGHT: #4ec8ca;
  --PS-COLOR--PRIMARY--ULTRALIGHT: #e8f7f5;
  --PS-COLOR--PRIMARY--DARK: #004a56;
  --PS-COLOR--TEXT: #16363b;
  --PS-COLOR--TEXT--LIGHT: #60777b;
  --PS-COLOR--HEADING: #16363b;
  --PS-COLOR--APP--GRAY: #edf3f2;
  --PS-FONT-FAMILY: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}
.psgca-community .psgca-wp-content { line-height: normal; }
.psgca-community .psgca-wp-content a { color: inherit; }
.psgca-community #peepso-wrap, .psgca-wp-content .peepso { max-width: 100%; }
.psgca-wp-content .ps-post, .psgca-wp-content .ps-postbox, .psgca-wp-content .ps-focus, .psgca-wp-content .ps-navbar {
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 8px 24px rgb(0 61 70 / 6%);
}
.psgca-wp-content .ps-btn--action, .psgca-wp-content .ps-btn--primary { background: var(--primary); color: #fff; border-radius: 9px; }
/* PeepSo menu items that point to pages the portal already covers */
.psgca-wp-content .ps-navbar__menu-item a[href*="/members"], .psgca-wp-content a.ps-js-register, .psgca-wp-content .ps-landing__actions { display: none !important; }

@media (max-width: 900px) {
  .psgca-copy-row { flex-direction: column; }
  .psgca-link-card { flex-direction: column; }
}
.psgca-header-actions { display: inline-flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }
.psgca-dir-state { display: block; color: #b7791f !important; font-weight: 600; }
.psgca-dir-state.on { color: #08624f !important; }
.psgca-join-card .psgca-check, .psgca-join-card .profile-save-row { grid-column: 1 / -1; }
