/**
 * ImproveCareNow-inspired layout (https://www.improvecarenow.org/)
 * Keeps IBDPal palette: primary #9933cc, secondary #cc6600, text #1a1a1a
 */

/* Social icons in brand header (ImproveCareNow-style) */
.site-social__list {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    list-style: none;
    margin: 0;
    padding: 0;
    flex-shrink: 0;
}

.site-social__link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 4px;
    color: #fff;
    text-decoration: none;
    transition: background 0.2s ease, opacity 0.2s ease;
}

.site-social__link:hover {
    background: rgba(255, 255, 255, 0.18);
    color: #fff;
}

.site-social__link--pending {
    opacity: 0.5;
    cursor: default;
}

.site-social__link--pending:hover {
    background: transparent;
    opacity: 0.65;
}

.site-social__svg {
    width: 18px;
    height: 18px;
    display: block;
}

:root {
    --ibd-primary: #9933cc;
    --ibd-secondary: #cc6600;
    --ibd-primary-dark: #7a2a9f;
    --ibd-text: #1a1a1a;
    --ibd-muted: #666666;
    --ibd-bg: #f4f4f4;
    --ibd-surface: #ffffff;
    --ibd-border: #e0e0e0;
    --ibd-content-pad: clamp(1rem, 2.5vw, 2rem);
}

/* Site shell | white content on light gray (ICN-style, not full-page gradient) */
body {
    background: var(--ibd-bg);
    color: var(--ibd-text);
    overflow-x: hidden;
}

.app-container,
.container {
    width: 80%;
    max-width: none;
    margin: 0 auto;
    padding: 0;
    min-height: auto;
}

/* Brand header: logo + IBDPal name + tagline + social */
.header {
    background: var(--ibd-primary);
    margin: 0;
    padding: 0;
    border-bottom: 3px solid var(--ibd-secondary);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.12);
}

.header__inner {
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 0.75rem var(--ibd-content-pad);
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 1.25rem;
    flex-wrap: nowrap;
}

.logo {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 0.85rem;
    text-align: left;
    min-width: 0;
    flex: 0 1 auto;
    margin-right: auto;
}

.header__inner .site-social__list {
    margin-left: auto;
    flex-shrink: 0;
}

.logo-brand {
    display: inline-flex;
    align-items: center;
    text-decoration: none;
    line-height: 0;
    flex-shrink: 0;
}

.logo-img {
    height: 56px;
    width: 56px;
    object-fit: contain;
    display: block;
}

.logo-text {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    min-width: 0;
}

.logo-name {
    margin: 0;
    font-size: clamp(1.75rem, 3vw, 2.15rem);
    font-weight: 700;
    line-height: 1.1;
    text-shadow: none;
    letter-spacing: -0.02em;
}

.logo-name a {
    color: #fff;
    text-decoration: none;
}

.logo-name a:hover {
    text-decoration: underline;
}

.logo .tagline,
.header .tagline {
    margin: 0;
    font-size: clamp(0.95rem, 1.5vw, 1.12rem);
    font-weight: 500;
    color: rgba(255, 255, 255, 0.95);
    line-height: 1.35;
}

.logo .logo-title,
.logo h1 {
    font-size: 1.55rem;
    text-shadow: none;
    margin-bottom: 0;
}

.header-nav {
    display: none;
}

/* Primary horizontal nav (ICN main menu) */
.tab-navigation {
    background: var(--ibd-surface);
    margin: 0;
    border-radius: 0;
    box-shadow: none;
    border-bottom: 1px solid var(--ibd-border);
    position: sticky;
    top: 0;
    z-index: 90;
}

.header,
.tab-navigation {
    width: 100%;
    max-width: 100%;
    margin-left: 0;
    margin-right: 0;
    box-sizing: border-box;
}

/* Full-bleed header/nav inside the 80% site shell */
.app-container > .header,
.app-container > .tab-navigation,
.container > .header,
.container > .tab-navigation {
    width: 100vw;
    max-width: 100vw;
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
}

.tab-container {
    width: 100%;
    max-width: none;
    margin: 0;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0;
    background: transparent;
    border-radius: 0;
    padding: 0 var(--ibd-content-pad);
}

