/* =================================================================
   Global Link Overrides
   ================================================================= */

a:visited {
    color: var(--text-link);
}

/* Former Component Styling */
.former-component {
    max-width: 2xl;
    margin: 0 auto;
}

.former-form {
    background-color: white;
    padding: 2rem;
    border-radius: 0.75rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    border: 1px solid #e5e7eb;
}

.former-form h3 {
    font-size: 1.5rem;
    font-weight: bold;
    color: #1f2937;
    margin-bottom: 0.75rem;
}

.former-form p {
    color: #4b5563;
    font-size: 1rem;
    margin-bottom: 1.5rem;
}

.form-field {
    margin-bottom: 1.25rem;
}

.form-field label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: #374151;
    margin-bottom: 0.5rem;
}

.form-field input,
.form-field textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid #d1d5db;
    border-radius: 0.5rem;
    font-size: 1rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    box-sizing: border-box;
}

.form-field input:focus,
.form-field textarea:focus {
    outline: none;
    border-color: #60a5fa;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.form-field input::placeholder,
.form-field textarea::placeholder {
    color: #9ca3af;
}

.form-field textarea {
    resize: vertical;
    min-height: 100px;
}

.former-form button[type="submit"] {
    margin-top: 1.5rem;
    width: 100%;
    background-color: #4f46e5;
    color: white;
    font-weight: 600;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.1s ease;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.former-form button[type="submit"]:hover {
    background-color: #4338ca;
    transform: translateY(-1px);
}

.former-form button[type="submit"]:active {
    transform: translateY(0);
}

.former-form button[type="submit"]:disabled {
    background-color: #9ca3af;
    cursor: not-allowed;
    transform: none;
}

#former-result {
    margin-top: 1.5rem;
    padding: 1rem;
    border-radius: 0.5rem;
    display: none;
}

#former-result.success {
    border: 1px solid #10b981;
    background-color: #ecfdf5;
    color: #065f46;
}

#former-result.error {
    border: 1px solid #ef4444;
    background-color: #fef2f2;
    color: #991b1b;
}

/* Responsive adjustments */
@media (min-width: 768px) {
    .former-form {
        padding: 2.5rem;
    }
}

/* Required field indicator */
.form-field label .required {
    color: #ef4444;
    margin-left: 0.25rem;
}

/* =================================================================
   Articles Component — List / Grid Layout
   ================================================================= */

/* Article item card */
.articles-component .article-item {
    padding: 1rem;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    transition: box-shadow 0.2s ease;
}

.articles-component .article-item:hover {
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.07);
}

/* Article item images */
.articles-component .article-item img {
    object-fit: cover;
}

/* Empty state */
.articles-component .no-results {
    padding: 1.5rem;
    border: 2px dashed #d1d5db;
    border-radius: 0.5rem;
    background-color: #f9fafb;
    text-align: center;
}

/* List mode: vertical stacking */
.articles-list.space-y-4 > * + * {
    margin-top: 1rem;
}

/* Grid mode */
.articles-list.grid {
    display: grid;
    gap: 1rem;
}

/* Grid column counts — base (mobile, < 640px): always 1 column */
.articles-list.grid-cols-1 {
    grid-template-columns: repeat(1, 1fr);
}

/* sm: 640px+ */
@media (min-width: 640px) {
    .articles-list.sm\:grid-cols-2 {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* md: 768px+ */
@media (min-width: 768px) {
    .articles-list.md\:grid-cols-3 {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* lg: 1024px+ */
@media (min-width: 1024px) {
    .articles-list.lg\:grid-cols-3 {
        grid-template-columns: repeat(3, 1fr);
    }
    .articles-list.lg\:grid-cols-4 {
        grid-template-columns: repeat(4, 1fr);
    }
    .articles-list.lg\:grid-cols-5 {
        grid-template-columns: repeat(5, 1fr);
    }
}

/* Article title links */
.articles-component .article-item a,
.articles-component .article-item a:link {
    color: #000000 !important;
    text-decoration: none;
}

.articles-component .article-item a:visited {
    color: #000000 !important;
}

.articles-component .article-item a:hover {
    color: #e53935 !important;
}

/* =================================================================
   Comment Form
   ================================================================= */

/* Form container */
#comment-form-container {
    background-color: #f9fafb;
    padding: 1.5rem;
    border-radius: 0.75rem;
    margin-top: 1.5rem;
}

/* Form title */
#comment-form-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 1rem;
}

/* Field labels */
#comment-form label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: #374151;
    margin-bottom: 0.25rem;
}

#comment-form label .required {
    color: #dc2626;
    margin-left: 0.125rem;
}

/* Input and textarea fields */
#comment-form input[type="text"],
#comment-form input[type="email"],
#comment-form textarea {
    width: 100%;
    padding: 0.625rem 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 0.375rem;
    font-size: 0.9375rem;
    font-family: inherit;
    color: #1f2937;
    background-color: #ffffff;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
    box-sizing: border-box;
}

#comment-form input[type="text"]:focus,
#comment-form input[type="email"]:focus,
#comment-form textarea:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

#comment-form input[type="text"]::placeholder,
#comment-form input[type="email"]::placeholder,
#comment-form textarea::placeholder {
    color: #9ca3af;
}

#comment-form textarea {
    resize: vertical;
    min-height: 100px;
}

/* Name / Email grid */
#comment-form .form-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
}

/* Submit button */
#comment-form #submit-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background-color: #2563eb;
    color: #ffffff;
    font-weight: 500;
    font-size: 0.9375rem;
    padding: 0.625rem 1.5rem;
    border: none;
    border-radius: 0.375rem;
    cursor: pointer;
    transition: background-color 0.15s ease;
}

#comment-form #submit-btn:hover {
    background-color: #1d4ed8;
}

#comment-form #submit-btn:active {
    background-color: #1e40af;
}

/* Form spacing */
#comment-form > .form-row + .form-group,
#comment-form > .form-group + .form-group {
    margin-top: 1rem;
}

/* Error messages */
#comment-form .form-error {
    margin-top: 0.25rem;
    font-size: 0.875rem;
    color: #dc2626;
}