/*
Theme Name: Flavor
Theme URI: https://analyticstutor.com
Author: AnalyticsTutor
Author URI: https://analyticstutor.com
Description: A modern, minimal WordPress theme inspired by shadcn/ui design system. Built for content-focused sites with clean typography, dark mode support, and responsive layouts.
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.8
Requires PHP: 8.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: flavor
*/

/* ==========================================================================
   Base Reset / Normalization
   ========================================================================== */

*,
*::before,
*::after {
	box-sizing: border-box;
}

body {
	margin: 0;
	font-family: var(--font-sans);
	background-color: hsl(var(--background));
	color: hsl(var(--foreground));
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
	line-height: 1.5;
}

img {
	max-width: 100%;
	height: auto;
	display: block;
}

a {
	color: inherit;
	text-decoration: none;
}

/* ==========================================================================
   Container
   ========================================================================== */

.container {
	max-width: 1200px;
	margin-left: auto;
	margin-right: auto;
	padding-left: 1rem;
	padding-right: 1rem;
}

@media (min-width: 768px) {
	.container {
		padding-left: 1.5rem;
		padding-right: 1.5rem;
	}
}

/* ==========================================================================
   Site Header
   ========================================================================== */

.site-header {
	position: sticky;
	top: 0;
	z-index: 40;
	background-color: hsl(var(--background) / 0.8);
	border-bottom: 1px solid hsl(var(--border));
	height: 64px;
	backdrop-filter: blur(8px);
	-webkit-backdrop-filter: blur(8px);
}

.site-header .container {
	display: flex;
	align-items: center;
	justify-content: space-between;
	height: 100%;
}

.site-logo img {
	height: 36px;
	width: auto;
}

.header-actions {
	display: flex;
	gap: 0.5rem;
}

.main-nav ul {
	display: flex;
	gap: 0.25rem;
	list-style: none;
	margin: 0;
	padding: 0;
}

/* Icon toggle states */
.icon-close {
	display: none;
}

.mobile-nav-open .icon-menu {
	display: none;
}

.mobile-nav-open .icon-close {
	display: block;
}

/* Badge count spacing */
.badge__count {
	margin-left: 0.25rem;
	opacity: 0.7;
}

@media (max-width: 767px) {
	.main-nav {
		display: none;
	}

	.mobile-nav-toggle {
		display: flex;
	}
}

@media (min-width: 768px) {
	.mobile-nav-toggle {
		display: none;
	}
}

/* ==========================================================================
   Mobile Navigation
   ========================================================================== */

.mobile-nav {
	position: fixed;
	top: 0;
	right: 0;
	bottom: 0;
	left: 0;
	z-index: 50;
	background-color: hsl(var(--background));
	transform: translateX(100%);
	transition: transform 0.3s ease;
	padding: 2rem;
	overflow-y: auto;
}

.mobile-nav-open .mobile-nav {
	transform: translateX(0);
}

.mobile-nav ul {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
}

.mobile-nav a {
	display: block;
	padding: 0.75rem 0;
	font-size: 1.125rem;
	font-weight: 500;
	border-bottom: 1px solid hsl(var(--border));
}

/* ==========================================================================
   Hero Section
   ========================================================================== */

.hero {
	background-color: hsl(var(--muted));
	padding: 5rem 0;
}

@media (min-width: 1024px) {
	.hero {
		padding: 6rem 0 5rem;
	}
}

.hero h1 {
	font-size: 2.5rem;
	font-weight: 700;
	letter-spacing: -0.025em;
	line-height: 1.1;
	max-width: 720px;
	margin: 0;
}

.hero-tagline {
	font-size: 1.25rem;
	color: hsl(var(--muted-foreground));
	margin-top: 1rem;
	max-width: 600px;
}

@media (min-width: 1024px) {
	.hero {
		padding: 5rem 0 4rem;
	}

	.hero h1 {
		font-size: 3.5rem;
		letter-spacing: -0.03em;
	}
}

