/* ============================================
   Published Essays Page Styles
   ============================================ */

.published-page {
    max-width: 900px;
}

/* Toolbar */
.published-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    gap: 1rem;
}

/* Filter Area */
.published-filters {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.filter-label {
    font-family: var(--font-body);
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--club-text-dark);
}

/* Loop Picker Dropdown */
.loop-picker {
    position: relative;
    display: flex;
    align-items: center;
}

.loop-select {
    font-family: var(--font-body);
    font-size: 0.875rem;
    font-weight: 500;
    padding: 0.5rem 2rem 0.5rem 1rem;
    background: #ffffff;
    border: 1px solid var(--club-border);
    border-radius: var(--radius-md);
    color: var(--club-text-dark);
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    transition: var(--transition-fast);
}

.loop-select:hover {
    border-color: #4b5563;
}

.loop-select:focus {
    outline: none;
    border-color: #4b5563;
    box-shadow: 0 0 0 2px rgba(75, 85, 99, 0.1);
}

.select-arrow {
    position: absolute;
    right: 0.625rem;
    pointer-events: none;
    color: var(--club-text-secondary);
}

/* View Toggle */
.view-toggle {
    display: flex;
    gap: 0.25rem;
    background: var(--club-surface);
    border: 1px solid var(--club-border);
    border-radius: var(--radius-md);
    padding: 0.25rem;
}

.view-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: transparent;
    border: none;
    border-radius: var(--radius-sm);
    color: var(--club-text-secondary);
    cursor: pointer;
    transition: var(--transition-fast);
}

.view-btn:hover {
    color: var(--club-text-dark);
    background: var(--club-border);
}

.view-btn.active {
    background: var(--club-text-dark);
    color: white;
}


/* Essays Grouped Container */
.essays-grouped {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

/* Loop Section */
.loop-section {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.loop-header {
    font-family: var(--font-display);
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--club-text-dark);
    margin: 0;
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
}

.loop-date {
    font-family: var(--font-body);
    font-size: 0.9rem;
    font-weight: 400;
    color: var(--club-text-secondary);
}

/* Essays List */
.essays-list {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.published-card {
    background: var(--club-surface);
    border: 1px solid var(--club-border);
    border-radius: var(--radius-lg);
    padding: 1.75rem;
    transition: var(--transition-smooth);
}

.published-card:hover {
    border-color: var(--club-cream-soft);
    box-shadow: var(--shadow-md);
}

/* Published Header */
.published-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.published-author {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.published-author .author-avatar {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--club-accent), var(--club-accent-dark));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-body);
    font-size: 0.8rem;
    font-weight: 600;
    color: white;
    border: 2px solid transparent;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

/* Author avatar as image (when profile picture exists) */
.published-author img.author-avatar {
    object-fit: cover;
}

/* Clickable Avatar Link Styles */
.author-avatar-link {
    display: block;
    border-radius: 50%;
    transition: transform 0.15s ease;
    flex-shrink: 0;
}

.author-avatar-link:hover {
    transform: scale(1.05);
}

.author-avatar-link:hover .author-avatar {
    border-color: var(--club-accent);
    box-shadow: 0 2px 8px rgba(201, 168, 108, 0.3);
}

.author-name-link {
    text-decoration: none;
    color: inherit;
}

.author-name-link:hover .author-name {
    color: var(--club-accent-dark);
}

.author-info {
    display: flex;
    flex-direction: column;
}

.author-name {
    font-family: var(--font-body);
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--club-text-dark);
}

.publish-date {
    font-family: var(--font-body);
    font-size: 0.8rem;
    color: var(--club-text-secondary);
}

/* Loop Badge */
.loop-badge {
    font-family: var(--font-body);
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.375rem 0.75rem;
    border-radius: var(--radius-pill);
    white-space: nowrap;
    background: #ffffff;
    border: 1px solid #4b5563;
    color: #1f2937;
}

/* Published Content */
.published-title {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 500;
    color: var(--club-text-dark);
    margin: 0 0 0.25rem 0;
    line-height: 1.3;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    transition: color var(--transition-fast);
}

/* External link icon */
.published-title .external-link-icon {
    opacity: 0.35;
    flex-shrink: 0;
    transition: opacity var(--transition-fast);
}

/* Golden title on card hover when URL exists */
.published-card[data-url]:not([data-url=""]):hover .published-title {
    color: var(--club-accent);
}

.published-card[data-url]:not([data-url=""]):hover .published-title .external-link-icon {
    opacity: 0.7;
}

.published-subtitle {
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 400;
    font-style: italic;
    color: var(--club-text-secondary);
    margin: 0 0 1rem 0;
}

