/* A la croisée des chemins - Refined Magazine theme port */

:root {
    --primary: #8a6d3b;
    --primary-dark: #6e5530;
    --accent: #3a2e1f;
    --text: #333;
    --text-light: #666;
    --bg: #faf7f2;
    --bg-white: #fff;
    --border: #e0d9c8;
    --font-primary: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-heading: 'Playfair Display', Georgia, serif;
    --max-width: 1100px;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
    --radius: 4px;
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    font-family: var(--font-primary);
    color: var(--text);
    background: var(--bg);
    line-height: 1.6;
    font-size: 16px;
}

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

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

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    color: var(--accent);
    line-height: 1.25;
    margin: 0 0 0.6em;
    font-weight: 700;
}

h1 { font-size: 2.2rem; }
h2 { font-size: 1.7rem; }
h3 { font-size: 1.3rem; }

p { margin: 0 0 1.1em; }

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

/* Header */
.site-header {
    background: var(--bg-white);
    border-bottom: 3px solid var(--primary);
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-mid { padding: 18px 0; }
.header-mid-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.site-branding {
    display: flex;
    align-items: center;
    gap: 16px;
    color: var(--accent);
    text-decoration: none;
}

.site-logo {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--primary);
    flex-shrink: 0;
}

.site-titles { display: flex; flex-direction: column; }
.site-title {
    font-family: var(--font-heading);
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--accent);
    line-height: 1.1;
}
.site-tagline {
    font-size: 0.85rem;
    color: var(--text-light);
    margin-top: 4px;
}

.menu-toggle {
    display: none;
    background: transparent;
    border: 0;
    padding: 8px;
    cursor: pointer;
    flex-direction: column;
    gap: 5px;
    width: 40px;
    height: 40px;
    justify-content: center;
}
.menu-toggle span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--accent);
    transition: 0.3s;
}
.menu-toggle.is-active span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.menu-toggle.is-active span:nth-child(2) { opacity: 0; }
.menu-toggle.is-active span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.header-nav {
    background: var(--accent);
}
.main-nav {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
}
.main-nav li { }
.main-nav a {
    display: block;
    padding: 14px 22px;
    color: #fff;
    font-weight: 500;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.5px;
    transition: background 0.2s;
}
.main-nav a:hover { background: var(--primary); color: #fff; }

/* Site main */
.site-main { min-height: 60vh; }

/* Hero */
.hero-full {
    background: var(--accent);
    margin-bottom: 40px;
}
.hero-card {
    display: block;
    position: relative;
    color: #fff;
    text-decoration: none;
    min-height: 460px;
    overflow: hidden;
}
.hero-image {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    transition: transform 0.5s;
}
.hero-card:hover .hero-image { transform: scale(1.03); }
.hero-overlay {
    position: relative;
    z-index: 2;
    background: linear-gradient(0deg, rgba(58,46,31,0.92) 0%, rgba(58,46,31,0.55) 50%, rgba(58,46,31,0.25) 100%);
    min-height: 460px;
    display: flex;
    align-items: flex-end;
    padding: 60px 0 40px;
}
.hero-cat {
    display: inline-block;
    background: var(--primary);
    color: #fff;
    padding: 5px 12px;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
    border-radius: var(--radius);
    margin-bottom: 16px;
}
.hero-title {
    color: #fff;
    font-size: 2.6rem;
    margin: 0 0 16px;
    max-width: 800px;
}
.hero-excerpt {
    color: rgba(255,255,255,0.9);
    font-size: 1.05rem;
    max-width: 700px;
    margin-bottom: 18px;
}
.hero-cta {
    display: inline-block;
    color: #fff;
    border-bottom: 2px solid var(--primary);
    padding-bottom: 3px;
    font-weight: 600;
}

/* Layout */
.site-content { padding: 30px 0 60px; }
.content-layout {
    display: flex;
    gap: 40px;
    align-items: flex-start;
}
.content-area { flex: 1; min-width: 0; }
.sidebar { width: 300px; flex-shrink: 0; }

/* Sections */
.section-title {
    font-size: 1.6rem;
    margin: 0 0 24px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--primary);
    color: var(--accent);
}
.section-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 24px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--primary);
}
.section-head .section-title {
    margin: 0;
    padding: 0;
    border: 0;
}
.section-more {
    color: var(--primary);
    font-weight: 600;
    font-size: 0.9rem;
}
.section-featured, .section-category, .related-articles {
    margin-bottom: 50px;
}

/* Post grid */
.post-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}
.post-grid-3 { grid-template-columns: repeat(3, 1fr); }

