/* Blog Styles */

/* Blog content styling */
.blog-content {
    color: #374151;
    font-size: 1.125rem;
    line-height: 1.7;
}

.blog-content h1,
.blog-content h2,
.blog-content h3,
.blog-content h4,
.blog-content h5,
.blog-content h6 {
    font-family: 'Playfair Display', serif;
    font-weight: 700;
    color: #1a365d;
    margin-top: 2rem;
    margin-bottom: 1rem;
    scroll-margin-top: 6rem; /* For anchor links with sticky header */
}

.blog-content h1 {
    font-size: 2.25rem;
    line-height: 1.2;
}

.blog-content h2 {
    font-size: 1.875rem;
    line-height: 1.3;
}

.blog-content h3 {
    font-size: 1.5rem;
    line-height: 1.4;
}

.blog-content h4 {
    font-size: 1.25rem;
    line-height: 1.5;
}

.blog-content p {
    margin-bottom: 1.5rem;
    text-align: justify;
}

.blog-content ul,
.blog-content ol {
    margin: 1.5rem 0;
    padding-left: 2rem;
}

.blog-content li {
    margin-bottom: 0.5rem;
}

.blog-content ul li {
    list-style-type: disc;
}

.blog-content ol li {
    list-style-type: decimal;
}

.blog-content strong {
    font-weight: 600;
    color: #111827;
}

.blog-content em {
    font-style: italic;
}

.blog-content a {
    color: #1a365d;
    text-decoration: underline;
    transition: color 0.2s ease;
}

.blog-content a:hover {
    color: #0f2537;
}

.blog-content blockquote {
    border-left: 4px solid #daa520;
    padding-left: 1.5rem;
    margin: 2rem 0;
    font-style: italic;
    color: #6b7280;
    background-color: #f9fafb;
    padding: 1.5rem;
    border-radius: 0.5rem;
}

.blog-content img {
    max-width: 100%;
    height: auto;
    border-radius: 0.75rem;
    margin: 2rem 0;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.blog-content figure {
    margin: 2rem 0;
}

.blog-content figcaption {
    text-align: center;
    font-size: 0.875rem;
    color: #6b7280;
    margin-top: 0.5rem;
    font-style: italic;
}

.blog-content pre {
    background-color: #f3f4f6;
    border-radius: 0.5rem;
    padding: 1.5rem;
    overflow-x: auto;
    margin: 1.5rem 0;
    font-family: 'Courier New', monospace;
    font-size: 0.875rem;
}

.blog-content code {
    background-color: #f3f4f6;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    font-family: 'Courier New', monospace;
    font-size: 0.875rem;
}

.blog-content pre code {
    background-color: transparent;
    padding: 0;
}

.blog-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 2rem 0;
    background-color: white;
    border-radius: 0.5rem;
    overflow: hidden;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
}

.blog-content th,
.blog-content td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid #e5e7eb;
}

.blog-content th {
    background-color: #f9fafb;
    font-weight: 600;
    color: #374151;
}

.blog-content tr:last-child td {
    border-bottom: none;
}

.blog-content hr {
    border: none;
    height: 1px;
    background-color: #e5e7eb;
    margin: 3rem 0;
}

/* Line clamping utilities */
.line-clamp-1 {
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.line-clamp-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Blog card hover effects */
.blog-card {
    transition: all 0.3s ease;
    transform: translateY(0);
}

.blog-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

/* Featured post styling */
.featured-post {
    position: relative;
}

.featured-post::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #daa520, #b8860b);
    border-radius: 0.75rem 0.75rem 0 0;
}

/* Tag styling */
.tag {
    transition: all 0.2s ease;
}

.tag:hover {
    transform: translateY(-1px);
}

/* Search input styling */
.search-input {
    transition: all 0.3s ease;
}

.search-input:focus {
    transform: scale(1.02);
}

/* WYSIWYG Editor styling */
.editor-container {
    position: relative;
}

.editor-toolbar {
    border: 1px solid #d1d5db;
    border-bottom: none;
    background: #f9fafb;
    padding: 0.5rem;
    border-radius: 0.5rem 0.5rem 0 0;
    display: flex;
    gap: 0.25rem;
    flex-wrap: wrap;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    width: 100%;
    box-sizing: border-box;
}

.editor-toolbar button {
    padding: 0.375rem 0.75rem;
    border: 1px solid #d1d5db;
    background: white;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 32px;
}

