/* ============================================
   Samoleti CMS - Mobile-First Stylesheet
   ============================================ */

/* --- Fonts --- */
@font-face { font-family: 'Inter'; font-weight: 400; font-style: normal; font-display: swap; src: url('/assets/fonts/inter/inter-400.ttf') format('truetype'); }
@font-face { font-family: 'Inter'; font-weight: 500; font-style: normal; font-display: swap; src: url('/assets/fonts/inter/inter-500.ttf') format('truetype'); }
@font-face { font-family: 'Inter'; font-weight: 700; font-style: normal; font-display: swap; src: url('/assets/fonts/inter/inter-700.ttf') format('truetype'); }

/* --- Reset & Base --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; -webkit-text-size-adjust: 100%; overflow-x: hidden; }
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    color: var(--text); background: var(--bg); line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}
a { color: var(--accent); text-decoration: none; transition: color .2s; }
a:hover { color: var(--accent-hover); }
img { max-width: 100%; height: auto; display: block; }
ul, ol { list-style: none; }
button, input, textarea, select { font: inherit; }

/* --- CSS Variables --- */
:root {
    --bg: #eef6fb;
    --bg-card: #ffffff;
    --bg-sidebar: #e0f0fa;
    --text: #1a2332;
    --text-muted: #546478;
    --text-light: #5c6b7a;
    --accent: #0270a8;
    --accent-hover: #0369a1;
    --accent-dark: #8B1A1A;
    --border: #c8dce8;
    --shadow: 0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.06);
    --shadow-lg: 0 10px 25px rgba(0,0,0,.12);
    --radius: 12px;
    --radius-sm: 8px;
    --header-bg: linear-gradient(135deg, #0b4f6c 0%, #4aafe6 50%, #87ceeb 100%);
    --header-height: 64px;
    /* Category colors */
    --cat-wizzair: #C60A7E;
    --cat-ryanair: #073590;
    --cat-qatar: #5C0632;
    --cat-bulair: #1a6b3c;
    --cat-promo: #c93035;
    --cat-destinations: #1a7a6f;
    --cat-companies: #0369a1;
    --cat-planes: #4f46e5;
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg: #0c1929;
        --bg-card: #152238;
        --bg-sidebar: #152238;
        --text: #e0eaf4;
        --text-muted: #8da4bd;
        --text-light: #5a7899;
        --border: #253550;
        --shadow: 0 1px 3px rgba(0,0,0,.3);
        --shadow-lg: 0 10px 25px rgba(0,0,0,.4);
    }
}

/* --- Layout --- */
.container { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 16px; }
.main-grid { display: grid; gap: 24px; grid-template-columns: 1fr; padding: 24px 0; }
.main-grid > * { min-width: 0; }

@media (min-width: 1024px) {
    .main-grid { grid-template-columns: 1fr 320px; }
    .container { padding: 0 24px; }
}

/* --- Header --- */
.site-header {
    background: var(--header-bg);
    position: sticky; top: 0; z-index: 100;
    box-shadow: 0 2px 10px rgba(0,0,0,.2);
}
.header-inner {
    display: flex; align-items: center; justify-content: space-between;
    height: var(--header-height); max-width: 1200px; margin: 0 auto; padding: 0 16px;
}
.site-logo {
    display: flex; align-items: center; gap: 6px;
}
.site-logo img { height: 44px; width: auto; }
.site-logo span {
    font-size: 1.5rem; font-weight: 800; font-style: italic;
    color: #fff;
    letter-spacing: -.5px;
}

/* --- Navigation --- */
.nav-toggle {
    display: flex; flex-direction: column; gap: 5px;
    background: none; border: none; cursor: pointer; padding: 8px;
}
.nav-toggle span {
    width: 24px; height: 2px; background: #fff; border-radius: 2px;
    transition: transform .3s, opacity .3s;
}
.nav-toggle.active span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
.nav-toggle.active span:nth-child(2) { opacity: 0; }
.nav-toggle.active span:nth-child(3) { transform: rotate(-45deg) translate(5px, -5px); }

