/*
Theme Name: Kamal Custom Theme
Theme URI: http://kamaladlan.local/
Author: Kamal
Author URI: http://kamaladlan.local/
Description: A minimalist, editorial, clarity-focused personal platform designed as a digital study room.
Version: 1.1
Requires at least: 6.0
Tested up to: 6.4
Requires PHP: 8.0
Text Domain: kamal-theme
Domain Path: /languages
*/

/* ==========================================================================
   Typography & Local Fonts
   ========================================================================== */
@font-face {
    font-family: 'The Year of Handicrafts Black';
    src: url('assets/fonts/TheYearofHandicrafts-Black.otf') format('opentype');
    font-weight: 900;
    font-style: normal;
    font-display: swap;
}

/* ==========================================================================
   Design System & Variables
   ========================================================================== */
:root {
    /* Colors - Calm, Minimal, Editorial */
    --c-bg: #f5f5f7;
    /* Soft off-white to reduce eye strain, Apple style */
    --c-bg-alt: #ffffff;
    /* Pure white for contrast cards if needed */
    --c-text-main: #333333;
    /* Dark warm gray for reading */
    --c-text-muted: #6b7280;
    /* Muted text for meta, dates, captions */
    --c-border: #e5e7eb;
    /* Soft border color */
    --c-accent: #4b5563;
    /* Subtle accent (slate) instead of flashy colors */
    --c-link: #1f2937;
    /* Very dark grayish blue for links */
    --c-link-hover: #4b5563;
    /* Lighter on hover */

    /* Typography */
    --font-sans: 'IBM Plex Sans Arabic', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --font-serif: 'The Year of Handicrafts Black', 'Times New Roman', Times, serif;

    /* Layout */
    --max-width-reading: 720px;
    --max-width-container: 1100px;
    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 2rem;
    --spacing-lg: 4rem;
    --spacing-xl: 6rem;
}

/* ==========================================================================
   Newsletter Subscription Messages
   ========================================================================== */
.subscribe-message {
    font-weight: 500;
    transition: all 0.3s ease;
}
.subscribe-message.success {
    color: #10b981; /* Green */
}
.subscribe-message.error {
    color: #ef4444; /* Red */
}

/* ==========================================================================
   Reset & Base Styles
   ========================================================================== */
*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    background-color: var(--c-bg);
    color: var(--c-text-main);
    font-family: var(--font-sans);
    font-size: 18px;
    /* Base reading size */
    line-height: 1.7;
    margin: 0;
    padding: 0;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font-serif);
    font-weight: 700;
    color: var(--c-text-main);
    line-height: 1.3;
    margin-top: 2em;
    margin-bottom: 0.75em;
}

h1 {
    font-size: 2.5rem;
}

h2 {
    font-size: 2rem;
}

h3 {
    font-size: 1.5rem;
}

p {
    margin-top: 0;
    margin-bottom: 1.5rem;
}

a {
    color: var(--c-link);
    text-decoration: underline;
    text-decoration-color: var(--c-border);
    text-underline-offset: 4px;
    transition: all 0.2s ease;
}

a:hover {
    color: var(--c-link-hover);
    text-decoration-color: var(--c-link-hover);
}

img,
video {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
    /* subtle curve, not flashy */
}

/* ==========================================================================
   Global Layout Containers
   ========================================================================== */
.site-container {
    max-width: var(--max-width-container);
    margin: 0 auto;
    padding: 0 var(--spacing-sm);
}

.reading-container {
    max-width: var(--max-width-reading);
    margin: 0 auto;
    padding: 0 var(--spacing-sm);
}

/* ==========================================================================
   Header & Navigation (Floating Glass Pill)
   ========================================================================== */
.site-header {
    padding: 10px 0;
    /* Reduced outer padding */
    border-bottom: none;
    margin-bottom: var(--spacing-sm);
    /* Reduced bottom margin */
    position: sticky;
    top: 15px;
    /* Sits closer to the top edge */
    z-index: 100;
}

