/*
 * File: /assets/css/base/global.css
 * Description: This is the foundational stylesheet for the entire Priceyoo theme.
 * It sets CSS variables, base typography, layout, and default styles for common HTML elements.
 * VERSION 2.5: Added styles for Read More Toggle and FAQ Accordions.
 */

/* ==========================================================================
   1. CSS Variables (Root Configuration)
   ========================================================================== */
:root {
    /* Colors */
    --py-primary-color: #C8102E; /* Main brand color */
    --py-primary-dark: #a20d24;  /* For hover states */
    --py-primary-rgb: 200, 16, 46; /* For rgba() usage */
    
    --py-secondary-color: #1a202c; /* Dark color for footer/text */
    --py-accent-color: #f5af19;    /* Accent color for highlights */
    
    --py-text-color: #2d3748;      /* Main body text */
    
    /* ACCESSIBILITY FIX: Increased contrast for light text on white backgrounds. */
    --py-text-light: #4A5568;     /* Lighter text for meta info. Was #718096 */
    
    --py-border-color: #e2e8f0;   /* Default border color */
    
    --py-bg-color: #f7fafc;        /* Page background */
    --py-card-bg: #ffffff;        /* Background for cards/widgets */

    /* ACCESSIBILITY ADDITION: New variable for high-contrast text on dark footer. */
    --py-footer-text-color: #a0aec0; /* For footer text on dark background */

    /* Typography */
    --py-font-primary: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --py-font-secondary: 'Poppins', sans-serif; /* For headings if needed */
    
    /* Spacing & Layout */
    --py-container-width: 1200px;
    --py-border-radius: 8px;
}

/* ==========================================================================
   2. Base Resets & Body Defaults
   ========================================================================== */
*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: var(--py-font-primary);
    font-size: 16px;
    line-height: 1.7;
    color: var(--py-text-color);
    background-color: var(--py-bg-color);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    /* NEW: Prevent horizontal scroll caused by third-party elements like Adsense overlays */
    overflow-x: hidden;
}

/* ==========================================================================
   3. Global Layout
   ========================================================================== */
#page {
    /* NEW: Ensure the main site wrapper also prevents horizontal overflow */
    overflow-x: hidden;
}

.container {
    max-width: var(--py-container-width);
    width: 100%;
    margin-left: auto;
    margin-right: auto;
    padding-left: 20px;
    padding-right: 20px;
}

/* Full-width container for heroes/special sections */
.container-fluid {
    width: 100%;
    padding-left: 20px;
    padding-right: 20px;
}

/* ==========================================================================
   4. Typography (Headings, Links, Paragraphs)
   ========================================================================== */
h1, h2, h3, h4, h5, h6 {
    margin-top: 0;
    margin-bottom: 0.75em;
    font-family: var(--py-font-secondary);
    font-weight: 700;
    line-height: 1.3;
    color: var(--py-secondary-color);
}

/* Desktop Sizes */
h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.75rem; }
h4 { font-size: 1.5rem; }
h5 { font-size: 1.25rem; }
h6 { font-size: 1rem; }

p {
    margin-top: 0;
    margin-bottom: 1.25em;
}

a {
    color: var(--py-primary-color);
    text-decoration: none;
    transition: color 0.2s ease-in-out;
}

a:hover {
    color: var(--py-primary-dark);
}

.archive-title {
    font-size: 1.8rem;
    margin-top: 15px;
}

/* ==========================================================================
   5. Default Element Styling (Buttons, Forms, Tables, Lists)
   ========================================================================== */

/* --- Buttons --- */
.button,
button,
input[type="button"],
input[type="reset"],
input[type="submit"] {
    display: inline-block;
    padding: 10px 20px;
    font-size: 1rem;
    font-weight: 600;
    font-family: var(--py-font-primary);
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    border: 1px solid transparent;
    border-radius: var(--py-border-radius);
    transition: all 0.2s ease-in-out;
    line-height: 1.5;
}

.button-primary,
button.button-primary,
input[type="submit"] {
    background-color: var(--py-primary-color);
    color: #fff;
}

