/** 
Theme Name: Astra Child
Template: astra
Version: 1.0.0
Description: Custom child theme for mastery project
Author: Vincent Verso
*/

:root {
    /* Base Site Colors */
    --wp--preset--color--background: #F8F9FA;  /* Very light gray for the main background */
    --wp--preset--color--foreground: #212529;  /* Dark charcoal for main body text */

    /* Palette Colors */
    --wp--preset--color--base: #FFFFFF;        /* White for content backgrounds */
    --wp--preset--color--contrast: #000000;     /* Pure black for strong text */
    --wp--preset--color--primary: #005A9C;      /* Professional blue for buttons and links */
    --wp--preset--color--secondary: #6c757d;    /* Muted gray for secondary text */
    --wp--preset--color--tertiary: #FFC107;     /* A warm gold for accents or highlights */
}

/* Example: Specific override for links if needed */
a {
    color: var(--wp--preset--color--primary);
}

/* Custom Product Card Styling */
.custom-product-card {
    background: #fff;
    border-radius: 12px;
    padding: 20px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08); 
}

.custom-product-card:hover {
    transform: translateY(-8px); 
    box-shadow: 0 8px 24px rgba(0,0,0,0.15);
}

/* Add to cart button styling */
.woocommerce a.button.add_to_cart_button {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    border: none;
    padding: 12px 30px;
    border-radius: 50px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

/* Hover effect */
.woocommerce a.button.add_to_cart_button:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.4);   
}

/* Loading State */
.woocommerce a.button.add_to_cart_button.loading {
    opacity: 0.7;
    pointer-events: none;
}

/* Add ripple effect on click */
.woocommerce a.button.add_to_cart_button::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    transform: translate(-50%, -50%);
    transition: width 0.6s height 0.6s;
}

.woocommerce a.button.add_to_cart_button.loading::after {
    width: 300px;
    height: 300px;
}

.recent-posts-widget {
    display: grid;
    gap: 20px;
    margin: 30px 0;
}

.recent-post-item {
    display: flex;
    gap: 15px;
    padding: 15px;
    background: #f9f9f9;
    border-radius: 8px;
    transition: transform 0.2s ease;
}

.recent-post-item:hover {
    transform: translateX(5px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.recent-post-thumbnail img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 6px;
}

.recent-post-content h3 {
    margin: 0 0 5px 0;
    font-size: 18px;
}

.recent-post-date {
    color: #666;
    font-size: 14px;
}

/* Body Class Styling */
/* Target logged-in administrators */
/* These classes are applied to the <body> element using php found in functions.php */
body.user-role-administrator .admin-notice {
    display: block;
}

/* Target specific page */
body.page-contact .hero-section {
    background: #2c3e50;
}

/* Target child pages */
body.child-of-services .breadcrumbs {
    display: block;
}

/* Target mobile devices */
body.mobile-device .desktop-only {
    display: none !important;
}

/* --- General Portfolio Layout --- */
.portfolio-archive-wrapper {
    max-width: 1200px;
    margin: 40px auto;
    padding: 0 20px;
    font-family: sans-serif;
}

.portfolio-header {
    text-align: center;
    margin-bottom: 40px;
}

.portfolio-header h1 {
    font-size: 2.5em;
    margin-bottom: 10px;
}

.portfolio-header p {
    font-size: 1.1em;
    color: #666;
}

/* --- Filter Buttons --- */
.portfolio-filters {
    margin-top: 30px;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
}

.filter-btn {
    background-color: #f0f0f0;
    border: 1px solid #ddd;
    border-radius: 20px;
    padding: 8px 18px;
    font-size: 0.9em;
    cursor: pointer;
    transition: all 0.3s ease;
}

.filter-btn:hover {
    background-color: #e0e0e0;
}

.filter-btn.active {
    background-color: #0073aa; /* WordPress blue */
    color: #fff;
    border-color: #0073aa;
}


/* --- Portfolio Grid Layout --- */
.portfolio-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 30px;
}

.portfolio-item {
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 8px rgba(0,0,0,0.05);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    position: relative; /* For featured badge */
    display: block; /* Default state for filtering */
}

.portfolio-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 16px rgba(0,0,0,0.1);
}

/* Class for hiding items with JS */
.portfolio-item.hidden {
    display: none;
}

/* --- Image Hover Effect --- */
.portfolio-image {
    position: relative;
    overflow: hidden;
}

.portfolio-image img {
    display: block;
    width: 100%;
    height: auto;
}

.portfolio-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    color: #fff;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.portfolio-item:hover .portfolio-overlay {
    opacity: 1;
}

.portfolio-link {
    color: #fff;
    font-size: 1.2em;
    text-decoration: none;
    padding: 10px 20px;
    border: 2px solid #fff;
    border-radius: 5px;
}

/* --- Content & Badges --- */
.portfolio-content {
    padding: 20px;
}

.portfolio-content h2 {
    margin-top: 0;
    font-size: 1.4em;
    margin-bottom: 15px;
}

.portfolio-client, .portfolio-year {
    color: #555;
    font-size: 0.9em;
    margin: 5px 0;
}

.term-badge {
    display: inline-block;
    background-color: #f0f0f0;
    color: #555;
    padding: 3px 12px;
    border-radius: 15px;
    font-size: 0.75em;
    margin: 5px 5px 10px 0;
    font-weight: 500;
}

.featured-badge {
    position: absolute;
    top: 15px;
    right: 15px;
    background-color: #d9534f; /* Red */
    color: white;
    padding: 5px 10px;
    font-size: 0.8em;
    border-radius: 5px;
    z-index: 10;
}

.external-link {
    display: inline-block;
    margin-top: 20px;
    font-weight: bold;
    text-decoration: none;
    color: #0073aa;
    font-size: 0.9em;
}

.portfolio-terms {
    /* Adds a bit of space below the container */
    margin-bottom: 10px; 
}

.portfolio-excerpt p {
    /* Control the excerpt text size and line height */
    font-size: 0.9em;
    color: #555;
    line-height: 1.6;
    margin: 0; /* Remove default paragraph margin */
}

/* --- Pagination --- */
.pagination {
    margin-top: 40px;
    text-align: center;
}
.nav-links .page-numbers {
    display: inline-block;
    padding: 8px 12px;
    margin: 0 2px;
    border: 1px solid #ddd;
    text-decoration: none;
    color: #333;
}
.nav-links .page-numbers.current, .nav-links .page-numbers:hover {
    background-color: #0073aa;
    color: #fff;
    border-color: #0073aa;
}

/* Defensive fix for portfolio grid */
.portfolio-image {
    /* This ensures the container never collapses to 0px height */
    min-height: 200px; 
    
    /* This gives it a fallback color if no image loads */
    background-color: #f0f0f0; 
    
    /* These will help center the alt text if the image breaks */
    display: flex;
    align-items: center;
    justify-content: center;
}

/* This makes the alt text (like "Placeholder") look better */
.portfolio-image img {
    color: #666;
    font-family: sans-serif;
    font-size: 14px;
}