/*
Theme Name: Darul Hikmah Modern
Theme URI: https://darulhikmah.or.id
Author: Tiko AI
Author URI: https://darulhikmah.or.id
Description: Modern, clean, and professional theme for Darul Hikmah Islamic Boarding School. Features smooth animations, responsive design, and contemporary aesthetics.
Version: 1.0.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: darulhikmah-modern
Template: twentytwentyfour
Tags: education, islamic, modern, responsive, custom-colors, block-patterns
*/

/* ═══════════════════════════════════════════════════════════════
   MODERN CSS VARIABLES
   ═══════════════════════════════════════════════════════════════ */
:root {
    /* Primary Colors - Modern Emerald Green Palette */
    --dh-primary: #10b981;
    --dh-primary-dark: #059669;
    --dh-primary-light: #34d399;
    --dh-primary-glow: rgba(16, 185, 129, 0.3);
    
    /* Secondary Colors - Deep Teal */
    --dh-secondary: #0f766e;
    --dh-secondary-dark: #115e59;
    --dh-secondary-light: #14b8a6;
    
    /* Accent Colors - Warm Amber */
    --dh-accent: #f59e0b;
    --dh-accent-dark: #d97706;
    --dh-accent-light: #fbbf24;
    
    /* Neutral Colors */
    --dh-dark: #1f2937;
    --dh-gray: #6b7280;
    --dh-gray-light: #9ca3af;
    --dh-light: #f3f4f6;
    --dh-lighter: #f9fafb;
    --dh-white: #ffffff;
    
    /* Typography - Modern Google Fonts */
    --font-heading: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
    --font-body: 'Inter', system-ui, -apple-system, sans-serif;
    
    /* Font Sizes - Fluid Typography */
    --text-xs: clamp(0.75rem, 0.7rem + 0.25vw, 0.875rem);
    --text-sm: clamp(0.875rem, 0.8rem + 0.35vw, 1rem);
    --text-base: clamp(1rem, 0.9rem + 0.5vw, 1.125rem);
    --text-lg: clamp(1.125rem, 1rem + 0.6vw, 1.25rem);
    --text-xl: clamp(1.25rem, 1.1rem + 0.75vw, 1.5rem);
    --text-2xl: clamp(1.5rem, 1.25rem + 1.25vw, 2rem);
    --text-3xl: clamp(1.875rem, 1.5rem + 1.875vw, 2.5rem);
    --text-4xl: clamp(2.25rem, 1.75rem + 2.5vw, 3rem);
    --text-5xl: clamp(2.5rem, 2rem + 2.5vw, 3.5rem);
    
    /* Spacing Scale */
    --spacing-1: 0.25rem;
    --spacing-2: 0.5rem;
    --spacing-3: 0.75rem;
    --spacing-4: 1rem;
    --spacing-5: 1.25rem;
    --spacing-6: 1.5rem;
    --spacing-8: 2rem;
    --spacing-10: 2.5rem;
    --spacing-12: 3rem;
    --spacing-16: 4rem;
    --spacing-20: 5rem;
    --spacing-24: 6rem;
    
    /* Border Radius - Modern Rounded Corners */
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
    --radius-2xl: 1.5rem;
    --radius-full: 9999px;
    
    /* Shadows - Layered Depth */
    --shadow-xs: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px -1px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    --shadow-2xl: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    --shadow-inner: inset 0 2px 4px 0 rgba(0, 0, 0, 0.05);
    --shadow-glow: 0 0 20px var(--dh-primary-glow);
    
    /* Transitions */
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-base: 300ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 500ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-bounce: 600ms cubic-bezier(0.34, 1.56, 0.64, 1);
    
    /* Layout */
    --container-max: 1280px;
    --container-narrow: 960px;
}

/* ═══════════════════════════════════════════════════════════════
   GLOBAL RESET & BASE STYLES
   ═══════════════════════════════════════════════════════════════ */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
    font-size: 16px;
    line-height: 1.5;
}

body {
    font-family: var(--font-body);
    font-size: var(--text-base);
    line-height: 1.7;
    color: var(--dh-dark);
    background-color: var(--dh-white);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

/* ═══════════════════════════════════════════════════════════════
   TYPOGRAPHY
   ═══════════════════════════════════════════════════════════════ */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -0.02em;
    color: var(--dh-dark);
    margin-bottom: var(--spacing-4);
}

h1 {
    font-size: var(--text-5xl);
    font-weight: 800;
}

h2 {
    font-size: var(--text-4xl);
}

h3 {
    font-size: var(--text-3xl);
}

h4 {
    font-size: var(--text-2xl);
}

p {
    margin-bottom: var(--spacing-4);
    color: var(--dh-gray);
}

a {
    color: var(--dh-primary);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--dh-primary-dark);
}

