/* ================================================================
   nd-public.css — Public Area Design System
   Reference: docs/design/clinic1.html + docs/design/PUBLIC_CSS_GUIDE.md
   Namespace: .pub-*
   ================================================================ */

/* ----------------------------------------------------------------
   Design tokens
   ---------------------------------------------------------------- */
:root {
    --pub-teal:        #00A6A0;
    --pub-dark:        #2c3e50;
    --pub-bg:          #F2F5F7;
    --pub-white:       #ffffff;
    --pub-text:        #2c3e50;
    --pub-muted:       #64748b;

    --pub-radius-sm:   8px;
    --pub-radius-md:   24px;
    --pub-radius-lg:   48px;
    --pub-radius-xl:   80px;

    --pub-spacing:     8px;
    --pub-section-pad: 8rem;
    --pub-container:   1400px;

    --pub-font:        "Helvetica Neue", Helvetica, Arial, sans-serif;
    --pub-font-mono:   ui-monospace, "Cascadia Code", "Menlo", monospace;
}

/* ----------------------------------------------------------------
   Page wrapper
   ---------------------------------------------------------------- */
.pub-page {
    background-color: var(--pub-bg);
    color: var(--pub-text);
    font-family: var(--pub-font);
    line-height: 1.5;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* ----------------------------------------------------------------
   Layout — container + grid
   ---------------------------------------------------------------- */
.pub-container {
    max-width: var(--pub-container);
    margin: 0 auto;
    padding: 0 4vw;
}

.pub-grid {
    display: grid;
    gap: 2rem;
}

.pub-grid--2    { grid-template-columns: 1fr 1fr; }
.pub-grid--3    { grid-template-columns: repeat(3, 1fr); }
.pub-grid--4    { grid-template-columns: repeat(4, 1fr); }
.pub-grid--hero { grid-template-columns: 1.2fr 0.8fr; align-items: center; }

/* ----------------------------------------------------------------
   Section
   ---------------------------------------------------------------- */
.pub-section {
    padding: var(--pub-section-pad) 0;
    background-color: var(--pub-bg);
}

.pub-section--white { background-color: var(--pub-white); }

.pub-section--dark {
    background-color: var(--pub-dark);
    color: var(--pub-white);
}

.pub-section--dark h2 { color: var(--pub-white); }

/* ----------------------------------------------------------------
   Typography
   ---------------------------------------------------------------- */
.pub-page h1,
.pub-page h2,
.pub-page h3,
.pub-page h4 {
    font-weight: 800;
    letter-spacing: -0.04em;
    line-height: 1.1;
}

.pub-page h1 {
    font-size: clamp(3rem, 5vw, 6rem);
    color: var(--pub-teal);
}

.pub-page h2 {
    font-size: clamp(2rem, 3vw, 3.5rem);
    color: var(--pub-dark);
}

.pub-page h3 {
    font-size: clamp(1.25rem, 2vw, 1.75rem);
    color: var(--pub-dark);
}

.pub-page h4 {
    font-size: 1rem;
    color: var(--pub-dark);
}

.pub-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 700;
    color: var(--pub-teal);
    margin-bottom: 1rem;
    display: block;
}

.pub-body-lg {
    font-size: 1.25rem;
    color: var(--pub-muted);
    max-width: 500px;
    margin: 2rem 0;
}

.pub-clinical {
    font-family: var(--pub-font-mono);
    font-size: 0.85rem;
    color: var(--pub-muted);
    letter-spacing: -0.02em;
}

.pub-section--dark .pub-clinical {
    color: rgba(255, 255, 255, 0.7);
}

/* ----------------------------------------------------------------
   Navigation
   ---------------------------------------------------------------- */
.pub-nav {
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1050;
    padding: 0;
    background: rgba(242, 245, 247, 0.96) !important;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.06) !important;
    box-shadow: none !important;
}

/* Inner flex container — max-width + horizontal padding */
.pub-nav__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: nowrap;
    gap: 1rem;
    max-width: var(--pub-container);
    margin: 0 auto;
    padding: 0.75rem 2rem;
}

