/*
Theme Name: 퍼널모아 AI 테마 v3 (Classic)
Theme URI: https://example.com/
Author: Cosmosfarm
Description: 초보자도 프롬프트만으로 콘텐츠를 고품질로 편집할 수 있는 클래식 워드프레스 테마. (v3 콘텐츠 전용 AI 편집)
Requires at least: 6.4
Tested up to: 6.5
Requires PHP: 7.4
Version: 3.0.0
Text Domain: cosmosfarm-funnelmoa
*/

/* -------------------------------------------------------------------------- */
/*	0. Variables & Design System
/* -------------------------------------------------------------------------- */
:root {
	/* Colors */
	--cf-color-primary: #1e293b;
	/* Navy for trust */
	--cf-color-brand: #2563eb;
	/* Blue for action */
	--cf-color-accent: #0f172a;
	/* Darker accent */
	--cf-color-text: #334155;
	/* Slate 700 */
	--cf-color-text-light: #64748b;
	/* Slate 500 */
	--cf-color-bg: #ffffff;
	--cf-color-bg-sub: #f8fafc;
	/* Slate 50 */
	--cf-color-border: #e2e8f0;
	/* Slate 200 */

	/* Typography */
	--cf-font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	--cf-font-heading: var(--cf-font-body);

	/* Spacing */
	--cf-spacing-container: 20px;
	--cf-spacing-block: 40px;

	/* Components */
	--cf-radius: 6px;
	--cf-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
	--cf-shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);

	/* Default WordPress Layout Sizes (Fallback) */
	--wp--style--global--content-size: 920px;
	--wp--style--global--wide-size: 1280px;
	--cf-layout-header-size: 1280px;
	--cf-layout-footer-size: 1280px;
}

/* -------------------------------------------------------------------------- */
/*	1. Reset & Base
/* -------------------------------------------------------------------------- */
*,
*::before,
*::after {
	box-sizing: border-box;
}

/* Clearfix Hack */
.clearfix::after,
.cf-ai-container::after,
.site-content::after,
.entry-content::after,
.site-main::after,
.site-header::after,
.site-footer::after {
	content: "";
	display: table;
	clear: both;
}

body {
	margin: 0;
	padding: 0;
	font-family: var(--cf-font-body);
	font-size: 16px;
	line-height: 1.65;
	color: var(--cf-color-text);
	background-color: #fff;
	-webkit-font-smoothing: antialiased;
}

h1,
h2,
h3,
h4,
h5,
h6 {
	font-family: var(--cf-font-heading);
	color: var(--cf-color-primary);
	font-weight: 700;
	line-height: 1.3;
	margin: 0 0 1rem;
}

h1 {
	font-size: 2.25rem;
}

h2 {
	font-size: 1.875rem;
}

h3 {
	font-size: 1.5rem;
}

p {
	margin: 0 0 1.5rem;
}

a {
	color: var(--cf-color-brand);
	text-decoration: none;
	transition: color 0.2s;
}

a:hover {
	color: var(--cf-color-primary);
}

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

/* -------------------------------------------------------------------------- */
/*	2. Layout
/* -------------------------------------------------------------------------- */
.cf-ai-container {
	width: 100%;
	/* Use WordPress Global Settings, fallback to 920px if not set */
	max-width: var(--wp--style--global--content-size, 920px);
	margin: 0 auto;
	padding: 0 var(--cf-spacing-container);
}

/* Home front page: full-width content */
.cf-ai-container--full-home {
	max-width: 100%;
	padding-left: 0;
	padding-right: 0;
}

/* Generic full-width container for page templates */
.cf-ai-container--full {
	max-width: 100%;
	padding-left: 0;
	padding-right: 0;
}

/* Alignment Classes support */
.alignwide {
	max-width: var(--wp--style--global--wide-size, 1280px);
	margin-left: auto;
	margin-right: auto;
}

.alignfull {
	max-width: 100%;
	margin-left: calc(50% - 50vw);
	margin-right: calc(50% - 50vw);
}

.site {
	display: flex;
	flex-direction: column;
	min-height: 100vh;
	background: #fff;
}

.site-content {
	flex: 1;
	padding: 0;
}

