/* Water Advisor - Component Styles */

/* ===================== */
/* Affiliate Disclosure  */
/* ===================== */

.wa-affiliate-disclosure {
    background-color: var(--wa-bg-alt);
    border-left: 3px solid var(--wa-secondary);
    padding: 8px 16px;
    margin-bottom: 16px;
    font-size: 13px;
    color: var(--wa-text-secondary);
}

.wa-affiliate-disclosure a {
    color: var(--wa-secondary);
    text-decoration: underline;
}

/* ===================== */
/* Post Meta Bar         */
/* ===================== */

.wa-post-meta {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    margin-bottom: 16px;
    border-bottom: 1px solid var(--wa-border);
}

.wa-author-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: var(--wa-text-secondary);
}

.wa-author-avatar img {
    border-radius: 50%;
    vertical-align: middle;
}

.wa-author-name {
    font-weight: 600;
    color: var(--wa-text-primary);
}

/* ===================== */
/* Trust Badges          */
/* ===================== */

.wa-trust-badges {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.wa-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 13px;
    font-weight: 600;
    color: var(--wa-text-secondary);
    background-color: var(--wa-bg-alt);
    padding: 4px 10px;
    border-radius: 4px;
}

.wa-badge-icon {
    color: var(--wa-secondary);
}

/* ===================== */
/* Author Box            */
/* ===================== */

.wa-author-box {
    display: flex;
    gap: 20px;
    padding: 24px;
    margin: 32px 0;
    background-color: var(--wa-bg-alt);
    border-radius: 8px;
}

.wa-author-box-avatar img {
    border-radius: 50%;
}

.wa-author-box-name {
    font-size: 18px;
    margin-bottom: 8px;
}

.wa-author-box-bio {
    font-size: 15px;
    color: var(--wa-text-secondary);
    line-height: 1.6;
}

/* ===================== */
/* Related Articles      */
/* ===================== */

.wa-related-articles {
    margin-top: 40px;
    padding-top: 32px;
    border-top: 1px solid var(--wa-border);
}

.wa-related-articles h3 {
    margin-bottom: 20px;
}

.wa-related-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.wa-related-card {
    text-decoration: none;
    color: inherit;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: box-shadow 0.2s;
}

.wa-related-card:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
}

.wa-related-card h4 {
    padding: 12px;
    font-size: 15px;
    line-height: 1.4;
    margin: 0;
}

.wa-related-thumb img {
    width: 100%;
    height: 140px;
    object-fit: cover;
    display: block;
}

.wa-related-thumb-placeholder {
    height: 140px;
    background-color: var(--wa-primary);
}

/* ===================== */
/* Footer Disclosure     */
/* ===================== */

.wa-footer-disclosure {
    text-align: center;
    padding: 12px 16px;
    font-size: 13px;
    color: rgba(255,255,255,0.7);
    border-bottom: none;
}

.wa-footer-disclosure p {
    margin: 0;
}

.wa-footer-disclosure a {
    color: rgba(255,255,255,0.9);
    text-decoration: underline;
}

/* ===================== */
/* Footer Links          */
/* ===================== */

.wa-footer-links {
    display: flex;
    justify-content: center;
    gap: 48px;
    padding: 40px 20px 24px;
    flex-wrap: wrap;
}

.wa-footer-links-col h4 {
    color: #FFFFFF;
    font-size: 15px;
    font-weight: 700;
    margin: 0 0 12px;
    letter-spacing: 0.02em;
}

.wa-footer-links-col ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.wa-footer-links-col li {
    margin-bottom: 6px;
}

.wa-footer-links-col a {
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    font-size: 14px;
    transition: color 0.15s;
}

.wa-footer-links-col a:hover {
    color: #FFFFFF;
}

/* ===================== */
/* Featured Image        */
/* ===================== */

.single .post-thumb-img-content img,
.single .ast-article-image-container img {
    width: 100%;
    max-height: 400px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 24px;
}

/* ===================== */
/* Sidebar               */
/* ===================== */

.widget {
    margin-bottom: 28px;
    padding-bottom: 28px;
    border-bottom: 1px solid var(--wa-border);
}

.widget:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.widget-title,
.widget h2 {
    font-size: 16px;
    font-weight: 700;
    color: var(--wa-primary);
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--wa-secondary);
}

/* Search widget — Astra uses label > input + icon btn, plus a separate submit */
.widget_search .search-form {
    position: relative;
}

.widget_search .search-form label {
    display: block;
    width: 100%;
}

.widget_search .search-field {
    width: 100%;
    padding: 10px 40px 10px 12px;
    border: 1px solid var(--wa-border);
    border-radius: 6px;
    font-size: 14px;
    box-sizing: border-box;
}

/* Icon button inside the label — position over input's right side */
.widget_search .search-form .ast-search-submit {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--wa-text-secondary);
    cursor: pointer;
    padding: 4px;
    line-height: 1;
}

.widget_search .search-form .ast-search-submit:hover {
    color: var(--wa-secondary);
}

