.tw-tributes-page { background: #f4f4f9; min-height: 100vh; }
.tw-wrap { max-width: 1200px; margin: 0 auto; padding: 32px 20px; }

/* Header */
.tw-header { margin-bottom: 24px; }
.tw-title { font-size: 28px; font-weight: 500; color: #1a1228; margin-bottom: 4px; }
.tw-subtitle { font-size: 14px; color: #888; }

/* Toolbar */
.tw-toolbar { display: flex; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; }
.tw-search-form { display: flex; align-items: center; gap: 8px; background: #fff; border: 0.5px solid #e0dced; border-radius: 20px; padding: 9px 16px; flex: 1; min-width: 200px; }
.tw-search-form input[type="text"] { border: none; outline: none; background: transparent; font-size: 13px; color: #333; width: 100%; }
.tw-search-form .ti { color: #aaa; font-size: 16px; }
.tw-sort,
.tw-sort-inline {
    margin-right: auto;
    font-size: 13px;
    color: #555;
    background: transparent !important;
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
    cursor: pointer;
    font-family: inherit;
    padding: 0 !important;
    border-radius: 0 !important;
    appearance: auto;
    -webkit-appearance: auto;
}
.tw-sort:hover,
.tw-sort-inline:hover { color: #5b4b8a; }
/* ── Sort pill ── */
.tw-sort-pill {
    margin-left: auto;
    font-size: 12px;
    color: #555;
    background: #fff;
    border: 0.5px solid #e0dced;
    border-radius: 20px;
    padding: 7px 14px;
    outline: none;
    cursor: pointer;
    font-family: inherit;
    flex-shrink: 0;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%23aaa' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 28px;
}
.tw-sort-pill:hover { border-color: #5b4b8a; color: #5b4b8a; }


/* Filters */
.tw-filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.tw-tab {
    font-size: 12px;
    padding: 7px 16px;
    border-radius: 20px;
    border: 0.5px solid #e0dced;
    background: #fff;
    color: #666;
    text-decoration: none;
    transition: all 0.2s;
    white-space: nowrap;
    height: 36px;
    display: inline-flex;
    align-items: center;
    line-height: 1;
}
.tw-tab:hover { background: #f0eef8; color: #5b4b8a; border-color: #c0b8e8; }
.tw-tab-active { background: #5b4b8a !important; border-color: #5b4b8a !important; color: #fff !important; }
.tw-results { font-size: 12px; color: #aaa; margin-bottom: 16px; }

/* Hero */
.tw-hero { display: block; position: relative; border-radius: 16px; overflow: hidden; height: 360px; margin-bottom: 16px; text-decoration: none; }
.tw-hero-img { width: 100%; height: 100%; object-fit: cover; }
.tw-hero-placeholder { width: 100%; height: 100%; background: linear-gradient(135deg,#1a1228,#3d2a1a); }
.tw-hero-overlay { position: absolute; inset: 0; background: linear-gradient(to top, rgba(0,0,0,0.88) 0%, rgba(0,0,0,0.3) 55%, rgba(0,0,0,0.1) 100%); }
.tw-hero-badge { position: absolute; top: 16px; left: 16px; background: rgba(255,255,255,0.15); color: #fff; font-size: 11px; padding: 4px 12px; border-radius: 20px; }
.tw-hero-ann { position: absolute; top: 16px; right: 16px; }
.tw-hero-content { position: absolute; bottom: 0; left: 0; right: 0; padding: 24px; }
.tw-hero-label { font-size: 12px; color: rgba(255,255,255,0.6); margin-bottom: 4px; }
.tw-tributes-page .tw-wrap .tw-hero .tw-hero-content .tw-hero-name,
.tw-hero-name {
    font-size: 28px !important;
    font-weight: 700 !important;
    color: #ffffff !important;
    margin-bottom: 8px;
    line-height: 1.2;
    text-shadow: 0 2px 12px rgba(0,0,0,0.8), 0 1px 4px rgba(0,0,0,0.95) !important;
    letter-spacing: -0.2px;
}
.tw-hero-meta {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}
.tw-hero-meta span {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    color: rgba(255,255,255,0.65);
    background: rgba(255,255,255,0.1);
    padding: 4px 12px;
    border-radius: 20px;
    backdrop-filter: blur(4px);
}
.tw-hero-meta svg { flex-shrink: 0; opacity: 0.8; }
.tw-hero-excerpt { font-size: 13px; color: rgba(255,255,255,0.75); line-height: 1.5; max-width: 600px; }

/* Grid */
.tw-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-bottom: 24px; }
.tw-card { border-radius: 16px; overflow: hidden; text-decoration: none; display: block; transition: transform 0.2s; }
.tw-card:hover { transform: translateY(-3px); }
.tw-card-wide { grid-column: span 2; }
.tw-card-img { position: relative; height: 220px; }
.tw-card-wide .tw-card-img { height: 260px; }
.tw-card-photo { width: 100%; height: 100%; object-fit: cover; }
.tw-card-placeholder { width: 100%; height: 100%; background: linear-gradient(135deg,#1a1228,#2d1f3d); }
.tw-card-overlay { position: absolute; inset: 0; background: linear-gradient(to top, rgba(0,0,0,0.9) 0%, rgba(0,0,0,0.2) 60%, transparent 100%); }
.tw-card-content { position: absolute; bottom: 0; left: 0; right: 0; padding: 14px; }
.tw-card-label { font-size: 11px; color: rgba(255,255,255,0.55); margin-bottom: 3px; }
.tw-tributes-page .tw-grid .tw-card .tw-card-content .tw-card-name,
.tw-card-name {
    font-size: 15px !important;
    font-weight: 600 !important;
    color: #ffffff !important;
    margin-bottom: 7px;
    line-height: 1.3;
    text-shadow: 0 1px 6px rgba(0,0,0,0.8) !important;
}
.tw-card-excerpt { font-size: 12px; color: rgba(255,255,255,0.6); line-height: 1.4; margin-bottom: 8px; }
.tw-card-footer { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 4px; }
.tw-card-meta { font-size: 11px; color: rgba(255,255,255,0.5); display: flex; align-items: center; gap: 4px; }

/* Author strip */
.tw-author-strip,
.tw-card .tw-author-strip,
.tw-grid .tw-author-strip {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    background: #ffffff !important;
    background-color: #ffffff !important;
    padding: 10px 14px !important;
}
.tw-author-name { font-size: 11px; color: #555 !important; }
.tw-author-meta { font-size: 11px; color: #aaa !important; }
.tw-author-left { display: flex; align-items: center; gap: 6px; }
.tw-author-av   { width: 20px !important; height: 20px !important; border-radius: 50% !important; }

/* Create card */
.tw-card-create {
    background: #fff;
    border: 1.5px dashed #d0cce8;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 260px;
    text-decoration: none;
    border-radius: 16px;
    transition: all 0.2s;
}
.tw-card-create:hover {
    background: #f8f7fc;
    border-color: #5b4b8a;
    transform: translateY(-3px);
}
.tw-create-icon {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: #f0eef8;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 12px;
    transition: background 0.2s;
}
.tw-card-create:hover .tw-create-icon { background: #e4e0f4; }
.tw-create-title {
    font-size: 14px;
    font-weight: 600;
    color: #5b4b8a;
    margin-bottom: 5px;
}
.tw-create-sub {
    font-size: 12px;
    color: #b0a8d0;
}

/* Anniversary badges */
.tw-ann { font-family: Roboto, sans-serif; font-size: 12px; font-weight: 400; display: inline-flex; align-items: center; gap: 5px; padding: 4px 10px; border-radius: 20px; }
.tw-ann-today { background: #5b4b8a; color: #fff; }
.tw-ann-upcoming { background: #EEEDFE; color: #534AB7; }
.tw-ann-ago { background: #E1F5EE; color: #0F6E56; }
.tw-dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; display: inline-block; flex-shrink: 0; }
.tw-dot-teal { background: #0F6E56; }

/* Pagination */
.tw-pagination { display: flex; justify-content: center; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.tw-pagination .page-numbers { font-size: 13px; padding: 8px 16px; border-radius: 20px; border: 0.5px solid #e0dced; background: #fff; color: #666; text-decoration: none; }
.tw-pagination .page-numbers.current { background: #5b4b8a; border-color: #5b4b8a; color: #fff; }
.tw-pagination .page-numbers:hover:not(.current) { background: #f0eef8; }

/* Empty state */
.tw-empty { text-align: center; padding: 60px 20px; }
.tw-empty .ti { font-size: 40px; color: #d0cce8; display: block; margin-bottom: 12px; }
.tw-empty p { color: #aaa; font-size: 14px; margin-bottom: 20px; }
.tw-btn-primary { background: #5b4b8a; color: #fff; padding: 11px 26px; border-radius: 20px; text-decoration: none; font-size: 14px; }

/* Responsive */
/* Tablet — 2 columns */
@media (max-width: 768px) {
    .tw-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        grid-auto-flow: dense;
        gap: 10px;
    }

    .tw-grid .tw-card-img,
    .tw-grid .tw-card-photo {
        aspect-ratio: 4 / 5;
        object-fit: cover;
    }

    .tw-grid .tw-card-excerpt {
        display: none;
    }

    .tw-grid .tw-card-name,
    .tw-grid h3 {
        font-size: 14px;
        line-height: 1.25;
    }

    .tw-grid .tw-card-meta {
        font-size: 10px;
    }

    .tw-grid .tw-card-footer {
        font-size: 11px;
        padding: 6px 8px;
    }

    .tw-grid .tw-card-footer img,
    .tw-grid .tw-card-footer .tw-avatar {
        width: 18px;
        height: 18px;
    }

    .tw-grid .tw-card-wide {
        grid-column: span 2;
    }

    .tw-grid .tw-card-wide .tw-card-img,
    .tw-grid .tw-card-wide .tw-card-photo {
        aspect-ratio: 16 / 9;
    }
     /* Hide anniversary badge on all grid cards */
    .tw-grid .tw-ann {
        display: none !important;
    }

    /* Keep it visible on the hero card only */
    .tw-hero .tw-ann {
        display: flex !important;
    }
}

/* Phone — 3 columns, simplified cards */
@media (max-width: 480px) {
    .tw-wrap {
        padding-left: 4px;
        padding-right: 4px;
    }

    .tw-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        grid-auto-flow: dense;
        gap: 4px;
    }
/* Card content always at bottom left */
.tw-grid .tw-card .tw-card-content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 8px;
    background: linear-gradient(to top, rgba(0,0,0,0.75) 0%, transparent 100%);
}
.tw-grid .tw-author-strip {
    display: none !important;
}
.tw-header {
    display: none !important;
}
.tw-toolbar {
    display: none !important;
}
   /* Fix long names — 2 lines max then ellipsis 

.tw-tributes-page .tw-grid .tw-card .tw-card-content .tw-card-name, .tw-card-name {
    font-size: 11px !important;
    font-weight: 600 !important;
    color: #ffffff !important;
    margin-bottom: 7px;
    line-height: 1.3;
    text-shadow: 0 1px 6px rgba(0, 0, 0, 0.8) !important;
}*/

/* Target strictly smartphones (480px width and below) 

    .tw-tributes-page .tw-grid .tw-card .tw-card-content .tw-card-name, 
    .tw-card-name {
        display: block !important;
        width: 100% !important;
        overflow-wrap: break-word;
        word-break: break-word;
        white-space: normal !important;
        font-size: 11px !important;
    font-weight: 600 !important;
    color: #ffffff !important;
    margin-bottom: 2px;
    line-height: 1.3;
    text-shadow: 0 1px 6px rgba(0, 0, 0, 0.8) !important;
    }


.tw-grid .tw-card-meta svg {
    width: 10px;
    height: 10px;
    min-width: 10px;
    display: inline-block;
    vertical-align: middle;
    margin-right: 2px;
}*/

/* Names — 2 lines max, better line height */
.tw-tributes-page .tw-grid .tw-card .tw-card-content .tw-card-name,
.tw-grid .tw-card .tw-card-content h3 {
    line-height: 1.2 !important;
    display: -webkit-box !important;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden !important;
    white-space: normal !important;
    font-size: 11px !important;
    margin-bottom: 4px;
}

/* Icon font size */
.tw-grid .tw-card-meta i {
    font-size: 9px;
    vertical-align: middle;
    margin-right: 2px;
}

/* Meta spans spacing */
.tw-grid .tw-card-meta {
    display: flex;
    flex-direction: column;
    gap: 2px;
    font-size: 9px;
}

.tw-grid .tw-card-meta span {
    display: flex;
    align-items: center;
    gap: 3px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

  .tw-grid .tw-card-meta {
    font-size: 9px;
    display: flex;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
    white-space: normal;
    overflow: visible;
}

.tw-grid .tw-card-meta span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%;
}

    .tw-grid .tw-card-img,
    .tw-grid .tw-card-photo {
        aspect-ratio: 1 / 1;
    }

    .tw-grid .tw-card-wide {
        grid-column: span 3;
    }

    .tw-grid .tw-card-wide .tw-card-img,
    .tw-grid .tw-card-wide .tw-card-photo {
        aspect-ratio: 16 / 9;
    }
    
    .tw-tributes-page {
    padding-left: 8px;
    padding-right: 8px;
    box-sizing: border-box;
    overflow-x: hidden;
}

.tw-wrap {
    padding-left: 8px;
    padding-right: 8px;
}

.tw-card-create {
    min-height: 0;
    height: 100%;
    aspect-ratio: unset;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 8px;
    box-sizing: border-box;
    overflow: hidden;
}


.tw-card-create .tw-create-icon {
    width: 36px;
    height: 36px;
}

.tw-card-create .tw-create-title {
    font-size: 11px;
    text-align: center;
    white-space: normal;
    margin: 0;
}

.tw-card-create .tw-create-sub {
    display: none;
}
}

/* ── Force overrides — BuddyBoss compatibility ── */
.tw-tributes-page h1,
.tw-tributes-page h2,
.tw-tributes-page h3 {
    color: inherit;
}
.tw-hero-content h1,
.tw-hero-content h2 {
    color: #ffffff !important;
    text-shadow: 0 2px 12px rgba(0,0,0,0.8) !important;
}
.tw-card-content h3 {
    color: #ffffff !important;
    text-shadow: 0 1px 6px rgba(0,0,0,0.8) !important;
}
.tw-author-strip {
    background: #ffffff !important;
    background-color: #ffffff !important;
}