/* ==========================================
   1. MASTER LANDING PAGE STRUCTURAL WRAPPER
   ========================================== */
.zensical-landing-wrap {
    margin: 0 auto;
    width: 100%;
    padding-top: 1.5rem;
    font-family: inherit;
}

.footer-content {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 1rem;
    font-size: 0.64rem !important;
}

.footer-content .md-copyright,
.footer-content .md-footer__brand,
.footer-content .md-footer__brand a {
    font-family: inherit !important;
    font-size: 12px !important;
    line-height: 17px !important;
    font-weight: 400 !important;
}

.footer-content .md-footer__brand * {
    font-family: inherit !important;
    font-size: 12px !important;
    line-height: 17px !important;
    font-weight: 400 !important;
}

.md-footer__brand {
    text-align: right;
}

@media screen and (max-width: 44.984375em) {
    .footer-content {
        align-items: flex-start !important;
        flex-direction: column;
    }
    .md-footer__brand {
        text-align: left;
    }
}

/* ==========================================
   2. GLOBAL HEADER LOGO OVERRIDES
   ========================================== */
/* Locks your main header logo image container scale crisp across all views */
.md-header__button.md-logo img,
.zensical-header__logo img,
.header-logo img,
.md-header__logo img,
[class*="header"] a img,
[class*="header"] img {
    height: 3rem !important;
    max-height: 48px !important;
    width: auto !important;
    display: inline-block !important;
}

.md-header__button.md-logo {
    display: inline-block !important;
}

.md-header__title,
.zensical-header__title {
    margin-left: 0.375rem;
    width: auto !important;
    justify-content: flex-start !important;
}

/* Keep the logo size while removing the theme's extra header whitespace */
.md-header__inner {
    padding: 0 0.15rem !important;
}

.md-header__button.md-logo {
    padding: 0 !important;
    margin: 0 !important;
}

/* Uses the white logo only against the landing page's red background */
body:has(.zensical-landing-wrap) .md-logo img {
    content: url("../images/toto-site-logo-white-med.png") !important;
}

/* ==========================================
   3. SITE NAME & PAGE NAME OVERRIDES (FIXED OVERLAP)
   ========================================== */
/* Keeps the site name and page name layered at the same header position */
.md-header__ellipsis {
    position: relative !important;
    width: 100% !important;
    height: 100% !important;
}

.md-header__topic {
    position: absolute !important;
    left: 0 !important;
    display: flex !important;
    max-width: 100% !important;
}

/* Keeps the site name larger than the current page name */
.md-header__topic:first-child .md-ellipsis {
    font-family: "IBM Plex Sans", sans-serif !important;
    font-size: 1.33rem !important;
    font-weight: 700 !important;
    line-height: 1.2 !important;
}

.md-header__topic:first-child .md-ellipsis::after,
.md-sidebar--primary .md-nav__title::after {
    content: "TM";
    display: inline-block;
    font-size: 0.225em;
    font-weight: 400;
    line-height: 1;
    margin-left: 0;
    vertical-align: super;
}

/* Keeps the current page name visually subordinate */
.md-header__topic[data-md-component="header-topic"] .md-ellipsis {
    font-size: 0.83rem !important;
    font-weight: 500 !important;
    opacity: 0.85 !important;
}

/* Keeps only the site name visible in the home landing header */
body:has(.zensical-landing-wrap) .md-header__topic[data-md-component="header-topic"] {
    display: none !important;
}

/* Keeps the landing-page site name visible while the page scrolls */
body:has(.zensical-landing-wrap) .md-header[hidden] {
    display: block !important;
    transform: none !important;
}

body:has(.zensical-landing-wrap) .md-header__topic:first-child {
    opacity: 1 !important;
    transform: none !important;
    z-index: 0 !important;
    pointer-events: auto !important;
}

body:has(.zensical-landing-wrap) .md-header__inner {
    position: relative !important;
}

body:has(.zensical-landing-wrap) .md-header__title {
    position: absolute !important;
    left: 50% !important;
    top: 0 !important;
    width: auto !important;
    margin: 0 !important;
    transform: translateX(-50%) !important;
}

