/**
 * Main Stylesheet for serefcicek.com
 *
 * Table of Contents:
 * 1. CSS Custom Properties (Design Tokens)
 * 2. Dark Mode Theme
 * 3. CSS Reset & Base Styles
 * 4. Typography
 * 5. Layout Components
 * 6. Profile Section
 * 7. Bio Section
 * 8. Social Links
 * 9. Footer
 * 10. Language Switcher
 * 11. Utility Classes
 * 12. Accessibility
 * 13. Responsive Design
 * 14. Print Styles
 */

/* =============================================================================
   1. CSS Custom Properties (Design Tokens)
   ============================================================================= */

:root {
    /* Colors - Light Mode (matching original design) */
    --color-primary: #212121;
    --color-accent: #616061;
    --color-text: #5e5e5e;
    --color-background: #edf0f0;
    --color-surface: #ffffff;
    --color-border: #929292;
    --color-muted: #727f80;
    --color-subtle: #7f8c8d;

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

    /* Typography */
    --font-family-serif: 'Lora', 'Georgia', serif;
    --font-size-xs: 0.75rem;
    --font-size-sm: 0.875rem;
    --font-size-base: 0.95rem;
    --font-size-md: 1rem;
    --font-size-lg: 1.5rem;
    --font-size-xl: 2rem;
    --font-weight-normal: 400;
    --font-weight-medium: 500;
    --font-weight-bold: 700;
    --line-height-base: 1.7;

    /* Layout */
    --container-max-width: 720px;
    --border-radius-sm: 6px;
    --border-radius-md: 10px;
    --border-radius-lg: 30px;

    /* Effects */
    --transition-fast: 0.1s ease;
    --transition-base: 0.1s ease;
    --transition-slow: 0.3s ease;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.03);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.05);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.08);

    /* Z-Index Scale */
    --z-base: 1;
    --z-dropdown: 100;
    --z-sticky: 500;
    --z-overlay: 1000;
}

/* =============================================================================
   2. Dark Mode Theme
   ============================================================================= */

/* System preference dark mode */
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --color-primary: #e8e8e8;
        --color-accent: #a9a8a9;
        --color-text: #b0b0b0;
        --color-background: #1a1d1d;
        --color-surface: #252828;
        --color-border: #6d7373;
        --color-muted: #8d9091;
        --color-subtle: #9aa3a4;
        --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.2);
    }
}

/* Manual dark mode override */
:root[data-theme="dark"] {
    --color-primary: #e8e8e8;
    --color-accent: #a9a8a9;
    --color-text: #b0b0b0;
    --color-background: #1a1d1d;
    --color-surface: #252828;
    --color-border: #6d7373;
    --color-muted: #8d9091;
    --color-subtle: #9aa3a4;
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.2);
}

/* =============================================================================
   3. CSS Reset & Base Styles
   ============================================================================= */

body {
    font-family: var(--font-family-serif);
    line-height: var(--line-height-base);
    margin: 0;
    padding: 0;
    background-color: var(--color-background);
    color: var(--color-text);
}

button {
    font-family: inherit;
}

/* =============================================================================
   4. Typography
   ============================================================================= */

h1 {
    font-size: 2rem;
    font-weight: 700;
    color: var(--color-primary);
    margin: 25px 0 15px;
    letter-spacing: -0.25px;
}

p {
    margin: 0 0 var(--space-lg);
}

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

em {
    font-style: italic;
}

strong {
    font-weight: var(--font-weight-bold);
}

/* =============================================================================
   5. Layout Components
   ============================================================================= */

.container {
    max-width: var(--container-max-width);
    margin: 80px auto;
    padding: 0 40px;
}

.card {
    background: var(--color-surface);
    border-radius: var(--border-radius-md);
    box-shadow: var(--shadow-md);
}

/* =============================================================================
   6. Profile Section
   ============================================================================= */

.profile-section {
    text-align: center;
    margin-bottom: 60px;
    padding: 40px 0;
    background: var(--color-surface);
    border-radius: var(--border-radius-md);
    box-shadow: var(--shadow-md);
}

.profile-img {
    width: 200px;
    height: 200px;
    border-radius: 50%;
    margin-top: 25px;
    margin-bottom: -5px;
    border: 3px solid var(--color-primary);
    object-fit: cover;
    transition: transform var(--transition-base);
}

.profile-img:hover {
    transform: scale(1.1);
}

.position {
    font-size: 1rem;
    color: var(--color-subtle);
    margin-bottom: 10px;
}

/* =============================================================================
   7. Bio Section
   ============================================================================= */

.bio-section {
    background: var(--color-surface);
    padding: 40px 50px;
    border-radius: var(--border-radius-md);
    box-shadow: var(--shadow-md);
    margin: 40px 0;
}

.bio {
    font-size: var(--font-size-base);
    text-align: justify;
    hyphens: auto;
    margin: 0 auto;
    max-width: var(--container-max-width);
}

.bio p {
    margin-bottom: 1.5em;
}

/* Links within bio */
.no-blue-link {
    color: var(--color-text);
    text-decoration: none;
}

