/*
Theme Name:   FTD Child Theme
Theme URI:    https://istodayaftd.com
Description:  Child theme for Is Today A Follow-Through Day? Built on Twenty Nineteen.
Author:       istodayaftd.com
Template:     twentynineteen
Version:      1.0.0
*/

/* =========================================================
   GOOGLE FONTS
   ========================================================= */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

/* =========================================================
   GLOBAL RESETS & FONTS
   ========================================================= */
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: #f8fafc;
    color: #1e293b;
}

/* Hide default Twenty Nineteen elements we don't need on FTD pages */
.ftd-full-page .site-header,
.ftd-page .site-header,
.ftd-page .site-footer,
.ftd-page #colophon,
.ftd-full-page #colophon,
.ftd-page .entry-header,
.ftd-page .entry-footer,
.ftd-page #comments {
    display: none !important;
}

.ftd-page .site-main {
    padding: 0;
    margin: 0;
}

.ftd-page .entry-content {
    max-width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
}

/* =========================================================
   HERO HEADER
   ========================================================= */
.ftd-hero {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    color: #fff;
    padding: 0;
}

.ftd-hero__inner {
    max-width: 860px;
    margin: 0 auto;
    padding: 40px 24px 0;
}

.ftd-hero__topbar {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.ftd-hero__badge {
    display: inline-flex;
    align-items: center;
    background: #3b82f6;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding: 4px 11px;
    border-radius: 999px;
    margin-bottom: 8px;
}

.ftd-hero__badge--link {
    text-decoration: none !important;
    cursor: pointer;
    transition: background 0.15s, box-shadow 0.15s, transform 0.1s;
    color: #fff !important;
    box-shadow: 0 0 0 rgba(59,130,246,0);
}

.ftd-hero__badge--link:hover {
    background: #2563eb;
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.5);
}

.ftd-hero__title {
    font-size: 28px;
    font-weight: 700;
    margin: 0 0 6px;
    color: #fff;
}

/* "No" state — subtle red tint */
.ftd-hero__title--no {
    color: #fca5a5;
}

/* "Yes" state — bright green, celebratory */
.ftd-hero__title--yes {
    color: #4ade80;
}

.ftd-hero__subtitle {
    font-size: 14px;
    color: #94a3b8;
    margin: 0;
}

/* Right column: chart + button stacked */
.ftd-hero__right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 10px;
    flex-shrink: 0;
}

/* Exposure chart — white background so SVG labels/indicators are visible */
.ftd-hero__chart {
    background: #fff;
    border: none;
    border-radius: 10px;
    padding: 8px 12px;
    text-align: center;
}

.ftd-hero__chart-label {
    font-size: 10px;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 6px;
}

.ftd-hero__chart-img {
    display: block;
    max-height: 75px;
    max-width: 220px;
    width: auto;
    border-radius: 4px;
    background: #fff;
}

/* .ftd-hero__app-link removed — merged into .ftd-hero__badge--link */

/* =========================================================
   COMPACT BOOK REFERENCES (in hero, below stats)
   ========================================================= */
.ftd-hero__inner .ftd-books {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 8px !important;
    margin-top: 12px !important;
    margin-bottom: 0 !important;
    padding: 0 !important;
    list-style: none !important;
}

.ftd-hero__inner .ftd-book {
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    padding: 8px 10px !important;
    background: rgba(255,255,255,0.08) !important;
    border: 1px solid rgba(255,255,255,0.12) !important;
    border-radius: 8px !important;
    text-decoration: none !important;
    box-shadow: none !important;
    color: inherit !important;
}

.ftd-hero__inner .ftd-book:hover {
    background: rgba(255,255,255,0.14) !important;
}

.ftd-hero__inner .ftd-book__icon {
    font-size: 16px !important;
    flex-shrink: 0 !important;
    line-height: 1 !important;
}

.ftd-hero__inner .ftd-book__text {
    display: flex !important;
    flex-direction: column !important;
    flex: 1 !important;
    min-width: 0 !important;
}

.ftd-hero__inner .ftd-book__author {
    font-size: 9px !important;
    color: #94a3b8 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    font-weight: 400 !important;
    text-decoration: none !important;
}

.ftd-hero__inner .ftd-book__title {
    font-size: 10px !important;
    font-weight: 600 !important;
    color: #e2e8f0 !important;
    line-height: 1.3 !important;
    text-decoration: none !important;
    display: -webkit-box !important;
    -webkit-line-clamp: 2 !important;
    -webkit-box-orient: vertical !important;
    overflow: hidden !important;
}