/* Keep both header names visible on documentation pages while scrolling */
body:not(:has(.zensical-landing-wrap)) .md-header[hidden] {
    display: block !important;
    transform: none !important;
}

body:not(:has(.zensical-landing-wrap)) .md-header__ellipsis {
    display: flex !important;
    align-items: center !important;
    gap: 0.5rem !important;
    width: auto !important;
    justify-content: flex-start !important;
}

body:not(:has(.zensical-landing-wrap)) .md-header__topic {
    position: static !important;
    display: flex !important;
    flex: 0 0 auto !important;
    opacity: 1 !important;
    transform: none !important;
    z-index: 0 !important;
    pointer-events: auto !important;
}

body:not(:has(.zensical-landing-wrap)) .md-header__topic[data-md-component="header-topic"] .md-ellipsis {
    font-size: 15px !important;
}

/* Separates the site and page names on documentation pages only */
body:not(:has(.zensical-landing-wrap)) .md-header__topic[data-md-component="header-topic"] {
    border-left: 1px solid rgba(255, 255, 255, 0.3) !important;
    padding-left: 0.5rem !important;
}

/* ==========================================
   4. HERO LAYOUT STYLES
   ========================================== */
.zensical-hero {
    text-align: center !important;
    padding: 3.5rem 1.5rem 3rem !important;
    max-width: 760px;
    margin: 0 auto;
}

.hero-eyebrow {
    font-size: 13px !important;
}

.zensical-hero h1 {
    font-size: 48px !important;
    line-height: 1.2 !important;
    font-weight: 700 !important;
    margin: 0.75rem 0 !important;
    letter-spacing: normal !important;
    color: #ffffff !important;
}

.hero-tagline {
    font-size: 18px !important;
    color: rgba(255, 255, 255, 0.85) !important;
    line-height: 1.5 !important;
    margin-bottom: 1.75rem !important;
}

/* --- CTA Buttons --- */
.hero-cta-group {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    flex-wrap: wrap;
}

.hero-cta-group a {
    padding: 0.5rem 1.65rem !important;
    font-weight: 700 !important;
    border-radius: 4px !important;
    transition: all 0.2s ease-in-out !important;
    text-decoration: none !important;
    font-size: 13px !important;
    display: inline-block;
}

.hero-cta-group a.btn-primary {
    background-color: #111111 !important;
    color: #ffffff !important;
    box-shadow: 0 4px 14px rgba(0,0,0,0.12) !important;
}
.hero-cta-group a.btn-primary:hover {
    background-color: #2d3748 !important;
    transform: translateY(-2px);
}

.hero-cta-group a.btn-secondary {
    border: 1px solid #cbd5e0 !important;
    background-color: #ffffff !important;
    color: #2d3748 !important;
}

/* ==========================================
   5. LAYOUT FEATURE GRID STRUCTURE
   ========================================== */
.zensical-features {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2.5rem 1.5rem;
    width: 100% !important;
}

.features-grid {
    display: grid !important;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)) !important;
    gap: 1.25rem !important;
    width: 100% !important;
}

.features-grid .feature-card {
    background-color: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
    padding: 1.5rem 1.25rem !important;
    border-radius: 8px !important;
    text-align: left;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05) !important;
    transition: all 0.2s ease-in-out !important;
    box-sizing: border-box !important;
}

.features-grid .feature-card:hover {
    transform: translateY(-4px) !important;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1) !important;
    border-color: #cbd5e0 !important;
}

.features-grid .feature-card h3 {
    margin: 0 0 0.75rem 0 !important;
    font-size: 18px !important;
    color: #111111 !important;
    font-weight: 700 !important;
}

.features-grid .feature-card p {
    margin: 0 !important;
    font-size: 14px !important;
    line-height: 1.5 !important;
    color: #4a5568 !important;
}

/* ==========================================
   6. HOMEPAGE VIEW FRAMEWORK (ISOLATED RED)
   ========================================== */
html:has(.zensical-landing-wrap),
body:has(.zensical-landing-wrap) {
    background-color: #B30B00 !important;
}

