/*
Theme Name: Halvano
Theme URI: https://halvano.dev.hackage.ir
Author: Halvano
Description: قالب اختصاصی و سبک «حلوانو» برای فروشگاه حلوای ایرانی. راست‌چین، بهینه برای سرعت و سئو، با الهام از رنگ‌ها و نقوش هنر ایرانی.
Version: 1.0.0
Requires at least: 6.7
Tested up to: 7.1
Requires PHP: 8.0
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: halvano
Tags: rtl-language-support, right-sidebar, custom-colors, custom-menu, featured-images, translation-ready, block-styles, wide-blocks
*/

/* استایل‌های پایه که theme.json پوشش نمی‌دهد */
:root {
  --halvano-saffron: #c8922a;
  --halvano-lapis: #1b3a5c;
  --halvano-turquoise: #2e8b8b;
  --halvano-cream: #fbf6ec;
  --halvano-ink: #241c14;
  --halvano-radius: 10px;
  --halvano-shadow: 0 1px 2px rgba(36, 28, 20, 0.06), 0 8px 24px rgba(36, 28, 20, 0.06);
  --halvano-shadow-hover: 0 2px 4px rgba(36, 28, 20, 0.08), 0 16px 40px rgba(36, 28, 20, 0.12);
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-feature-settings: "ss02", "ss03";
  text-rendering: optimizeLegibility;
}

/* پس‌زمینه‌ی بافت کاغذی ایرانی */
body.halvano-pattern::before {
  /* بافت کاغذی با نقش هندسی ایرانی */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0.6;
  background-image: url("assets/css/pattern.svg");
  background-repeat: repeat;
  background-size: 80px 80px;
}

body > * {
  position: relative;
  z-index: 1;
}

/* تیترهای تزئینی ایرانی */
.halvano-ornament {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  color: var(--halvano-saffron);
}

.halvano-ornament::before,
.halvano-ornament::after {
  content: "";
  height: 1px;
  width: 3rem;
  background: linear-gradient(to left, transparent, currentColor);
}

.halvano-ornament::after {
  background: linear-gradient(to right, transparent, currentColor);
}

/* کارت محصول */
.halvano-card {
  background: #fff;
  border: 1px solid rgba(36, 28, 20, 0.08);
  border-radius: var(--halvano-radius);
  overflow: hidden;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.halvano-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--halvano-shadow-hover);
}

.halvano-card img {
  aspect-ratio: 4 / 3;
  object-fit: cover;
  width: 100%;
  background: var(--halvano-cream);
}

.halvano-card-body {
  padding: 1rem 1.25rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  flex: 1;
}

.halvano-price {
  color: var(--halvano-lapis);
  font-weight: 700;
  font-size: 1.05rem;
}

.halvano-price del {
  color: #9a8b7c;
  font-weight: 400;
  font-size: 0.85rem;
  margin-inline-start: 0.4rem;
}

/* برچسب ویژه */
.halvano-badge {
  position: absolute;
  inset-block-start: 0.75rem;
  inset-inline-start: 0.75rem;
  background: var(--halvano-saffron);
  color: #241c14;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
}

/* دکمه‌ها */
.wp-block-button__link {
  transition: background-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.wp-block-button__link:active {
  transform: translateY(1px);
}

/* ناوبری */
.halvano-nav a {
  position: relative;
  text-decoration: none;
}

.halvano-nav a::after {
  content: "";
  position: absolute;
  inset-block-end: -4px;
  inset-inline-start: 0;
  width: 0;
  height: 2px;
  background: var(--halvano-saffron);
  transition: width 0.25s ease;
}

.halvano-nav a:hover::after,
.halvano-nav a:focus-visible::after {
  width: 100%;
}

/* فوتر */
.halvano-footer {
  background: var(--halvano-lapis);
  color: rgba(255, 255, 255, 0.82);
}

.halvano-footer a {
  color: #fff;
}

.halvano-footer a:hover {
  color: var(--halvano-saffron-light);
}

.halvano-footer h2,
.halvano-footer h3 {
  color: #fff;
}

/* دسترس‌پذیری */
.skip-link:focus {
  background: var(--halvano-lapis);
  color: #fff;
  padding: 0.75rem 1rem;
  z-index: 100000;
}

:focus-visible {
  outline: 2px solid var(--halvano-saffron);
  outline-offset: 2px;
}

/* احترام به تنظیم کاهش حرکت */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

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

/* موبایل */
@media (max-width: 640px) {
  .halvano-card-body {
    padding: 0.85rem 1rem 1rem;
  }
}