.editor-toolbar button:hover {
    background: #e5e7eb;
    border-color: #9ca3af;
    transform: translateY(-1px);
}

.editor-toolbar button.active {
    background: #1a365d;
    color: white;
    border-color: #1a365d;
    box-shadow: 0 2px 4px 0 rgba(26, 54, 93, 0.2);
}

.editor-content {
    min-height: 300px;
    border: 1px solid #d1d5db;
    border-radius: 0 0 0.5rem 0.5rem;
    padding: 1.5rem;
    outline: none;
    font-family: inherit;
    line-height: 1.7;
    background: white;
    font-size: 1rem;
    color: #374151;
    width: 100%;
    box-sizing: border-box;
    overflow-wrap: break-word;
    word-wrap: break-word;
}

.editor-content:focus {
    border-color: #1a365d;
    box-shadow: 0 0 0 3px rgba(26, 54, 93, 0.1);
}

.editor-content:empty:before {
    content: attr(placeholder);
    color: #9ca3af;
    font-style: italic;
}

/* Editor Content Visual Feedback */
.editor-content h1 {
    font-family: 'Playfair Display', serif;
    font-size: 2.25rem;
    font-weight: 700;
    color: #1a365d;
    margin: 1.5rem 0 1rem 0;
    padding: 0.5rem 0;
    border-bottom: 3px solid #daa520;
    position: relative;
}

.editor-content h1:before {
    content: "H1";
    position: absolute;
    left: -3rem;
    top: 0.5rem;
    background: #1a365d;
    color: white;
    font-size: 0.75rem;
    font-weight: 600;
    font-family: 'Inter', sans-serif;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    line-height: 1;
}

.editor-content h2 {
    font-family: 'Playfair Display', serif;
    font-size: 1.875rem;
    font-weight: 700;
    color: #1a365d;
    margin: 1.5rem 0 1rem 0;
    padding: 0.375rem 0;
    border-bottom: 2px solid #daa520;
    position: relative;
}

.editor-content h2:before {
    content: "H2";
    position: absolute;
    left: -3rem;
    top: 0.375rem;
    background: #374151;
    color: white;
    font-size: 0.75rem;
    font-weight: 600;
    font-family: 'Inter', sans-serif;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    line-height: 1;
}

.editor-content h3 {
    font-family: 'Playfair Display', serif;
    font-size: 1.5rem;
    font-weight: 700;
    color: #1a365d;
    margin: 1.25rem 0 0.75rem 0;
    padding: 0.25rem 0;
    border-left: 4px solid #daa520;
    padding-left: 1rem;
    position: relative;
}

.editor-content h3:before {
    content: "H3";
    position: absolute;
    left: -3rem;
    top: 0.25rem;
    background: #6b7280;
    color: white;
    font-size: 0.75rem;
    font-weight: 600;
    font-family: 'Inter', sans-serif;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    line-height: 1;
}

.editor-content p {
    margin: 1rem 0;
    line-height: 1.7;
    position: relative;
}

.editor-content p:empty {
    min-height: 1.5rem;
    margin: 0.5rem 0;
}

.editor-content p:empty:before {
    content: "Párrafo";
    position: absolute;
    left: -3rem;
    top: 0;
    background: #e5e7eb;
    color: #6b7280;
    font-size: 0.75rem;
    font-weight: 500;
    font-family: 'Inter', sans-serif;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    line-height: 1;
}

.editor-content ul,
.editor-content ol {
    margin: 1rem 0;
    padding-left: 2rem;
    position: relative;
}

.editor-content ul:before {
    content: "Lista";
    position: absolute;
    left: -3rem;
    top: 0;
    background: #10b981;
    color: white;
    font-size: 0.75rem;
    font-weight: 600;
    font-family: 'Inter', sans-serif;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    line-height: 1;
}

.editor-content ol:before {
    content: "Lista #";
    position: absolute;
    left: -3rem;
    top: 0;
    background: #3b82f6;
    color: white;
    font-size: 0.75rem;
    font-weight: 600;
    font-family: 'Inter', sans-serif;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    line-height: 1;
}

.editor-content li {
    margin: 0.5rem 0;
    line-height: 1.6;
}

.editor-content ul li {
    list-style-type: disc;
}

.editor-content ol li {
    list-style-type: decimal;
}

.editor-content strong {
    font-weight: 700;
    color: #111827;
    background: rgba(250, 204, 21, 0.2);
    padding: 0 0.25rem;
    border-radius: 0.25rem;
}

