/*
Theme Name: Caregiver Survival
Author: Caregiver Survival Team
Description: Rapid-response zero-cognitive-load PWA theme for dementia caregivers.
Version: 1.0.0
*/

/* ==========================================================================
   1. GLOBAL RESET & FULL-BLEED LAYOUT ENGINE
   ========================================================================== */

/* Universal Reset & Device Bounds */
html, body {
    margin: 0 !important;
    padding: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    overflow-x: hidden !important;
    background-color: #FAF7F2; /* Warm Linen */
    color: #1E1B18; /* Deep Earth */
}

/* Force FSE Root Block Container Full Bleed */
.wp-site-blocks {
    padding-left: 0 !important;
    padding-right: 0 !important;
    padding-top: 0 !important;
    margin: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    overflow-x: hidden !important;
}

/* WP Admin Bar Fixed Position */
body.admin-bar #wpadminbar {
    position: fixed !important;
}

/* Admin Bar Offset: Top-level template part header wrapper */
body.admin-bar .wp-site-blocks > .wp-block-template-part {
    margin-top: 32px !important;
}

@media screen and (max-width: 782px) {
    body.admin-bar .wp-site-blocks > .wp-block-template-part {
        margin-top: 46px !important;
    }
}

/* Universal 100% Full-Bleed Header Shell */
.wp-site-blocks > .wp-block-template-part,
header,
.site-header {
    width: 100% !important;
    max-width: 100% !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    background-color: #660066 !important; /* Deep Plum */
    box-sizing: border-box !important;
}

/* Header Content Row & Text Alignment */
header.wp-block-group,
.wp-block-template-part header {
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    padding: 12px 16px !important;
    margin: 0 !important;
    width: 100% !important;
    background-color: #660066 !important;
}

header p,
header a,
header span,
.wp-block-template-part header * {
    color: #FAF7F2 !important; /* Warm Linen */
    text-align: center !important;
    margin: 0 !important;
}

/* ==========================================================================
   2. MAIN READING COLUMN & CONTENT TYPOGRAPHY
   ========================================================================== */

/* Main Content Column Constraints (Desktop & Mobile Parity) */
main,
.cs-single-container,
.entry-content,
.wp-block-post-content {
    max-width: 680px !important;
    margin-left: auto !important;
    margin-right: auto !important;
    padding-left: 16px !important;
    padding-right: 16px !important;
    box-sizing: border-box !important;
}

/* Main Post Title Alignment & Brand Color */
h1,
.wp-block-post-title,
.editor-post-title__input,
.editor-visual-editor__post-title-wrapper h1 {
    font-weight: 700 !important;
    color: #660066 !important; /* Deep Plum */
    text-align: center !important;
    margin-left: auto !important;
    margin-right: auto !important;
    width: 100% !important;
}

/* Sub-Titles (H2 Headings & Lead Section Titles) */
h2,
.wp-block-heading,
.entry-content h2,
.wp-block-post-content h2 {
    text-align: center !important;
    color: #660066 !important; /* Deep Plum */
    margin-left: auto !important;
    margin-right: auto !important;
    width: 100% !important;
    max-width: 680px !important;
}

/* Bold Text Enforcement */
strong, b {
    font-weight: 600 !important;
    color: #1E1B18 !important; /* Deep Earth */
}

/* High-Contrast Crisp Section Divider */
hr,
hr.wp-block-separator,
.wp-block-separator {
    border: none !important;
    border-top: 2px solid #660066 !important; /* Deep Plum */
    opacity: 1 !important;
    margin-top: 24px !important;
    margin-bottom: 24px !important;
    width: 100% !important;
}

/* Full-Bleed Footer Container */
footer,
.site-footer,
.wp-block-template-part-footer {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    box-sizing: border-box !important;
}

/* ==========================================================================
   3. CAREGIVER CARDS & TOUCH TARGETS (STRICT PALETTE COMPLIANT)
   ========================================================================== */

/* Standard Module Touch Card */
.caregiver-module-row,
.cs-module-card {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    padding: 12px 16px !important;
    margin-bottom: 10px !important;
    background-color: #FAF7F2 !important; /* Warm Linen */
    border: 1px solid #F0EAE1 !important; /* Soft Almond */
    border-radius: 6px !important;
    text-decoration: none !important;
    color: #1E1B18 !important; /* Deep Earth */
    transition: background-color 0.15s ease !important;
}

.caregiver-module-row:hover,
.caregiver-module-row:active,
.cs-module-card:hover,
.cs-module-card:active {
    background-color: #F0EAE1 !important; /* Soft Almond Press State */
}

/* Orientation Utility Cards (Intro / Outro) */
.cs-utility-card {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    padding: 12px 16px !important;
    background-color: #F0EAE1 !important; /* Soft Almond */
    border: none !important;
    border-radius: 6px !important;
    text-decoration: none !important;
    color: #1E1B18 !important;
    transition: background-color 0.15s ease !important;
}

.cs-utility-card:hover,
.cs-utility-card:active {
    background-color: #FAF7F2 !important; /* Warm Linen Flip State */
}

/* Step & Media Containers */
.cs-step-box,
.cs-media-card {
    border: 2px solid #F0EAE1 !important; /* Soft Almond */
    border-radius: 8px !important;
    padding: 16px !important;
}

.cs-product-section .cs-step-box + .cs-step-box {
    margin-top: 10px !important;
}

/* ==========================================================================
   4. ASSET LOCKDOWN & SECURITY CANVAS SUPPRESSION
   ========================================================================== */

/* Global User Selection Prevention */
body,
.wp-site-blocks,
.secure-protocol-text,
.secure-protocol-text *,
.pdfemb-viewer,
.pdfemb-inner {
    -webkit-touch-callout: none !important;
    -webkit-user-select: none !important;
    -moz-user-select: none !important;
    -ms-user-select: none !important;
    user-select: none !important;
}

::selection {
    background: transparent !important;
    color: inherit !important;
}

/* Form Input Selection Exemption */
input,
textarea,
[contenteditable="true"] {
    -webkit-user-select: text !important;
    -moz-user-select: text !important;
    -ms-user-select: text !important;
    user-select: text !important;
}

/* Suppress PDF Embedder Toolbar Actions */
.pdfemb-toolbar .pdfemb-download,
.pdfemb-toolbar .pdfemb-popout,
.pdfemb-toolbar .pdfemb-print,
a.pdfemb-download-link {
    display: none !important;
    visibility: hidden !important;
    pointer-events: none !important;
}

/* Image & Canvas Protection */
.pdfemb-viewer canvas,
.secure-protocol-text img {
    pointer-events: none !important;
    -webkit-user-drag: none !important;
}

/* Landscape Mobile Fit Fix */
@media (max-height: 500px) and (orientation: landscape) {
    body {
        padding-top: 0 !important;
    }
}

/* Phase 8, Step 2: Suppress SuperPWA Offline Snackbar */
.snackbar,
#snackbar-msg,
.snackbar-close,
.snackbar a,
body.snackbar--show .snackbar {
    display: none !important;
    visibility: hidden !important;
    pointer-events: none !important;
    opacity: 0 !important;
    height: 0 !important;
    width: 0 !important;
}