/*
Theme Name: Hello Elementor Child - Taste of Asia
Theme URI: https://tasteofasia.io
Description: Child theme for Taste of Asia WooCommerce store - IKEA-style UX with crimson/gold branding
Author: Taste of Asia
Template: hello-elementor
Version: 1.0.0
Text Domain: hello-elementor-child-toa
*/

/* =============================================
   FONTS
   ============================================= */

@font-face {
  font-family: "Sora";
  src: url("assets/fonts/Sora-Medium.ttf") format("truetype");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Poppins";
  src: url("assets/fonts/Poppins-Medium.ttf") format("truetype");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Cormorant Garamond";
  src: url("assets/fonts/CormorantGaramond-Medium.ttf") format("truetype");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

/* Reusable utilities — add a class to any element to apply that font. */
.toa-font-sora {
  font-family: var(--toa-font-sora, "Sora", "DM Sans", sans-serif);
}

.toa-font-poppins {
  font-family: var(--toa-font-poppins, "Poppins", "DM Sans", sans-serif);
}

.toa-font-cormorant {
  font-family: var(--toa-font-cormorant, "Cormorant Garamond", Georgia, serif);
}

/* =============================================
   TASTE OF ASIA - DESIGN TOKENS
   ============================================= */

:root {
  /* Brand Colors - hex fallbacks for older browsers */
  --toa-crimson: #82001b;
  --toa-crimson: oklch(24% 0.13 18);
  --toa-crimson-dark: #5a0012;
  --toa-crimson-dark: oklch(18% 0.1 18);
  --toa-crimson-light: #9d0021;
  --toa-crimson-light: oklch(30% 0.13 18);
  --toa-gold: #c9a227;
  --toa-gold: oklch(72% 0.14 62);
  --toa-gold-light: #dbb82e;
  --toa-gold-light: oklch(78% 0.14 62);
  --toa-cream: #f5f5f3;
  --toa-white: #ffffff;
  --toa-text-dark: #1a1a1a;
  --toa-text-muted: #888888;

  /* Typography */
  --toa-font-heading: "Cormorant Garamond", Georgia, serif;
  --toa-font-body: "DM Sans", -apple-system, BlinkMacSystemFont, sans-serif;
  --toa-font-sora: "Sora", "DM Sans", sans-serif;
  --toa-font-poppins: "Poppins", "DM Sans", sans-serif;
  --toa-font-cormorant: "Cormorant Garamond", Georgia, serif;

  /* Spacing & Layout */
  --toa-container-width: 1400px;
  --toa-section-padding: 60px;
  --toa-gutter: 32px;
  --toa-gutter-mobile: 16px;

  /* Hero */
  --toa-hero-gradient: radial-gradient(
    at top right,
    #82011bad 50%,
    #1a0008 90%
  );

  /* Header */
  --toa-header-height: 144px; /* Fallback before JS runs; synced to real height by header-scroll.js (top bar + main nav + category nav) */
  --toa-header-top-bar: 0px; /* Not used with Elementor Pro */
  --toa-header-main-nav: 72px;
  --toa-header-cat-nav: 48px;
  --toa-header-scrolled-bg: rgba(0, 0, 0, 0.7);
  --toa-header-blur: saturate(180%) blur(20px);

  /* Buttons */
  --toa-btn-radius: 4px;
  --toa-btn-padding: 8px 20px;

  /* Shadows */
  --toa-shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.05);
  --toa-shadow-md: 0 4px 16px rgba(0, 0, 0, 0.08);
  --toa-shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.12);

  /* Transitions */
  --toa-transition-fast: 0.15s ease;
  --toa-transition-normal: 0.3s ease;
}

/* =============================================
   ELEMENTOR PRO HEADER COMPATIBILITY
   ============================================= */

/* Elementor Pro sticky header */
.elementor-location-header {
  position: fixed !important;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100 !important;
}

/* Ensure Elementor Pro header sticky container is properly positioned */
.elementor-location-header .e-con.e-parent[data-settings*="sticky"] {
  position: relative;
}

/* =============================================
   BASE RESET & TYPOGRAPHY
   ============================================= */

/* Reset parent theme site-content wrapper - our layouts handle their own padding */
.site-content,
.content-area,
.site-main {
  max-width: none;
  padding: 0;
  margin: 0;
  background: transparent;
}

body {
  font-family: var(--toa-font-body);
  background-color: var(--toa-cream);
  color: var(--toa-text-dark);
  line-height: 1.6;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--toa-font-heading);
  color: var(--toa-crimson);
  line-height: 1.15;
  margin-top: 0;
}

h1 {
  font-size: clamp(32px, 5vw, 58px);
}
h2 {
  font-size: clamp(28px, 4vw, 42px);
}
h3 {
  font-size: clamp(24px, 3vw, 36px);
}
h4 {
  font-size: clamp(20px, 2.5vw, 28px);
}