/* Left: logo + desktop links */
.pub-nav__left {
    display: flex;
    align-items: center;
    gap: 2.5rem;
    flex-shrink: 0;
}

/* Logo */
.pub-nav__logo {
    display: flex;
    align-items: center;
    text-decoration: none;
    flex-shrink: 0;
}

/* Desktop nav links (flex row, d-none d-lg-flex via Bootstrap) */
.pub-nav__links {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.pub-nav__link {
    color: var(--pub-dark);
    font-weight: 600;
    font-size: 0.9rem;
    text-decoration: none;
    padding: 0.25rem 0;
    position: relative;
    background: none;
    border: none;
    cursor: pointer;
    transition: color 0.2s;
    line-height: 1.4;
}

.pub-nav__link::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--pub-teal);
    transition: width 0.25s ease;
}

.pub-nav__link:hover { color: var(--pub-teal); }

.pub-nav__link:hover::after,
.pub-nav__link--active::after {
    width: 100%;
}

.pub-nav__link--active { color: var(--pub-teal); }

/* Button-style link (logout) — remove button chrome */
.pub-nav__link--btn {
    padding: 0.25rem 0.1rem;
    display: inline-flex;
    align-items: center;
}

/* Right: auth + language + toggler */
.pub-nav__right {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-shrink: 0;
}

/* Cart badge */
.pub-nav__cart-badge {
    position: absolute;
    top: -6px;
    right: -8px;
    background: #e74c3c;
    color: #fff;
    font-size: 0.65rem;
    font-weight: 700;
    line-height: 1;
    min-width: 16px;
    height: 16px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 3px;
}

/* Language dropdown */
.pub-nav__lang-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.35rem 0.65rem;
    font-size: 0.85rem;
    font-weight: 600;
    background: transparent;
    border: 1px solid rgba(0, 0, 0, 0.14);
    border-radius: var(--pub-radius-sm);
    cursor: pointer;
    color: var(--pub-dark);
    transition: background 0.2s;
    line-height: 1;
}

