/**
 * RESPONSIVE GRID SYSTEM
 * Mobile-First Responsive Design for Your Life • Your Home
 * 
 * Design Philosophy:
 * - Mobile-first approach (design for mobile, enhance for desktop)
 * - Consistent breakpoints across the platform
 * - Luxury feel maintained across all screen sizes
 * - No horizontal scrolling at any breakpoint
 * - Touch-optimized interactions on mobile
 */

/* ============================================
   BREAKPOINTS
   ============================================ */
:root {
  --breakpoint-mobile: 480px;
  --breakpoint-tablet: 768px;
  --breakpoint-desktop: 1024px;
  --breakpoint-wide: 1440px;
  
  /* Spacing Scale - Consistent across platform */
  --space-xs: 0.25rem;    /* 4px */
  --space-sm: 0.5rem;     /* 8px */
  --space-md: 1rem;       /* 16px */
  --space-lg: 1.5rem;     /* 24px */
  --space-xl: 2rem;       /* 32px */
  --space-2xl: 3rem;      /* 48px */
  --space-3xl: 4rem;      /* 64px */
  
  /* Container Widths */
  --container-mobile: 100%;
  --container-tablet: 100%;
  --container-desktop: 1200px;
  --container-wide: 1600px;
  
  /* Grid Gaps */
  --grid-gap-mobile: var(--space-md);
  --grid-gap-tablet: var(--space-lg);
  --grid-gap-desktop: var(--space-xl);
}

/* ============================================
   RESPONSIVE CONTAINER SYSTEM
   ============================================ */

/* Base container - fluid with max-width constraints */
.ylh-container {
  width: 100%;
  max-width: var(--container-wide);
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--space-md);
  padding-right: var(--space-md);
  box-sizing: border-box;
}

/* Standard container for most content */
.ylh-container-standard {
  width: 100%;
  max-width: var(--container-desktop);
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--space-md);
  padding-right: var(--space-md);
  box-sizing: border-box;
}

/* Narrow container for focused content (forms, articles) */
.ylh-container-narrow {
  width: 100%;
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--space-md);
  padding-right: var(--space-md);
  box-sizing: border-box;
}

/* Full bleed container (no padding) */
.ylh-container-full {
  width: 100%;
  max-width: 100%;
  padding: 0;
}

/* Tablet: increase padding */
@media (min-width: 768px) {
  .ylh-container,
  .ylh-container-standard,
  .ylh-container-narrow {
    padding-left: var(--space-lg);
    padding-right: var(--space-lg);
  }
}

/* Desktop: increase padding further */
@media (min-width: 1024px) {
  .ylh-container,
  .ylh-container-standard,
  .ylh-container-narrow {
    padding-left: var(--space-xl);
    padding-right: var(--space-xl);
  }
}

/* ============================================
   RESPONSIVE GRID SYSTEM
   ============================================ */

/* Flexbox Grid Base */
.ylh-grid {
  display: flex;
  flex-wrap: wrap;
  gap: var(--grid-gap-mobile);
  width: 100%;
}

/* CSS Grid Alternative */
.ylh-grid-css {
  display: grid;
  gap: var(--grid-gap-mobile);
  width: 100%;
}

/* Tablet: increase gaps */
@media (min-width: 768px) {
  .ylh-grid,
  .ylh-grid-css {
    gap: var(--grid-gap-tablet);
  }
}

/* Desktop: increase gaps */
@media (min-width: 1024px) {
  .ylh-grid,
  .ylh-grid-css {
    gap: var(--grid-gap-desktop);
  }
}

/* ============================================
   GRID COLUMN SYSTEM
   ============================================ */

/* Mobile: All columns stack (1 column) */
.ylh-grid > * {
  flex: 1 1 100%;
  min-width: 0; /* Prevent overflow */
}

.ylh-grid-css {
  grid-template-columns: 1fr;
}

/* Tablet: 2 columns by default */
@media (min-width: 768px) {
  .ylh-grid-2,
  .ylh-grid-3,
  .ylh-grid-4 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
  }
  
  .ylh-grid-2-flex > * {
    flex: 1 1 calc(50% - var(--grid-gap-tablet) / 2);
  }
}