/* -------------------------------------------------------------------------- */
/*	3. Header (Redesigned)
/* -------------------------------------------------------------------------- */
.site-header {
	background: #fff;
	border-bottom: 1px solid var(--cf-color-border);
	position: sticky;
	top: 0;
	z-index: 1000;
}

/* Admin Bar Compatibility */
.admin-bar .site-header {
	top: 32px;
}

@media screen and (max-width: 782px) {
	.admin-bar .site-header {
		top: 46px;
	}
}

.header-inner {
	display: flex;
	justify-content: space-between;
	align-items: center;
	height: 80px;
	width: 100%;
	max-width: var(--cf-layout-header-size, 1280px);
	/* Use Wide Size */
	margin: 0 auto;
	padding: 0 var(--cf-spacing-container);
}

.site-title {
	font-size: 1.5rem;
	font-weight: 800;
	margin: 0;
	line-height: 1;
}

.site-title a {
	color: var(--cf-color-primary);
	text-decoration: none;
}

.site-branding {
	display: inline-flex;
	align-items: center;
	min-width: 0;
}

.site-branding .custom-logo-link {
	display: inline-flex;
	align-items: center;
}

.site-branding .custom-logo {
	width: auto;
	height: auto;
	max-width: 200px;
	max-height: 64px;
}

/* Main Navigation (Desktop) */
.main-navigation {
	height: 100%;
	display: flex;
	align-items: center;
}

.main-navigation>ul {
	display: flex;
	list-style: none;
	margin: 0;
	padding: 0;
	gap: 32px;
	height: 100%;
	align-items: center;
}

.main-navigation>ul>li {
	height: 100%;
	display: flex;
	align-items: center;
	position: relative;
}

.main-navigation>ul>li>a {
	color: var(--cf-color-text);
	font-weight: 500;
	font-size: 1rem;
	text-decoration: none;
	transition: color 0.2s;
}

/* Dropdown Arrows */
.menu-item-has-children>a {
	padding-right: 24px !important;
	position: relative;
}

.menu-item-has-children>a::after {
	content: '';
	position: absolute;
	right: 6px;
	top: 50%;
	width: 5px;
	height: 5px;
	border-right: 1.5px solid currentColor;
	border-bottom: 1.5px solid currentColor;
	transform: translateY(-50%) rotate(45deg);
	transition: transform 0.2s ease;
	opacity: 0.7;
}

.main-navigation>ul>li:hover>a,
.main-navigation>ul>li.current-menu-item>a {
	color: var(--cf-color-brand);
}

/* Dropdown Menu (Sub Menu) */
.main-navigation ul ul {
	display: none;
	position: absolute;
	top: 100%;
	left: 0;
	background: #fff;
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
	border: 1px solid var(--cf-color-border);
	border-radius: 0 0 4px 4px;
	min-width: 200px;
	padding: 8px 0;
	z-index: 999;
	list-style: none;
	flex-direction: column;
	gap: 0;
}

.main-navigation li:hover>ul,
.main-navigation li:focus-within>ul {
	display: block;
	animation: fadeIn 0.2s ease-out;
}

.main-navigation ul ul li {
	display: block;
	height: auto;
	position: relative;
}

.main-navigation ul ul a {
	display: block;
	padding: 10px 20px;
	font-size: 0.95rem;
	color: var(--cf-color-text);
	text-decoration: none;
}

.main-navigation ul ul a:hover {
	background-color: var(--cf-color-bg-sub);
	color: var(--cf-color-brand);
}

/* 3rd Level Dropdown */
.main-navigation ul ul ul {
	top: -1px;
	left: 100%;
	border-radius: 4px;
}

/* 3rd Level Arrow Direction */
.main-navigation ul ul .menu-item-has-children>a::after {
	transform: translateY(-50%) rotate(-45deg);
	right: 12px;
}

/* Mobile Menu Toggle */
.menu-toggle {
	display: none;
	/* Hidden on desktop */
	background: none;
	border: none;
	padding: 0;
	cursor: pointer;
	color: var(--cf-color-primary);
}