.editor-content em {
    font-style: italic;
    background: rgba(168, 85, 247, 0.1);
    padding: 0 0.25rem;
    border-radius: 0.25rem;
}

.editor-content u {
    text-decoration: underline;
    text-decoration-color: #ef4444;
    text-decoration-thickness: 2px;
}

.editor-content a {
    color: #1a365d;
    text-decoration: underline;
    background: rgba(26, 54, 93, 0.1);
    padding: 0 0.25rem;
    border-radius: 0.25rem;
    transition: all 0.2s ease;
}

.editor-content a:hover {
    background: rgba(26, 54, 93, 0.2);
}

/* Editor content wrapper for positioning labels */
.editor-content-wrapper {
    position: relative;
    margin-left: 3.5rem;
}

@media (max-width: 640px) {
    .editor-content-wrapper {
        margin-left: 0;
    }
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .blog-content {
        font-size: 1rem;
    }
    
    .blog-content h1 {
        font-size: 1.875rem;
    }
    
    .blog-content h2 {
        font-size: 1.5rem;
    }
    
    .blog-content h3 {
        font-size: 1.25rem;
    }
    
    .blog-content ul,
    .blog-content ol {
        padding-left: 1.5rem;
    }
    
    .blog-content blockquote {
        padding: 1rem;
        margin: 1.5rem 0;
    }
    
    .editor-toolbar {
        padding: 0.25rem;
        gap: 0.125rem;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .editor-toolbar button {
        padding: 0.25rem 0.375rem;
        font-size: 0.75rem;
        min-width: 28px;
        height: 28px;
        flex-shrink: 0;
    }
    
    .editor-content-wrapper {
        margin-left: 0;
    }
    
    .editor-content {
        padding: 1rem;
        min-height: 200px;
        font-size: 0.875rem;
    }
    
    .editor-content h1:before,
    .editor-content h2:before,
    .editor-content h3:before,
    .editor-content p:empty:before,
    .editor-content ul:before,
    .editor-content ol:before {
        display: none;
    }
    
    .editor-content h1,
    .editor-content h2,
    .editor-content h3 {
        font-size: 1.25rem;
        margin: 1rem 0 0.5rem 0;
    }
    
    .editor-content h1 {
        border-bottom-width: 2px;
    }
    
    .editor-content h2 {
        border-bottom-width: 1px;
    }
    
    .editor-content h3 {
        border-left-width: 3px;
        padding-left: 0.75rem;
    }
    
    .editor-content p {
        margin: 0.5rem 0;
    }
    
    .editor-content ul,
    .editor-content ol {
        margin: 0.5rem 0;
        padding-left: 1.5rem;
    }
}

/* Extra small devices (phones, 480px and down) */
@media (max-width: 480px) {
    .editor-container {
        width: 100%;
        overflow: hidden;
    }
    
    .editor-toolbar {
        padding: 0.125rem;
        gap: 0.125rem;
        overflow-x: auto;
        white-space: nowrap;
        scrollbar-width: thin;
    }
    
    .editor-toolbar::-webkit-scrollbar {
        height: 4px;
    }
    
    .editor-toolbar::-webkit-scrollbar-track {
        background: #f3f4f6;
    }
    
    .editor-toolbar::-webkit-scrollbar-thumb {
        background: #d1d5db;
        border-radius: 2px;
    }
    
    .editor-toolbar button {
        padding: 0.25rem;
        min-width: 24px;
        height: 24px;
        font-size: 0.625rem;
        flex-shrink: 0;
    }
    
    .editor-content {
        padding: 0.75rem;
        min-height: 150px;
        font-size: 0.8rem;
    }
    
    .editor-content-wrapper {
        width: 100%;
        margin-left: 0;
    }
}

/* Print styles */
@media print {
    .blog-content {
        font-size: 12pt;
        line-height: 1.5;
        color: #000;
    }
    
    .blog-content h1,
    .blog-content h2,
    .blog-content h3,
    .blog-content h4,
    .blog-content h5,
    .blog-content h6 {
        color: #000;
        page-break-after: avoid;
    }
    
    .blog-content a {
        color: #000;
        text-decoration: none;
    }
    
    .blog-content a::after {
        content: " (" attr(href) ")";
        font-size: 10pt;
        color: #666;
    }
    
    .blog-content blockquote {
        border-left: 2px solid #000;
        background: none;
    }
    
    .blog-content img {
        max-width: 100%;
        box-shadow: none;
    }
}
