/* ===========================================
   Gipedara Main Stylesheet - Deferred CSS
   Version: 1.0.1
   =========================================== */

/* --- CSS Variables --- */
:root {
  --gipedara-primary: #e53935;
  --gipedara-primary-dark: #c62828;
  --gipedara-primary-light: #ff6f61;
  --gipedara-bg: #1a1a1a;
  --gipedara-bg-alt: #1e1e1e;
  --gipedara-bg-dark: #111;
  --gipedara-bg-darker: #0a0a0a;
  --gipedara-bg-card: #222;
  --gipedara-bg-card-hover: #2a2a2a;
  --gipedara-text: #ccc;
  --gipedara-text-light: #ddd;
  --gipedara-text-muted: #888;
  --gipedara-text-muted-alt: #666;
  --gipedara-heading: #fff;
  --gipedara-border: #2a2a2a;
  --gipedara-radius: 8px;
  --gipedara-radius-sm: 4px;
  --gipedara-radius-lg: 12px;
  --gipedara-transition: .3s;
  --gipedara-font-body: 'Roboto', Arial, sans-serif;
  --gipedara-font-heading: 'Playfair Display', Georgia, serif;
  --gipedara-container: 1170px;
  --gipedara-header-height: 50px;
}

/* --- Featured / Hero Section --- */
.gipedara-featured-card { position: relative; border-radius: var(--gipedara-radius); overflow: hidden; margin-bottom: 25px; }
.gipedara-featured-card .gipedara-card__image { aspect-ratio: 21/9; }
.gipedara-featured-card .gipedara-card__image img { width: 100%; height: 100%; object-fit: cover; }
.gipedara-featured-card .gipedara-card__image::after { content: ''; position: absolute; bottom: 0; left: 0; right: 0; height: 60%; background: linear-gradient(transparent, rgba(0,0,0,.85)); }
.gipedara-featured-card .gipedara-card__body { position: absolute; bottom: 0; left: 0; right: 0; padding: 30px; z-index: 2; }
.gipedara-featured-card .gipedara-card__title { font-size: 28px; margin-bottom: 10px; }
.gipedara-featured-card .gipedara-card__title a { color: #fff !important; text-shadow: 0 2px 8px rgba(0,0,0,.5); }
.gipedara-featured-card .gipedara-card__meta { color: rgba(255,255,255,.7); }
.gipedara-featured-card .gipedara-card__excerpt { color: rgba(255,255,255,.8); text-shadow: 0 1px 4px rgba(0,0,0,.3); max-width: 600px; }

@media (max-width: 767px) {
  .gipedara-featured-card .gipedara-card__image { aspect-ratio: 16/9; }
  .gipedara-featured-card .gipedara-card__body { padding: 15px; }
  .gipedara-featured-card .gipedara-card__title { font-size: 20px; }
}

/* --- Category Badge Colors --- */
.gipedara-card .gipedara-card__category:nth-child(1) a { background: #e53935; }
.gipedara-card .gipedara-card__category:nth-child(2) a { background: #1e88e5; }
.gipedara-card .gipedara-card__category:nth-child(3) a { background: #43a047; }
.gipedara-card .gipedara-card__category:nth-child(4) a { background: #8e24aa; }
.gipedara-card .gipedara-card__category:nth-child(5) a { background: #fb8c00; }
.gipedara-card .gipedara-card__category:nth-child(6) a { background: #00897b; }
.gipedara-card .gipedara-card__category:nth-child(7) a { background: #d81b60; }
.gipedara-card .gipedara-card__category:nth-child(8) a { background: #00acc1; }
.gipedara-card .gipedara-card__category:nth-child(9) a { background: #ff8f00; }
.gipedara-card .gipedara-card__category:nth-child(10) a { background: #3949ab; }

/* --- Mega Menu --- */
.gipedara-mega-menu { display: flex; gap: 20px; padding: 20px; }
.gipedara-mega-menu .mega-col { flex: 1; }
.gipedara-mega-menu .mega-col-title { color: #fff; font-size: 14px; text-transform: uppercase; letter-spacing: 1px; margin-bottom: 12px; padding-bottom: 8px; border-bottom: 2px solid var(--gipedara-primary); }
.gipedara-mega-menu .mega-post { display: flex; gap: 10px; margin-bottom: 10px; align-items: flex-start; }
.gipedara-mega-menu .mega-post-thumb { width: 60px; height: 60px; border-radius: 4px; overflow: hidden; flex-shrink: 0; }
.gipedara-mega-menu .mega-post-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s; }
.gipedara-mega-menu .mega-post:hover .mega-post-thumb img { transform: scale(1.1); }
.gipedara-mega-menu .mega-post-title { font-size: 13px; line-height: 1.3; }
.gipedara-mega-menu .mega-post-title a { color: #ccc !important; text-transform: none !important; letter-spacing: 0 !important; font-weight: 400 !important; border: none !important; padding: 0 !important; }
.gipedara-mega-menu .mega-post-title a:hover { color: var(--gipedara-primary) !important; }
.gipedara-mega-menu .mega-post-date { font-size: 11px; color: #666; }

/* --- Homepage Sections --- */
.gipedara-section--hero { margin-bottom: 40px; }
.gipedara-section--latest { background: var(--gipedara-bg); padding: 30px 0; }
.gipedara-section--trending { background: var(--gipedara-bg-alt); padding: 30px 0; }
.gipedara-section--category { padding: 30px 0; }
.gipedara-section--striped:nth-child(odd) { background: var(--gipedara-bg); }
.gipedara-section--striped:nth-child(even) { background: var(--gipedara-bg-alt); }

/* --- Custom Widgets --- */
.gipedara-recent-posts-widget .rp-item { display: flex; gap: 12px; margin-bottom: 15px; padding-bottom: 15px; border-bottom: 1px solid var(--gipedara-border); }
.gipedara-recent-posts-widget .rp-item:last-child { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }
.gipedara-recent-posts-widget .rp-thumb { width: 80px; height: 60px; border-radius: 4px; overflow: hidden; flex-shrink: 0; }
.gipedara-recent-posts-widget .rp-thumb img { width: 100%; height: 100%; object-fit: cover; }
.gipedara-recent-posts-widget .rp-title { font-size: 14px; line-height: 1.3; margin-bottom: 4px; font-family: var(--gipedara-font-body); }
.gipedara-recent-posts-widget .rp-title a { color: #ddd; }
.gipedara-recent-posts-widget .rp-title a:hover { color: var(--gipedara-primary); }
.gipedara-recent-posts-widget .rp-date { font-size: 11px; color: #666; }

.gipedara-popular-posts-widget .pp-item { display: flex; gap: 12px; margin-bottom: 12px; padding-bottom: 12px; border-bottom: 1px solid var(--gipedara-border); align-items: center; }
.gipedara-popular-posts-widget .pp-item:last-child { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }
.gipedara-popular-posts-widget .pp-num { width: 28px; height: 28px; background: var(--gipedara-primary); color: #fff; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; flex-shrink: 0; }
.gipedara-popular-posts-widget .pp-title { font-size: 14px; line-height: 1.3; margin-bottom: 2px; }
.gipedara-popular-posts-widget .pp-title a { color: #ddd; }
.gipedara-popular-posts-widget .pp-title a:hover { color: var(--gipedara-primary); }
.gipedara-popular-posts-widget .pp-views { font-size: 11px; color: #666; }

.gipedara-categories-widget .cat-item { display: flex; justify-content: space-between; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--gipedara-border); }
.gipedara-categories-widget .cat-item:last-child { border-bottom: none; }
.gipedara-categories-widget .cat-item a { color: #ccc; font-size: 14px; }
.gipedara-categories-widget .cat-item a:hover { color: var(--gipedara-primary); padding-left: 5px; }
.gipedara-categories-widget .cat-count { background: var(--gipedara-border); color: #888; padding: 2px 10px; border-radius: 10px; font-size: 11px; }

.gipedara-social-widget { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.gipedara-social-widget a { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-radius: 4px; color: #fff; font-size: 13px; font-weight: 500; transition: opacity .2s; }
.gipedara-social-widget a:hover { opacity: .85; }
.gipedara-social-widget a[data-network="facebook"] { background: #1877f2; }
.gipedara-social-widget a[data-network="twitter"] { background: #000; }
.gipedara-social-widget a[data-network="instagram"] { background: linear-gradient(135deg, #405de6, #e4405f); }
.gipedara-social-widget a[data-network="youtube"] { background: #ff0000; }
.gipedara-social-widget a[data-network="linkedin"] { background: #0077b5; }
.gipedara-social-widget a[data-network="pinterest"] { background: #bd081c; }
.gipedara-social-widget a[data-network="telegram"] { background: #0088cc; }
.gipedara-social-widget a[data-network="tiktok"] { background: #000; }
.gipedara-social-widget a[data-network="threads"] { background: #000; }

.gipedara-ad-widget { background: var(--gipedara-bg-darker); padding: 15px; border-radius: 4px; text-align: center; min-height: 100px; display: flex; align-items: center; justify-content: center; }

/* --- Newsletter Widget --- */
.gipedara-newsletter-widget { background: linear-gradient(135deg, #1a237e, #e53935); padding: 25px; border-radius: var(--gipedara-radius); text-align: center; }
.gipedara-newsletter-widget h4 { color: #fff; font-size: 18px; margin-bottom: 8px; }
.gipedara-newsletter-widget p { color: rgba(255,255,255,.7); font-size: 13px; margin-bottom: 15px; }
.gipedara-newsletter-widget input[type="email"] { width: 100%; background: rgba(255,255,255,.15); border: none; padding: 10px 14px; border-radius: 4px; color: #fff; margin-bottom: 10px; }
.gipedara-newsletter-widget input[type="email"]::placeholder { color: rgba(255,255,255,.5); }
.gipedara-newsletter-widget input[type="submit"] { width: 100%; background: #fff; color: #e53935; border: none; padding: 10px 14px; border-radius: 4px; font-weight: 700; cursor: pointer; text-transform: uppercase; letter-spacing: .5px; transition: background .2s; }
.gipedara-newsletter-widget input[type="submit"]:hover { background: #f0f0f0; }

/* --- Tag Cloud --- */
.tagcloud { display: flex; flex-wrap: wrap; gap: 6px; }
.tagcloud a { display: inline-block; background: var(--gipedara-bg); color: #888; padding: 4px 12px; font-size: 12px !important; border-radius: 3px; border: 1px solid var(--gipedara-border); transition: all .2s; }
.tagcloud a:hover { background: var(--gipedara-primary); color: #fff; border-color: var(--gipedara-primary); }

/* --- Dark Mode Toggle --- */
.gipedara-dark-toggle { background: none; border: none; color: #ddd; font-size: 18px; cursor: pointer; padding: 8px; transition: color .2s; }
.gipedara-dark-toggle:hover { color: var(--gipedara-primary); }
[data-theme="light"] { --gipedara-bg: #f5f5f5; --gipedara-bg-alt: #eee; --gipedara-bg-dark: #fff; --gipedara-bg-darker: #e0e0e0; --gipedara-bg-card: #fff; --gipedara-bg-card-hover: #f5f5f5; --gipedara-text: #444; --gipedara-text-light: #222; --gipedara-text-muted: #888; --gipedara-heading: #111; --gipedara-border: #e0e0e0; }
[data-theme="light"] body { background: #f5f5f5; color: #444; }

/* --- Cookie Consent --- */
.gipedara-cookie-bar { position: fixed; bottom: 0; left: 0; right: 0; background: #111; padding: 15px 30px; z-index: 9998; display: none; align-items: center; justify-content: space-between; gap: 20px; border-top: 3px solid var(--gipedara-primary); }
.gipedara-cookie-bar.active { display: flex; }
.gipedara-cookie-bar p { color: #aaa; font-size: 13px; margin: 0; }
.gipedara-cookie-bar a { color: var(--gipedara-primary); }
.gipedara-cookie-btn { background: var(--gipedara-primary); color: #fff; border: none; padding: 8px 20px; border-radius: 4px; font-weight: 700; cursor: pointer; font-size: 13px; transition: background .2s; white-space: nowrap; }
.gipedara-cookie-btn:hover { background: var(--gipedara-primary-dark); }

/* --- Loading Spinner --- */
.gipedara-spinner { display: inline-block; width: 30px; height: 30px; border: 3px solid var(--gipedara-border); border-top-color: var(--gipedara-primary); border-radius: 50%; animation: spin .6s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* --- Skeleton Loader --- */
.gipedara-skeleton { background: linear-gradient(90deg, var(--gipedara-bg-card) 25%, var(--gipedara-bg-card-hover) 50%, var(--gipedara-bg-card) 75%); background-size: 200% 100%; animation: shimmer 1.5s infinite; border-radius: 4px; }
.gipedara-skeleton--thumb { width: 100%; aspect-ratio: 16/10; margin-bottom: 10px; }
.gipedara-skeleton--title { height: 18px; width: 80%; margin-bottom: 8px; }
.gipedara-skeleton--meta { height: 12px; width: 50%; }
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* --- Image Overlay Hover --- */
.gipedara-image-hover { position: relative; overflow: hidden; }
.gipedara-image-hover::before { content: '+'; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%) scale(0); width: 50px; height: 50px; background: rgba(229,57,53,.85); border-radius: 50%; display: flex; align-items: center; justify-content: center; color: #fff; font-size: 28px; z-index: 3; transition: transform .3s; }
.gipedara-image-hover::after { content: ''; position: absolute; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,.3); opacity: 0; z-index: 2; transition: opacity .3s; }
.gipedara-image-hover:hover::before { transform: translate(-50%, -50%) scale(1); }
.gipedara-image-hover:hover::after { opacity: 1; }

/* --- WordPress Gallery --- */
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; margin: 20px 0; }
.gallery-item { overflow: hidden; border-radius: 4px; }
.gallery-item img { width: 100%; height: auto; transition: transform .3s; }
.gallery-item:hover img { transform: scale(1.05); }
.gallery-caption { font-size: 12px; color: #888; padding: 5px; text-align: center; }

/* --- Table Styling --- */
.wp-block-table { border-collapse: collapse; width: 100%; margin: 20px 0; }
.wp-block-table th, .wp-block-table td { border: 1px solid var(--gipedara-border); padding: 10px 15px; text-align: left; }
.wp-block-table th { background: var(--gipedara-bg-dark); color: #fff; font-weight: 700; }
.wp-block-table td { color: #aaa; }
.wp-block-table tr:nth-child(even) td { background: rgba(255,255,255,.02); }

/* --- Code Blocks --- */
pre, code { font-family: 'Consolas', 'Monaco', monospace; background: var(--gipedara-bg-card); color: #e0e0e0; }
code { padding: 2px 6px; border-radius: 3px; font-size: .9em; }
pre { padding: 20px; border-radius: var(--gipedara-radius); overflow-x: auto; border: 1px solid var(--gipedara-border); margin: 20px 0; line-height: 1.5; }
pre code { background: transparent; padding: 0; }

/* --- Block Editor Styles --- */
.wp-block-cover { border-radius: var(--gipedara-radius); overflow: hidden; margin: 30px 0; }
.wp-block-cover .wp-block-cover__inner-container { color: #fff; }
.wp-block-columns { gap: 25px; margin: 30px 0; }
.wp-block-button .wp-block-button__link { background: var(--gipedara-primary); color: #fff; border-radius: var(--gipedara-radius-sm); padding: 10px 24px; font-weight: 700; transition: background .2s; }
.wp-block-button .wp-block-button__link:hover { background: var(--gipedara-primary-dark); color: #fff !important; }
.wp-block-separator { border-color: var(--gipedara-border); margin: 30px 0; }
.wp-block-pullquote { border-color: var(--gipedara-primary); color: #ddd; font-family: var(--gipedara-font-heading); }
.wp-block-quote { border-left-color: var(--gipedara-primary); }

/* --- WooCommerce Compatibility --- */
.woocommerce .products ul, .woocommerce ul.products { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.woocommerce ul.products li.product { background: var(--gipedara-bg-card); border-radius: var(--gipedara-radius); overflow: hidden; padding: 0; }
.woocommerce ul.products li.product a img { border-radius: 0; margin: 0; }
.woocommerce ul.products li.product .woocommerce-loop-product__title { padding: 10px 15px; font-size: 16px; color: var(--gipedara-heading); }
.woocommerce ul.products li.product .price { padding: 0 15px 15px; color: var(--gipedara-primary); font-weight: 700; }
.woocommerce ul.products li.product .button { margin: 0 15px 15px; background: var(--gipedara-primary); color: #fff; border-radius: var(--gipedara-radius-sm); font-weight: 700; }
.woocommerce ul.products li.product .button:hover { background: var(--gipedara-primary-dark); }

/* --- Animations --- */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { opacity: 0; transform: translateY(30px); } to { opacity: 1; transform: translateY(0); } }
@keyframes slideDown { from { opacity: 0; transform: translateY(-20px); } to { opacity: 1; transform: translateY(0); } }
@keyframes slideInLeft { from { opacity: 0; transform: translateX(-30px); } to { opacity: 1; transform: translateX(0); } }
@keyframes slideInRight { from { opacity: 0; transform: translateX(30px); } to { opacity: 1; transform: translateX(0); } }
@keyframes zoomIn { from { opacity: 0; transform: scale(.8); } to { opacity: 1; transform: scale(1); } }
@keyframes scaleIn { from { transform: scale(0); } to { transform: scale(1); } }
@keyframes bounce { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-5px); } }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .5; } }

.animate-fade-in { animation: fadeIn .6s ease; }
.animate-slide-up { animation: slideUp .6s ease; }
.animate-zoom-in { animation: zoomIn .4s ease; }
.animate-bounce { animation: bounce 1s ease infinite; }

/* --- Scroll-to-Top Button --- */
.gipedara-scroll-top { position: fixed; bottom: 30px; right: 30px; width: 45px; height: 45px; background: var(--gipedara-primary); color: #fff; border: none; border-radius: 50%; font-size: 20px; cursor: pointer; z-index: 999; opacity: 0; visibility: hidden; transition: all .3s; display: flex; align-items: center; justify-content: center; box-shadow: 0 4px 12px rgba(229,57,53,.3); }
.gipedara-scroll-top.visible { opacity: 1; visibility: visible; }
.gipedara-scroll-top:hover { background: var(--gipedara-primary-dark); transform: translateY(-3px); }

/* --- AJAX Search Results --- */
.gipedara-search-results { position: absolute; top: 100%; left: 0; right: 0; background: var(--gipedara-bg-card); border-radius: 0 0 var(--gipedara-radius) var(--gipedara-radius); max-height: 400px; overflow-y: auto; z-index: 999; box-shadow: 0 10px 30px rgba(0,0,0,.5); display: none; }
.gipedara-search-overlay .gipedara-search-results { position: static; background: transparent; box-shadow: none; max-height: 300px; margin-top: 20px; }
.gipedara-search-results.active { display: block; }
.gipedara-search-result-item { display: flex; gap: 12px; padding: 12px 15px; border-bottom: 1px solid var(--gipedara-border); align-items: center; }
.gipedara-search-result-item:last-child { border-bottom: none; }
.gipedara-search-result-item:hover { background: rgba(255,255,255,.03); }
.gipedara-search-result-item img { width: 50px; height: 50px; border-radius: 4px; object-fit: cover; }
.gipedara-search-result-item .sr-title { font-size: 14px; color: #ddd; }
.gipedara-search-result-item .sr-title:hover { color: var(--gipedara-primary); }
.gipedara-search-result-item .sr-meta { font-size: 11px; color: #666; }
.gipedara-no-results { padding: 20px; text-align: center; color: #666; }

/* --- RTL Support --- */
[dir="rtl"] .gipedara-top-bar .container { flex-direction: row-reverse; }
[dir="rtl"] .gipedara-nav-menu ul { flex-direction: row-reverse; }
[dir="rtl"] .gipedara-nav-menu ul li a { border-right: none; border-left: 1px solid var(--gipedara-border); }
[dir="rtl"] .gipedara-nav-menu ul li:last-child a { border-left: none; }
[dir="rtl"] .gipedara-nav-menu ul ul { left: auto; right: 0; }
[dir="rtl"] .gipedara-nav-menu ul ul ul { left: auto; right: 100%; }
[dir="rtl"] .gipedara-card__category { left: auto; right: 10px; }
[dir="rtl"] .gipedara-card .gipedara-card__category a { background: var(--gipedara-primary); }
[dir="rtl"] .gipedara-post-navigation { flex-direction: row-reverse; }
[dir="rtl"] .gipedara-sticky-share { left: auto; right: 0; }
[dir="rtl"] .gipedara-mobile-menu { left: auto; right: -300px; }
[dir="rtl"] .gipedara-mobile-menu.open { left: auto; right: 0; }

/* --- Responsive --- */
@media (max-width: 1199px) {
  .container { max-width: 970px; }
}
@media (max-width: 991px) {
  .container { max-width: 750px; }
  .gipedara-featured-card .gipedara-card__title { font-size: 24px; }
  .entry-title { font-size: 28px; }
}
@media (max-width: 767px) {
  .gipedara-top-bar { display: none; }
  .site-header { border-bottom-width: 2px; }
  .gipedara-section { margin-bottom: 25px; }
  .gipedara-section-title { font-size: 18px; }
  .entry-title { font-size: 22px; }
  .entry-content { font-size: 15px; }
  .gipedara-cookie-bar { flex-direction: column; text-align: center; padding: 15px; }
  .gipedara-author-box { flex-direction: column; text-align: center; }
  .gipedara-share-buttons { flex-wrap: wrap; justify-content: center; }
  .woocommerce .products ul, .woocommerce ul.products { grid-template-columns: repeat(2, 1fr); }
  .gipedara-scroll-top { bottom: 15px; right: 15px; width: 40px; height: 40px; font-size: 16px; }
}
@media (max-width: 480px) {
  .woocommerce .products ul, .woocommerce ul.products { grid-template-columns: 1fr; }
}