/* Mobile Responsive Header */
@media (max-width: 991px) {
	.header-inner {
		height: 60px;
		/* Mobile Height Reduced */
	}

	/* Admin bar gap removal while scrolling (mobile) */
	.admin-bar.cf-ai-adminbar-collapsed .site-header {
		top: 0;
	}

	.site-branding .custom-logo {
		max-width: 150px;
		max-height: 48px;
	}

	.menu-toggle {
		display: block;
	}

	.main-navigation {
		display: none;
		position: absolute;
		top: 100%;
		/* Directly below header */
		left: 0;
		right: 0;
		background: #fff;
		border-bottom: 1px solid var(--cf-color-border);
		box-shadow: 0 10px 20px rgba(0, 0, 0, 0.05);
		height: auto;
		max-height: calc(100vh - 60px);
		overflow-y: auto;
		align-items: flex-start;
		/* Reset align */
	}

	.main-navigation.toggled {
		display: block;
	}

	.main-navigation>ul {
		flex-direction: column;
		width: 100%;
		gap: 0;
		padding: 0;
	}

	.main-navigation>ul>li {
		width: 100%;
		height: auto;
		display: block;
		border-bottom: 1px solid #f1f1f1;
	}

	.main-navigation>ul>li:last-child {
		border-bottom: none;
	}

	.main-navigation a {
		display: flex;
		justify-content: space-between;
		align-items: center;
		padding: 14px 20px;
		width: 100%;
		font-weight: 500;
		color: var(--cf-color-text);
	}

	/* Mobile Submenu */
	.main-navigation ul ul {
		position: static;
		box-shadow: none;
		border: none;
		background-color: #f9fafb;
		display: none;
		padding: 0;
	}

	.main-navigation li.ast-submenu-expanded>ul {
		display: block;
	}

	.main-navigation li.ast-submenu-expanded>a {
		color: var(--cf-color-brand);
		background: #f8fafc;
	}

	/* Rotate arrow when expanded on mobile */
	.main-navigation li.ast-submenu-expanded>a::after {
		transform: rotate(225deg) translateY(0);
	}

	/* Mobile Submenu Levels Indentation */
	.main-navigation ul ul a {
		padding-left: 35px;
		font-size: 0.95rem;
		color: #475569;
	}

	.main-navigation ul ul ul a {
		padding-left: 50px;
		background-color: #f1f5f9;
	}

	/* Arrows on mobile always on the right */
	.main-navigation .menu-item-has-children>a::after {
		position: static;
		transform: rotate(45deg);
		margin-left: 10px;
	}
}

/* -------------------------------------------------------------------------- */
/*	4. Content & Archive (Unified)
/* -------------------------------------------------------------------------- */

/* Common Page Header (Title Area) */
.page-header,
.entry-header,
.woocommerce-products-header {
	margin-bottom: 40px;
	padding-bottom: 20px;
	border-bottom: 1px solid transparent;
	/* Reserved for future use */
	text-align: left;
	/* Unified Alignment */
}

.page-title,
.entry-title,
.woocommerce-products-header__title {
	font-size: 2.25rem;
	font-weight: 800;
	letter-spacing: -0.02em;
	color: var(--cf-color-primary);
	margin: 0;
	line-height: 1.2;
}

/* Main Container Spacing */
.site-main {
	padding: 60px 0;
}

.page-template-page-full-width .site-main,
.page-template-page-full-width-php .site-main {
	padding-top: 0;
	padding-bottom: 0;
}

/* Mobile: reduce spacing on non-home pages */
@media (max-width: 768px) {
	.site-main {
		padding: 32px 0;
	}

	.page-template-page-full-width .site-main,
	.page-template-page-full-width-php .site-main {
		padding-top: 0;
		padding-bottom: 0;
	}
}


/* -------------------------------------------------------------------------- */
/*	5. Unified Card Design (Blog & Shop)
/* -------------------------------------------------------------------------- */

/* Base Card Style */
.post-grid article,
.archive article,
.blog article,
.search article,
.woocommerce ul.products li.product {
	background: #fff;
	border: 1px solid var(--cf-color-border) !important;
	border-radius: var(--cf-radius) !important;
	padding: 24px !important;
	transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
	display: flex;
	flex-direction: column;
	margin-bottom: 0 !important;
	box-shadow: none !important;
	/* Start clean */
}

