/**
 * MonoFrame Theme - Main Stylesheet
 * 
 * This file contains custom styles for the MonoFrame WordPress theme supporting classic theme styles as a backward compatibility.
 * It includes styles for layout, typography, forms, galleries, and block patterns.
 * The main styling for blocks is in the theme.json file.
 * 
 * @package MonoFrame
 * @version 1.00
 */

/* ==========================================================================
   LAYOUT & SPACING
   ========================================================================== */

/* Front page layout adjustments */
.front-page {
	margin-top: 0;
	margin-bottom: 0;
}

/* Keep the footer at the bottom of short pages */
.wp-site-blocks {
	display: flex;
	min-height: 100vh;
	min-height: 100dvh;
	flex-direction: column;
}

.wp-site-blocks > footer:last-child {
	margin-top: auto;
}

/* Remove vertical margins for specific elements */
.empty-vertical-margin {
	margin-top: 0;
	margin-bottom: 0;
}

/* Footer spacing */
footer {
	margin-top: 0;
}

/* ==========================================================================
   MEDIA & FIGURES
   ========================================================================== */

/* Image alignment classes */
.alignnone {
    margin-left: auto;
    margin-right: auto;
}

.alignleft {
    float: left;
    margin: 0 var(--wp--style--block-gap) var(--wp--style--block-gap) 0;
}

.aligncenter {
    display: block;
    margin: 0 auto;
}

.alignright {
    float: right;
    margin: 0 0 var(--wp--style--block-gap) var(--wp--style--block-gap);
}

/* Pre-formatted text */
pre {
    max-width: 100%;
    box-sizing: border-box;
    overflow-x: auto;
    white-space: pre-wrap;
    word-break: break-word;
}

/* ==========================================================================
   BUTTONS & INTERACTIVE ELEMENTS
   ========================================================================== */

/* Button hover effects */
.wp-block-button a {
	transition: color 0.3s ease, background-color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease, transform 0.3s ease;
}