.widget_search .search-form .ast-search-submit .ast-icon svg {
    width: 16px;
    height: 16px;
}

/* Hide the redundant text submit button */
.widget_search .search-form > input.search-submit {
    display: none;
}

/* Category widget */
.widget_categories ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.widget_categories li {
    padding: 6px 0;
    border-bottom: 1px solid var(--wa-bg-alt);
}

.widget_categories li:last-child {
    border-bottom: none;
}

.widget_categories a {
    color: var(--wa-text-primary);
    text-decoration: none;
    font-size: 15px;
    transition: color 0.15s;
}

.widget_categories a:hover {
    color: var(--wa-secondary);
}

.widget_categories .count,
.widget_categories li > span {
    float: right;
    font-size: 13px;
    color: var(--wa-text-secondary);
}

/* Recent posts widget */
.widget_recent_entries ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.widget_recent_entries li {
    padding: 8px 0;
    border-bottom: 1px solid var(--wa-bg-alt);
    line-height: 1.4;
}

.widget_recent_entries li:last-child {
    border-bottom: none;
}

.widget_recent_entries a {
    color: var(--wa-text-primary);
    text-decoration: none;
    font-size: 15px;
    display: block;
    transition: color 0.15s;
}

.widget_recent_entries a:hover {
    color: var(--wa-secondary);
}

.widget_recent_entries .post-date {
    font-size: 13px;
    color: var(--wa-text-secondary);
    display: block;
    margin-top: 2px;
}

/* Tag cloud widget */
.widget_tag_cloud .tagcloud a {
    display: inline-block;
    padding: 4px 10px;
    margin: 0 4px 6px 0;
    background-color: var(--wa-bg-alt);
    color: var(--wa-text-secondary) !important;
    font-size: 13px !important;
    text-decoration: none;
    border-radius: 4px;
    border: 1px solid var(--wa-border);
    transition: background-color 0.15s, color 0.15s;
}

.widget_tag_cloud .tagcloud a:hover {
    background-color: var(--wa-secondary);
    color: #FFFFFF !important;
    border-color: var(--wa-secondary);
}

/* Sidebar CTA */
.wa-sidebar-cta {
    background-color: var(--wa-bg-alt);
    border: 1px solid var(--wa-border);
    border-radius: 8px;
    padding: 20px;
    text-align: center;
}

.wa-sidebar-cta p {
    font-size: 15px;
    color: var(--wa-text-secondary);
    line-height: 1.5;
    margin-bottom: 16px;
}

.wa-btn-sm {
    padding: 10px 20px;
    font-size: 15px;
    width: 100%;
    text-align: center;
    box-sizing: border-box;
}

/* ===================== */
/* Sticky TOC            */
/* ===================== */

#ez-toc-container {
    position: relative;
    background: var(--wa-bg-alt);
    border: 1px solid var(--wa-border);
    border-radius: 8px;
    padding: 16px 20px;
    margin-bottom: 24px;
    max-width: 600px;
}

/* Hide the toggle checkbox and label icon */
#ez-toc-container input[type="checkbox"],
#ez-toc-container .ez-toc-title-toggle,
#ez-toc-container label[for] {
    display: none !important;
}

#ez-toc-container .ez-toc-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--wa-primary);
    margin-bottom: 12px;
}

/* Clean up TOC list styling */
#ez-toc-container ul {
    list-style: none;
    padding-left: 0;
    margin: 0;
}

#ez-toc-container ul ul {
    padding-left: 16px;
}

#ez-toc-container li {
    padding: 4px 0;
    line-height: 1.4;
}

#ez-toc-container a {
    color: var(--wa-text-primary);
    text-decoration: none;
    font-size: 14px;
    display: block;
    padding: 2px 8px;
    border-radius: 4px;
    transition: background-color 0.15s, color 0.15s;
}

#ez-toc-container a:hover {
    color: var(--wa-secondary);
    background-color: rgba(20, 138, 158, 0.08);
}

/* Active TOC item */
#ez-toc-container .active a {
    color: var(--wa-secondary);
    font-weight: 600;
}

/* ===================== */
/* Breadcrumbs           */
/* ===================== */

.ast-breadcrumbs .trail-items a {
    color: var(--wa-secondary);
}

/* ===================== */
/* Hide Astra default meta (we use our own via hook) */
/* ===================== */

.single .entry-meta {
    display: none;
}

/* ===================== */
/* Accessibility         */
/* ===================== */

a:focus-visible,
button:focus-visible,
input:focus-visible {
    outline: 2px solid var(--wa-secondary);
    outline-offset: 2px;
}

/* ===================== */
/* Mobile Responsive     */
/* ===================== */

@media (max-width: 768px) {
    .wa-post-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .wa-related-grid {
        grid-template-columns: 1fr;
    }

    .wa-author-box {
        flex-direction: column;
        text-align: center;
    }

    #ez-toc-container {
        position: static;
    }
}
