body { 
    font-family: system-ui, sans-serif; 
    padding: 0; 
    margin: 0; 
    line-height: 1.6; 
    background-color: #f9f9f9;
    color: #333;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

header {
    background: #1f2937;
    color: white;
    padding: 15px 10px;
    text-align: center;
    width: 100%;
    box-sizing: border-box;
}

header h1 {
    margin: 0 0 12px 0;
    font-size: 1.6rem;
}

.nav-links {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
}

.nav-links a {
    color: #93c5fd;
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 500;
}

.nav-links a:hover {
    text-decoration: underline;
}

.nav-links a.active {
    color: #ffffff;
    font-weight: bold;
    text-decoration: underline;
}

footer {
    background: #e5e7eb;
    color: #4b5563;
    text-align: center;
    padding: 15px;
    margin-top: auto;
    font-size: 0.9em;
    border-top: 1px solid #d1d5db;
    width: 100%;
    box-sizing: border-box;
}

/* Footer Links */
.footer-links {
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
    margin-bottom: 15px;
}

.footer-links a {
    color: #4b5563;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
}

.footer-links a:hover {
    color: #0066cc;
    text-decoration: underline;
}

.main-content {
    padding: 20px;
    flex: 1;
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
    box-sizing: border-box;
}



.control-group { margin-bottom: 20px; }

select, input[type="file"], input[type="text"], input[type="date"], input[type="number"], button { 
    width: 100%; 
    padding: 10px; 
    margin-top: 5px; 
    box-sizing: border-box; 
}

.flex-row { display: flex; gap: 10px; }
.flex-row input { flex: 1; }
canvas { display: none; }
#crop-container { margin-top: 20px; display: none; max-height: 400px; }
img { display: block; max-width: 100%; }

#output-container { 
    margin-top: 20px; 
    padding: 15px; 
    border: 1px dashed #ccc; 
    border-radius: 8px; 
    text-align: center; 
    display: none; 
    background: #fff;
}

#output-image { margin: auto; border: 1px solid #ccc; margin-bottom: 10px; }

button { 
    cursor: pointer; 
    background: #0066cc; 
    color: white; 
    border: none; 
    border-radius: 4px; 
    font-weight: bold; 
    margin-top: 10px; 
}

button:hover { background: #005bb5; }
button:disabled { background: #6c757d; cursor: not-allowed; }

a.download-btn { 
    display: block; 
    padding: 10px 15px; 
    background: #28a745; 
    color: white; 
    text-decoration: none; 
    border-radius: 4px; 
    font-weight: bold; 
    text-align: center;
}

.spec-info { font-size: 0.9em; color: #555; margin-bottom: 10px; }

#preview-grid { 
    list-style-type: none; padding: 0; display: flex; flex-wrap: wrap; gap: 10px; margin-top: 15px; 
}

#preview-grid li { 
    position: relative; width: 100px; height: 120px; cursor: grab; border: 2px solid #ccc; border-radius: 6px; overflow: hidden; background: #f8f9fa;
}

#preview-grid li:active { cursor: grabbing; border-color: #0066cc; }
#preview-grid li img { width: 100%; height: 100%; object-fit: cover; }

.page-badge {
    position: absolute; bottom: 0; left: 0; width: 100%; background: rgba(0,0,0,0.6); color: white; font-size: 11px; text-align: center; padding: 3px 0;
}

.sortable-ghost { opacity: 0.4; border: 2px dashed #0066cc !important; }

/* Article Section Styles */
.article-grid {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-top: 25px;
}

.blog-preview {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 20px;
    transition: box-shadow 0.2s ease;
}

.blog-preview:hover {
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
}

.blog-preview h3 {
    margin: 0 0 8px 0;
    font-size: 1.2rem;
    line-height: 1.4;
}

.blog-preview h3 a {
    color: #1f2937;
    text-decoration: none;
}

.blog-preview h3 a:hover {
    color: #0066cc;
}

.publish-date {
    display: block;
    font-size: 0.85rem;
    color: #6b7280;
    margin-bottom: 12px;
}

.read-more {
    display: inline-block;
    margin-top: 10px;
    font-weight: 600;
    font-size: 0.9rem;
    color: #0066cc;
    text-decoration: none;
}

.read-more:hover {
    text-decoration: underline;
}

/* Homepage Mini Article Cards */
.article-list {
    display: grid;
    grid-template-columns: repeat(2, 1fr); /* Creates two equal columns */
    gap: 15px;
    margin-top: 20px;
    text-align: center; /* Keeps the text centered */
}

/* On small mobile screens, stack them in 1 column so they don't get squeezed */
@media (max-width: 500px) {
    .article-list {
        grid-template-columns: 1fr; 
    }
}

.article-card {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 15px;
    background: #f3f4f6;
    border-radius: 6px;
    text-decoration: none;
    color: inherit;
    border: 1px solid transparent;
}

.article-card:hover {
    background: #e5e7eb;
    border-color: #d1d5db;
}

.article-card h4 {
    margin: 0 0 8px 0;
    color: #1f2937;
    font-size: 1.05rem;
}

.article-card p {
    margin: 0;
    font-size: 0.9rem;
    color: #4b5563;
}



/* Related Article Banner on Tool Pages */
.related-article-banner {
    margin-top: 30px;
    padding: 15px 20px;
    background-color: #e0f2fe; /* Light blue background */
    border-left: 4px solid #0066cc; /* Solid blue accent */
    border-radius: 4px;
}

.related-article-banner h4 {
    margin: 0 0 5px 0;
    color: #0369a1; /* Dark blue text */
    font-size: 1.05rem;
}

.related-article-banner p {
    margin: 0;
    font-size: 0.95rem;
    color: #0c4a6e;
}

.related-article-banner a {
    font-weight: bold;
    color: #0066cc;
    text-decoration: none;
}

.related-article-banner a:hover {
    text-decoration: underline;
}