/*
Theme Name: AppSheet Advisor
Theme URI: https://appsheetadvisor.com
Author: Pliable Matter LLC
Author URI: https://pliablematter.com
Description: A lightweight custom theme for AppSheet Advisor. Uses area-normal typography from Adobe Typekit and dark rounded pill buttons.
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.7
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: appsheet-advisor
*/

/* ==========================================================================
   Skip Link (Accessibility)
   ========================================================================== */

.skip-link {
	position: absolute;
	top: -100px;
	left: 50%;
	transform: translateX(-50%);
	background: #1F2937;
	color: #ffffff;
	padding: 10px 20px;
	border-radius: 0 0 8px 8px;
	font-size: 14px;
	font-weight: 600;
	z-index: 999;
	transition: top 0.2s ease;
}

.skip-link:focus {
	top: 0;
	color: #ffffff;
	text-decoration: none;
	outline: 2px solid #0073e6;
	outline-offset: 2px;
}

/* ==========================================================================
   Reset & Base
   ========================================================================== */

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

body {
	margin: 0;
	padding: 0;
	font-family: area-normal, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
	font-weight: 400;
	font-size: 16px;
	line-height: 1.7;
	letter-spacing: -0.01em;
	color: #0d0d0d;
	background-color: #ffffff;
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
}

a {
	color: #0073e6;
	text-decoration: none;
	transition: color 0.2s ease;
}

a:hover,
a:focus {
	color: #005bb5;
	text-decoration: underline;
}

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

/* ==========================================================================
   Typography
   ========================================================================== */

h1, h2, h3, h4, h5, h6 {
	font-family: area-normal, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
	line-height: 1.2;
	letter-spacing: -0.02em;
	margin-top: 0;
	margin-bottom: 0.5em;
	color: #0d0d0d;
}

h1 {
	font-weight: 200;
}

h2, h3 {
	font-weight: 900;
}

h4, h5, h6 {
	font-weight: 700;
}

h1 { font-size: 42px; }
h2 { font-size: 32px; }
h3 { font-size: 24px; }
h4 { font-size: 20px; }
h5 { font-size: 18px; }
h6 { font-size: 16px; }

p {
	margin-top: 0;
	margin-bottom: 1.5em;
}

/* ==========================================================================
   Layout
   ========================================================================== */

.site-container {
	display: flex;
	flex-direction: column;
	min-height: 100vh;
}

.site-content {
	flex: 1;
}

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

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

.site-header {
	background: #ffffff;
	border-bottom: 1px solid #e5e7eb;
	position: relative;
	z-index: 100;
}

.site-header .container {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding-top: 15px;
	padding-bottom: 15px;
}

.site-logo a {
	display: flex;
	align-items: center;
}

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

/* Primary Navigation */

.primary-nav ul {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	gap: 30px;
	align-items: center;
}

.primary-nav li {
	margin: 0;
}

.primary-nav a {
	font-family: area-normal, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
	font-size: 16px;
	font-weight: 500;
	color: #374151;
	text-decoration: none;
	padding: 8px 0;
	transition: color 0.2s ease;
}

.primary-nav a:hover,
.primary-nav a:focus {
	color: #1F2937;
	text-decoration: none;
}

.primary-nav .current-menu-item a,
.primary-nav .current_page_item a {
	color: #1F2937;
	font-weight: 600;
}

/* Mobile Menu Toggle */

.menu-toggle {
	display: none;
	background: #1F2937;
	color: #ffffff;
	border: none;
	border-radius: 9999px;
	padding: 10px 20px;
	font-family: area-normal, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
	font-size: 14px;
	font-weight: 600;
	cursor: pointer;
	align-items: center;
	gap: 8px;
	transition: background-color 0.2s ease;
}

.menu-toggle:hover {
	background: #374151;
}

.menu-toggle svg {
	width: 20px;
	height: 20px;
	fill: currentColor;
}

/* ==========================================================================
   Buttons
   ========================================================================== */

.wp-block-button .wp-block-button__link,
.wp-element-button,
button[type="submit"],
input[type="submit"],
.button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	background-color: #1F2937 !important;
	color: #ffffff !important;
	border: none;
	border-radius: 9999px !important;
	padding: 11px 32px 14px;
	font-family: area-normal, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
	font-size: 16px;
	font-weight: 800 !important;
	line-height: 1.2;
	text-decoration: none;
	cursor: pointer;
	transition: background-color 0.2s ease, transform 0.15s ease;
}