.tab-button {
    padding: 0.95rem 1.1rem;
    font-size: 0.92rem;
    min-width: auto;
    border-bottom: 4px solid transparent;
    border-radius: 0;
}

.tab-button:hover {
    background: rgba(153, 51, 204, 0.06);
    color: var(--ibd-primary);
}

.tab-button.active {
    background: transparent;
    color: var(--ibd-primary);
    border-bottom-color: var(--ibd-primary);
    font-weight: 600;
}

.tab-button.active::after {
    display: none;
}

/* Main content | full width */
.main-content {
    background: var(--ibd-surface);
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 0;
    border-radius: 0;
    box-shadow: none;
}

.tab-content {
    display: none;
    background: var(--ibd-surface);
    border-radius: 0;
    box-shadow: none;
    margin-bottom: 0;
    padding: clamp(1.25rem, 3vw, 2rem) var(--ibd-content-pad) clamp(2rem, 4vw, 3rem);
    min-height: 50vh;
    width: 100%;
    max-width: none;
}

.tab-content.active {
    display: block;
}

.app-subcontent {
    display: none;
}

.app-subcontent.active {
    display: block;
}

/* Hero band (homepage) */
.hero-section {
    background: linear-gradient(180deg, rgba(153, 51, 204, 0.07) 0%, var(--ibd-surface) 85%);
    border-bottom: 1px solid var(--ibd-border);
    padding: clamp(1.5rem, 4vw, 2.5rem) var(--ibd-content-pad);
}

.hero-description,
.hero-tagline {
    max-width: none;
}

.hero-tagline {
    border-left: 4px solid var(--ibd-primary);
    border-right: none;
    border-radius: 0;
    box-shadow: none;
    text-align: left;
    margin-left: 0;
    margin-right: 0;
    max-width: none;
}

/* Article / news post layout (ICN LOOP-style) */
.blogs-section {
    width: 100%;
    max-width: none;
    margin: 0;
    padding-left: var(--ibd-content-pad);
    padding-right: var(--ibd-content-pad);
}

.blog-post {
    width: 100%;
    max-width: none;
    margin: 0 0 2rem;
    padding: clamp(1rem, 3vw, 2rem) 0 clamp(2rem, 4vw, 3rem);
    background: transparent;
    border-radius: 0;
    box-shadow: none;
}

.blog-header {
    border-bottom: none;
    padding-bottom: 0.35rem;
    margin-bottom: 1.25rem;
}

.blog-header--with-thumb .blog-header-thumb {
    border-radius: 4px;
}

.blog-title {
    font-size: clamp(1.65rem, 4vw, 2.15rem);
    color: var(--ibd-text);
    line-height: 1.25;
}

.blog-date {
    font-style: normal;
    font-size: 0.95rem;
    color: var(--ibd-muted);
    font-weight: 500;
}

.blog-date::before {
    content: none;
}

.blog-content {
    font-size: 1.05rem;
}

.blog-content h2 {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--ibd-text);
    margin-top: 2rem;
    margin-bottom: 0.75rem;
    padding-bottom: 0.35rem;
    border-bottom: 2px solid rgba(153, 51, 204, 0.2);
}

.blog-content blockquote,
.icn-pullquote {
    margin: 1.75rem 0;
    padding: 1.15rem 1.25rem 1.15rem 1.5rem;
    border-left: 5px solid var(--ibd-primary);
    background: rgba(153, 51, 204, 0.06);
    font-size: 1.08rem;
    line-height: 1.65;
    color: var(--ibd-text);
    border-radius: 0;
}

.blog-punchline {
    border-radius: 0;
    text-align: left;
    border-left: 5px solid var(--ibd-primary);
}

.icn-related-links {
    margin-top: 2.5rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--ibd-border);
}

.icn-related-links h2 {
    font-size: 1rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--ibd-muted);
    margin-bottom: 0.75rem;
}

.icn-share-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem 1.25rem;
    align-items: center;
    margin-top: 2rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--ibd-border);
    font-size: 0.9rem;
    color: var(--ibd-muted);
}

.icn-share-bar strong {
    color: var(--ibd-text);
}

