/* OC Text Widgets — shared styles for all text-only widgets.
   Falls back to sensible values on any theme; picks up Foxiz's own
   design tokens (--h3-family, --meta-family, --excerpt-color, --g-color,
   --effect, --round-5) automatically when Foxiz is active, so widgets
   inherit the site's typography and per-category colors for free. */

.octw-empty {
	opacity: 0.7;
}

.octw-meta {
	font-family: var(--meta-family, inherit);
	font-size: 0.85em;
	opacity: 0.75;
	margin: 0.25em 0;
}

.octw-meta .octw-sep {
	margin: 0 0.5em;
}

.octw-excerpt {
	margin: 0.35em 0 0;
	line-height: 1.5;
	color: var(--excerpt-color, inherit);
}

.octw-readtime {
	white-space: nowrap;
}

/* Status badges: "New", "Pinned", editor-picked highlight */
.octw-badges {
	display: flex;
	gap: 0.4em;
	margin-bottom: 0.4em;
}

.octw-badge {
	display: inline-flex;
	align-items: center;
	padding: 0.2em 0.65em;
	border-radius: var(--round-5, 5px);
	font-family: var(--meta-family, inherit);
	font-size: 0.72em;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.03em;
	line-height: 1.6;
	white-space: nowrap;
}

.octw-badge--new {
	background: var(--g-color, #ff184e);
	color: var(--awhite, #fff);
}

.octw-badge--pinned {
	background: var(--flex-gray-15, rgba(128, 128, 128, 0.2));
	color: inherit;
}

.octw-badge--pick {
	background: transparent;
	border: 1px solid var(--g-color, currentColor);
	color: var(--g-color, currentColor);
}

/* Post List */
.octw-post-list {
	list-style: none;
	margin: 0;
	padding: 0;
}

.octw-post-list-item {
	padding: 1em 0;
	border-top: 1px solid transparent;
}

.octw-post-list-item:first-child {
	border-top: none;
}

.octw-item-title {
	margin: 0;
	font-family: var(--h3-family, inherit);
	font-size: 1.1em;
	line-height: 1.35;
}

.octw-item-title a {
	color: inherit;
	text-decoration: none;
	transition: var(--effect, color 0.2s ease);
}

.octw-item-title a:hover {
	color: var(--g-color, currentColor);
}

/* Post Carousel */
.octw-carousel {
	position: relative;
	overflow: hidden;
}

.octw-carousel-track {
	display: flex;
	transition: transform 0.6s ease;
}

.octw-carousel-slide {
	flex: 0 0 100%;
	max-width: 100%;
	box-sizing: border-box;
	padding: 0 1em;
}

.octw-carousel-title {
	margin: 0;
	font-family: var(--h2-family, inherit);
	font-size: 1.4em;
	line-height: 1.3;
}

.octw-carousel-title a {
	color: inherit;
	text-decoration: none;
	transition: var(--effect, color 0.2s ease);
}

.octw-carousel-title a:hover {
	color: var(--g-color, currentColor);
}

.octw-carousel-dots {
	display: flex;
	justify-content: center;
	gap: 0.5em;
	margin-top: 1em;
}

.octw-carousel-dots span {
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: currentColor;
	opacity: 0.3;
	cursor: pointer;
	transition: var(--effect, opacity 0.2s ease);
}

.octw-carousel-dots span.is-active {
	opacity: 1;
	background: var(--g-color, currentColor);
}

/* Post Timeline */
.octw-timeline {
	--octw-line-color: currentColor;
	--octw-marker-color: var(--g-color, currentColor);
	position: relative;
	padding-left: 1.5em;
}

.octw-timeline::before {
	content: '';
	position: absolute;
	left: 5px;
	top: 0;
	bottom: 0;
	width: 2px;
	background: var(--octw-line-color);
	opacity: 0.25;
}

.octw-timeline-item {
	position: relative;
	padding-bottom: 1.75em;
}

.octw-timeline-item:last-child {
	padding-bottom: 0;
}

.octw-timeline-marker {
	position: absolute;
	left: -1.5em;
	top: 0.35em;
	width: 12px;
	height: 12px;
	border-radius: 50%;
	background: var(--octw-marker-color);
}

.octw-timeline-date {
	display: block;
	font-size: 0.8em;
	opacity: 0.65;
	margin-bottom: 0.2em;
}

.octw-timeline-title {
	margin: 0 0 0.2em;
	font-family: var(--h3-family, inherit);
}

.octw-timeline-title a {
	color: inherit;
	text-decoration: none;
	transition: var(--effect, color 0.2s ease);
}

.octw-timeline-title a:hover {
	color: var(--g-color, currentColor);
}

.octw-timeline-scroll {
	overflow-y: auto;
	padding-right: 0.75em;
	scrollbar-width: thin;
	scrollbar-color: var(--g-color, currentColor) transparent;
}

.octw-timeline-scroll::-webkit-scrollbar {
	width: 6px;
}

.octw-timeline-scroll::-webkit-scrollbar-track {
	background: transparent;
}

.octw-timeline-scroll::-webkit-scrollbar-thumb {
	background: var(--g-color, currentColor);
	border-radius: 999px;
	opacity: 0.6;
}

/* Related Posts */
.octw-related-heading {
	margin: 0 0 0.75em;
}

/* Popular Posts */
.octw-popular-posts {
	list-style: none;
	margin: 0;
	padding: 0;
	counter-reset: none;
}

.octw-popular-posts .octw-post-list-item {
	display: flex;
	align-items: flex-start;
	gap: 0.75em;
}

.octw-rank-number {
	font-family: var(--h2-family, inherit);
	font-size: 1.6em;
	font-weight: 700;
	line-height: 1;
	color: var(--g-color, currentColor);
	opacity: 0.6;
	min-width: 1.2em;
}

.octw-rank-content {
	flex: 1;
}

/* News Ticker */
.octw-ticker {
	display: flex;
	align-items: center;
	overflow: hidden;
}

.octw-ticker-label {
	flex: 0 0 auto;
	padding: 0.4em 0.9em;
	border-radius: var(--round-5, 5px);
	background: var(--g-color, #ff184e);
	color: var(--awhite, #fff);
	font-family: var(--meta-family, inherit);
	font-weight: 700;
	text-transform: uppercase;
	font-size: 0.85em;
	white-space: nowrap;
}

.octw-ticker-viewport {
	overflow: hidden;
	flex: 1;
}

.octw-ticker-track {
	display: inline-flex;
	white-space: nowrap;
	animation-name: octw-ticker-scroll;
	animation-timing-function: linear;
	animation-iteration-count: infinite;
	will-change: transform;
}

.octw-ticker:hover .octw-ticker-track {
	animation-play-state: paused;
}

.octw-ticker-item a {
	color: inherit;
	text-decoration: none;
	padding: 0 0.5em;
	font-family: var(--meta-family, inherit);
}

.octw-ticker-item a:hover {
	color: var(--g-color, currentColor);
}

.octw-ticker-separator {
	opacity: 0.5;
}

@keyframes octw-ticker-scroll {
	from {
		transform: translateX(0);
	}
	to {
		transform: translateX(-50%);
	}
}

@media (prefers-reduced-motion: reduce) {
	.octw-ticker-track {
		animation: none;
	}
}

/* Category Pulse */
.octw-pulse-label {
	display: block;
	font-family: var(--meta-family, inherit);
	font-size: 0.78em;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	color: var(--meta-fcolor, inherit);
	opacity: 0.75;
	margin-bottom: 0.6em;
}

.octw-pulse-row {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5em;
}

.octw-pulse-pill {
	display: inline-flex;
	align-items: center;
	gap: 0.45em;
	padding: 0.35em 0.75em;
	border-radius: 999px;
	border: 1px solid var(--flex-gray-15, rgba(128, 128, 128, 0.2));
	font-family: var(--meta-family, inherit);
	font-size: 0.85em;
	font-weight: 600;
	text-decoration: none;
	color: var(--g-color, currentColor);
	transition: var(--effect, border-color 0.2s ease, background-color 0.2s ease);
}

.octw-pulse-pill:hover {
	border-color: var(--g-color, currentColor);
	background: var(--g-color, currentColor);
	color: var(--awhite, #fff);
}

.octw-pulse-pill:hover .octw-pulse-count {
	color: inherit;
	opacity: 0.85;
}

.octw-pulse-count {
	font-size: 0.85em;
	opacity: 0.55;
	color: inherit;
}

/* Digest */
.octw-digest {
	display: flex;
	flex-direction: column;
	gap: 1.6em;
}

.octw-digest-section-head {
	display: flex;
	align-items: center;
	gap: 0.75em;
	margin-bottom: 0.7em;
}

.octw-digest-section-label {
	font-family: var(--h4-family, inherit);
	font-weight: 700;
	font-size: 0.95em;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	color: var(--g-color, currentColor);
	white-space: nowrap;
}

.octw-digest-section-head::after {
	content: '';
	flex: 1;
	height: 1px;
	background: var(--flex-gray-15, rgba(128, 128, 128, 0.2));
}

.octw-digest-list {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 0.55em;
}

.octw-digest-item-title {
	margin: 0;
	font-family: var(--h3-family, inherit);
	font-size: 1em;
	line-height: 1.35;
}

.octw-digest-item-title a {
	color: inherit;
	text-decoration: none;
}

.octw-digest-item-title a:hover {
	color: var(--g-color, currentColor);
}

/* Post Grid */
.octw-post-grid {
	display: grid;
	gap: 1.5em;
}

.octw-grid-title {
	margin: 0;
	font-family: var(--h3-family, inherit);
	font-size: 1.15em;
	line-height: 1.3;
}

.octw-grid-title a {
	color: inherit;
	text-decoration: none;
	transition: var(--effect, color 0.2s ease);
}

.octw-grid-title a:hover {
	color: var(--g-color, currentColor);
}

.octw-grid-item--lead {
	grid-column: 1 / -1;
}

.octw-grid-item--lead .octw-grid-title {
	font-family: var(--h1-family, inherit);
	font-size: 1.9em;
	line-height: 1.2;
}

/* Departure Board */
.octw-board {
	font-family: var(--meta-family, inherit);
	border: 1px solid var(--flex-gray-15, rgba(128, 128, 128, 0.2));
	border-radius: var(--round-7, 7px);
	overflow: hidden;
}

.octw-board-heading {
	padding: 0.7em 1em;
	font-family: var(--h3-family, inherit);
	font-weight: 700;
	font-size: 0.95em;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	background: var(--flex-gray-15, rgba(128, 128, 128, 0.08));
}

.octw-board-head {
	display: flex;
	padding: 0.5em 1em;
	font-size: 0.7em;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.06em;
	opacity: 0.5;
	border-bottom: 1px solid var(--flex-gray-15, rgba(128, 128, 128, 0.2));
}

.octw-board-row {
	display: flex;
	align-items: baseline;
	padding: 0.6em 1em;
	text-decoration: none;
	color: inherit;
	border-bottom: 1px solid var(--flex-gray-15, rgba(128, 128, 128, 0.12));
	animation: octw-board-flip-in 0.5s ease backwards;
	animation-delay: var(--octw-row-delay, 0s);
}

.octw-board-row:last-child {
	border-bottom: none;
}

.octw-board-row:hover {
	background: var(--flex-gray-15, rgba(128, 128, 128, 0.06));
}

.octw-board-col--time {
	flex: 0 0 4.5em;
	font-variant-numeric: tabular-nums;
	font-weight: 700;
	color: var(--g-color, currentColor);
}

.octw-board-col--code {
	flex: 0 0 4em;
	display: flex;
	gap: 0.15em;
	font-weight: 700;
	letter-spacing: 0.05em;
}

.octw-flap {
	display: inline-block;
	min-width: 1em;
	text-align: center;
	background: var(--flex-gray-15, rgba(128, 128, 128, 0.12));
	border-radius: 2px;
	padding: 0 0.15em;
}

.octw-board-col--title {
	flex: 1;
	font-family: var(--h3-family, inherit);
	font-weight: 600;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

@keyframes octw-board-flip-in {
	from {
		opacity: 0;
		transform: rotateX(-90deg);
		transform-origin: top;
	}
	to {
		opacity: 1;
		transform: rotateX(0deg);
	}
}

@media (prefers-reduced-motion: reduce) {
	.octw-board-row {
		animation: none;
	}
}

/* On Air */
.octw-onair {
	display: flex;
	flex-direction: column;
	gap: 0.5em;
	font-family: var(--meta-family, inherit);
}

.octw-onair-row {
	display: flex;
	align-items: center;
	gap: 0.75em;
	padding: 0.7em 1em;
	border-radius: var(--round-7, 7px);
	text-decoration: none;
	color: inherit;
}

.octw-onair-row--live {
	background: var(--flex-gray-15, rgba(128, 128, 128, 0.06));
	border: 1px solid var(--flex-gray-15, rgba(128, 128, 128, 0.2));
}

.octw-onair-tag {
	flex: 0 0 auto;
	padding: 0.25em 0.7em;
	border-radius: 999px;
	font-size: 0.72em;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	white-space: nowrap;
}

.octw-onair-tag--live {
	background: var(--g-color, #ff184e);
	color: var(--awhite, #fff);
	animation: octw-onair-pulse 2s ease-in-out infinite;
}

.octw-onair-tag--next {
	background: transparent;
	border: 1px solid var(--flex-gray-15, rgba(128, 128, 128, 0.3));
	color: var(--meta-fcolor, inherit);
}

.octw-onair-title {
	flex: 1;
	font-family: var(--h3-family, inherit);
	font-weight: 600;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.octw-onair-title--muted {
	opacity: 0.6;
	font-weight: 500;
}

.octw-onair-time {
	flex: 0 0 auto;
	font-size: 0.8em;
	font-variant-numeric: tabular-nums;
	opacity: 0.6;
	white-space: nowrap;
}

@keyframes octw-onair-pulse {
	0%, 100% {
		opacity: 1;
	}
	50% {
		opacity: 0.6;
	}
}

@media (prefers-reduced-motion: reduce) {
	.octw-onair-tag--live {
		animation: none;
	}
}

/* ── Category Ranking Widget (ocr-*) — integrado ao Foxiz ─────────────── */
/*
 * Usa variáveis reais do Foxiz: --g-color, --body-fcolor, --dwidgets-*, 
 * --flex-gray-15, --dark-accent, --awhite, --cat-highlight, --effect.
 * Cores de categoria via .term-i-{id} → --cat-highlight (injetado pelo
 * Foxiz dynamic-css.php por categoria configurada no painel do tema).
 * O widget-heading é gerado pelo PHP; este CSS cobre apenas o corpo.
 */

/* ── Layout: list ── */
.ocr-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.ocr-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.ocr-item + .ocr-item {
    margin-top: 10px;
}

.ocr-item-body {
    flex: 1;
    min-width: 0;
}

/* Link idêntico ao .cat-item a do Foxiz sidebar */
.ocr-cat-link {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    padding-top: var(--sidebar-menu-spacing, 5px);
    padding-bottom: var(--sidebar-menu-spacing, 5px);
    color: inherit;
    font-family: var(--dwidgets-family, inherit);
    font-size: var(--dwidgets-fsize, 13px);
    font-weight: var(--dwidgets-fweight, 600);
    font-style: var(--dwidgets-fstyle, normal);
    letter-spacing: var(--dwidgets-fspace, 0);
    text-transform: var(--dwidgets-transform, none);
    text-decoration: none;
    transition: var(--effect, all 0.2s ease);
    border-bottom: 1px solid var(--flex-gray-15, #88888826);
}

.ocr-item:last-child .ocr-cat-link {
    border-bottom: none;
}

.ocr-cat-link:hover {
    color: var(--cat-highlight, var(--g-color, #ff184e));
}

.ocr-cat-link:hover .ocr-count {
    background-color: var(--cat-highlight, var(--g-color, #ff184e));
}

.ocr-cat-name {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 7px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Dot colorido — usa a mesma --cat-highlight da categoria Foxiz */
.ocr-cat-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
    background: var(--cat-highlight, var(--g-color, #ff184e));
}

/* Badge de contagem — idêntico ao .count do Foxiz */
.ocr-count {
    min-width: 18px;
    padding: 0 4px;
    border-radius: var(--round-3, 3px);
    background-color: var(--dark-accent, #191c20);
    color: var(--awhite, #fff);
    font-size: 0.8rem;
    line-height: 18px;
    text-align: center;
    transition: var(--effect, all 0.2s ease);
    flex-shrink: 0;
    font-weight: 600;
}

/* Barra de progresso — fill usa --cat-highlight da categoria */
.ocr-bar {
    width: 100%;
    height: 3px;
    background: var(--flex-gray-15, #88888826);
    border-radius: 2px;
    margin-top: 3px;
    overflow: hidden;
}

.ocr-bar-fill {
    height: 100%;
    border-radius: 2px;
    background: var(--cat-highlight, var(--g-color, #ff184e));
    transition: width 0.4s ease;
}

/* ── Layout: rank ── */
.ocr-layout--rank .ocr-item {
    align-items: center;
}

.ocr-rank {
    flex-shrink: 0;
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
    border-radius: 50%;
    background: var(--dark-accent, #191c20);
    color: var(--awhite, #fff);
    line-height: 1;
    font-family: var(--dwidgets-family, inherit);
}

.ocr-layout--rank .ocr-item:nth-child(1) .ocr-rank { background: #c9a227; color: #fff; }
.ocr-layout--rank .ocr-item:nth-child(2) .ocr-rank { background: #8c8c8c; color: #fff; }
.ocr-layout--rank .ocr-item:nth-child(3) .ocr-rank { background: #8b5a2b; color: #fff; }

/* ── Layout: pills ── */
.ocr-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
}

/* Pill usa .ecat-bg-3 do Foxiz — rounded, fundo = --cat-highlight */
.ocr-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 0.7em 1.5em;
    border-radius: 100px;
    text-decoration: none;
    font-family: var(--dwidgets-family, inherit);
    font-size: var(--cat-fsize, 10px);
    font-weight: var(--cat-fweight, 700);
    letter-spacing: var(--cat-fspace, 0.07em);
    text-transform: var(--cat-transform, uppercase);
    color: var(--cat-fcolor, var(--awhite, #fff));
    background: var(--cat-highlight, var(--g-color, #ff184e));
    transition: var(--effect, all 0.2s ease);
    line-height: 1;
}

.ocr-pill:hover {
    opacity: 0.85;
}

.ocr-pill-count {
    font-size: 0.85em;
    font-weight: 400;
    opacity: 0.85;
}

/* Dark mode — Foxiz usa [data-theme="dark"] no body */
[data-theme="dark"] .ocr-bar,
.light-scheme .ocr-bar {
    background: var(--flex-gray-15, #88888840);
}

/* ── Variantes "Foxiz Native" — News Ticker / Post Carousel / Digest ─── */
/* A maior parte do visual vem do main.css do próprio Foxiz (classes
   breaking-news-*, post-carousel/swiper-*, tax-accordion-*, reaproveitadas
   diretamente). Aqui só o necessário pro conteúdo de texto do OCTW dentro
   desses wrappers nativos ficar legível/consistente com o resto do plugin. */

.octw-ticker--foxiz .breaking-news-title a,
.octw-ticker--foxiz .breaking-news-title {
    font-family: var(--dwidgets-family, inherit);
}

.octw-carousel--foxiz .octw-carousel-slide {
    padding: 12px;
}

.octw-digest--accordion .tax-accordion-trigger {
    font-family: var(--h4-family, inherit);
    font-weight: 700;
    cursor: pointer;
}

.octw-digest--accordion .octw-digest-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

/* ── Site Group Bar (footer) ──────────────────────────────────────── */
.octw-site-group--bar {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 6px;
    font-size: 0.85rem;
    font-family: var(--dwidgets-family, inherit);
}

.octw-sg-label {
    opacity: 0.65;
}

.octw-sg-list {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 6px;
}

.octw-sg-list a {
    color: inherit;
    text-decoration: none;
    font-weight: 600;
}

.octw-sg-list a:hover {
    text-decoration: underline;
}

.octw-sg-current {
    font-weight: 600;
    opacity: 0.85;
}

.octw-sg-sep {
    opacity: 0.4;
}

/* ── Site Group Grid (hub page) ───────────────────────────────────── */
.octw-sg-grid {
    display: grid;
    grid-template-columns: repeat(var(--octw-sg-cols, 3), 1fr);
    gap: 20px;
}

@media (max-width: 767px) {
    .octw-sg-grid {
        grid-template-columns: 1fr;
    }
}

.octw-sg-card {
    padding: 20px;
    border: 1px solid var(--flex-gray-15, #88888826);
    border-radius: var(--round-7, 8px);
    transition: var(--effect, all 0.2s ease);
}

.octw-sg-card:hover {
    box-shadow: 0 4px 16px var(--shadow-12, #0000001f);
}

.octw-sg-card--current {
    border-color: var(--g-color, #ff184e);
}

.octw-sg-card-title {
    margin: 0 0 8px;
    font-size: 1.1rem;
}

.octw-sg-card-title a {
    color: inherit;
    text-decoration: none;
}

.octw-sg-card-title a:hover {
    color: var(--g-color, #ff184e);
}

.octw-sg-card-desc {
    margin: 0 0 12px;
    font-size: 0.9rem;
    opacity: 0.75;
    line-height: 1.5;
}

.octw-sg-card-visit {
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--g-color, #ff184e);
    text-decoration: none;
}

.octw-sg-card-visit:hover {
    text-decoration: underline;
}

.octw-sg-card-badge {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 3px 10px;
    border-radius: 100px;
    background: var(--g-color, #ff184e);
    color: #fff;
}
