/**
 * Theme Name: Astra Child
 * Theme URI: https://www.fiowind.com/
 * Description: Astra child theme matching the hscode Flask app's Tailwind-based visual style (primary #1e3a8a, accent #f59e0b, Inter font).
 * Author: Fiowind
 * Author URI: https://www.fiowind.com/
 * Template: astra
 * Version: 1.0.0
 * License: GNU General Public License v2 or later
 * License URI: https://www.gnu.org/licenses/gpl-2.0.html
 * Text Domain: astra-child
 */

/* WordPress-specific overrides. Most styling handled by Tailwind CSS via functions.php. */

/* Markdown content styles (mirrors hscode app/templates/base.html) */
.markdown-content h2, .markdown-content h3, .markdown-content h4 {
    color: #1e3a8a;
    margin: 1.5rem 0 1rem;
    font-weight: 600;
    line-height: 1.3;
}
.markdown-content h2 { font-size: 1.5rem; border-bottom: 1px solid #e2e8f0; padding-bottom: 0.5rem; }
.markdown-content h3 { font-size: 1.25rem; }
.markdown-content h4 { font-size: 1.1rem; }
.markdown-content h1 {
    color: #1e3a8a;
    font-size: 2rem;
    font-weight: 800;
    line-height: 1.3;
    margin: 1.5rem 0 1rem;
}
.markdown-content p { margin: 1rem 0; }
.markdown-content ul, .markdown-content ol { margin: 1rem 0; padding-left: 2rem; }
.markdown-content li { margin: 0.5rem 0; }
.markdown-content ul li { list-style: disc; }
.markdown-content ol li { list-style: decimal; }
.markdown-content a { color: #1e3a8a; text-decoration: underline; }
.markdown-content a:hover { color: #3b82f6; }
.markdown-content code { background: #f1f5f9; padding: 0.2rem 0.4rem; border-radius: 4px; font-family: 'Courier New', monospace; font-size: 0.9em; }
.markdown-content pre { background: #1e293b; color: #f8fafc; padding: 1rem; border-radius: 8px; overflow-x: auto; margin: 1.5rem 0; }
.markdown-content pre code { background: transparent; padding: 0; color: inherit; }
.markdown-content blockquote { border-left: 4px solid #1e3a8a; padding: 0.5rem 1rem; margin: 1.5rem 0; background: #f8fafc; color: #64748b; font-style: italic; }
.markdown-content table { width: 100%; border-collapse: collapse; margin: 1.5rem 0; }
.markdown-content th { background: #1e3a8a; color: white; padding: 0.75rem; text-align: left; font-weight: 600; }
.markdown-content td { padding: 0.75rem; border-bottom: 1px solid #f1f5f9; }
.markdown-content tr:nth-child(even) { background: #f8fafc; }
.markdown-content tr:hover { background: #dbeafe; transition: background 0.2s; }
.markdown-content img { max-width: 100%; height: auto; border-radius: 0.75rem; margin: 1.5rem 0; }

/* Image gallery */
.image-gallery { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1rem; margin: 1.5rem 0; }
.image-gallery img { width: 100%; height: auto; border-radius: 0.75rem; box-shadow: 0 1px 3px rgba(0,0,0,0.12); transition: transform 0.3s ease; }
.image-gallery img:hover { transform: scale(1.05); }

/* WordPress image alignment */
.entry-content img.alignleft { float: left; margin: 0 1.5rem 1rem 0; }
.entry-content img.alignright { float: right; margin: 0 0 1rem 1.5rem; }
.entry-content img.aligncenter { display: block; margin: 1.5rem auto; }
.entry-content img.alignnone { margin: 1.5rem 0; }
.entry-content .wp-caption { max-width: 100%; }
.entry-content .wp-caption-text { text-align: center; color: #64748b; font-size: 0.875rem; margin-top: 0.5rem; font-style: italic; }
.entry-content .alignwide { width: calc(100% + 4rem); margin-left: -2rem; margin-right: -2rem; }
.entry-content .alignfull { width: 100vw; margin-left: calc(50% - 50vw); margin-right: calc(50% - 50vw); }

/* WordPress gallery shortcode */
.gallery { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 0.75rem; margin: 1.5rem 0; }
.gallery .gallery-item { margin: 0; }
.gallery img { border-radius: 0.5rem; }

/* Comment list */
.comment-list { list-style: none; padding: 0; margin: 1.5rem 0; }
.comment-list .comment { background: white; border: 1px solid #f1f5f9; border-radius: 0.75rem; padding: 1.25rem; margin-bottom: 1rem; }
.comment-list .children { list-style: none; padding-left: 1.5rem; margin-top: 1rem; border-left: 3px solid #dbeafe; }
.comment-meta { display: flex; justify-content: space-between; align-items: center; margin-bottom: 0.5rem; font-size: 0.875rem; color: #64748b; }
.comment-meta .comment-author { font-weight: 600; color: #1e3a8a; }
.comment-reply-link { color: #1e3a8a; font-size: 0.875rem; text-decoration: underline; }

/* Comment form */
.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"],
.comment-form textarea {
    width: 100%;
    padding: 0.625rem 0.875rem;
    border: 2px solid #e2e8f0;
    border-radius: 0.5rem;
    font-family: inherit;
    font-size: 0.95rem;
    transition: border-color 0.15s;
}
.comment-form input:focus,
.comment-form textarea:focus {
    outline: none;
    border-color: #1e3a8a;
}
.comment-form .submit {
    background: #1e3a8a;
    color: white;
    padding: 0.5rem 1.25rem;
    border-radius: 0.375rem;
    font-weight: 500;
    border: none;
    cursor: pointer;
    transition: background 0.15s;
}
.comment-form .submit:hover { background: #162a5b; }

/* Pagination */
.pagination { display: flex; justify-content: center; gap: 0.5rem; margin: 2rem 0; }
.pagination .page-numbers {
    padding: 0.5rem 0.875rem;
    border: 1px solid #e2e8f0;
    border-radius: 0.375rem;
    background: white;
    color: #1e3a8a;
    font-size: 0.875rem;
    text-decoration: none;
    transition: background 0.15s;
}
.pagination .page-numbers:hover { background: #dbeafe; }
.pagination .page-numbers.current { background: #1e3a8a; color: white; border-color: #1e3a8a; }

/* Sticky / byline */
.entry-meta { color: #64748b; font-size: 0.875rem; }
.entry-meta a { color: #1e3a8a; text-decoration: none; }
.entry-meta a:hover { text-decoration: underline; }

/* Screen reader text (WordPress accessibility) */
.screen-reader-text {
    border: 0;
    clip: rect(1px, 1px, 1px, 1px);
    clip-path: inset(50%);
    height: 1px;
    margin: -1px;
    overflow: hidden;
    padding: 0;
    position: absolute !important;
    width: 1px;
    word-wrap: normal !important;
}

/* Search form (get_search_form default markup) */
.search-form {
    display: flex;
    gap: 0.5rem;
    align-items: stretch;
}
.search-form .search-field {
    flex: 1;
    padding: 0.625rem 0.875rem;
    border: 2px solid #e2e8f0;
    border-radius: 0.5rem;
    font-family: inherit;
    font-size: 0.95rem;
    transition: border-color 0.15s;
}
.search-form .search-field:focus {
    outline: none;
    border-color: #1e3a8a;
}
.search-form .search-submit {
    background: #1e3a8a;
    color: white;
    padding: 0.5rem 1.25rem;
    border-radius: 0.375rem;
    font-weight: 500;
    border: none;
    cursor: pointer;
    transition: background 0.15s;
    font-family: inherit;
    font-size: 0.95rem;
}
.search-form .search-submit:hover { background: #162a5b; }

/* Breadcrumbs (Astra renders them; we keep markup simple) */
.ast-breadcrumbs, .breadcrumbs {
    color: #64748b;
    font-size: 0.875rem;
    margin-bottom: 1rem;
}
.ast-breadcrumbs a, .breadcrumbs a {
    color: #1e3a8a;
    text-decoration: none;
}
.ast-breadcrumbs a:hover, .breadcrumbs a:hover {
    text-decoration: underline;
}

/* Sticky post badge */
.sticky .entry-title::before {
    content: "Pinned";
    display: inline-block;
    background: #f59e0b;
    color: white;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 0.15rem 0.5rem;
    border-radius: 0.25rem;
    margin-right: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    vertical-align: middle;
}
