/* Nécrologie Form Styles */

#necrologie-form-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

#necrologie-form {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
}

/* Form Sections */
.form-section {
    margin-bottom: 30px;
    padding: 20px;
    background: #fafafa;
    border-radius: 6px;
    border-left: 4px solid #0073aa;
}

.form-section h3 {
    margin: 0 0 20px 0;
    color: #23282d;
    font-size: 18px;
    font-weight: 600;
}

.section-description {
    color: #666;
    font-size: 14px;
    line-height: 1.5;
    margin-bottom: 20px;
    font-style: italic;
}

.form-section-title {
    font-weight: 600;
    color: #23282d;
    margin: 20px 0 10px 0;
    font-size: 16px;
}

/* Form Layout */
.form-row {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
}

.form-row .form-group {
    flex: 1;
}

.form-group {
    margin-bottom: 20px;
}

.form-group:last-child {
    margin-bottom: 0;
}

/* Labels */
label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: #23282d;
    font-size: 14px;
}

label:after {
    content: "";
}

/* Required field indicator */
label:has(+ input[required]),
label:has(+ textarea[required]),
input[required] + label,
textarea[required] + label {
    position: relative;
}

/* Input Fields */
input[type="text"],
input[type="email"],
input[type="tel"],
input[type="date"],
input[type="time"],
input[type="number"],
textarea,
select {
    width: 100%;
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    box-sizing: border-box;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="tel"]:focus,
input[type="date"]:focus,
input[type="time"]:focus,
input[type="number"]:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: #0073aa;
    box-shadow: 0 0 0 3px rgba(0, 115, 170, 0.1);
}

/* File Input */
input[type="file"] {
    width: 100%;
    padding: 8px;
    border: 2px dashed #ddd;
    border-radius: 4px;
    background: #fafafa;
    cursor: pointer;
    transition: border-color 0.3s ease;
}

input[type="file"]:hover {
    border-color: #0073aa;
}

/* Photo Upload Area */
.photo-upload-area {
    border: 2px dashed #ddd;
    border-radius: 8px;
    padding: 40px 20px;
    text-align: center;
    background: #fafafa;
    transition: border-color 0.3s ease, background-color 0.3s ease;
    position: relative;
}

.photo-upload-area:hover {
    border-color: #0073aa;
    background: #f0f8ff;
}

.photo-upload-area input[type="file"] {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
    border: none;
    background: transparent;
}

.upload-text {
    color: #666;
    font-size: 14px;
    pointer-events: none;
}

/* Rich Editor Styles */
.rich-editor {
    margin-top: 5px;
}

.rich-editor .wp-editor-wrap {
    border: 2px solid #ddd;
    border-radius: 4px;
    overflow: hidden;
}

.rich-editor .wp-editor-wrap:focus-within {
    border-color: #0073aa;
    box-shadow: 0 0 0 3px rgba(0, 115, 170, 0.1);
}

/* Checkbox Group */
.checkbox-group {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.checkbox-group input[type="checkbox"] {
    width: auto;
    margin: 0;
    flex-shrink: 0;
    margin-top: 2px;
}

.checkbox-group label {
    margin: 0;
    font-weight: normal;
    font-size: 14px;
    line-height: 1.4;
    cursor: pointer;
}

/* Textarea */
textarea {
    min-height: 100px;
    resize: vertical;
    font-family: inherit;
}

/* Small helper text */
small {
    display: block;
    margin-top: 5px;
    font-size: 12px;
    color: #666;
    font-style: italic;
}

/* Submit Button */
.form-actions {
    text-align: center;
    padding: 30px 20px;
    background: #f9f9f9;
    border-radius: 6px;
    margin-top: 30px;
}

#submit-btn {
    background: #0073aa;
    color: white;
    padding: 15px 30px;
    border: none;
    border-radius: 5px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.2s ease;
    min-width: 200px;
}

#submit-btn:hover {
    background: #005a87;
    transform: translateY(-1px);
}

#submit-btn:active {
    transform: translateY(0);
}

#submit-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
}

/* Loading state */
#submit-btn.loading {
    position: relative;
    color: transparent;
}

#submit-btn.loading:after {
    content: "";
    position: absolute;
    width: 20px;
    height: 20px;
    top: 50%;
    left: 50%;
    margin-left: -10px;
    margin-top: -10px;
    border: 2px solid #ffffff;
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Form Messages */
#form-messages {
    margin-top: 20px;
    padding: 0;
}

.form-message {
    padding: 12px 16px;
    border-radius: 4px;
    margin-bottom: 10px;
    font-weight: 500;
}

.form-message.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.form-message.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.form-message.info {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

/* Validation Styles */
.form-group.error input,
.form-group.error textarea {
    border-color: #dc3545;
    box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.1);
}

