/**
 * Condolence Book - Public Styles (NEW GRID DESIGN)
 */

.condolence-book-wrapper {
    max-width: 1200px;
    margin: 0 auto;
    padding: 30px 20px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

/* Grid Header */
.cb-grid-header {
    text-align: center;
    margin-bottom: 40px;
}

.cb-grid-header h2 {
    font-size: 36px;
    color: #1d2327;
    margin: 0 0 30px 0;
    font-weight: 600;
}

/* Controls Section */
.cb-controls {
    display: flex;
    gap: 20px;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 30px;
}

.cb-search-wrapper {
    flex: 1;
    min-width: 280px;
    max-width: 400px;
}

.cb-search-input {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #ddd;
    border-radius: 25px;
    font-size: 15px;
    transition: border-color 0.3s;
}

.cb-search-input:focus {
    outline: none;
    border-color: #2271b1;
}

.cb-filter-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
}

.cb-filter-wrapper label {
    font-weight: 600;
    color: #3c434a;
}

.cb-sort-select {
    padding: 10px 15px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
    background: #fff;
    cursor: pointer;
    transition: border-color 0.3s;
}

.cb-sort-select:focus {
    outline: none;
    border-color: #2271b1;
}

/* Deceased Grid */
.cb-deceased-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 30px;
    margin-bottom: 30px;
}

.cb-deceased-card {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s, box-shadow 0.3s;
    cursor: pointer;
}

.cb-deceased-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.cb-card-image {
    position: relative;
    padding-top: 100%; /* 1:1 Aspect Ratio */
    overflow: hidden;
    background: #f5f5f5;
}

.cb-card-image img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.cb-no-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.cb-card-content {
    padding: 20px;
}

.cb-card-name {
    font-size: 20px;
    font-weight: 600;
    color: #1d2327;
    margin: 0 0 8px 0;
    line-height: 1.3;
}

.cb-card-dates {
    font-size: 14px;
    color: #666;
    margin: 0 0 8px 0;
}

.cb-card-death-date {
    font-size: 13px;
    color: #757575;
    margin: 0 0 8px 0;
}

.cb-card-location {
    font-size: 13px;
    color: #757575;
    margin: 0 0 15px 0;
}

.cb-card-button {
    display: block;
    width: 100%;
    padding: 12px;
    background: #2271b1;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s;
    text-align: center;
    text-decoration: none;
    box-sizing: border-box;
}

.cb-card-button:hover {
    background: #135e96;
    color: #fff;
}

.cb-no-results,
.cb-no-search-results {
    text-align: center;
    padding: 40px 20px;
    color: #666;
    font-size: 16px;
}

/* Detail View */
.cb-detail-view {
    max-width: 900px;
}

.cb-back-button {
    display: inline-block;
    margin-bottom: 20px;
    color: #2271b1;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s;
}

.cb-back-button:hover {
    color: #135e96;
}

.cb-detail-header {
    display: flex;
    gap: 30px;
    margin-bottom: 40px;
    padding: 30px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.cb-detail-photo {
    flex-shrink: 0;
}

.cb-detail-photo img {
    width: 250px;
    height: 250px;
    object-fit: cover;
    border-radius: 12px;
}

.cb-detail-info h1 {
    margin: 0 0 15px 0;
    font-size: 32px;
    color: #1d2327;
}

.cb-detail-dates {
    font-size: 16px;
    color: #666;
    margin: 0 0 10px 0;
}

.cb-detail-location {
    font-size: 15px;
    color: #757575;
    margin: 0 0 10px 0;
}

.cb-detail-age {
    font-size: 15px;
    color: #3c434a;
    margin: 0 0 20px 0;
}

.cb-detail-age strong {
    color: #1d2327;
}

.cb-detail-biography,
.cb-detail-other-info,
.cb-detail-bereaved-info,
.cb-detail-relatives-info {
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px solid #e0e0e0;
    line-height: 1.7;
    color: #3c434a;
}

.cb-detail-biography:first-of-type,
.cb-detail-other-info:first-of-type {
    border-top: none;
    padding-top: 0;
}

.cb-detail-biography h3,
.cb-detail-other-info h3,
.cb-detail-bereaved-info h3,
.cb-detail-relatives-info h3 {
    font-size: 20px;
    color: #1d2327;
    margin: 0 0 15px 0;
    font-weight: 600;
}

.cb-detail-biography p,
.cb-detail-other-info p,
.cb-detail-bereaved-info p,
.cb-detail-relatives-info p {
    margin: 0 0 12px 0;
}

/* Access & Condolence Sections */
.cb-access-section,
.cb-condolence-section,
.cb-condolences-section {
    background: #fff;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    margin-bottom: 30px;
}

.cb-access-section h2,
.cb-condolence-section h2,
.cb-condolences-section h2 {
    margin-top: 0;
    color: #1d2327;
    font-size: 24px;
    margin-bottom: 15px;
}

.cb-access-section > p,
.cb-condolence-section > p {
    color: #666;
    margin-bottom: 25px;
}

/* Moderation Notice */
.cb-moderation-notice {
    background: #e7f3ff;
    border-left: 4px solid #2271b1;
    padding: 15px 20px;
    margin: 20px 0;
    border-radius: 6px;
}

.cb-moderation-notice p {
    margin: 0;
    color: #1d2327;
    font-size: 14px;
    line-height: 1.6;
}

/* Form Styles */
.cb-form {
    width: 100%;
}

.cb-form-group {
    margin-bottom: 20px;
}

.cb-form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
    font-size: 14px;
}