/* ═══════════════════════════════════════════════════════════════
   HERO SECTION MODERNIZATION
   ═══════════════════════════════════════════════════════════════ */
.wp-block-cover {
    position: relative;
    overflow: hidden;
    isolation: isolate;
}

.wp-block-cover::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
        135deg,
        rgba(16, 185, 129, 0.8) 0%,
        rgba(15, 118, 110, 0.7) 100%
    );
    z-index: 1;
}

.wp-block-cover__image-background {
    object-fit: cover;
    object-position: center;
    filter: brightness(0.8) contrast(1.1);
    transition: transform 0.5s ease;
}

.wp-block-cover:hover .wp-block-cover__image-background {
    transform: scale(1.05);
}

.wp-block-cover__inner-container {
    position: relative;
    z-index: 2;
    max-width: var(--container-max);
    margin: 0 auto;
    padding: var(--spacing-20);
    text-align: center;
}

.wp-block-cover h1 {
    color: var(--dh-white) !important;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    animation: dhFadeInUp 0.8s ease-out;
    margin-bottom: var(--spacing-6);
}

.wp-block-cover p {
    color: var(--dh-white) !important;
    font-size: var(--text-xl);
    max-width: 800px;
    margin: 0 auto var(--spacing-8);
    animation: dhFadeInUp 0.8s ease-out 0.2s backwards;
}

.wp-block-buttons {
    display: flex;
    gap: var(--spacing-4);
    justify-content: center;
    flex-wrap: wrap;
    animation: dhFadeInUp 0.8s ease-out 0.4s backwards;
}

/* ═══════════════════════════════════════════════════════════════
   MODERN BUTTONS
   ═══════════════════════════════════════════════════════════════ */
.wp-block-button__link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-2);
    padding: var(--spacing-4) var(--spacing-8);
    font-family: var(--font-heading);
    font-size: var(--text-base);
    font-weight: 600;
    border-radius: var(--radius-full);
    transition: all var(--transition-base);
    box-shadow: var(--shadow-md);
    position: relative;
    overflow: hidden;
}

.wp-block-button__link::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(45deg, transparent, rgba(255,255,255,0.2), transparent);
    transform: translateX(-100%);
    transition: transform 0.5s ease;
}

.wp-block-button__link:hover::before {
    transform: translateX(100%);
}

.wp-block-button__link:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-xl);
}

.wp-block-button__link:active {
    transform: translateY(0);
}

.wp-block-button.is-style-outline .wp-block-button__link {
    background: transparent;
    border: 2px solid var(--dh-white);
    color: var(--dh-white);
}

.wp-block-button.is-style-outline .wp-block-button__link:hover {
    background: var(--dh-white);
    color: var(--dh-primary);
}

/* ═══════════════════════════════════════════════════════════════
   CARDS & COLUMNS
   ═══════════════════════════════════════════════════════════════ */
.wp-block-columns {
    gap: var(--spacing-6);
    margin: var(--spacing-16) 0;
}

.wp-block-column {
    padding: var(--spacing-8);
    background: var(--dh-white);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-md);
    transition: all var(--transition-base);
    border: 1px solid var(--dh-light);
}

.wp-block-column:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-2xl);
    border-color: var(--dh-primary-light);
}

.wp-block-column h3 {
    color: var(--dh-secondary);
    margin-bottom: var(--spacing-4);
}

/* ═══════════════════════════════════════════════════════════════
   SECTIONS & SPACERS
   ═══════════════════════════════════════════════════════════════ */
.wp-block-spacer {
    clear: both;
}

section, .wp-block-group {
    padding: var(--spacing-16) 0;
}

/* ═══════════════════════════════════════════════════════════════
   QUERY LOOP (POSTS)
   ═══════════════════════════════════════════════════════════════ */
.wp-block-query {
    margin: var(--spacing-16) 0;
}

.wp-block-query .wp-block-post-template {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--spacing-6);
}

.wp-block-post-template li {
    list-style: none;
}

.wp-block-post-template .wp-block-post {
    background: var(--dh-white);
    border-radius: var(--radius-xl);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    transition: all var(--transition-base);
}

.wp-block-post:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-xl);
}

.wp-block-post-featured-image {
    position: relative;
    overflow: hidden;
    aspect-ratio: 16/9;
}

.wp-block-post-featured-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--transition-slow);
}

.wp-block-post:hover .wp-block-post-featured-image img {
    transform: scale(1.1);
}

.wp-block-post-title {
    padding: var(--spacing-6);
    padding-bottom: var(--spacing-2);
}

.wp-block-post-title a {
    color: var(--dh-dark);
    font-weight: 700;
    transition: color var(--transition-fast);
}

.wp-block-post-title a:hover {
    color: var(--dh-primary);
}

.wp-block-post-excerpt {
    padding: 0 var(--spacing-6) var(--spacing-6);
    color: var(--dh-gray);
}

