/* Vazirmatn */
@font-face {
    font-family: 'Vazirmatn';
    src: url('assets/fonts/Vazirmatn-Regular.woff2') format('woff2');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Vazirmatn';
    src: url('assets/fonts/Vazirmatn-Medium.woff2') format('woff2');
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}

/* Tokens */
:root {
    --color-text: #424242;
    --color-heading: #212121;
    --color-muted: #757575;
    --color-border: #FAFAFA;
    --bg-body: #FAFAFA;
    --bg-card: #FFFFFF;
    --bg-hover: #f5f5f5;
    --section-padding: 4rem 0;
    --radius: 4px;

    /* Font sizes */
    --font-size-sm: 0.875rem;
    --font-size-md: 1rem;
    --font-size-lg: 1.25rem;
    --font-size-xl: 1.5rem;

    /* Spacing */
    --space-sm: 0.5rem;
    --space-md: 1rem;
    --space-lg: 1.5rem;
    --space-xl: 2rem;
    --space-2xl: 3rem;
}

/* Reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Vazirmatn', sans-serif;
    font-size: var(--font-size-md);
    color: var(--color-text);
    background-color: var(--bg-body);
    direction: rtl;
}

/* Container */
.container {
    width: 100%;
    max-width: 960px;
    margin-inline: auto;
    padding-inline: var(--space-2xl);
    padding-block: 0;
}

/* Typography */
h1, h2, h3 {
    margin-bottom: var(--space-md);
    font-weight: 500;
}

h1 {
    font-size: var(--font-size-xl);
    color: var(--color-heading);
}

h2 {
    font-size: var(--font-size-lg);
    color: var(--color-heading);
}

h3 {
    font-size: var(--font-size-md);
    color: var(--color-heading);
}

p {
    margin-bottom: var(--space-md);
}

a {
    color: var(--color-text);
    text-decoration: underline;
    transition: color 0.3s ease;
}

a:hover {
    color: #111;
}

/* Hero Section */
.hero {
    background: var(--bg-hover);
    color: var(--color-text);
    padding: var(--section-padding);
    min-height: 500px;
    display: flex;
    align-items: center;
}

.hero-content {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: var(--space-2xl);
    align-items: center;
    width: 100%;
}

.hero-image {
    order: 2;
    margin-inline-start: 0;
    width: 300px;
    aspect-ratio: 1;
    overflow: hidden;
    border-radius: 50%;
}

.hero-image img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

.hero-text {
    order: 1;
}

.hero-text h1 {
    font-size: var(--font-size-xl);
    margin-bottom: var(--space-sm);
}

.hero-text h2 {
    font-size: var(--font-size-lg);
    margin-bottom: var(--space-lg);
}

.hero-text p {
    color: var(--color-text);
    font-size: var(--font-size-md);
    margin-bottom: var(--space-xl);
}

.contact-info {
    background: var(--bg-card);
    padding: var(--space-md);
    border-radius: 8px;
    border: 1px solid var(--color-border);
}

.contact-info p {
    margin-bottom: var(--space-sm);
    color: var(--color-text);
}

.contact-info a,
.footer-contact a {
    color: var(--color-text);
    text-decoration: none;
}

.contact-info a:hover,
.footer-contact a:hover {
    color: var(--color-heading);
}

.contact-info .contact-icon svg,
.footer-contact .contact-icon svg {
    width: 1.125rem;
    height: 1.125rem;
    vertical-align: middle;
    display: inline-block;
    margin-left: 0.35rem;
}

/* تجربه‌ها */
.section-experiences {
    padding: var(--section-padding);
    background: var(--bg-hover);
}

.section-experiences h2,
.experience h2 {
    text-align: right;
    color: var(--color-heading);
}

.section-experiences h2 {
    margin-bottom: var(--space-xl);
}

.section-experiences .category-title {
    color: var(--color-heading);
    font-size: var(--font-size-lg);
    margin-top: var(--space-2xl);
    margin-bottom: var(--space-sm);
}

.section-experiences .category-title:first-child {
    margin-top: 0;
}

.section-experiences .category-subtitle {
    color: var(--color-muted);
    font-size: var(--font-size-md);
    margin-bottom: var(--space-lg);
}

.section-experiences .category-grid {
    margin-bottom: var(--space-2xl);
}

.section-experiences .category-grid:last-child {
    margin-bottom: 0;
}

.block-images {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: var(--space-md);
}

.block-image {
    position: relative;
    background: var(--bg-card);
    overflow: hidden;
    border-radius: var(--radius);
    border: 1px solid var(--color-border);
    cursor: pointer;
    transition: border-color 0.2s ease, background 0.2s ease;
}

.block-image:has(video),
.block-image:has(.block-video-placeholder) {
    background: #252525;
}

