:root {
    --bg-color: #faf9f6;
    --bg-secondary: #f3f1ec;
    --text-color: #2a2a2a;
    --text-secondary: #555;
    --accent-color: #a67c52;
    --link-color: #8c5e3c;
    --border-color: rgba(0, 0, 0, 0.08);
    --font-serif: 'Lora', serif;
    --font-sans: 'Inter', sans-serif;
    --max-width: 740px;
}

html {
    scroll-behavior: smooth;
}

::selection {
    background-color: rgba(166, 124, 82, 0.25);
    color: var(--text-color);
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: var(--font-serif);
    line-height: 1.8;
    margin: 0;
    padding: 0;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 3rem 1.5rem;
}

/* --- Header & Profile --- */
header {
    text-align: center;
    margin-bottom: 4rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 2rem;
}

.profile {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.avatar {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #fff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    margin-bottom: 1rem;
    transition: transform 0.3s ease;
}

.avatar:hover {
    transform: scale(1.05);
}

h1 {
    font-family: var(--font-sans);
    font-size: 1.8rem;
    font-weight: 500;
    letter-spacing: 1px;
    margin: 0.5rem 0 0.2rem 0;
    text-transform: uppercase;
    color: #111;
}

.subtitle {
    font-family: var(--font-sans);
    font-size: 0.9rem;
    color: #666;
    font-weight: 300;
}

/* --- Navigation --- */
nav {
    margin-top: 1.5rem;
}

nav a {
    font-family: var(--font-sans);
    color: #888;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9rem;
    margin: 0 15px;
    padding-bottom: 2px;
    border-bottom: 2px solid transparent;
    transition: all 0.3s;
}

nav a:hover,
nav a.active {
    color: var(--accent-color);
    border-bottom-color: var(--accent-color);
}

nav a:focus-visible {
    outline: 2px solid var(--accent-color);
    outline-offset: 4px;
    border-radius: 2px;
}

/* --- Typography & Posts --- */
article.post {
    margin-bottom: 4rem;
    animation: fadeIn 0.6s ease;
}

article.preview {
    margin-bottom: 3rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--border-color);
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.date {
    display: block;
    font-family: var(--font-sans);
    font-size: 0.85rem;
    color: #999;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

h2 {
    font-family: var(--font-serif);
    font-size: 2rem;
    font-weight: 400;
    margin: 0 0 1.5rem 0;
    line-height: 1.3;
    color: #111;
}

h2 a {
    text-decoration: none;
    color: inherit;
    background-image: linear-gradient(var(--accent-color), var(--accent-color));
    background-position: 0% 100%;
    background-repeat: no-repeat;
    background-size: 0% 1px;
    transition: background-size 0.3s;
}

h2 a:hover {
    background-size: 100% 1px;
}

h2 a:focus-visible {
    outline: 2px solid var(--accent-color);
    outline-offset: 2px;
    border-radius: 2px;
}

h3 {
    font-size: 1.4rem;
    margin-top: 2.5rem;
    margin-bottom: 1rem;
    font-weight: 600;
    line-height: 1.4;
}

p {
    margin-bottom: 1.5rem;
    color: #333;
    max-width: 65ch;
}

blockquote {
    margin: 2rem 0;
    padding: 1rem 1.5rem;
    border-left: 3px solid var(--accent-color);
    background-color: var(--bg-secondary);
    border-radius: 0 4px 4px 0;
    font-style: italic;
    color: var(--text-secondary);
}

blockquote p {
    margin-bottom: 0;
}

/* --- Dual Language & TTS --- */
.content-en,
.content-tr {
    position: relative;
}

.lang-divider {
    border: 0;
    height: 1px;
    background: linear-gradient(to right, transparent, rgba(0, 0, 0, 0.1), transparent);
    margin: 3rem 0;
}

.content-tr {
    color: #4a4a4a;
}

.content-tr h3 {
    color: var(--accent-color);
}

/* TTS Button */
.tts-btn {
    background: transparent;
    border: 1px solid #e0e0e0;
    border-radius: 20px;
    padding: 8px 16px;
    font-family: var(--font-sans);
    font-size: 0.8rem;
    color: #666;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 1rem;
    min-height: 44px;
    min-width: 44px;
}

.tts-btn:hover {
    border-color: var(--accent-color);
    color: var(--accent-color);
}

.tts-btn:focus-visible {
    outline: 2px solid var(--accent-color);
    outline-offset: 2px;
    border-radius: 20px;
}

.tts-btn.playing {
    background-color: var(--accent-color);
    color: #fff;
    border-color: var(--accent-color);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(166, 124, 82, 0.4); }
    70% { box-shadow: 0 0 0 6px rgba(166, 124, 82, 0); }
    100% { box-shadow: 0 0 0 0 rgba(166, 124, 82, 0); }
}

/* --- Read More Link --- */
.read-more {
    display: inline-block;
    font-family: var(--font-sans);
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--link-color);
    text-decoration: none;
    margin-top: 0.5rem;
    transition: color 0.2s;
}