/* ═══════════════════════════════════════════════════════════════
   NAVIGATION
   ═══════════════════════════════════════════════════════════════ */
.wp-block-navigation {
    backdrop-filter: blur(10px);
    transition: all var(--transition-base);
}

.dh-navbar-scrolled {
    background: rgba(255, 255, 255, 0.95) !important;
    box-shadow: var(--shadow-md);
}

/* ═══════════════════════════════════════════════════════════════
   SCROLL TO TOP BUTTON
   ═══════════════════════════════════════════════════════════════ */
.dh-scroll-to-top {
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-base);
}

.dh-scroll-to-top:hover {
    background: var(--dh-primary-dark) !important;
    transform: translateY(-3px) !important;
    box-shadow: var(--shadow-lg) !important;
}

/* ═══════════════════════════════════════════════════════════════
   ANIMATIONS
   ═══════════════════════════════════════════════════════════════ */
@keyframes dhFadeInUp {
    from {
        opacity: 0;
        transform: translateY(40px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes dhFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes dhPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

@keyframes dhShimmer {
    0% { background-position: -1000px 0; }
    100% { background-position: 1000px 0; }
}

.dh-animate-in {
    opacity: 1 !important;
    transform: translateY(0) !important;
}

/* ═══════════════════════════════════════════════════════════════
   RESPONSIVE DESIGN
   ═══════════════════════════════════════════════════════════════ */
@media (max-width: 1024px) {
    :root {
        --spacing-20: 4rem;
        --spacing-16: 3rem;
    }
    
    .wp-block-cover__inner-container {
        padding: var(--spacing-12);
    }
}

@media (max-width: 768px) {
    :root {
        --spacing-20: 3rem;
        --spacing-16: 2rem;
        --spacing-12: 1.5rem;
    }
    
    .wp-block-columns {
        flex-direction: column;
    }
    
    .wp-block-cover h1 {
        font-size: var(--text-3xl);
    }
    
    .wp-block-cover p {
        font-size: var(--text-lg);
    }
    
    .wp-block-buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .wp-block-button__link {
        width: 100%;
        max-width: 300px;
    }
}

@media (max-width: 480px) {
    html {
        font-size: 14px;
    }
    
    .wp-block-cover__inner-container {
        padding: var(--spacing-8);
    }
    
    .wp-block-column {
        padding: var(--spacing-6);
    }
}

/* ═══════════════════════════════════════════════════════════════
   ACCESSIBILITY
   ═══════════════════════════════════════════════════════════════ */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* Focus styles for keyboard navigation */
a:focus, button:focus, input:focus, textarea:focus {
    outline: 2px solid var(--dh-primary);
    outline-offset: 2px;
    border-radius: var(--radius-sm);
}

/* Skip link for accessibility */
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--dh-primary);
    color: var(--dh-white);
    padding: var(--spacing-2) var(--spacing-4);
    z-index: 10000;
    transition: top 0.3s;
}

.skip-link:focus {
    top: 0;
}

/* ═══════════════════════════════════════════════════════════════
   DARK MODE SUPPORT
   ═══════════════════════════════════════════════════════════════ */
@media (prefers-color-scheme: dark) {
    :root {
        --dh-dark: #f9fafb;
        --dh-gray: #9ca3af;
        --dh-light: #1f2937;
        --dh-lighter: #111827;
        --dh-white: #030712;
    }
    
    .wp-block-column {
        background: var(--dh-light);
        border-color: var(--dh-dark);
    }
    
    .wp-block-post {
        background: var(--dh-light);
    }
    
    .wp-block-post-title a {
        color: var(--dh-white);
    }
}

/* ═══════════════════════════════════════════════════════════════
   PRINT STYLES
   ═══════════════════════════════════════════════════════════════ */
@media print {
    body {
        background: white;
        color: black;
    }
    
    .wp-block-cover::before {
        background: none;
    }
    
    .dh-scroll-to-top, nav, header {
        display: none;
    }
}

/* ═══════════════════════════════════════════════════════════════
   UTILITY CLASSES
   ═══════════════════════════════════════════════════════════════ */
.dh-container {
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 var(--spacing-4);
}

.dh-text-center {
    text-align: center;
}

.dh-text-gradient {
    background: linear-gradient(135deg, var(--dh-primary), var(--dh-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.dh-shadow-hover {
    transition: box-shadow var(--transition-base);
}

.dh-shadow-hover:hover {
    box-shadow: var(--shadow-xl);
}

.dh-card {
    background: var(--dh-white);
    border-radius: var(--radius-xl);
    padding: var(--spacing-8);
    box-shadow: var(--shadow-md);
    transition: all var(--transition-base);
}

.dh-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-xl);
}

/* ===================================
   ADDITIONAL ENHANCEMENTS
   =================================== */