/* Hover Effect */
.post-grid article:hover,
.archive article:hover,
.blog article:hover,
.search article:hover,
.woocommerce ul.products li.product:hover {
	transform: translateY(-4px);
	box-shadow: var(--cf-shadow-lg) !important;
	border-color: var(--cf-color-brand) !important;
	z-index: 1;
}

/* Card Image Area */
.post-thumbnail,
.woocommerce ul.products li.product a img {
	margin: -24px -24px 20px -24px !important;
	/* Full width image */
	width: calc(100% + 48px) !important;
	max-width: calc(100% + 48px) !important;
	border-radius: var(--cf-radius) var(--cf-radius) 0 0 !important;
	height: auto;
	object-fit: cover;
	border-bottom: 1px solid var(--cf-color-border);
}

/* Card Title */
.entry-title a,
.woocommerce-loop-product__title {
	font-size: 1.15rem;
	font-weight: 700;
	color: var(--cf-color-primary);
	text-decoration: none;
	display: block;
	margin-bottom: 10px;
}

/* Card Content / Price */
.entry-summary,
.woocommerce ul.products li.product .price {
	font-size: 0.95rem;
	color: var(--cf-color-text-light);
	margin-bottom: 15px;
	flex-grow: 1;
}

.woocommerce ul.products li.product .price {
	color: var(--cf-color-text);
	font-weight: 600;
	font-size: 1rem;
	margin-bottom: 0;
	/* Price at bottom */
}

/* Pagination (Unified) */
.navigation.pagination,
.woocommerce-pagination {
	margin-top: 60px;
	text-align: center;
}

.nav-links,
.woocommerce-pagination ul.page-numbers {
	display: inline-flex;
	gap: 8px;
	border: none;
	padding: 0;
	list-style: none;
}

.page-numbers,
.woocommerce-pagination ul.page-numbers li a,
.woocommerce-pagination ul.page-numbers li span {
	display: inline-flex;
	justify-content: center;
	align-items: center;
	min-width: 40px;
	height: 40px;
	border-radius: var(--cf-radius);
	border: 1px solid var(--cf-color-border);
	color: var(--cf-color-text);
	text-decoration: none;
	font-weight: 500;
	padding: 0 10px;
}

.page-numbers.current,
.woocommerce-pagination ul.page-numbers li span.current,
.page-numbers:hover,
.woocommerce-pagination ul.page-numbers li a:hover {
	background: var(--cf-color-brand);
	color: #fff;
	border-color: var(--cf-color-brand);
}

/* -------------------------------------------------------------------------- */
/*	6. Content Pages (Single)
/* -------------------------------------------------------------------------- */
.entry-full-content,
.page .entry-content {
	background: transparent;
	border: none !important;
	box-shadow: none !important;
	padding: 0 !important;
	margin: 0 auto;
}

/* -------------------------------------------------------------------------- */
/*	7. Elements (Buttons & Inputs)
/* -------------------------------------------------------------------------- */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="search"],
input[type="tel"],
textarea,
select {
	border: 1px solid var(--cf-color-border);
	border-radius: var(--cf-radius);
	padding: 12px 16px;
	background: #fff;
	font-size: 1rem;
	width: 100%;
	transition: border-color 0.2s;
}