/* =============================================
   UTILITY CLASSES
   ============================================= */

.toa-container {
  max-width: var(--toa-container-width);
  margin: 0 auto;
  padding: 0 var(--toa-gutter);
}

.toa-section {
  padding: var(--toa-section-padding) 0;
}

/* Buttons - CSS Component System */
.toa-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-decoration: none;
  border: 2px solid transparent;
  padding: var(--toa-btn-padding, 8px 20px);
  font-family: var(--toa-font-body);
  font-weight: 700;
  font-size: 15px;
  border-radius: var(--toa-btn-radius, 4px);
  cursor: pointer;
  transition: all var(--toa-transition-fast);
  white-space: nowrap;
}

.toa-btn:focus-visible {
  outline: 2px solid var(--toa-crimson);
  outline-offset: 2px;
}

/* Variant modifiers */
.toa-btn--primary {
  background: var(--toa-crimson);
  color: var(--toa-white);
}

.toa-btn--primary:hover {
  background: oklch(28% 0.13 18);
}

.toa-btn--secondary {
  background: var(--toa-gold);
  color: var(--toa-crimson);
}

.toa-btn--secondary:hover {
  background: var(--toa-gold-light);
  transform: translateY(-1px);
}

.toa-btn--outline {
  background: transparent;
  color: var(--toa-crimson);
  border: 2px solid var(--toa-crimson);
}

.toa-btn--outline:hover {
  background: var(--toa-crimson);
  color: var(--toa-white);
}

.toa-btn--ghost {
  background: transparent;
  color: var(--toa-gold);
  border: none;
  padding: 0;
}

.toa-btn--ghost:hover {
  color: var(--toa-gold-light);
}

.toa-btn--white {
  background: transparent;
  color: var(--toa-white);
  border: 2px solid rgba(255, 255, 255, 0.6);
  padding: 14px 28px;
}

.toa-btn--white:hover {
  border-color: var(--toa-white);
  background: rgba(255, 255, 255, 0.1);
}

/* Size modifiers */
.toa-btn--sm {
  padding: 8px 16px;
  font-size: 13px;
}

.toa-btn--lg {
  padding: 15px 32px;
  font-size: 16px;
}

/* State modifiers */
.toa-btn--disabled,
.toa-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

.toa-btn--loading {
  position: relative;
  color: transparent !important;
}

.toa-btn--loading::after {
  content: "";
  position: absolute;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.82);
  border-top-color: transparent;
  border-radius: 50%;
  animation: toa-spin 0.6s linear infinite;
}

@keyframes toa-spin {
  to {
    transform: rotate(360deg);
  }
}

/* Icon support */
.toa-btn--icon {
  padding: 12px;
  width: 44px;
  height: 44px;
}

.toa-btn svg,
.toa-btn i {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  color: inherit; /* Inherit parent color for hover states */
}

/* Ensure icons match button color on hover */
.toa-btn:hover svg,
.toa-btn:hover i {
  color: inherit;
}

/* Outline button: icon stays visible on hover (white on crimson bg) */
.toa-btn--outline:hover svg,
.toa-btn--outline:hover i {
  color: var(--toa-white);
}

/* Legacy aliases (backwards compatibility) */
.toa-btn-primary {
  display: inline-flex;
  background: var(--toa-gold);
  color: var(--toa-crimson);
  padding: var(--toa-btn-padding);
  font-family: var(--toa-font-body);
  font-weight: 700;
  font-size: 15px;
  border-radius: var(--toa-btn-radius);
  cursor: pointer;
  transition: all var(--toa-transition-fast);
  text-decoration: none;
}

.toa-btn-primary:hover {
  background: var(--toa-gold-light);
  transform: translateY(-1px);
}

.toa-btn-secondary {
  display: inline-flex;
  background: transparent;
  color: var(--toa-white);
  border: 2px solid rgba(255, 255, 255, 0.6);
  padding: 14px 28px;
  font-family: var(--toa-font-body);
  font-weight: 600;
  font-size: 15px;
  border-radius: var(--toa-btn-radius);
  cursor: pointer;
  transition: all var(--toa-transition-fast);
  text-decoration: none;
}

.toa-btn-secondary:hover {
  border-color: var(--toa-white);
  background: rgba(255, 255, 255, 0.1);
}

.toa-btn-ghost {
  display: inline-flex;
  background: transparent;
  color: var(--toa-gold);
  border: none;
  padding: 0;
  font-family: var(--toa-font-body);
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  transition: color var(--toa-transition-fast);
}

.toa-btn-ghost:hover {
  color: var(--toa-gold-light);
}

