/* ABOUTME: Nature Magazine theme for photosolutions.co
   ABOUTME: Light cream bg, green accents, centered branding, 3-column grid, sidebar layout */

@import url('https://fonts.googleapis.com/css2?family=Merriweather:wght@400;700;900&family=Open+Sans:wght@300;400;500;600&display=swap');

:root {
    --accent: #27ae60;
    --accent-hover: #2ecc71;
    --accent-light: rgba(39, 174, 96, 0.08);
    --bg: #fafaf8;
    --bg-white: #ffffff;
    --border: rgba(0,0,0,0.08);
    --text: #2c3e50;
    --text-muted: rgba(44,62,80,0.55);
    --heading-font: 'Merriweather', serif;
    --body-font: 'Open Sans', sans-serif;
    --container: 1200px;
    --narrow: 720px;
    --radius: 10px;
    --shadow: 0 2px 12px rgba(0,0,0,0.06);
    --shadow-hover: 0 6px 24px rgba(0,0,0,0.1);
}

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

body {
    font-family: var(--body-font);
    color: var(--text);
    background: var(--bg);
    line-height: 1.75;
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 { font-family: var(--heading-font); line-height: 1.3; font-weight: 700; color: var(--text); }
h1 { font-size: 2.2rem; }
h2 { font-size: 1.6rem; }
h3 { font-size: 1.2rem; }

a { color: var(--accent); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--accent-hover); }

img { max-width: 100%; height: auto; }

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

/* Header — top bar with categories, centered logo below */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--bg-white);
    box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}