/* Desktop: Full column layouts */
@media (min-width: 1024px) {
  /* 2 columns */
  .ylh-grid-2 {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .ylh-grid-2-flex > * {
    flex: 1 1 calc(50% - var(--grid-gap-desktop) / 2);
  }
  
  /* 3 columns */
  .ylh-grid-3 {
    grid-template-columns: repeat(3, 1fr);
  }
  
  .ylh-grid-3-flex > * {
    flex: 1 1 calc(33.333% - var(--grid-gap-desktop) * 2 / 3);
  }
  
  /* 4 columns */
  .ylh-grid-4 {
    grid-template-columns: repeat(4, 1fr);
  }
  
  .ylh-grid-4-flex > * {
    flex: 1 1 calc(25% - var(--grid-gap-desktop) * 3 / 4);
  }
  
  /* Sidebar layouts (1/3 + 2/3) */
  .ylh-grid-sidebar-left {
    grid-template-columns: 1fr 2fr;
  }
  
  .ylh-grid-sidebar-right {
    grid-template-columns: 2fr 1fr;
  }
}

/* ============================================
   RESPONSIVE CARDS
   ============================================ */

.ylh-card {
  background: #FFFFFF;
  border: 1px solid #C8B497;
  border-radius: 2px;
  padding: var(--space-lg);
  box-shadow: 0 2px 8px rgba(58, 53, 44, 0.08);
  transition: all 0.3s ease;
  box-sizing: border-box;
}

.ylh-card:hover {
  box-shadow: 0 4px 16px rgba(58, 53, 44, 0.12);
  transform: translateY(-2px);
}

/* Tablet: increase padding */
@media (min-width: 768px) {
  .ylh-card {
    padding: var(--space-xl);
  }
}

/* Desktop: slight increase */
@media (min-width: 1024px) {
  .ylh-card {
    padding: var(--space-2xl);
  }
}

/* Card header */
.ylh-card-header {
  margin-bottom: var(--space-lg);
  padding-bottom: var(--space-md);
  border-bottom: 1px solid #EFE9DC;
}

.ylh-card-title {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.5rem;
  font-weight: 600;
  color: #3A352C;
  margin: 0 0 var(--space-sm) 0;
  line-height: 1.3;
}

.ylh-card-description {
  font-size: 0.95rem;
  color: #3A352C;
  opacity: 0.8;
  margin: 0;
  line-height: 1.6;
}

/* Tablet: increase title size */
@media (min-width: 768px) {
  .ylh-card-title {
    font-size: 1.75rem;
  }
}

/* Desktop: further increase */
@media (min-width: 1024px) {
  .ylh-card-title {
    font-size: 2rem;
  }
}

/* ============================================
   RESPONSIVE TYPOGRAPHY
   ============================================ */

/* Headings */
.ylh-h1 {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 2rem;
  font-weight: 600;
  color: #3A352C;
  line-height: 1.2;
  margin: 0 0 var(--space-lg) 0;
  letter-spacing: -0.02em;
}

.ylh-h2 {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.5rem;
  font-weight: 600;
  color: #3A352C;
  line-height: 1.3;
  margin: 0 0 var(--space-md) 0;
  letter-spacing: -0.01em;
}

.ylh-h3 {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.25rem;
  font-weight: 600;
  color: #3A352C;
  line-height: 1.4;
  margin: 0 0 var(--space-md) 0;
}

/* Tablet: increase sizes */
@media (min-width: 768px) {
  .ylh-h1 { font-size: 2.5rem; }
  .ylh-h2 { font-size: 1.75rem; }
  .ylh-h3 { font-size: 1.5rem; }
}

/* Desktop: final sizes */
@media (min-width: 1024px) {
  .ylh-h1 { font-size: 3rem; }
  .ylh-h2 { font-size: 2rem; }
  .ylh-h3 { font-size: 1.75rem; }
}

/* Body text */
.ylh-text {
  font-size: 1rem;
  line-height: 1.6;
  color: #3A352C;
  margin: 0 0 var(--space-md) 0;
}

.ylh-text-large {
  font-size: 1.125rem;
  line-height: 1.7;
}

.ylh-text-small {
  font-size: 0.875rem;
  line-height: 1.5;
}

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

.ylh-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.875rem 1.5rem;
  font-size: 1rem;
  font-weight: 600;
  text-align: center;
  text-decoration: none;
  border: none;
  border-radius: 2px;
  cursor: pointer;
  transition: all 0.3s ease;
  box-sizing: border-box;
  white-space: nowrap;
  min-height: 48px; /* Touch-friendly minimum */
}

