/*
 * Additional styles for the WebHosting4U Blog theme.
 *
 * This stylesheet contains small tweaks to improve the reading
 * experience on the blog and address minor issues discovered after
 * deployment.
 */

/* Prevent images within blog posts from becoming sticky or fixed.  In
 * some browsers the default Sticky Post styling can cause featured
 * images to stick to the top of the viewport.  Reset the position
 * property so images scroll normally with the content. */
/* Ensure images behave like block elements and do not overlap text.
 * Reset positioning so they scroll naturally and add a bottom margin
 * to separate them from following content. */
article img {
    position: static !important;
    display: block;
    width: 100%;
    height: auto;
    margin-bottom: 1.5rem;
}

/* Override default alignment classes used by WordPress on images.  The
 * default .alignleft and .alignright float images and allow text to
 * wrap around them, which can appear as if the image overlaps the
 * content.  These rules remove the floats and center the images on
 * their own line with appropriate margin. */
.single-post .alignleft,
.single-post .alignright,
.single-post .aligncenter {
    float: none !important;
    display: block;
    margin-left: auto;
    margin-right: auto;
    margin-bottom: 1.5rem;
    text-align: center;
}

/* Ensure that sticky posts (WordPress feature) do not remain
 * physically sticky when displayed in the blog.  Without this rule
 * a post marked as "sticky" in the WordPress admin can become
 * fixed at the top of the viewport due to generic sticky styling.
 */
article.sticky {
    position: static !important;
}

/* Disable sticky header only on blog and single post pages.  On long
 * articles the sticky header can overlap content and make it appear
 * as if the featured image is stuck beneath the header.  By
 * reverting to a relative position we allow the page to scroll
 * naturally. */
body.blog header,
body.single-post header {
    /* Override the sticky positioning used on the main site so the
     * header scrolls away on long blog articles.  Without this
     * override the featured image can appear "stuck" beneath the
     * header. */
    position: relative !important;
    top: 0 !important;
    z-index: 40 !important;
}

/* Limit the height of featured images on single posts.  Large
 * photographs can dominate the screen; setting a maximum height
 * ensures readers see the article content sooner. */
.single-post article img {
    max-height: 28rem;
    object-fit: cover;
    width: 100%;
}

/* Accessible skip link.  Hidden off‑screen by default and revealed
 * when focused via keyboard navigation to allow users to jump
 * directly to the main content. */
.skip-link {
    position: absolute;
    left: -10000px;
    top: auto;
    width: 1px;
    height: 1px;
    overflow: hidden;
    z-index: -9999;
}
.skip-link:focus,
.skip-link:active {
    position: static;
    left: auto;
    width: auto;
    height: auto;
    overflow: visible;
    margin: 1rem;
    padding: 0.5rem 0.75rem;
    z-index: 10000;
    background: #dc431b;
    color: #ffffff;
    border-radius: 0.25rem;
}

/* Improve typography for headings and paragraphs on the blog.  Use
 * bolder weights for headings and a comfortable line height for
 * paragraphs. */
article h1, article h2, article h3, article h4, article h5, article h6 {
    font-weight: 700;
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
}
article p {
    line-height: 1.7;
    margin-bottom: 1rem;
}

/* Remove max-width restriction on prose so that the content spans the
 * full width of the article container.  The previous restriction
 * could cause the first paragraph to appear beneath images in a
 * narrow column. */
article .prose {
    max-width: none;
}

/* Style unordered and ordered lists within articles. */
article ul,
article ol {
    margin-left: 1.5rem;
    margin-bottom: 1rem;
}
article ul li {
    list-style: disc;
}
article ol li {
    list-style: decimal;
}

/* ------------------------------------------------------------------
 * Reading progress bar styles
 *
 * The progress container spans the full width of the viewport and
 * remains fixed to the top of the screen.  The bar itself animates
 * smoothly as its width is updated by JavaScript.  Colours are
 * chosen to match the brand palette and ensure sufficient contrast
 * for users with low vision. */
#reading-progress-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background-color: #f1f5f9; /* slate-100 */
    z-index: 60;
}
#readingProgress {
    width: 0;
    height: 100%;
    background-color: #dc431b; /* brand primary */
    transition: width 0.1s ease-out;
}

/* ------------------------------------------------------------------
 * Micro animations & visual cues
 *
 * Use subtle animations to draw attention to interactive elements
 * without distracting from the reading experience.  Pulse effect
 * for call‑to‑action buttons and slide‑in effect for icons on hover.
 */
.cta-animate {
    animation: ctaPulse 2s infinite;
}
@keyframes ctaPulse {
    0% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.05); opacity: 0.9; }
    100% { transform: scale(1); opacity: 1; }
}
.icon-slide {
    position: relative;
    transition: transform 0.2s ease;
}
.icon-slide:hover {
    transform: translateX(2px);
}

/* Focus styles for interactive elements to aid keyboard navigation. */
a:focus,
button:focus,
input:focus,
textarea:focus {
    outline: 2px solid #dc431b;
    outline-offset: 2px;
}

/* ------------------------------------------------------------------
 * Pagination styling
 *
 * Center the pagination links and style them as pill buttons.  The
 * current page uses the brand primary colour, while other links
 * have a light background. */
.navigation.pagination .nav-links {
    display: inline-flex;
    justify-content: center;
    gap: 0.5rem;
}
.navigation.pagination .page-numbers {
    padding: 0.5rem 0.75rem;
    border-radius: 0.375rem;
    background: #f8fafc; /* slate-50 */
    color: #374151; /* slate-700 */
    transition: background-color 0.2s ease, color 0.2s ease;
    text-decoration: none;
    font-size: 0.875rem;
}
.navigation.pagination .page-numbers.current {
    background: #dc431b;
    color: #ffffff;
}
.navigation.pagination .page-numbers:hover {
    background: #e85a2e;
    color: #ffffff;
}

/* ------------------------------------------------------------------
 * Comment styling
 *
 * Style the comment list and form to blend with the theme.  Each
 * comment is separated with a border and padding, and the comment
 * form fields use full width inputs with rounded corners. */
ol.comment-list,
ul.comment-list {
    list-style: none;
    margin: 0;
    padding: 0;
}
.comment-list li {
    margin: 0;
}

.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    background-color: #ffffff;
    font-size: 0.875rem;
}
.comment-form textarea {
    min-height: 120px;
}
.comment-form .form-submit input {
    padding: 0.75rem 1.25rem;
    background-color: #dc431b;
    color: #ffffff;
    border-radius: 0.5rem;
    font-weight: 600;
    transition: background-color 0.2s ease;
}
.comment-form .form-submit input:hover {
    background-color: #e85a2e;
}

/* Style the search form to match the theme colours and maintain
 * readability on mobile devices. */
.wh4u-search-form {
    max-width: 640px;
    margin-left: auto;
    margin-right: auto;
}
.wh4u-search-input {
    flex: 1;
    padding: 0.75rem 1rem;
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem 0 0 0.5rem;
    background-color: #ffffff;
}
.wh4u-search-button {
    padding: 0.75rem 1.25rem;
    background-color: #dc431b;
    color: #ffffff;
    border-radius: 0 0.5rem 0.5rem 0;
    font-weight: 600;
    transition: background-color 0.2s ease;
}
.wh4u-search-button:hover {
    background-color: #e85a2e;
}