/*
Theme Name: Quick Bajt
Theme URI: https://quickbajt.rs
Author: Quick Bajt
Description: Tamna tech tema za Quick Bajt — rubrike, YouTube Shorts mreža i stranice objava sa ugrađenim Shorts videom.
Version: 1.0.0
Requires at least: 6.6
Tested up to: 7.1
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: quickbajt
*/

/* ---------- Base ---------- */
body { -webkit-font-smoothing: antialiased; }
a { text-decoration: none; }
:where(.wp-site-blocks) > * { margin-block-start: 0; }
.qb-wrap { max-width: 1240px; margin-inline: auto !important; padding-inline: 24px; box-sizing: border-box; width: 100%; }
.qb-eyebrow { margin: 0 0 8px !important; font-size: 14px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; }
.qb-eyebrow.is-orange { color: var(--wp--preset--color--orange-text); }
.qb-eyebrow.is-blue { color: var(--wp--preset--color--blue-text); }
.qb-muted { color: var(--wp--preset--color--muted); }

/* ---------- Header ---------- */
.qb-header { position: sticky; top: 0; z-index: 50; background: rgba(7,9,15,.92); border-bottom: 1px solid var(--wp--preset--color--line); backdrop-filter: blur(8px); }
.admin-bar .qb-header { top: 32px; }
@media (max-width: 782px) { .admin-bar .qb-header { top: 0; } }
.qb-header-inner { display: flex; align-items: center; gap: 32px; flex-wrap: wrap; padding-block: 14px; }
.qb-brand { display: flex; align-items: center; gap: 12px; margin: 0 !important; }
.qb-brand a { display: flex; align-items: center; gap: 12px; color: var(--wp--preset--color--text); }
.qb-brand img { width: 68px; height: 34px; object-fit: contain; display: block; }
.qb-wordmark { font-family: var(--wp--preset--font-family--display); font-weight: 700; font-size: 22px; letter-spacing: .04em; line-height: 1; }
.qb-wordmark span { color: var(--wp--preset--color--orange); }
.qb-nav { flex-grow: 1; margin: 0 !important; }
.qb-nav .wp-block-navigation-item__content { color: #C9D1E0; font-weight: 500; font-size: 15px; }
.qb-nav .wp-block-navigation-item__content:hover { color: var(--wp--preset--color--orange-text); }
.qb-nav .wp-block-navigation__responsive-container.is-menu-open { background: var(--wp--preset--color--ground) !important; color: var(--wp--preset--color--text) !important; }
.qb-header-actions { margin: 0 0 0 auto !important; gap: 10px !important; }

/* ---------- Buttons ---------- */
.wp-block-button__link { border-radius: 12px; font-weight: 600; min-height: 44px; display: inline-flex; align-items: center; justify-content: center; box-sizing: border-box; }
.is-style-qb-orange .wp-block-button__link { background: var(--wp--preset--color--orange); color: var(--wp--preset--color--ground); }
.is-style-qb-orange .wp-block-button__link:hover { background: #FF7A57; color: var(--wp--preset--color--ground); }
.is-style-qb-blue .wp-block-button__link { background: var(--wp--preset--color--blue); color: #fff; }
.is-style-qb-blue .wp-block-button__link:hover { background: #2F7BFF; color: #fff; }
.is-style-qb-ghost .wp-block-button__link { background: rgba(14,19,32,.6); color: var(--wp--preset--color--text); border: 1px solid var(--wp--preset--color--line-strong); }
.is-style-qb-ghost .wp-block-button__link:hover { border-color: var(--wp--preset--color--orange); color: var(--wp--preset--color--text); }
.qb-btn-lg .wp-block-button__link { min-height: 52px; padding: 0 24px; }

/* ---------- Hero ---------- */
.qb-hero { position: relative; border-bottom: 1px solid var(--wp--preset--color--line); background-size: cover; background-position: center; }
.qb-hero-shade { background: linear-gradient(90deg, rgba(7,9,15,.96) 0%, rgba(7,9,15,.86) 45%, rgba(7,9,15,.35) 100%); }
.qb-hero-inner { display: flex; flex-wrap: wrap; align-items: center; gap: 56px; padding-block: 88px 96px; }
.qb-hero-text { flex: 999 1 520px; min-width: 0; display: flex; flex-direction: column; gap: 24px; }
.qb-hero-text > * { margin: 0 !important; }
.qb-pill { align-self: flex-start; padding: 6px 12px; border: 1px solid var(--wp--preset--color--blue); border-radius: 999px; color: #8DB4FF; font-size: 13px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; }
.qb-hero-title { font-size: clamp(40px, 6vw, 72px) !important; line-height: 1.02 !important; letter-spacing: -.01em; }
.qb-hero-title mark, .qb-accent { color: var(--wp--preset--color--orange) !important; background: none !important; }
.qb-hero-lead { max-width: 560px; font-size: 19px; color: #B4BDCE; }
.qb-hero-card-wrap { flex: 1 1 300px; display: flex; justify-content: center; }
.qb-hero-card { width: 300px; margin: 0 !important; border-radius: 22px; overflow: hidden; border: 1px solid var(--wp--preset--color--line-strong); background: var(--wp--preset--color--surface); }
.qb-hero-card img { display: block; width: 100%; aspect-ratio: 4/5; object-fit: cover; }
.qb-hero-card figcaption { margin: 0; padding: 16px 18px 18px; text-align: left; font-family: var(--wp--preset--font-family--display); font-weight: 600; font-size: 18px; line-height: 1.25; color: var(--wp--preset--color--text); }

/* ---------- Section headings ---------- */
.qb-section { padding-top: 88px; }
.qb-section-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 32px; }
.qb-section-head > * { margin: 0 !important; }
.qb-section-head .wp-block-heading { font-size: 40px; line-height: 1.1; }
.qb-section-head p:not(.qb-eyebrow) { max-width: 420px; color: var(--wp--preset--color--muted); }

/* ---------- Rubric cards ---------- */
.qb-rubrics { display: grid !important; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 20px; }
.qb-rubric { display: flex; flex-direction: column; gap: 14px; padding: 28px; background: var(--wp--preset--color--surface); border: 1px solid var(--wp--preset--color--line); border-radius: 18px; transition: transform .18s ease, border-color .18s ease; }
.qb-rubric > * { margin: 0 !important; }
.qb-rubric:hover { transform: translateY(-3px); border-color: var(--wp--preset--color--line-strong); }
.qb-rubric h3 { font-size: 24px; }
.qb-rubric h3 a { color: var(--wp--preset--color--text); }
.qb-rubric p { color: var(--wp--preset--color--muted); }
.qb-rubric .qb-rubric-desc { flex-grow: 1; }
.qb-icon { width: 52px; height: 52px; display: flex; align-items: center; justify-content: center; border-radius: 14px; }
.qb-icon.is-blue { background: rgba(8,96,255,.16); color: var(--wp--preset--color--blue-text); }
.qb-icon.is-orange { background: rgba(255,90,51,.14); color: var(--wp--preset--color--orange-text); }
.qb-rubric .qb-more a { font-weight: 600; font-size: 15px; }
.qb-rubric.is-orange .qb-more a { color: var(--wp--preset--color--orange-text); }
.qb-rubric.is-blue .qb-more a { color: var(--wp--preset--color--blue-text); }

/* ---------- Shorts grid ---------- */
.qb-shorts .wp-block-post-template { display: grid !important; grid-template-columns: repeat(auto-fill, minmax(176px, 1fr)); gap: 28px 20px; list-style: none; padding: 0; margin: 0; }
.qb-shorts .wp-block-post { display: flex; flex-direction: column; gap: 10px; margin: 0; }
.qb-shorts .wp-block-post > * { margin: 0 !important; }
.qb-short-thumb { position: relative; aspect-ratio: 9/16; border-radius: 16px; overflow: hidden; border: 1px solid var(--wp--preset--color--line); background-color: var(--wp--preset--color--surface); background-image: linear-gradient(#1A2234 1px, transparent 1px), linear-gradient(90deg, #1A2234 1px, transparent 1px); background-size: 24px 24px; transition: transform .18s ease, border-color .18s ease; }
.qb-short-thumb:hover { transform: translateY(-3px); border-color: var(--wp--preset--color--line-strong); }
.qb-short-thumb a { display: block; width: 100%; height: 100%; }
.qb-short-thumb img { width: 100% !important; height: 100% !important; object-fit: cover; display: block; }
.qb-short-thumb::after { content: ""; position: absolute; left: 50%; top: 50%; width: 54px; height: 54px; transform: translate(-50%,-50%); border-radius: 999px; background: rgba(7,9,15,.75) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='M8 5l12 7-12 7z'/%3E%3C/svg%3E") no-repeat 55% 50% / 20px; border: 1px solid var(--wp--preset--color--line-strong); pointer-events: none; }
.qb-short-cat { font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; }
.qb-short-cat a { color: var(--wp--preset--color--blue-text); }
.qb-short-title { font-size: 17px !important; line-height: 1.3 !important; }
.qb-short-title a { color: var(--wp--preset--color--text); }
.qb-short-title a:hover { color: var(--wp--preset--color--orange-text); }
.qb-empty { padding: 32px; border: 1px dashed var(--wp--preset--color--line-strong); border-radius: 16px; color: var(--wp--preset--color--muted); }
.qb-pagination { margin-top: 40px !important; gap: 12px; }
.qb-pagination a, .qb-pagination .page-numbers { color: var(--wp--preset--color--text); }

/* ---------- Follow band ---------- */
.qb-follow { border-radius: 24px; border: 1px solid var(--wp--preset--color--line-strong); overflow: hidden; background-size: cover; background-position: center; }
.qb-follow-inner { padding: 64px 40px; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 18px; background: linear-gradient(rgba(7,9,15,.55), rgba(7,9,15,.75)); }
.qb-follow-inner > * { margin: 0 !important; }
.qb-follow-inner .wp-block-heading { font-size: 40px; line-height: 1.1; }
.qb-follow-inner .wp-block-buttons { justify-content: center; gap: 12px; margin-top: 10px !important; }

/* ---------- Footer ---------- */
.qb-footer { margin-top: 88px; border-top: 1px solid var(--wp--preset--color--line); }
.qb-footer-cols { display: flex; flex-wrap: wrap; gap: 40px; justify-content: space-between; padding-block: 48px 32px; }
.qb-footer-cols > * { margin: 0 !important; }
.qb-footer-brand { display: flex; flex-direction: column; gap: 12px; max-width: 360px; }
.qb-footer-brand > * { margin: 0 !important; }
.qb-footer-brand img { width: 132px; height: auto; }
.qb-footer-col { display: flex; flex-direction: column; gap: 8px; }
.qb-footer-col > * { margin: 0 !important; }
.qb-footer-col h4 { font-family: var(--wp--preset--font-family--body); font-size: 16px; font-weight: 600; }
.qb-footer-col a { color: var(--wp--preset--color--muted); }
.qb-footer-col a:hover { color: var(--wp--preset--color--orange-text); }
.qb-copy { padding-block: 20px 32px; border-top: 1px solid var(--wp--preset--color--line); color: #7F8AA0; font-size: 14px; margin: 0 !important; }

/* ---------- Archive head ---------- */
.qb-archive-head { padding-block: 64px 8px; }
.qb-archive-head > * { margin: 0 0 12px !important; }
.qb-archive-head .wp-block-query-title { font-size: clamp(36px, 5vw, 56px); line-height: 1.05; }
.qb-archive-head .wp-block-term-description { color: var(--wp--preset--color--muted); max-width: 640px; font-size: 18px; }

/* ---------- Single post ---------- */
.qb-single { padding-top: 48px; }
.qb-single-head { max-width: 760px; }
.qb-single-head > * { margin: 0 0 18px !important; }
.qb-single-cat a { display: inline-block; padding: 5px 12px; border-radius: 999px; background: rgba(8,96,255,.16); color: #8DB4FF; font-size: 13px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; }
.qb-single-title { font-size: clamp(34px, 4.5vw, 52px) !important; line-height: 1.08 !important; }
.qb-single-date { color: var(--wp--preset--color--muted); font-size: 15px; }
.qb-single-body { display: flow-root; margin-top: 24px; }
.qb-single-body .wp-block-post-content { font-size: 18px; color: #C9D1E0; }
.qb-single-body .wp-block-post-content > * { max-width: 720px; }
.qb-single-body .wp-block-post-content h2 { font-size: 28px; margin-top: 1.6em; color: var(--wp--preset--color--text); }
.qb-single-body .wp-block-post-content strong { color: #fff; }
.qb-single-body .wp-block-post-content pre, .qb-single-body .wp-block-post-content .wp-block-quote, .qb-single-body .wp-block-post-content .wp-block-code { background: var(--wp--preset--color--surface); border: 1px solid var(--wp--preset--color--line-strong); border-radius: 16px; padding: 22px 24px; white-space: pre-wrap; font-family: var(--wp--preset--font-family--body); font-size: 16px; color: #C9D1E0; }
.qb-single-body .wp-block-post-content .wp-block-quote { border-left: 1px solid var(--wp--preset--color--line-strong); }
.qb-tags { margin-top: 32px !important; }
.qb-tags a { display: inline-block; padding: 6px 12px; margin: 0 6px 8px 0; border-radius: 8px; border: 1px solid var(--wp--preset--color--line-strong); color: var(--wp--preset--color--muted); font-size: 14px; }
.qb-tags .wp-block-post-terms__separator { display: none; }

/* YouTube Shorts embeds: vertical player */
.wp-block-embed.qb-embed-short { max-width: 380px !important; width: 100%; margin-inline: auto; }
.wp-block-embed.qb-embed-short .wp-block-embed__wrapper { position: relative; aspect-ratio: 9/16; border-radius: 22px; overflow: hidden; border: 1px solid var(--wp--preset--color--line-strong); background: var(--wp--preset--color--surface); }
.wp-block-embed.qb-embed-short .wp-block-embed__wrapper::before { display: none !important; }
.wp-block-embed.qb-embed-short iframe { position: absolute; inset: 0; width: 100% !important; height: 100% !important; }
@media (min-width: 1000px) {
	.qb-single-body .wp-block-post-content > .wp-block-embed.qb-embed-short:first-child { float: left; width: 360px; margin: 0 56px 32px 0 !important; }
	/* Text next to a leading Short runs to the full content width */
	.qb-single-body .wp-block-post-content:has(> .wp-block-embed.qb-embed-short:first-child) > *:not(.qb-embed-short) { max-width: none !important; margin-left: 0 !important; margin-right: 0 !important; }
}

/* ---------- 404 / search ---------- */
.qb-center { text-align: center; padding-block: 96px; }
.qb-center > * { margin-inline: auto !important; }
.wp-block-search__input { background: var(--wp--preset--color--surface); color: var(--wp--preset--color--text); border: 1px solid var(--wp--preset--color--line-strong); border-radius: 12px; min-height: 48px; padding: 0 16px; }
.wp-block-search__button { border-radius: 12px; background: var(--wp--preset--color--orange); color: var(--wp--preset--color--ground); font-weight: 600; border: 0; }

/* ---------- Fixes & mobile ---------- */
.qb-rubrics > *, .qb-shorts .wp-block-post-template > * { margin: 0 !important; }
@media (max-width: 600px) {
	.qb-header-inner { flex-wrap: nowrap; gap: 12px; }
	.qb-wordmark { font-size: 18px; }
	.qb-brand img { width: 56px; height: 28px; }
	.qb-nav { flex-grow: 0; order: 3; }
	.qb-header-actions .wp-block-button__link { padding: 0 14px; font-size: 14px; }
	.qb-hero-inner { padding-block: 56px 64px; }
	.qb-hero-card-wrap { display: none; }
	.qb-section { padding-top: 64px; }
	.qb-section-head .wp-block-heading, .qb-follow-inner .wp-block-heading { font-size: 32px; }
	.qb-shorts .wp-block-post-template { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px 14px; }
	.qb-follow-inner { padding: 48px 20px; }
}

/* ---------- Vesti (front page + Vesti category page) ---------- */
.qb-news-list .wp-block-post-template,
.qb-is-news .qb-shorts .wp-block-post-template { display: flex !important; flex-direction: column; gap: 20px; list-style: none; padding: 0; margin: 0; }
.qb-news-list .wp-block-post,
.qb-is-news .qb-shorts .wp-block-post { display: grid; grid-template-columns: minmax(0, 42%) minmax(0, 1fr); grid-template-rows: auto auto 1fr; column-gap: 40px; row-gap: 12px; padding: 28px; background: var(--wp--preset--color--surface); border: 1px solid var(--wp--preset--color--line); border-radius: 18px; transition: transform .18s ease, border-color .18s ease; }
.qb-news-list .wp-block-post:hover,
.qb-is-news .qb-shorts .wp-block-post:hover { transform: translateY(-3px); border-color: var(--wp--preset--color--line-strong); }
.qb-news-list .wp-block-post > *,
.qb-is-news .qb-shorts .wp-block-post > * { grid-column: 2; margin: 0 !important; min-width: 0; }
.qb-news-list .wp-block-post > .qb-news-thumb,
.qb-is-news .qb-shorts .wp-block-post > .qb-short-thumb { grid-column: 1; grid-row: 1 / span 3; align-self: start; aspect-ratio: 16/9; border-radius: 14px; overflow: hidden; border: 1px solid var(--wp--preset--color--line); transform: none; }
.qb-news-list .qb-news-thumb a, .qb-is-news .qb-shorts .qb-short-thumb a { display: block; width: 100%; height: 100%; }
.qb-news-list .qb-news-thumb img,
.qb-is-news .qb-shorts .qb-short-thumb img { width: 100% !important; height: 100% !important; aspect-ratio: 16/9; object-fit: cover; display: block; }
.qb-is-news .qb-shorts .qb-short-thumb::after { display: none; }
.qb-news-date { color: var(--wp--preset--color--muted); font-size: 14px; }
.qb-news-title, .qb-is-news .qb-short-title { font-size: 24px !important; line-height: 1.25 !important; }
.qb-news-title a, .qb-is-news .qb-short-title a { color: var(--wp--preset--color--text); }
.qb-news-excerpt { color: #C9D1E0; font-size: 17px; line-height: 1.6; }
.qb-news-excerpt p { margin: 0; }
.qb-news-excerpt .wp-block-post-excerpt__more-text { margin: 14px 0 0 !important; }
.qb-news-excerpt .wp-block-post-excerpt__more-link { font-weight: 600; color: var(--wp--preset--color--orange-text); }
@media (max-width: 760px) {
	.qb-news-list .wp-block-post,
	.qb-is-news .qb-shorts .wp-block-post { grid-template-columns: minmax(0, 1fr); grid-template-rows: none; padding: 20px; }
	.qb-news-list .wp-block-post > *,
	.qb-is-news .qb-shorts .wp-block-post > * { grid-column: 1; }
	.qb-news-list .wp-block-post > .qb-news-thumb,
	.qb-is-news .qb-shorts .wp-block-post > .qb-short-thumb { grid-column: 1; grid-row: auto; order: -1; }
}

/* Featured image inside a single article */
.qb-single-body .wp-block-post-content > .qb-single-featured { margin: 28px 0 !important; }
.qb-single-featured img { display: block; width: 100%; height: auto; border-radius: 18px; border: 1px solid var(--wp--preset--color--line); }

/* News articles (Vesti): text runs to the full content width, in line with "+ Zaprati" */
.qb-is-news-single .qb-single-body .wp-block-post-content > * { max-width: none !important; margin-left: 0 !important; margin-right: 0 !important; }
