:root {
    --text-color: #1d1d1f;
    --secondary-text: #86868b;
    --background-color: #fff;
    --link-color: #0066cc;
    --link-hover-color: #0077ed;
    --border-color: #d2d2d7;
    --card-background: #f5f5f7;
    --header-background: rgba(255, 255, 255, 0.9);
    --shadow-color: rgba(0, 0, 0, 0.08);
}

[data-theme="dark"] {
    --text-color: #f5f5f7;
    --secondary-text: #a1a1a6;
    --background-color: #1d1d1f;
    --link-color: #409cff;
    --link-hover-color: #5fbfff;
    --border-color: #424245;
    --card-background: #2d2d30;
    --header-background: rgba(29, 29, 31, 0.9);
    --shadow-color: rgba(0, 0, 0, 0.3);
}

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

html {
    font-family: system-ui, sans-serif;
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    color: var(--text-color);
    scroll-behavior: smooth;
    transition: color 0.3s ease, background-color 0.3s ease;
}

body {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
    background-color: var(--background-color);
    line-height: 1.5;
    transition: background-color 0.3s ease;
}

/* Header */
header {
    position: sticky;
    top: 0;
    padding: 1rem 0;
    background-color: var(--header-background);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 2rem;
    z-index: 100;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background-color 0.3s ease, border-bottom-color 0.3s ease;
}

header a {
    display: inline-block;
    text-decoration: none;
}

header img {
    display: block;
    height: 32px;
    width: auto;
}

/* Theme Toggle */
#theme-toggle {
    background: none;
    border: 2px solid var(--border-color);
    border-radius: 50%;
    width: 44px;
    height: 44px;
    cursor: pointer;
    transition: all 0.3s ease, border-color 0.3s ease, color 0.3s ease;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-color);
}

#theme-toggle:hover {
    border-color: var(--link-color);
    background-color: var(--card-background);
    transform: scale(1.05);
}

#theme-toggle:focus {
    outline: 2px solid var(--link-color);
    outline-offset: 2px;
}

#theme-toggle .sun-icon,
#theme-toggle .moon-icon {
    position: absolute;
    transition: all 0.3s ease;
}

/* Light mode - show sun */
:root #theme-toggle .sun-icon {
    opacity: 1;
    transform: rotate(0deg) scale(1);
}

:root #theme-toggle .moon-icon {
    opacity: 0;
    transform: rotate(90deg) scale(0);
}

/* Dark mode - show moon */
[data-theme="dark"] #theme-toggle .sun-icon {
    opacity: 0;
    transform: rotate(-90deg) scale(0);
}

[data-theme="dark"] #theme-toggle .moon-icon {
    opacity: 1;
    transform: rotate(0deg) scale(1);
}

/* Main Content */
h1 {
    font-size: 2.5rem;
    font-weight: 600;
    line-height: 1.2;
    margin-bottom: 2rem;
    letter-spacing: -0.02em;
    transition: color 0.3s ease;
}

.container {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
}

.photo {
    display: flex;
    justify-content: center;
    width: 100%;
}

.photo img {
    border-radius: 12px;
    object-fit: cover;
    box-shadow: 0 12px 24px var(--shadow-color);
    max-width: 100%;
    height: auto;
}

.body {
    font-size: 1.125rem;
    line-height: 1.6;
    transition: color 0.3s ease;
}

.body p {
    margin-bottom: 1.5rem;
}

.body strong {
    font-weight: 600;
}

.body span[lang] {
    font-weight: 500;
}

.body ul {
    list-style-position: inside;
    margin-bottom: 1.5rem;
    padding-left: 1rem;
}

.body li {
    margin-bottom: 0.5rem;
}

.body a {
    color: var(--link-color);
    text-decoration: none;
    transition: color 0.3s ease, border-bottom 0.3s ease;
    border-bottom: 1px solid transparent;
}

.body a:hover {
    color: var(--link-hover-color);
    border-bottom: 1px solid var(--link-hover-color);
}

/* Info section */
.info-section {
    background-color: var(--card-background);
    border-radius: 12px;
    padding: 1.5rem;
    margin-top: 2rem;
    transition: background-color 0.3s ease;
}

.info-section h2 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 1rem;
    transition: color 0.3s ease;
}

.info-section ul {
    list-style: none;
    padding: 0;
}

.info-section li {
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
}

.info-section li b {
    font-weight: 600;
}

/* Articles section */
.articles-section h2 {
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--text-color);
    transition: color 0.3s ease;
}

.articles-list {
    margin-bottom: 1.5em;
}

/* Audio player */
#play-xfq-audio {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.375rem 0.5rem;
    margin-left: 0.5rem;
    background-color: var(--link-color);
    border: none;
    border-radius: 1.25rem;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

#play-xfq-audio:hover {
    background-color: var(--link-hover-color);
}

#play-xfq-audio img {
    filter: invert(1);
}

/* Footer */
hr {
    border: none;
    height: 1px;
    background-color: var(--border-color);
    margin: 3rem 0 1.5rem;
    transition: background-color 0.3s ease;
}

address {
    font-style: normal;
    color: var(--secondary-text);
    font-size: 0.875rem;
    padding-bottom: 2rem;
    transition: color 0.3s ease;
}

/* Responsive design */
@media (min-width: 768px) {
    h1 {
        font-size: 3rem;
    }

    .container {
        grid-template-columns: 1fr 2fr;
        align-items: start;
        gap: 3rem;
    }

    .photo {
        position: sticky;
        top: 6rem;
    }
    
    header img {
        height: 44px;
    }
    
    .info-section {
        margin-top: 0;
    }

    .articles-grid {
        grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
        gap: 2rem;
    }
}