/*
Theme Name: JRC New Theme
Theme URI: https://jrc.gov.jm
Author: JRC IT Team
Author URI: https://jrc.gov.jm
Description: Modern Full Site Editing (FSE) block theme for the Jamaica Racing Commission with complete visual editing capabilities.
Requires at least: 6.0
Tested up to: 6.4
Requires PHP: 7.4
Version: 2.0.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: jrc-theme
Tags: full-site-editing, block-patterns, custom-colors, custom-menu, featured-images, threaded-comments, translation-ready
*/

/* 
 * Global Styles
 * Most styles are controlled via theme.json
 * Additional utility styles below
 */

/* Utility Classes */
.highlight {
    color: var(--wp--preset--color--secondary);
}

.badge {
    display: inline-block;
    background-color: var(--wp--preset--color--secondary);
    color: var(--wp--preset--color--light);
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: var(--wp--preset--font-size--small);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Hero image wrapper with decorative ring */
.hero-image-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem !important;
}

.hero-image-wrapper::before {
    content: '';
    position: absolute;
    inset: -8px;
    border-radius: 50%;
    border: 2px solid #7DCFEC;
    opacity: 0.5;
    pointer-events: none;
}

.hero-image-wrapper::after {
    content: '';
    position: absolute;
    inset: -20px;
    border-radius: 50%;
    border: 1.5px solid #7DCFEC;
    opacity: 0.25;
    pointer-events: none;
}

.hero-circle-image {
    border-radius: 50%;
    overflow: hidden;
    margin: 0 auto !important;
    box-shadow: 0 20px 60px rgba(0, 43, 91, 0.2);
}

.hero-circle-image img {
    border-radius: 50% !important;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    aspect-ratio: 1 / 1;
}

/* Card Styles */
.wp-block-group.is-style-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    border: 1px solid var(--wp--preset--color--gray-200);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.wp-block-group.is-style-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

/* Service Card Specific */
.wp-block-group.is-style-service-card {
    background: linear-gradient(135deg, #f8fafc 0%, #ffffff 100%);
    border-radius: 16px;
    padding: 2.5rem;
    box-shadow: 0 4px 20px rgba(0, 43, 91, 0.08);
    transition: all 0.3s ease;
    border: 1px solid var(--wp--preset--color--gray-200);
    height: 100%;
}

.wp-block-group.is-style-service-card:hover {
    box-shadow: 0 10px 40px rgba(0, 43, 91, 0.15);
    transform: translateY(-5px);
}

/* Top Bar Styling */
.is-style-top-bar {
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.is-style-top-bar .wp-block-navigation .wp-block-navigation-item a {
    padding: 0.25rem 0.75rem;
}

/* Navigation Dropdowns for Top Bar */
.is-style-top-bar .wp-block-navigation .wp-block-navigation-submenu {
    background-color: var(--wp--preset--color--navy);
}

/* Social Icons Custom Style */
.wp-block-social-links.is-style-jrc-social .wp-block-social-link {
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    transition: all 0.3s ease;
}

.wp-block-social-links.is-style-jrc-social .wp-block-social-link:hover {
    background-color: var(--wp--preset--color--gold);
    transform: scale(1.1);
}

/* Accessibility */
.screen-reader-text {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* 
 * Racehorse Retirement Project Styles
 */

.rrp-hero {
    background: radial-gradient(circle at center, var(--wp--preset--color--navy), #001529);
    padding: 100px 20px;
    text-align: center;
    color: white;
}

.rrp-hero h1 {
    font-size: clamp(2.5rem, 5vw, 4rem);
    margin-bottom: 1rem;
    color: white;
}

.gold-highlight {
    color: var(--wp--preset--color--gold);
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 2px;
    display: block;
    font-size: 1.25rem;
    margin-top: 1rem;
}

.rrp-card {
    background: white;
    border: 1px solid var(--wp--preset--color--gray-200);
    border-radius: 20px;
    padding: 3rem;
    height: 100%;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
    transition: var(--wp--custom--transition);
}

.rrp-card:hover {
    transform: translateY(-8px);
    border-color: var(--wp--preset--color--primary);
}

.value-item {
    padding: 2rem;
    background: #fdfdfd;
    border: 1px solid #f0f0f0;
    border-radius: 12px;
    transition: var(--wp--custom--transition);
    height: 100%;
}

.value-item:hover {
    border-color: var(--wp--preset--color--gold);
    background: white;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.05);
}

.video-box {
    background: white;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    height: 100%;
}

.video-wrapper {
    position: relative;
    padding-bottom: 56.25%;
    /* 16:9 */
    height: 0;
}

.video-wrapper iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

.video-info {
    padding: 1rem 1.5rem;
    background: var(--wp--preset--color--navy);
    color: var(--wp--preset--color--gold);
    font-weight: 700;
    font-size: 0.9rem;
}

/* Partner Network Table */
.table-container {
    background: white;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.05);
    border: 1px solid var(--wp--preset--color--gray-200);
}

.wp-block-table.is-style-rrp-table table {
    width: 100%;
    border-collapse: collapse;
}

.wp-block-table.is-style-rrp-table th {
    background: var(--wp--preset--color--navy);
    color: white;
    text-align: left;
    padding: 1.5rem;
    font-weight: 600;
}

.wp-block-table.is-style-rrp-table td {
    padding: 1.5rem;
    border-bottom: 1px solid var(--wp--preset--color--gray-100);
    color: var(--wp--preset--color--gray-600);
}

/* Link Groups */
.link-group {
    background: white;
    padding: 2rem;
    border-radius: 16px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    border: 1px solid var(--wp--preset--color--gray-200);
    height: 100%;
}

.link-group h3 {
    border-bottom: 2px solid var(--wp--preset--color--gold);
    padding-bottom: 0.5rem;
    display: inline-block;
    margin-bottom: 1.5rem;
}

.article-date {
    display: block;
    font-size: 0.85rem;
    color: var(--wp--preset--color--gray-600);
    font-weight: 400;
}

/* Additional Responsive and Layout Fixes */
.grid-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
}

@media (max-width: 768px) {
    .grid-2 {
        grid-template-columns: 1fr;
    }
}

.mission-vision {
    background-color: var(--wp--preset--color--gray-50);
}

.section-header p {
    color: var(--wp--preset--color--gray-600);
    max-width: 700px;
    margin: 0 auto;
}

.values-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.video-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
}