.pub-nav__lang-btn:hover { background: #e2e8ec; }

.pub-nav__lang-code {
    font-size: 0.8rem;
    letter-spacing: 0.03em;
}

.pub-nav__lang-menu .dropdown-item.active {
    background: rgba(0, 166, 160, 0.1);
    color: var(--pub-teal);
    font-weight: 600;
}

.pub-nav__lang-menu .dropdown-item:hover {
    background: rgba(0, 166, 160, 0.08);
}

/* Hamburger toggler */
.pub-nav__toggler {
    border: 1px solid rgba(0, 0, 0, 0.15);
    border-radius: var(--pub-radius-sm);
    padding: 0.35rem 0.5rem;
}

.pub-nav__toggler:focus { box-shadow: none; }

/* Mobile collapse panel */
.pub-nav__mobile-collapse {
    width: 100%;
    padding: 0.75rem 0 1rem;
    border-top: 1px solid rgba(0, 0, 0, 0.08);
    margin-top: 0.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.pub-nav__mobile-link {
    display: block;
    color: var(--pub-dark);
    font-weight: 600;
    font-size: 0.95rem;
    text-decoration: none;
    padding: 0.55rem 0.5rem;
    border-radius: var(--pub-radius-sm);
    transition: background 0.15s, color 0.15s;
}

.pub-nav__mobile-link:hover {
    background: rgba(0, 166, 160, 0.08);
    color: var(--pub-teal);
}

@media (max-width: 991px) {
    .pub-nav__inner { padding: 0.65rem 1.25rem; }
}

/* ----------------------------------------------------------------
   Hero
   ---------------------------------------------------------------- */
.pub-hero {
    min-height: 100vh;
    padding-top: 9vh;
    padding-bottom: 10vh;
    display: flex;
    align-items: center;
    background-color: var(--pub-bg);
    position: relative;
    overflow: hidden;
}

.pub-hero__text {
    z-index: 2;
}

.pub-hero__cta {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.pub-hero__image-wrap {
    position: relative;
    height: 700px;
    background: #dce4e8;
    border-radius: var(--pub-radius-xl) var(--pub-radius-xl) 0 0;
    overflow: hidden;
}

.pub-hero__image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: grayscale(100%) sepia(20%) hue-rotate(130deg) saturate(150%);
    transition: filter 0.5s ease;
}

.pub-hero__image:hover {
    filter: grayscale(0%);
}

.pub-hero__badge {
    position: absolute;
    bottom: 2rem;
    left: 2rem;
    background: var(--pub-white);
    padding: 1rem 1.5rem;
    border-radius: var(--pub-radius-md);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

.pub-hero__badge-status {
    font-weight: 700;
    color: var(--pub-teal);
    display: block;
}

/* ----------------------------------------------------------------
   Buttons
   ---------------------------------------------------------------- */
.pub-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 1.25rem 3rem;
    border-radius: var(--pub-radius-lg);
    font-weight: 700;
    font-size: 1rem;
    text-decoration: none;
    transition: all 0.3s ease;
    cursor: pointer;
    border: none;
    font-family: var(--pub-font);
}

.pub-btn--primary {
    background-color: var(--pub-teal);
    color: var(--pub-white);
    box-shadow: 0 10px 30px -10px rgba(0, 166, 160, 0.4);
}

.pub-btn--primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 20px 40px -10px rgba(0, 166, 160, 0.5);
    color: var(--pub-white);
}

.pub-btn--outline {
    border: 2px solid var(--pub-dark);
    color: var(--pub-dark);
    background: transparent;
}

.pub-btn--outline:hover {
    background: var(--pub-dark);
    color: var(--pub-white);
}

.pub-btn--white {
    background: var(--pub-white);
    color: var(--pub-dark);
}

.pub-btn--white:hover {
    background: var(--pub-bg);
    color: var(--pub-dark);
}

.pub-btn--sm {
    padding: 0.8rem 1.5rem;
    font-size: 0.9rem;
}

/* ----------------------------------------------------------------
   Algorithm / Data card
   ---------------------------------------------------------------- */
.pub-algo-card {
    background: var(--pub-bg);
    padding: 3rem;
    border-radius: var(--pub-radius-md);
}

.pub-algo-card__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 2rem;
}

.pub-data-point {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.pub-data-point span:first-child {
    font-weight: 700;
    color: var(--pub-dark);
}

.pub-data-point span:last-child {
    font-family: var(--pub-font-mono);
    color: var(--pub-teal);
}

.pub-toggle {
    width: 60px;
    height: 32px;
    background: var(--pub-dark);
    border-radius: 32px;
    position: relative;
    flex-shrink: 0;
}

.pub-toggle::after {
    content: '';
    position: absolute;
    left: 2px;
    top: 2px;
    width: 28px;
    height: 28px;
    background: var(--pub-teal);
    border-radius: 50%;
}

/* ----------------------------------------------------------------
   Specialty columns
   ---------------------------------------------------------------- */
.pub-specialty {
    margin-bottom: 4rem;
}

.pub-specialty h3 {
    color: var(--pub-teal);
    margin-bottom: 1rem;
}

/* ----------------------------------------------------------------
   About section — image fill (non-square ratio)
   ---------------------------------------------------------------- */
#about-project .pub-expert-card__img {
    aspect-ratio: auto;
    height: auto;
    width: 100%;
}

/* Body paragraph spacing inside pub sections */
.pub-section p + p {
    margin-top: 1rem;
}

/* Grid top margin variant */
.pub-grid--mt {
    margin-top: 4rem;
}

/* Algorithm section — right specialty column indent */
#algorithm .pub-grid > div:last-child {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding-left: 4rem;
}

/* Algo card disclaimer spacing */
.pub-algo-card .pub-clinical {
    margin-top: 2rem;
}

@media (max-width: 1024px) {
    #algorithm .pub-grid > div:last-child {
        padding-left: 0;
    }
}