/* ==========================================================================
   Card Grid Layouts
   ========================================================================== */

.card-grid {
	display: grid;
	gap: 1.5rem;
}

.card-grid--3col {
	grid-template-columns: 1fr;
}

.card-grid--2col {
	grid-template-columns: 1fr;
}

@media (min-width: 640px) {
	.card-grid--3col {
		grid-template-columns: repeat(2, 1fr);
	}

	.card-grid--2col {
		grid-template-columns: repeat(2, 1fr);
	}
}

@media (min-width: 1024px) {
	.card-grid--3col {
		grid-template-columns: repeat(3, 1fr);
	}
}

/* ==========================================================================
   Single Article Layout
   Centered content column with optional TOC sidebar on the right.
   ========================================================================== */

.single-post {
	padding-top: 1.5rem;
}

.single-layout {
	display: block;
	max-width: 760px;
	margin-left: auto;
	margin-right: auto;
}

.single-content {
	min-width: 0;
}

.single-sidebar {
	display: none;
}

.toc-sidebar {
	position: sticky;
	top: 80px;
	max-height: calc(100vh - 100px);
	overflow-y: auto;
}

/* With TOC: content stays centered, TOC floats to the right outside the flow */
@media (min-width: 1100px) {
	.single-post > .container {
		overflow: visible;
	}

	.single-layout.has-toc {
		position: relative;
		display: block;
		max-width: 760px;
	}

	.single-layout.has-toc .single-sidebar {
		display: block;
		position: absolute;
		top: 0;
		left: calc(100% + 2.5rem);
		width: 220px;
	}
}

/* ==========================================================================
   Page Content
   ========================================================================== */

.page-content {
	max-width: 100%;
}

/* ==========================================================================
   Footer
   ========================================================================== */

.site-footer {
	background-color: hsl(var(--muted));
	border-top: 1px solid hsl(var(--border));
	padding: 5rem 0 2.5rem;
}

.footer-grid {
	display: grid;
	grid-template-columns: 1fr;
	gap: 2rem;
}

@media (min-width: 768px) {
	.footer-grid {
		gap: 3rem;
	}
}

@media (min-width: 768px) {
	.footer-grid {
		grid-template-columns: repeat(3, 1fr);
	}
}

.footer-col h4 {
	font-weight: 600;
	font-size: 0.875rem;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	margin-bottom: 0.75rem;
	margin-top: 0;
}

.footer-col ul {
	list-style: none;
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
	margin: 0;
	padding: 0;
}

.footer-col a {
	font-size: 0.875rem;
	color: hsl(var(--muted-foreground));
	transition: color 0.15s ease;
}

.footer-col a:hover {
	color: hsl(var(--foreground));
}

.footer-bar {
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding-top: 2rem;
	margin-top: 2rem;
	border-top: 1px solid hsl(var(--border));
	font-size: 0.875rem;
	color: hsl(var(--muted-foreground));
}

.footer-bar nav ul {
	display: flex;
	gap: 1rem;
	list-style: none;
	margin: 0;
	padding: 0;
}

/* ==========================================================================
   Category Pills
   ========================================================================== */

.category-pills {
	display: flex;
	gap: 0.5rem;
	overflow-x: auto;
	padding-top: 2.5rem;
	padding-bottom: 1rem;
	margin-bottom: 2.5rem;
}

.category-pills::-webkit-scrollbar {
	display: none;
}

.category-pill {
	white-space: nowrap;
	display: inline-flex;
	align-items: center;
	border-radius: var(--radius-full, 9999px);
	border: 1px solid hsl(var(--border));
	padding: 0.25rem 0.75rem;
	font-size: 0.75rem;
	font-weight: 500;
	color: hsl(var(--foreground));
	transition: background-color 0.15s ease, color 0.15s ease;
}

.category-pill:hover {
	background-color: hsl(var(--accent));
	color: hsl(var(--accent-foreground));
}

