/*
 Theme Name:   GeneratePress Child
 Theme URI:    https://generatepress.com
 Description:  Default GeneratePress child theme
 Author:       Tom Usborne
 Author URI:   https://tomusborne.com
 Template:     generatepress
 Version:      0.1
*/

html {
    scroll-behavior: smooth;
}

/* Base Layout Resets */
.habic-homepage-wrapper {
    width: 100%;
    overflow-x: hidden;
}
.text-center { text-align: center; }

/* ==========================================================================
   1. HABIC EPIC HERO SECTION
   ========================================================================== */
.habic-hero {
    position: relative;
    background-image: linear-gradient(180deg, rgba(0, 0, 0, 0.4) 0%, rgba(0, 0, 0, 0.4) 100%), 
                      url('https://www.havingababyinchina.com/wp-content/uploads/2009/05/JKBelly.jpg') !important;
    background-repeat: no-repeat;
    background-position: right center;
    background-size: cover;
    min-height: 600px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding-bottom: 100px;
}

.habic-hero-inner {
    text-align: center;
    padding: 0 20px;
    z-index: 2;
}

.hero-welcome-text {
    font-family: inherit;
    color: #800000 !important;
    font-size: 90px !important;
    font-weight: 700;
    line-height: 1.1;
    margin: 0 0 10px 0;
    text-transform: none;
}

.hero-main-title {
    color: #ffffff !important;
    font-size: 64px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin: 0;
    line-height: 1.2;
    text-shadow: 1px 2px 8px rgba(0, 0, 0, 0.3);
}

.hero-diagonal-divider {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    overflow: hidden;
    line-height: 0;
    z-index: 1;
}

.hero-diagonal-divider svg {
    position: relative;
    display: block;
    width: calc(100% + 1.3px);
    height: 90px;
}

@media (max-width: 768px) {
    .habic-hero {
        min-height: 450px;
        background-position: 75% center;
        padding-bottom: 60px;
    }
    .hero-welcome-text {
        font-size: 40px !important;
        margin-bottom: 5px;
    }
    .hero-main-title {
        font-size: 32px !important;
        letter-spacing: 0px;
    }
    .hero-diagonal-divider svg {
        height: 45px;
    }
}

/* ==========================================================================
   2. VITALS 3-COLUMN SECTIONS
   ========================================================================== */
.habic-vitals-section {
    max-width: 1140px;
    margin: 60px auto;
    padding: 0 20px;
}
.vitals-header h3 {
    font-size: 1.1rem;
    color: #666666;
    margin-bottom: 5px;
    font-weight: normal;
}
.vitals-header h2 {
    font-size: 2rem;
    color: #a31d1d;
    text-transform: uppercase;
    font-weight: 800;
    margin-top: 0;
    margin-bottom: 40px;
}
.vitals-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 40px;
    margin-bottom: 40px;
}
.vital-card {
    text-align: center;
}
.vital-icon {
    font-size: 2.5rem;
    margin-bottom: 15px;
}
.vital-card h4 {
    font-size: 1.3rem;
    color: #a31d1d;
    font-weight: 700;
    margin-bottom: 15px;
}
.vital-card p {
    font-size: 0.95rem;
    line-height: 1.6;
    color: #444444;
}
.habic-btn-primary {
    display: inline-block;
    background: #a31d1d;
    color: #fff !important;
    padding: 12px 35px;
    font-weight: bold;
    text-transform: uppercase;
    text-decoration: none;
    border-radius: 4px;
    transition: background 0.2s ease;
}
.habic-btn-primary:hover {
    background: #7a1414;
}

/* ==========================================================================
   3. SPLIT ABOUT US ROW
   ========================================================================== */
.habic-split-about {
    display: flex;
    width: 100%;
    background: #a31d1d;
}
.about-image-side {
    flex: 1;
    display: flex;
}
.about-native-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.about-text-side {
    flex: 1;
    background: #a31d1d;
    color: #ffffff;
    display: flex;
    align-items: center;
    padding: 60px;
}
.about-inner-content {
    max-width: 500px;
}
.about-inner-content h2 {
    font-size: 2.2rem;
    text-transform: uppercase;
    font-weight: 800;
    margin: 0 0 10px 0;
}
.habic-accent-line {
    width: 40px;
    border: none;
    height: 3px;
    background: #ffffff;
    margin: 0 0 20px 0;
}
.about-inner-content p {
    font-size: 1.05rem;
    line-height: 1.7;
    opacity: 0.95;
}

/* ==========================================================================
   4. LET'S CONNECT CONTACT ROW
   ========================================================================== */