:has(.zensical-landing-wrap) .md-container,
:has(.zensical-landing-wrap) .md-main,
:has(.zensical-landing-wrap) .md-content,
:has(.zensical-landing-wrap) .md-content__inner {
    background-color: transparent !important;
    background: transparent !important;
    --md-default-bg-color: #B30B00 !important;
}

html:has(.zensical-landing-wrap) .md-header__title,
html:has(.zensical-landing-wrap) [class*="header__title"] {
    color: #ffffff !important;
}

/* ==========================================
   7. LANDING PAGE ONLY: TRANSPARENT HEADER, UI & FOOTER
   ========================================== */
body:has(.zensical-landing-wrap) .md-header {
    background-color: rgba(0, 0, 0, 0.25) !important;
    backdrop-filter: blur(10px) !important;
    -webkit-backdrop-filter: blur(10px) !important;
}

body:has(.zensical-landing-wrap) {
    --md-primary-fg-color: transparent !important;
    --md-primary-fg-color--dark: transparent !important;
    --md-accent-fg-color: #ffffff !important;
    --md-default-fg-color: #ffffff !important;
    --md-default-fg-color--light: rgba(255, 255, 255, 0.8) !important;
    --md-default-fg-color--lightest: rgba(255, 255, 255, 0.6) !important;
}

body:has(.zensical-landing-wrap) .md-tabs__item--active .md-tabs__link,
body:has(.zensical-landing-wrap) .md-tabs__link--active,
body:has(.zensical-landing-wrap) .md-tabs__item {
    border-bottom-color: #ffffff !important;
}

body:has(.zensical-landing-wrap) .md-search__icon[for="__search"],
body:has(.zensical-landing-wrap) .md-search__form label.md-search__icon svg,
body:has(.zensical-landing-wrap) .md-search__inner svg path {
    fill: #ffffff !important;
    color: #ffffff !important;
    opacity: 1 !important;
}
body:has(.zensical-landing-wrap) .md-search__input::placeholder {
    color: rgba(255, 255, 255, 0.7) !important;
    -webkit-text-fill-color: rgba(255, 255, 255, 0.7) !important;
}
body:has(.zensical-landing-wrap) .md-search__input {
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
}

body:has(.zensical-landing-wrap) .md-footer,
body:has(.zensical-landing-wrap) .md-footer-meta {
    background-color: rgba(0, 0, 0, 0.25) !important;
    border-top: 1px solid rgba(255, 255, 255, 0.1) !important;
}
body:has(.zensical-landing-wrap) .md-footer__inner,
body:has(.zensical-landing-wrap) .md-footer-meta__inner {
    background-color: transparent !important;
}
body:has(.zensical-landing-wrap) .md-footer,
body:has(.zensical-landing-wrap) .md-footer__link,
body:has(.zensical-landing-wrap) .md-footer__title,
body:has(.zensical-landing-wrap) .md-footer-meta,
body:has(.zensical-landing-wrap) .md-footer-meta__inner,
body:has(.zensical-landing-wrap) .md-tabs__link,
body:has(.zensical-landing-wrap) .md-nav__link,
body:has(.zensical-landing-wrap) .md-header__button {
    color: #ffffff !important;
}
body:has(.zensical-landing-wrap) .md-footer__direction {
    color: rgba(255, 255, 255, 0.6) !important;
}

/* Keep named top navigation visible above narrow-mobile widths */
@media screen and (min-width: 45em) {
    .md-tabs {
        display: block !important;
    }

    .md-header__button[for="__drawer"] {
        display: none !important;
    }
}

body:not(:has(.zensical-landing-wrap)) .md-tabs {
    background-color: #ffffff !important;
    color: #111111 !important;
    opacity: 1 !important;
    position: relative !important;
    z-index: 5 !important;
}

body:not(:has(.zensical-landing-wrap)) .md-tabs__link {
    color: #111111 !important;
    opacity: 1 !important;
}

/* ==========================================
   8. SIDEBAR VISIBILITY BY PAGE TYPE
   ========================================== */