.header-topbar {
    background: var(--text);
    padding: 0.4rem 0;
}
.topbar-nav { display: flex; gap: 1.5rem; justify-content: center; }
.topbar-nav a { color: rgba(255,255,255,0.7); font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.08em; font-weight: 500; }
.topbar-nav a:hover { color: #fff; }

.header-brand {
    text-align: center;
    padding: 1.2rem 0 0.6rem;
}
.site-logo {
    font-family: var(--heading-font);
    font-size: 2rem;
    font-weight: 900;
    color: var(--text);
    display: block;
    letter-spacing: -0.02em;
}
.site-tagline {
    color: var(--text-muted);
    font-size: 0.88rem;
    margin-top: 0.2rem;
    font-style: italic;
}

.header-nav {
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    padding: 0.6rem 0;
}
.site-nav { display: flex; gap: 2rem; justify-content: center; align-items: center; }
.site-nav a { color: var(--text); font-size: 0.9rem; font-weight: 500; }
.site-nav a:hover { color: var(--accent); }
.subscribe-btn {
    background: var(--accent) !important;
    color: #fff !important;
    padding: 0.4rem 1rem;
    border-radius: var(--radius);
    font-weight: 600;
    font-size: 0.85rem !important;
}
.subscribe-btn:hover { background: var(--accent-hover) !important; color: #fff !important; }
.mobile-menu-btn { display: none; background: none; border: none; font-size: 1.5rem; color: var(--text); cursor: pointer; }

/* Hero Featured */
.hero-featured {
    padding: 2.5rem 0;
    background: var(--bg-white);
    border-bottom: 1px solid var(--border);
}
.hero-featured-link {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 2.5rem;
    align-items: center;
    text-decoration: none;
}
.hero-featured-img img {
    width: 100%;
    height: 360px;
    object-fit: cover;
    border-radius: var(--radius);
}
.hero-label {
    display: inline-block;
    background: var(--accent);
    color: #fff;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    padding: 0.25rem 0.7rem;
    border-radius: 4px;
    font-weight: 600;
    margin-bottom: 0.3rem;
}
.hero-featured-text h1 {
    color: var(--text);
    margin: 0.5rem 0 0.8rem;
    font-size: 1.9rem;
}
.hero-featured-text p {
    color: var(--text-muted);
    font-size: 1rem;
    margin-bottom: 0.8rem;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.hero-featured-meta {
    display: flex;
    gap: 1rem;
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* Homepage layout — main + sidebar */
.homepage-content { padding: 3rem 0; }
.homepage-layout {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 3rem;
}
.section-title {
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--accent);
    display: inline-block;
}

/* 3-column post grid */
.post-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}

/* Cards — white with shadow, rounded corners */
.post-card {
    background: var(--bg-white);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: box-shadow 0.3s, transform 0.2s;
}
.post-card:hover {
    box-shadow: var(--shadow-hover);
    transform: translateY(-3px);
}
.post-card img { width: 100%; height: 180px; object-fit: cover; }
.post-card-body { padding: 1rem 1.2rem 1.2rem; }
.post-category { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--accent); font-weight: 600; }
.post-card h3 { margin: 0.4rem 0; font-size: 1.05rem; }
.post-card h3 a { color: var(--text); }
.post-card h3 a:hover { color: var(--accent); }
.post-card p { color: var(--text-muted); font-size: 0.88rem; margin-bottom: 0.4rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.post-card time { font-size: 0.8rem; color: var(--text-muted); }

/* Sidebar */
.homepage-sidebar, .post-sidebar { display: flex; flex-direction: column; gap: 1.5rem; }
.sidebar-widget {
    background: var(--bg-white);
    border-radius: var(--radius);
    padding: 1.5rem;
    box-shadow: var(--shadow);
}
.sidebar-widget h4 {
    font-size: 0.95rem;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--accent);
}
.sidebar-post {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    padding: 0.6rem 0;
    border-bottom: 1px solid var(--border);
    text-decoration: none;
}
.sidebar-post:last-child { border-bottom: none; }
.sidebar-post-title { color: var(--text); font-size: 0.9rem; font-weight: 500; flex: 1; margin-right: 0.5rem; }
.sidebar-post time { color: var(--text-muted); font-size: 0.8rem; white-space: nowrap; }
.sidebar-post:hover .sidebar-post-title { color: var(--accent); }
.sidebar-subscribe { text-align: center; }
.sidebar-subscribe p { color: var(--text-muted); font-size: 0.9rem; margin-bottom: 1rem; }
.sidebar-sticky { position: sticky; top: 140px; }
.sidebar-author-name { font-weight: 700; font-family: var(--heading-font); margin-bottom: 0.3rem; }
.sidebar-author p { color: var(--text-muted); font-size: 0.9rem; }

/* Single Post — two-column with sidebar */
.post-single { padding: 2rem 0 4rem; }
.post-layout {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 3rem;
}
.post-header { margin-bottom: 1.5rem; }
.post-header h1 { margin: 0.5rem 0 1rem; font-size: 2rem; }
.post-meta { color: var(--text-muted); font-size: 0.88rem; display: flex; gap: 1.5rem; }
.post-hero-img { width: 100%; max-height: 450px; object-fit: cover; border-radius: var(--radius); margin-bottom: 2rem; }

.post-content { font-size: 1.05rem; }
.post-content h2 { margin: 2rem 0 0.8rem; }
.post-content h3 { margin: 1.5rem 0 0.6rem; }
.post-content p { margin-bottom: 1.2rem; }
.post-content img { border-radius: var(--radius); margin: 1.5rem 0; }
.post-content ul, .post-content ol { margin-bottom: 1.2rem; padding-left: 1.5rem; }
.post-content li { margin-bottom: 0.5rem; }
.post-content blockquote {
    border-left: 4px solid var(--accent);
    padding-left: 1.5rem;
    margin: 1.5rem 0;
    color: var(--text-muted);
    font-style: italic;
    font-family: var(--heading-font);
}

.post-cta {
    background: var(--accent-light);
    padding: 2rem;
    border-radius: var(--radius);
    text-align: center;
    margin: 3rem 0 2rem;
    border: 1px solid rgba(39,174,96,0.15);
}
.post-cta h3 { margin-bottom: 0.5rem; }
.post-cta p { color: var(--text-muted); margin-bottom: 1rem; }

.post-tags { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 1.5rem; }
.tag { background: var(--accent-light); padding: 0.3rem 0.8rem; border-radius: 20px; font-size: 0.82rem; color: var(--accent); font-weight: 500; }

/* Buttons */
.btn {
    display: inline-block;
    background: var(--accent);
    color: #fff;
    padding: 0.7rem 1.6rem;
    border-radius: var(--radius);
    font-weight: 600;
    border: none;
    cursor: pointer;
    font-size: 0.95rem;
    transition: background 0.2s, transform 0.1s;
}
.btn:hover { background: var(--accent-hover); color: #fff; transform: translateY(-1px); }
.btn-lg { padding: 0.9rem 2rem; font-size: 1.05rem; }

/* Page Header */
.page-header { padding: 2rem 0 1rem; }
.post-list { padding: 2rem 0 4rem; }

/* Footer */
.site-footer {
    padding: 3rem 0 2rem;
    border-top: 3px solid var(--accent);
    margin-top: 2rem;
    background: var(--bg-white);
}
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 2rem; margin-bottom: 2rem; }
.footer-about p { color: var(--text-muted); margin-top: 0.5rem; }
.footer-links a { display: block; color: var(--text-muted); margin-top: 0.5rem; }
.footer-links a:hover { color: var(--accent); }
.footer-subscribe p { color: var(--text-muted); margin: 0.5rem 0 1rem; }
.footer-bottom { border-top: 1px solid var(--border); padding-top: 1.5rem; text-align: center; color: var(--text-muted); font-size: 0.88rem; }

/* Modal */
.modal { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.4); z-index: 1000; display: flex; align-items: center; justify-content: center; backdrop-filter: blur(4px); }
.modal-content { background: var(--bg-white); padding: 2.5rem; border-radius: var(--radius); max-width: 440px; width: 90%; position: relative; box-shadow: 0 8px 40px rgba(0,0,0,0.12); }
.modal-close { position: absolute; top: 1rem; right: 1rem; background: none; border: none; font-size: 1.5rem; cursor: pointer; color: var(--text-muted); }
.modal-content h2 { margin-bottom: 0.5rem; }
.modal-content > p { color: var(--text-muted); margin-bottom: 1.5rem; }
.modal-content form { display: flex; flex-direction: column; gap: 0.75rem; }
.modal-content input { padding: 0.75rem 1rem; border: 1px solid var(--border); border-radius: var(--radius); font-size: 1rem; background: var(--bg); color: var(--text); }
.modal-content input:focus { outline: none; border-color: var(--accent); }
.modal-fine-print { font-size: 0.8rem; color: var(--text-muted); text-align: center; margin-top: 0.75rem; }

