/* =============================================
   Everyday Wellbeing — Wellness Journal Design
   ============================================= */

:root {
    --navy:        #1e3a5f;
    --navy-light:  #2c5282;
    --sage:        #5f7a6a;
    --sage-light:  #7f9e8e;
    --sage-pale:   #eaf2ed;
    --blue-muted:  #dce8f5;
    --beige:       #f7f4ef;
    --beige-dark:  #ede8e0;
    --surface:     #ffffff;
    --text-dark:   #1a1a2e;
    --text-body:   #2d2d2d;
    --text-muted:  #5a6472;
    --border:      #dde3ec;
    --border-sage: #b8cebc;
    --warm-amber:  #c4853a;
    --warm-pale:   #fdf6ed;
    --calm-lavender: #e8e4f3;
    --shadow:      0 2px 12px rgba(30,58,95,0.07);
    --radius:      8px;
    --radius-lg:   14px;
}

/* ---- Base ---- */
html { scroll-behavior: smooth; }
body {
    background: var(--beige);
    color: var(--text-body);
    font-family: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    font-size: 1rem;
    line-height: 1.75;
}
section[id], article[id] { scroll-margin-top: 85px; }

h1,h2,h3,h4,h5,h6 {
    color: var(--text-dark);
    font-weight: 700;
    line-height: 1.28;
}
h1 { font-size: clamp(1.85rem, 4vw, 2.7rem); }
h2 { font-size: clamp(1.35rem, 3vw, 1.85rem); }
h3 { font-size: clamp(1.1rem, 2vw, 1.35rem); }
a { color: var(--navy); }
a:hover { color: var(--navy-light); }

/* ---- Navbar ---- */
.site-nav {
    background: var(--surface);
    border-bottom: 2px solid var(--border);
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 1040;
}
.site-nav .navbar-brand {
    font-weight: 800;
    font-size: 1.25rem;
    color: var(--navy) !important;
    letter-spacing: -0.3px;
}
.site-nav .navbar-brand .tagline {
    display: block;
    font-size: 0.68rem;
    font-weight: 400;
    color: var(--text-muted);
    line-height: 1;
    letter-spacing: 0;
}
.site-nav .nav-link {
    font-weight: 600;
    font-size: 0.88rem;
    color: var(--text-dark) !important;
    padding: 0.4rem 0.7rem !important;
    border-radius: var(--radius);
    transition: background 0.15s, color 0.15s;
}
.site-nav .nav-link:hover,
.site-nav .nav-link.active {
    background: var(--sage-pale);
    color: var(--sage) !important;
}
.site-nav .nav-link.active { font-weight: 700; }

/* ---- Breadcrumb ---- */
.breadcrumb-bar {
    background: var(--beige-dark);
    border-bottom: 1px solid var(--border);
    padding: 0.35rem 0;
    font-size: 0.8rem;
}
.breadcrumb-bar .breadcrumb { margin: 0; background: none; padding: 0; }
.breadcrumb-item a { color: var(--navy); text-decoration: none; font-weight: 500; }
.breadcrumb-item.active { color: var(--text-muted); }
.breadcrumb-item + .breadcrumb-item::before { color: var(--text-muted); }