/* ----------------------------------------------------------------
   Product grid
   ---------------------------------------------------------------- */
.pub-product-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.pub-product-card {
    background: var(--pub-dark);
    padding: 4rem 2rem;
    text-align: center;
    transition: background 0.3s;
}

.pub-product-card:hover {
    background: #34495e;
}

.pub-product-card h3 { color: var(--pub-white); margin-bottom: 0.5rem; }

.pub-bottle {
    width: 120px;
    height: 180px;
    background: var(--pub-teal);
    margin: 0 auto 2rem;
    border-radius: 40px 40px 20px 20px;
    position: relative;
    box-shadow:
        inset 10px 0 20px rgba(0, 0, 0, 0.1),
        inset -10px 0 20px rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
}

.pub-bottle::before {
    content: '';
    position: absolute;
    top: -20px;
    width: 100px;
    height: 30px;
    background: var(--pub-teal);
    border-radius: 10px 10px 0 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.pub-bottle__text {
    color: rgba(0, 0, 0, 0.2);
    font-weight: 900;
    font-size: 1.2rem;
    transform: rotate(-90deg);
    white-space: nowrap;
}

/* ----------------------------------------------------------------
   Values section (memorandum CTA)
   ---------------------------------------------------------------- */
.pub-values {
    text-align: center;
}

.pub-values .pub-label,
.pub-values h2 {
    display: block;
    text-align: center;
}

.pub-values .pub-body-lg {
    max-width: 560px;
    margin: 1.5rem auto 2.5rem;
}

/* ----------------------------------------------------------------
   Memorandum modal
   ---------------------------------------------------------------- */
.pub-memo {
    border-radius: var(--pub-radius-sm);
    border-top: 3px solid var(--pub-teal);
}

.pub-memo__header {
    background: var(--pub-bg);
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.pub-memo__title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--pub-dark);
}

.pub-memo__body {
    font-family: var(--pub-font);
    color: var(--pub-text);
    line-height: 1.7;
    padding: 2rem;
}

.pub-memo__body p {
    margin-bottom: 1rem;
}

.pub-memo__doc-title {
    font-size: 1rem;
    font-weight: 800;
    color: var(--pub-dark);
    text-align: center;
    margin-bottom: 1.5rem;
    line-height: 1.4;
}

.pub-memo__subheading {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--pub-teal);
    margin: 2rem 0 1rem;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.pub-memo__list {
    padding-left: 1.5rem;
    margin-bottom: 1rem;
}

.pub-memo__list li {
    margin-bottom: 0.75rem;
}

.pub-memo__list li p {
    margin-bottom: 0;
}

.pub-memo__footer {
    border-top: 1px solid rgba(0, 0, 0, 0.08);
    background: var(--pub-bg);
}

/* ----------------------------------------------------------------
   Castaldo section
   ---------------------------------------------------------------- */
.pub-castaldo__grid {
    grid-template-columns: 1.1fr 0.9fr;
    gap: 5rem;
    margin-top: 3rem;
    align-items: start;
}

.pub-castaldo__text p {
    color: var(--pub-text);
    line-height: 1.7;
    margin-bottom: 1.25rem;
}