.grid-card {
    background: var(--bg-white);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: transform 0.25s, box-shadow 0.25s;
}
.grid-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}
.grid-card-link {
    display: block;
    color: inherit;
    text-decoration: none;
    height: 100%;
}
.grid-card-thumb {
    aspect-ratio: 16/10;
    overflow: hidden;
    background: var(--bg);
}
.grid-card-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s;
}
.grid-card:hover .grid-card-thumb img { transform: scale(1.05); }
.grid-card-body { padding: 16px; }
.grid-card-cat {
    display: inline-block;
    color: var(--primary);
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
    margin-bottom: 8px;
}
.grid-card-title {
    font-size: 1.05rem;
    margin: 0;
    line-height: 1.35;
    color: var(--accent);
}

/* Post list */
.post-list { display: flex; flex-direction: column; gap: 24px; }
.post-card {
    display: flex;
    gap: 20px;
    background: var(--bg-white);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: box-shadow 0.25s;
}
.post-card:hover { box-shadow: var(--shadow-md); }
.post-card-thumb {
    flex: 0 0 240px;
    overflow: hidden;
    background: var(--bg);
}
.post-card-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    aspect-ratio: 4/3;
}
.post-card-body { flex: 1; padding: 18px 22px; }
.post-card-cat {
    display: inline-block;
    color: var(--primary);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
    margin-bottom: 8px;
}
.post-card-title {
    font-size: 1.3rem;
    margin: 0 0 10px;
}
.post-card-title a { color: var(--accent); }
.post-card-title a:hover { color: var(--primary); }
.post-card-excerpt { color: var(--text-light); margin: 0 0 12px; font-size: 0.95rem; }
.post-card-more {
    font-weight: 600;
    color: var(--primary);
    font-size: 0.9rem;
}

/* Breadcrumb */
.breadcrumb {
    font-size: 0.85rem;
    color: var(--text-light);
    margin-bottom: 18px;
}
.breadcrumb a { color: var(--primary); }
.breadcrumb .sep { margin: 0 6px; color: var(--border); }
.breadcrumb .current { color: var(--text-light); }

/* Single article */
.single-article {
    background: var(--bg-white);
    border-radius: var(--radius);
    padding: 32px 36px;
    box-shadow: var(--shadow-sm);
}
.article-header { margin-bottom: 24px; }
.article-cat {
    display: inline-block;
    color: var(--primary);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    font-weight: 600;
    margin-bottom: 12px;
}
.article-title {
    font-size: 2.4rem;
    margin: 0;
    color: var(--accent);
}
.article-featured-image {
    margin: 0 -36px 28px;
}
.article-featured-image img {
    width: 100%;
    max-height: 500px;
    object-fit: cover;
}
.entry-content {
    font-size: 1.02rem;
    line-height: 1.75;
    color: var(--text);
}
.entry-content h2 {
    font-size: 1.55rem;
    margin: 1.6em 0 0.6em;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border);
}
.entry-content h3 {
    font-size: 1.25rem;
    margin: 1.4em 0 0.5em;
    color: var(--primary-dark);
}
.entry-content img {
    border-radius: var(--radius);
    margin: 18px auto;
}
.entry-content a {
    color: var(--primary);
    border-bottom: 1px solid var(--primary);
}
.entry-content a:hover {
    color: var(--primary-dark);
    border-bottom-color: var(--primary-dark);
}
.entry-content ul, .entry-content ol { padding-left: 1.5em; }
.entry-content li { margin-bottom: 0.4em; }
.entry-content blockquote {
    border-left: 4px solid var(--primary);
    padding: 8px 20px;
    margin: 20px 0;
    background: var(--bg);
    color: var(--text-light);
    font-style: italic;
}

/* Category header */
.category-header {
    background: var(--bg-white);
    padding: 28px 32px;
    border-radius: var(--radius);
    margin-bottom: 30px;
    box-shadow: var(--shadow-sm);
    border-left: 4px solid var(--primary);
}
.category-title {
    font-size: 2rem;
    margin: 8px 0 8px;
}
.category-description {
    margin: 0;
    color: var(--text-light);
    font-size: 1rem;
}

