/*
Theme Name: SmartAdmin Spectrum
Theme URI: https://muhidin.web.id/smartadmin-spectrum/
Author: Muhidin Saimin
Author URI: http://muhidin.web.id
Description: A professional and lightweight theme designed for educational portals and Digital Office Specialist classes. Features enhanced Hero Slider with 5 image slots and 4 transition effects, Header Background Image, Widget system, and Full Width Container layout options.
Version: 1.1.1
Tested up to: 6.4
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: smartadmin-spectrum
Tags: custom-menu, custom-logo, education, one-column, two-columns, three-columns, flexible-header, translation-ready, theme-options, threaded-comments, wide-blocks

SmartAdmin Spectrum is distributed under the terms of the GNU GPL.
*/

/**
 * Table of Contents:
 * 1.0 - Root Variables
 * 2.0 - Reset & Base Styles
 * 3.0 - WordPress Core Classes
 * 4.0 - Layout & Containers
 * 5.0 - Header Styling
 * 6.0 - Navigation & Menus
 * 7.0 - Brand & Logo Layouts
 * 8.0 - Content Sections (Hero & Grid)
 * 9.0 - Single Post & Pages
 * 10.0 - Footer
 * 11.0 - Media Queries
 */

/* 1.0 - Root Variables */
:root {
    --primary-blue: #0056b3; 
    --accent-red: #e63946;   
    --light-bg: #f4f7f6;
    --dark-text: #333333;
    --white: #ffffff;
}

/* 2.0 - Reset & Base Styles */
body {
    font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    line-height: 1.6;
    color: var(--dark-text);
    background-color: var(--light-bg);
    margin: 0;
}

a {
    color: var(--primary-blue);
    text-decoration: none;
    transition: 0.3s;
}

a:hover {
    color: var(--accent-red);
}

/* 3.0 - WordPress Core Classes */
.alignleft { float: left; margin: 0.5em 1em 0.5em 0; }
.alignright { float: right; margin: 0.5em 0 0.5em 1em; }
.aligncenter { display: block; margin-left: auto; margin-right: auto; text-align: center; }
.wp-caption { background: #fff; border: 1px solid #f0f0f0; max-width: 96%; padding: 5px 3px 10px; text-align: center; }
.wp-caption img { border: 0 none; height: auto; margin: 0; max-width: 98%; padding: 0; width: auto; }
.wp-caption-text { font-size: 0.8rem; margin: 0; padding: 0 5px 5px; }
.sticky { background: #fff9c4; border: 1px solid #fbc02d; }
.gallery-caption { font-size: 0.8rem; }
.bypostauthor { font-style: italic; }

.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;
    width: 1px;
    word-wrap: normal;
}

/* 4.0 - Layout & Containers */
.container {
    width: 90%;
    max-width: 1140px;
    margin: 0 auto;
}

.container-full {
    width: 100%;
    max-width: 100%;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    overflow-x: hidden;
}

/* 5.0 - Header Styling */
header {
    background: var(--white);
    padding: 20px 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    position: relative;
}

/* Header with background image */
header[style*="background-image"] {
    background-size: cover !important;
    background-position: center !important;
    background-repeat: no-repeat !important;
}

header[style*="background-image"]::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.3);
    z-index: 1;
}

header[style*="background-image"] .header-flex {
    position: relative;
    z-index: 2;
}

/* Ensure text readability on header background */
header[style*="background-image"] .text-blue-red-dynamic {
    color: var(--primary-blue);
    text-shadow: 0 1px 2px rgba(255, 255, 255, 0.8);
}

header[style*="background-image"] .site-tagline {
    color: #555;
    text-shadow: 0 1px 2px rgba(255, 255, 255, 0.8);
}

header[style*="background-image"] .main-navigation a {
    color: var(--primary-blue);
    text-shadow: 0 1px 2px rgba(255, 255, 255, 0.8);
}

.header-flex {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
    max-width: 100%;
    box-sizing: border-box;
    overflow: hidden;
}

/* Ensure brand wrapper doesn't overflow */
.brand-wrapper {
    flex: 0 1 auto;
    max-width: 70%;
    min-width: 0;
}

/* Ensure navigation doesn't overflow */
.main-navigation {
    flex: 0 1 auto;
    max-width: 30%;
    min-width: 0;
}

/* Navigation menu overflow handling */
.main-nav-list {
    display: flex;
    gap: 15px;
    list-style: none;
    margin: 0;
    padding: 0;
    overflow: hidden;
    white-space: nowrap;
}

.main-nav-list li {
    flex-shrink: 0;
}

.main-nav-list a {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 120px;
    display: inline-block;
}

/* 6.0 - Navigation & Menus */
nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    gap: 25px;
}

nav ul li {
    position: relative;
}