.no-blue-link:hover {
    color: var(--color-accent);
    text-decoration: underline;
}

/* =============================================================================
   8. Social Links
   ============================================================================= */

.social-links {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin: 50px 0;
    flex-wrap: wrap;
}

.social-link {
    color: var(--color-primary);
    text-decoration: none;
    padding: 5px 15px;
    border: 2px solid var(--color-primary);
    border-radius: var(--border-radius-lg);
    transition: all var(--transition-base);
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
}

.social-link:hover {
    background: var(--color-primary);
    color: var(--color-surface);
    transform: translateY(-2px);
}

/* =============================================================================
   9. Footer
   ============================================================================= */

footer {
    text-align: center;
    color: var(--color-muted);
    padding: 40px 0;
    margin-top: 60px;
    border-top: 1px solid var(--color-border);
    font-size: 0.9rem;
}

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

.contact-link {
    color: var(--color-accent);
    text-decoration: none;
    font-weight: 500;
}

/* =============================================================================
   10. Language Switcher
   ============================================================================= */

.lang-switcher {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin-bottom: 20px;
}

.lang-btn {
    padding: 6px 12px;
    font-size: 0.8rem;
    border: 1px solid var(--color-primary);
    background: var(--color-surface);
    color: var(--color-primary);
    cursor: pointer;
    border-radius: var(--border-radius-sm);
    transition: all var(--transition-base);
}

.lang-btn.active,
.lang-btn:hover {
    background: var(--color-primary);
    color: var(--color-surface);
}

/* Theme Toggle - subtle text in footer */
.theme-toggle {
    font-size: 0.75rem;
    color: var(--color-muted);
    cursor: pointer;
    margin-top: var(--space-lg);
    opacity: 0.6;
    transition: opacity var(--transition-base);
}

.theme-toggle:hover {
    opacity: 1;
}

/* Theme icon visibility */
.theme-icon {
    display: none;
}

/* Light mode: show "Light" text */
:root:not([data-theme="dark"]) .theme-icon--light {
    display: inline;
}

/* Dark mode: show "Dark" text */
[data-theme="dark"] .theme-icon--dark {
    display: inline;
}

/* When system prefers dark and no override */
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) .theme-icon--light {
        display: none;
    }
    :root:not([data-theme="light"]) .theme-icon--dark {
        display: inline;
    }
}

/* =============================================================================
   11. Utility Classes
   ============================================================================= */

/* Screen Reader Only - Visually hidden but accessible */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Focus visible utility */
.focus-visible:focus {
    outline: 2px solid var(--color-accent);
    outline-offset: 2px;
}

/* =============================================================================
   12. Accessibility
   ============================================================================= */

/* Skip Link */
.skip-link {
    position: absolute;
    top: -100%;
    left: 50%;
    transform: translateX(-50%);
    background: var(--color-primary);
    color: var(--color-surface);
    padding: var(--space-md) var(--space-xl);
    text-decoration: none;
    border-radius: 0 0 var(--border-radius-sm) var(--border-radius-sm);
    z-index: var(--z-overlay);
    transition: top var(--transition-base);
    font-weight: var(--font-weight-medium);
}

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

/* Reduced Motion */
@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;
    }

    .profile-img:hover {
        transform: none;
    }

    .social-link:hover {
        transform: none;
    }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    :root {
        --shadow-md: none;
        --shadow-lg: none;
    }

    .card,
    .profile-section,
    .bio-section {
        border: 2px solid var(--color-primary);
    }
}

/* =============================================================================
   13. Responsive Design
   ============================================================================= */

/* Tablet and Mobile */
@media (max-width: 720px) {
    .container {
        padding: 0 20px;
        margin: 40px auto;
    }

    .profile-section {
        padding: 30px 20px;
    }

    .bio-section {
        padding: 30px;
    }

    h1 {
        font-size: 2.5rem;
    }
}

/* =============================================================================
   14. Print Styles
   ============================================================================= */

@media print {
    :root {
        --color-background: white;
        --color-surface: white;
        --color-text: black;
        --color-primary: black;
    }

    body {
        background: white;
        color: black;
        font-size: 12pt;
    }

    .skip-link,
    .theme-toggle {
        display: none !important;
    }

    .container {
        margin: 0;
        padding: 0;
        max-width: 100%;
    }

    .profile-section,
    .bio-section {
        box-shadow: none;
        border: 1px solid #ccc;
        page-break-inside: avoid;
        margin-bottom: 1rem;
    }

    .profile-img {
        width: 150px;
        height: 150px;
        border-width: 2px;
    }

    .social-links {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .social-link {
        border: none;
        padding: 0.25rem 0;
        display: block;
    }

    .social-link::after {
        content: " (" attr(href) ")";
        font-size: 10pt;
        color: #666;
    }

    a {
        color: black;
        text-decoration: underline;
    }

    footer {
        border-top: 1px solid #ccc;
        margin-top: 1rem;
        padding-top: 1rem;
    }

    /* Avoid page breaks in important sections */
    h1, h2, h3 {
        page-break-after: avoid;
    }

    .bio p {
        orphans: 3;
        widows: 3;
    }
}
