/*
 * Theme Name: AffiliateCMS Child
 * Theme URI: https://affiliatecms.com/
 * Description: Child theme for AffiliateCMS Theme. Add your custom styles and overrides here.
 * Author: AffiliateCMS Team
 * Author URI: https://affiliatecms.com/
 * Template: affiliateCMS-theme
 * Version: 1.0.5
 * Requires at least: 6.0
 * Requires PHP: 8.0
 * License: GNU General Public License v2 or later
 * License URI: http://www.gnu.org/licenses/gpl-2.0.html
 * Text Domain: affiliatecms-child
 */

/* ── HEADING COLORS (dark theme) ──────────── */
.entry-content h1,
.entry-content h2,
.entry-content h3,
.entry-content h4,
.entry-content h5,
.entry-content h6 {
    color: #ffffff;
}

/* ── BODY TEXT READABILITY ────────────────── */
.entry-content p,
.entry-content li,
.entry-content td,
.entry-content th {
    color: #e2e2e2;
}

.entry-content strong,
.entry-content b {
    color: #ffffff;
}

/* ── TABLE STYLING ─────────────────────────── */
.entry-content table {
    color: #e2e2e2;
}

.entry-content table th {
    color: #ffffff;
    background-color: #2a2a3e;
}

/* ── MOBILE: TABLE OVERFLOW SCROLL ─────────── */
@media (max-width: 767px) {
    .entry-content table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        max-width: 100%;
    }

    .entry-content table td,
    .entry-content table th {
        font-size: 13px;
        padding: 8px 10px;
        white-space: nowrap;
    }
}

/* ── MOBILE: PRODUCT LIST ───────────────────── */
@media (max-width: 600px) {
    .acms-list,
    .acms-grid {
        max-width: 100%;
        overflow-x: hidden;
    }

    .acms-list__item,
    .acms-grid__item {
        max-width: 100%;
    }

    .acms-list__footer,
    .acms-list__actions {
        flex-direction: column;
        gap: 8px;
    }

    .acms-list__btn {
        width: 100%;
        text-align: center;
    }
}

/* ── MOBILE: SEARCH MODAL ───────────────────── */
@media (max-width: 639px) {
    .search-modal__content {
        width: calc(100vw - 32px);
        max-width: 100%;
    }

    .search-modal__form,
    .search-modal__input {
        max-width: 100%;
    }
}

/* ── MOBILE: GENERAL ────────────────────────── */
@media (max-width: 767px) {
    .entry-content img {
        max-width: 100%;
        height: auto;
    }

    .entry-content iframe {
        max-width: 100%;
    }

    .toc-container,
    .toc-expandable {
        font-size: 14px;
    }

    .header__logo {
        max-width: 160px;
    }

    .header__menu {
        display: none !important;
    }
}


/* ══════════════════════════════════════════════
   ACMS PRODUCT CARD FIX
   Override wp-custom-css amazon link styles that
   break ACMS card layout
   ══════════════════════════════════════════════ */

/* Reset amazon link overrides inside ACMS — exclude .acms-btn */
.post-content .acms-list a[href*="amazon"]:not(.acms-btn),
.post-content .acms-card a[href*="amazon"]:not(.acms-btn),
.post-content .acms-grid a[href*="amazon"]:not(.acms-btn) {
    background: none !important;
    background-image: none !important;
    color: inherit !important;
    padding: 0 !important;
    border-radius: 0 !important;
    font-weight: inherit !important;
    text-decoration: none !important;
    display: block !important;
    transform: none !important;
    opacity: 1 !important;
}