.ylh-btn-primary {
  background: linear-gradient(135deg, #6B6A45 0%, #5A5940 100%);
  color: #FFFFFF;
  box-shadow: 0 2px 8px rgba(107, 106, 69, 0.25);
}

.ylh-btn-primary:hover {
  background: linear-gradient(135deg, #5A5940 0%, #4A4935 100%);
  box-shadow: 0 4px 12px rgba(107, 106, 69, 0.35);
  transform: translateY(-2px);
}

.ylh-btn-secondary {
  background: #FFFFFF;
  color: #6B6A45;
  border: 2px solid #6B6A45;
}

.ylh-btn-secondary:hover {
  background: #6B6A45;
  color: #FFFFFF;
}

/* Mobile: Full width buttons for better touch */
@media (max-width: 767px) {
  .ylh-btn-mobile-full {
    width: 100%;
    display: flex;
  }
  
  .ylh-btn-group-mobile-stack {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
    width: 100%;
  }
  
  .ylh-btn-group-mobile-stack .ylh-btn {
    width: 100%;
  }
}

/* Desktop: Button groups side by side */
@media (min-width: 768px) {
  .ylh-btn-group {
    display: flex;
    gap: var(--space-md);
    align-items: center;
    flex-wrap: wrap;
  }
}

/* ============================================
   RESPONSIVE SECTIONS & SPACING
   ============================================ */

.ylh-section {
  padding: var(--space-xl) 0;
}

.ylh-section-large {
  padding: var(--space-2xl) 0;
}

/* Tablet: increase spacing */
@media (min-width: 768px) {
  .ylh-section {
    padding: var(--space-2xl) 0;
  }
  
  .ylh-section-large {
    padding: var(--space-3xl) 0;
  }
}

/* Desktop: maximum spacing */
@media (min-width: 1024px) {
  .ylh-section {
    padding: var(--space-3xl) 0;
  }
  
  .ylh-section-large {
    padding: 4rem 0;
  }
}

/* ============================================
   RESPONSIVE UTILITIES
   ============================================ */

/* Hide/Show based on screen size */
.ylh-hide-mobile {
  display: none;
}

.ylh-hide-tablet {
  display: block;
}

.ylh-hide-desktop {
  display: block;
}

@media (min-width: 768px) {
  .ylh-hide-mobile {
    display: block;
  }
  
  .ylh-hide-tablet {
    display: none;
  }
}

@media (min-width: 1024px) {
  .ylh-hide-desktop {
    display: none;
  }
}

/* Text alignment */
.ylh-text-center-mobile {
  text-align: center;
}

@media (min-width: 768px) {
  .ylh-text-center-mobile {
    text-align: left;
  }
}

/* Stack/Unstack */
.ylh-stack-mobile {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

@media (min-width: 768px) {
  .ylh-stack-mobile {
    flex-direction: row;
    align-items: center;
  }
}

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

.ylh-form-group {
  margin-bottom: var(--space-lg);
}

.ylh-form-label {
  display: block;
  font-size: 0.95rem;
  font-weight: 600;
  color: #3A352C;
  margin-bottom: var(--space-sm);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.ylh-form-input,
.ylh-form-select,
.ylh-form-textarea {
  width: 100%;
  padding: 0.875rem 1.25rem;
  font-size: 1rem;
  color: #3A352C;
  background: #FFFFFF;
  border: 2px solid #C8B497;
  border-radius: 2px;
  box-sizing: border-box;
  transition: all 0.3s ease;
  min-height: 48px; /* Touch-friendly */
}

.ylh-form-input:focus,
.ylh-form-select:focus,
.ylh-form-textarea:focus {
  outline: none;
  border-color: #6B6A45;
  box-shadow: 0 0 0 3px rgba(107, 106, 69, 0.1);
}

/* Tablet: slightly larger inputs */
@media (min-width: 768px) {
  .ylh-form-input,
  .ylh-form-select,
  .ylh-form-textarea {
    padding: 1rem 1.5rem;
  }
}

/* Form grid layouts */
.ylh-form-grid {
  display: grid;
  gap: var(--space-lg);
  grid-template-columns: 1fr;
}

@media (min-width: 768px) {
  .ylh-form-grid-2 {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .ylh-form-grid-3 {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* ============================================
   RESPONSIVE TABLES
   ============================================ */

.ylh-table-wrapper {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: var(--space-lg) 0;
}

.ylh-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

.ylh-table th,
.ylh-table td {
  padding: var(--space-md);
  text-align: left;
  border-bottom: 1px solid #EFE9DC;
}

.ylh-table th {
  font-weight: 600;
  color: #6B6A45;
  text-transform: uppercase;
  font-size: 0.85rem;
  letter-spacing: 0.05em;
  background: #F6F2E8;
}

/* Mobile: Stack table or scroll */
@media (max-width: 767px) {
  .ylh-table-mobile-cards {
    display: block;
  }
  
  .ylh-table-mobile-cards thead {
    display: none;
  }
  
  .ylh-table-mobile-cards tbody,
  .ylh-table-mobile-cards tr,
  .ylh-table-mobile-cards td {
    display: block;
    width: 100%;
  }
  
  .ylh-table-mobile-cards tr {
    margin-bottom: var(--space-lg);
    border: 1px solid #C8B497;
    border-radius: 2px;
    padding: var(--space-md);
    background: #FFFFFF;
  }
  
  .ylh-table-mobile-cards td {
    padding: var(--space-sm) 0;
    border: none;
  }
  
  .ylh-table-mobile-cards td:before {
    content: attr(data-label);
    font-weight: 600;
    display: inline-block;
    margin-right: var(--space-sm);
    color: #6B6A45;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
  }
}

/* ============================================
   RESPONSIVE NAVIGATION
   ============================================ */

.ylh-tabs {
  display: flex;
  border-bottom: 2px solid #EFE9DC;
  gap: var(--space-sm);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.ylh-tabs::-webkit-scrollbar {
  display: none;
}

.ylh-tab {
  padding: var(--space-md) var(--space-lg);
  font-size: 0.95rem;
  font-weight: 600;
  color: #3A352C;
  opacity: 0.6;
  text-decoration: none;
  border-bottom: 3px solid transparent;
  transition: all 0.3s ease;
  white-space: nowrap;
  cursor: pointer;
}

.ylh-tab:hover {
  opacity: 0.8;
}

.ylh-tab.active {
  opacity: 1;
  color: #6B6A45;
  border-bottom-color: #6B6A45;
}

/* Desktop: larger tabs */
@media (min-width: 1024px) {
  .ylh-tab {
    padding: var(--space-lg) var(--space-xl);
    font-size: 1rem;
  }
}

/* ============================================
   RESPONSIVE IMAGES & MEDIA
   ============================================ */

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

.ylh-img-cover {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.ylh-aspect-ratio-16-9 {
  position: relative;
  padding-bottom: 56.25%; /* 16:9 */
  overflow: hidden;
}

.ylh-aspect-ratio-4-3 {
  position: relative;
  padding-bottom: 75%; /* 4:3 */
  overflow: hidden;
}

.ylh-aspect-ratio-1-1 {
  position: relative;
  padding-bottom: 100%; /* 1:1 */
  overflow: hidden;
}

.ylh-aspect-ratio-16-9 img,
.ylh-aspect-ratio-4-3 img,
.ylh-aspect-ratio-1-1 img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ============================================
   RESPONSIVE STATS/METRICS
   ============================================ */

.ylh-stat-card {
  background: linear-gradient(135deg, #F6F2E8 0%, #EFE9DC 100%);
  border: 1px solid #C8B497;
  border-radius: 2px;
  padding: var(--space-lg);
  text-align: center;
  transition: all 0.3s ease;
}

.ylh-stat-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 16px rgba(58, 53, 44, 0.12);
}

.ylh-stat-value {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 2rem;
  font-weight: 600;
  color: #6B6A45;
  line-height: 1.2;
  margin: 0 0 var(--space-sm) 0;
}

.ylh-stat-label {
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #3A352C;
  opacity: 0.8;
}

@media (min-width: 1024px) {
  .ylh-stat-value {
    font-size: 2.5rem;
  }
  
  .ylh-stat-label {
    font-size: 0.95rem;
  }
}

/* ============================================
   PRINT STYLES
   ============================================ */

@media print {
  .ylh-hide-print {
    display: none !important;
  }
  
  .ylh-card {
    box-shadow: none;
    border: 1px solid #C8B497;
  }
}
