/*
Theme Name: cartileftine
Theme URI: https://savko.dev/
Author: Savko
Version: 1.0
License: GNU General Public License v2 or later
Text Domain: cartileftine
*/

/* === Fonts (match original Betheme: Noto Sans + Playfair Display) === */
@import url('https://fonts.googleapis.com/css2?family=Noto+Sans:wght@400;500;600;700&family=Playfair+Display:wght@500;600;700&display=swap');

:root {
    --brand: #DE3241;
    --brand-dark: #b6232f;
    --brand-light: #ef6b77;
    --ink: #070707;
    --body: #626262;
    --muted: #858585;
    --line: #e5e5e5;
    --bg: #ffffff;
    --bg-soft: #f7f7f7;
    --dark: #000000;
    --header-h: 90px;
    --header-h-sticky: 60px;

    --font-body: "Noto Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
    --font-heading: "Playfair Display", Georgia, serif;
}

body {
    font-family: var(--font-body);
    font-size: 15px;
    line-height: 28px;
    font-weight: 400;
    color: var(--body);
    background: var(--bg);
    padding-top: var(--header-h);
}
a { color: inherit; font-family: var(--font-body); }

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 500;
    color: var(--ink);
    margin: 0;
}
h1 { font-size: 50px; line-height: 60px; }
h2 { font-size: 40px; line-height: 50px; }
h3 { font-size: 28px; line-height: 38px; }
h4 { font-size: 22px; line-height: 32px; }

/* === Header (white w/ red bottom accent) === */
.site-header {
    background: #fff;
    border-bottom: 3px solid var(--brand);
    box-shadow: 0 1px 4px rgba(0,0,0,0.04);
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 999;
    transition: all .25s ease;
}
.site-header__inner {
    height: var(--header-h);
    transition: height .25s ease;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0 15px;
}
.site-header.is-sticky { box-shadow: 0 2px 12px rgba(0,0,0,0.12); }
.site-header.is-sticky .site-header__inner { height: var(--header-h-sticky); }
.site-header.is-sticky .site-logo img { max-height: 40px; }
.site-logo img {
    max-height: 60px;
    max-width: 300px;
    width: auto;
    display: block;
    transition: max-height .25s ease;
}

/* Menu */
.site-nav .nav-list {
    display: flex;
    gap: 1.5rem;
    list-style: none;
    margin: 0; padding: 0;
    align-items: center;
}
.site-nav .nav-list a {
    color: var(--ink);
    font-family: var(--font-body);
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    padding: .25rem 0;
    border-bottom: 2px solid transparent;
    transition: color .15s, border-color .15s;
}
.site-nav .nav-list a:hover,
.site-nav .nav-list li.is-active > a {
    color: var(--brand);
    border-bottom-color: var(--brand);
}

/* Hamburger */
.nav-toggle {
    display: none;
    width: 36px; height: 36px;
    background: transparent;
    border: 0;
    padding: 0;
    cursor: pointer;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
}
.nav-toggle span {
    display: block;
    width: 24px; height: 2px;
    background: var(--ink);
    transition: transform .25s, opacity .25s;
}
.nav-toggle.is-open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.is-open span:nth-child(2) { opacity: 0; }
.nav-toggle.is-open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

@media (max-width: 900px) {
    .nav-toggle { display: flex; }
    .site-nav {
        position: absolute;
        top: 100%;
        left: 0; right: 0;
        background: #fff;
        border-top: 1px solid var(--line);
        max-height: 0;
        overflow: hidden;
        transition: max-height .3s ease;
    }
    .site-nav.is-open { max-height: 600px; box-shadow: 0 4px 10px rgba(0,0,0,.08); }
    .site-nav .nav-list {
        flex-direction: column;
        gap: 0;
        padding: .5rem 1rem;
        align-items: stretch;
    }
    .site-nav .nav-list li { border-bottom: 1px solid var(--line); }
    .site-nav .nav-list li:last-child { border-bottom: 0; }
    .site-nav .nav-list a {
        display: block;
        padding: .8rem 0;
        border-bottom: none !important;
    }
    .site-logo img { max-width: 200px; }
}