/* ---- Hero ---- */
.hero-section {
    background: var(--surface);
    border-bottom: 2px solid var(--border);
    padding: 3.5rem 0 2.5rem;
}
.wellness-dashboard {
    background: var(--beige);
    border: 2px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.4rem;
    box-shadow: var(--shadow);
}
.dashboard-label {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--text-muted);
    margin-bottom: 0.6rem;
}
.dash-item {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    padding: 0.55rem 0.75rem;
    background: var(--surface);
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 0.5rem;
    font-size: 0.85rem;
    font-weight: 600;
}
.dash-item:last-child { margin-bottom: 0; }
.dash-item .bi { font-size: 1.1rem; }
.dash-item.water  { border-color: #a0c4e8; } .dash-item.water  .bi { color: #3b82c4; }
.dash-item.move   { border-color: var(--border-sage); } .dash-item.move   .bi { color: var(--sage); }
.dash-item.screen { border-color: #c4b8e8; } .dash-item.screen .bi { color: #7c60b8; }
.dash-item.wind   { border-color: #e8c8a0; } .dash-item.wind   .bi { color: var(--warm-amber); }
.dash-item.focus  { border-color: var(--border); } .dash-item.focus  .bi { color: var(--navy); }

/* ---- Wellness Focus Strip ---- */
.focus-strip {
    background: var(--navy);
    padding: 0.65rem 0;
    overflow-x: auto;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}
.focus-strip::-webkit-scrollbar { display: none; }
.focus-strip .container { display: flex; gap: 0.5rem; }
.focus-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.35rem 1rem;
    border-radius: 20px;
    font-size: 0.82rem;
    font-weight: 600;
    color: rgba(255,255,255,0.8);
    background: rgba(255,255,255,0.1);
    border: 1.5px solid rgba(255,255,255,0.18);
    text-decoration: none;
    white-space: nowrap;
    transition: all 0.15s;
    flex-shrink: 0;
}
.focus-chip:hover { background: rgba(255,255,255,0.22); color: #fff; }
.focus-chip.active { background: var(--sage); border-color: var(--sage); color: #fff; }

/* ---- Timeline ---- */
.timeline { position: relative; padding-left: 2.5rem; }
.timeline::before {
    content: '';
    position: absolute;
    left: 0.85rem;
    top: 0; bottom: 0;
    width: 2px;
    background: var(--border);
}
.timeline-item { position: relative; margin-bottom: 1.75rem; }
.timeline-item:last-child { margin-bottom: 0; }
.timeline-dot {
    position: absolute;
    left: -2.5rem;
    top: 0.25rem;
    width: 1.5rem;
    height: 1.5rem;
    border-radius: 50%;
    background: var(--sage);
    border: 3px solid var(--surface);
    box-shadow: 0 0 0 2px var(--sage);
    display: flex;
    align-items: center;
    justify-content: center;
}
.timeline-dot .bi { font-size: 0.65rem; color: #fff; }
.timeline-time {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--sage);
    margin-bottom: 0.2rem;
}
.timeline-item h3, .timeline-item h4 { margin-bottom: 0.3rem; }

/* ---- Content Sections ---- */
.section-eyebrow {
    display: inline-block;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
    margin-bottom: 0.25rem;
}
.section-rule {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}
.section-rule h2 { margin: 0; }
.section-rule::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
}

/* ---- Habit / Content Rows ---- */
.habit-row {
    background: var(--surface);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.75rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow);
}
.habit-row.alt { background: var(--sage-pale); }
.habit-row::before {
    /* top accent line */
}

/* ---- Callout Panels ---- */
.callout {
    border-radius: var(--radius);
    padding: 0.9rem 1.1rem;
    margin: 0.75rem 0;
    border-left: 4px solid;
    font-size: 0.9rem;
}
.callout-try    { background: var(--sage-pale); border-color: var(--sage); }
.callout-easier { background: var(--blue-muted); border-color: #7babd4; }
.callout-avoid  { background: var(--warm-pale); border-color: var(--warm-amber); }
.callout-pro    { background: var(--calm-lavender); border-color: #9b87c8; }
.callout-note   { background: var(--beige-dark); border-color: var(--border); }
.callout-warn   { background: #fff3e0; border-color: #e6872a; }

.callout h5, .callout h6 {
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 0.3rem;
}
.callout-try    h5, .callout-try    h6 { color: var(--sage); }
.callout-easier h5, .callout-easier h6 { color: #2c6eaa; }
.callout-avoid  h5, .callout-avoid  h6 { color: var(--warm-amber); }
.callout-pro    h5, .callout-pro    h6 { color: #6b52a8; }
.callout-warn   h5, .callout-warn   h6 { color: #b05a10; }

/* ---- Numbered Steps ---- */
.steps-list { list-style: none; padding: 0; margin: 0; }
.steps-list li {
    display: flex;
    gap: 0.85rem;
    align-items: flex-start;
    margin-bottom: 0.85rem;
}
.step-n {
    min-width: 1.75rem;
    height: 1.75rem;
    border-radius: 50%;
    background: var(--navy);
    color: #fff;
    font-size: 0.78rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-top: 0.12rem;
}

/* ---- Meta Labels ---- */
.meta-label {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.74rem;
    font-weight: 700;
    padding: 0.18rem 0.6rem;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.label-category { background: var(--sage-pale); color: var(--sage); border: 1px solid var(--border-sage); }
.label-navy     { background: var(--blue-muted); color: var(--navy); border: 1px solid #b0c8e0; }
.label-warm     { background: var(--warm-pale); color: var(--warm-amber); border: 1px solid #e8c88a; }

/* ---- Filter Bar ---- */
.filter-bar {
    background: var(--surface);
    border-bottom: 2px solid var(--border);
    padding: 0.65rem 0;
    position: sticky;
    top: 65px;
    z-index: 900;
    box-shadow: 0 2px 8px rgba(30,58,95,0.05);
}
.filter-chips {
    display: flex;
    gap: 0.35rem;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}
.filter-chips::-webkit-scrollbar { display: none; }
.filter-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.28rem 0.8rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    white-space: nowrap;
    border: 1.5px solid var(--border);
    background: var(--surface);
    color: var(--text-muted);
    text-decoration: none;
    transition: all 0.15s;
}
.filter-chip:hover, .filter-chip.active {
    background: var(--navy);
    border-color: var(--navy);
    color: #fff;
}

/* ---- Balance Sections ---- */
.balance-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}
.balance-card {
    background: var(--surface);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.35rem;
    text-align: center;
    box-shadow: var(--shadow);
}
.balance-card .bi { font-size: 2rem; margin-bottom: 0.5rem; display: block; }
.balance-card h3 { font-size: 1rem; margin-bottom: 0.4rem; }
.balance-card p  { font-size: 0.85rem; color: var(--text-muted); margin: 0; }
.balance-nourish .bi { color: var(--sage); }
.balance-move    .bi { color: var(--navy); }
.balance-rest    .bi { color: var(--warm-amber); }
.balance-reset   .bi { color: #7c60b8; }

/* ---- Weekly Plan ---- */
.week-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 0.5rem;
}
.day-card {
    background: var(--surface);
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    padding: 0.75rem 0.5rem;
    text-align: center;
    font-size: 0.78rem;
}
.day-card .day-name {
    font-weight: 700;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--sage);
    display: block;
    margin-bottom: 0.35rem;
}
.day-card .bi { font-size: 1.2rem; color: var(--navy); display: block; margin-bottom: 0.3rem; }
.day-card p { margin: 0; line-height: 1.3; color: var(--text-body); }

/* ---- Checklist Panel ---- */
.check-list { list-style: none; padding: 0; margin: 0; }
.check-list li {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    padding: 0.3rem 0;
    font-size: 0.9rem;
    border-bottom: 1px solid var(--border);
}
.check-list li:last-child { border-bottom: none; }
.check-list li .bi { color: var(--sage); margin-top: 0.18rem; flex-shrink: 0; }

/* ---- Comparison Table ---- */
.compare-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 0.88rem;
}
.compare-table th {
    background: var(--navy);
    color: #fff;
    padding: 0.65rem 1rem;
    font-weight: 600;
    text-align: left;
}
.compare-table th:first-child { border-radius: var(--radius) 0 0 0; }
.compare-table th:last-child  { border-radius: 0 var(--radius) 0 0; }
.compare-table td {
    padding: 0.6rem 1rem;
    border-bottom: 1px solid var(--border);
    vertical-align: top;
}
.compare-table tr:nth-child(even) td { background: var(--beige); }
.compare-table tr:last-child td:first-child { border-radius: 0 0 0 var(--radius); }
.compare-table tr:last-child td:last-child  { border-radius: 0 0 var(--radius) 0; }

/* ---- Reflection Prompt ---- */
.reflection-prompt {
    background: var(--calm-lavender);
    border: 1.5px solid #c4b8e8;
    border-radius: var(--radius);
    padding: 1rem 1.25rem;
    font-style: italic;
    color: #4a3d7a;
    font-size: 0.9rem;
    margin: 1rem 0;
}
.reflection-prompt::before {
    content: '💭 ';
}

/* ---- Disclaimer Banner ---- */
.disclaimer-bar {
    background: var(--warm-pale);
    border: 1.5px solid #e8c88a;
    border-radius: var(--radius);
    padding: 0.85rem 1.1rem;
    font-size: 0.83rem;
    color: #5a3e10;
}
.disclaimer-bar a { color: #7a4e10; font-weight: 600; }

/* ---- Habit Search ---- */
.search-wrap { position: relative; max-width: 320px; }
.search-wrap .bi {
    position: absolute;
    left: 0.8rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none;
}
#habitSearch {
    padding-left: 2.2rem;
    border-radius: 20px;
    border: 1.5px solid var(--border);
    background: var(--beige);
    font-size: 0.86rem;
}

/* ---- Ad Placeholder ---- */
.ad-placeholder {
    background: var(--beige-dark);
    border: 1px dashed var(--border);
    border-radius: var(--radius);
    padding: 1rem;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.74rem;
    min-height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ---- Footer ---- */
.site-footer {
    background: var(--navy);
    color: #a8b8cc;
    padding: 2.75rem 0 1.25rem;
    margin-top: 4rem;
    border-top: 3px solid var(--sage);
}
.site-footer h5 {
    color: #fff;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 700;
    margin-bottom: 0.8rem;
}
.site-footer a {
    color: #a8b8cc;
    text-decoration: none;
    font-size: 0.86rem;
    display: block;
    padding: 0.16rem 0;
    transition: color 0.15s;
}
.site-footer a:hover { color: #fff; }
.site-footer .footer-note {
    font-size: 0.78rem;
    color: #7a8ea0;
    line-height: 1.6;
}
.site-footer .footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.1);
    padding-top: 1.1rem;
    margin-top: 1.75rem;
    font-size: 0.77rem;
    color: #607080;
}

/* ---- Back to Top ---- */
#backToTop {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    background: var(--navy);
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 2.6rem;
    height: 2.6rem;
    font-size: 1rem;
    display: none;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 2000;
    box-shadow: var(--shadow);
    transition: background 0.15s;
}
#backToTop:hover { background: var(--sage); }
#backToTop.visible { display: flex; }

/* ---- Policy pages ---- */
.policy-section { padding: 1.35rem 0; border-bottom: 1px solid var(--border); }
.policy-section:last-child { border-bottom: none; }

/* ---- About panels ---- */
.about-card {
    background: var(--surface);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.6rem;
    margin-bottom: 1.35rem;
    box-shadow: var(--shadow);
}

/* ---- Habit entry (hidden by filter/search) ---- */
.habit-entry.hidden { display: none; }

/* ---- Print ---- */
@media print {
    .site-nav, .filter-bar, .focus-strip, .site-footer,
    #backToTop, .ad-placeholder, .no-print { display: none !important; }
    body { background: #fff; font-size: 11pt; }
    .habit-row { box-shadow: none; border: 1px solid #ccc; }
    a { color: #000; text-decoration: none; }
}

/* ---- Responsive ---- */
@media (max-width: 767px) {
    .hero-section { padding: 2rem 0 1.5rem; }
    .week-grid { grid-template-columns: repeat(4, 1fr); }
    .timeline { padding-left: 2rem; }
    .timeline::before { left: 0.65rem; }
    .timeline-dot { left: -2rem; }
}
@media (max-width: 479px) {
    .week-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ---- Accessibility ---- */
:focus-visible {
    outline: 3px solid var(--sage);
    outline-offset: 2px;
    border-radius: 3px;
}