.wp-block-button .wp-block-button__link:hover,
.wp-block-button .wp-block-button__link:focus,
.wp-element-button:hover,
.wp-element-button:focus,
button[type="submit"]:hover,
button[type="submit"]:focus,
input[type="submit"]:hover,
input[type="submit"]:focus,
.button:hover,
.button:focus {
	background-color: #374151 !important;
	color: #ffffff !important;
	text-decoration: none;
	transform: translateY(-1px);
}

/* Outline button variant */
.wp-block-button.is-style-outline .wp-block-button__link {
	background-color: transparent;
	color: #1F2937;
	border: 2px solid #1F2937;
}

.wp-block-button.is-style-outline .wp-block-button__link:hover,
.wp-block-button.is-style-outline .wp-block-button__link:focus {
	background-color: #1F2937;
	color: #ffffff;
}

/* ==========================================================================
   Content Area
   ========================================================================== */

.content-area {
	padding-top: 40px;
	padding-bottom: 60px;
}

.entry-content {
	max-width: 1200px;
	margin-left: auto;
	margin-right: auto;
}

/* Wide and full-width alignment */
.entry-content > .alignwide {
	max-width: 1400px;
	margin-left: auto;
	margin-right: auto;
}

.entry-content > .alignfull {
	max-width: none;
	margin-left: calc(-50vw + 50%);
	margin-right: calc(-50vw + 50%);
	width: 100vw;
}

/* ==========================================================================
   Blog Listing (index.php)
   ========================================================================== */

.blog-layout {
	display: grid;
	grid-template-columns: 1fr 300px;
	gap: 40px;
	padding-top: 40px;
	padding-bottom: 60px;
}

.posts-list {
	display: flex;
	flex-direction: column;
	gap: 40px;
}

.post-card {
	border-bottom: 1px solid #e5e7eb;
	padding-bottom: 40px;
}

.post-card:last-child {
	border-bottom: none;
}

.post-card .post-thumbnail {
	margin-bottom: 20px;
}

.post-card .post-thumbnail img {
	width: 100%;
	height: auto;
	display: block;
}

.post-card .entry-title {
	font-size: 28px;
	font-weight: 700;
	margin-bottom: 8px;
}

.post-card .entry-title a {
	color: #0d0d0d;
	text-decoration: none;
}

.post-card .entry-title a:hover {
	color: #0073e6;
}

.post-card .entry-meta {
	font-size: 14px;
	color: #6b7280;
	margin-bottom: 16px;
}

.post-card .entry-summary {
	margin-bottom: 16px;
}

.post-card .continue-reading {
	font-weight: 600;
	font-size: 14px;
	text-transform: uppercase;
	letter-spacing: 0.3px;
}

.post-card .entry-categories {
	font-size: 14px;
	color: #6b7280;
	margin-top: 16px;
}

.post-card .entry-categories a {
	color: #6b7280;
}

.post-card .entry-categories a:hover {
	color: #0073e6;
}

/* Pagination */
.pagination {
	margin-top: 40px;
	display: flex;
	gap: 8px;
	align-items: center;
}

.pagination .page-numbers {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 40px;
	height: 40px;
	padding: 0 12px;
	border-radius: 9999px;
	font-size: 14px;
	font-weight: 500;
	color: #374151;
	text-decoration: none;
	transition: background-color 0.2s ease;
}

.pagination .page-numbers:hover {
	background-color: #f3f4f6;
	text-decoration: none;
}

.pagination .page-numbers.current {
	background-color: #1F2937;
	color: #ffffff;
}

/* ==========================================================================
   Single Post (single.php)
   ========================================================================== */

.single-post-layout {
	display: grid;
	grid-template-columns: 1fr 300px;
	gap: 40px;
	padding-top: 40px;
	padding-bottom: 60px;
}

.single-post-header {
	margin-bottom: 30px;
}

.single-post-header .entry-title {
	font-size: 36px;
	margin-bottom: 10px;
}

.single-post-header .entry-meta {
	font-size: 14px;
	color: #6b7280;
	margin-bottom: 20px;
}

.single-post-header .post-thumbnail {
	margin-bottom: 30px;
}

.single-post-header .post-thumbnail img {
	width: 100%;
	height: auto;
	display: block;
}

.single-post-content .entry-categories {
	font-size: 14px;
	color: #6b7280;
	margin-top: 40px;
	padding-top: 20px;
	border-top: 1px solid #e5e7eb;
}

.single-post-content .entry-categories a {
	color: #6b7280;
}

