/*
 Theme Name: Habits
 Template: colormag
 Description: Minimal child theme for ColorMag. Adds hreflang, DNS prefetch, ad optimization.
 Version: 1.0.0
*/

/* ============================================================
   FlavourBud Modern Styles
   ============================================================ */

/* --- Typography --- */
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6,
.entry-title a {
    font-family: "Georgia", "Times New Roman", serif;
    font-weight: 700;
    letter-spacing: -0.02em;
}

/* --- Global card/post styling --- */
.article-content,
.tg-module-block .tg-module-info {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
    overflow: hidden;
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.article-content:hover,
.tg-module-block .tg-module-info:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,0.1);
    transform: translateY(-2px);
}

/* Post content padding */
.article-content .entry-content-block,
.tg-module-block .tg-module-info {
    padding: 8px 12px;
}

/* --- Post titles --- */
.article-content .entry-title a,
.tg-module-block .entry-title a {
    color: #1a1a1a;
    font-weight: 700;
    line-height: 1.3;
    text-decoration: none;
}

.article-content .entry-title a:hover,
.tg-module-block .entry-title a:hover {
    color: #2E8B57;
}

/* --- Category labels --- */
.cat-links a {
    text-transform: uppercase;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.8px;
    border-radius: 3px;
    padding: 3px 8px;
}

/* --- Post meta (date, author) --- */
.below-entry-meta span,
.below-entry-meta a,
.entry-meta span,
.entry-meta a {
    font-size: 12px;
    color: #888;
}

/* --- Featured slider overlay --- */
.category-slide .entry-title a {
    text-shadow: 1px 1px 4px rgba(0,0,0,0.6);
}

/* --- Excerpt --- */
.entry-summary p {
    color: #555;
    line-height: 1.75;
    font-size: 14px;
}

/* --- Sidebar --- */
.widget {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
    padding: 12px;
    margin-bottom: 16px;
}

.widget-title {
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    font-weight: 700;
    border-bottom: 3px solid #2E8B57;
    padding-bottom: 12px;
    margin-bottom: 16px;
    color: #1a1a1a;
}

/* --- Navigation --- */
.cm-header-bottom-row {
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

#cm-primary-menu li a {
    font-size: 13px;
    font-weight: 500;
    letter-spacing: 0.6px;
    text-transform: uppercase;
    padding: 14px 16px;
    transition: background 0.2s ease;
    position: relative;
}

#cm-primary-menu li a:hover {
    background: rgba(0,0,0,0.15);
}

#cm-primary-menu li.current-menu-item > a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 16px;
    right: 16px;
    height: 2px;
    background: #fff;
    border-radius: 2px;
}

/* --- Header area --- */
#masthead {
    box-shadow: 0 1px 6px rgba(0,0,0,0.05);
}

/* Hide tagline */
.cm-site-description,
.cm-tagline-show-desktop,
#site-description {
    display: none !important;
}

/* --- Footer --- */
.site-footer {
    border-top: none;
}

.site-footer a {
    color: #a0d2db;
    transition: color 0.2s ease;
}

.site-footer a:hover {
    color: #fff;
}

/* --- Buttons / Read more --- */
.read-more a,
.more-link {
    display: inline-block;
    background: #2E8B57;
    color: #fff;
    padding: 8px 20px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    text-decoration: none;
    transition: background 0.2s ease;
}

.read-more a:hover,
.more-link:hover {
    background: #247048;
    color: #fff;
}

/* --- Images --- */
.post-thumbnail img,
.featured-image img,
.article-content img {
    border-radius: 6px 6px 0 0;
}

/* --- Ad placeholder --- */
.ad-placeholder {
    background: #f9f9f9;
    border: 1px dashed #ddd;
    border-radius: 6px;
    text-align: center;
    padding: 20px;
    color: #999;
    font-size: 12px;
}

/* --- Spacing & Layout --- */
.inner-wrap {
    max-width: 1200px;
}

/* Wider content spacing */
#primary {
    padding-top: 24px;
}

/* --- Front page sections spacing --- */
.tg-container .tg-column-wrapper {
    gap: 20px;
}

/* --- Pagination --- */
.pagination a,
.pagination span {
    border-radius: 4px;
}

/* --- Mobile ad optimization --- */
@media (max-width: 768px) {
    /* Hide desktop-only header/footer 728x90 ads */
    .cm-header-main-row .cm-html-1,
    .advertisement_above_footer .widget_custom_html {
        display: none;
    }

    /* Sidebar ads: responsive on mobile */
    .widget_custom_html div[style],
    #cm-secondary .widget_custom_html div[style] {
        width: 100% !important;
        max-width: 100% !important;
        height: auto !important;
        min-height: 100px !important;
        box-sizing: border-box !important;
        overflow: hidden !important;
    }

    /* Tighter spacing on mobile */
    .widget {
        padding: 10px;
        margin-bottom: 12px;
    }

    .article-content .entry-content-block {
        padding: 8px 10px;
    }

    /* Stack sidebar below content */
    #cm-secondary {
        margin-top: 20px;
    }
}

/* --- Sticky bottom ad on mobile --- */
@media (max-width: 768px) {
    .mobile-sticky-ad {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        z-index: 9999;
        background: #fff;
        box-shadow: 0 -2px 8px rgba(0,0,0,0.1);
        text-align: center;
        padding: 6px 0;
    }
}

/* --- Related Posts --- */
.dp-related-posts {
    margin-top: 40px;
    padding-top: 24px;
    border-top: 2px solid #f0f0f0;
}

.dp-related-title {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 16px;
    color: #1a1a1a;
}

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

.dp-related-item {
    text-decoration: none;
    color: #1a1a1a;
    border-radius: 6px;
    overflow: hidden;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.dp-related-item:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    transform: translateY(-2px);
}

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

.dp-related-item-title {
    display: block;
    padding: 10px 12px;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.4;
}

@media (max-width: 768px) {
    .dp-related-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .dp-related-item img {
        height: 180px;
    }
}

/* --- Prev/Next Navigation --- */
.post-navigation,
nav.navigation.post-navigation {
    margin-top: 32px;
    padding: 20px 0;
    border-top: 2px solid #f0f0f0;
    border-bottom: 2px solid #f0f0f0;
}

.post-navigation a {
    color: #1a1a1a;
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    transition: color 0.2s ease;
}

.post-navigation a:hover {
    color: #2E8B57;
}

/* --- Smooth transitions --- */
a {
    transition: color 0.2s ease;
}
