/**
 * CGS site-tour styling.
 * Matches the existing brown/cream CGS palette.
 */

/* Floating "Take a tour" button */
.cgs-tour-button {
    position: fixed;
    right: 20px;
    bottom: 20px;
    z-index: 9999;
    padding: 10px 18px;
    border: none;
    border-radius: 999px;
    background: #642200;
    color: #fff;
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18);
    transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}
.cgs-tour-button:hover {
    background: #7d2900;
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.22);
}
.cgs-tour-button:focus-visible {
    outline: 3px solid #c8a35f;
    outline-offset: 2px;
}

/* Tour step popover overrides */
.cgs-tour-step.shepherd-element {
    max-width: 420px;
    border-radius: 12px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.25);
    border: 1px solid #c8a35f;
    background: #fff;
}

.shepherd-element.cgs-tour-step .shepherd-content .shepherd-header,
.shepherd-has-title.cgs-tour-step .shepherd-content .shepherd-header {
    background: #642200 !important;
    background-color: #642200 !important;
    padding: 14px 20px !important;
    border-top-left-radius: 12px !important;
    border-top-right-radius: 12px !important;
}
.shepherd-element.cgs-tour-step .shepherd-content .shepherd-header .shepherd-title {
    color: #fff !important;
    font-size: 16px !important;
    font-weight: 700 !important;
    margin: 0 !important;
}
.shepherd-element.cgs-tour-step .shepherd-content .shepherd-header .shepherd-cancel-icon {
    color: #c8a35f !important;
    font-size: 22px !important;
    line-height: 1 !important;
}
.shepherd-element.cgs-tour-step .shepherd-content .shepherd-header .shepherd-cancel-icon:hover {
    color: #fff !important;
}
/* Also override Shepherd's arrow-bg colour so the tooltip arrow matches the brown header */
.cgs-tour-step.shepherd-element.shepherd-has-title[data-popper-placement^="bottom"] > .shepherd-arrow:before {
    background-color: #642200 !important;
}
.cgs-tour-step .shepherd-text {
    padding: 16px 20px;
    font-size: 14px;
    line-height: 1.55;
    color: #333;
}
.cgs-tour-step .shepherd-text a {
    color: #642200;
    text-decoration: underline;
}
.cgs-tour-step .shepherd-footer {
    padding: 0 20px 16px !important;
    display: flex !important;
    justify-content: flex-end !important;
    gap: 8px !important;
}
.cgs-tour-step .shepherd-footer .shepherd-button {
    padding: 8px 16px !important;
    border-radius: 6px !important;
    border: none !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    background: #642200 !important;
    color: #fff !important;
    margin: 0 !important;
    transition: background 0.15s ease !important;
}
.cgs-tour-step .shepherd-footer .shepherd-button:not(:disabled):hover,
.cgs-tour-step .shepherd-footer .shepherd-button:hover {
    background: #7d2900 !important;
    color: #fff !important;
}
.cgs-tour-step .shepherd-footer .shepherd-button.shepherd-button-secondary {
    background: #f1ece3 !important;
    color: #642200 !important;
}
.cgs-tour-step .shepherd-footer .shepherd-button.shepherd-button-secondary:hover {
    background: #e6dfd2 !important;
    color: #642200 !important;
}

/* Backdrop dim */
.shepherd-modal-overlay-container {
    opacity: 0.55;
    fill: #000;
}

