/*
 Theme Name:   GeneratePress Child
 Theme URI:    https://www.horoscope-day.com
 Description:  Child theme for GeneratePress
 Author:       horoscope-day.com
 Template:     generatepress
 Version:      1.0.0
 Text Domain:  generatepress-child
*/
/* Reserve space for images using their width/height attributes — prevents CLS */
img[width][height] {
    height: auto;
    max-width: 100%;
}

/* Prevent font-icon flash by hiding icon elements until font is ready */
@font-face {
    font-family: 'GeneratePress';
    src: url('../generatepress/assets/fonts/generatepress.woff2') format('woff2');
    font-display: block;
}

/* Reserve space for AdSense auto-placed ad containers to prevent CLS.
   The div starts at height:auto (0px) and expands when the ad loads.
   Pre-reserving space eliminates the layout shift. */
.google-auto-placed {
    min-height: 280px; /* covers leaderboard (90px) and medium rectangle (250px) */
    display: block;
    contain: layout style; /* isolate this element so its resize doesn't reflow the page */
}

@media (max-width: 768px) {
    .google-auto-placed {
        min-height: 100px; /* mobile banner is typically 50–100px */
    }
}

/* Reserve minimum space for AdSense ins tags */
ins.adsbygoogle {
    min-height: 90px;
    display: block;
}

@media (min-width: 769px) {
    img.header-image.is-logo-image.lazyloaded {
        max-width: 300px;
    }
    img.header-image.is-logo-image {
    max-width: 300px;
}
}

/* Footer navigation menu */
nav.footer-nav {
    text-align: center;
    margin-bottom: 8px;
}
nav.footer-nav ul.footer-menu {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 4px 16px;
}
nav.footer-nav ul.footer-menu li {
    margin: 0;
}
nav.footer-nav ul.footer-menu a {
    font-size: 0.85em;
}

/* Category description — collapsed with fade, expandable */
.taxonomy-description {
    position: relative;
    max-height: 5.8em; /* ~1 paragraph */
    overflow: hidden; 
    transition: max-height 0.35s ease;
}
.taxonomy-description::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2.5em;
    background: linear-gradient(to bottom, transparent, #fff);
    pointer-events: none;
    transition: opacity 0.25s ease;
}
.taxonomy-description.is-expanded {
    max-height: 600px; /* large enough for any description */ 
}
.taxonomy-description.is-expanded::after {
    opacity: 0;
}
.cat-desc-toggle {
    display: inline-block;
    margin-top: 6px;
    font-size: 0.88em;
    cursor: pointer;
    background: none;
    border: none;
    padding: 0;
    color: inherit;
    text-decoration: underline;
    text-underline-offset: 2px;
}

@media (max-width: 768px) {
    .separate-containers .inside-article, .separate-containers .comments-area, .separate-containers .page-header, .separate-containers .paging-navigation, .one-container .site-content, .inside-page-header {
        padding: 10px;
    }
} 

a.read-more {
    display: block;
    text-decoration: underline; /* must not rely on color alone — WCAG 1.4.1 */
}

/* wp-block-latest-posts post title links: enforce WCAG AA contrast (≥4.5:1 on white) */
a.wp-block-latest-posts__post-title {
    color: #0057b8;
}
a.wp-block-latest-posts__post-title:hover,
a.wp-block-latest-posts__post-title:focus {
    color: #003d82;
    text-decoration: underline;
}