.header-floating-pill {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255, 255, 255, 0.35);
    /* Apple-style high transparency */
    backdrop-filter: blur(48px);
    /* Massive blur for realistic depth */
    -webkit-backdrop-filter: blur(48px);

    /* Liquid / Prism Edge Effect */
    border: 1px solid rgba(255, 255, 255, 0.5);
    /* Soft physical border */
    box-shadow:
        0 12px 40px 0 rgba(0, 0, 0, 0.08),
        /* Outer floating drop-shadow */
        inset 0 0 0 1px rgba(255, 255, 255, 0.1),
        /* Ultra-faint inner border reflection */
        inset 0 2px 4px rgba(255, 255, 255, 0.7),
        /* Strong upper rim highlight (liquid effect) */
        inset 0 -1px 2px rgba(0, 0, 0, 0.05);
    /* Bottom shadow for thickness */

    border-radius: 14px;
    padding: 0.3rem 1.25rem;
    /* Tight vertical padding for a slim bar */
    max-width: 1200px;
    margin: 0 auto;
}

.site-branding {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.site-title {
    margin: 0;
    font-family: var(--font-sans);
    /* Switch back to sans for the logo as in the image */
    font-size: 1.25rem;
    /* Slightly smaller logo text for a sleeker header */
    font-weight: 700;
}

.site-title a {
    text-decoration: none;
    color: var(--c-text-main);
    letter-spacing: -0.5px;
}

.site-logo img {
    height: 32px;
    /* Constrained to keep the header slim */
    width: auto;
    object-fit: contain;
    mix-blend-mode: multiply;
}

/* ... existing code ... */

.main-navigation {
    flex: 1;
    display: flex;
    justify-content: center;
    /* Center the links */
    padding: 0 1rem;
}

.main-navigation ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    gap: 1.5rem;
}

.main-navigation a {
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--c-text-muted);
    transition: all 0.2s ease;
    padding: 0.2rem 0;
    position: relative;
}

.main-navigation a:hover {
    color: var(--c-text-main);
}

/* Active State — nav link text stands out */
.main-navigation .current-menu-item a {
    color: var(--c-text-main);
    font-weight: 600;
    position: relative;
    z-index: 1;
    /* Sit on top of the bubble */
}

/* Liquid Glass Hover Bubble — Prism + Lens Effect */

/* Make nav items position relative so text can be transitioned independently */
.main-navigation ul li {
    position: relative;
}

/* All nav link text animates smoothly under the bubble */
.main-navigation a {
    display: inline-block;
    transition:
        transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1),
        color 0.2s ease;
    will-change: transform;
}

/* Text under the bubble appears magnified (glass lens effect) */
.main-navigation li.nav-hovered a {
    transform: scale(1.1);
    color: var(--c-text-main);
}

.nav-liquid-bubble {
    position: absolute;
    pointer-events: none;
    border-radius: 12px;
    opacity: 0;
    z-index: 0;

    /* Core glass: mostly transparent so text underneath is visible */
    background: rgba(255, 255, 255, 0.18);
    backdrop-filter: blur(10px) brightness(1.04);
    -webkit-backdrop-filter: blur(10px) brightness(1.04);

    /* Outer glow: subtle depth shadow */
    box-shadow:
        0 6px 24px rgba(0, 0, 0, 0.08),
        inset 0 1.5px 0 rgba(255, 255, 255, 0.9),
        /* Top rim highlight */
        inset 0 -1px 0 rgba(0, 0, 0, 0.04);
    /* Bottom depth */

    /* Smooth fluid motion with spring overshoot */
    transition:
        left 0.38s cubic-bezier(0.22, 1.4, 0.36, 1),
        top 0.38s cubic-bezier(0.22, 1.4, 0.36, 1),
        width 0.35s cubic-bezier(0.22, 1.4, 0.36, 1),
        height 0.35s cubic-bezier(0.22, 1.4, 0.36, 1),
        opacity 0.25s ease;
}

/* Prism edge: visible only at borders, transparent in center */
.nav-liquid-bubble::before {
    content: '';
    position: absolute;
    inset: -1px;
    border-radius: 13px;

    /* Center clear, prism spectrum appears at outer edge ring */
    background: radial-gradient(ellipse at center,
            transparent 42%,
            rgba(60, 150, 255, 0.18) 58%,
            rgba(130, 80, 255, 0.22) 70%,
            rgba(255, 80, 120, 0.18) 82%,
            rgba(255, 165, 50, 0.14) 92%,
            transparent 100%);

    z-index: -1;
    opacity: 0.85;
    mix-blend-mode: screen;
}

.header-action {
    display: flex;
    align-items: center;
}

