/*
Theme Name: Sekolah Theme
Theme URI: https://example.com/sekolah-theme
Author: Sekolah Theme Developer
Author URI: https://example.com
Description: Custom WordPress theme untuk website sekolah. Dirancang dengan pendekatan editorial dan institutional design — modern, elegan, profesional, dan mudah dikelola oleh admin sekolah.
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.5
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: sekolah-theme
Tags: education, school, custom-menu, custom-logo, featured-images, threaded-comments, translation-ready
*/

/* ==========================================================================
   1. CSS Custom Properties — Design System
   ========================================================================== */

:root {
    /* Primary Colors — Deep Green (Islamic Education) */
    --primary: #1B4D3E;
    --primary-light: #2D6A56;
    --primary-dark: #0F3328;
    --primary-rgb: 27, 77, 62;

    /* Secondary & Accent — Gold / Muted Yellow */
    --secondary: #C5A059;
    --secondary-light: #D8B673;
    --secondary-dark: #A3803D;
    --accent: #D4AF37;

    /* Neutrals — Dark Charcoal & Warm Off-White */
    --text: #222222;
    --text-secondary: #4A4A4A;
    --muted: #7A7A7A;
    --bg: #FFFFFF;
    --bg-alt: #F7F6F2;
    --surface: #FAFAf7;
    --border: #E2DFD7;
    --border-light: #ECEAE3;

    /* Functional */
    --success: #2A7B5F;
    --warning: #C8A951;
    --error: #B44040;
    --info: #1B4D6E;

    /* Typography */
    --font-heading: 'Playfair Display', Georgia, 'Times New Roman', serif;
    --font-body: 'Source Sans 3', 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;

    /* Type Scale (1.25 ratio) */
    --text-xs: 0.75rem;    /* 12px */
    --text-sm: 0.875rem;   /* 14px */
    --text-base: 1rem;     /* 16px */
    --text-md: 1.125rem;   /* 18px */
    --text-lg: 1.25rem;    /* 20px */
    --text-xl: 1.5rem;     /* 24px */
    --text-2xl: 1.875rem;  /* 30px */
    --text-3xl: 2.25rem;   /* 36px */
    --text-4xl: 3rem;      /* 48px */
    --text-5xl: 3.75rem;   /* 60px */

    /* Spacing */
    --space-xs: 0.25rem;
    --space-sm: 0.5rem;
    --space-md: 1rem;
    --space-lg: 1.5rem;
    --space-xl: 2rem;
    --space-2xl: 3rem;
    --space-3xl: 4rem;
    --space-4xl: 6rem;
    --space-5xl: 8rem;

    /* Layout */
    --container-max: 1200px;
    --container-narrow: 800px;
    --container-wide: 1400px;
    --header-height: 80px;
    --top-bar-height: 40px;

    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-base: 250ms ease;
    --transition-slow: 400ms ease;

    /* Shadows — minimal, purposeful */
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 8px 30px rgba(0, 0, 0, 0.1);

    /* Border Radius — conservative */
    --radius-sm: 3px;
    --radius-md: 5px;
    --radius-lg: 8px;
}

/* ==========================================================================
   2. CSS Reset & Base
   ========================================================================== */

*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 100%;
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

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

img {
    max-width: 100%;
    height: auto;
    display: block;
}

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

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

a:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

ul, ol {
    list-style: none;
}

button {
    cursor: pointer;
    border: none;
    background: none;
    font-family: inherit;
    font-size: inherit;
}

input, textarea, select {
    font-family: inherit;
    font-size: inherit;
}

table {
    border-collapse: collapse;
    width: 100%;
}

/* ==========================================================================
   3. Typography
   ========================================================================== */

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 700;
    line-height: 1.25;
    color: var(--text);
}

h1 {
    font-size: var(--text-4xl);
    letter-spacing: -0.02em;
}

h2 {
    font-size: var(--text-3xl);
    letter-spacing: -0.01em;
}

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

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

h5 {
    font-size: var(--text-lg);
}

h6 {
    font-size: var(--text-md);
}

p {
    margin-bottom: 1em;
}

p:last-child {
    margin-bottom: 0;
}

strong, b {
    font-weight: 700;
}

em, i {
    font-style: italic;
}

blockquote {
    border-left: 3px solid var(--secondary);
    padding-left: var(--space-lg);
    margin: var(--space-xl) 0;
    font-style: italic;
    color: var(--text-secondary);
    font-size: var(--text-md);
}

/* ==========================================================================
   4. Layout Utilities
   ========================================================================== */

.container {
    width: 100%;
    max-width: var(--container-max);
    margin-left: auto;
    margin-right: auto;
    padding-left: var(--space-lg);
    padding-right: var(--space-lg);
}

.container--narrow {
    max-width: var(--container-narrow);
}

.container--wide {
    max-width: var(--container-wide);
}

.section {
    padding-top: var(--space-5xl);
    padding-bottom: var(--space-5xl);
}

.section--sm {
    padding-top: var(--space-4xl);
    padding-bottom: var(--space-4xl);
}

.section--alt {
    background-color: var(--bg-alt);
}

/* Section Header — used for section titles */
.section-header {
    margin-bottom: var(--space-3xl);
}

.section-label {
    display: inline-block;
    font-family: var(--font-body);
    font-size: var(--text-xs);
    font-weight: 700;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--secondary-dark);
    margin-bottom: var(--space-sm);
}

.section-title {
    font-size: var(--text-3xl);
    margin-bottom: var(--space-md);
}