.form-group.error label {
    color: #dc3545;
}

.error-message {
    color: #dc3545;
    font-size: 12px;
    margin-top: 5px;
    display: block;
}

/* Required field asterisk */
input[required] + label:after,
textarea[required] + label:after {
    content: " *";
    color: #dc3545;
}

/* Responsive Design */
@media (max-width: 768px) {
    #necrologie-form-container {
        margin: 10px;
        padding: 15px;
    }
    
    .form-row {
        flex-direction: column;
        gap: 0;
    }
    
    .form-section {
        padding: 15px;
        margin-bottom: 20px;
    }
    
    .form-section h3 {
        font-size: 16px;
        margin-bottom: 15px;
    }
    
    input[type="text"],
    input[type="email"],
    input[type="tel"],
    input[type="date"],
    input[type="time"],
    input[type="number"],
    textarea,
    select {
        padding: 10px;
        font-size: 16px; /* Prevents zoom on iOS */
    }
    
    #submit-btn {
        width: 100%;
        padding: 12px;
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    #necrologie-form-container {
        margin: 5px;
        padding: 10px;
    }
    
    .form-section {
        padding: 10px;
    }
}

/* Print Styles */
@media print {
    #necrologie-form-container {
        box-shadow: none;
        border: 1px solid #ccc;
    }
    
    .form-actions {
        display: none;
    }
    
    input[type="text"],
    input[type="email"],
    input[type="tel"],
    input[type="date"],
    input[type="time"],
    input[type="number"],
    textarea,
    select {
        border: 1px solid #999;
        background: white;
    }
}

/* Accessibility Improvements */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    input[type="text"],
    input[type="email"],
    input[type="tel"],
    input[type="date"],
    input[type="time"],
    input[type="number"],
    textarea,
    select {
        border-width: 3px;
    }
    
    #submit-btn {
        border: 2px solid #000;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    #necrologie-form-container {
        background: #1e1e1e;
        color: #fff;
    }
    
    .form-section {
        background: #2a2a2a;
        border-left-color: #0ea5e9;
    }
    
    .form-section h3,
    label {
        color: #fff;
    }
    
    input[type="text"],
    input[type="email"],
    input[type="tel"],
    input[type="date"],
    input[type="time"],
    input[type="number"],
    textarea,
    select {
        background: #333;
        border-color: #555;
        color: #fff;
    }
    
    input[type="file"] {
        background: #333;
        border-color: #555;
        color: #fff;
    }
    
    .form-actions {
        background: #2a2a2a;
    }
    
    small {
        color: #ccc;
    }
}

/* Obituary Display Styles - Inspired by Forêt de la seconde vie */
.necrologie-dates {
    text-align: center;
    margin: 20px 0 30px 0;
    padding: 20px 0;
    border-bottom: 1px solid #e0e0e0;
}

.necrologie-dates h3 {
    font-size: 24px;
    font-weight: 400;
    color: #333;
    margin: 0;
    letter-spacing: 0.5px;
}

.necrologie-tribute {
    margin: 30px 0;
    line-height: 1.8;
    font-size: 16px;
    color: #444;
}

.necrologie-tribute p {
    margin-bottom: 20px;
}

.necrologie-locations {
    margin: 30px 0;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
}

.necrologie-locations p {
    margin: 10px 0;
    font-size: 15px;
}

.necrologie-ceremony {
    margin: 30px 0;
    padding: 25px;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.ceremony-location p {
    margin: 8px 0;
    font-size: 15px;
}

.ceremony-date {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #e0e0e0;
}

.necrologie-publication {
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid #e0e0e0;
    text-align: center;
}

.necrologie-publication p {
    font-size: 13px;
    color: #666;
    margin: 0;
}

/* Obituary Preview Grid Styles */
.necrologie-preview-container {
    margin: 40px 0;
}

.necrologie-grid {
    display: grid;
    gap: 30px;
}

@media (max-width: 1024px) {
    .necrologie-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

@media (max-width: 768px) {
    .necrologie-grid {
        grid-template-columns: 1fr !important;
        gap: 20px;
    }
}

.necrologie-card {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid #f0f0f0;
}

.necrologie-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 30px rgba(0,0,0,0.15);
}

.necrologie-card-image {
    position: relative;
    width: 100%;
    height: 200px;
    overflow: hidden;
}

.necrologie-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center top;
    transition: transform 0.3s ease;
}

.necrologie-card:hover .necrologie-card-image img {
    transform: scale(1.05);
}

.necrologie-placeholder-image {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #f5f5f5 0%, #e8e8e8 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #999;
    font-size: 14px;
    font-weight: 500;
}