/* Static / landing pages */
.support-section,
.seo-landing,
.legal-section {
    width: 100%;
    max-width: none;
    margin: 0;
    padding: clamp(1.5rem, 3vw, 2rem) var(--ibd-content-pad) clamp(2.5rem, 5vw, 3.5rem);
}

.support-section h1,
.seo-landing h1 {
    font-size: clamp(1.65rem, 4vw, 2.15rem);
    color: var(--ibd-text);
    text-align: left;
    margin-bottom: 0.75rem;
}

.support-intro {
    font-size: 1.05rem;
    color: var(--ibd-muted);
    line-height: 1.65;
}

.seo-landing__block {
    margin-top: 2rem;
    padding-top: 0;
}

.seo-landing__block h2 {
    font-size: 1.25rem;
    color: var(--ibd-primary);
    border-bottom: 2px solid rgba(153, 51, 204, 0.2);
    padding-bottom: 0.35rem;
    margin-bottom: 0.75rem;
}

/* Blog index cards | ICN “Stay in the LOOP” feed feel */
.blog-index-grid {
    gap: 1rem;
}

.blog-card {
    background: var(--ibd-surface);
    border-radius: 4px;
    border: 1px solid var(--ibd-border);
    border-left: 4px solid var(--ibd-primary);
}

.blog-card:hover {
    border-left-color: var(--ibd-secondary);
}

/* Discovery / feature panels */
.discovery-dashboard__panel {
    border: 1px solid var(--ibd-border);
    border-radius: 4px;
    box-shadow: none;
}

/* Footer | ICN link column style */
.footer {
    background: #2a2a2a;
    padding: 0;
    text-align: left;
    margin-top: 0;
}

.footer-content {
    width: 100%;
    max-width: none;
    margin: 0;
    padding: clamp(2rem, 4vw, 2.75rem) var(--ibd-content-pad);
}

.footer-links {
    justify-content: flex-start;
    gap: 0.5rem 1.5rem;
    margin-bottom: 1.75rem;
}

.footer-link {
    border: none;
    padding: 0;
    border-radius: 0;
    color: #d4b8eb;
    font-size: 0.92rem;
    font-weight: 500;
}

.footer-link:hover {
    background: transparent;
    color: #fff;
    text-decoration: underline;
}

.footer-content strong {
    color: #e8d4f5;
}

.footer-content p {
    font-size: 0.88rem;
    color: #b8b8b8;
}

/* App sub-tabs stay readable under ICN nav */
.app-subtab-navigation {
    margin-left: calc(-1 * var(--ibd-content-pad));
    margin-right: calc(-1 * var(--ibd-content-pad));
    padding-left: var(--ibd-content-pad);
    padding-right: var(--ibd-content-pad);
}

#app .app-subtab-button {
    font-size: 1.1rem;
}

#app .app-deep-links--bar,
#app .app-deep-links--bar a {
    font-size: 1.05rem;
}

/* Privacy / Support as homepage tabs (match other tab panels) */
.tab-content .tab-page-section {
    padding: 0;
    max-width: none;
    margin: 0;
}

.tab-content .legal-section h1,
.tab-content .support-section h1 {
    text-align: left;
    font-size: clamp(1.65rem, 4vw, 2.25rem);
}

.tab-content .legal-section h2,
.tab-content .support-section h2,
.tab-content .support-section h3 {
    text-align: left;
}

.tab-content .support-intro,
.tab-content .last-updated {
    text-align: left;
}

/* Homepage sections | use horizontal space */
.discovery-dashboard,
.community-section,
.features-section,
.resources-hub,
.blog-index-grid,
.community-layout {
    width: 100%;
    max-width: none;
}

@media (max-width: 768px) {
    .tab-container {
        justify-content: center;
    }

    .tab-button {
        padding: 0.75rem 0.85rem;
        font-size: 0.85rem;
    }

    .header__inner {
        flex-wrap: wrap;
        align-items: center;
    }

    .logo {
        flex: 1 1 auto;
        margin-right: 0;
    }

    .header__inner .site-social__list {
        margin-left: auto;
    }

    .logo-img {
        height: 44px;
        width: 44px;
    }
}