.section-subtitle {
    font-size: var(--text-md);
    color: var(--text-secondary);
    max-width: 640px;
    line-height: 1.6;
}

/* ==========================================================================
   5. WordPress Core Styles
   ========================================================================== */

/* Alignment */
.alignleft {
    float: left;
    margin-right: var(--space-xl);
    margin-bottom: var(--space-md);
}

.alignright {
    float: right;
    margin-left: var(--space-xl);
    margin-bottom: var(--space-md);
}

.aligncenter {
    display: block;
    margin-left: auto;
    margin-right: auto;
    margin-bottom: var(--space-xl);
}

.alignwide {
    max-width: var(--container-wide);
    margin-left: auto;
    margin-right: auto;
}

.alignfull {
    width: 100vw;
    max-width: 100vw;
    margin-left: calc(50% - 50vw);
}

/* Captions */
.wp-caption {
    max-width: 100%;
    margin-bottom: var(--space-xl);
}

.wp-caption-text {
    font-size: var(--text-sm);
    color: var(--muted);
    margin-top: var(--space-sm);
    text-align: center;
}

/* Galleries */
.gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: var(--space-md);
    margin-bottom: var(--space-xl);
}

.gallery-item {
    margin: 0;
}

.gallery-item img {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

/* Screen Reader Text */
.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 !important;
    width: 1px;
    word-wrap: normal !important;
}

.screen-reader-text:focus {
    background-color: var(--bg);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    clip: auto !important;
    clip-path: none;
    color: var(--primary);
    display: block;
    font-size: var(--text-sm);
    font-weight: 700;
    height: auto;
    left: 5px;
    line-height: normal;
    padding: var(--space-md) var(--space-xl);
    text-decoration: none;
    top: 5px;
    width: auto;
    z-index: 100000;
}

/* ==========================================================================
   6. Post Content Styles (for Gutenberg/Classic editor output)
   ========================================================================== */

.entry-content > * + * {
    margin-top: 1.5em;
}

.entry-content h2 {
    margin-top: 2.5em;
    margin-bottom: 0.75em;
    font-size: var(--text-2xl);
}

.entry-content h3 {
    margin-top: 2em;
    margin-bottom: 0.5em;
    font-size: var(--text-xl);
}

.entry-content h4 {
    margin-top: 1.5em;
    margin-bottom: 0.5em;
}

.entry-content ul,
.entry-content ol {
    padding-left: var(--space-xl);
    margin-bottom: 1.5em;
}

.entry-content ul {
    list-style-type: disc;
}

.entry-content ol {
    list-style-type: decimal;
}

.entry-content li {
    margin-bottom: 0.4em;
}

.entry-content table {
    margin-bottom: 1.5em;
}

.entry-content th,
.entry-content td {
    padding: var(--space-sm) var(--space-md);
    border: 1px solid var(--border);
    text-align: left;
}

.entry-content th {
    background-color: var(--bg-alt);
    font-weight: 700;
}

.entry-content a {
    color: var(--primary);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.entry-content a:hover {
    color: var(--primary-light);
}

.entry-content pre {
    background: var(--bg-alt);
    padding: var(--space-lg);
    overflow-x: auto;
    font-size: var(--text-sm);
    border-radius: var(--radius-md);
    margin-bottom: 1.5em;
}

.entry-content code {
    background: var(--bg-alt);
    padding: 0.15em 0.4em;
    font-size: 0.9em;
    border-radius: var(--radius-sm);
}

.entry-content pre code {
    background: none;
    padding: 0;
}

/* ==========================================================================
   7. Scroll Animations & Micro-Interactions (Editorial & Institutional)
   ========================================================================== */

.fade-in,
.fade-in-up {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1), transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
    will-change: opacity, transform;
}

.fade-in-left {
    opacity: 0;
    transform: translateX(-30px);
    transition: opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1), transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
    will-change: opacity, transform;
}

.fade-in-right {
    opacity: 0;
    transform: translateX(30px);
    transition: opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1), transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
    will-change: opacity, transform;
}

.fade-in.is-visible,
.fade-in-up.is-visible,
.fade-in-left.is-visible,
.fade-in-right.is-visible {
    opacity: 1;
    transform: translate(0, 0);
}

/* Staggered Children Delay */
.stagger-children > * {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.stagger-children > *.is-visible {
    opacity: 1;
    transform: translateY(0);
}

/* Image & Card Micro-Interactions */
.program-item,
.prestasi-item,
.berita-featured,
.berita-compact,
.agenda-item {
    transition: transform var(--transition-base), box-shadow var(--transition-base), border-color var(--transition-base);
}

.program-item:hover,
.prestasi-item:hover {
    transform: translateY(-3px);
}

.about-image img,
.sambutan-photo img,
.berita-featured__image img,
.galeri-item img {
    transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.galeri-item:hover img,
.berita-featured:hover .berita-featured__image img {
    transform: scale(1.03);
}

/* Number Counter Highlight */
.statistik-number {
    transition: transform 0.3s ease, color 0.3s ease;
}

.statistik-item:hover .statistik-number {
    transform: scale(1.05);
    color: var(--secondary);
}

/* Disable animations for users who prefer reduced motion */
@media (prefers-reduced-motion: reduce) {
    .fade-in,
    .fade-in-up,
    .fade-in-left,
    .fade-in-right,
    .stagger-children > * {
        opacity: 1 !important;
        transform: none !important;
        transition: none !important;
    }
}
