/* =========================================================================
   Panara8 News — main.css
   Modern, lightweight, modular CSS for a WordPress news theme.
   Colors are driven by CSS custom properties, overridden live from the
   WordPress Customizer (see inc/customizer.php -> wp_head inline <style>).
   ========================================================================= */

:root {
	--p8-primary: #E30613;
	--p8-primary-dark: #b8050f;
	--p8-dark: #101820;
	--p8-accent: #F5A623;

	--p8-bg: #f6f7f9;
	--p8-surface: #ffffff;
	--p8-text: #1a1d21;
	--p8-text-soft: #5b6470;
	--p8-border: #e7e9ec;

	--p8-font-head: 'Merriweather', Georgia, serif;
	--p8-font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

	--p8-radius: 10px;
	--p8-shadow: 0 2px 10px rgba(16, 24, 32, 0.06);
	--p8-shadow-hover: 0 10px 28px rgba(16, 24, 32, 0.14);
	--p8-container: 1240px;
	--p8-transition: 0.25s cubic-bezier(.4,0,.2,1);
}

/* ---------- Reset & base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
	margin: 0;
	font-family: var(--p8-font-body);
	color: var(--p8-text);
	background: var(--p8-bg);
	line-height: 1.55;
	-webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; height: auto; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; margin: 0; padding: 0; }
h1, h2, h3, h4 { font-family: var(--p8-font-head); margin: 0; line-height: 1.25; }
button { font-family: inherit; cursor: pointer; }
.screen-reader-text { position: absolute !important; clip: rect(1px,1px,1px,1px); overflow: hidden; height: 1px; width: 1px; }
.p8-skip-link { position: absolute; left: -9999px; top: 0; background: var(--p8-primary); color: #fff; padding: 10px 16px; z-index: 999; }
.p8-skip-link:focus { left: 10px; top: 10px; }

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

/* ---------- Image treatment ---------- */
.p8-img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* ---------- Buttons / badges ---------- */
.p8-btn {
	display: inline-flex; align-items: center; justify-content: center;
	gap: 6px; padding: 11px 22px; border-radius: 999px; border: none;
	background: var(--p8-primary); color: #fff; font-weight: 600; font-size: 14px;
	transition: background var(--p8-transition), transform var(--p8-transition);
}
.p8-btn:hover { background: var(--p8-primary-dark); transform: translateY(-1px); }
.p8-btn--outline { background: transparent; color: var(--p8-primary); border: 1.5px solid var(--p8-primary); }
.p8-btn--outline:hover { background: var(--p8-primary); color: #fff; }

.p8-badge {
	display: inline-block; font-size: 11px; font-weight: 700; letter-spacing: .04em;
	text-transform: uppercase; color: #fff; background: var(--p8-primary);
	padding: 4px 10px; border-radius: 4px; margin-bottom: 8px;
}
.p8-badge--tag { background: var(--p8-border); color: var(--p8-text-soft); text-transform: none; font-weight: 500; border-radius: 999px; }

.p8-meta { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--p8-text-soft); flex-wrap: wrap; }
.p8-meta__dot { opacity: .5; }
.p8-empty { color: var(--p8-text-soft); padding: 30px 0; }

/* =========================================================================
   TOP BAR
   ========================================================================= */
.p8-topbar { background: var(--p8-dark); color: rgba(255,255,255,.75); font-size: 12.5px; }
.p8-topbar__inner { display: flex; justify-content: space-between; align-items: center; padding: 7px 20px; }
.p8-topbar__date { display: none; }
@media (min-width: 640px) { .p8-topbar__date { display: block; } }

/* =========================================================================
   HEADER / NAVBAR
   ========================================================================= */
.p8-header { background: var(--p8-surface); border-bottom: 1px solid var(--p8-border); position: sticky; top: 0; z-index: 60; transition: box-shadow var(--p8-transition); }
.p8-header.is-stuck { box-shadow: 0 4px 16px rgba(0,0,0,.08); }
.p8-header__inner { display: flex; align-items: center; justify-content: space-between; padding: 14px 20px; gap: 20px; }