.wp-block-button a:hover {
    color: var(--wp--preset--color--anti-flash-white);
	transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Cover pattern button hover states */
.wp-block-cover .wp-block-button__link:hover {
    background-color: var(--wp--preset--color--cornsilk) !important;
    color: var(--wp--preset--color--jet) !important;
}

/* Secondary button hover in cover */
.wp-block-cover .wp-block-button__link.has-secondary-background-color:hover {
    background-color: var(--wp--preset--color--cornsilk) !important;
    color: var(--wp--preset--color--jet) !important;
}

/* Outline button hover in cover */
.wp-block-cover .wp-block-button.is-style-outline .wp-block-button__link:hover {
    background-color: var(--wp--preset--color--cornsilk) !important;
    color: var(--wp--preset--color--jet) !important;
    border-color: var(--wp--preset--color--cornsilk) !important;
}

/* ==========================================================================
   LINKS & NAVIGATION
   ========================================================================== */

/* Header link states */
header a:visited,
header a:hover {
    color: var(--wp--preset--color--primary);
}

/* General link hover state */
a:hover {
    color: var(--wp--preset--color--chinese-blue);
}

/* Visited link color */
a:visited {
    color: #2F4B93;
}

/* Footer link styling */
footer a,
footer h2.wp-block-site-title a {
    color: var(--wp--preset--color--anti-flash-white);
}

footer a:hover {
    color: var(--wp--preset--color--ripe-mango);
}

footer a:visited {
    color: #A3A3A3;
}

/* Visible keyboard focus for native form and disclosure controls */
:where(input, textarea, select, summary):focus-visible {
	outline: 3px solid var(--wp--preset--color--primary);
	outline-offset: 3px;
	box-shadow: 0 0 0 5px var(--wp--preset--color--white);
}

/* * Related articles title */
.monoframe-related-article-title {
    font-size: var(--wp--preset--font-size--large);
    margin-top: 0;
    margin-bottom: 0;
}

/* ==========================================================================
   DEFINITION LISTS
   ========================================================================== */

/* Definition list container */
dl {
	margin: var(--wp--preset--spacing--medium) 0;
}

/* Definition terms */
dt {
	font-weight: 700;
	color: var(--wp--preset--color--primary);
	margin-top: var(--wp--preset--spacing--small);
}

/* Definition descriptions */
dd {
	margin-left: var(--wp--preset--spacing--medium);
	margin-bottom: var(--wp--preset--spacing--small);
	padding-left: var(--wp--preset--spacing--small);
	border-left: 2px solid var(--wp--preset--color--anti-flash-white);
}

/* ==========================================================================
   ADDRESS & CODE ELEMENTS
   ========================================================================== */

/* Address styling */
address {
	font-style: normal;
	margin: var(--wp--preset--spacing--medium) 0;
	padding: var(--wp--preset--spacing--small);
	background: var(--wp--preset--color--anti-flash-white);
	border-left: 3px solid var(--wp--preset--color--primary);
	border-radius: 0 4px 4px 0;
}

/* Inline code styling */
code {
	background: var(--wp--preset--color--anti-flash-white);
	color: var(--wp--preset--color--jet);
	padding: 2px 6px;
	border-radius: 3px;
	font-family: 'Courier New', monospace;
	font-size: 0.875em;
}

/* ==========================================================================
   CLASSIC GALLERY STYLING
   ========================================================================== */

/* Gallery container */
.gallery {
	display: grid;
	gap: var(--wp--preset--spacing--small);
	margin: var(--wp--preset--spacing--medium) 0;
}

/* Gallery column configurations */
.gallery-columns-1 {
	grid-template-columns: 1fr;
}

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

.gallery-columns-3 {
	grid-template-columns: repeat(3, 1fr);
}

.gallery-columns-4 {
	grid-template-columns: repeat(4, 1fr);
}

.gallery-columns-5 {
	grid-template-columns: repeat(5, 1fr);
}

.gallery-columns-6 {
	grid-template-columns: repeat(6, 1fr);
}

.gallery-columns-7 {
	grid-template-columns: repeat(7, 1fr);
}

.gallery-columns-8 {
	grid-template-columns: repeat(8, 1fr);
}

.gallery-columns-9 {
	grid-template-columns: repeat(9, 1fr);
}

/* Gallery items */
.gallery-item {
	margin: 0;
	position: relative;
}

/* Gallery icon container */
.gallery-icon {
	position: relative;
	overflow: hidden;
	border-radius: 4px;
	transition: transform 0.3s ease;
}

.gallery-icon:hover {
	transform: scale(1.05);
}

/* Gallery images */
.gallery-icon img {
	width: 100%;
	height: auto;
	display: block;
	border-radius: 4px;
}

.gallery-icon a {
	display: block;
	text-decoration: none;
}

/* Gallery captions */
.gallery-caption {
	background: rgba(0, 0, 0, 0.8);
	color: var(--wp--preset--color--white);
	padding: var(--wp--preset--spacing--small);
	font-size: 0.875rem;
	text-align: center;
	margin-top: 4px;
	border-radius: 0 0 4px 4px;
}

/* ==========================================================================
   GALLERY RESPONSIVE BREAKPOINTS
   ========================================================================== */

/* Tablet breakpoint */
@media (max-width: 768px) {
	.gallery-columns-4,
	.gallery-columns-5,
	.gallery-columns-6,
	.gallery-columns-7,
	.gallery-columns-8,
	.gallery-columns-9 {
		grid-template-columns: repeat(3, 1fr);
	}
}

/* Mobile breakpoint */
@media (max-width: 480px) {
	.gallery-columns-2,
	.gallery-columns-3,
	.gallery-columns-4,
	.gallery-columns-5,
	.gallery-columns-6,
	.gallery-columns-7,
	.gallery-columns-8,
	.gallery-columns-9 {
		grid-template-columns: repeat(2, 1fr);
	}
}

/* Small mobile breakpoint */
@media (max-width: 320px) {
	.gallery-columns-2,
	.gallery-columns-3,
	.gallery-columns-4,
	.gallery-columns-5,
	.gallery-columns-6,
	.gallery-columns-7,
	.gallery-columns-8,
	.gallery-columns-9 {
		grid-template-columns: 1fr;
	}
}

/* ==========================================================================
   FORMS
   ========================================================================== */

/* Form container */
form {
	margin: var(--wp--preset--spacing--medium) 0;
}

/* Form groups */
.form-group {
	margin-bottom: var(--wp--preset--spacing--medium);
}

/* Form labels */
label {
	display: block;
	margin-bottom: var(--wp--preset--spacing--small);
	font-weight: 700;
	color: var(--wp--preset--color--jet);
}

/* Form field containers */
.form-group,
fieldset {
	margin-bottom: var(--wp--preset--spacing--medium);
}

/* Input fields - all types */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="search"],
input[type="url"],
input[type="tel"],
input[type="number"],
input[type="date"],
input[type="time"],
input[type="datetime-local"],
input[type="month"],
input[type="week"],
textarea,
select {
	width: 100%;
	max-width: 100%;
	box-sizing: border-box;
	padding: var(--wp--preset--spacing--small);
	border: 1px solid var(--wp--preset--color--jet);
	border-radius: 4px;
	font-size: 1rem;
	font-family: inherit;
	background: var(--wp--preset--color--white);
	transition: border-color 0.3s ease;
}