/* Pagination */
.pagination { display: flex; justify-content: center; gap: 0.5rem; padding: 2rem 0; }
.pagination li { list-style: none; }
.pagination a, .pagination .active a { padding: 0.5rem 1rem; border-radius: var(--radius); }
.pagination .active a { background: var(--accent); color: #fff; }

/* Responsive */
@media (max-width: 1024px) {
    .homepage-layout { grid-template-columns: 1fr; }
    .post-layout { grid-template-columns: 1fr; }
    .post-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 768px) {
    .site-nav, .topbar-nav { display: none; }
    .site-nav.open { display: flex; flex-direction: column; position: absolute; top: 100%; left: 0; right: 0; background: var(--bg-white); padding: 1rem; border-bottom: 1px solid var(--border); z-index: 100; }
    .mobile-menu-btn { display: block; }
    .hero-featured-link { grid-template-columns: 1fr; }
    .hero-featured-img img { height: 240px; }
    .post-grid { grid-template-columns: 1fr; }
    .footer-grid { grid-template-columns: 1fr; }
}

/* Comments */
.comments-section { margin: 3rem 0 2rem; max-width: 740px; }
.comments-section h3 { margin-bottom: 1.5rem; }
.comment { display: flex; gap: 1rem; margin-bottom: 1.5rem; padding-bottom: 1.5rem; border-bottom: 1px solid rgba(128,128,128,0.15); }
.comment-author { background: rgba(128,128,128,0.05); padding: 1rem; border-radius: 12px; margin: -0.5rem; padding-bottom: 1rem; border-bottom: none; }
.comment-avatar { width: 40px; height: 40px; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: #fff; font-weight: 700; font-size: 1.1rem; flex-shrink: 0; }
.comment-body { flex: 1; }
.comment-meta { display: flex; align-items: center; gap: 0.75rem; margin-bottom: 0.4rem; flex-wrap: wrap; }
.comment-meta strong { font-size: 0.95rem; }
.comment-meta time { font-size: 0.8rem; color: rgba(128,128,128,0.7); }
.comment-site { font-size: 0.8rem; opacity: 0.6; }
.author-badge { background: var(--accent, #0984e3); color: #fff; font-size: 0.7rem; padding: 0.15rem 0.5rem; border-radius: 10px; font-weight: 600; }
.comment p { font-size: 0.95rem; line-height: 1.6; margin: 0; }

/* Fix card consistency and spacing */
.post-card { display: flex; flex-direction: column; }
.post-card-body { flex: 1; display: flex; flex-direction: column; }
.post-card-body p { flex: 1; }
.post-card-body time { margin-top: auto; }
.post-grid { gap: 1.5rem; }

/* Ensure sidebar widget spacing */
.sidebar-widget + .sidebar-widget { margin-top: 1.5rem; }