.p8-branding img { max-height: 46px; width: auto; }
.p8-logo-text { font-family: var(--p8-font-head); font-weight: 900; font-size: 26px; color: var(--p8-primary); letter-spacing: -.5px; }
.p8-logo-text--footer { color: #fff; font-size: 22px; }

.p8-nav { display: none; }
.p8-nav__list { display: flex; gap: 28px; }
.p8-nav__list a { font-weight: 600; font-size: 14.5px; position: relative; padding: 6px 0; }
.p8-nav__list a::after {
	content: ""; position: absolute; left: 0; bottom: -2px; width: 0; height: 2px;
	background: var(--p8-primary); transition: width var(--p8-transition);
}
.p8-nav__list a:hover::after,
.p8-nav__list li.current-menu-item a::after { width: 100%; }

.p8-header__actions { display: flex; align-items: center; gap: 6px; }
.p8-icon-btn {
	display: inline-flex; align-items: center; justify-content: center;
	width: 38px; height: 38px; border-radius: 50%; border: none; background: transparent;
	color: var(--p8-text); transition: background var(--p8-transition);
}
.p8-icon-btn:hover { background: var(--p8-bg); }

.p8-hamburger span { display: block; width: 18px; height: 2px; background: currentColor; margin: 3px auto; transition: transform var(--p8-transition), opacity var(--p8-transition); }
.p8-hamburger.is-active span:nth-child(1) { transform: translateY(5px) rotate(45deg); }
.p8-hamburger.is-active span:nth-child(2) { opacity: 0; }
.p8-hamburger.is-active span:nth-child(3) { transform: translateY(-5px) rotate(-45deg); }

.p8-search-panel { max-height: 0; overflow: hidden; background: var(--p8-bg); transition: max-height var(--p8-transition), padding var(--p8-transition); }
.p8-search-panel.is-open { max-height: 100px; padding: 16px 0; }
.p8-search-form { display: flex; max-width: 520px; margin: 0 auto; }
.p8-search-form__input { flex: 1; border: 1.5px solid var(--p8-border); border-right: none; border-radius: 8px 0 0 8px; padding: 11px 16px; font-size: 14px; background: #fff; }
.p8-search-form__input:focus { outline: none; border-color: var(--p8-primary); }
.p8-search-form__btn { background: var(--p8-primary); color: #fff; border: none; padding: 0 18px; border-radius: 0 8px 8px 0; }

/* Mobile drawer nav (reuses .p8-nav__list via JS toggling a class on <body>) */
@media (max-width: 899px) {
	.p8-nav {
		display: block; position: fixed; inset: 0 0 0 auto; width: 78%; max-width: 320px;
		background: var(--p8-surface); transform: translateX(100%); transition: transform var(--p8-transition);
		z-index: 90; padding: 90px 24px 24px; overflow-y: auto; box-shadow: -8px 0 30px rgba(0,0,0,.15);
	}
	body.p8-menu-open .p8-nav { transform: translateX(0); }
	.p8-nav__list { flex-direction: column; gap: 4px; }
	.p8-nav__list a { display: block; padding: 12px 0; border-bottom: 1px solid var(--p8-border); }
}
@media (min-width: 900px) {
	.p8-nav { display: block; }
	.p8-hamburger { display: none; }
}

/* Backdrop for mobile menu */
.p8-nav-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 80; opacity: 0; pointer-events: none; transition: opacity var(--p8-transition); }
body.p8-menu-open .p8-nav-backdrop { opacity: 1; pointer-events: auto; }

/* ---------- Category bar ---------- */
.p8-catbar { background: var(--p8-dark); }
.p8-catbar__scroll { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; padding: 0 20px; }
.p8-catbar__scroll::-webkit-scrollbar { display: none; }
.p8-catbar__item {
	flex: 0 0 auto; padding: 11px 14px; font-size: 13.5px; font-weight: 600;
	color: rgba(255,255,255,.7); border-bottom: 2px solid transparent; white-space: nowrap;
	transition: color var(--p8-transition), border-color var(--p8-transition);
}
.p8-catbar__item:hover, .p8-catbar__item.is-active { color: #fff; border-color: var(--p8-accent); }

/* =========================================================================
   BREAKING NEWS TICKER
   ========================================================================= */
.p8-breaking { background: #fff; border-bottom: 1px solid var(--p8-border); }
.p8-breaking__inner { display: flex; align-items: stretch; padding: 0; }
.p8-breaking__label {
	flex: 0 0 auto; display: flex; align-items: center; gap: 6px; background: var(--p8-primary);
	color: #fff; font-weight: 800; font-size: 12.5px; text-transform: uppercase; letter-spacing: .03em;
	padding: 10px 16px; clip-path: polygon(0 0, 100% 0, 88% 100%, 0% 100%);
	padding-right: 26px; margin-right: -10px;
}
.p8-breaking__label svg { color: var(--p8-accent); animation: p8-pulse 1.4s infinite; }
@keyframes p8-pulse { 0%,100% { opacity: 1; } 50% { opacity: .3; } }

.p8-breaking__track-wrap { flex: 1; overflow: hidden; position: relative; padding: 10px 0; }
.p8-breaking__track { display: flex; gap: 48px; white-space: nowrap; width: max-content; animation: p8-marquee 28s linear infinite; padding-left: 20px; }
.p8-breaking__track-wrap:hover .p8-breaking__track,
.p8-breaking__track.is-paused { animation-play-state: paused; }
.p8-breaking__track li a { font-size: 14px; font-weight: 600; }
.p8-breaking__track li a:hover { color: var(--p8-primary); }
@keyframes p8-marquee { from { transform: translateX(0); } to { transform: translateX(-50%); } }

/* =========================================================================
   SECTION HEAD
   ========================================================================= */
.p8-section-head { display: flex; align-items: center; justify-content: space-between; margin: 34px 0 18px; }
.p8-section-head--sidebar { margin-top: 0; }
.p8-section-title { font-size: 24px; font-weight: 900; position: relative; padding-left: 14px; }
.p8-section-title::before { content: ""; position: absolute; left: 0; top: 3px; bottom: 3px; width: 5px; background: var(--p8-primary); border-radius: 3px; }
.p8-section-title--sm { font-size: 18px; }

/* =========================================================================
   FEATURED NEWS (HERO GRID)
   ========================================================================= */
.p8-featured { padding-top: 8px; }
.p8-featured__grid { display: grid; grid-template-columns: 1fr; gap: 20px; }

.p8-hero-card { position: relative; border-radius: var(--p8-radius); overflow: hidden; background: var(--p8-surface); box-shadow: var(--p8-shadow); }
.p8-hero-card__media { position: relative; display: block; aspect-ratio: 16/10; overflow: hidden; }
.p8-hero-card__img { transition: transform .5s ease; }
.p8-hero-card:hover .p8-hero-card__img { transform: scale(1.06); }
.p8-hero-card__overlay { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0,0,0,0) 40%, rgba(0,0,0,.75) 100%); }
.p8-hero-card__body { padding: 18px; }
.p8-hero-card__title { font-size: 24px; margin: 6px 0 10px; }
.p8-hero-card__title a:hover { color: var(--p8-primary); }
.p8-hero-card__excerpt { color: var(--p8-text-soft); font-size: 14.5px; margin: 0 0 12px; }

.p8-featured__side { display: grid; grid-template-columns: 1fr; gap: 14px; }
.p8-side-card { display: flex; gap: 12px; background: var(--p8-surface); border-radius: var(--p8-radius); padding: 10px; box-shadow: var(--p8-shadow); transition: box-shadow var(--p8-transition), transform var(--p8-transition); }
.p8-side-card:hover { box-shadow: var(--p8-shadow-hover); transform: translateY(-2px); }
.p8-side-card__media { flex: 0 0 96px; width: 96px; height: 72px; border-radius: 6px; overflow: hidden; }
.p8-side-card__body { flex: 1; min-width: 0; }
.p8-side-card__title { font-size: 14.5px; margin: 4px 0 6px; }
.p8-side-card__title a:hover { color: var(--p8-primary); }

@media (min-width: 960px) {
	.p8-featured__grid { grid-template-columns: 1.4fr 1fr; align-items: stretch; }
	.p8-hero-card__body { position: absolute; left: 0; right: 0; bottom: 0; padding: 26px; color: #fff; }
	.p8-hero-card__body .p8-hero-card__excerpt { color: rgba(255,255,255,.85); }
	.p8-hero-card__body .p8-meta { color: rgba(255,255,255,.75); }
	.p8-hero-card__media { position: absolute; inset: 0; aspect-ratio: auto; }
	.p8-hero-card { min-height: 460px; }
	.p8-hero-card__title { font-size: 30px; }
}

/* =========================================================================
   LAYOUT: main + sidebar
   ========================================================================= */
.p8-layout { display: grid; grid-template-columns: 1fr; gap: 34px; padding-bottom: 50px; }
@media (min-width: 992px) {
	.p8-layout { grid-template-columns: 2.2fr 1fr; align-items: start; }
	.p8-layout__aside { position: sticky; top: 90px; }
}

/* =========================================================================
   CARD GRID (Latest news)
   ========================================================================= */
.p8-card-grid { display: grid; grid-template-columns: 1fr; gap: 20px; }
@media (min-width: 640px) { .p8-card-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 992px) { .p8-card-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1180px) and (max-width: 1400px) { .p8-card-grid { grid-template-columns: repeat(2, 1fr); } }

.p8-card { background: var(--p8-surface); border-radius: var(--p8-radius); overflow: hidden; box-shadow: var(--p8-shadow); transition: box-shadow var(--p8-transition), transform var(--p8-transition); display: flex; flex-direction: column; }
.p8-card:hover { box-shadow: var(--p8-shadow-hover); transform: translateY(-3px); }
.p8-card__media { display: block; aspect-ratio: 16/10; overflow: hidden; }
.p8-card__media .p8-img { transition: transform .45s ease; }
.p8-card:hover .p8-card__media .p8-img { transform: scale(1.07); }
.p8-card__body { padding: 16px; flex: 1; display: flex; flex-direction: column; }
.p8-card__title { font-size: 17px; margin: 4px 0 8px; }
.p8-card__title a:hover { color: var(--p8-primary); }
.p8-card__excerpt { font-size: 13.5px; color: var(--p8-text-soft); margin: 0 0 12px; flex: 1; }

.p8-loadmore-wrap { display: flex; flex-direction: column; align-items: center; gap: 14px; margin-top: 32px; }
.p8-loading-spinner { width: 22px; height: 22px; border-radius: 50%; border: 3px solid var(--p8-border); border-top-color: var(--p8-primary); animation: p8-spin .7s linear infinite; }
@keyframes p8-spin { to { transform: rotate(360deg); } }

.p8-pagination { display: flex; gap: 8px; justify-content: center; margin-top: 30px; }
.p8-pagination .page-numbers { display: inline-flex; align-items: center; justify-content: center; min-width: 38px; height: 38px; border-radius: 8px; background: var(--p8-surface); box-shadow: var(--p8-shadow); font-weight: 600; font-size: 13px; }
.p8-pagination .page-numbers.current { background: var(--p8-primary); color: #fff; }

/* =========================================================================
   SIDEBAR: Popular + Categories
   ========================================================================= */
.p8-sidebar__block { background: var(--p8-surface); border-radius: var(--p8-radius); padding: 18px; box-shadow: var(--p8-shadow); margin-bottom: 22px; }

.p8-popular__list { display: flex; flex-direction: column; gap: 14px; }
.p8-popular__item { display: flex; align-items: center; gap: 12px; }
.p8-popular__rank { font-family: var(--p8-font-head); font-size: 22px; font-weight: 900; color: var(--p8-border); flex: 0 0 30px; }
.p8-popular__thumb { flex: 0 0 64px; width: 64px; height: 56px; border-radius: 6px; overflow: hidden; }
.p8-popular__body { min-width: 0; }
.p8-popular__title { font-size: 13.5px; margin: 0 0 4px; line-height: 1.35; }
.p8-popular__title a:hover { color: var(--p8-primary); }

.p8-cat-widget__list a { display: flex; justify-content: space-between; padding: 9px 0; border-bottom: 1px solid var(--p8-border); font-weight: 600; font-size: 13.5px; }
.p8-cat-widget__list li:last-child a { border-bottom: none; }
.p8-cat-widget__list a:hover { color: var(--p8-primary); }
.p8-cat-widget__count { color: var(--p8-text-soft); font-weight: 400; }

.p8-widget__title { font-size: 15px; margin-bottom: 10px; }

/* =========================================================================
   SINGLE POST
   ========================================================================= */
.p8-single__title { font-size: 30px; margin: 10px 0 14px; }
.p8-single__thumb { border-radius: var(--p8-radius); overflow: hidden; margin: 18px 0; aspect-ratio: 16/9; box-shadow: var(--p8-shadow); }
.p8-single__thumb figcaption { font-size: 12.5px; color: var(--p8-text-soft); padding: 8px 0; }
.p8-single__content { font-size: 16.5px; line-height: 1.85; }
.p8-single__content p { margin: 0 0 20px; }
.p8-single__content img { border-radius: 8px; margin: 12px 0; }
.p8-single__content h2, .p8-single__content h3 { margin: 30px 0 14px; }
.p8-single__content blockquote { margin: 20px 0; padding: 14px 20px; border-left: 4px solid var(--p8-primary); background: var(--p8-surface); font-style: italic; color: var(--p8-text-soft); }
.p8-single__tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 24px; }
.p8-related { margin-top: 40px; }

.p8-page-wrap { max-width: 820px; margin: 30px auto 60px; }

.p8-404 { text-align: center; padding: 80px 0; }
.p8-404__code { font-size: 90px; color: var(--p8-primary); margin-bottom: 10px; }
.p8-404__search { max-width: 420px; margin: 24px auto 0; }

/* =========================================================================
   FOOTER
   ========================================================================= */
.p8-footer { background: var(--p8-dark); color: rgba(255,255,255,.72); margin-top: 40px; }
.p8-footer__grid { display: grid; grid-template-columns: 1fr; gap: 30px; padding: 50px 20px 30px; }
.p8-footer__about p { font-size: 14px; margin-top: 10px; line-height: 1.6; }
.p8-footer__title { color: #fff; font-size: 15px; margin-bottom: 14px; }
.p8-footer__col ul { display: flex; flex-direction: column; gap: 9px; }
.p8-footer__col a { font-size: 14px; transition: color var(--p8-transition); }
.p8-footer__col a:hover { color: var(--p8-accent); }
.p8-footer__bottom { border-top: 1px solid rgba(255,255,255,.1); }
.p8-footer__bottom-inner { display: flex; flex-direction: column; gap: 6px; padding: 18px 20px; font-size: 12.5px; }
@media (min-width: 640px) { .p8-footer__grid { grid-template-columns: repeat(2, 1fr); } .p8-footer__bottom-inner { flex-direction: row; justify-content: space-between; } }
@media (min-width: 992px) { .p8-footer__grid { grid-template-columns: 1.4fr 1fr 1fr 1fr; } }

/* =========================================================================
   BACK TO TOP
   ========================================================================= */
.p8-back-to-top {
	position: fixed; right: 20px; bottom: 20px; width: 44px; height: 44px; border-radius: 50%;
	background: var(--p8-primary); color: #fff; border: none; display: flex; align-items: center;
	justify-content: center; box-shadow: var(--p8-shadow-hover); opacity: 0; transform: translateY(10px);
	pointer-events: none; transition: opacity var(--p8-transition), transform var(--p8-transition);
	z-index: 70;
}
.p8-back-to-top.is-visible { opacity: 1; transform: translateY(0); pointer-events: auto; }

/* =========================================================================
   Accessibility: reduced motion
   ========================================================================= */
@media (prefers-reduced-motion: reduce) {
	.p8-breaking__track { animation: none; }
	html { scroll-behavior: auto; }
	* { transition: none !important; animation: none !important; }
}

/* =========================================================================
   COMMENTS
   ========================================================================= */
.p8-comments { margin-top: 40px; }
.p8-comment-list { margin-top: 20px; }
.p8-comment-list .comment-body { background: var(--p8-surface); border-radius: var(--p8-radius); padding: 16px; box-shadow: var(--p8-shadow); margin-bottom: 14px; }
.p8-comment-list .comment-author { font-weight: 700; font-size: 14px; }
.p8-comment-list .comment-metadata { font-size: 12px; color: var(--p8-text-soft); margin-bottom: 8px; }
.p8-comment-list ol.children { list-style: none; margin-left: 30px; padding: 0; }
.comment-respond { background: var(--p8-surface); border-radius: var(--p8-radius); padding: 20px; box-shadow: var(--p8-shadow); margin-top: 20px; }
.comment-respond input[type="text"], .comment-respond input[type="email"], .comment-respond input[type="url"], .comment-respond textarea {
	width: 100%; padding: 10px 12px; border: 1.5px solid var(--p8-border); border-radius: 8px; margin-bottom: 12px; font-family: inherit; font-size: 14px;
}
.comment-respond textarea { min-height: 110px; }
.comment-respond label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; }
