/* ─── WM Training Diary — Public Styles ─── */

/* ─── Archive Container ─── */

.wmtd-archive {
    max-width: 100%;
    margin: 0 auto;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, sans-serif;
}

.wmtd-archive-page-wrap {
    max-width: 1200px;
    margin: 40px auto;
    padding: 0 20px;
}

/* ─── Discipline Filter Pills ─── */

.wmtd-archive-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 32px;
    padding-bottom: 24px;
    border-bottom: 1px solid #e0e0e0;
    justify-content: center;
}

.wmtd-filter-pill {
    padding: 8px 20px;
    border: 1.5px solid #d0d0d0;
    border-radius: 24px;
    background: #fff;
    color: #555;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
}

.wmtd-filter-pill:hover {
    border-color: var(--disc-color, #999);
    color: var(--disc-color, #333);
}

.wmtd-filter-pill.active {
    background: var(--disc-color, #333);
    border-color: var(--disc-color, #333);
    color: #fff;
}

/* ─── Month Groups ─── */

.wmtd-month-group {
    margin-bottom: 32px;
}

.wmtd-month-heading {
    font-size: 26px;
    font-weight: 700;
    color: #222;
    margin: 0 0 14px 0;
    padding: 0;
    letter-spacing: -0.3px;
}

/* ─── Card Grid ─── */

.wmtd-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
    gap: 10px;
}

/* ─── Cards ─── */

.wmtd-card {
    display: flex;
    flex-direction: column;
    position: relative;
    background: #fff;
    border: 1px solid #e4e4e4;
    border-radius: 8px;
    padding: 14px 16px;
    text-decoration: none;
    color: inherit;
    transition: border-color 0.15s;
    min-height: 60px;
    overflow: hidden;
}

.wmtd-card:hover {
    border-color: #ccc;
}

/* Title */
.wmtd-card-title {
    font-size: 14px;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0 0 4px 0;
    line-height: 1.3;
}

/* Body */
.wmtd-card-body {
    font-size: 13px;
    line-height: 1.4;
    color: #666;
    flex: 1;
}

/* Tags */
.wmtd-card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 8px;
}

.wmtd-card-tag {
    font-size: 11px;
    color: #666;
    font-weight: 500;
    background: #f0f0f0;
    padding: 2px 8px;
    border-radius: 10px;
}

/* Hover overlay — mimics Tumblr's dark overlay with date */
.wmtd-card-hover {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(45, 50, 62, 0.92);
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    padding: 14px 16px;
    opacity: 0;
    transition: opacity 0.15s;
    pointer-events: none;
    border-radius: 7px;
}

.wmtd-card:hover .wmtd-card-hover {
    opacity: 1;
}

.wmtd-card-hover-date {
    font-size: 13px;
    font-weight: 600;
    color: #fff;
}

/* Legacy badge — hidden on public cards, kept for admin */
.wmtd-card-disc {
    display: none;
}

/* ─── Load More ─── */

.wmtd-load-more-wrap {
    text-align: center;
    margin-top: 24px;
}

.wmtd-btn-load-more {
    display: inline-block;
    padding: 10px 28px;
    border: 1.5px solid #d0d0d0;
    border-radius: 20px;
    background: #fff;
    color: #333;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
}

.wmtd-btn-load-more:hover {
    border-color: #999;
    background: #f8f8f8;
}

.wmtd-btn-load-more.loading {
    opacity: 0.5;
    pointer-events: none;
}

/* ─── Empty State ─── */

.wmtd-empty {
    text-align: center;
    color: #999;
    font-size: 15px;
    padding: 60px 20px;
}

/* ─── Single Entry Page ─── */

.wmtd-single-wrap {
    max-width: 680px;
    margin: 40px auto;
    padding: 0 20px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, sans-serif;
}

.wmtd-single-entry {
    background: #fff;
    border: 1px solid #e4e4e4;
    border-radius: 8px;
    padding: 32px;
}

.wmtd-back-link {
    display: inline-block;
    font-size: 13px;
    font-weight: 500;
    color: #555;
    text-decoration: none;
    margin-bottom: 20px;
    padding: 6px 16px;
    border: 1.5px solid #d0d0d0;
    border-radius: 20px;
    background: #fff;
    transition: all 0.15s;
}

.wmtd-back-link:hover {
    border-color: #999;
    color: #333;
    background: #f8f8f8;
}

.wmtd-single-disc {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 700;
    color: #fff;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    margin-bottom: 12px;
}

.wmtd-single-title {
    font-size: 28px;
    font-weight: 800;
    color: #1a1a1a;
    margin: 0 0 8px 0;
    letter-spacing: -0.5px;
    line-height: 1.2;
}

.wmtd-single-date {
    display: block;
    font-size: 14px;
    color: #999;
    margin-bottom: 24px;
    padding-bottom: 20px;
    border-bottom: 1px solid #eee;
}

.wmtd-single-body {
    font-size: 16px;
    line-height: 1.7;
    color: #333;
}

.wmtd-single-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 24px;
    padding-top: 16px;
    border-top: 1px solid #eee;
}

.wmtd-single-tags .wmtd-card-tag {
    font-size: 13px;
    font-weight: 500;
    color: #444;
    background: #f0f0f2;
    padding: 5px 14px;
    border-radius: 16px;
    border: 1px solid #e0e0e4;
}

/* ─── Heatmap (Public) ─── */

.wmtd-heatmap-card {
    background: #fff;
    border: 1px solid #e4e4e4;
    border-radius: 10px;
    padding: 20px 24px;
    margin-bottom: 28px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

.wmtd-heatmap-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.wmtd-heatmap-left { display: flex; align-items: center; gap: 16px; }
.wmtd-heatmap-title { font-size: 15px; font-weight: 700; color: #1a1a1a; }

.wmtd-view-toggle { display: flex; background: #f0f0f2; border-radius: 8px; padding: 2px; }
.wmtd-view-btn { padding: 5px 12px; border: none; border-radius: 6px; background: transparent; font-size: 11px; font-weight: 600; color: #86868b; cursor: pointer; transition: all 0.15s; }
.wmtd-view-btn.active { background: #fff; color: #1a1a1a; box-shadow: 0 1px 3px rgba(0,0,0,0.08); }
.wmtd-view-btn:hover:not(.active) { color: #555; }

.wmtd-heatmap-year-nav { display: flex; align-items: center; gap: 10px; }
.wmtd-heatmap-year-nav button { background: none; border: 1px solid #e0e0e4; border-radius: 6px; padding: 4px 10px; font-size: 12px; color: #86868b; cursor: pointer; }
.wmtd-heatmap-year-nav button:hover { border-color: #999; color: #333; }
.wmtd-heatmap-year-nav button:disabled { opacity: 0.3; cursor: default; }
.wmtd-heatmap-year { font-size: 14px; font-weight: 600; color: #1a1a1a; min-width: 36px; text-align: center; }

.wmtd-hm-view { display: none; }
.wmtd-hm-view.active { display: block; }

.wmtd-streak-wrap { overflow-x: auto; padding-bottom: 4px; }
.wmtd-streak-months { position: relative; height: 16px; padding-left: 28px; margin-bottom: 4px; }
.wmtd-streak-month-label { position: absolute; font-size: 10px; font-weight: 600; color: #86868b; text-transform: uppercase; letter-spacing: 0.3px; }
.wmtd-streak-grid { display: flex; align-items: flex-start; }
.wmtd-streak-days { display: flex; flex-direction: column; gap: 2px; padding-right: 4px; }
.wmtd-streak-day-label { font-size: 9px; color: #aaa; height: 11px; line-height: 11px; text-align: right; width: 24px; }
.wmtd-streak-cols { display: flex; gap: 2px; }
.wmtd-streak-col { display: flex; flex-direction: column; gap: 2px; }
.wmtd-streak-cell { width: 11px; height: 11px; border-radius: 2px; background: #ebedf0; position: relative; cursor: default; }
.wmtd-streak-cell.future { background: #f7f7f9; }
.wmtd-streak-cell[data-tip]:hover::after { content: attr(data-tip); position: absolute; bottom: calc(100% + 6px); left: 50%; transform: translateX(-50%); background: #1d1d1f; color: #fff; font-size: 10px; font-weight: 500; padding: 4px 8px; border-radius: 4px; white-space: nowrap; z-index: 10; pointer-events: none; }
.wmtd-streak-cell[data-tip]:hover::before { content: ''; position: absolute; bottom: calc(100% + 2px); left: 50%; transform: translateX(-50%); border: 4px solid transparent; border-top-color: #1d1d1f; z-index: 10; }

.wmtd-month-grid { display: grid; grid-template-columns: 28px repeat(12, 1fr); }
.wmtd-mg-corner { padding-bottom: 6px; }
.wmtd-mg-month { text-align: center; font-size: 10px; font-weight: 700; color: #86868b; text-transform: uppercase; letter-spacing: 0.3px; padding-bottom: 6px; }
.wmtd-mg-day-label { font-size: 9px; color: #aaa; text-align: right; padding-right: 6px; line-height: 14px; height: 14px; }
.wmtd-mg-cell { width: 100%; max-width: 14px; height: 14px; border-radius: 2px; margin: 1px auto; background: #ebedf0; position: relative; cursor: default; }
.wmtd-mg-cell.empty { background: transparent; }
.wmtd-mg-cell.future { background: #f7f7f9; }
.wmtd-mg-cell[data-tip]:hover::after { content: attr(data-tip); position: absolute; bottom: calc(100% + 6px); left: 50%; transform: translateX(-50%); background: #1d1d1f; color: #fff; font-size: 10px; font-weight: 500; padding: 4px 8px; border-radius: 4px; white-space: nowrap; z-index: 10; pointer-events: none; }
.wmtd-mg-cell[data-tip]:hover::before { content: ''; position: absolute; bottom: calc(100% + 2px); left: 50%; transform: translateX(-50%); border: 4px solid transparent; border-top-color: #1d1d1f; z-index: 10; }

.wmtd-heatmap-footer { display: flex; align-items: center; justify-content: space-between; margin-top: 16px; padding-top: 14px; border-top: 1px solid #f0f0f2; flex-wrap: wrap; gap: 12px; }
.wmtd-hm-legend-left { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.wmtd-hm-legend-item { display: flex; align-items: center; gap: 5px; font-size: 11px; color: #555; font-weight: 500; }
.wmtd-hm-legend-dot { width: 10px; height: 10px; border-radius: 2px; flex-shrink: 0; }
.wmtd-hm-legend-right { display: flex; align-items: center; gap: 3px; font-size: 10px; color: #aaa; }
.wmtd-hm-legend-right span { margin: 0 4px; }
.wmtd-hm-legend-scale { width: 10px; height: 10px; border-radius: 2px; }
.wmtd-heatmap-summary { display: flex; gap: 20px; margin-top: 12px; padding-top: 12px; border-top: 1px solid #f0f0f2; flex-wrap: wrap; }
.wmtd-hm-summary-chip { font-size: 12px; color: #86868b; }
.wmtd-hm-summary-chip strong { color: #1a1a1a; font-weight: 700; }

/* ─── Responsive ─── */

@media (max-width: 600px) {
    .wmtd-card-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 8px;
    }

    .wmtd-card { padding: 10px 12px; }
    .wmtd-card-title { font-size: 13px; }
    .wmtd-card-body { font-size: 12px; }

    .wmtd-archive-filters { gap: 6px; }
    .wmtd-filter-pill { padding: 5px 12px; font-size: 12px; }

    .wmtd-single-entry { padding: 20px; }
    .wmtd-single-title { font-size: 22px; }

    .wmtd-archive-page-wrap { padding: 0 12px; }

    /* Disable hover overlay on touch devices */
    .wmtd-card-hover { display: none; }
    .wmtd-card::after {
        content: attr(data-date);
        display: block;
        font-size: 11px;
        color: #aaa;
        margin-top: 6px;
    }
}
