/* ------------------------------------------------------------------
 * 1. Global Reset & Variables
 * ------------------------------------------------------------------ */

html {
    box-sizing: border-box;
    font-size: 16px;
}

*,
*:before,
*:after {
    box-sizing: inherit;
}

:root {
    /* Fonts */
    --body-font: 'Nunito', sans-serif;
    --heading-font: 'Lora', serif;
    --site-title-font: 'Nunito', sans-serif;
    /* NEW: Dedicated sans-serif for title */

    /* Colors - Humanistic Palette */
    --color-primary: #9A6332;
    /* Updated to Brown per user request */
    --color-secondary: #8CA28D;
    --color-cream-bg: #F5F2EC;
    --color-tan-bg: #E7E3D8;
    /* Sidebar BG */
    --color-warm-gray: #4A4A4A;
    /* Menu Item Color */

    --line-height: 1.65;
}

body {
    line-height: var(--line-height);
    font-family: var(--body-font);
    color: var(--color-warm-gray);
    /* NEW: Main Page Area Background Image */
    background-image: url('/shaylamcdermott/media/bg.png');
    background-size: cover;
    background-position: center center;
    background-attachment: fixed;
}

h1,
h2,
h3,
h4,
h5,
h6,
#header .logo strong {
    font-family: var(--heading-font);
    font-weight: 700;
    color: var(--color-primary);
    line-height: 1.3;
    margin: 1.5em 0 0.75em 0;
    /* Increased bottom margin for better separation */
    letter-spacing: 0.02em;
    /* Slight letter spacing for elegance */
}

h2 {
    font-size: 1.8em;
}

h3 {
    font-size: 1.4em;
}

/* NEW: Underlining of the main page title (H2) */
article .post__header h2 {
    display: inline-block;
    /* Makes the border only span the text width */
    border-bottom: 3px solid var(--color-secondary);
    padding-bottom: 0.25em;
    /* Space between text and line */
    margin-bottom: 0.5em;
    /* Ensure it doesn't push down the content too much */
}

/* ------------------------------------------------------------------
 * 2. Structural Layout
 * ------------------------------------------------------------------ */

#wrapper {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

#main {
    flex-grow: 1;
    width: 100%;
    padding: 2rem 0;
}

#main .inner {
    max-width: 700px;
    margin: 0 auto;
    padding: 3rem 1.5rem;
    /* background-color: var(--color-cream-bg); REMOVED to let body bg show through */
    /* box-shadow: 0 0 50px rgba(0, 0, 0, 0.05); REMOVED per user request */
}

/* Sidebar: Light Tan Background with Organic Shapes */
#sidebar {
    width: 280px;
    flex-shrink: 0;
    order: -1;
    background-color: #D4C3AD;
    /* Solid color per user request */
    /* background-image removed */
}

#sidebar .inner {
    padding: 2rem 1.5rem;
}

/* Footer in Sidebar: Use Body Font for Headers */
#sidebar #footer h1,
#sidebar #footer h2,
#sidebar #footer h3,
#sidebar #footer h4,
#sidebar #footer h5,
#sidebar #footer h6 {
    font-family: var(--body-font);
    margin-top: 0;
    /* Align better with menu */
}

#sidebar #footer a {
    text-decoration: none;
    color: var(--color-primary);
}

@media screen and (min-width: 1024px) {
    #wrapper {
        flex-direction: row;
    }

    #main .inner {
        max-width: 900px;
        padding: 4rem 3rem;
        margin: 0;
    }
}

/* ------------------------------------------------------------------
 * 3. Header & Navigation Styling
 * ------------------------------------------------------------------ */

#header {
    display: flex;
    justify-content: flex-end;
    align-items: baseline;
    padding-bottom: 2rem;
    /* CHANGE: Thicker divider line */
    border-bottom: 3px solid var(--color-secondary);
    margin-bottom: 2rem;
}

#header .logo strong a {
    /* CHANGE: Sans-serif font for the site title */
    font-family: var(--site-title-font);
    font-weight: 700;
    font-size: 1.8em;
    color: var(--color-primary);
    text-decoration: none;
    border-bottom: none;
    transition: none;
}

#menu ul {
    list-style: none;
    padding: 0;
    margin: 1.5rem 0;
}

#menu>ul>li {
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    /* Faint divider */
    margin-top: 0.5rem;
    padding-top: 0.5rem;
}

#menu>ul>li:first-child {
    border-top: none;
    margin-top: 0;
    padding-top: 0;
}

#menu li a,
#menu .opener {
    /* Ensure opener span is styled like a link */
    display: block;
    padding: 0.35rem 0;
    /* Tighter spacing */
    text-decoration: none;
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.05em;
    color: var(--color-primary);
    /* Updated to match headers */
    transition: color 0.2s ease-in-out;
    cursor: pointer;
}

#menu li a:hover,
#menu .opener:hover {
    color: var(--color-primary);
}

#menu li.active>a,
#menu li.active>.opener {
    /* Targets active main links/openers */
    color: var(--color-primary);
    font-weight: 800;
    /* Bolder active state */
    border-bottom: 2px solid var(--color-primary);
    padding-bottom: 0.15em;
    /* Tighter underline */
}

/* Submenu Fix (CRITICAL: Hides the submenu by default) */
#menu .submenu {
    list-style: none;
    padding-left: 1rem;
    margin: 0.5em 0 1.5em 0;

    /* --- FIX: HIDE THE SUBMENU INITIALLY --- */
    display: none;
}