@media (max-width: 1024px) {
    .video-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .video-grid {
        grid-template-columns: 1fr;
    }
}

.partners-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 3rem;
}

.link-list {
    list-style: none;
    padding: 0;
}

.link-list li {
    margin-bottom: 1.25rem;
    padding-left: 1.5rem;
    position: relative;
}

.link-list li::before {
    content: "➤";
    color: var(--wp--preset--color--gold);
    position: absolute;
    left: 0;
    top: 2px;
    font-size: 0.8rem;
}

.link-list a {
    color: var(--wp--preset--color--secondary);
    font-weight: 600;
    text-decoration: none;
    transition: color 0.2s;
    display: block;
}

.link-list a:hover {
    color: var(--wp--preset--color--navy);
    text-decoration: underline;
}

/* Video Gallery Spans */
.featured-video {
    grid-column: span 3;
}

@media (max-width: 1024px) {
    .featured-video {
        grid-column: span 2;
    }
}

@media (max-width: 768px) {
    .featured-video {
        grid-column: span 1;
    }
}

/* Fix for obstructed navigation and readability in dark sections */
.is-style-top-bar a,
.is-style-footer a {
    color: var(--wp--preset--color--light) !important;
}

.is-style-top-bar a:hover,
.is-style-footer a:hover {
    color: var(--wp--preset--color--gold) !important;
}

/* Ensure footer headings and text are readable */
.is-style-footer h1,
.is-style-footer h2,
.is-style-footer h3,
.is-style-footer h4,
.is-style-footer p {
    color: var(--wp--preset--color--light);
}

/* Stronger overrides for navigation readability */
.is-style-top-bar .wp-block-navigation .wp-block-navigation-item a,
.is-style-top-bar .wp-block-navigation .wp-block-navigation-link,
.is-style-footer .wp-block-navigation .wp-block-navigation-item a,
.is-style-footer .wp-block-navigation .wp-block-navigation-link {
    color: var(--wp--preset--color--light) !important;
}

.is-style-top-bar .wp-block-navigation .wp-block-navigation-item a:hover,
.is-style-footer .wp-block-navigation .wp-block-navigation-item a:hover {
    color: var(--wp--preset--color--gold) !important;
}