.ftd-hero__inner .ftd-book__link {
    font-size: 9px !important;
    font-weight: 700 !important;
    color: #60a5fa !important;
    white-space: nowrap !important;
    flex-shrink: 0 !important;
    text-decoration: none !important;
    padding-left: 4px !important;
}

/* Status Cards */
.ftd-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-top: 28px;
}

.ftd-stat {
    background: rgba(255,255,255,0.08);
    border-radius: 14px;
    padding: 14px 18px;
}

.ftd-stat__label {
    font-size: 11px;
    color: #94a3b8;
    margin-bottom: 4px;
}

.ftd-stat__value {
    font-size: 22px;
    font-weight: 700;
    color: #fff;
    line-height: 1.2;
}

.ftd-stat__sub {
    font-size: 11px;
    color: #64748b;
    margin-top: 2px;
}

/* Tabs */
.ftd-tabs {
    display: flex;
    gap: 4px;
    margin-top: 28px;
}

.ftd-tab {
    padding: 10px 20px;
    border-radius: 10px 10px 0 0;
    font-size: 14px;
    font-weight: 600;
    color: #64748b;
    text-decoration: none !important;
    cursor: pointer;
    transition: all 0.15s;
    border: none;
    background: transparent;
    font-family: inherit;
}

.ftd-tab:hover {
    color: #fff;
}

.ftd-tab.active {
    background: #f8fafc;
    color: #1e293b;
}

/* =========================================================
   MAIN CONTENT AREA
   ========================================================= */
.ftd-content {
    max-width: 860px;
    margin: 0 auto;
    padding: 32px 24px 60px;
}

.ftd-section {
    display: none;
}

.ftd-section.active {
    display: block;
}

.ftd-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 12px;
}

.ftd-section-title {
    font-size: 18px;
    font-weight: 700;
    color: #1e293b;
    margin: 0;
}

.ftd-x-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: #64748b;
    text-decoration: none !important;
    font-weight: 500;
    transition: color 0.15s;
}

.ftd-x-link:hover {
    color: #1e293b;
}

/* =========================================================
   DAILY LOG — TABLE TRANSFORMED INTO CARDS
   ========================================================= */

/* Hide the default table chrome */
.ftd-page .wp-block-table table {
    border-collapse: separate;
    border-spacing: 0 10px;
    width: 100%;
    background: transparent;
    border: none;
}

.ftd-page .wp-block-table tbody {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.ftd-page .wp-block-table tr {
    display: flex;
    align-items: center;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 14px 18px;
    transition: box-shadow 0.15s, border-color 0.15s;
    position: relative;
}

.ftd-page .wp-block-table tr:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.07);
    border-color: #cbd5e1;
}

.ftd-page .wp-block-table td {
    border: none;
    padding: 0;
    flex: 1;
    font-size: 14px;
    color: #1e293b;
    font-weight: 500;
}

.ftd-page .wp-block-table td a {
    color: #1e293b !important;
    text-decoration: none !important;
    display: block;
}

.ftd-page .wp-block-table td a:hover {
    color: #2563eb !important;
}

/* After-row external link icon */
.ftd-page .wp-block-table tr::after {
    content: "↗";
    font-size: 14px;
    color: #cbd5e1;
    flex-shrink: 0;
    transition: color 0.15s;
}

.ftd-page .wp-block-table tr:hover::after {
    color: #64748b;
}

/* Highlight failed rows */
.ftd-page .wp-block-table tr:has(mark) {
    background: #fef2f2;
    border-color: #fecaca;
}

/* Highlight rows with strong (rally start) */
.ftd-page .wp-block-table tr:has(strong):not(:has(mark)) {
    background: #f0fdf4;
    border-color: #bbf7d0;
}

/* Style inline marks */
.ftd-page .wp-block-table mark {
    background: transparent;
    color: #dc2626;
    font-weight: 600;
    padding: 0;
}

.ftd-page .wp-block-table strong {
    color: #15803d;
    font-weight: 600;
}

/* =========================================================
   PAST RALLIES — LIST TRANSFORMED INTO CARDS
   ========================================================= */
.ftd-page #section-history .wp-block-list,
.ftd-archive-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.ftd-page #section-history .wp-block-list li {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 18px 22px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: box-shadow 0.15s, border-color 0.15s;
}

.ftd-page #section-history .wp-block-list li:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.07);
    border-color: #cbd5e1;
}

.ftd-page #section-history .wp-block-list li a {
    font-size: 14px;
    font-weight: 600;
    color: #1e293b !important;
    text-decoration: none !important;
}

.ftd-page #section-history .wp-block-list li a:hover {
    color: #2563eb !important;
}

.ftd-page #section-history .wp-block-list li::after {
    content: "›";
    font-size: 20px;
    color: #cbd5e1;
    flex-shrink: 0;
}