.read-more:hover {
    color: #111;
}

.read-more:focus-visible {
    outline: 2px solid var(--accent-color);
    outline-offset: 2px;
    border-radius: 2px;
}

/* --- Gallery Grid --- */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.gallery-card {
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 2rem;
    text-decoration: none;
    color: var(--text-color);
    transition: transform 0.3s, box-shadow 0.3s, border-color 0.3s;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.gallery-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.05);
    border-color: var(--accent-color);
}

.card-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.gallery-card h3 {
    margin: 0 0 0.5rem 0;
    font-size: 1.4rem;
    color: var(--text-color);
}

.gallery-card p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin: 0;
}

/* --- Footer (Fixed) --- */
footer {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    margin-top: 5rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
    font-family: var(--font-sans);
    font-size: 0.8rem;
    color: #999;
    width: 100%;
}

footer p {
    margin: 0.2rem 0;
    max-width: 100%;
}

.system-note {
    font-size: 0.7rem;
    opacity: 0.7;
}

/* --- Responsive: Tablet (768px) --- */
@media (max-width: 768px) {
    .container {
        padding: 2rem 1.25rem;
    }

    header {
        margin-bottom: 3rem;
    }

    h1 {
        font-size: 1.6rem;
    }

    h2 {
        font-size: 1.75rem;
    }

    h3 {
        font-size: 1.25rem;
    }

    article.post {
        margin-bottom: 3rem;
    }

    article.preview {
        margin-bottom: 2rem;
        padding-bottom: 1.5rem;
    }

    footer {
        margin-top: 3rem;
    }
}

/* --- Responsive: Mobile (600px) --- */
@media (max-width: 600px) {
    .container {
        padding: 1.5rem 1rem;
    }

    h1 {
        font-size: 1.5rem;
    }

    h2 {
        font-size: 1.6rem;
    }

    nav a {
        margin: 0 8px;
    }

    .avatar {
        width: 80px;
        height: 80px;
    }

    .tts-btn {
        padding: 10px 18px;
        font-size: 0.85rem;
    }

    footer {
        padding-top: 1.5rem;
        margin-top: 2.5rem;
    }

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

/* --- Responsive: Small Mobile (480px) --- */
@media (max-width: 480px) {
    .container {
        padding: 1.25rem 0.75rem;
    }

    h1 {
        font-size: 1.3rem;
        letter-spacing: 0.5px;
    }

    h2 {
        font-size: 1.4rem;
    }

    h3 {
        font-size: 1.15rem;
    }

    nav a {
        margin: 0 6px;
        font-size: 0.85rem;
    }

    article.preview {
        margin-bottom: 1.5rem;
        padding-bottom: 1.25rem;
    }

    .lang-divider {
        margin: 2rem 0;
    }

    p {
        font-size: 0.95rem;
        line-height: 1.7;
    }
}

/* --- Dark Mode --- */
@media (prefers-color-scheme: dark) {
    :root {
        --bg-color: #1a1a1a;
        --bg-secondary: #242424;
        --text-color: #e0ddd8;
        --text-secondary: #b0aaa0;
        --accent-color: #c9a06c;
        --link-color: #d4a96a;
        --border-color: rgba(255, 255, 255, 0.08);
    }

    h1 {
        color: #f0ede8;
    }

    h2 {
        color: #f0ede8;
    }

    p {
        color: #ccc8c0;
    }

    .subtitle {
        color: #999;
    }

    .date {
        color: #888;
    }

    .avatar {
        border-color: #333;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    }

    nav a {
        color: #999;
    }

    .content-tr {
        color: #b0aaa0;
    }

    .tts-btn {
        border-color: #444;
        color: #aaa;
    }

    .tts-btn:hover {
        border-color: var(--accent-color);
        color: var(--accent-color);
    }

    .tts-btn.playing {
        background-color: var(--accent-color);
        color: #1a1a1a;
        border-color: var(--accent-color);
    }

    blockquote {
        background-color: var(--bg-secondary);
        border-left-color: var(--accent-color);
        color: var(--text-secondary);
    }

    .read-more:hover {
        color: #f0ede8;
    }

    .gallery-card {
        background: var(--bg-secondary);
        border-color: rgba(255,255,255,0.05);
        color: var(--text-color);
    }
    .gallery-card h3 {
        color: var(--text-color);
    }
    .gallery-card p {
        color: var(--text-secondary);
    }

    footer {
        color: #777;
    }

    ::selection {
        background-color: rgba(201, 160, 108, 0.3);
        color: #f0ede8;
    }
}

/* --- Print Styles --- */
@media print {
    body {
        background: #fff;
        color: #000;
        font-size: 12pt;
    }

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

    header {
        margin-bottom: 2rem;
    }

    .avatar,
    nav,
    .tts-btn,
    footer {
        display: none;
    }

    h2 {
        page-break-after: avoid;
    }

    article {
        page-break-inside: avoid;
    }

    a {
        color: #000;
        text-decoration: underline;
    }

    h2 a {
        background-image: none;
    }
}