.btn-header-subscribe {
    background-color: #d9f99d;
    /* The specific lime green from the image */
    color: #1a2e05;
    /* Dark readable text */
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    transition: background-color 0.2s;
    white-space: nowrap;
}

.btn-header-subscribe:hover {
    background-color: #bef264;
    color: #1a2e05;
}

/* ==========================================================================
   Footer Glass Background & Orbs
   ========================================================================== */

/* The outer wrapper that holds orbs + the frosted footer */
.footer-bg-wrap {
    position: relative;
    overflow: hidden;
    /* keep orbs clipped to footer area */
    padding: var(--spacing-xl) 0 0;
    background: transparent;
}

/* Decorative gradient orbs — these are what the glass blurs through */
.footer-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.45;
    pointer-events: none;
}

.footer-orb--1 {
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, #c7d2fe 0%, #a5b4fc 60%, transparent 100%);
    top: -80px;
    right: -100px;
}

.footer-orb--2 {
    width: 450px;
    height: 450px;
    background: radial-gradient(circle, #d9f99d 0%, #86efac 60%, transparent 100%);
    bottom: 0;
    left: -80px;
}

.footer-orb--3 {
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, #fde68a 0%, #fbcfe8 60%, transparent 100%);
    top: 80px;
    left: 40%;
}

/* ==========================================================================
   Footer (Stylized Card Style)
   ========================================================================== */
.site-footer {
    padding: 0 0 var(--spacing-md) 0;
    background-color: transparent;
    /* Let orbs show through */
    border-top: none;
    position: relative;
    /* above orbs */
    z-index: 1;
}

.footer-card {
    background: rgba(255, 255, 255, 0.35);
    /* Apple-style high transparency */
    backdrop-filter: blur(48px);
    /* Massive blur for realistic depth */
    -webkit-backdrop-filter: blur(48px);

    /* Liquid / Prism Edge Effect */
    border: 1px solid rgba(255, 255, 255, 0.5);
    /* Soft physical border */
    box-shadow:
        0 12px 40px 0 rgba(0, 0, 0, 0.08),
        /* Outer floating drop-shadow */
        inset 0 0 0 1px rgba(255, 255, 255, 0.1),
        /* Ultra-faint inner border reflection */
        inset 0 2px 4px rgba(255, 255, 255, 0.7),
        /* Strong upper rim highlight (liquid effect) */
        inset 0 -1px 2px rgba(0, 0, 0, 0.05);
    /* Bottom shadow for thickness */

    border-radius: 20px;
    padding: 3rem 4rem;
}

.footer-main-columns {
    display: flex;
    justify-content: space-between;
    gap: 3rem;
    margin-bottom: 3rem;
    flex-wrap: wrap;
}

/* Brand Col */
.footer-brand {
    flex: 1;
    min-width: 200px;
    padding-left: 1rem;
}

.footer-logo-title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}

.footer-logo-title h2 {
    margin: 0;
    font-family: var(--font-sans);
    font-size: 1.4rem;
    font-weight: 600;
    color: var(--c-link);
}

.footer-dots {
    display: flex;
    gap: 4px;
}

.dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
}

.dot-green {
    background-color: #a3e635;
}

.dot-yellow {
    background-color: #fde047;
}

.dot-blue {
    background-color: #60a5fa;
}

.footer-tagline {
    color: var(--c-text-muted);
    font-size: 0.95rem;
    margin: 0;
}

/* Newsletter Col */
.footer-newsletter {
    flex: 1.5;
    min-width: 300px;
    border-right: 1px solid var(--c-border);
    /* Divider in RTL */
    padding-right: 3rem;
}

.footer-newsletter h3 {
    margin-top: 0;
    font-family: var(--font-sans);
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
    color: var(--c-text-main);
}

.footer-newsletter p {
    font-size: 0.95rem;
    color: var(--c-text-muted);
    margin-bottom: 1.5rem;
}

.footer-form {
    display: flex;
    background-color: var(--c-bg);
    border: 1px solid var(--c-border);
    border-radius: 8px;
    padding: 0.25rem;
}

.footer-form input {
    flex: 1;
    border: none;
    background: transparent;
    padding: 0.6rem 1rem;
    font-family: var(--font-sans);
    font-size: 0.95rem;
    color: var(--c-text-main);
    outline: none;
}