/* =========================================================
   LEARN SECTION
   ========================================================= */

/* FTD explainer steps */
.ftd-steps {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 36px;
}

.ftd-step {
    border-radius: 14px;
    padding: 18px;
}

.ftd-step--1 { background: #f1f5f9; color: #475569; }
.ftd-step--2 { background: #eff6ff; color: #1d4ed8; }
.ftd-step--3 { background: #f0fdf4; color: #15803d; }

.ftd-step__num {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    opacity: 0.6;
    margin-bottom: 6px;
}

.ftd-step__title {
    font-size: 17px;
    font-weight: 700;
    margin-bottom: 6px;
}

.ftd-step__desc {
    font-size: 13px;
    opacity: 0.8;
    line-height: 1.5;
}

/* YouTube embeds */
.ftd-page #section-learn .wp-block-embed {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    overflow: hidden;
    margin-bottom: 24px;
}

.ftd-page #section-learn .wp-block-embed__wrapper {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    overflow: hidden;
}

.ftd-page #section-learn .wp-block-embed__wrapper iframe {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    border: none;
}

/* =========================================================
   FOOTER
   ========================================================= */
.ftd-footer {
    max-width: 860px;
    margin: 0 auto;
    padding: 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 12px;
    color: #94a3b8;
}

.ftd-footer a {
    color: #64748b !important;
    text-decoration: none !important;
    font-weight: 500;
}

.ftd-footer a:hover {
    color: #1e293b !important;
}

/* =========================================================
   X.COM POST POPUP MODAL
   ========================================================= */
.ftd-modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 99999;
    background: rgba(15, 23, 42, 0.55);
    backdrop-filter: blur(4px);
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.ftd-modal-overlay.active {
    display: flex;
}

.ftd-modal {
    background: #fff;
    border-radius: 16px;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.25);
    overflow: hidden;
    animation: ftd-modal-in 0.18s ease;
}

@keyframes ftd-modal-in {
    from { opacity: 0; transform: translateY(10px) scale(0.97); }
    to   { opacity: 1; transform: translateY(0)   scale(1);    }
}

.ftd-modal__header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 16px 20px;
    background: #0f172a;
    color: #fff;
}

.ftd-modal__header span {
    flex: 1;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.ftd-modal__close {
    background: none;
    border: none;
    color: #94a3b8;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    padding: 0 4px;
    transition: color 0.1s;
}

.ftd-modal__close:hover {
    color: #fff;
}

.ftd-modal__body {
    padding: 20px 20px 12px;
}

.ftd-modal__day {
    font-size: 15px;
    font-weight: 600;
    color: #1e293b;
    margin: 0 0 8px;
    line-height: 1.4;
}

.ftd-modal__note {
    font-size: 12px;
    color: #94a3b8;
    margin: 0;
}

.ftd-modal__footer {
    padding: 12px 20px 20px;
    display: flex;
    gap: 10px;
}

.ftd-modal-overlay .ftd-modal .ftd-modal__footer .ftd-modal__open-btn,
.ftd-modal-overlay .ftd-modal .ftd-modal__footer .ftd-modal__open-btn:visited {
    display: inline-flex !important;
    align-items: center !important;
    gap: 6px !important;
    background: #000 !important;
    color: #fff !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    padding: 10px 20px !important;
    border-radius: 999px !important;
    text-decoration: none !important;
    box-shadow: none !important;
    transition: background 0.15s !important;
    flex: 1 !important;
    justify-content: center !important;
    border: none !important;
    letter-spacing: 0 !important;
    line-height: 1.4 !important;
}

.ftd-modal-overlay .ftd-modal .ftd-modal__footer .ftd-modal__open-btn:hover {
    background: #222 !important;
    color: #fff !important;
}

/* =========================================================
   RESPONSIVE
   ========================================================= */
@media (max-width: 600px) {
    .ftd-stats {
        grid-template-columns: repeat(3, 1fr);
        gap: 8px;
    }

    .ftd-stat {
        padding: 10px 12px;
    }

    .ftd-stat__value {
        font-size: 18px;
    }

    .ftd-steps {
        grid-template-columns: 1fr;
    }

    .ftd-hero__title {
        font-size: 22px;
    }

    .ftd-hero__topbar {
        flex-direction: column;
    }

    .ftd-hero__right {
        flex-direction: row;
        align-items: center;
        width: 100%;
        justify-content: space-between;
    }

    .ftd-hero__chart-img {
        max-height: 50px;
        max-width: 140px;
    }

    .ftd-books {
        grid-template-columns: 1fr;
    }

    .ftd-tabs {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
}