/* Documentation navigation styling inspired by Zensical's restrained rails */
body:not(:has(.zensical-landing-wrap)) .md-sidebar--primary {
    border-right: 1px solid rgba(25, 25, 25, 0.1);
    padding-right: 1rem !important;
}

body:not(:has(.zensical-landing-wrap)) .md-sidebar--secondary {
    border-left: 1px solid rgba(25, 25, 25, 0.1);
    padding-left: 1rem !important;
}

body:not(:has(.zensical-landing-wrap)) .md-nav__title {
    font-family: "IBM Plex Sans", sans-serif !important;
    min-height: 2rem;
    padding: 0 0.75rem 0.6rem !important;
    color: rgba(25, 25, 25, 0.55) !important;
    font-size: 0.7rem !important;
    font-weight: 700 !important;
    letter-spacing: 0.08em;
    line-height: 1.3 !important;
    text-transform: uppercase;
}

body:not(:has(.zensical-landing-wrap)) .md-sidebar--primary .md-nav--primary > .md-nav__title {
    display: none !important;
}

body:not(:has(.zensical-landing-wrap)) .md-sidebar--primary .md-nav__link,
body:not(:has(.zensical-landing-wrap)) .md-sidebar--secondary .md-nav__link {
    border-radius: 0.35rem;
    color: rgba(25, 25, 25, 0.68) !important;
    font-size: 14px !important;
    line-height: 1.35 !important;
    margin: 0.12rem 0;
    padding: 0.45rem 0.75rem !important;
    transition: background-color 0.2s ease, color 0.2s ease;
}

body:not(:has(.zensical-landing-wrap)) .md-sidebar--primary .md-nav__link:hover,
body:not(:has(.zensical-landing-wrap)) .md-sidebar--secondary .md-nav__link:hover {
    background-color: rgba(25, 25, 25, 0.06) !important;
    color: #111111 !important;
}

body:not(:has(.zensical-landing-wrap)) .md-sidebar--primary .md-nav__link--active {
    background-color: rgba(198, 74, 36, 0.12) !important;
    color: #a23b1f !important;
    font-weight: 700 !important;
}

body:not(:has(.zensical-landing-wrap)) .md-sidebar--secondary .md-nav__link {
    border-left: 2px solid transparent;
    border-radius: 0;
    color: rgba(25, 25, 25, 0.52) !important;
    font-size: 0.72rem !important;
    padding: 0.3rem 0.65rem !important;
}

body:not(:has(.zensical-landing-wrap)) .md-sidebar--secondary .md-nav__link--active {
    border-left-color: #c64a24;
    color: #a23b1f !important;
}

body:has(.zensical-landing-wrap) .md-sidebar,
body:has(.zensical-landing-wrap) [data-md-component="sidebar"] {
    display: none !important;
}

body:not(:has(.zensical-landing-wrap)) .md-sidebar,
body:not(:has(.zensical-landing-wrap)) [data-md-component="sidebar"],
body:not(:has(.zensical-landing-wrap)) .md-sidebar--primary,
body:not(:has(.zensical-landing-wrap)) .md-sidebar--secondary {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    position: sticky !important;
    top: 4.8rem !important;
    right: auto !important;
    bottom: auto !important;
    left: auto !important;
    transform: none !important;
    height: auto !important;
    width: 12.1rem !important;
    flex: 0 0 12.1rem !important;
}

body:not(:has(.zensical-landing-wrap)) .md-sidebar--secondary {
    order: 2 !important;
    padding: 1.1rem 0 !important;
}

@media screen and (min-width: 45em) {
    body:not(:has(.zensical-landing-wrap)) .md-sidebar--primary .md-sidebar__scrollwrap,
    body:not(:has(.zensical-landing-wrap)) .md-sidebar--primary .md-sidebar__inner,
    body:not(:has(.zensical-landing-wrap)) .md-sidebar--secondary .md-sidebar__scrollwrap,
    body:not(:has(.zensical-landing-wrap)) .md-sidebar--secondary .md-sidebar__inner {
        position: static !important;
        width: auto !important;
        height: auto !important;
        max-height: none !important;
        overflow: visible !important;
        opacity: 1 !important;
        pointer-events: auto !important;
        transform: none !important;
    }
}



