/* RingQ SharePoint Guides v19.0.0 — main.css */

/* ── CSS VARS (set by PHP) ───────────────────────────────────── */
.rsgp-index-wrap,
.rsgp-reader-wrap,
.rsgp-doc-loading,
.rsgp-see-also,
#rsgp-lb {
    --rsgp-primary:      #00b5a5;
    --rsgp-primary-dark: #009488;
    --rsgp-blue:         #2563eb;
    --rsgp-blue-dark:    #1d4ed8;
    --rsgp-text:         #374151;
    --rsgp-text-dark:    #1a1a2e;
    --rsgp-heading-font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --rsgp-body-font:    -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* ── INDEX PAGE ──────────────────────────────────────────────── */
.rsgp-index-wrap { margin: 0; padding: 0; }

.rsgp-index-grid { display: grid; gap: 20px; }
.rsgp-cols-1 { grid-template-columns: 1fr; }
.rsgp-cols-2 { grid-template-columns: repeat(2, 1fr); }
.rsgp-cols-3 { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 900px) { .rsgp-cols-3 { grid-template-columns: repeat(2,1fr); } }
@media (max-width: 560px) { .rsgp-cols-3,.rsgp-cols-2 { grid-template-columns: 1fr; } }

.rsgp-index-col { display: flex; flex-direction: column; }
.rsgp-index-card {
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 2px 12px rgba(0,0,0,.07);
    padding: 20px 18px 16px;
    flex: 1;
}
.rsgp-index-divider { border-top: 1px solid #f0f0f0; margin: 8px 0 6px; }

.rsgp-index-heading {
    display: flex; align-items: center; gap: 8px;
    font-family: var(--rsgp-heading-font);
    font-size: 1.05rem; font-weight: 800;
    color: var(--rsgp-text-dark);
    margin: 0 0 10px;
    padding-bottom: 8px;
    border-bottom: 2px solid #1a1a2e;
}
.rsgp-cat-icon { font-size: 1rem; flex-shrink: 0; }
.rsgp-cat-icon img.emoji { width: 1rem!important; height: 1rem!important; display: inline!important; vertical-align: middle; margin: 0!important; }

/* File list */
.rsgp-index-list { margin: 0; padding: 0; list-style: none; }
.rsgp-index-list li {
    display: flex; align-items: center; gap: 5px;
    padding: 3px 0;
    border-bottom: 1px solid #f9f9f9;
}
.rsgp-index-list li:last-child { border-bottom: none; }
.rsgp-chevron { color: var(--rsgp-blue); font-size: .78rem; font-weight: 700; flex-shrink: 0; }
.rsgp-ficon   { font-size: .82rem; flex-shrink: 0; width: 18px; text-align: center; }
.rsgp-ficon img.emoji { width: .82rem!important; height: .82rem!important; display: inline!important; vertical-align: middle; margin: 0!important; }
.rsgp-file-img-icon { width: 20px; height: 20px; object-fit: contain; border-radius: 3px; flex-shrink: 0; }
.rsgp-index-list a {
    color: #1a1a2e!important;
    font-size: .84rem; text-decoration: none; line-height: 1.4; flex: 1;
    transition: color .15s;
}
.rsgp-index-list a:hover { color: #2563eb!important; text-decoration: underline; }

/* Sub-folders in index */
.rsgp-subfolder { margin: 4px 0 2px; }
.rsgp-sub-heading {
    display: flex; align-items: center; gap: 6px;
    font-family: var(--rsgp-heading-font);
    font-size: .8rem; font-weight: 700;
    color: var(--rsgp-primary);
    margin: 6px 0 2px; padding: 2px 0 2px 2px;
    border-bottom: 1px solid #e5f9f7;
    text-transform: uppercase; letter-spacing: .04em;
}
.rsgp-sub-icon { font-size: .85rem; }
.rsgp-sub-icon img.emoji { width: .85rem!important; height: .85rem!important; display: inline!important; vertical-align: middle; margin: 0!important; }
.rsgp-sub-h3 { color: #4b7cf3!important; border-bottom-color: #eef2ff!important; }
.rsgp-sub-h4 { color: #9ca3af!important; border-bottom-color: #f3f4f6!important; }
.rsgp-depth-3 > .rsgp-index-list li { padding-left: 10px; }
.rsgp-depth-4 > .rsgp-index-list li { padding-left: 20px; }

/* ── READER PAGE ─────────────────────────────────────────────── */
.rsgp-reader-wrap {
    display: flex; gap: 0; min-height: 600px;
    font-family: var(--rsgp-body-font);
}

/* Sidebar */
.rsgp-sidebar {
    width: 280px; min-width: 260px; max-width: 300px; flex-shrink: 0;
    background: #f9fafb; border-right: 1px solid #e5e7eb;
    display: flex; flex-direction: column;
    position: sticky; top: 80px; height: calc(100vh - 100px); overflow: hidden;
}
@media (max-width: 800px) { .rsgp-sidebar { display: none; } }

.rsgp-sidebar-header {
    padding: 14px 16px; background: #fff; border-bottom: 1px solid #e5e7eb;
    font-weight: 700; font-size: .85rem;
}
.rsgp-all-content-link {
    display: flex; align-items: center; gap: 8px; text-decoration: none;
    color: var(--rsgp-text-dark); font-weight: 700;
}
.rsgp-all-content-link:hover { color: var(--rsgp-primary); }
.rsgp-all-content-link svg { fill: currentColor; flex-shrink: 0; }

.rsgp-sidebar-search { padding: 10px 12px; border-bottom: 1px solid #e5e7eb; }
.rsgp-sidebar-search input {
    width: 100%; padding: 6px 10px; border: 1px solid #e0e0e0;
    border-radius: 6px; font-size: .82rem; box-sizing: border-box;
}
.rsgp-sidebar-body { flex: 1; overflow-y: auto; padding: 8px 0; }
.rsgp-sidebar-section { margin-bottom: 4px; }
.rsgp-sidebar-cat {
    font-size: .78rem; font-weight: 700; text-transform: uppercase;
    letter-spacing: .05em; color: #6b7280;
    padding: 8px 16px 4px; margin: 0;
}
.rsgp-sb-active-cat {
    color: var(--rsgp-primary)!important;
    border-left: 3px solid var(--rsgp-primary);
    padding-left: 13px!important;
}
.rsgp-sidebar-link {
    display: flex; align-items: center; gap: 5px;
    padding: 5px 16px; font-size: .81rem;
    color: var(--rsgp-text)!important; text-decoration: none;
    transition: background .12s, color .12s;
    line-height: 1.35;
}
.rsgp-sidebar-link:hover { background: rgba(0,181,165,.06); color: var(--rsgp-primary)!important; }
.rsgp-sidebar-active { color: var(--rsgp-primary)!important; font-weight: 600; background: rgba(0,181,165,.08); }
.rsgp-sb-chevron { color: var(--rsgp-blue); font-size: .72rem; font-weight: 700; flex-shrink: 0; }
.rsgp-sb-icon { font-size: .77rem; width: 16px; text-align: center; flex-shrink: 0; }
.rsgp-sb-icon img.emoji { width: .77rem!important; height: .77rem!important; display: inline!important; vertical-align: middle; margin: 0!important; }
.rsgp-sb-hidden { display: none!important; }

/* Sub-sections in sidebar */
.rsgp-sidebar-subcat {
    font-size: .71rem; font-weight: 700; text-transform: uppercase;
    letter-spacing: .04em; color: var(--rsgp-primary); padding: 5px 16px 2px; margin: 0;
}
.rsgp-sb-subcat-3 { padding-left: 22px!important; color: #4b7cf3!important; }
.rsgp-sb-subcat-4 { padding-left: 30px!important; color: #9ca3af!important; }
.rsgp-sb-depth-3 .rsgp-sidebar-link { padding-left: 26px; }
.rsgp-sb-depth-4 .rsgp-sidebar-link { padding-left: 34px; }

/* More Guides section */
.rsgp-sidebar-others { margin-top: 10px; border-top: 1px solid #e5e7eb; padding-top: 8px; }
.rsgp-sb-other-label { font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: #9ca3af; padding: 0 16px 6px; margin: 0; }
.rsgp-sb-details { margin: 2px 6px; }
.rsgp-sb-summary {
    cursor: pointer; list-style: none; padding: 7px 10px!important;
    font-size: .81rem!important; display: flex!important; align-items: center; gap: 6px;
    border-radius: 6px; color: var(--rsgp-text)!important; font-weight: 600!important;
    text-transform: none!important; letter-spacing: 0!important;
    transition: background .12s;
}
.rsgp-sb-summary:hover { background: rgba(0,181,165,.06); }
.rsgp-sb-details[open] .rsgp-sb-summary { color: var(--rsgp-primary)!important; background: rgba(0,181,165,.05); }

/* Main content */
.rsgp-reader-main {
    flex: 1; min-width: 0; padding: 24px 32px;
    font-family: var(--rsgp-body-font);
}
@media (max-width: 800px) { .rsgp-reader-main { padding: 16px; } }

/* Breadcrumb */
.rsgp-breadcrumb {
    display: flex; flex-wrap: wrap; align-items: center; gap: 2px;
    margin-bottom: 14px; font-size: .79rem; color: #9ca3af;
}
.rsgp-breadcrumb a { color: var(--rsgp-primary); text-decoration: none; padding: 2px 3px; border-radius: 3px; }
.rsgp-breadcrumb a:hover { text-decoration: underline; background: rgba(0,181,165,.07); }
.rsgp-bc-sep { color: #d1d5db; padding: 0 1px; }
.rsgp-bc-current { color: var(--rsgp-text-dark); font-weight: 600; padding: 2px 3px; max-width: 280px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.rsgp-reader-title { font-family: var(--rsgp-heading-font); font-size: 1.6rem; font-weight: 800; color: var(--rsgp-text-dark); margin: 0 0 20px; line-height: 1.2; }

/* TOC */
.rsgp-toc { border-left: 3px solid var(--rsgp-primary); padding: 8px 0 8px 16px; margin: 0 0 20px; list-style: none; }
.rsgp-toc li { margin: 4px 0; }
.rsgp-toc a { font-size: .84rem; color: var(--rsgp-text); text-decoration: none; }
.rsgp-toc a:hover { color: var(--rsgp-primary); }
.rsgp-toc-hr { border: none; border-top: 1px solid #e5e7eb; margin: 16px 0; }

/* Doc content */
.rsgp-doc-body { font-size: .93rem; color: var(--rsgp-text); line-height: 1.7; }
.rsgp-doc-body h1,.rsgp-doc-title { font-family: var(--rsgp-heading-font); font-size: 1.5rem; font-weight: 800; color: var(--rsgp-text-dark); margin: 28px 0 12px; }
.rsgp-h2 { font-family: var(--rsgp-heading-font); font-size: 1.15rem; font-weight: 700; color: var(--rsgp-text-dark); margin: 24px 0 10px; border-bottom: 2px solid var(--rsgp-primary); padding-bottom: 4px; }
.rsgp-h3 { font-family: var(--rsgp-heading-font); font-size: 1rem; font-weight: 700; color: var(--rsgp-text-dark); margin: 20px 0 8px; }
.rsgp-h4,.rsgp-h5,.rsgp-h6 { font-size: .93rem; font-weight: 700; color: var(--rsgp-text); margin: 16px 0 6px; }
.rsgp-doc-p { margin: 0 0 12px; }
.rsgp-doc-list,.rsgp-ordered-list { padding-left: 20px; margin: 8px 0 12px; }
.rsgp-doc-list li,.rsgp-ordered-list li { margin-bottom: 4px; }
.rsgp-table { border-collapse: collapse; width: 100%; margin: 12px 0; font-size: .87rem; }
.rsgp-table td,.rsgp-table th { border: 1px solid #e0e0e0; padding: 7px 10px; text-align: left; }
.rsgp-table tr:nth-child(even) td { background: #f9fafb; }
.rsgp-doc-img { max-width: 100%; height: auto; border-radius: 6px; margin: 12px 0; cursor: zoom-in; transition: opacity .15s, box-shadow .15s; display: block; }
.rsgp-doc-img:hover { opacity: .9; box-shadow: 0 2px 12px rgba(0,0,0,.15); }
.rsgp-link { color: var(--rsgp-blue); }

/* Image-only paragraph wrapper */
.rsgp-img-wrap { margin: 12px 0; text-align: center; }
.rsgp-img-wrap .rsgp-doc-img { display: inline-block; }

/* Loading spinner */
.rsgp-doc-loading { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 80px 20px; color: #9ca3af; gap: 16px; }
.rsgp-spinner { width: 40px; height: 40px; border: 3px solid #e5e7eb; border-top-color: var(--rsgp-primary); border-radius: 50%; animation: rsgpSpin .8s linear infinite; }
@keyframes rsgpSpin { to { transform: rotate(360deg); } }

/* See Also */
.rsgp-see-also { margin-top: 40px; border-top: 1px solid #e5e7eb; padding-top: 20px; }
.rsgp-see-also h2 { font-family: var(--rsgp-heading-font); font-size: 1rem; font-weight: 700; margin: 0 0 10px; }
.rsgp-see-also-list { list-style: none; padding: 0; margin: 0; }
.rsgp-see-also-list li { margin: 6px 0; }
.rsgp-see-also-list a { color: var(--rsgp-blue); text-decoration: none; font-size: .87rem; }
.rsgp-see-also-list a:hover { text-decoration: underline; }

/* SharePoint button */
.rsgp-sp-btn { display: inline-block; background: var(--rsgp-primary); color: #fff; padding: 10px 22px; border-radius: 6px; text-decoration: none; font-weight: 700; font-size: .9rem; margin-top: 8px; }
.rsgp-sp-btn:hover { background: var(--rsgp-primary-dark); color: #fff; }

/* Welcome state */
.rsgp-reader-welcome { display: flex; align-items: center; justify-content: center; height: 200px; color: #9ca3af; font-size: .9rem; }

/* ── IMAGE LIGHTBOX ───────────────────────────────────────────── */
#rsgp-lb { display: none; position: fixed; inset: 0; z-index: 99999; align-items: center; justify-content: center; }
#rsgp-lb.rsgp-lb-open { display: flex; }
#rsgp-lb-bg { position: absolute; inset: 0; background: rgba(0,0,0,.85); backdrop-filter: blur(4px); }
#rsgp-lb-wrap { position: relative; z-index: 1; max-width: 90vw; max-height: 90vh; display: flex; flex-direction: column; align-items: center; gap: 12px; }
#rsgp-lb-img { max-width: 90vw; max-height: 82vh; object-fit: contain; border-radius: 8px; box-shadow: 0 8px 40px rgba(0,0,0,.6); animation: rsgpZoomIn .2s ease; }
@keyframes rsgpZoomIn { from { opacity:0; transform:scale(.92); } to { opacity:1; transform:scale(1); } }
#rsgp-lb-close { position: absolute; top: -14px; right: -14px; width: 34px; height: 34px; background: #fff; border: none; border-radius: 50%; font-size: 1rem; cursor: pointer; color: #374151; box-shadow: 0 2px 8px rgba(0,0,0,.3); display: flex; align-items: center; justify-content: center; padding: 0; }
#rsgp-lb-close:hover { background: #f3f4f6; }
#rsgp-lb-caption { color: #e5e7eb; font-size: .82rem; text-align: center; max-width: 600px; }

/* ── ADMIN SETTINGS ───────────────────────────────────────────── */
.rsgp-tab-wrap { border: 1px solid #e5e7eb; border-radius: 10px; overflow: hidden; margin: 0 0 20px; max-width: 860px; }
.rsgp-tabs { display: flex; background: #f9fafb; border-bottom: 1px solid #e5e7eb; flex-wrap: wrap; }
.rsgp-tab { flex: 1; min-width: 110px; padding: 10px 14px; background: none; border: none; border-bottom: 3px solid transparent; cursor: pointer; font-size: .82rem; font-weight: 700; color: #6b7280; transition: color .15s, border-color .15s; font-family: inherit; }
.rsgp-tab:hover { color: var(--rsgp-primary); }
.rsgp-tab-active { color: var(--rsgp-primary)!important; border-bottom-color: var(--rsgp-primary)!important; background: #fff; }
.rsgp-tab-panel { padding: 16px 20px; background: #fff; }

.rsgp-settings-actions { display: flex; gap: 12px; align-items: center; margin-top: 24px; padding: 14px 0; border-top: 1px solid #e5e7eb; position: sticky; bottom: 0; background: #fff; z-index: 10; }

/* ── PAGE HEADING ────────────────────────────────────────────── */
.rsgp-guides-page-heading {
    text-align: center;
    font-family: var(--rsgp-heading-font);
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--rsgp-text-dark, #1a1a2e);
    margin: 0 0 28px;
    padding: 0;
    letter-spacing: -.02em;
}

.rsgp-office-preview iframe {
    width: 100% !important;
    min-height: 700px !important;
    display: block !important;
}