input:focus,
textarea:focus,
select:focus {
	border-color: var(--cf-color-brand);
	outline: none;
	box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* Theme Button Styles - Only for theme-specific and WooCommerce buttons */
.cf-ai-btn,
.woocommerce button.button,
.woocommerce a.button,
.woocommerce input.button,
.comment-form input[type="submit"],
.search-form input[type="submit"],
.wp-block-button__link {
	display: inline-flex;
	justify-content: center;
	align-items: center;
	background: var(--cf-color-primary);
	color: #fff;
	border: none;
	padding: 14px 32px;
	border-radius: var(--cf-radius);
	font-weight: 600;
	font-size: 1rem;
	cursor: pointer;
	text-decoration: none;
	transition: all 0.2s ease;
	line-height: 1.5;
	box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.cf-ai-btn:hover,
.woocommerce button.button:hover,
.woocommerce a.button:hover,
.woocommerce input.button:hover,
.comment-form input[type="submit"]:hover,
.search-form input[type="submit"]:hover,
.wp-block-button__link:hover {
	background-color: #0f172a;
	color: #fff;
	transform: translateY(-2px);
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* -------------------------------------------------------------------------- */
/*	8. WooCommerce
/*  - Moved to assets/css/woocommerce.css
/* -------------------------------------------------------------------------- */


/* -------------------------------------------------------------------------- */
/*	9. Footer (Restored)
/* -------------------------------------------------------------------------- */
.site-footer {
	background-color: #ffffff;
	/* v3: keep footer clean white */
	color: var(--cf-color-text-light);
	padding: 40px 0;
	margin-top: auto;
	/* Push to bottom */
	border-top: 1px solid var(--cf-color-border);
}

.site-footer-inner {
	display: flex;
	flex-direction: column;
	gap: 24px;
	width: 100%;
	max-width: var(--cf-layout-footer-size, 1280px);
	/* Use Wide Size */
	margin: 0 auto;
	padding: 0 var(--cf-spacing-container);
}

.site-footer-widgets {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 20px;
	width: 100%;
}

.site-footer-widgets.columns-1 {
	grid-template-columns: minmax(0, 1fr);
}

.site-footer-widgets.columns-2 {
	grid-template-columns: repeat(2, minmax(0, 1fr));
}

.site-footer-widgets.columns-4 {
	grid-template-columns: repeat(4, minmax(0, 1fr));
}

.footer-widget-area .widget {
	margin: 0;
}

.footer-widget-area .widget-title {
	font-size: 1rem;
	margin: 0 0 10px 0;
	color: var(--cf-color-primary);
}

.footer-widget-area p:last-child {
	margin-bottom: 0;
}

.footer-widget-area .widget_nav_menu .menu {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	gap: 4px;
}

.footer-widget-area .widget_nav_menu .menu-item {
	margin: 0;
	padding: 0;
}

.footer-widget-area .widget_nav_menu .menu-item a {
	display: inline-flex;
	align-items: center;
	padding: 3px 8px;
	border-radius: 8px;
	color: var(--cf-color-text);
	text-decoration: none;
	transition: background-color 0.2s ease, color 0.2s ease;
}

.footer-widget-area .widget_nav_menu .menu-item a:hover {
	background: var(--cf-color-bg-sub);
	color: var(--cf-color-brand);
}

.site-footer-bottom {
	display: flex;
	justify-content: center;
	align-items: center;
	flex-wrap: wrap;
	gap: 16px;
	width: 100%;
	padding-top: 12px;
	border-top: 1px solid var(--cf-color-border);
}

.site-info {
	order: 2;
	flex: 0 0 100%;
	width: 100%;
	font-size: 0.9rem;
	text-align: center;
}

.footer-navigation {
	order: 1;
}

.site-info .widget {
	margin: 0;
}

.site-info p {
	margin: 0;
}

.site-info a {
	color: inherit;
	text-decoration: none;
}

.site-info a:hover {
	color: var(--cf-color-brand);
}

/* Footer Navigation */
.footer-navigation ul {
	display: flex;
	list-style: none;
	margin: 0;
	padding: 0;
	gap: 24px;
}

.footer-navigation a {
	color: var(--cf-color-text);
	font-size: 0.9rem;
	font-weight: 500;
	text-decoration: none;
	transition: color 0.2s;
}

.footer-navigation a:hover {
	color: var(--cf-color-brand);
}

/* Mobile Footer */
@media (max-width: 768px) {
	.site-footer-widgets,
	.site-footer-widgets.columns-2,
	.site-footer-widgets.columns-3,
	.site-footer-widgets.columns-4 {
		grid-template-columns: 1fr;
	}

	.site-footer-bottom {
		flex-direction: column-reverse;
		text-align: center;
	}

	.site-footer-inner {
		gap: 30px;
	}

	.footer-navigation ul {
		flex-direction: column;
		gap: 15px;
	}
}

/* -------------------------------------------------------------------------- */
/*	10. Plugin Compatibility
/* -------------------------------------------------------------------------- */
/* 플러그인과의 호환성을 위한 최소한의 스타일만 정의합니다. */
/* 간섭(숨김/강제)은 지양하고, 테마 영역 제어에 집중합니다. */