.cb-form-group .required {
    color: #d63638;
}

.cb-form-group input[type="text"],
.cb-form-group input[type="email"],
.cb-form-group textarea {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 15px;
    font-family: inherit;
    transition: border-color 0.3s;
    box-sizing: border-box;
}

.cb-form-group input:focus,
.cb-form-group textarea:focus {
    outline: none;
    border-color: #2271b1;
}

.cb-form-group textarea {
    resize: vertical;
    min-height: 150px;
}

/* GDPR Notice */
.cb-gdpr-notice {
    background: #f0f6fc;
    border: 2px solid #c3dcf3;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 20px;
    display: flex;
    gap: 12px;
}

.cb-gdpr-notice input[type="checkbox"] {
    flex-shrink: 0;
    margin-top: 3px;
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.cb-gdpr-notice label {
    font-size: 13px;
    color: #1d2327;
    line-height: 1.6;
    cursor: pointer;
}

.cb-form-actions {
    margin-top: 20px;
}

.cb-button {
    padding: 14px 28px;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s, transform 0.2s;
}

.cb-button-primary {
    background-color: #2271b1;
    color: #fff;
}

.cb-button-primary:hover {
    background-color: #135e96;
    transform: translateY(-1px);
}

.cb-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

/* Message Styles */
.cb-message {
    margin-top: 20px;
    padding: 15px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
}

.cb-message-success {
    background-color: #d5f4e6;
    color: #0a6e31;
    border-left: 4px solid #00a32a;
}

.cb-message-error {
    background-color: #fce8e9;
    color: #8b0000;
    border-left: 4px solid #d63638;
}

/* Condolences List */
.cb-condolence-count {
    color: #757575;
    font-weight: normal;
    font-size: 20px;
}

.cb-condolences-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.cb-condolence-item {
    padding: 20px;
    background: #f9f9f9;
    border-radius: 10px;
    border-left: 4px solid #2271b1;
}

.cb-condolence-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 12px;
    flex-wrap: wrap;
    gap: 10px;
}

.cb-condolence-author {
    color: #1d2327;
    font-size: 16px;
    font-weight: 600;
}

.cb-condolence-date {
    color: #757575;
    font-size: 13px;
}

.cb-condolence-content {
    color: #3c434a;
    line-height: 1.7;
}

.cb-condolence-content p {
    margin: 0 0 10px 0;
}

.cb-condolence-content p:last-child {
    margin-bottom: 0;
}

.cb-no-condolences {
    text-align: center;
    color: #666;
    font-style: italic;
    padding: 30px 20px;
}

/* Responsive Styles */
@media (max-width: 768px) {
    .condolence-book-wrapper {
        padding: 20px 15px;
    }
    
    .cb-grid-header h2 {
        font-size: 28px;
    }
    
    .cb-controls {
        flex-direction: column;
        align-items: stretch;
    }
    
    .cb-search-wrapper {
        max-width: 100%;
    }
    
    .cb-filter-wrapper {
        justify-content: space-between;
    }
    
    .cb-deceased-grid {
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
        gap: 20px;
    }
    
    .cb-detail-header {
        flex-direction: column;
        padding: 20px;
    }
    
    .cb-detail-photo img {
        width: 100%;
        height: auto;
        max-width: 300px;
        margin: 0 auto;
        display: block;
    }
    
    .cb-detail-info h1 {
        font-size: 26px;
    }
    
    .cb-access-section,
    .cb-condolence-section,
    .cb-condolences-section {
        padding: 20px;
    }
    
    .cb-gdpr-notice {
        flex-direction: column;
    }
    
    .cb-condolence-header {
        flex-direction: column;
        align-items: flex-start;
    }
}

@media (max-width: 480px) {
    .cb-deceased-grid {
        grid-template-columns: 1fr;
    }
    
    .cb-button {
        width: 100%;
    }
}