.habic-connect-section {
    background: url('https://www.havingababyinchina.com/wp-content/uploads/2022/08/JKPregBeach.jpg') no-repeat center center;
    background-size: cover;
    padding: 100px 20px;
    position: relative;
}
.connect-container {
    max-width: 1140px;
    margin: 0 auto;
    display: flex;
    justify-content: flex-start;
}
.connect-form-card {
    background: rgba(255, 255, 255, 0.96);
    padding: 40px;
    border-radius: 6px;
    width: 100%;
    max-width: 450px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
}
.habic-fallback-form input,
.habic-fallback-form select,
.habic-fallback-form textarea {
    width: 100%;
    padding: 12px;
    margin-bottom: 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.95rem;
}
.habic-btn-submit {
    background: #a31d1d;
    color: #fff;
    border: none;
    width: 100%;
    padding: 14px;
    text-transform: uppercase;
    font-weight: bold;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.2s;
}
.habic-btn-submit:hover { background: #7a1414; }

/* Responsive Grid Adapters for Home Page Elements */
@media (max-width: 992px) {
    .vitals-grid { grid-template-columns: repeat(2, 1fr); }
    .habic-split-about { flex-direction: column; }
    .about-image-side { min-height: 300px; height: 350px; }
    .connect-container { justify-content: center; }
}
@media (max-width: 768px) {
    .hero-main { font-size: 2.2rem; }
    .hero-sub { font-size: 1.6rem; }
    .vitals-grid { grid-template-columns: 1fr; }
    .about-text-side { padding: 40px 20px; }
}

/* ==========================================================================
   5. SITE-WIDE DIRECTORY GRID ENGINE (AFFILIATES, PODCASTS, HOSPITALS)
   ========================================================================== */
.habic-affiliates-container {
    max-width: 1200px;
    margin: 40px auto;
    padding: 0 20px;
}

/* * CRITICAL FIX: Changed from column-count to a CSS Grid template layout.
 * This guarantees items render horizontally across rows from left-to-right.
 */
.habic-affiliate-grid {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 30px !important;
    width: 100% !important;
}

/* Individual Card Structural Adjustments */
.affiliate-card {
    background: #ffffff;
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    margin: 0 !important; /* Managed seamlessly by the explicit grid gap setting now */
    display: flex !important; /* Stretches matching column cards to identical row heights */
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box;
}

/* Forces interior content containers to fill card height uniformly */
.affiliate-card-inner {
    padding: 25px;
    width: 100% !important;
    display: flex !important;
    flex-direction: column !important;
    height: 100% !important;
}

.affiliate-logo-wrap {
    text-align: center;
    margin-bottom: 20px;
}

.affiliate-logo-wrap img {
    max-width: 100%;
    height: auto;
    max-height: 120px;
    object-fit: contain;
}

.affiliate-title {
    font-size: 1.35rem;
    margin: 0 0 15px 0;
    color: #333333;
    font-weight: 700;
}

.affiliate-full-content,
.affiliate-excerpt {
    font-size: 0.95rem;
    line-height: 1.6;
    color: #444444;
}

.affiliate-full-content p,
.affiliate-excerpt p {
    margin-bottom: 12px;
}

/* Push footer elements straight to the base of the uniform grid card row block */
.affiliate-footer {
    margin-top: auto !important;
    padding-top: 15px;
}

/* Sponsored Highlight Feature (Affiliates Template) */
.affiliate-card.sponsored-highlight {
    border-top: 4px solid #d43f3a;
}

/* Lazy Load Visibility Safety Check */
.habic-lazy-hidden {
    display: none !important;
}

/* Responsive Directory Grid Adaptations */
@media (max-width: 992px) {
    .habic-affiliate-grid {
        grid-template-columns: repeat(2, 1fr) !important; /* 2 Columns on Tablets */
    }
}

@media (max-width: 650px) {
    .habic-affiliate-grid {
        grid-template-columns: 1fr !important; /* 1 Column on Mobile Phones */
        gap: 20px !important;
    }
}

/* ==========================================================================
   6. FEATURED HOSPITAL LISTINGS & PLUGIN HIGHLIGHTS (CATEGORY ARCHIVES)
   ========================================================================== */

/* Restoring your true yellow/orange theme for premium sponsored listings */
.category article.is-sponsored-listing,
.category article.featured-hospital-card {
    border-top: 4px solid #f79920 !important;
    background-color: #fffdf4 !important;
    box-shadow: 0 8px 24px rgba(247, 153, 32, 0.08) !important;
    transform: translateY(-2px);
    transition: all 0.3s ease-in-out;
    position: relative !important;
    overflow: hidden !important;
}

/* Hover interaction tracking states */
.category article.is-sponsored-listing:hover,
.category article.featured-hospital-card:hover {
    box-shadow: 0 12px 30px rgba(247, 153, 32, 0.15) !important;
    transform: translateY(-5px);
}

/* Featured corner ribbon banner */
.category article.is-sponsored-listing::before,
.category article.featured-hospital-card::before {
    content: 'Featured';
    position: absolute;
    top: 18px;
    right: -28px;
    width: 110px;
    background: #f79920;
    color: #ffffff;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    text-align: center;
    padding: 5px 0;
    transform: rotate(45deg);
    z-index: 10;
    pointer-events: none;
}

.category .inside-article {
    border-radius: 6px;
    overflow: hidden;
}