/* Dropdown Support */
nav ul li ul.sub-menu {
    position: absolute;
    top: 100%;
    left: 0;
    background-color: var(--white);
    min-width: 200px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    display: none;
    flex-direction: column;
    z-index: 999;
    border-top: 3px solid var(--accent-red);
    padding: 10px 0;
}

nav ul li:hover > ul.sub-menu {
    display: flex;
}

nav ul li ul.sub-menu li a {
    padding: 10px 20px;
    display: block;
    font-size: 0.95rem;
    color: var(--dark-text);
    border-bottom: 1px solid #eee;
}

nav ul li ul.sub-menu li a:hover {
    background-color: var(--light-bg);
    color: var(--primary-blue);
    padding-left: 25px;
}

.menu-item-has-children > a::after {
    content: ' ▾';
    font-size: 0.8rem;
}

/* 7.0 - Brand & Logo Layouts */
.brand-wrapper {
    display: flex;
    align-items: center;
}

/* Stacked Mode */
.brand-stacked {
    flex-direction: column;
    text-align: center;
}

.brand-stacked img {
    width: 100%;
    max-width: 320px;
    height: auto;
    margin-bottom: 5px;
}

/* Inline Mode */
.brand-inline {
    flex-direction: row;
    text-align: left;
    gap: 15px;
}

.brand-inline img {
    height: 60px; 
    width: auto;
}

/* Typography for Brand */
.text-blue-red-dynamic {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--primary-blue);
    display: block;
    line-height: 1.1;
}

.site-tagline {
    font-size: 0.9rem;
    color: #555;
    margin-top: 5px;
    font-weight: 600;
}

/* 8.0 - Content Sections (Hero & Grid) */
.hero {
    background: var(--white);
    padding: 60px 40px;
    border-radius: 12px;
    text-align: center;
    margin: 40px 0;
    border-top: 5px solid var(--primary-blue);
}

.btn-cta {
    background: var(--accent-red);
    color: white !important;
    padding: 12px 30px;
    border-radius: 50px;
    font-weight: bold;
    display: inline-block;
}

.post-grid {
    display: grid;
    gap: 30px;
    margin-bottom: 40px;
}

/* Ensure post-grid has consistent spacing in full-width mode */
.container-full .post-grid {
    padding: 0;
    box-sizing: border-box;
}

/* Grid column variations */
.post-grid.grid-1-cols {
    grid-template-columns: 1fr;
}

.post-grid.grid-2-cols {
    grid-template-columns: repeat(2, 1fr);
}

.post-grid.grid-3-cols {
    grid-template-columns: repeat(3, 1fr);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .post-grid.grid-2-cols,
    .post-grid.grid-3-cols {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .post-grid.grid-3-cols {
        grid-template-columns: 1fr;
    }
}

.post-card {
    background: var(--white);
    padding: 25px;
    border-radius: 8px;
    border-bottom: 4px solid var(--primary-blue);
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
}

/* 9.0 - Single Post & Pages */
.single-post-container {
    background: var(--white);
    padding: 40px;
    margin: 40px auto;
    border-radius: 12px;
}

.entry-meta {
    font-size: 0.9rem;
    color: #777;
    margin-bottom: 20px;
}

/* 10.0 - Footer */
footer {
    background: var(--primary-blue);
    color: white;
    padding: 40px 0;
    text-align: center;
    margin-top: 60px;
}

footer a {
    color: #ffd1d1;
}

/* Widgets Section */
.site-widgets {
    background: var(--white);
    padding: 40px 0;
    margin-bottom: 40px;
}

.site-widgets .widget {
    margin-bottom: 30px;
    padding: 20px;
    background: #f9f9f9;
    border-radius: 8px;
    border-left: 4px solid var(--primary-blue);
}

.site-widgets .widget-title {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--primary-blue);
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--accent-red);
}

.site-widgets ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.site-widgets ul li {
    margin-bottom: 10px;
    padding-bottom: 10px;
    border-bottom: 1px solid #ddd;
}

.site-widgets ul li:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.site-widgets a {
    color: var(--primary-blue);
    text-decoration: none;
}

.site-widgets a:hover {
    text-decoration: underline;
}

/* 11.0 - Media Queries */
@media (max-width: 768px) {
    .header-flex {
        flex-direction: column;
        gap: 20px;
        padding: 10px 0;
    }
    
    .brand-wrapper {
        max-width: 100%;
        text-align: center;
    }
    
    .main-navigation {
        max-width: 100%;
        width: 100%;
    }
    
    .main-nav-list {
        justify-content: center;
        gap: 10px;
        flex-wrap: wrap;
    }
    
    .main-nav-list a {
        max-width: none;
        white-space: normal;
    }
}

@media (max-width: 480px) {
    .main-nav-list {
        flex-direction: column;
        gap: 5px;
        text-align: center;
    }
    
    .main-nav-list a {
        font-size: 0.9rem;
    }
    
    nav ul {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }

    .brand-inline {
        flex-direction: column;
        text-align: center;
    }
}