.nav-menu {
    display: none; position: absolute; top: var(--header-height); left: 0; right: 0;
    background: #0b4f6c; padding: 16px; border-top: 1px solid rgba(255,255,255,.15);
    flex-direction: column; gap: 0;
}
.nav-menu.open { display: flex; }
.nav-menu a {
    color: #e0f2fe; padding: 12px 16px; font-size: .95rem; font-weight: 500;
    border-radius: var(--radius-sm); transition: background .2s, color .2s;
}
.nav-menu a:hover { background: rgba(255,255,255,.12); color: #fff; }
.nav-submenu { padding-left: 20px; }
.nav-submenu a { font-size: .9rem; color: #bae6fd; }

.search-form-header { display: none; }

@media (min-width: 768px) {
    .nav-toggle { display: none; }
    .nav-menu {
        display: flex; position: static; background: none; padding: 0;
        flex-direction: row; gap: 4px; border: none; align-items: center;
    }
    .nav-menu a { padding: 8px 14px; font-size: .9rem; }
    .nav-submenu { display: none; position: absolute; background: #0b4f6c; border-radius: var(--radius-sm); padding: 8px 0; min-width: 240px; box-shadow: var(--shadow-lg); z-index: 200; }
    .nav-item-parent { position: relative; }
    .nav-item-parent:hover .nav-submenu { display: block; padding-left: 0; }
    .nav-submenu a { display: block; padding: 8px 20px; }
    .search-form-header { display: flex; margin-left: 8px; }
    .search-form-header input {
        background: rgba(255,255,255,.15); border: 1px solid rgba(255,255,255,.2);
        color: #fff; padding: 6px 14px; border-radius: 20px; font-size: .85rem; width: 160px;
        transition: width .3s, background .3s;
    }
    .search-form-header input:focus { width: 220px; background: rgba(255,255,255,.25); outline: none; border-color: rgba(255,255,255,.4); }
    .search-form-header input::placeholder { color: rgba(255,255,255,.5); }
}

/* --- Hero Card --- */
.hero-card {
    position: relative; border-radius: var(--radius); overflow: hidden;
    display: block;
    box-shadow: var(--shadow-lg);
}
.hero-card img, .hero-card picture img {
    width: 100%; height: auto; display: block; z-index: 0;
}
.hero-card picture { display: contents; }
.hero-card .hero-overlay {
    position: absolute; bottom: 0; left: 0; right: 0; z-index: 1;
    background: linear-gradient(transparent, rgba(0,0,0,.8));
    padding: 32px 24px 24px; color: #fff;
}
.hero-card .cat-badge { margin-bottom: 12px; }
.hero-card h2 {
    font-size: clamp(1.2rem, 3vw, 1.8rem); font-weight: 700; line-height: 1.3;
    margin-bottom: 8px;
}
.hero-card h2 a { color: #fff; }
.hero-card h2 a:hover { color: #7dd3fc; }
.hero-card .post-meta { color: rgba(255,255,255,.7); font-size: .85rem; }

@media (min-width: 768px) { .hero-card { min-height: 380px; } }

/* --- Post Cards Grid --- */
.posts-grid {
    display: grid; gap: 20px;
    grid-template-columns: 1fr;
}
@media (min-width: 640px) { .posts-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .posts-grid { grid-template-columns: repeat(2, 1fr); } }

.post-card {
    background: var(--bg-card); border-radius: var(--radius); overflow: hidden;
    box-shadow: var(--shadow); transition: transform .25s, box-shadow .25s;
    display: flex; flex-direction: column;
}
.post-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.post-card-img {
    position: relative; overflow: hidden; background: var(--border);
}
.post-card-img picture { display: contents; }
.post-card-img img {
    width: 100%; height: auto; display: block;
    transition: transform .4s;
}
.post-card:hover .post-card-img img { transform: scale(1.05); }
.post-card-body { padding: 16px; flex: 1; display: flex; flex-direction: column; }
.post-card-body .cat-badge { margin-bottom: 6px; }
.post-card-title {
    font-size: clamp(.95rem, 2vw, 1.1rem); font-weight: 700; line-height: 1.4;
    margin-bottom: 8px;
}
.post-card-title a { color: var(--text); display: inline-block; min-height: 24px; padding: 2px 0; }
.post-card-title a:hover { color: var(--accent); }
.post-card-excerpt { font-size: .88rem; color: var(--text-muted); line-height: 1.5; margin-bottom: 12px; flex: 1; }
.post-card-footer { display: flex; align-items: center; justify-content: space-between; font-size: .8rem; color: var(--text-light); }

/* --- Category Badges --- */
.cat-badge {
    display: inline-block; padding: 3px 10px; border-radius: 20px;
    font-size: .75rem; font-weight: 600; color: #fff; text-transform: uppercase; letter-spacing: .5px;
    background: var(--cat-companies); text-decoration: none;
}
.cat-badge:hover { color: #fff; opacity: .85; }
.cat-badge[data-cat="wizzair"] { background: var(--cat-wizzair); }
.cat-badge[data-cat="ryanair"] { background: var(--cat-ryanair); }
.cat-badge[data-cat="qatar-airways"] { background: var(--cat-qatar); }
.cat-badge[data-cat="bulgaria-air"] { background: var(--cat-bulair); }
.cat-badge[data-cat="promo"] { background: var(--cat-promo); }
.cat-badge[data-cat="destinations"] { background: var(--cat-destinations); }
.cat-badge[data-cat="companies"] { background: var(--cat-companies); }
.cat-badge[data-cat="planes"] { background: var(--cat-planes); }

/* --- Single Post --- */
.post-single { background: var(--bg-card); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.post-featured-img { overflow: hidden; border-radius: var(--radius) var(--radius) 0 0; }
.post-featured-img img { width: 100%; height: auto; display: block; }
.post-body { padding: 20px; }
@media (min-width: 768px) { .post-body { padding: 36px 44px 44px; } }

.post-header { margin-bottom: 28px; padding-bottom: 20px; border-bottom: 1px solid var(--border); }
.post-header .cat-badge { margin-bottom: 14px; }
.post-title {
    font-size: clamp(1.25rem, 3.5vw, 1.75rem); font-weight: 800; line-height: 1.35;
    margin-bottom: 16px; color: var(--text); letter-spacing: -.01em;
}
.post-meta {
    display: flex; flex-wrap: wrap; gap: 6px; color: var(--text-light); font-size: .82rem;
    align-items: center;
}
.post-meta span { display: inline-flex; align-items: center; gap: 4px; }
.post-meta .meta-sep { color: var(--border); margin: 0 2px; }
.post-meta .meta-author { color: var(--text-muted); font-weight: 600; }
.post-meta .meta-views { color: var(--accent); }

.post-content { font-size: .98rem; line-height: 1.85; color: var(--text); }
.post-content p { margin-bottom: 1.1em; }
.post-content h2 {
    font-size: 1.3rem; font-weight: 700; margin: 1.8em 0 .7em;
    color: var(--accent-dark, var(--text)); padding-bottom: 8px;
    border-bottom: 2px solid var(--border);
}
.post-content h3 {
    font-size: 1.1rem; font-weight: 600; margin: 1.4em 0 .5em;
    color: var(--text);
}
.post-content img { border-radius: var(--radius-sm); margin: 1.2em 0; }
.post-content picture { display: block; margin: 1.2em 0; }
.post-content picture img { margin: 0; }
.post-content figure { margin: 1.5em 0; }
.post-content figcaption {
    font-size: .8rem; color: var(--text-light); text-align: center;
    margin-top: 8px; font-style: italic;
}
.post-content a { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }
.post-content a:hover { color: var(--accent-hover); }
.post-content ul, .post-content ol { padding-left: 1.5em; margin-bottom: 1.2em; }
.post-content li { list-style: disc; margin-bottom: .4em; line-height: 1.7; }
.post-content ol li { list-style: decimal; }
.post-content blockquote {
    border-left: 4px solid var(--accent); padding: 14px 20px; margin: 1.5em 0;
    background: var(--bg-sidebar); border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    font-style: italic; color: var(--text-muted); font-size: .95rem;
}
.post-content strong { font-weight: 700; color: var(--text); }

/* --- Tags on Post --- */
.post-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 32px; padding-top: 24px; border-top: 1px solid var(--border); }
.tag-link {
    display: inline-block; padding: 4px 14px; background: var(--bg-sidebar);
    border-radius: 20px; font-size: .82rem; color: var(--text-muted); transition: all .2s;
    border: 1px solid var(--border);
}
.tag-link:hover { background: var(--accent); color: #fff; border-color: var(--accent); }

/* --- Share --- */
.share-bar { display: flex; gap: 12px; margin-top: 24px; padding-top: 24px; border-top: 1px solid var(--border); align-items: center; }
.share-bar span { font-size: .9rem; font-weight: 600; color: var(--text-muted); }
.share-btn {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 8px 16px; border-radius: 8px; font-size: .85rem; font-weight: 500;
    border: 1px solid var(--border); color: var(--text-muted); background: var(--bg);
    cursor: pointer; transition: all .2s;
}
.share-btn:hover { background: var(--accent); color: #fff; border-color: var(--accent); }

/* --- Breadcrumbs --- */
.breadcrumbs {
    padding: 14px 0; font-size: .82rem; color: var(--text-light);
    display: flex; flex-wrap: wrap; gap: 4px; align-items: center;
}
.breadcrumbs a { color: var(--text-muted); font-weight: 500; }
.breadcrumbs a:hover { color: var(--accent); }
.breadcrumbs .sep { margin: 0 3px; color: var(--border); font-size: .7rem; }

/* --- Sidebar --- */
.sidebar { display: flex; flex-direction: column; gap: 24px; }
.sidebar-widget {
    background: var(--bg-card); border-radius: var(--radius); padding: 20px;
    box-shadow: var(--shadow);
}
.widget-title {
    font-size: 1rem; font-weight: 700; margin-bottom: 16px;
    padding-bottom: 10px; border-bottom: 2px solid var(--accent); color: var(--text);
}

/* Recent posts widget */
.recent-post-item { display: flex; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border); align-items: center; }
.recent-post-item:last-child { border-bottom: none; }
.recent-post-thumb { width: 64px; height: 48px; border-radius: 6px; overflow: hidden; flex-shrink: 0; background: var(--border); }
.recent-post-thumb img { width: 100%; height: 100%; object-fit: cover; }
.recent-post-info h4 { font-size: .85rem; font-weight: 600; line-height: 1.3; }
.recent-post-info h4 a { color: var(--text); }
.recent-post-info h4 a:hover { color: var(--accent); }
.recent-post-info time { font-size: .75rem; color: var(--text-light); }

/* Tag cloud widget */
.tag-cloud { display: flex; flex-wrap: wrap; gap: 6px; }
.tag-cloud.collapsed { max-height: 120px; overflow: hidden; position: relative; }
.tag-cloud-toggle { margin-top: 12px; font-size: .85rem; color: var(--accent); cursor: pointer; font-weight: 500; background: none; border: none; padding: 8px 0; min-height: 44px; }

/* Newsletter widget */
.newsletter-form { display: flex; flex-direction: column; gap: 10px; }
.newsletter-form input[type="email"] {
    padding: 10px 14px; border: 1px solid var(--border); border-radius: var(--radius-sm);
    font-size: .9rem; background: var(--bg);
}
.newsletter-form button {
    padding: 10px; border: none; border-radius: var(--radius-sm);
    background: var(--accent); color: #fff; font-weight: 600; font-size: .9rem; cursor: pointer;
    transition: background .2s;
}
.newsletter-form button:hover { background: var(--accent-hover); }

/* --- Pagination --- */
.pagination { display: flex; justify-content: center; gap: 6px; margin: 32px 0; flex-wrap: wrap; }
.pagination a, .pagination span {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 40px; height: 40px; padding: 0 12px;
    border-radius: var(--radius-sm); font-size: .9rem; font-weight: 500;
    border: 1px solid var(--border); color: var(--text-muted);
    transition: all .2s;
}
.pagination a:hover { background: var(--accent); color: #fff; border-color: var(--accent); }
.pagination .current { background: var(--accent); color: #fff; border-color: var(--accent); }

/* --- Category/Tag Page Header --- */
.page-header {
    background: var(--bg-card); border-radius: var(--radius); padding: 24px;
    margin-bottom: 24px; box-shadow: var(--shadow);
}
.page-header h1 { font-size: clamp(1.3rem, 3vw, 1.8rem); font-weight: 700; margin-bottom: 4px; }
.page-header .count { color: var(--text-muted); font-size: .9rem; }

/* --- Comments --- */
.comments-section { margin-top: 32px; }
.comments-title { font-size: 1.2rem; font-weight: 700; margin-bottom: 20px; }
.comment {
    padding: 16px 0; border-bottom: 1px solid var(--border);
}
.comment:last-child { border-bottom: none; }
.comment-author { font-weight: 600; font-size: .95rem; }
.comment-date { font-size: .8rem; color: var(--text-light); margin-left: 12px; }
.comment-text { margin-top: 8px; font-size: .95rem; line-height: 1.6; color: var(--text-muted); }

.comment-form { margin-top: 24px; }
.comment-form h3 { font-size: 1.1rem; font-weight: 700; margin-bottom: 16px; }
.form-row { margin-bottom: 14px; }
.form-row label { display: block; font-size: .85rem; font-weight: 500; margin-bottom: 4px; color: var(--text-muted); }
.form-row input, .form-row textarea {
    width: 100%; padding: 10px 14px; border: 1px solid var(--border);
    border-radius: var(--radius-sm); font-size: .95rem; background: var(--bg);
    transition: border-color .2s;
}
.form-row input:focus, .form-row textarea:focus { outline: none; border-color: var(--accent); }
.form-row textarea { resize: vertical; min-height: 120px; }
.btn-submit {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 12px 24px; background: var(--accent); color: #fff;
    border: none; border-radius: var(--radius-sm); font-size: .95rem;
    font-weight: 600; cursor: pointer; transition: background .2s;
}
.btn-submit:hover { background: var(--accent-hover); }

/* --- Related Posts --- */
.related-posts { margin-top: 40px; }
.related-posts h3 { font-size: 1.2rem; font-weight: 700; margin-bottom: 16px; }
.related-grid { display: grid; gap: 16px; grid-template-columns: repeat(2, 1fr); }
@media (min-width: 768px) { .related-grid { grid-template-columns: repeat(4, 1fr); } }

/* --- Footer --- */
.site-footer {
    background: linear-gradient(135deg, #0b4f6c 0%, #0c1929 100%); color: #bae6fd; padding: 40px 0 24px;
    margin-top: 48px; font-size: .88rem;
}
.footer-inner { max-width: 1200px; margin: 0 auto; padding: 0 16px; text-align: center; }
.footer-inner a { color: #7dd3fc; }
.footer-copy { margin-top: 16px; padding-top: 16px; border-top: 1px solid rgba(255,255,255,.1); color: #64a3c9; font-size: .82rem; }

/* --- Search Page --- */
.search-form-page { display: flex; gap: 8px; max-width: 500px; margin-bottom: 24px; }
.search-form-page input {
    flex: 1; padding: 12px 18px; border: 2px solid var(--border); border-radius: var(--radius);
    font-size: 1rem; background: var(--bg-card);
}
.search-form-page input:focus { outline: none; border-color: var(--accent); }
.search-form-page button {
    padding: 12px 24px; background: var(--accent); color: #fff; border: none;
    border-radius: var(--radius); font-weight: 600; cursor: pointer;
}

/* --- Ad Slots --- */
.ad-slot { text-align: center; margin: 0.75rem auto; padding: 0 16px; box-sizing: border-box; max-width: 100%; overflow: hidden; }
.ad-slot > div { max-width: 100%; overflow: hidden; margin: 0 auto; }
.ad-slot iframe, .ad-slot img { max-width: 100%; }
.post-body .ad-slot { padding: 0; }
.ad-slot:empty { display: none; }

/* --- Animations --- */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}
.post-card { animation: fadeInUp .4s ease both; }
.post-card:nth-child(2) { animation-delay: .05s; }
.post-card:nth-child(3) { animation-delay: .1s; }
.post-card:nth-child(4) { animation-delay: .15s; }

/* --- Lazy Images --- */
img[data-src] { opacity: 0; transition: opacity .3s; }
img[data-src].loaded { opacity: 1; }

/* --- Utility --- */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0; }
.text-center { text-align: center; }
.mt-0 { margin-top: 0; }

/* --- Lightbox Modal --- */
.lightbox {
    display: none; position: fixed; inset: 0; z-index: 9999;
    background: rgba(0,0,0,.9); align-items: center; justify-content: center;
    cursor: zoom-out; opacity: 0; transition: opacity .25s;
}
.lightbox.active { display: flex; opacity: 1; }
.lightbox img {
    max-width: 92vw; max-height: 90vh; border-radius: 8px;
    box-shadow: 0 20px 60px rgba(0,0,0,.5);
    animation: lightboxIn .3s ease;
}
.lightbox-close {
    position: absolute; top: 16px; right: 20px;
    color: #fff; font-size: 2rem; cursor: pointer; background: none; border: none;
    width: 44px; height: 44px; display: flex; align-items: center; justify-content: center;
    border-radius: 50%; transition: background .2s;
}
.lightbox-close:hover { background: rgba(255,255,255,.15); }
.lightbox-caption {
    position: absolute; bottom: 20px; left: 50%; transform: translateX(-50%);
    color: #e2e8f0; font-size: .9rem; text-align: center; max-width: 80%;
    text-shadow: 0 1px 3px rgba(0,0,0,.5);
}
@keyframes lightboxIn {
    from { transform: scale(.9); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}
.post-content img { cursor: zoom-in; transition: opacity .2s; }
.post-content img:hover { opacity: .9; }