.footer-form button {
    background-color: var(--c-accent-blue-light);
    color: var(--c-accent-blue);
    border: none;
    border-radius: 6px;
    padding: 0 1.2rem;
    font-weight: 600;
    font-family: var(--font-sans);
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.footer-form button:hover {
    background-color: var(--c-accent-blue);
    color: white;
}

/* Links Col */
.footer-links {
    flex: 1.5;
    min-width: 250px;
    display: flex;
    gap: 3rem;
}

.footer-nav-block h4 {
    margin-top: 0;
    font-family: var(--font-sans);
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--c-text-main);
}

.footer-nav-block ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.footer-nav-block a {
    color: var(--c-text-muted);
    text-decoration: none;
    font-size: 0.95rem;
}

.footer-nav-block a:hover {
    color: var(--c-accent-blue);
}

.footer-nav-block ul li::before {
    content: "•";
    color: #cbd5e1;
    margin-left: 0.5rem;
    font-size: 0.8rem;
}

.footer-socials {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
}

.footer-socials a {
    color: #94a3b8;
    transition: color 0.2s;
}

.footer-socials a:hover {
    color: var(--c-accent-blue);
}

/* Bottom */
.footer-bottom {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--c-border);
    font-size: 0.85rem;
    color: var(--c-text-muted);
}

.footer-icon {
    color: var(--c-border);
    display: inline-flex;
}

.footer-copy-links a {
    color: var(--c-text-muted);
    text-decoration: none;
}

.footer-copy-links a:hover {
    color: var(--c-link);
}

.footer-separator {
    margin: 0 0.5rem;
    color: var(--c-border);
}

/* Responsive Footer */
@media (max-width: 900px) {
    .footer-main-columns {
        flex-direction: column;
        gap: 2rem;
    }

    .footer-newsletter {
        border-right: none;
        padding-right: 0;
        border-bottom: 1px solid var(--c-border);
        padding-bottom: 2rem;
    }

    .footer-links {
        justify-content: flex-start;
        gap: 4rem;
        flex-wrap: wrap;
    }

    .footer-card {
        padding: 2rem;
    }
}


/* ==========================================================================
   About Page Specific Styles
   ========================================================================== */

.about-page-main {
    max-width: 1000px !important;
}

.about-hero-section {
    display: flex;
    gap: 0;
    /* Remove gap to facilitate overlap */
    align-items: center;
    position: relative;
    margin-bottom: var(--spacing-xxl);
}

.about-image-column {
    flex: 0 0 45%;
    position: relative;
    z-index: 1;
}

.bio-image-wrapper {
    position: relative;
    border-radius: 40px;
    /* Slightly more rounded for premium feel */
    overflow: hidden;
    box-shadow: 0 40px 80px rgba(0, 0, 0, 0.15);
    aspect-ratio: 1/1.1;
    /* Ultra-smooth expressive transition (physics-based feel) */
    transition: transform 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
    will-change: transform;
}

.bio-image-wrapper:hover {
    /* Tilt slightly to the right and lift */
    transform: scale(1.03) rotate(2.5deg) translateY(-5px);
}