/* Title links: inline */
.post-content .acms-list__title a,
.post-content .acms-card__title a,
.post-content .acms-grid__title a {
    background: none !important;
    background-image: none !important;
    padding: 0 !important;
    display: inline !important;
    color: var(--acms-text, #1a1d21) !important;
    text-decoration: none !important;
    font-weight: inherit !important;
}

/* Buy buttons: restore ACMS button styling from wp-custom-css override */
.post-content .acms-list a.acms-btn[href*="amazon"],
.post-content .acms-card a.acms-btn[href*="amazon"],
.post-content .acms-grid a.acms-btn[href*="amazon"] {
    background: var(--acms-primary, #0d7377) !important;
    background-image: none !important;
    color: #fff !important;
    padding: 0.625rem 1.25rem !important;
    border-radius: var(--acms-radius, 0.5rem) !important;
    font-weight: 600 !important;
    text-decoration: none !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 0.5rem !important;
    width: 100% !important;
    transform: none !important;
    opacity: 1 !important;
    transition: opacity 0.2s !important;
}
.post-content .acms-list a.acms-btn[href*="amazon"]:hover,
.post-content .acms-card a.acms-btn[href*="amazon"]:hover,
.post-content .acms-grid a.acms-btn[href*="amazon"]:hover {
    opacity: 0.85 !important;
    transform: none !important;
}

/* Fix ACMS text color from dark-theme post-content override */
.post-content .acms-list,
.post-content .acms-card,
.post-content .acms-grid {
    color: var(--acms-text, #1a1d21) !important;
    font-size: var(--acms-text-base, 15px) !important;
    line-height: normal !important;
}
.post-content .acms-list__item,
.post-content .acms-grid__item {
    background: var(--acms-surface, #fff) !important;
    color: var(--acms-text, #1a1d21) !important;
}
.post-content .acms-list__title,
.post-content .acms-card__title,
.post-content .acms-grid__title {
    color: var(--acms-text, #1a1d21) !important;
    font-size: var(--acms-text-base, 15px) !important;
}
.post-content .acms-list p,
.post-content .acms-card p,
.post-content .acms-grid p {
    color: var(--acms-text-secondary, #4a5056) !important;
    font-size: inherit !important;
    line-height: inherit !important;
    margin-bottom: 0 !important;
}

/* ══════════════════════════════════════════════
   RELATED ARTICLES — DARK THEME OVERRIDES
   data-theme=light but wp-custom-css forces dark
   bg → fix all element colors manually
   ══════════════════════════════════════════════ */

/* Section header title */
.related-content__title,
.related-content--slider .related-content__title {
    color: #f1f5f9 !important;
}

/* "View All" button — dark style */
.related-content__link {
    background-color: rgba(13,115,119,0.12) !important;
    border: 1px solid rgba(13,115,119,0.4) !important;
    color: #14b8a6 !important;
}
.related-content__link:hover {
    background-color: #0d7377 !important;
    border-color: #0d7377 !important;
    color: #fff !important;
}

/* Arrow nav buttons — dark style */
.related-slider__arrow {
    background-color: #132338 !important;
    border-color: #1e3a5f !important;
    color: #c8d3e0 !important;
    box-shadow: 0 2px 12px rgba(0,0,0,0.5) !important;
}
.related-slider__arrow:hover:not(:disabled) {
    background-color: #0d7377 !important;
    border-color: #0d7377 !important;
    color: #fff !important;
}
.related-slider__arrow:disabled {
    background-color: rgba(19,35,56,0.4) !important;
    border-color: rgba(30,58,95,0.3) !important;
    color: #3a4a5a !important;
}

/* Dot indicators */
.related-slider__dot {
    background-color: #1e3a5f !important;
}
.related-slider__dot.is-active {
    background-color: #0d7377 !important;
}
.related-slider__dot:hover {
    background-color: #14b8a6 !important;
}

/* Card image bg */
.related-content .post-card__image,
.related-content--slider .post-card__image {
    background-color: #0d1421 !important;
}

/* Card title */
.related-content .post-card__title,
.related-content--slider .post-card__title {
    color: #e2eaf5 !important;
}
.related-content .post-card__title a,
.related-content--slider .post-card__title a {
    color: #e2eaf5 !important;
}
.related-content .post-card--slider:hover .post-card__title,
.related-content--slider .post-card--slider:hover .post-card__title,
.related-content .post-card--slider:hover .post-card__title a,
.related-content--slider .post-card--slider:hover .post-card__title a {
    color: #14b8a6 !important;
}

/* Card excerpt */
.related-content .post-card__excerpt,
.related-content--slider .post-card__excerpt {
    color: #8899aa !important;
}

/* Card footer */
.related-content .post-card__author-text,
.related-content--slider .post-card__author-text {
    color: #8899aa !important;
}
.related-content .post-card__footer-item,
.related-content--slider .post-card__footer-item {
    color: #6b7a8d !important;
}
.related-content .post-card__footer-grid,
.related-content--slider .post-card__footer-grid {
    border-top-color: rgba(30,58,95,0.5) !important;
}