/* Input focus states */
input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
input[type="search"]:focus,
input[type="url"]:focus,
input[type="tel"]:focus,
input[type="number"]:focus,
textarea:focus,
select:focus-visible {
	border-color: var(--wp--preset--color--primary);
}

/* Textarea specific styling */
textarea {
	min-height: 100px;
	resize: vertical;
}

/* Select dropdown styling */
select {
	appearance: none;
	background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3e%3c/svg%3e");
	background-position: right 8px center;
	background-repeat: no-repeat;
	background-size: 16px;
	padding-right: 40px;
}

/* Checkboxes and radio buttons */
input[type="checkbox"],
input[type="radio"] {
	margin-right: var(--wp--preset--spacing--small);
}

/* ==========================================================================
   BUTTONS
   ========================================================================== */

/* Button base styles */
button,
input[type="submit"],
input[type="button"],
input[type="reset"] {
	background: var(--wp--preset--color--primary);
	color: var(--wp--preset--color--white);
	padding: var(--wp--preset--spacing--small) var(--wp--preset--spacing--medium);
	border: none;
	border-radius: 4px;
	font-size: 1rem;
	font-weight: 700;
	cursor: pointer;
	transition: background-color 0.3s ease;
}

/* Button hover states */
button:hover,
input[type="submit"]:hover,
input[type="button"]:hover,
input[type="reset"]:hover {
	background: var(--wp--preset--color--yankees-blue);
	color: var(--wp--preset--color--white);
}

/* Submit button specific hover */
input[type="submit"]:hover {
	background: var(--wp--preset--color--chinese-blue);
	color: var(--wp--preset--color--white);
}

/* Outline button style */
.wp-block-button.is-style-outline .wp-block-button__link {
	background: transparent;
	border: 2px solid var(--wp--preset--color--primary);
	color: var(--wp--preset--color--primary);
}

.wp-block-button.is-style-outline .wp-block-button__link:hover {
	background: var(--wp--preset--color--primary);
	color: var(--wp--preset--color--white);
}

/* Secondary button styling */
button.secondary,
input[type="button"] {
	background: var(--wp--preset--color--secondary);
	color: var(--wp--preset--color--jet);
}

button.secondary:hover,
input[type="button"]:hover {
	background: var(--wp--preset--color--primary);
	color: var(--wp--preset--color--white);
}

/* Respect the visitor's operating-system motion preference */
@media (prefers-reduced-motion: reduce) {
	html:focus-within {
		scroll-behavior: auto;
	}

	*,
	*::before,
	*::after {
		animation-duration: 0.01ms !important;
		animation-iteration-count: 1 !important;
		scroll-behavior: auto !important;
		transition-duration: 0.01ms !important;
	}
}

/* ==========================================================================
   FORM VALIDATION & LAYOUT
   ========================================================================== */

/* Form validation styling */
input:invalid,
textarea:invalid,
select:invalid {
	border-color: #dc2626;
}

/* Form row layout */
.form-row {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: var(--wp--preset--spacing--medium);
}

/* Form responsive layout */
@media (max-width: 768px) {
	.form-row {
		grid-template-columns: 1fr;
	}
}

/* ==========================================================================
   BLOCK PATTERNS
   ========================================================================== */

/* Services and testimonials pattern spacing */
.services,
.testimonials {
    padding-bottom: var(--wp--preset--spacing--large);
}

/* Services pattern icon sizing */
.services-icon img {
    width: 64px !important;
    height: 64px !important;
    margin: 0 auto var(--wp--preset--spacing--small);
    display: block;
}

/* ==========================================================================
   PATTERN RESPONSIVE BREAKPOINTS
   ========================================================================== */

/* Tablet breakpoint for services icons */
@media (max-width: 768px) {
    .services-icon img {
        width: 40px !important;
        height: 40px !important;
    }
}

/* Mobile breakpoint for services icons */
@media (max-width: 480px) {
    .services-icon img {
        width: 64px !important;
        height: 64px !important;
    }
}