/* === Breadcrumbs === */
.breadcrumbs {
    background: var(--bg-soft);
    border-bottom: 1px solid var(--line);
    color: var(--muted);
    font-size: 13px;
    padding: 10px 0;
}
.breadcrumbs a { color: var(--brand); transition: color .15s; }
.breadcrumbs a:hover { color: var(--brand-dark); text-decoration: underline; }
.breadcrumbs .sep { margin: 0 .5rem; color: #cbd5e1; }
.breadcrumbs .current { color: var(--ink); font-weight: 500; }

/* === Utils === */
.border-brand { border-color: var(--brand) !important; }
.text-brand { color: var(--brand); }
.bg-brand { background: var(--brand); }
.container { max-width: 1280px; margin: 0 auto; padding: 0 15px; }

/* === Home section heading with decorative underline === */
.section-head {
    position: relative;
    margin-bottom: 50px !important;
    padding-bottom: 20px !important;
    border-bottom: none !important;
}
.section-title {
    font-family: var(--font-heading);
    font-size: 38px;
    line-height: 48px;
    font-weight: 500;
    color: var(--ink);
    margin: 0;
}
.section-head::before {
    content: "";
    position: absolute;
    left: 0;
    bottom: 0;
    width: 60px;
    height: 2px;
    background: var(--brand);
}
.section-head__more {
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--brand);
    font-weight: 600;
}
.section-head__more:hover { color: var(--brand-dark); text-decoration: underline; }

/* === Card grid === */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 40px 30px;
}
.card-grid--3 { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }

/* === Post card (Betheme .fancy style) === */
.post-card {
    position: relative;
    margin-bottom: 10px;
}
.post-card__photo {
    position: relative;
    overflow: hidden;
    background: #f3f4f6;
}
.post-card__thumb {
    display: block;
    position: relative;
    overflow: hidden;
    height: 450px;
}
.post-card__thumb .post-card__img,
.post-card__thumb img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .45s ease;
    display: block;
}
.post-card:hover .post-card__thumb img { transform: scale(1.04); }
.post-card__no-thumb {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, #e5e7eb, #d1d5db);
}
.post-card__zoom {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%) scale(0.6);
    width: 46px; height: 46px;
    background: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity .3s, transform .3s;
    pointer-events: none;
}
.post-card:hover .post-card__zoom {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}
/* Date label — Betheme .date_label */
.post-card__date-label {
    position: absolute;
    top: 15px; left: 15px;
    background: var(--brand);
    color: #fff;
    font-family: var(--font-body);
    padding: 8px 12px;
    text-align: center;
    line-height: 1;
    min-width: 56px;
    letter-spacing: 0;
    z-index: 3;
}
.post-card__date-label .day {
    display: block;
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 4px;
}
.post-card__date-label .monyr {
    display: block;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
}
/* Floating description (Betheme .fancy .post-desc) */
.post-card__desc {
    position: relative;
    z-index: 2;
    background: #fff;
    margin: -80px 25px 50px 25px;
    padding: 30px 25px 50px;
    box-shadow: 0 2px 5px 0 rgba(0,0,0,0.1);
    transition: box-shadow .25s ease;
}
.post-card:hover .post-card__desc {
    box-shadow: 0 10px 24px rgba(0,0,0,.14);
}
.post-card__cats {
    font-family: var(--font-body);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 10px;
    color: var(--muted);
}
.post-card__cats a {
    color: var(--brand);
    transition: color .15s;
}
.post-card__cats a:hover { color: var(--brand-dark); }
.post-card__cats a + a::before { content: ", "; color: var(--muted); }
.post-card__title {
    font-family: var(--font-heading);
    font-size: 24px;
    line-height: 32px;
    font-weight: 600;
    margin: 0 0 15px;
}
.post-card__title a {
    color: var(--ink);
    transition: color .15s;
    font-family: var(--font-heading);
}
.post-card__title a:hover { color: var(--brand); }
.post-card__more {
    font-family: var(--font-body);
    font-size: 12px;
    color: var(--brand);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: color .15s;
}
.post-card__more:hover { color: var(--brand-dark); text-decoration: underline; }