/* JRC Carousel Styles */
.jrc-carousel {
    position: relative;
    width: 100%;
    overflow: hidden;
    background: var(--wp--preset--color--gray-50);
}

.carousel-track {
    position: relative;
    height: 450px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.carousel-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 0.8s ease-in-out;
    display: flex;
    align-items: center;
    justify-content: center;
    background-size: cover;
    background-position: center;
}

.carousel-slide.active {
    opacity: 1;
    z-index: 1;
}

.slide-content {
    background: rgba(0, 43, 91, 0.8);
    color: white;
    padding: 3rem;
    border-radius: 12px;
    max-width: 600px;
    text-align: center;
    border-left: 5px solid var(--wp--preset--color--gold);
}

.slide-content h3 {
    color: white;
    font-size: 2rem;
    margin-bottom: 1rem;
}

.carousel-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 43, 91, 0.5);
    color: white;
    border: none;
    padding: 1rem;
    cursor: pointer;
    z-index: 10;
    transition: background 0.3s;
    font-size: 1.5rem;
}

.carousel-nav:hover {
    background: var(--wp--preset--color--navy);
}

.carousel-nav.prev {
    left: 1rem;
}

.carousel-nav.next {
    right: 1rem;
}

.carousel-indicators {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 0.75rem;
    z-index: 10;
}

.carousel-indicators button {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 2px solid white;
    background: transparent;
    cursor: pointer;
    padding: 0;
}

.carousel-indicators button.active {
    background: white;
}

@media (max-width: 768px) {
    .carousel-track {
        height: 400px;
    }

    .slide-content {
        margin: 0 2rem;
        padding: 1.5rem;
    }
}

/* Fix for Navigation Dropdown Visibility */

/* Top Bar Dropdowns (on Navy background) */
.is-style-top-bar .wp-block-navigation .wp-block-navigation__submenu-container {
    background-color: var(--wp--preset--color--navy) !important;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.is-style-top-bar .wp-block-navigation .wp-block-navigation-item .wp-block-navigation-item__label {
    color: var(--wp--preset--color--light) !important;
}

.is-style-top-bar .wp-block-navigation .wp-block-navigation-submenu__toggle {
    color: var(--wp--preset--color--light) !important;
}

/* Main Header Dropdowns (on Light background) */
.main-header .wp-block-navigation .wp-block-navigation__submenu-container,
header .wp-block-navigation .wp-block-navigation__submenu-container {
    background-color: #ffffff !important;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

.main-header .wp-block-navigation .wp-block-navigation-item a,
header .wp-block-navigation .wp-block-navigation-item a {
    color: var(--wp--preset--color--navy) !important;
}

.main-header .wp-block-navigation .wp-block-navigation-item a:hover,
header .wp-block-navigation .wp-block-navigation-item a:hover {
    color: var(--wp--preset--color--primary) !important;
}

/* Common Dropdown Fixes */
.wp-block-navigation-item__content {
    color: inherit !important;
}

.wp-block-navigation-submenu__toggle {
    color: inherit !important;
}

/* Force white color for all navigation elements in Top Bar */
.is-style-top-bar .wp-block-navigation,
.is-style-top-bar .wp-block-navigation a,
.is-style-top-bar .wp-block-navigation span,
.is-style-top-bar .wp-block-navigation button {
    color: var(--wp--preset--color--light) !important;
}

.is-style-top-bar .wp-block-navigation .wp-block-navigation__submenu-container {
    background-color: var(--wp--preset--color--navy) !important;
}

.is-style-top-bar .wp-block-navigation a:hover {
    color: var(--wp--preset--color--gold) !important;
}

/* Ultimate Readability Fix for Navigation & Links in Dark Sections */
.is-style-top-bar .wp-block-navigation *,
.is-style-footer .wp-block-navigation * {
    color: var(--wp--preset--color--light) !important;
}

.is-style-top-bar .wp-block-navigation a:hover,
.is-style-footer .wp-block-navigation a:hover {
    color: var(--wp--preset--color--gold) !important;
}

/* Specific fix for footer link lists that might not be navigation blocks */
.is-style-footer ul li a,
.is-style-footer .wp-block-list a {
    color: var(--wp--preset--color--light) !important;
}

.is-style-footer ul li a:hover,
.is-style-footer .wp-block-list a:hover {
    color: var(--wp--preset--color--gold) !important;
}