/*
Theme Name: CS Theme
Theme URI: https://example.com/cs-theme
Author: Reza
Author URI: https://example.com
Description: A premium WordPress theme inspired by Apple's design language. Features clean typography, refined color palette, generous spacing, and a professional aesthetic. Built with the block editor for maximum flexibility and modern web standards.
Requires at least: 6.4
Tested up to: 6.9
Version: 1.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: cs-theme
Tags: custom, modern, clean, minimal, professional, block-styles, full-site-editing, accessibility-ready
*/

/**
 * Apple-Inspired Custom Styles
 * Clean, minimal, and professional
 */

/* Enhanced Typography */
body {
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
	text-rendering: optimizeLegibility;
}

/* Smooth Transitions */
a,
button,
.wp-block-button__link {
	transition: all 0.2s ease-in-out;
}

/* Refined Focus States */
a:focus-visible,
button:focus-visible,
.wp-block-button__link:focus-visible {
	outline: 2px solid #0071e3;
	outline-offset: 2px;
	border-radius: 4px;
}

/* Enhanced Images */
img {
	height: auto;
	max-width: 100%;
}

.wp-block-image img {
	border-radius: 8px;
}

/* Featured Image Optimization */
.cs-featured-image img,
.wp-block-post-featured-image img {
	width: 100%;
	height: auto;
	max-height: 70vh;
	object-fit: cover;
	border-radius: 12px;
	display: block;
}

.wp-block-post-featured-image {
	overflow: hidden;
}

.wp-block-post-featured-image a {
	display: block;
	line-height: 0;
}

/* Hero Featured Image */
.cs-hero-featured-image {
	flex-shrink: 0;
}

.cs-hero-featured-image img {
	width: 280px;
	height: 280px;
	object-fit: cover;
	border-radius: 12px;
}

/* Card-like Containers */
.wp-block-group.is-style-card {
	background: #ffffff;
	border-radius: 12px;
	padding: 2rem;
	box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

/* Hero Sections */
.wp-block-cover {
	border-radius: 12px;
}

/* Navigation */
.wp-block-navigation {
	font-weight: 500;
}

.wp-block-navigation a {
	padding: 0.5rem 1rem;
}

/* Buttons - Apple Style */
.wp-block-button__link {
	border-radius: 980px !important;
	padding: 0.75rem 1.5rem !important;
	font-weight: 500;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.wp-block-button__link:hover {
	transform: translateY(-1px);
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

/* Form Inputs */
input[type="text"],
input[type="email"],
input[type="url"],
input[type="password"],
input[type="search"],
input[type="number"],
input[type="tel"],
input[type="date"],
textarea,
select {
	border: 1px solid #d2d2d7;
	border-radius: 8px;
	padding: 0.75rem 1rem;
	font-size: 1rem;
	font-family: inherit;
	transition: border-color 0.2s ease;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="url"]:focus,
input[type="password"]:focus,
input[type="search"]:focus,
input[type="number"]:focus,
input[type="tel"]:focus,
input[type="date"]:focus,
textarea:focus,
select:focus {
	outline: none;
	border-color: #0071e3;
	box-shadow: 0 0 0 3px rgba(0, 113, 227, 0.1);
}

/* Tables */
table {
	border-collapse: collapse;
	width: 100%;
}

th,
td {
	padding: 1rem;
	text-align: left;
	border-bottom: 1px solid #e8e8ed;
}

th {
	font-weight: 600;
	background: #f5f5f7;
}

/* Code Blocks */
code,
pre {
	font-family: ui-monospace, "SF Mono", Menlo, Monaco, "Cascadia Mono", monospace;
	border-radius: 8px;
}

code {
	background: #f0f0f3;
	color: #2d3748;
	padding: 0.2em 0.5em;
	font-size: 0.9em;
	font-weight: 500;
	border: 1px solid #e8e8ed;
}

pre {
	background: #fafafa;
	color: #2d3748;
	padding: 1.25rem;
	overflow-x: auto;
	border: 1px solid #e8e8ed;
}

pre code {
	background: transparent;
	border: none;
	padding: 0;
}

/* Code Block with Copy Button */
.code-block-wrapper {
	position: relative;
	margin: 1.5rem 0;
}

.code-block-wrapper pre {
	margin: 0;
}

.code-copy-button {
	position: absolute;
	top: 0.75rem;
	right: 0.75rem;
	display: flex;
	align-items: center;
	gap: 0.375rem;
	background: #ffffff;
	border: 1px solid #d2d2d7;
	color: #1d1d1f;
	padding: 0.5rem 0.75rem;
	border-radius: 6px;
	font-size: 0.8125rem;
	font-weight: 600;
	cursor: pointer;
	transition: all 0.2s ease;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.code-copy-button:hover {
	background: #f5f5f7;
	border-color: #86868b;
	transform: translateY(-1px);
	box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
}

.code-copy-button:active {
	transform: translateY(0);
}

.code-copy-button.copied {
	background: #e8f4fd;
	border-color: #0071e3;
	color: #0071e3;
}

.code-copy-button.error {
	background: #ffebee;
	border-color: #ef5350;
	color: #c62828;
}

.code-copy-button svg {
	width: 16px;
	height: 16px;
	flex-shrink: 0;
}

.code-copy-button .button-text {
	line-height: 1;
}

/* Responsive adjustments */
@media (max-width: 640px) {
	.code-copy-button {
		padding: 0.375rem 0.625rem;
		font-size: 0.75rem;
		gap: 0.25rem;
	}
	
	.code-copy-button svg {
		width: 14px;
		height: 14px;
	}
}

/* Blockquotes */
blockquote {
	border-left: 3px solid #0071e3;
	padding-left: 1.5rem;
	font-style: italic;
	color: #1d1d1f;
}

/* Lists */
ul,
ol {
	padding-left: 1.5rem;
}

li {
	margin-bottom: 0.5rem;
}

/* Utility Classes */
.text-center {
	text-align: center;
}

.max-width-narrow {
	max-width: 680px;
	margin-left: auto;
	margin-right: auto;
}

/* Responsive Improvements */
@media (max-width: 768px) {
	.wp-block-button__link {
		padding: 0.65rem 1.25rem !important;
		font-size: 0.9375rem;
	}
	
	.cs-featured-image img,
	.wp-block-post-featured-image img {
		max-height: 50vh;
		border-radius: 8px;
	}
	
	.cs-hero-featured-image img {
		width: 100%;
		height: auto;
		max-height: 240px;
	}
}

/* Accessibility */
.screen-reader-text {
	clip: rect(1px, 1px, 1px, 1px);
	position: absolute !important;
	height: 1px;
	width: 1px;
	overflow: hidden;
	word-wrap: normal !important;
}

.screen-reader-text:focus {
	background-color: #f5f5f7;
	border-radius: 4px;
	clip: auto !important;
	color: #1d1d1f;
	display: block;
	font-size: 0.875rem;
	font-weight: 600;
	height: auto;
	left: 5px;
	line-height: normal;
	padding: 1rem 1.5rem;
	text-decoration: none;
	top: 5px;
	width: auto;
	z-index: 100000;
}