.pub-castaldo__book {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.pub-castaldo__book-img {
    width: 100%;
    max-height: 320px;
    object-fit: contain;
    border-radius: var(--pub-radius-md);
    background: var(--pub-bg);
    padding: 1.5rem;
}

.pub-castaldo__book .pub-clinical {
    line-height: 1.7;
}

.pub-castaldo__signature {
    text-align: right;
    color: var(--pub-dark);
    margin: 0;
}

@media (max-width: 1024px) {
    .pub-castaldo__grid {
        grid-template-columns: 1fr;
        gap: 3rem;
    }
}

/* ----------------------------------------------------------------
   Fibromyalgia section
   ---------------------------------------------------------------- */
.pub-fibro__intro {
    max-width: 760px;
    margin: 2rem 0 4rem;
}

.pub-fibro__intro .pub-body-lg {
    max-width: 100%;
}

.pub-fibro__subheading {
    color: var(--pub-teal);
    margin-bottom: 2rem;
}

.pub-fibro__videos {
    margin-bottom: 4rem;
}

.pub-video-wrap {
    border-radius: var(--pub-radius-md);
    overflow: hidden;
    background: var(--pub-dark);
}

.pub-video-wrap video {
    width: 100%;
    display: block;
    aspect-ratio: 16 / 9;
    object-fit: contain;
}

.pub-video-wrap__caption {
    text-align: center;
    padding: 0.75rem 1rem;
    color: rgba(255, 255, 255, 0.7);
    background: var(--pub-dark);
    margin: 0;
}

.pub-fibro__book {
    border-top: 1px solid rgba(0, 0, 0, 0.08);
    padding-top: 3rem;
}

.pub-fibro__book h3 {
    color: var(--pub-teal);
    margin-bottom: 1rem;
}

.pub-fibro__book p {
    color: var(--pub-muted);
    margin-bottom: 1.5rem;
}

/* ----------------------------------------------------------------
   Products section header + CTA
   ---------------------------------------------------------------- */
.pub-products-header {
    text-align: center;
    margin-bottom: 4rem;
}

.pub-products-cta {
    text-align: center;
    margin-top: 4rem;
}

/* ----------------------------------------------------------------
   Expert / Team card
   ---------------------------------------------------------------- */
.pub-expert-card {
    text-align: left;
}

.pub-expert-card__img {
    width: 100%;
    aspect-ratio: 1;
    object-fit: contain;
    border-radius: var(--pub-radius-md);
    margin-bottom: 1.5rem;
    background: #ddd;
    display: block;
}

.pub-expert-card__role {
    color: var(--pub-teal);
    font-weight: 700;
    font-size: 0.8rem;
    text-transform: uppercase;
    margin-bottom: 0.5rem;
}

.pub-expert-card__social {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-top: 1rem;
    width: 36px;
    height: 36px;
    border-radius: var(--pub-radius-sm);
    background: var(--pub-bg);
    color: var(--pub-dark);
    font-size: 1rem;
    text-decoration: none;
    transition: background 0.2s, color 0.2s;
}

.pub-expert-card__social:hover {
    background: var(--pub-teal);
    color: var(--pub-white);
}

/* Team section heading spacing */
.pub-team__heading {
    margin-bottom: 3rem;
}

/* Expert card bio spacing */
.pub-expert-card .pub-clinical {
    margin-top: 0.5rem;
}

/* ----------------------------------------------------------------
   Footer
   ---------------------------------------------------------------- */
.pub-footer {
    background: var(--pub-white);
    padding: 4rem 0;
    border-top: 1px solid #e0e0e0;
}

.pub-footer__grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 2rem;
}

.pub-footer__logo {
    color: var(--pub-teal);
    font-weight: 900;
    font-size: 1.5rem;
    margin-bottom: 1rem;
    display: block;
}

.pub-footer__col h4 {
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
    color: var(--pub-text);
    font-weight: 700;
}

.pub-footer__col ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.pub-footer__col ul li {
    margin-bottom: 0.8rem;
}

.pub-footer__col ul li a {
    color: var(--pub-muted);
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.2s;
}

.pub-footer__col ul li a:hover {
    color: var(--pub-teal);
}

.pub-footer__bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid #eee;
    margin-top: 4rem;
    padding-top: 2rem;
}

/* ----------------------------------------------------------------
   Responsive breakpoints
   ---------------------------------------------------------------- */
@media (max-width: 1024px) {
    .pub-grid--hero {
        grid-template-columns: 1fr;
    }

    .pub-hero__image-wrap {
        height: 500px;
        order: -1;
    }

    .pub-grid--3 {
        grid-template-columns: 1fr;
    }

    .pub-product-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .pub-footer__grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 575px) {
    .pub-footer__grid {
        grid-template-columns: 1fr;
    }

    .pub-btn {
        width: 100%;
        justify-content: center;
    }

    .pub-body-lg {
        font-size: 1rem;
    }
}