.bio-photo {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.image-glass-overlay {
    position: absolute;
    inset: 0;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 40px;
    pointer-events: none;
    box-shadow: inset 0 0 20px rgba(255, 255, 255, 0.1);
}

.about-text-column {
    flex: 0 0 65%;
    margin-right: -10%;
    /* Negative margin for overlap in RTL */
    position: relative;
    z-index: 2;
}

/* LTR override if needed */
body:not(.rtl) .about-text-column {
    margin-left: -10%;
    margin-right: 0;
}

.bio-content-card {
    padding: 4rem 3.5rem;
    /* Large internal padding for editorial feel */
    border-radius: 40px;
    background: rgba(255, 255, 255, 0.4);
    backdrop-filter: blur(40px);
    -webkit-backdrop-filter: blur(40px);
    border: 1px solid rgba(255, 255, 255, 0.5);
    box-shadow:
        0 30px 60px rgba(0, 0, 0, 0.08),
        inset 0 0 0 1px rgba(255, 255, 255, 0.4);
    min-height: 450px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.bio-name {
    margin-bottom: 0.5rem;
    font-size: 3.2rem !important;
    font-weight: 800;
    letter-spacing: -1.5px;
    color: var(--c-text-main);
    line-height: 1.1;
}

.bio-intro {
    font-size: 1.45rem;
    line-height: 1.4;
    color: var(--c-text-main);
    font-family: var(--font-serif);
    margin-bottom: 2rem;
    font-weight: 600;
}

.bio-divider {
    height: 4px;
    background: linear-gradient(to left, var(--c-accent-blue), transparent);
    margin-bottom: 2.5rem;
    width: 60px;
    border-radius: 20px;
}

.bio-details {
    color: #374151;
    /* Deeper gray for better readability */
    font-size: 1.1rem;
    line-height: 1.9;
}

.bio-details p {
    margin-bottom: 1.25rem;
}

.bio-details p:last-child {
    margin-bottom: 0;
}

.bio-details p {
    margin-bottom: 1rem;
}

.section-subtitle {
    font-size: 1.8rem !important;
    text-align: center;
    margin-bottom: var(--spacing-md);
}

.philosophy-text {
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
    font-size: 1.15rem;
    line-height: 1.8;
    color: var(--c-text-main);
}

/* RTL Specific adjustments */
body.rtl .bio-divider {
    background: linear-gradient(to right, var(--c-accent-blue), transparent);
}

@media (max-width: 850px) {
    .about-hero-section {
        flex-direction: column;
        text-align: center;
        gap: var(--spacing-xl);
    }

    .about-image-column {
        flex: 0 0 auto;
        width: 280px;
    }

    .bio-image-wrapper {
        transform: none;
    }

    .bio-divider {
        margin: 0 auto var(--spacing-md);
    }
}

@media (max-width: 950px) {
    .about-hero-section {
        flex-direction: column;
        text-align: center;
    }

    .about-image-column,
    .about-text-column {
        flex: 1 1 auto;
        width: 100%;
        max-width: 500px;
        margin: 0 auto;
    }

    .about-text-column {
        margin-top: -60px;
        /* Overlap vertically on mobile */
    }

    .bio-content-card {
        padding: var(--spacing-lg);
    }
}

/* ==========================================================================
   Copy Protection — Glassmorphism Toast Notification
   ========================================================================== */
#copy-toast {
    /* Positioning — fixed center of viewport */
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -40%) scale(0.9);
    z-index: 9999;

    /* Layout */
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    max-width: 480px;
    width: calc(100% - 3rem);
    padding: 1.25rem 1.5rem;
    direction: rtl;

    /* Glassmorphism */
    background: rgba(255, 255, 255, 0.45);
    backdrop-filter: blur(40px);
    -webkit-backdrop-filter: blur(40px);
    border: 1px solid rgba(255, 255, 255, 0.6);
    border-radius: 18px;
    box-shadow:
        inset 0 2px 4px rgba(255, 255, 255, 0.8),
        0 16px 48px rgba(0, 0, 0, 0.12),
        0 4px 12px rgba(0, 0, 0, 0.06);

    /* Typography */
    font-family: var(--font-sans);
    color: var(--c-text-main);

    /* Transition */
    transition: transform 0.45s cubic-bezier(0.34, 1.56, 0.64, 1),
        opacity 0.35s ease;
    opacity: 0;
    pointer-events: none;
}

#copy-toast.copy-toast--show {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
    pointer-events: auto;
}

#copy-toast.copy-toast--hide {
    transform: translate(-50%, -44%) scale(0.95);
    opacity: 0;
    pointer-events: none;
}

/* Dark overlay behind the centered toast */
#copy-toast-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
    z-index: 9998;
    opacity: 0;
    transition: opacity 0.35s ease;
    pointer-events: none;
}

#copy-toast-overlay.overlay--show {
    opacity: 1;
    pointer-events: auto;
}

.copy-toast-icon {
    font-size: 2rem;
    line-height: 1;
    flex-shrink: 0;
    margin-top: 2px;
}

.copy-toast-body {
    flex: 1;
}

.copy-toast-title {
    margin: 0 0 0.35rem 0;
    font-size: 1rem;
    font-weight: 700;
    color: var(--c-text-main);
}

.copy-toast-msg {
    margin: 0;
    font-size: 0.88rem;
    line-height: 1.6;
    color: var(--c-text-muted);
}

.copy-toast-close {
    background: rgba(0, 0, 0, 0.06);
    border: none;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    cursor: pointer;
    font-size: 0.75rem;
    color: var(--c-text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background 0.2s;
    margin-top: 2px;
    padding: 0;
}

.copy-toast-close:hover {
    background: rgba(0, 0, 0, 0.12);
}