.hero {
    border-radius: 20px;
    margin: 20px 0;
    overflow: hidden;
    position: relative;
    min-height: 400px; /* Adjust hero height */
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.hero-slider {
    width: 100%;
    max-width: 1200px;
    height: 400px !important;
    position: relative;
    overflow: hidden;
    border-radius: 10px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    margin: 0 auto;
    perspective: 1000px;
    transform-style: preserve-3d;
}

/* Slider responsive to container layout */
.container .hero-slider {
    max-width: 1200px;
    width: 100%;
}

.container-full .hero-slider {
    max-width: 100%;
    width: 100%;
    padding: 0;
    box-sizing: border-box;
}
/* Simplified 3D Effects Support */
.hero-slider.slider-cube,
.hero-slider.slider-flip {
    perspective: 1000px;
}

.hero-slider.slider-cube .swiper-wrapper,
.hero-slider.slider-flip .swiper-wrapper {
    transform-style: preserve-3d;
}

.hero-slider.slider-cube .swiper-slide,
.hero-slider.slider-flip .swiper-slide {
    backface-visibility: hidden;
}

/* Reduced hover effects for better cube animation */
.hero-slider:hover .swiper-slide:not(.swiper-slide-active) {
    transform: translateZ(-10px) scale(0.98);
    transition: all 0.2s ease-out;
}

/* Subtle shadow for active slide */
.hero-slider .swiper-slide-active {
    box-shadow: 0 6px 20px rgba(0,0,0,0.25);
}
.hero-slider .swiper-wrapper {
    height: 100% !important;
}

.hero-slider .swiper-slide {
    height: 400px !important;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    position: relative;
    transform-style: preserve-3d;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 3D Image Effects */
.hero-slider .swiper-slide::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(0,0,0,0.1) 0%, rgba(0,0,0,0.3) 100%);
    z-index: 1;
    pointer-events: none;
}

/* Enhanced 3D for fade transition */
.hero-slider.slider-fade .swiper-slide {
    opacity: 0;
    transform: translateZ(100px) rotateY(15deg);
    transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.hero-slider.slider-fade .swiper-slide-active {
    opacity: 1;
    transform: translateZ(0) rotateY(0deg);
}

/* Enhanced 3D for slide transition */
.hero-slider.slider-slide .swiper-slide {
    transform: translateZ(50px) rotateY(-5deg);
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.hero-slider.slider-slide .swiper-slide-active {
    transform: translateZ(0) rotateY(0deg);
}

/* Parallax depth effect */
.hero-slider .swiper-slide img {
    transform: translateZ(-50px) scale(1.1);
    transition: transform 0.8s ease-out;
}

.hero-slider .swiper-slide-active img {
    transform: translateZ(0) scale(1);
}


/* Enhanced 3D Swiper Navigation */
.hero-slider .swiper-button-next,
.hero-slider .swiper-button-prev {
    color: rgba(255, 255, 255, 0.9);
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.4), rgba(0, 0, 0, 0.6));
    border-radius: 50%;
    width: 50px;
    height: 50px;
    margin-top: -25px;
    transform: translateZ(20px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
    backdrop-filter: blur(5px);
}

.hero-slider .swiper-button-next:hover,
.hero-slider .swiper-button-prev:hover {
    color: white;
    background: linear-gradient(135deg, rgba(0, 86, 179, 0.8), rgba(230, 57, 70, 0.8));
    transform: translateZ(30px) scale(1.1);
    box-shadow: 0 6px 20px rgba(0,0,0,0.4);
}

.hero-slider .swiper-button-next::after,
.hero-slider .swiper-button-prev::after {
    font-size: 18px;
    font-weight: bold;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

/* Enhanced 3D Swiper Pagination */
.hero-slider .swiper-pagination {
    bottom: 20px;
    z-index: 10;
    transform: translateZ(10px);
}

.hero-slider .swiper-pagination-bullet {
    background: rgba(255, 255, 255, 0.5);
    opacity: 1;
    width: 12px;
    height: 12px;
    margin: 0 5px;
    transform: translateZ(5px) scale(1);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.hero-slider .swiper-pagination-bullet:hover {
    background: rgba(255, 255, 255, 0.8);
    transform: translateZ(8px) scale(1.2);
}

.hero-slider .swiper-pagination-bullet-active {
    background: linear-gradient(135deg, #0056b3, #e63946);
    transform: translateZ(15px) scale(1.3);
    box-shadow: 0 4px 12px rgba(0,86,179,0.4);
}

.hero-slider .swiper-pagination-bullet-active {
    background: white;
}

/* If hero is missing, the bottom margin of the header container will pull content up */
.site-main {
    display: flex;
    flex-direction: column;
}