.single-post-content .entry-categories a:hover {
	color: #0073e6;
}

/* ==========================================================================
   Sidebar
   ========================================================================== */

.sidebar {
	font-size: 15px;
}

.sidebar .widget {
	margin-bottom: 30px;
}

.sidebar .widget-title {
	font-size: 16px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.3px;
	margin-bottom: 15px;
	padding-bottom: 10px;
	border-bottom: 2px solid #1F2937;
}

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

.sidebar li {
	padding: 6px 0;
	border-bottom: 1px solid #f3f4f6;
}

.sidebar li:last-child {
	border-bottom: none;
}

.sidebar a {
	color: #374151;
	text-decoration: none;
}

.sidebar a:hover {
	color: #0073e6;
}

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

.site-footer {
	background: #f9f9f9;
	border-top: 1px solid #e5e7eb;
	padding: 30px 0;
}

.site-footer .container {
	display: flex;
	align-items: center;
	justify-content: space-between;
	flex-wrap: wrap;
	gap: 15px;
}

.footer-nav ul {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	gap: 25px;
}

.footer-nav a {
	font-size: 14px;
	font-weight: 500;
	color: #374151;
	text-decoration: none;
	transition: color 0.2s ease;
}

.footer-nav a:hover {
	color: #1F2937;
}

.site-footer .copyright {
	font-size: 14px;
	color: #6b7280;
}

/* ==========================================================================
   404 Page
   ========================================================================== */

.error-404 {
	text-align: center;
	padding: 80px 20px;
}

.error-404 h1 {
	font-size: 48px;
	margin-bottom: 16px;
}

.error-404 p {
	font-size: 18px;
	color: #6b7280;
	margin-bottom: 30px;
}

/* ==========================================================================
   WordPress Block Overrides
   ========================================================================== */

/* Ensure Gutenberg blocks respect max-width */
.entry-content > * {
	max-width: 1200px;
	margin-left: auto;
	margin-right: auto;
}

/* Cover blocks full width */
.entry-content > .wp-block-cover.alignfull,
.entry-content > .wp-block-group.alignfull {
	max-width: none;
}

/* Separator block */
.wp-block-separator {
	border: none;
	border-top: 1px solid #e5e7eb;
}

.wp-block-separator.is-style-wide {
	max-width: none;
}

/* Quote block */
.wp-block-quote {
	border-left: 4px solid #1F2937;
	padding-left: 24px;
	margin-left: 0;
	font-style: italic;
}

/* Table block */
.wp-block-table table {
	width: 100%;
	border-collapse: collapse;
}

.wp-block-table td,
.wp-block-table th {
	border: 1px solid #e5e7eb;
	padding: 10px 14px;
}

.wp-block-table th {
	background-color: #f9f9f9;
	font-weight: 600;
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 768px) {

	h1 { font-size: 32px; }
	h2 { font-size: 26px; }
	h3 { font-size: 20px; }

	/* Header */
	.menu-toggle {
		display: flex;
	}

	.primary-nav {
		display: none;
		position: absolute;
		top: 100%;
		left: 0;
		right: 0;
		background: #ffffff;
		border-bottom: 1px solid #e5e7eb;
		box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
		z-index: 99;
	}

	.primary-nav.is-open {
		display: block;
	}

	.primary-nav ul {
		flex-direction: column;
		gap: 0;
		padding: 10px 20px;
	}

	.primary-nav li {
		border-bottom: 1px solid #f3f4f6;
	}

	.primary-nav li:last-child {
		border-bottom: none;
	}

	.primary-nav a {
		display: block;
		padding: 12px 0;
	}

	/* Blog layout stacks on mobile */
	.blog-layout,
	.single-post-layout {
		grid-template-columns: 1fr;
		gap: 30px;
	}

	/* Content area */
	.content-area {
		padding-top: 30px;
		padding-bottom: 40px;
	}

	/* Footer */
	.site-footer .container {
		flex-direction: column;
		text-align: center;
	}

	.footer-nav ul {
		justify-content: center;
		flex-wrap: wrap;
	}

	/* Buttons */
	.wp-block-button .wp-block-button__link,
	.wp-element-button,
	button[type="submit"],
	input[type="submit"],
	.button {
		padding: 12px 24px;
		font-size: 15px;
	}
}

@media (max-width: 480px) {
	.container {
		padding-left: 16px;
		padding-right: 16px;
	}

	.site-header .container {
		padding-top: 12px;
		padding-bottom: 12px;
	}

	.site-logo img {
		max-height: 40px;
	}
}
