@import url('https://fonts.googleapis.com/css2?family=Lora:wght@400;500;600;700&display=swap');

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

html {
    scroll-behavior: smooth;
}

/* Custom text selection color */
::selection {
    background: rgba(168, 189, 255, 0.3);
    color: #0f0f0f;
}

::-moz-selection {
    background: rgba(168, 189, 255, 0.3);
    color: #0f0f0f;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Inter', sans-serif;
    font-size: 18px;
    line-height: 1.7;
    color: #3a3a3a;
    position: relative;
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

/* Complex gradient background */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background:
        radial-gradient(circle at 20% 30%, rgba(168, 189, 255, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(255, 182, 193, 0.12) 0%, transparent 50%),
        radial-gradient(circle at 40% 70%, rgba(179, 229, 252, 0.13) 0%, transparent 50%),
        radial-gradient(circle at 90% 80%, rgba(243, 229, 245, 0.14) 0%, transparent 50%),
        radial-gradient(circle at 10% 90%, rgba(255, 229, 180, 0.11) 0%, transparent 50%),
        radial-gradient(circle at 60% 50%, rgba(200, 230, 201, 0.10) 0%, transparent 50%),
        linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
}

/* Animated floating gradients */
.gradient-orb {
    position: fixed;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.3;
    z-index: -1;
    animation: float 20s ease-in-out infinite;
}

.gradient-orb-1 {
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(147, 197, 253, 0.4) 0%, transparent 70%);
    top: -100px;
    left: -100px;
    animation-delay: 0s;
}

.gradient-orb-2 {
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(251, 207, 232, 0.4) 0%, transparent 70%);
    top: 30%;
    right: -50px;
    animation-delay: -7s;
}

.gradient-orb-3 {
    width: 450px;
    height: 450px;
    background: radial-gradient(circle, rgba(196, 181, 253, 0.3) 0%, transparent 70%);
    bottom: 10%;
    left: 20%;
    animation-delay: -14s;
}

@keyframes float {
    0%, 100% {
        transform: translate(0, 0) scale(1);
    }
    33% {
        transform: translate(30px, -30px) scale(1.1);
    }
    66% {
        transform: translate(-20px, 20px) scale(0.9);
    }
}

/* Mobile optimizations - disable animations and reduce blur */
@media (max-width: 768px) {
    .gradient-orb {
        animation: none;
        filter: blur(40px);
        opacity: 0.2;
    }

    /* Simplify to static positions on mobile */
    .gradient-orb-1 {
        transform: none;
    }

    .gradient-orb-2 {
        transform: none;
    }

    .gradient-orb-3 {
        transform: none;
    }
}

nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    background: rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.04);
    transition: transform 0.3s ease, opacity 0.3s ease;
}

nav.hidden {
    transform: translateY(-100%);
    opacity: 0;
}