/* ==========================================================================
   Pagination
   ========================================================================== */

.pagination {
	display: flex;
	justify-content: center;
	gap: 0.25rem;
	margin-top: 3rem;
	margin-bottom: 4rem;
}

.pagination .page-numbers {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 2.25rem;
	height: 2.25rem;
	padding: 0 0.5rem;
	font-size: 0.875rem;
	font-weight: 500;
	border-radius: var(--radius);
	border: none;
	background: transparent;
	color: hsl(var(--foreground));
	cursor: pointer;
	transition: background-color 0.15s ease;
}

.pagination .page-numbers:hover {
	background-color: hsl(var(--accent));
	color: hsl(var(--accent-foreground));
}

.pagination .page-numbers.current {
	background-color: hsl(var(--primary));
	color: hsl(var(--primary-foreground));
}

.pagination .prev,
.pagination .next {
	border: 1px solid hsl(var(--border));
	background: hsl(var(--background));
}

.pagination .prev:hover,
.pagination .next:hover {
	background-color: hsl(var(--accent));
}

/* ==========================================================================
   Skip Link
   ========================================================================== */

.skip-link {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

.skip-link:focus {
	position: fixed;
	top: 0.5rem;
	left: 0.5rem;
	z-index: 100;
	width: auto;
	height: auto;
	padding: 0.75rem 1.5rem;
	margin: 0;
	overflow: visible;
	clip: auto;
	background-color: hsl(var(--background));
	color: hsl(var(--foreground));
	border: 2px solid hsl(var(--ring));
	border-radius: var(--radius);
	font-size: 0.875rem;
	font-weight: 600;
}

/* ==========================================================================
   Utility Classes
   ========================================================================== */

.sr-only {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

.text-sm {
	font-size: 0.875rem;
	line-height: 1.25rem;
}

.text-xs {
	font-size: 0.75rem;
	line-height: 1rem;
}

.text-lg {
	font-size: 1.125rem;
	line-height: 1.75rem;
}

.text-muted {
	color: hsl(var(--muted-foreground));
}

.mt-2 { margin-top: 0.5rem; }
.mt-4 { margin-top: 1rem; }
.mt-6 { margin-top: 1.5rem; }
.mt-8 { margin-top: 2rem; }

.mb-2 { margin-bottom: 0.5rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-6 { margin-bottom: 1.5rem; }
.mb-8 { margin-bottom: 2rem; }

/* ==========================================================================
   Author Box (Issue #3)
   ========================================================================== */

.author-box {
	display: flex;
	gap: 1.5rem;
	align-items: flex-start;
	background-color: hsl(var(--muted));
	border-radius: calc(var(--radius) * 2);
	padding: 1.5rem;
	margin-top: 2.5rem;
}

.author-box__avatar {
	flex-shrink: 0;
}

.author-box__avatar img {
	width: 80px;
	height: 80px;
	border-radius: 9999px;
	border: 2px solid hsl(var(--border));
	object-fit: cover;
}

.author-box__content {
	flex: 1;
	min-width: 0;
}

.author-box__label {
	font-size: 0.75rem;
	color: hsl(var(--muted-foreground));
	text-transform: uppercase;
	letter-spacing: 0.05em;
	font-weight: 500;
	margin: 0 0 0.125rem;
}

.author-box__name {
	font-size: 1.125rem;
	font-weight: 600;
	margin: 0 0 0.75rem;
	line-height: 1.3;
}

.author-box__name a {
	color: hsl(var(--foreground));
	text-decoration: none;
	transition: color 0.15s ease;
}

.author-box__name a:hover {
	color: hsl(var(--primary));
}

.author-box__credentials {
	display: flex;
	flex-wrap: wrap;
	gap: 0.375rem;
	margin-bottom: 0.75rem;
}

.author-box__credentials .badge {
	font-size: 0.6875rem;
}

.author-box__bio {
	font-size: 0.875rem;
	line-height: 1.6;
	color: hsl(var(--muted-foreground));
	margin: 0 0 1rem;
}

.author-box__links {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
}

@media (max-width: 639px) {
	.author-box {
		flex-direction: column;
		align-items: center;
		text-align: center;
	}

	.author-box__credentials {
		justify-content: center;
	}

	.author-box__links {
		justify-content: center;
	}
}

/* ==========================================================================
   Comment Form & Comment List (Issue #4)
   ========================================================================== */

.comments-area {
	margin-top: 3rem;
	padding-top: 2rem;
	border-top: 1px solid hsl(var(--border));
}

.comments-title,
.comment-reply-title {
	font-size: 1.5rem;
	font-weight: 600;
	margin-bottom: 1.5rem;
}

.comment-list {
	list-style: none;
	margin: 0;
	padding: 0;
}

.comment-list .comment {
	background-color: hsl(var(--card));
	border: 1px solid hsl(var(--border));
	border-radius: calc(var(--radius) * 1.4);
	padding: 1.25rem;
	margin-bottom: 1rem;
}

.comment-list .comment .children {
	list-style: none;
	margin: 1rem 0 0 1.5rem;
	padding: 0;
}

.comment-list .comment-author {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	font-weight: 600;
	font-size: 0.875rem;
	margin-bottom: 0.5rem;
}

.comment-list .comment-author img {
	border-radius: 9999px;
	width: 32px;
	height: 32px;
}

.comment-list .comment-meta {
	font-size: 0.75rem;
	color: hsl(var(--muted-foreground));
	margin-bottom: 0.75rem;
}

.comment-list .comment-content p {
	font-size: 0.875rem;
	line-height: 1.6;
}

.comment-list .reply a {
	font-size: 0.75rem;
	font-weight: 500;
	color: hsl(var(--primary));
	text-decoration: none;
	transition: color 0.15s ease;
}

.comment-list .reply a:hover {
	text-decoration: underline;
}

.comment-form label {
	display: block;
	font-size: 0.875rem;
	font-weight: 500;
	margin-bottom: 0.25rem;
	color: hsl(var(--foreground));
}

.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"] {
	display: flex;
	height: 2.25rem;
	width: 100%;
	border-radius: var(--radius);
	border: 1px solid hsl(var(--input));
	background-color: transparent;
	padding-left: 0.75rem;
	padding-right: 0.75rem;
	font-size: 0.875rem;
	line-height: 1.5;
	color: hsl(var(--foreground));
	font-family: var(--font-sans);
	transition: var(--transition-colors);
	margin-bottom: 1rem;
}

.comment-form input[type="text"]:focus,
.comment-form input[type="email"]:focus,
.comment-form input[type="url"]:focus,
.comment-form textarea:focus {
	outline: 2px solid hsl(var(--ring));
	outline-offset: 2px;
	border-color: transparent;
}

.comment-form textarea {
	display: block;
	width: 100%;
	min-height: 150px;
	border-radius: var(--radius);
	border: 1px solid hsl(var(--input));
	background-color: transparent;
	padding: 0.75rem;
	font-size: 0.875rem;
	line-height: 1.6;
	color: hsl(var(--foreground));
	font-family: var(--font-sans);
	transition: var(--transition-colors);
	resize: vertical;
	margin-bottom: 1rem;
}

.comment-form .form-submit {
	margin-top: 1rem;
}

/* ==========================================================================
   Entry Header / Breadcrumbs Spacing (Issue #6)
   ========================================================================== */

.breadcrumb {
	margin-bottom: 1rem;
}

.entry-header {
	margin-bottom: 2.5rem;
}

.entry-header__category {
	margin-bottom: 0.75rem;
}

.entry-title {
	font-size: 2rem;
	font-weight: 700;
	letter-spacing: -0.025em;
	line-height: 1.2;
	margin: 0 0 1rem;
}

@media (min-width: 768px) {
	.entry-title {
		font-size: 2.75rem;
	}
}

.entry-meta {
	margin-bottom: 1.5rem;
}

.post-meta {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 0.5rem;
	font-size: 0.875rem;
	color: hsl(var(--muted-foreground));
}

.post-meta__author {
	display: flex;
	align-items: center;
	gap: 0.375rem;
}

.post-meta__author-name {
	font-weight: 500;
	color: hsl(var(--foreground));
	text-decoration: none;
	transition: color 0.15s ease;
}

.post-meta__author-name:hover {
	color: hsl(var(--primary));
}

.post-meta__sep {
	color: hsl(var(--muted-foreground) / 0.5);
	user-select: none;
	line-height: 1;
}

.entry-hero {
	margin-bottom: 2rem;
}

.entry-hero img {
	border-radius: calc(var(--radius) * 2);
	width: 100%;
	height: auto;
}

/* ==========================================================================
   Entry Tags (Issue #7)
   ========================================================================== */

.entry-footer {
	margin-top: 2rem;
	padding-top: 1.5rem;
	border-top: 1px solid hsl(var(--border));
}

.entry-tags {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
}

.entry-tags .badge {
	transition: background-color 0.15s ease, color 0.15s ease;
}

.entry-tags .badge:hover {
	background-color: hsl(var(--accent));
	color: hsl(var(--accent-foreground));
}

/* ==========================================================================
   Related Posts (Issue #8)
   ========================================================================== */

.related-posts {
	margin-top: 3rem;
	padding-top: 2.5rem;
	border-top: 1px solid hsl(var(--border));
}

.related-posts__title {
	font-size: 1.5rem;
	font-weight: 600;
	margin: 0 0 1.5rem;
}

.card--compact .card-title--sm {
	font-size: 0.9375rem;
}

/* ==========================================================================
   Footer Polish (Issue #9)
   ========================================================================== */

.footer-logo img {
	max-height: 40px;
	width: auto;
}

.footer-site-name {
	font-size: 1.125rem;
	font-weight: 600;
}

.footer-about {
	font-size: 0.875rem;
	line-height: 1.6;
	color: hsl(var(--muted-foreground));
	margin-top: 0.75rem;
}

.footer-bar {
	font-size: 0.8125rem;
	color: hsl(var(--muted-foreground) / 0.8);
}

.footer-legal {
	display: flex;
	gap: 1rem;
}

.footer-legal a {
	font-size: 0.8125rem;
	color: hsl(var(--muted-foreground));
	text-decoration: none;
	transition: color 0.15s ease;
}

.footer-legal a:hover {
	color: hsl(var(--foreground));
}

/* ==========================================================================
   Category Pills - Mobile Scrolling (Issue #10)
   ========================================================================== */

.category-pills {
	-webkit-overflow-scrolling: touch;
	scrollbar-width: none;
	-ms-overflow-style: none;
	padding-left: 0.25rem;
	padding-right: 0.25rem;
}

/* ==========================================================================
   Hero Section Polish (Issue #11)
   ========================================================================== */

@media (min-width: 1280px) {
	.hero h1 {
		font-size: 4rem;
	}
}

/* ==========================================================================
   Progress Bar Visibility (Issue #13)
   ========================================================================== */

#reading-progress,
.progress-bar {
	z-index: 9999;
	height: 3px;
}

/* ==========================================================================
   General Transitions & Reduced Motion (Issue #14)
   ========================================================================== */

.btn,
.nav-link,
.category-pill,
.badge,
.footer-col a,
.footer-legal a {
	transition: color 0.15s ease, background-color 0.15s ease,
		border-color 0.15s ease;
}

@media (prefers-reduced-motion: reduce) {
	*,
	*::before,
	*::after {
		animation-duration: 0.01ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: 0.01ms !important;
		scroll-behavior: auto !important;
	}

	.card:hover {
		transform: none;
	}

	.card:hover .card-image img {
		transform: none;
	}

	.progress-bar,
	#reading-progress {
		display: none;
	}
}