/* =============================================
   PLACEHOLDER COMPONENT
   Reusable image placeholder with diagonal stripes
   ============================================= */

.toa-placeholder {
  width: 100%;
  height: 100%;
  min-height: 100px;
  background: repeating-linear-gradient(
    135deg,
    var(--toa-cream-light, #f5ede0) 0px,
    var(--toa-cream-light, #f5ede0) 8px,
    var(--toa-cream-dark, #ede3d4) 8px,
    var(--toa-cream-dark, #ede3d4) 16px
  );
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 8px;
  overflow: hidden;
}

/* Placeholder icon */
.toa-placeholder__icon {
  color: var(--toa-placeholder-color, #b0926a);
  font-size: 32px;
}

.toa-placeholder__icon svg {
  width: 32px;
  height: 32px;
  stroke: currentColor;
  fill: none;
}

/* Placeholder label/text */
.toa-placeholder__label {
  font-family: var(--toa-font-body);
  font-size: 10px;
  color: var(--toa-placeholder-color, #b0926a);
  text-align: center;
  padding: 0 12px;
  line-height: 1.4;
  max-width: 80%;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Size modifiers */
.toa-placeholder--sm {
  min-height: 60px;
}

.toa-placeholder--sm .toa-placeholder__icon {
  font-size: 20px;
}

.toa-placeholder--sm .toa-placeholder__icon svg {
  width: 20px;
  height: 20px;
}

.toa-placeholder--lg {
  min-height: 200px;
}

.toa-placeholder--lg .toa-placeholder__icon {
  font-size: 48px;
}

.toa-placeholder--lg .toa-placeholder__icon svg {
  width: 48px;
  height: 48px;
}

/* Variant: compact (no label) */
.toa-placeholder--compact {
  gap: 0;
}

/* Legacy alias (backwards compatibility) */
.toa-product-placeholder {
  width: 100%;
  height: 100%;
  background: repeating-linear-gradient(
    135deg,
    #f5ede0 0px,
    #f5ede0 8px,
    #ede3d4 8px,
    #ede3d4 16px
  );
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 6px;
}

.toa-product-placeholder-icon {
  font-size: 32px;
  color: #b0926a;
}

.toa-product-placeholder-label {
  font-family: monospace;
  font-size: 10px;
  color: #b0926a;
  text-align: center;
  padding: 0 8px;
  line-height: 1.4;
}

/* =============================================
   SCROLLBAR
   ============================================= */

::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
  background: oklch(24% 0.13 18 / 0.3);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: oklch(24% 0.13 18 / 0.5);
}

/* =============================================
   RESPONSIVE BASE
   ============================================= */

/* NOTE: body no longer needs a top offset — the header is now position:sticky
   (in normal flow), so it occupies space and never overlaps page content. */
@media (max-width: 767px) {
  :root {
    --toa-section-padding: 40px;
    --toa-gutter: 16px;
  }
}

@media (min-width: 768px) and (max-width: 1023px) {
  :root {
    --toa-section-padding: 50px;
    --toa-gutter: 24px;
  }
}

/* =============================================
   PARENT THEME OVERRIDE - MOBILE INLINE PADDING
   Hello Elementor's theme.css adds 10px inline padding to .site-main (and
   header/footer wrappers) at <=575px. TOA sections are full-bleed and manage
   their own gutters, so that padding only causes horizontal scroll on mobile.
   Same selectors, loaded after the parent -> cascade order wins.
   ============================================= */
@media (max-width: 575px) {
  .page-header .entry-title,
  .site-footer .footer-inner,
  .site-footer:not(.dynamic-footer),
  .site-header .header-inner,
  .site-header:not(.dynamic-header),
  body:not([class*=elementor-page-]) .site-main {
    padding-inline-end: 0;
    padding-inline-start: 0;
  }
}

/* =============================================
   SINGLE BLOG POST (single.php)
   Article body sits inside .toa-page-wrapper--single-post; readable measure,
   TOA crimson/gold accents, styled meta + featured image + tags.
   ============================================= */
.toa-single-post {
  max-width: 1400px;
  margin: 0 auto;
  background: var(--toa-white);
  border-radius: 8px;
  box-shadow: var(--toa-shadow-sm);
  padding: 32px 40px 40px;
}

.toa-post-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  margin-bottom: 24px;
  font-family: var(--toa-font-body);
  font-size: 13px;
  color: var(--toa-text-muted);
}

.toa-post-meta__item i {
  color: var(--toa-gold);
  margin-right: 4px;
}

.toa-post-meta__item a {
  color: var(--toa-text-muted);
  text-decoration: none;
}

.toa-post-meta__item a:hover {
  color: var(--toa-crimson);
}

.toa-post-thumb {
  margin: 0 0 28px;
}

.toa-post-thumb img {
  width: 100%;
  height: auto;
  border-radius: 6px;
  display: block;
}

.toa-post-content {
  font-family: var(--toa-font-body);
  font-size: 16px;
  line-height: 1.75;
  color: var(--toa-text-dark);
}

.toa-post-content h2,
.toa-post-content h3,
.toa-post-content h4 {
  font-family: var(--toa-font-heading);
  color: var(--toa-crimson);
  margin: 1.4em 0 0.5em;
}

.toa-post-content a {
  color: var(--toa-crimson);
}

.toa-post-content img {
  max-width: 100%;
  height: auto;
  border-radius: 6px;
}

.toa-post-content blockquote {
  border-left: 3px solid var(--toa-gold);
  margin: 1.5em 0;
  padding: 0.25em 0 0.25em 1.25em;
  color: var(--toa-text-muted);
  font-style: italic;
}

.toa-post-tags {
  margin-top: 32px;
  padding-top: 20px;
  border-top: 1px solid #eee;
  font-family: var(--toa-font-body);
  font-size: 13px;
}

.toa-post-tags__label {
  font-weight: 700;
  color: var(--toa-text-dark);
  margin-right: 6px;
}

.toa-post-tags a {
  display: inline-block;
  background: var(--toa-cream);
  border: 1px solid #ddd;
  border-radius: 20px;
  padding: 4px 12px;
  margin: 0 6px 6px 0;
  color: #666;
  text-decoration: none;
  transition: var(--toa-transition-fast);
}

.toa-post-tags a:hover {
  border-color: var(--toa-crimson);
  color: var(--toa-crimson);
}

@media (max-width: 575px) {
  .toa-single-post {
    padding: 24px 20px 32px;
  }
}

/* =============================================
   BLOG INDEX (home.php)
   Card grid inside .toa-page-wrapper--blog; white cards with hover lift,
   image (or crimson placeholder) on top, meta + title + excerpt below.
   ============================================= */
.toa-blog-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.toa-blog-card {
  background: var(--toa-white);
  border-radius: 6px;
  box-shadow: var(--toa-shadow-sm);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: var(--toa-transition-fast);
}

.toa-blog-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
}

.toa-blog-card__media {
  display: block;
  position: relative;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: var(--toa-cream);
}

/* Absolutely positioned so uploads of any size crop to the card ratio
   instead of stretching the box and misaligning the grid. */
.toa-blog-card__media img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.toa-blog-card__placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  background: var(--toa-crimson);
  color: var(--toa-gold);
  font-family: var(--toa-font-heading);
  font-size: 56px;
  font-weight: 700;
}

.toa-blog-card__body {
  padding: 20px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.toa-blog-card__body .toa-post-meta {
  margin-bottom: 10px;
}

.toa-blog-card__title {
  font-family: var(--toa-font-heading);
  font-size: 22px;
  font-weight: 700;
  line-height: 1.25;
  margin: 0 0 10px;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  min-height: calc(2em * 1.25);
}

.toa-blog-card__title a {
  color: var(--toa-text-dark);
  text-decoration: none;
}

.toa-blog-card__title a:hover {
  color: var(--toa-crimson);
}

.toa-blog-card__excerpt {
  font-family: var(--toa-font-body);
  font-size: 14px;
  line-height: 1.6;
  color: var(--toa-text-muted);
  margin: 0 0 16px;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  overflow: hidden;
}

.toa-blog-card__more {
  margin-top: auto;
  align-self: flex-start;
  font-family: var(--toa-font-body);
  font-size: 13px;
  font-weight: 700;
  color: var(--toa-crimson);
  text-decoration: none;
}

.toa-blog-card__more:hover {
  color: var(--toa-gold);
}

.toa-blog-pagination {
  margin-top: 32px;
}

.toa-blog-pagination .nav-links {
  display: flex;
  justify-content: center;
  gap: 8px;
}

.toa-blog-pagination .page-numbers {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 40px;
  padding: 0 8px;
  background: var(--toa-white);
  border: 1px solid #ddd;
  border-radius: 4px;
  font-family: var(--toa-font-body);
  font-size: 14px;
  color: var(--toa-text-dark);
  text-decoration: none;
}

.toa-blog-pagination .page-numbers.current {
  background: var(--toa-crimson);
  border-color: var(--toa-crimson);
  color: var(--toa-white);
}

.toa-blog-empty {
  background: var(--toa-white);
  border-radius: 6px;
  box-shadow: var(--toa-shadow-sm);
  padding: 60px 20px;
  text-align: center;
  font-family: var(--toa-font-body);
}

@media (max-width: 991px) {
  .toa-blog-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 575px) {
  .toa-blog-grid {
    grid-template-columns: 1fr;
  }
}