.button-primary:hover,
button.button-primary:hover,
input[type="submit"]:hover {
    background-color: var(--py-primary-dark);
    color: #fff;
}

/* --- Forms --- */
input[type="text"],
input[type="email"],
input[type="search"],
input[type="password"],
textarea {
    width: 100%;
    padding: 10px 15px;
    border: 1px solid var(--py-border-color);
    border-radius: var(--py-border-radius);
    font-family: var(--py-font-primary);
    font-size: 1rem;
    background-color: #fff;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="search"]:focus,
input[type="password"]:focus,
textarea:focus {
    outline: none;
    border-color: var(--py-primary-color);
    box-shadow: 0 0 0 2px rgba(var(--py-primary-rgb), 0.2);
}

/* --- Lists --- */
ul, ol {
    margin: 0 0 1.5em 1.5em;
    padding: 0;
}

/* --- Tables --- */
table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1.5em;
}

th, td {
    padding: 12px;
    border: 1px solid var(--py-border-color);
    text-align: left;
}

th {
    background-color: #f8f9fa;
    font-weight: 600;
}

/* ==========================================================================
   6. WordPress Core Styles & Helper Classes
   ========================================================================== */
.screen-reader-text {
    border: 0;
    clip: rect(1px, 1px, 1px, 1px);
    clip-path: inset(50%);
    height: 1px;
    margin: -1px;
    overflow: hidden;
    padding: 0;
    position: absolute !important;
    width: 1px;
    word-wrap: normal !important;
}

/* ==========================================================================
   7. GLOBAL PAGINATION STYLES (Clean & Native)
   ========================================================================== */

/* 1. Main Wrapper */
.py-pagination {
    margin-top: 50px;
    margin-bottom: 40px;
    width: 100%;
    text-align: center;
    display: block;
}

/* 2. The List (UL) - Flexbox for Horizontal Layout */
/* Hum specific class 'ul.page-numbers' target kar rahe hain jo WP deta hai */
.py-pagination ul.page-numbers {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 10px;
    padding: 0;
    margin: 0;
    list-style: none;
    border: none;
}

/* 3. List Items (LI) - Reset defaults */
.py-pagination ul.page-numbers li {
    margin: 0;
    padding: 0;
    border: none;
    background: none;
    display: block;
}

/* 4. The Buttons (Links & Current Span) */
/* Specificity: .py-pagination -> ul -> li -> .page-numbers */
.py-pagination ul.page-numbers .page-numbers {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 44px;
    padding: 0 18px;
    
    /* Default Colors */
    background-color: #fff;
    border: 1px solid var(--py-border-color);
    color: var(--py-text-light);
    
    /* Typography & Shape */
    border-radius: 6px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    line-height: 1;
    transition: all 0.2s ease-in-out;
}