/* Sidebar */
.sidebar { display: flex; flex-direction: column; gap: 28px; }
.widget {
    background: var(--bg-white);
    padding: 22px;
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}
.widget-title {
    font-size: 1.1rem;
    margin: 0 0 16px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--primary);
    color: var(--accent);
}
.widget-list {
    list-style: none;
    margin: 0;
    padding: 0;
}
.widget-item {
    display: flex;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
}
.widget-item:last-child { border-bottom: 0; padding-bottom: 0; }
.widget-item:first-child { padding-top: 0; }
.widget-thumb {
    flex: 0 0 70px;
    width: 70px;
    height: 70px;
    border-radius: var(--radius);
    overflow: hidden;
}
.widget-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.widget-meta { flex: 1; min-width: 0; }
.widget-link {
    display: block;
    color: var(--accent);
    font-weight: 600;
    font-size: 0.9rem;
    line-height: 1.35;
    margin-bottom: 4px;
}
.widget-link:hover { color: var(--primary); }
.widget-cat {
    font-size: 0.72rem;
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}
.cat-list li {
    padding: 8px 0;
    border-bottom: 1px solid var(--border);
}
.cat-list li:last-child { border-bottom: 0; }
.cat-list a {
    display: flex;
    justify-content: space-between;
    color: var(--accent);
    font-weight: 500;
}
.cat-list a:hover { color: var(--primary); }
.cat-count { color: var(--text-light); font-size: 0.85rem; }

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 40px;
}
.pagination a, .pagination span {
    display: inline-block;
    padding: 8px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg-white);
    color: var(--accent);
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s;
}
.pagination a:hover {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}
.pagination .page-current {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

/* 404 */
.error-404 {
    text-align: center;
    padding: 60px 20px;
    background: var(--bg-white);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}
.error-title {
    font-size: 6rem;
    color: var(--primary);
    margin: 0 0 10px;
    line-height: 1;
}
.error-subtitle { font-size: 1.6rem; margin: 0 0 16px; }
.error-text { color: var(--text-light); margin-bottom: 24px; }
.btn-primary {
    display: inline-block;
    background: var(--primary);
    color: #fff !important;
    padding: 12px 28px;
    border-radius: var(--radius);
    font-weight: 600;
    transition: background 0.2s;
}
.btn-primary:hover { background: var(--primary-dark); }

.no-results {
    background: var(--bg-white);
    padding: 30px;
    border-radius: var(--radius);
    color: var(--text-light);
    text-align: center;
}

/* Footer */
.site-footer {
    background: var(--accent);
    color: #d8d2c4;
    padding: 40px 0 20px;
    margin-top: 40px;
}
.footer-content {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 30px;
    margin-bottom: 30px;
    padding-bottom: 30px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}
.footer-branding { display: flex; flex-direction: column; gap: 6px; }
.footer-title {
    font-family: var(--font-heading);
    font-size: 1.4rem;
    color: #fff;
    font-weight: 700;
}
.footer-tagline { color: #b3a98e; font-size: 0.9rem; }
.footer-nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
}
.footer-nav a {
    color: #d8d2c4;
    font-size: 0.9rem;
}
.footer-nav a:hover { color: var(--primary); }
.footer-bottom {
    text-align: center;
    color: #b3a98e;
    font-size: 0.85rem;
}
.footer-bottom p { margin: 0; }

/* Back to top */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 46px;
    height: 46px;
    background: var(--primary);
    color: #fff;
    border: 0;
    border-radius: 50%;
    font-size: 1.2rem;
    cursor: pointer;
    box-shadow: var(--shadow-md);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
    z-index: 99;
}
.back-to-top.is-visible { opacity: 1; visibility: visible; }
.back-to-top:hover { background: var(--primary-dark); }

/* Responsive */
@media (max-width: 900px) {
    .content-layout { flex-direction: column; }
    .sidebar { width: 100%; }
    .post-grid { grid-template-columns: repeat(2, 1fr); }
    .post-grid-3 { grid-template-columns: repeat(2, 1fr); }
    .hero-title { font-size: 2rem; }
    .hero-overlay { min-height: 380px; }
    .hero-card { min-height: 380px; }
}

@media (max-width: 768px) {
    .menu-toggle { display: flex; }
    .header-nav { display: none; }
    .header-nav.is-open { display: block; }
    .main-nav { flex-direction: column; }
    .main-nav a {
        text-align: center;
        border-bottom: 1px solid rgba(255,255,255,0.1);
    }
    .site-title { font-size: 1.3rem; }
    .site-tagline { font-size: 0.78rem; }
    .site-logo { width: 50px; height: 50px; }
    h1 { font-size: 1.7rem; }
    .article-title { font-size: 1.7rem; }
    .single-article { padding: 22px; }
    .article-featured-image { margin: 0 -22px 22px; }
    .post-card { flex-direction: column; }
    .post-card-thumb { flex: 0 0 auto; width: 100%; }
    .post-card-thumb img { aspect-ratio: 16/9; }
    .footer-content { flex-direction: column; }
    .hero-title { font-size: 1.6rem; }
}

@media (max-width: 480px) {
    .post-grid { grid-template-columns: 1fr; }
    .post-grid-3 { grid-template-columns: 1fr; }
    .container { padding: 0 14px; }
    .site-content { padding: 20px 0 40px; }
    .single-article { padding: 16px; }
    .article-featured-image { margin: 0 -16px 18px; }
    .article-title { font-size: 1.4rem; }
    .hero-overlay { padding: 30px 0 24px; min-height: 320px; }
    .hero-card { min-height: 320px; }
    .hero-title { font-size: 1.4rem; }
    .hero-excerpt { font-size: 0.95rem; }
    .error-title { font-size: 4rem; }
    .back-to-top { width: 40px; height: 40px; bottom: 18px; right: 18px; }
}