/* The existing main.min.js toggles the 'display' property for us. 
   We only need to handle the CSS for when the submenu is open 
   (which the JS will handle via inline styles/classes)
*/

#menu .submenu li a {
    font-size: 0.9em;
    padding: 0.25rem 0;
}


/* ------------------------------------------------------------------
 * 4. Liberation Health Page Layout (Requires updated .md file)
 * ------------------------------------------------------------------ */

.page-intro-group {
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
    align-items: flex-start;
    margin-bottom: 2rem;
}

.client-avatar {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    margin-left: 1.5rem;
}

.page-intro-group blockquote {
    background-color: rgba(255, 255, 255, 0.6);
    border-left: 0.5em solid var(--color-secondary);
    padding: 1.5em;
    margin: 0;
    font-style: italic;
    font-size: 1.1em;
    flex-grow: 1;
}

@media screen and (max-width: 768px) {
    .client-avatar {
        float: right;
    }
}

/* ------------------------------------------------------------------
 * 5. Responsive Sidebar Restoration (Surgical Extraction)
 * ------------------------------------------------------------------ */

#sidebar {
    /* Add transition for smooth sliding */
    transition: margin-left 0.5s ease, box-shadow 0.5s ease;
}

/* Toggle Button */
#sidebar .toggle {
    text-decoration: none;
    transition: left 0.5s ease;
    -webkit-tap-highlight-color: rgba(255, 255, 255, 0);
    border: 0;
    display: block;
    height: 7.5em;
    left: 280px;
    /* Match sidebar width */
    line-height: 7.5em;
    outline: 0;
    overflow: hidden;
    position: absolute;
    text-align: center;
    text-indent: -15em;
    white-space: nowrap;
    top: 0;
    width: 6em;
    z-index: 1000;
}

#sidebar .toggle:before {
    content: "\f0c9";
    /* FontAwesome Menu Icon */
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    font-size: 2rem;
    height: inherit;
    left: 0;
    line-height: inherit;
    position: absolute;
    text-indent: 0;
    top: 0;
    width: inherit;
    color: var(--color-primary);
    /* Adapted color */
}

/* Inactive State (Desktop/General) */
#sidebar.inactive {
    margin-left: -280px;
}

/* Responsive Behavior (Max Width 1280px - Matches 'large' breakpoint) */
@media screen and (max-width: 1280px) {
    #sidebar {
        height: 100%;
        left: 0;
        position: fixed;
        top: 0;
        z-index: 10000;
        box-shadow: 0 0 5em 0 rgba(0, 0, 0, 0.175);
    }

    #sidebar.inactive {
        margin-left: -280px;
        box-shadow: none;
    }

    #sidebar>.inner {
        height: 100%;
        overflow-y: auto;
    }

    /* Adjust Toggle for smaller screens */
    #sidebar .toggle {
        text-indent: 6em;
        width: 6em;
        left: 280px;
    }
}

/* Mobile Adjustments */
@media screen and (max-width: 736px) {
    #sidebar .toggle {
        width: 4em;
        left: 280px;
    }

    #sidebar .toggle:before {
        font-size: 1.5rem;
    }
}

/* ------------------------------------------------------------------
 * 6. Submenu Restoration (Surgical Extraction)
 * ------------------------------------------------------------------ */

#menu ul a.opener,
#menu ul span.opener {
    -webkit-transition: color 0.2s ease-in-out;
    transition: color 0.2s ease-in-out;
    text-decoration: none;
    -webkit-tap-highlight-color: rgba(255, 255, 255, 0);
    position: relative;
    cursor: pointer;
}

#menu ul a.opener:before,
#menu ul span.opener:before {
    -moz-osx-font-smoothing: grayscale;
    -webkit-font-smoothing: antialiased;
    display: inline-block;
    font-style: normal;
    font-variant: normal;
    text-rendering: auto;
    line-height: 1;
    text-transform: none !important;
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
}

#menu ul a.opener:before,
#menu ul span.opener:before {
    -webkit-transition: color 0.2s ease-in-out, -webkit-transform 0.2s ease-in-out;
    transition: color 0.2s ease-in-out, -webkit-transform 0.2s ease-in-out;
    transition: color 0.2s ease-in-out, transform 0.2s ease-in-out;
    transition: color 0.2s ease-in-out, transform 0.2s ease-in-out, -webkit-transform 0.2s ease-in-out;
    color: var(--color-warm-gray);
    /* Default to warm gray */
    content: "\f078";
    /* Chevron Down */
    position: absolute;
    right: 0;
    top: 0.5em;
    /* Adjust vertical alignment */
}

#menu ul a.opener:hover:before,
#menu ul span.opener:hover:before {
    color: var(--color-primary);
}

#menu ul a.opener.active+ul,
#menu ul span.opener.active+ul {
    display: block;
    /* Show submenu */
}

#menu ul a.opener.active:before,
#menu ul span.opener.active:before {
    -webkit-transform: rotate(-180deg);
    transform: rotate(-180deg);
    color: var(--color-primary);
}

hover-image {
  position: relative;
  cursor: pointer;
}

.hover-image::after {
  content: '';
  position: fixed;
  width: 40px;
  height: 40px;
  background-image: var(--hover-img); /* pull from variable - this path ends up relative to css directory? */
 background-size: contain;
  background-repeat: no-repeat;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
 transition-delay: 0.8s; /* delay before appearing */
  z-index: 9999;
  left: var(--mouse-x, 0);
  top: var(--mouse-y, 0);
}

.hover-image:hover::after {
  opacity: 1;
  transition-delay: 0.8s; /* keeps the delay on hover */
}