.necrologie-card-content {
    padding: 25px;
    background: #fff;
}

.necrologie-card-date {
    font-size: 12px;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 10px;
    font-weight: 500;
}

.necrologie-card-title {
    margin: 0 0 10px 0;
    font-size: 20px;
    font-weight: 600;
    line-height: 1.3;
}

.necrologie-card-title a {
    color: #333;
    text-decoration: none;
    transition: color 0.3s ease;
}

.necrologie-card-title a:hover {
    color: #0073aa;
}

.necrologie-card-dates {
    font-size: 14px;
    color: #666;
    margin-bottom: 15px;
    font-style: italic;
    letter-spacing: 0.3px;
}

.necrologie-card-excerpt {
    font-size: 14px;
    line-height: 1.6;
    color: #555;
    margin-bottom: 20px;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    word-wrap: break-word;
    word-break: break-word;
    white-space: normal;
}

.necrologie-card-link {
    display: inline-block;
    padding: 10px 20px;
    background: #0073aa;
    color: white;
    text-decoration: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    transition: background-color 0.3s ease, transform 0.2s ease;
}

.necrologie-card-link:hover {
    background: #005a87;
    transform: translateY(-1px);
    color: white;
    text-decoration: none;
}

/* Single Obituary Page Styles - Two Column Layout like Forêt de la seconde vie */

/* Main container with two columns */
.necrologie-container {
    display: flex;
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px;
    gap: 40px;
    align-items: flex-start;
}

/* Left sidebar with photo and info */
.necrologie-sidebar {
    flex: 0 0 300px;
    text-align: center;
}

.necrologie-photo {
    margin-bottom: 20px;
}

.necrologie-photo img.necrologie-portrait {
    width: 100%;
    max-width: 300px;
    height: auto;
    border-radius: 8px;
    object-fit: cover;
    object-position: center top;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.necrologie-location-info {
    margin: 20px 0;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 6px;
}

.necrologie-location-info p {
    font-size: 14px;
    color: #666;
    margin: 0;
    font-weight: 500;
}

.necrologie-publication-info {
    margin-top: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 6px;
    border-top: 3px solid #0073aa;
}

.necrologie-publication-info p {
    font-size: 12px;
    color: #666;
    margin: 2px 0;
    text-align: center;
}

.necrologie-publication-info p:first-child {
    font-weight: normal;
}

.necrologie-publication-info p:last-child {
    font-weight: 600;
    color: #333;
}

/* Right column - Main content */
.necrologie-main-content {
    flex: 1;
    min-width: 0; /* Allows flex item to shrink */
}

.necrologie-title {
    font-size: 48px;
    font-weight: 400;
    color: #333;
    margin: 0 0 10px 0;
    line-height: 1.1;
}

.necrologie-dates {
    margin-bottom: 15px;
}

.necrologie-dates h2 {
    font-size: 20px;
    font-weight: 300;
    color: #666;
    margin: 0;
    letter-spacing: 0.5px;
}

.necrologie-location-title {
    margin-bottom: 30px;
}

.necrologie-location-title p {
    font-size: 16px;
    color: #666;
    margin: 0;
    font-weight: 500;
}

.necrologie-tribute {
    margin: 30px 0;
    line-height: 1.7;
    font-size: 16px;
    color: #444;
    text-align: justify;
}

.necrologie-tribute p {
    margin-bottom: 20px;
}

.necrologie-ceremony {
    margin: 30px 0;
    padding: 25px;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #0073aa;
}

.necrologie-ceremony p {
    margin: 15px 0;
    font-size: 16px;
    line-height: 1.6;
}

.ceremony-contact {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #ddd;
}

.ceremony-contact p {
    margin: 8px 0;
    font-size: 15px;
}

/* Responsive design for single pages */
@media (max-width: 1024px) {
    .necrologie-container {
        gap: 30px;
        padding: 30px 15px;
    }
    
    .necrologie-sidebar {
        flex: 0 0 250px;
    }
    
    .necrologie-title {
        font-size: 36px;
    }
}

@media (max-width: 768px) {
    .necrologie-container {
        flex-direction: column;
        gap: 30px;
        padding: 20px 15px;
    }
    
    .necrologie-sidebar {
        flex: none;
        width: 100%;
    }
    
    .necrologie-photo img.necrologie-portrait {
        max-width: 250px;
    }
    
    .necrologie-title {
        font-size: 32px;
    }
    
    .necrologie-dates h2 {
        font-size: 18px;
    }
    
    .necrologie-tribute {
        font-size: 15px;
        text-align: left;
    }
    
    .necrologie-ceremony {
        padding: 20px;
    }
}