/* FAQ page */
.cgs-user-guide {
    max-width: 880px;
    margin: 30px auto;
    padding: 0 20px;
    font-family: "Poppins", "Roboto", "Helvetica Neue", Arial, sans-serif;
    color: #333;
}
.cgs-user-guide h2,
.cgs-user-guide p,
.cgs-user-guide summary,
.cgs-user-guide .answer,
.cgs-user-guide .take-tour,
.cgs-user-guide .take-tour button {
    font-family: "Poppins", "Roboto", "Helvetica Neue", Arial, sans-serif;
}
.cgs-user-guide h2 {
    color: #642200;
    margin-bottom: 8px;
}
.cgs-user-guide p.intro {
    color: #555;
    margin-bottom: 28px;
}
.cgs-user-guide details {
    border: 1px solid #e3dcce;
    border-radius: 8px;
    background: #fff;
    margin-bottom: 10px;
    overflow: hidden;
}
.cgs-user-guide details[open] {
    border-color: #c8a35f;
}
.cgs-user-guide summary {
    list-style: none;
    cursor: pointer;
    padding: 14px 18px;
    font-weight: 600;
    color: #642200;
    background: #fdfaf3;
    position: relative;
    user-select: none;
}
.cgs-user-guide summary::-webkit-details-marker { display: none; }
.cgs-user-guide summary::after {
    content: '+';
    position: absolute;
    right: 18px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 20px;
    color: #642200;
    font-weight: 400;
    transition: transform 0.2s ease;
}
.cgs-user-guide details[open] summary::after {
    content: '\2212';
    transform: translateY(-50%);
}
.cgs-user-guide .answer {
    padding: 16px 18px;
    line-height: 1.6;
    border-top: 1px solid #f0eadc;
}
.cgs-user-guide .answer p:first-child { margin-top: 0; }
.cgs-user-guide .answer p:last-child { margin-bottom: 0; }
.cgs-user-guide .answer ul, .cgs-user-guide .answer ol {
    margin: 8px 0 8px 22px;
}
.cgs-user-guide .answer code {
    background: #f5f0e6;
    padding: 1px 6px;
    border-radius: 3px;
    font-size: 0.92em;
}
.cgs-user-guide .answer a {
    color: #642200;
    text-decoration: underline;
}
.cgs-user-guide .take-tour {
    background: #fdfaf3;
    border: 1px solid #c8a35f;
    border-radius: 8px;
    padding: 16px 20px;
    margin: 28px 0 12px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}
.cgs-user-guide .take-tour p { margin: 0; }
.cgs-user-guide .take-tour button {
    padding: 10px 20px;
    border-radius: 999px;
    background: #642200;
    color: #fff;
    font-weight: 600;
    border: none;
    cursor: pointer;
}
.cgs-user-guide .take-tour button:hover { background: #7d2900; }

/* Page footer block (rendered inside the [cgs_user_guide] shortcode).
   Specificity bumped + !important on the structural rules because the
   surrounding .entry-content theme styles otherwise win. */
footer.cgs-page-footer {
    background: #595d68 !important;
    color: #fff !important;
    padding: 40px 0 0 !important;
    margin: 50px 0 0 !important;
    font-family: "Poppins", "Roboto", "Segoe UI", "Helvetica Neue", Arial, sans-serif !important;
    font-size: 14px !important;
    line-height: 1.6 !important;
    width: 100% !important;
    box-sizing: border-box !important;
}
footer.cgs-page-footer .cgs-page-footer-inner {
    max-width: 1180px !important;
    margin: 0 auto !important;
    padding: 0 30px !important;
    display: grid !important;
    grid-template-columns: repeat(4, 1fr) !important;
    gap: 30px !important;
    background: transparent !important;
}
footer.cgs-page-footer h3 {
    color: #fff !important;
    font-size: 16px !important;
    font-weight: 600 !important;
    margin: 0 0 14px !important;
    letter-spacing: 0.3px !important;
    font-family: inherit !important;
}
footer.cgs-page-footer p { margin: 0 0 10px !important; color: #fff !important; }
footer.cgs-page-footer ul {
    list-style: none !important;
    padding: 0 !important;
    margin: 0 !important;
}
footer.cgs-page-footer ul li { margin: 0 0 8px !important; color: #fff !important; }
footer.cgs-page-footer a {
    color: #fff !important;
    text-decoration: none !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2) !important;
}
footer.cgs-page-footer a:hover {
    color: #f1ece3 !important;
    border-bottom-color: #c8a35f !important;
}
footer.cgs-page-footer .cgs-footer-social li { display: inline-block !important; margin-right: 12px !important; }
footer.cgs-page-footer .cgs-page-footer-bottom {
    margin: 30px 0 0 !important;
    padding: 16px 30px !important;
    background: #4a4e57 !important;
    text-align: center !important;
    color: #fff !important;
    font-size: 13px !important;
}
footer.cgs-page-footer .cgs-page-footer-bottom a { color: #fff !important; }
@media (max-width: 768px) {
    footer.cgs-page-footer .cgs-page-footer-inner { grid-template-columns: repeat(2, 1fr) !important; }
}
@media (max-width: 480px) {
    footer.cgs-page-footer .cgs-page-footer-inner { grid-template-columns: 1fr !important; }
}

/* Print: hide the floating button */
@media print {
    .cgs-tour-button { display: none !important; }
}