.block-image:hover {
    border-color: #ccc;
    background: var(--bg-body);
}

.block-image img,
.block-image video,
.block-image .block-video-placeholder {
    width: 100%;
    height: 220px;
    object-fit: cover;
    display: block;
}

.block-image .block-video-placeholder {
    pointer-events: auto;
    background: #252525;
    cursor: pointer;
}

.block-image video.block-video {
    pointer-events: auto;
    background: #252525;
}

.video-play-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1;
    pointer-events: none;
    width: 52px;
    height: 52px;
}

.video-play-overlay svg {
    width: 100%;
    height: 100%;
}

.media-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: var(--space-sm) var(--space-md);
    background: rgba(0, 0, 0, 0.75);
    color: #fff;
    font-size: var(--font-size-sm);
    text-align: right;
    opacity: 0;
    transition: opacity 0.2s ease;
    pointer-events: none;
}

.block-image:hover .media-caption {
    opacity: 1;
}

/* Experience */
.experience {
    padding: var(--section-padding);
    background: var(--bg-body);
}

.experience h2 {
    margin-bottom: var(--space-2xl);
}

.timeline-item {
    background: var(--bg-card);
    padding: var(--space-md) var(--space-xl);
    margin-bottom: var(--space-md);
    border-radius: var(--radius);
    border: 1px solid #eee;
    border-right: 4px solid var(--color-text);
    transition: background 0.2s ease;
}

.timeline-item:hover {
    background: #f8f8f8;
}

.timeline-item-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: var(--space-sm);
}

.timeline-date {
    font-size: var(--font-size-sm);
    color: var(--color-muted);
}

.timeline-item h3 {
    color: var(--color-text);
    margin: 0;
}

.timeline-item p {
    font-size: var(--font-size-sm);
    color: var(--color-muted);
    margin: 0;
}

/* Lightbox */
.lightbox {
    display: none;
    position: fixed;
    z-index: 1000;
    inset: 0;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.9);
    padding-block: 50px;
}

.lightbox.active {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.lightbox-media {
    position: relative;
    max-width: 90%;
    max-height: 80vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-content {
    max-width: 100%;
    max-height: 80vh;
    object-fit: contain;
    display: block;
}

.lightbox-video {
    display: none;
    max-height: 80vh;
    width: auto;
}

.lightbox-video.active {
    display: block;
}

.lightbox-caption {
    display: block;
    margin-top: var(--space-md);
    color: #fff;
    text-align: center;
    max-width: 90%;
}

.lightbox-close {
    position: absolute;
    top: 20px;
    left: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem;
    background: none;
    border: none;
    color: #fff;
    cursor: pointer;
    transition: color 0.3s ease;
}

.lightbox-close:hover {
    color: #999;
}

.lightbox-close svg {
    display: block;
    width: 28px;
    height: 28px;
}

.lightbox-prev,
.lightbox-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 3rem;
    height: 3rem;
    padding: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    border: 2px solid #fff;
    color: #fff;
    cursor: pointer;
    transition: background 0.3s ease, color 0.3s ease;
}

.lightbox-prev:hover,
.lightbox-next:hover {
    background: rgba(255, 255, 255, 0.25);
}

.lightbox-prev svg,
.lightbox-next svg {
    display: block;
    width: 24px;
    height: 24px;
}

.lightbox-prev {
    right: 2rem;
}

.lightbox-next {
    left: 2rem;
}


/* Footer */
.footer {
    background: var(--bg-body);
    color: var(--color-text);
    padding: 3rem 0;
}

.footer-content {
    margin-bottom: 0;
}

.footer-contact h3 {
    color: var(--color-heading);
    margin-bottom: 1rem;
    text-align: right;
}

.footer-contact p {
    margin-bottom: 0.5rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .hero-content {
        grid-template-columns: 1fr;
        text-align: right;
        gap: 2rem;
    }

    .hero-image {
        order: 1;
        margin: 0 auto;
        width: 250px;
        aspect-ratio: 1;
    }

    .hero-text {
        order: 2;
    }

    .hero-text h1 {
        font-size: 2rem;
    }

    .hero-text h2 {
        font-size: 1.2rem;
    }

    h1 {
        font-size: 2rem;
    }

    h2 {
        font-size: 1.5rem;
    }

    .container {
        padding-inline: var(--space-xl);
        padding-block: 0;
    }


    .block-images {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: var(--space-sm);
    }
}

@media (max-width: 480px) {
    .block-images {
        grid-template-columns: 1fr;
        gap: var(--space-sm);
    }

    .hero {
        padding: var(--space-xl) 0;
    }

    .hero-image {
        width: 200px;
        aspect-ratio: 1;
    }
}