nav .nav-container {
    max-width: 720px;
    margin: 0 auto;
    padding: 1rem 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

nav .logo {
    font-family: 'Lora', 'Georgia', serif;
    font-size: 1.2rem;
    font-weight: 600;
    color: #0f0f0f;
    text-decoration: none;
}

nav ul {
    display: flex;
    gap: 2rem;
    list-style: none;
    margin: 0;
    padding: 0;
}

nav a {
    color: #3a3a3a;
    text-decoration: none;
    font-size: 0.95rem;
    transition: color 0.2s ease;
    border-radius: 4px;
    padding: 4px 8px;
    margin: -4px -8px;
}

nav a:hover {
    color: #2563eb;
}

nav a:focus {
    outline: 2px solid rgba(37, 99, 235, 0.5);
    outline-offset: 2px;
    color: #2563eb;
}

/* Auth links styling */
.auth-links {
    opacity: 0.5;
    transition: opacity 0.2s ease;
    display: flex;
    align-items: center;
}

.auth-links:hover {
    opacity: 1;
}

.auth-links a {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Inter', sans-serif;
    font-size: 0.95rem;
}

.auth-links a:hover {
    text-decoration: none;
}

/* Slideshow link button */
.slideshow-link {
    display: flex;
    justify-content: center;
    margin: 0 0 2rem 0;
}

.slideshow-button {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1.2rem;
    background: rgba(37, 99, 235, 0.08);
    border: 1px solid rgba(37, 99, 235, 0.2);
    border-radius: 6px;
    color: #2563eb;
    text-decoration: none;
    font-size: 0.9rem;
    transition: all 0.2s ease;
}

.slideshow-button:hover {
    background: rgba(37, 99, 235, 0.12);
    border-color: rgba(37, 99, 235, 0.3);
    transform: translateY(-1px);
}

.slideshow-button::after {
    display: none;
}

.slideshow-button svg {
    flex-shrink: 0;
}

.container {
    max-width: 720px;
    margin: 0 auto;
    padding: 120px 24px 80px;
}

header {
    margin-bottom: 60px;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Lora', 'Georgia', 'Iowan Old Style', 'Times New Roman', serif;
    font-weight: 600;
    line-height: 1.3;
    margin-bottom: 0.8em;
    color: #0f0f0f;
    letter-spacing: -0.015em;
}

h1 {
    font-size: 2.5rem;
    margin-bottom: 0.3em;
}

h2 {
    font-size: 2rem;
    margin-top: 1.5em;
}

h3 {
    font-size: 1.5rem;
    margin-top: 1.3em;
}

.subtitle {
    font-size: 1.1rem;
    color: #666;
    font-weight: 400;
    margin-bottom: 1em;
}

.date {
    font-size: 0.95rem;
    color: #888;
    margin-bottom: 2em;
}

.meta {
    font-size: 0.95rem;
    color: #888;
    margin-bottom: 2em;
}

main {
    margin: 10px auto 35px;
    line-height: 1.5;
}

article p {
    margin-bottom: 1.4em;
}

article a,
main a {
    color: #2563eb;
    text-decoration: none;
    border-bottom: 1px solid rgba(37, 99, 235, 0.3);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

article a:hover,
main a:hover {
    color: #1d4ed8;
    border-bottom-color: #2563eb;
}

article a::after,
main a::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, #2563eb, #7c3aed);
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

article a:hover::after,
main a:hover::after {
    width: 100%;
}

article a:focus,
main a:focus {
    outline: 2px solid rgba(37, 99, 235, 0.5);
    outline-offset: 3px;
    border-radius: 2px;
}

figure {
    margin: 2em 0;
}

article img {
    width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 0;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

/* Wide photos break out of container on larger screens */
.wide-photo {
    width: 100vw;
    max-width: 1200px;
    margin-left: 50%;
    transform: translateX(-50%);
}

@media (max-width: 1220px) {
    .wide-photo {
        width: calc(100vw - 40px);
        max-width: none;
    }
}

@media (max-width: 670px) {
    .wide-photo {
        width: 100%;
        margin-left: 0;
        transform: none;
    }
}

figcaption {
    margin-top: 0.8em;
    font-size: 0.9rem;
    color: #666;
    font-style: italic;
    text-align: center;
    line-height: 1.5;
}

figure video {
    width: 100%;
    height: auto;
    max-height: 80vh;
    object-fit: contain;
    margin: 0;
    display: block;
    border-radius: 8px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

article ul, article ol {
    margin-bottom: 1.4em;
    padding-left: 1.5em;
}

article li {
    margin-bottom: 0.5em;
}

blockquote {
    border-left: 3px solid rgba(0, 0, 0, 0.1);
    padding-left: 1.5em;
    margin: 2em 0;
    font-style: italic;
    color: #555;
}

code {
    background: rgba(0, 0, 0, 0.05);
    padding: 0.2em 0.4em;
    border-radius: 3px;
    font-family: 'SF Mono', 'Monaco', 'Consolas', monospace;
    font-size: 0.9em;
}

pre {
    background: rgba(0, 0, 0, 0.03);
    padding: 1.5em;
    border-radius: 8px;
    overflow-x: auto;
    margin: 2em 0;
    border: 1px solid rgba(0, 0, 0, 0.08);
}

pre code {
    background: none;
    padding: 0;
}

hr {
    border: none;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    margin: 3em 0;
}

/* Travel posts grid */
.travel-posts {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2.5em 1em;
    margin: 0.3em 0 2em;
}

.section-heading {
    grid-column: 1 / -1;
    margin: 2.5em 0 0.5em;
}

.section-heading h3 {
    margin-bottom: 0.3em;
}

.section-heading p {
    margin: 0;
}

@media (max-width: 500px) {
    .travel-posts {
        grid-template-columns: 1fr;
    }
}

.travel-post {
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: inherit;
    transition: transform 0.2s ease;
    border-bottom: none !important;
}

.travel-post::after {
    display: none !important;
}

.travel-post:hover {
    transform: translateY(-2px);
    border-bottom: none !important;
}

.travel-post a {
    border-bottom: none;
}

.travel-post a::after {
    display: none;
}

.travel-post-thumbnail {
    width: 100%;
    height: 180px;
    object-fit: cover;
    border-radius: 4px;
    margin-bottom: 0.3em;
    margin-top: 0;
}

.travel-post-title {
    font-family: 'Lora', serif;
    font-size: 1em;
    margin: 0;
    color: #2c2c2c;
}

.travel-post-description {
    font-size: 0.8em;
    color: #666;
    margin: 0.2em 0 0.3em;
}

.travel-post-date {
    font-size: 0.75em;
    color: #999;
}

/* Article list */
.article-list {
    display: flex;
    flex-direction: column;
    gap: 2.5em;
    margin: 1em 0 2em;
}

.article-item {
    display: block;
    text-decoration: none;
    color: inherit;
    transition: opacity 0.2s ease;
    border-bottom: none !important;
}

.article-item::after {
    display: none !important;
}

.article-item:hover {
    opacity: 0.7;
    border-bottom: none !important;
}

.article-item a {
    border-bottom: none;
}

.article-item a::after {
    display: none;
}

.article-title {
    font-family: 'Lora', serif;
    font-size: 1.3em;
    margin: 0 0 0.3em 0;
    color: #2c2c2c;
}

.article-description {
    font-size: 0.95em;
    color: #666;
    margin: 0 0 0.3em 0;
}

.article-date {
    font-size: 0.85em;
    color: #999;
}

/* Newsletter form styles */
.newsletter-form {
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 20px;
    margin: 20px 0;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: #2c2c2c;
}

.form-group input[type="email"] {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Inter', sans-serif;
    box-sizing: border-box;
}

.form-group input[type="email"]:focus {
    outline: none;
    border-color: #666;
}

.newsletter-form button {
    background: #2c2c2c;
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Inter', sans-serif;
    cursor: pointer;
    transition: background 0.2s ease;
}

.newsletter-form button:hover {
    background: #444;
}

.success-message {
    background: #d4edda;
    color: #155724;
    padding: 10px;
    border-radius: 4px;
    margin-top: 15px;
    border: 1px solid #c3e6cb;
}

.error-message {
    background: #f8d7da;
    color: #721c24;
    padding: 10px;
    border-radius: 4px;
    margin-top: 15px;
    border: 1px solid #f5c6cb;
}

/* Admin page styles */
.admin-section {
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 20px;
    margin: 20px 0;
}

.admin-section h3 {
    margin-top: 0;
    color: #2c2c2c;
}

.subscriber-section {
    margin: 20px 0;
    padding: 15px;
    background: rgba(248, 249, 250, 0.5);
    border-radius: 6px;
}

.subscriber-section h4 {
    margin-top: 0;
    margin-bottom: 10px;
    color: #2c2c2c;
}

.subscribers-textarea {
    width: 100%;
    height: 80px;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Inter', sans-serif;
    font-size: 14px;
    resize: vertical;
    box-sizing: border-box;
    background: white;
}

.subscribers-textarea:focus {
    outline: none;
    border-color: #666;
}

.copy-button {
    background: #28a745;
    color: white;
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Inter', sans-serif;
    cursor: pointer;
    transition: background 0.2s ease;
    margin-top: 10px;
}

.copy-button:hover {
    background: #218838;
}

.subscriber-list {
    max-height: 200px;
    overflow-y: auto;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: white;
}

.subscriber-item {
    padding: 8px 12px;
    border-bottom: 1px solid #eee;
    font-size: 14px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Inter', sans-serif;
}

.subscriber-item:last-child {
    border-bottom: none;
}

@media (max-width: 768px) {
    body {
        font-size: 16px;
    }

    /* Reduce expensive backdrop filter on mobile */
    nav {
        backdrop-filter: blur(8px);
        background: rgba(255, 255, 255, 0.85);
    }

    nav .nav-container {
        padding: 1rem 20px;
    }

    nav ul {
        gap: 1.5rem;
    }

    nav a {
        font-size: 0.9rem;
    }

    .container {
        padding: 100px 20px 40px;
    }

    h1 {
        font-size: 2rem;
    }

    h2 {
        font-size: 1.6rem;
    }
}