/* === Tag pills (Betheme .mfn-tag-cloud) === */
.tag-pill {
    display: inline-block;
    background: var(--brand);
    color: #fff;
    padding: 6px 14px;
    font-size: 11px;
    font-family: var(--font-body);
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: background .15s;
    font-weight: 600;
}
.tag-pill:hover { background: var(--brand-dark); color: #fff; }

/* === Single post === */
.single-post header h1 {
    font-family: var(--font-heading);
    font-size: 44px;
    line-height: 54px;
    font-weight: 600;
    color: var(--ink);
    margin-bottom: 15px;
}
.post-content {
    font-family: var(--font-body);
    font-size: 15px;
    line-height: 28px;
    color: var(--body);
    text-align: justify;
}
.post-content p { margin: 0 0 1em; }
.post-content h2,
.post-content h3,
.post-content h4,
.post-content h5,
.post-content h6,
.post-content p {
    text-align: justify;
}
.post-content h2 {
    font-family: var(--font-heading);
    font-size: 32px; line-height: 42px; font-weight: 600;
    margin: 1.6em 0 0.6em;
    color: var(--ink);
}
.post-content h3 {
    font-family: var(--font-heading);
    font-size: 24px; line-height: 34px; font-weight: 600;
    margin: 1.5em 0 0.5em;
    color: var(--brand);
}
.post-content h4 {
    font-family: var(--font-heading);
    font-size: 20px; line-height: 30px; font-weight: 600;
    margin: 1.4em 0 0.4em;
    color: var(--ink);
}
.post-content a { color: var(--brand); text-decoration: underline; }
.post-content a:hover { color: var(--brand-dark); }
.post-content ul, .post-content ol { margin: 0 0 1em 1.5em; }
.post-content ul { list-style: disc; }
.post-content ol { list-style: decimal; }
.post-content li { margin: 0.25em 0; }
.post-content strong { font-weight: 700; color: var(--ink); }
.post-content hr { border: 0; border-top: 1px solid var(--line); margin: 2em 0; }
.post-content img { max-width: 100%; height: auto; }
.post-content figure { margin: 1.5em 0; }
.post-content blockquote {
    border-left: 4px solid var(--brand);
    padding: 0.5em 1em;
    margin: 1.5em 0;
    color: #4b5563;
    font-style: italic;
    background: var(--bg-soft);
}
.post-content table { width: 100%; border-collapse: collapse; margin: 1em 0; }
.post-content th, .post-content td { border: 1px solid var(--line); padding: 0.5em 0.75em; text-align: left; }

/* === Fixed prev/next sidebar === */
.fixed-nav {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    z-index: 120;
    display: flex;
    align-items: center;
    background: #fff;
    box-shadow: 0 4px 14px rgba(0,0,0,.12);
    padding: 8px;
    max-width: 60px;
    overflow: hidden;
    transition: max-width .35s ease;
    text-decoration: none;
    color: var(--ink);
}
.fixed-nav:hover { max-width: 320px; }
.fixed-nav--prev { left: 12px; }
.fixed-nav--next { right: 12px; flex-direction: row-reverse; }
.fixed-nav__arrow {
    flex: 0 0 44px;
    font-size: 28px;
    color: var(--brand);
    text-align: center;
    line-height: 1;
    font-family: var(--font-heading);
}
.fixed-nav__photo {
    flex: 0 0 48px;
    width: 48px; height: 48px;
    overflow: hidden;
}
.fixed-nav__photo img { width: 100%; height: 100%; object-fit: cover; }
.fixed-nav__desc {
    flex: 1;
    padding: 0 .75rem;
    min-width: 180px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.fixed-nav--next .fixed-nav__desc { text-align: right; }
.fixed-nav__title {
    font-family: var(--font-heading);
    font-size: 14px;
    font-weight: 600;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    color: var(--ink);
}
.fixed-nav__date {
    font-size: 11px;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 1px;
}
@media (max-width: 1280px) { .fixed-nav { display: none; } }

/* === Archive header === */
.archive-hero {
    background: var(--bg-soft);
    border-bottom: 1px solid var(--line);
    padding: 40px 0;
    margin-bottom: 40px;
}
.archive-hero h1 {
    font-family: var(--font-heading);
    font-size: 44px;
    line-height: 54px;
    font-weight: 600;
    color: var(--ink);
    margin: 0;
}

/* === Footer === */
.site-footer {
    background: #1f2937;
    color: #d1d5db;
    margin-top: 60px;
}
.site-footer a { color: #d1d5db; transition: color .15s; }
.site-footer a:hover { color: var(--brand-light); }
.site-footer h4 {
    font-family: var(--font-heading);
    font-size: 18px;
    line-height: 40px;
    font-weight: 700;
    text-transform: uppercase;
    color: #fff;
}
.footer_copy { border-top: 1px solid rgba(255,255,255,.08); }
.back-to-top {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px; height: 40px;
    background: var(--brand);
    color: #fff !important;
    font-size: 18px;
    text-decoration: none;
    transition: background .15s;
    font-family: var(--font-body);
}
.back-to-top:hover { background: var(--brand-dark); color: #fff !important; }