/* 5. HOVER STATE (Sirf Links ke liye) */
/* Hum 'a.page-numbers' ko target kar rahe hain taake 'span.current' par asar na ho */
.py-pagination ul.page-numbers a.page-numbers:hover {
    background-color: #fff; /* Background White rahega */
    color: var(--py-primary-color); /* Text Color Change */
    border-color: var(--py-primary-color); /* Border Color Change */
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

/* 6. CURRENT / ACTIVE PAGE */
/* Yeh 'span' hota hai, isliye iska background solid rakhenge */
.py-pagination ul.page-numbers span.page-numbers.current {
    background-color: var(--py-primary-color);
    color: #fff;
    border-color: var(--py-primary-color);
    cursor: default;
    transform: none;
    box-shadow: none;
}

/* 7. Icons Adjustment */
.py-pagination .page-numbers i {
    font-size: 0.85rem;
}

/* ==========================================================================
   8. MOBILE RESPONSIVENESS (Global Typography & Layout)
   ========================================================================== */
@media (max-width: 768px) {
    /* Adjust Heading Sizes for Mobile to prevent overflow */
    h1 { font-size: 1.8rem; }
    h2 { font-size: 1.6rem; }
    h3 { font-size: 1.4rem; }
    h4 { font-size: 1.2rem; }
    h5 { font-size: 1.1rem; }
    
    /* Adjust Container Padding for better space usage on small screens */
    .container, .container-fluid {
        padding-left: 15px;
        padding-right: 15px;
    }
    
    .archive-title {
        font-size: 1.0rem;
        margin-top: 15px; 
    }
}
    
/* ==========================================================================
   9. BREADCRUMBS STYLING
   ========================================================================== */
.breadcrumbs {
    list-style: none;
    margin: 0 0 20px 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    font-size: 0.9rem;
    color: var(--py-text-light);
}

.breadcrumbs li {
    display: inline-flex;
    align-items: center;
}

.breadcrumbs a {
    color: var(--py-text-light);
    text-decoration: none;
    transition: color 0.2s;
}

.breadcrumbs a:hover {
    color: var(--py-primary-color);
}

.breadcrumbs .separator {
    margin: 0 8px;
    font-size: 0.7rem;
    color: #cbd5e0;
}

.breadcrumbs .bread-current {
    color: var(--py-text-color);
    font-weight: 600;
}

/* Mobile Adjustment */
@media (max-width: 768px) {
    .breadcrumbs {
        font-size: 0.8rem;
        margin-bottom: 15px;
    }
}

/* ==========================================================================
   10. THEME SPECIFIC GLOBAL STYLES
   ========================================================================== */
/* Fix for plan card logo aspect ratio */
.plan-card-wrapper .operator-logo {
    object-fit: contain;
}

/* ==========================================================================
   11. READ MORE TOGGLE STYLES (For Operator Description)
   ========================================================================== */
.py-read-more-wrap {
    position: relative;
    margin-bottom: 25px;
}

.py-read-more-content {
    overflow: hidden;
    transition: max-height 0.4s ease-out; /* Smooth open/close */
    position: relative;
}

.py-read-more-content.collapsed {
    max-height: 120px; /* Initial visible height */
}

/* Fade Out Effect for Collapsed State */
.py-read-more-content.collapsed::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 50px;
    background: linear-gradient(to bottom, rgba(255,255,255,0), rgba(255,255,255,1));
    pointer-events: none;
}

.py-read-more-btn {
    background: none;
    border: none;
    color: var(--py-primary-color);
    padding: 8px 0;
    font-weight: 600;
    cursor: pointer;
    font-size: 0.95rem;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: color 0.2s;
}

.py-read-more-btn:hover {
    color: var(--py-primary-dark);
    text-decoration: underline;
}

.py-read-more-btn i {
    font-size: 0.8em;
    transition: transform 0.3s ease;
}

.py-read-more-btn.active i {
    transform: rotate(180deg);
}

/* ==========================================================================
   12. FAQ ACCORDION STYLES (Global)
   ========================================================================== */
.py-faq-section {
    margin-top: 40px;
    margin-bottom: 40px;
    background: var(--py-card-bg);
    padding: 30px;
    border-radius: var(--py-border-radius);
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    border: 1px solid var(--py-border-color);
}

.py-faq-title {
    text-align: center;
    margin-bottom: 30px;
    font-size: 1.8rem;
    color: var(--py-secondary-color);
}

.py-faq-list {
    display: flex;
    flex-direction: column;
}

.py-faq-item {
    border-bottom: 1px solid var(--py-border-color);
}

.py-faq-item:last-child {
    border-bottom: none;
}

.py-faq-question {
    width: 100%;
    text-align: left;
    padding: 18px 0;
    background: none;
    border: none;
    font-weight: 600;
    font-size: 1.05rem;
    color: var(--py-secondary-color);
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: color 0.2s;
}

.py-faq-question:hover {
    color: var(--py-primary-color);
}

.py-faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
    color: var(--py-text-light);
    line-height: 1.7;
}

.py-faq-answer-inner {
    padding-bottom: 20px;
}

.py-faq-icon {
    transition: transform 0.3s ease;
    color: #cbd5e0;
}

.py-faq-item.active .py-faq-question {
    color: var(--py-primary-color);
}

.py-faq-item.active .py-faq-icon {
    transform: rotate(180deg);
    color: var(--py-primary-color);
}