.published-excerpt {
    font-family: var(--font-body);
    font-size: 0.95rem;
    color: var(--club-text-secondary);
    line-height: 1.7;
    margin: 0 0 1.25rem 0;
}

/* Published Content wrapper */
.published-content {
    display: block;
}

/* Published Footer */
.published-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 1rem;
    border-top: 1px solid var(--club-border);
}

.published-link {
    font-family: var(--font-body);
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--club-accent);
    text-decoration: none;
    transition: var(--transition-fast);
}

.published-link:hover {
    color: var(--club-accent-dark);
}

.published-stats {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.published-stats .stat {
    font-family: var(--font-body);
    font-size: 0.85rem;
    color: var(--club-text-secondary);
}

/* Comment Toggle */
.comment-toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    user-select: none;
}

.comment-checkbox {
    appearance: none;
    -webkit-appearance: none;
    width: 36px;
    height: 20px;
    background: #e5e7eb;
    border-radius: 10px;
    position: relative;
    cursor: pointer;
    transition: background 0.2s ease;
}

.comment-checkbox::before {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    background: white;
    border-radius: 50%;
    top: 2px;
    left: 2px;
    transition: transform 0.2s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.comment-checkbox:checked {
    background: #10b981;
}

.comment-checkbox:checked::before {
    transform: translateX(16px);
}

.toggle-label {
    font-family: var(--font-body);
    font-size: 0.8rem;
    color: var(--club-text-secondary);
}

.comment-checkbox:checked + .toggle-label {
    color: #10b981;
}

.comment-count {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.85rem;
}

.comment-count svg {
    flex-shrink: 0;
}

/* ============================================
   Expanded View (default card display)
   ============================================ */

.view-expanded .published-card,
.essays-grouped:not(.view-compressed) .published-card {
    display: block;
    cursor: pointer;
}

/* ============================================
   Compressed View
   ============================================ */

.view-compressed .essays-list {
    gap: 0;
    border: 1px solid var(--club-border);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.view-compressed .published-card {
    border-radius: 0;
    border: none;
    border-bottom: 1px solid var(--club-border);
    padding: 0.875rem 1.25rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    cursor: pointer;
}

.view-compressed .published-card:last-child {
    border-bottom: none;
}

.view-compressed .published-card:hover {
    background: #f9fafb;
    box-shadow: none;
}

/* Hide elements in compressed view */
.view-compressed .loop-badge,
.view-compressed .published-excerpt {
    display: none;
}

/* In compressed view, hide footer wrapper but show stats */
.view-compressed .published-footer {
    display: contents;
}

.view-compressed .published-footer .published-link {
    display: none;
}

/* Compressed header - just avatar */
.view-compressed .published-header {
    margin-bottom: 0;
    flex-shrink: 0;
}

.view-compressed .published-author {
    gap: 0.625rem;
}

.view-compressed .published-author .author-avatar {
    width: 32px;
    height: 32px;
    font-size: 0.7rem;
}

.view-compressed .author-info {
    display: flex;
    flex-direction: column;
    min-width: 100px;
}

.view-compressed .author-name {
    font-size: 0.8rem;
}

.view-compressed .publish-date {
    display: block;
    font-size: 0.7rem;
}

/* Compressed content area */
.view-compressed .published-content {
    display: flex;
    flex-direction: column;
    min-width: 0;
    flex: 1;
    gap: 0.125rem;
}

.view-compressed .published-title {
    font-size: 0.95rem;
    margin: 0;
    max-width: 100%;
}

.view-compressed .published-title .external-link-icon {
    width: 12px;
    height: 12px;
}

.view-compressed .published-subtitle {
    font-size: 0.8rem;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-style: normal;
}

/* Compressed stats on right */
.view-compressed .published-stats {
    margin-left: auto;
    margin-bottom: 0;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.view-compressed .comment-checkbox {
    width: 32px;
    height: 18px;
}

.view-compressed .comment-checkbox::before {
    width: 14px;
    height: 14px;
}

.view-compressed .comment-checkbox:checked::before {
    transform: translateX(14px);
}

.view-compressed .toggle-label {
    display: inline;
    font-size: 0.75rem;
}

.view-compressed .comment-count {
    font-size: 0.8rem;
}

/* Responsive */
@media (max-width: 768px) {
    .published-toolbar {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .published-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .published-title {
        font-size: 1.25rem;
    }
    
    .view-compressed .published-card {
        flex-wrap: wrap;
    }
    
}


/* Empty State */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--club-text-secondary);
    font-family: var(--font-body);
    font-size: 1.1rem;
}

/* Disabled Link */
.published-link.disabled {
    color: var(--club-text-secondary);
    cursor: default;
    opacity: 0.6;
}
