/* ============================================
   E-MAGAZINE VIEWER - READ ONLY FRONTEND
   No editing capabilities
============================================ */

/* Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,400;0,500;0,600;0,700;1,400;1,500&family=Montserrat:wght@300;400;500;600;700;800&family=Libre+Baskerville:ital,wght@0,400;0,700;1,400&family=DM+Sans:wght@300;400;500;600;700&family=Playfair+Display:ital,wght@0,400;0,500;0,600;0,700;1,400&display=swap');

/* Reset */
.emag-viewer-wrapper *, .emag-viewer-wrapper *::before, .emag-viewer-wrapper *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* CSS Variables */
:root {
  --emag-font-display: 'Playfair Display', Georgia, serif;
  --emag-font-body: 'DM Sans', -apple-system, sans-serif;
  --emag-font-accent: 'Montserrat', sans-serif;
}

/* Theme: Classic */
.emag-theme-classic {
  --emag-primary: #1a1a1a;
  --emag-secondary: #f8f7f4;
  --emag-accent: #c9a87c;
  --emag-accent-rgb: 201, 168, 124;
  --emag-text: #2d2d2d;
  --emag-text-light: #6b6b6b;
  --emag-white: #ffffff;
}

/* Theme: Corporate */
.emag-theme-corporate {
  --emag-primary: #0f172a;
  --emag-secondary: #f1f5f9;
  --emag-accent: #3b82f6;
  --emag-accent-rgb: 59, 130, 246;
  --emag-text: #1e293b;
  --emag-text-light: #64748b;
  --emag-white: #ffffff;
}

/* Theme: Executive */
.emag-theme-executive {
  --emag-primary: #18181b;
  --emag-secondary: #fafafa;
  --emag-accent: #a855f7;
  --emag-accent-rgb: 168, 85, 247;
  --emag-text: #27272a;
  --emag-text-light: #71717a;
  --emag-white: #ffffff;
}

/* Theme: Nonprofit */
.emag-theme-nonprofit {
  --emag-primary: #14532d;
  --emag-secondary: #f0fdf4;
  --emag-accent: #22c55e;
  --emag-accent-rgb: 34, 197, 94;
  --emag-text: #166534;
  --emag-text-light: #4ade80;
  --emag-white: #ffffff;
}

/* Theme: Teal */
.emag-theme-teal {
  --emag-primary: #134e4a;
  --emag-secondary: #f0fdfa;
  --emag-accent: #14b8a6;
  --emag-accent-rgb: 20, 184, 166;
  --emag-text: #115e59;
  --emag-text-light: #5eead4;
  --emag-white: #ffffff;
}

/* Theme: Warm */
.emag-theme-warm {
  --emag-primary: #7c2d12;
  --emag-secondary: #fff7ed;
  --emag-accent: #f97316;
  --emag-accent-rgb: 249, 115, 22;
  --emag-text: #9a3412;
  --emag-text-light: #fdba74;
  --emag-white: #ffffff;
}

/* Viewer Wrapper - Contained within page */
.emag-viewer-wrapper {
  position: relative !important;
  display: block !important;
  width: 100% !important;
  max-width: 1200px;
  height: 550px; /* Default, can be overridden via shortcode */
  margin: 20px auto !important;
  background: #0a0a0a;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 10px 40px rgba(0,0,0,0.15);
}

/* Ensure it doesn't go fullscreen */
.emag-viewer-wrapper,
.emag-viewer-wrapper * {
  position: relative;
}

.emag-viewer-wrapper .emag-viewer {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
}

/* Viewer */
.emag-viewer {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  background: #0a0a0a;
}

/* Header */
.emag-viewer-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 20px;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(10px);
  z-index: 10;
}

.emag-viewer-title {
  font-family: var(--emag-font-accent);
  font-size: 0.9rem;
  font-weight: 600;
  color: white;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.emag-viewer-controls {
  display: flex;
  align-items: center;
  gap: 15px;
}

.emag-viewer-page {
  font-family: var(--emag-font-body);
  font-size: 0.85rem;
  color: rgba(255,255,255,0.8);
}

/* Body */
.emag-viewer-body {
  flex: 1;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 20px 60px;
}

/* Pages Container */
.emag-viewer-pages {
  position: relative;
  width: 100%;
  max-width: 900px;
  height: 100%;
  perspective: 1500px;
}

/* Page Item */
.emag-viewer-page-item {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: white;
  border-radius: 4px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.3);
  overflow: hidden;
  overflow-y: auto;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.emag-viewer-page-item.active {
  opacity: 1;
  visibility: visible;
  z-index: 5;
}

/* Navigation Buttons */
.emag-viewer-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  background: rgba(255,255,255,0.15);
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  z-index: 20;
}

.emag-viewer-nav:hover {
  background: rgba(255,255,255,0.25);
}

.emag-viewer-nav:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.emag-viewer-nav svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: white;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.emag-viewer-nav-prev { left: 10px; }
.emag-viewer-nav-next { right: 10px; }

/* Progress Bar */
.emag-viewer-progress {
  height: 3px;
  background: rgba(255,255,255,0.1);
}

.emag-viewer-progress-bar {
  height: 100%;
  background: var(--emag-accent, #c9a87c);
  transition: width 0.3s ease;
}

/* Animations */
.emag-animate-fadeIn {
  animation: emagFadeIn 0.5s ease forwards;
}

.emag-animate-slideUp {
  animation: emagSlideUp 0.5s ease forwards;
}

.emag-animate-zoomIn {
  animation: emagZoomIn 0.5s ease forwards;
}

@keyframes emagFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes emagSlideUp {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes emagZoomIn {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

/* Exit animations */
.emag-viewer-page-item.exit-left {
  opacity: 0;
  transform: translateX(-30px);
}

.emag-viewer-page-item.exit-right {
  opacity: 0;
  transform: translateX(30px);
}

/* Lightbox */
.emag-lightbox {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.95);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999999;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s, visibility 0.3s;
}

.emag-lightbox.active {
  opacity: 1;
  visibility: visible;
}

.emag-lightbox-close {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 44px;
  height: 44px;
  background: rgba(255,255,255,0.1);
  border: none;
  border-radius: 50%;
  color: white;
  font-size: 28px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.emag-lightbox-content {
  max-width: 90%;
  max-height: 90%;
  text-align: center;
}

.emag-lightbox-image {
  max-width: 100%;
  max-height: 80vh;
  object-fit: contain;
  border-radius: 4px;
}

.emag-lightbox-caption {
  margin-top: 15px;
  color: rgba(255,255,255,0.8);
  font-family: var(--emag-font-body);
  font-size: 0.95rem;
}

/* Zoomable images */
.emag-zoomable {
  cursor: zoom-in;
}

/* Responsive */
@media (max-width: 768px) {
  .emag-viewer-body {
    padding: 15px 50px;
  }
  
  .emag-viewer-nav {
    width: 38px;
    height: 38px;
  }
  
  .emag-viewer-nav-prev { left: 5px; }
  .emag-viewer-nav-next { right: 5px; }
}
      --emag-ui-surface: #25252b;
      --emag-ui-border: #35353d;
      --emag-ui-text: #ffffff;
      --emag-ui-text-dim: #9999a5;
      --emag-ui-accent: #6366f1;
      --emag-ui-accent-hover: #818cf8;
      --emag-ui-success: #10b981;
      --emag-ui-danger: #ef4444;
      
      /* Typography */
      --emag-font-display: 'Playfair Display', Georgia, serif;
      --emag-font-body: 'DM Sans', -apple-system, sans-serif;
      --emag-font-accent: 'Montserrat', sans-serif;
    }
    
    /* Theme: Classic (Default) */
    .emag-theme-classic {
      --emag-primary: #1a1a1a;
      --emag-secondary: #f8f7f4;
      --emag-accent: #c9a87c;
      --emag-accent-rgb: 201, 168, 124;
      --emag-text: #2d2d2d;
      --emag-text-light: #6b6b6b;
      --emag-white: #ffffff;
      --emag-gradient: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
    }
    
    /* Theme: Corporate Blue */
    .emag-theme-corporate {
      --emag-primary: #0f172a;
      --emag-secondary: #f1f5f9;
      --emag-accent: #3b82f6;
      --emag-accent-rgb: 59, 130, 246;
      --emag-text: #1e293b;
      --emag-text-light: #64748b;
      --emag-white: #ffffff;
      --emag-gradient: linear-gradient(135deg, #0f172a 0%, #1e3a5f 100%);
    }
    
    /* Theme: Executive Dark */
    .emag-theme-executive {
      --emag-primary: #18181b;
      --emag-secondary: #fafafa;
      --emag-accent: #a855f7;
      --emag-accent-rgb: 168, 85, 247;
      --emag-text: #27272a;
      --emag-text-light: #71717a;
      --emag-white: #ffffff;
      --emag-gradient: linear-gradient(135deg, #18181b 0%, #3f3f46 100%);
    }
    
    /* Theme: Nonprofit Green */
    .emag-theme-nonprofit {
      --emag-primary: #14532d;
      --emag-secondary: #f0fdf4;
      --emag-accent: #22c55e;
      --emag-accent-rgb: 34, 197, 94;
      --emag-text: #166534;
      --emag-text-light: #4ade80;
      --emag-white: #ffffff;
      --emag-gradient: linear-gradient(135deg, #14532d 0%, #166534 100%);
    }
    
    /* Theme: Modern Teal */
    .emag-theme-teal {
      --emag-primary: #134e4a;
      --emag-secondary: #f0fdfa;
      --emag-accent: #14b8a6;
      --emag-accent-rgb: 20, 184, 166;
      --emag-text: #115e59;
      --emag-text-light: #5eead4;
      --emag-white: #ffffff;
      --emag-gradient: linear-gradient(135deg, #134e4a 0%, #0f766e 100%);
    }
    
    /* Theme: Warm Professional */
    .emag-theme-warm {
      --emag-primary: #451a03;
      --emag-secondary: #fffbeb;
      --emag-accent: #f59e0b;
      --emag-accent-rgb: 245, 158, 11;
      --emag-text: #78350f;
      --emag-text-light: #b45309;
      --emag-white: #ffffff;
      --emag-gradient: linear-gradient(135deg, #451a03 0%, #78350f 100%);
    }
    
    /* ============================================
       BUILDER INTERFACE
    ============================================ */
    .emag-builder {
      display: flex;
      height: 100vh;
      font-family: var(--emag-font-body);
      background: var(--emag-ui-bg);
      color: var(--emag-ui-text);
    }
    
    /* Sidebar */
    .emag-sidebar {
      width: 340px;
      min-width: 340px;
      background: var(--emag-ui-surface);
      border-right: 1px solid var(--emag-ui-border);
      display: flex;
      flex-direction: column;
      overflow: hidden;
    }
    
    .emag-sidebar-header {
      padding: 14px 18px;
      border-bottom: 1px solid var(--emag-ui-border);
      flex-shrink: 0;
      display: flex;
      align-items: center;
      justify-content: space-between;
    }
    
    .emag-logo {
      font-family: var(--emag-font-display);
      font-size: 1.3rem;
      font-weight: 600;
      letter-spacing: -0.5px;
    }
    
    .emag-logo span {
      color: var(--emag-ui-accent);
    }
    
    .emag-badge {
      background: linear-gradient(135deg, var(--emag-ui-accent), #a855f7);
      color: white;
      font-size: 9px;
      font-weight: 700;
      padding: 3px 6px;
      border-radius: 4px;
      text-transform: uppercase;
      letter-spacing: 0.5px;
    }
    
    .emag-sidebar-content {
      flex: 1;
      display: flex;
      flex-direction: column;
      overflow: hidden;
    }
    
    .emag-pages-section {
      flex: 1;
      min-height: 0;
      display: flex;
      flex-direction: column;
      padding: 14px 18px;
      border-bottom: 1px solid var(--emag-ui-border);
    }
    
    .emag-section-title {
      font-size: 9px;
      text-transform: uppercase;
      letter-spacing: 1.5px;
      color: var(--emag-ui-text-dim);
      margin-bottom: 10px;
      font-weight: 600;
      flex-shrink: 0;
    }
    
    .emag-page-list-wrapper {
      flex: 1;
      overflow-y: auto;
      margin-bottom: 10px;
    }
    
    .emag-page-list {
      list-style: none;
    }
    
    .emag-page-item {
      display: flex;
      align-items: center;
      justify-content: space-between;
      padding: 8px 10px;
      background: var(--emag-ui-bg);
      border-radius: 6px;
      margin-bottom: 5px;
      cursor: pointer;
      transition: all 0.2s ease;
      border: 2px solid transparent;
    }
    
    .emag-page-item:hover {
      background: rgba(99, 102, 241, 0.1);
    }
    
    .emag-page-item.active {
      border-color: var(--emag-ui-accent);
      background: rgba(99, 102, 241, 0.15);
    }
    
    .emag-page-item-info {
      display: flex;
      align-items: center;
      gap: 8px;
    }
    
    .emag-page-item-num {
      width: 24px;
      height: 24px;
      background: var(--emag-ui-border);
      border-radius: 5px;
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 10px;
      font-weight: 600;
    }
    
    .emag-page-item-label {
      font-size: 11px;
      font-weight: 500;
    }
    
    .emag-page-item-type {
      font-size: 9px;
      color: var(--emag-ui-text-dim);
    }
    
    .emag-page-item-actions {
      display: flex;
      gap: 3px;
      opacity: 0;
      transition: opacity 0.2s ease;
    }
    
    .emag-page-item:hover .emag-page-item-actions {
      opacity: 1;
    }
    
    .emag-btn-icon {
      width: 24px;
      height: 24px;
      border: none;
      background: var(--emag-ui-border);
      color: var(--emag-ui-text);
      border-radius: 4px;
      cursor: pointer;
      display: flex;
      align-items: center;
      justify-content: center;
      transition: all 0.2s ease;
    }
    
    .emag-btn-icon:hover {
      background: var(--emag-ui-accent);
    }
    
    .emag-btn-icon.danger:hover {
      background: var(--emag-ui-danger);
    }
    
    .emag-btn-icon svg {
      width: 11px;
      height: 11px;
    }
    
    .emag-add-page-btn {
      width: 100%;
      padding: 9px;
      border: 2px dashed var(--emag-ui-border);
      background: transparent;
      color: var(--emag-ui-text-dim);
      border-radius: 6px;
      font-size: 11px;
      font-weight: 500;
      cursor: pointer;
      transition: all 0.2s ease;
      font-family: inherit;
      flex-shrink: 0;
    }
    
    .emag-add-page-btn:hover {
      border-color: var(--emag-ui-accent);
      color: var(--emag-ui-accent);
      background: rgba(99, 102, 241, 0.05);
    }
    
    /* Settings Section */
    .emag-settings-section {
      padding: 14px 18px;
      flex-shrink: 0;
      max-height: 200px;
      overflow-y: auto;
    }
    
    .emag-setting-group {
      margin-bottom: 10px;
    }
    
    .emag-setting-group:last-child {
      margin-bottom: 0;
    }
    
    .emag-setting-label {
      display: block;
      font-size: 10px;
      font-weight: 500;
      margin-bottom: 5px;
      color: var(--emag-ui-text);
    }
    
    .emag-select {
      width: 100%;
      padding: 7px 9px;
      background: var(--emag-ui-bg);
      border: 1px solid var(--emag-ui-border);
      color: var(--emag-ui-text);
      border-radius: 5px;
      font-size: 11px;
      font-family: inherit;
      cursor: pointer;
    }
    
    .emag-select:focus {
      outline: none;
      border-color: var(--emag-ui-accent);
    }
    
    /* Theme Swatches */
    .emag-theme-swatches {
      display: flex;
      gap: 6px;
      flex-wrap: wrap;
    }
    
    .emag-theme-swatch {
      width: 28px;
      height: 28px;
      border-radius: 6px;
      cursor: pointer;
      border: 2px solid transparent;
      transition: all 0.2s ease;
      position: relative;
    }
    
    .emag-theme-swatch:hover {
      transform: scale(1.1);
    }
    
    .emag-theme-swatch.active {
      border-color: var(--emag-ui-accent);
    }
    
    .emag-theme-swatch.active::after {
      content: '✓';
      position: absolute;
      top: 50%;
      left: 50%;
      transform: translate(-50%, -50%);
      color: white;
      font-size: 12px;
      font-weight: bold;
      text-shadow: 0 1px 2px rgba(0,0,0,0.5);
    }
    
    .swatch-classic { background: linear-gradient(135deg, #1a1a1a 50%, #c9a87c 50%); }
    .swatch-corporate { background: linear-gradient(135deg, #0f172a 50%, #3b82f6 50%); }
    .swatch-executive { background: linear-gradient(135deg, #18181b 50%, #a855f7 50%); }
    .swatch-nonprofit { background: linear-gradient(135deg, #14532d 50%, #22c55e 50%); }
    .swatch-teal { background: linear-gradient(135deg, #134e4a 50%, #14b8a6 50%); }
    .swatch-warm { background: linear-gradient(135deg, #451a03 50%, #f59e0b 50%); }
    
    /* Sidebar Footer */
    .emag-sidebar-footer {
      padding: 14px 18px;
      border-top: 1px solid var(--emag-ui-border);
      flex-shrink: 0;
    }
    
    .emag-btn {
      width: 100%;
      padding: 9px 14px;
      border: none;
      border-radius: 6px;
      font-size: 11px;
      font-weight: 600;
      font-family: inherit;
      cursor: pointer;
      transition: all 0.2s ease;
    }
    
    .emag-btn-primary {
      background: var(--emag-ui-accent);
      color: white;
    }
    
    .emag-btn-primary:hover {
      background: var(--emag-ui-accent-hover);
      transform: translateY(-1px);
    }
    
    .emag-btn-secondary {
      background: var(--emag-ui-border);
      color: var(--emag-ui-text);
      margin-top: 6px;
    }
    
    .emag-btn-secondary:hover {
      background: #45454f;
    }
    
    /* ============================================
       MAIN CANVAS AREA
    ============================================ */
    .emag-canvas {
      flex: 1;
      display: flex;
      flex-direction: column;
      overflow: hidden;
    }
    
    .emag-toolbar {
      display: flex;
      justify-content: space-between;
      align-items: center;
      padding: 10px 18px;
      background: var(--emag-ui-surface);
      border-bottom: 1px solid var(--emag-ui-border);
    }
    
    .emag-toolbar-group {
      display: flex;
      align-items: center;
      gap: 12px;
    }
    
    .emag-zoom-controls {
      display: flex;
      align-items: center;
      gap: 6px;
    }
    
    .emag-zoom-btn {
      width: 28px;
      height: 28px;
      border: 1px solid var(--emag-ui-border);
      background: var(--emag-ui-bg);
      color: var(--emag-ui-text);
      border-radius: 5px;
      cursor: pointer;
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 14px;
      transition: all 0.2s ease;
    }
    
    .emag-zoom-btn:hover {
      border-color: var(--emag-ui-accent);
      color: var(--emag-ui-accent);
    }
    
    .emag-zoom-level {
      font-size: 10px;
      color: var(--emag-ui-text-dim);
      min-width: 36px;
      text-align: center;
    }
    
    .emag-mode-toggle {
      display: flex;
      background: var(--emag-ui-bg);
      border-radius: 5px;
      padding: 3px;
    }
    
    .emag-mode-btn {
      padding: 5px 12px;
      border: none;
      background: transparent;
      color: var(--emag-ui-text-dim);
      font-size: 10px;
      font-weight: 500;
      border-radius: 4px;
      cursor: pointer;
      font-family: inherit;
      transition: all 0.2s ease;
    }
    
    .emag-mode-btn.active {
      background: var(--emag-ui-accent);
      color: white;
    }
    
    .emag-preview-area {
      flex: 1;
      overflow: auto;
      padding: 25px;
      display: flex;
      justify-content: center;
      align-items: flex-start;
      background: #0f0f12;
    }
    
    .emag-preview-container {
      background: white;
      box-shadow: 0 25px 80px rgba(0, 0, 0, 0.5);
      transition: transform 0.3s ease;
      transform-origin: top center;
    }
    
    .emag-magazine-page {
      width: 900px;
      min-height: 600px;
      position: relative;
      overflow: hidden;
    }
    
    /* ============================================
       LAYOUT PICKER MODAL
    ============================================ */
    .emag-modal-overlay {
      position: fixed;
      top: 0;
      left: 0;
      right: 0;
      bottom: 0;
      background: rgba(0, 0, 0, 0.85);
      display: flex;
      justify-content: center;
      align-items: center;
      z-index: 1000;
      opacity: 0;
      visibility: hidden;
      transition: all 0.3s ease;
    }
    
    .emag-modal-overlay.active {
      opacity: 1;
      visibility: visible;
    }
    
    .emag-modal {
      background: var(--emag-ui-surface);
      border-radius: 14px;
      width: 92%;
      max-width: 1100px;
      max-height: 88vh;
      overflow: hidden;
      transform: scale(0.9);
      transition: transform 0.3s ease;
    }
    
    .emag-modal-overlay.active .emag-modal {
      transform: scale(1);
    }
    
    .emag-modal-header {
      display: flex;
      justify-content: space-between;
      align-items: center;
      padding: 18px 22px;
      border-bottom: 1px solid var(--emag-ui-border);
    }
    
    .emag-modal-title {
      font-size: 1.1rem;
      font-weight: 600;
    }
    
    .emag-modal-close {
      width: 32px;
      height: 32px;
      border: none;
      background: var(--emag-ui-bg);
      color: var(--emag-ui-text);
      border-radius: 6px;
      cursor: pointer;
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 18px;
      transition: all 0.2s ease;
    }
    
    .emag-modal-close:hover {
      background: var(--emag-ui-danger);
    }
    
    .emag-modal-body {
      padding: 22px;
      overflow-y: auto;
      max-height: calc(88vh - 75px);
    }
    
    .emag-layout-tabs {
      display: flex;
      gap: 6px;
      margin-bottom: 18px;
      flex-wrap: wrap;
    }
    
    .emag-layout-tab {
      padding: 7px 14px;
      border: 1px solid var(--emag-ui-border);
      background: transparent;
      color: var(--emag-ui-text-dim);
      border-radius: 5px;
      font-size: 11px;
      font-weight: 500;
      cursor: pointer;
      font-family: inherit;
      transition: all 0.2s ease;
    }
    
    .emag-layout-tab:hover {
      border-color: var(--emag-ui-accent);
      color: var(--emag-ui-text);
    }
    
    .emag-layout-tab.active {
      background: var(--emag-ui-accent);
      border-color: var(--emag-ui-accent);
      color: white;
    }
    
    .emag-layout-grid {
      display: grid;
      grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
      gap: 14px;
    }
    
    .emag-layout-card {
      background: var(--emag-ui-bg);
      border-radius: 8px;
      overflow: hidden;
      cursor: pointer;
      border: 2px solid transparent;
      transition: all 0.2s ease;
    }
    
    .emag-layout-card:hover {
      border-color: var(--emag-ui-accent);
      transform: translateY(-2px);
    }
    
    .emag-layout-preview {
      aspect-ratio: 3/2;
      background: #2a2a32;
      position: relative;
      overflow: hidden;
    }
    
    .emag-layout-info {
      padding: 10px;
    }
    
    .emag-layout-name {
      font-size: 12px;
      font-weight: 600;
      margin-bottom: 2px;
    }
    
    .emag-layout-desc {
      font-size: 10px;
      color: var(--emag-ui-text-dim);
    }
    
    /* ============================================
       IMAGE LIGHTBOX
    ============================================ */
    .emag-lightbox {
      position: fixed;
      top: 0;
      left: 0;
      right: 0;
      bottom: 0;
      background: rgba(0, 0, 0, 0.95);
      z-index: 2000;
      display: flex;
      align-items: center;
      justify-content: center;
      opacity: 0;
      visibility: hidden;
      transition: all 0.3s ease;
    }
    
    .emag-lightbox.active {
      opacity: 1;
      visibility: visible;
    }
    
    .emag-lightbox-close {
      position: absolute;
      top: 20px;
      right: 20px;
      width: 48px;
      height: 48px;
      background: rgba(255, 255, 255, 0.1);
      border: none;
      border-radius: 50%;
      color: white;
      font-size: 26px;
      cursor: pointer;
      display: flex;
      align-items: center;
      justify-content: center;
      transition: all 0.2s ease;
      z-index: 10;
    }
    
    .emag-lightbox-close:hover {
      background: rgba(255, 255, 255, 0.2);
      transform: scale(1.1);
    }
    
    .emag-lightbox-content {
      max-width: 90%;
      max-height: 90%;
      display: flex;
      flex-direction: column;
      align-items: center;
    }
    
    .emag-lightbox-image {
      max-width: 100%;
      max-height: 80vh;
      object-fit: contain;
      border-radius: 4px;
      transform: scale(0.9);
      transition: transform 0.3s ease;
    }
    
    .emag-lightbox.active .emag-lightbox-image {
      transform: scale(1);
    }
    
    .emag-lightbox-caption {
      margin-top: 18px;
      color: rgba(255, 255, 255, 0.8);
      font-size: 13px;
      text-align: center;
      max-width: 600px;
    }
    
    /* ============================================
       EDITABLE CONTENT STYLES
    ============================================ */
    .emag-editable {
      cursor: text;
      outline: none;
      transition: box-shadow 0.2s ease;
      min-height: 1em;
    }
    
    .emag-editable:hover {
      box-shadow: inset 0 0 0 2px rgba(99, 102, 241, 0.3);
    }
    
    .emag-editable:focus {
      box-shadow: inset 0 0 0 2px var(--emag-ui-accent);
    }
    
    .emag-editable:empty::before {
      content: attr(data-placeholder);
      color: #999;
      font-style: italic;
    }
    
    .emag-image-editable {
      cursor: pointer;
      position: relative;
    }
    
    .emag-image-editable::after {
      content: 'Click to change image';
      position: absolute;
      top: 50%;
      left: 50%;
      transform: translate(-50%, -50%);
      background: rgba(0,0,0,0.75);
      color: white;
      padding: 8px 16px;
      border-radius: 6px;
      font-size: 11px;
      opacity: 0;
      transition: opacity 0.2s ease;
      pointer-events: none;
    }
    
    .emag-image-editable:hover::after {
      opacity: 1;
    }
    
    .emag-zoomable {
      cursor: zoom-in;
      transition: transform 0.2s ease;
    }
    
    .emag-zoomable:hover {
      transform: scale(1.02);
    }
    
    /* ============================================
       PREMIUM LAYOUT STYLES
    ============================================ */
    
    /* Decorative Elements */
    .emag-accent-line {
      width: 60px;
      height: 3px;
      background: var(--emag-accent);
    }
    
    .emag-accent-line-thin {
      width: 40px;
      height: 2px;
      background: var(--emag-accent);
    }
    
    .emag-decorative-border {
      border: 1px solid rgba(var(--emag-accent-rgb), 0.3);
      padding: 30px;
    }
    
    /* --- COVER LAYOUTS --- */
    
    /* Cover 1: Classic Centered */
    .emag-layout-cover-1 {
      height: 100%;
      min-height: 600px;
      display: flex;
      flex-direction: column;
      justify-content: center;
      align-items: center;
      text-align: center;
      padding: 60px;
      background: var(--emag-gradient);
      color: white;
    }
    
    .emag-layout-cover-1 .cover-tag {
      font-family: var(--emag-font-accent);
      font-size: 11px;
      text-transform: uppercase;
      letter-spacing: 4px;
      color: var(--emag-accent);
      margin-bottom: 25px;
    }
    
    .emag-layout-cover-1 .cover-title {
      font-family: var(--emag-font-display);
      font-size: clamp(2.8rem, 7vw, 4.5rem);
      font-weight: 700;
      line-height: 1.05;
      margin-bottom: 25px;
    }
    
    .emag-layout-cover-1 .cover-subtitle {
      font-family: var(--emag-font-body);
      font-size: clamp(1rem, 2vw, 1.15rem);
      font-weight: 300;
      color: rgba(255,255,255,0.75);
      max-width: 480px;
      line-height: 1.7;
      margin-bottom: 35px;
    }
    
    .emag-layout-cover-1 .cover-date {
      font-family: var(--emag-font-accent);
      font-size: 10px;
      text-transform: uppercase;
      letter-spacing: 3px;
      color: rgba(255,255,255,0.5);
    }
    
    /* Cover 2: Full Bleed Image */
    .emag-layout-cover-2 {
      height: 100%;
      min-height: 600px;
      position: relative;
      display: flex;
      flex-direction: column;
      justify-content: flex-end;
      padding: 50px;
      color: white;
    }
    
    .emag-layout-cover-2 .cover-bg {
      position: absolute;
      top: 0;
      left: 0;
      right: 0;
      bottom: 0;
      background-size: cover;
      background-position: center;
      background-image: url('https://images.unsplash.com/photo-1497366216548-37526070297c?w=1200&q=80');
    }
    
    .emag-layout-cover-2 .cover-overlay {
      position: absolute;
      top: 0;
      left: 0;
      right: 0;
      bottom: 0;
      background: linear-gradient(transparent 30%, rgba(0,0,0,0.9));
    }
    
    .emag-layout-cover-2 .cover-content {
      position: relative;
      z-index: 1;
      max-width: 550px;
    }
    
    .emag-layout-cover-2 .cover-tag {
      font-family: var(--emag-font-accent);
      font-size: 10px;
      text-transform: uppercase;
      letter-spacing: 3px;
      color: var(--emag-accent);
      margin-bottom: 12px;
    }
    
    .emag-layout-cover-2 .cover-title {
      font-family: var(--emag-font-display);
      font-size: clamp(2.2rem, 5vw, 3.5rem);
      font-weight: 700;
      line-height: 1.1;
      margin-bottom: 12px;
    }
    
    .emag-layout-cover-2 .cover-subtitle {
      font-size: 0.95rem;
      color: rgba(255,255,255,0.8);
      line-height: 1.6;
    }
    
    .emag-layout-cover-2 .cover-masthead {
      position: absolute;
      top: 35px;
      left: 50px;
      right: 50px;
      display: flex;
      justify-content: space-between;
      align-items: center;
      z-index: 2;
    }
    
    .emag-layout-cover-2 .masthead-logo {
      font-family: var(--emag-font-accent);
      font-size: 1.6rem;
      font-weight: 700;
      letter-spacing: 2px;
    }
    
    .emag-layout-cover-2 .masthead-date {
      font-size: 10px;
      text-transform: uppercase;
      letter-spacing: 2px;
      opacity: 0.7;
    }
    
    /* Cover 3: Split Design */
    .emag-layout-cover-3 {
      height: 100%;
      min-height: 600px;
      display: grid;
      grid-template-columns: 1fr 1fr;
    }
    
    .emag-layout-cover-3 .cover-left {
      background: var(--emag-secondary);
      display: flex;
      flex-direction: column;
      justify-content: center;
      padding: 50px;
    }
    
    .emag-layout-cover-3 .cover-right {
      background-size: cover;
      background-position: center;
      background-image: url('https://images.unsplash.com/photo-1497366216548-37526070297c?w=800&q=80');
    }
    
    .emag-layout-cover-3 .cover-tag {
      font-family: var(--emag-font-accent);
      font-size: 10px;
      text-transform: uppercase;
      letter-spacing: 3px;
      color: var(--emag-accent);
      margin-bottom: 18px;
    }
    
    .emag-layout-cover-3 .cover-title {
      font-family: var(--emag-font-display);
      font-size: clamp(1.8rem, 3.5vw, 3rem);
      font-weight: 600;
      line-height: 1.15;
      color: var(--emag-primary);
      margin-bottom: 18px;
    }
    
    .emag-layout-cover-3 .cover-subtitle {
      font-size: 0.95rem;
      color: var(--emag-text-light);
      line-height: 1.7;
      margin-bottom: 25px;
    }
    
    .emag-layout-cover-3 .cover-date {
      font-size: 10px;
      text-transform: uppercase;
      letter-spacing: 2px;
      color: var(--emag-text-light);
    }
    
    /* Cover 4: Annual Report Style (NEW) */
    .emag-layout-cover-4 {
      height: 100%;
      min-height: 600px;
      background: var(--emag-white);
      display: flex;
      flex-direction: column;
    }
    
    .emag-layout-cover-4 .cover-top {
      padding: 40px 50px;
      display: flex;
      justify-content: space-between;
      align-items: flex-start;
    }
    
    .emag-layout-cover-4 .cover-logo {
      font-family: var(--emag-font-accent);
      font-size: 1.1rem;
      font-weight: 700;
      color: var(--emag-primary);
      letter-spacing: 1px;
    }
    
    .emag-layout-cover-4 .cover-year {
      font-family: var(--emag-font-display);
      font-size: 4rem;
      font-weight: 700;
      color: var(--emag-accent);
      line-height: 1;
    }
    
    .emag-layout-cover-4 .cover-main {
      flex: 1;
      display: flex;
      align-items: center;
      padding: 0 50px;
    }
    
    .emag-layout-cover-4 .cover-content {
      max-width: 500px;
    }
    
    .emag-layout-cover-4 .cover-tag {
      font-family: var(--emag-font-accent);
      font-size: 10px;
      text-transform: uppercase;
      letter-spacing: 3px;
      color: var(--emag-accent);
      margin-bottom: 15px;
    }
    
    .emag-layout-cover-4 .cover-title {
      font-family: var(--emag-font-display);
      font-size: clamp(2.5rem, 5vw, 4rem);
      font-weight: 700;
      line-height: 1.1;
      color: var(--emag-primary);
      margin-bottom: 20px;
    }
    
    .emag-layout-cover-4 .cover-subtitle {
      font-size: 1rem;
      color: var(--emag-text-light);
      line-height: 1.7;
    }
    
    .emag-layout-cover-4 .cover-image {
      position: absolute;
      right: 0;
      bottom: 0;
      width: 45%;
      height: 70%;
      background-size: cover;
      background-position: center;
      background-image: url('https://images.unsplash.com/photo-1560472354-b33ff0c44a43?w=800&q=80');
    }
    
    .emag-layout-cover-4 .cover-bottom {
      padding: 30px 50px;
      background: var(--emag-primary);
      color: white;
      display: flex;
      justify-content: space-between;
      align-items: center;
    }
    
    .emag-layout-cover-4 .cover-info {
      font-size: 11px;
      text-transform: uppercase;
      letter-spacing: 2px;
      opacity: 0.8;
    }
    
    /* Cover 5: Newsletter Style (NEW) */
    .emag-layout-cover-5 {
      height: 100%;
      min-height: 600px;
      background: var(--emag-secondary);
      padding: 45px;
      display: flex;
      flex-direction: column;
    }
    
    .emag-layout-cover-5 .cover-header {
      display: flex;
      justify-content: space-between;
      align-items: flex-start;
      margin-bottom: 35px;
      padding-bottom: 25px;
      border-bottom: 2px solid var(--emag-primary);
    }
    
    .emag-layout-cover-5 .cover-brand {
      display: flex;
      flex-direction: column;
    }
    
    .emag-layout-cover-5 .cover-logo {
      font-family: var(--emag-font-display);
      font-size: 2.2rem;
      font-weight: 700;
      color: var(--emag-primary);
      line-height: 1;
      margin-bottom: 5px;
    }
    
    .emag-layout-cover-5 .cover-tagline {
      font-size: 11px;
      color: var(--emag-text-light);
      text-transform: uppercase;
      letter-spacing: 2px;
    }
    
    .emag-layout-cover-5 .cover-issue {
      text-align: right;
    }
    
    .emag-layout-cover-5 .issue-label {
      font-size: 10px;
      text-transform: uppercase;
      letter-spacing: 2px;
      color: var(--emag-text-light);
    }
    
    .emag-layout-cover-5 .issue-number {
      font-family: var(--emag-font-display);
      font-size: 2.5rem;
      font-weight: 700;
      color: var(--emag-accent);
      line-height: 1;
    }
    
    .emag-layout-cover-5 .cover-featured {
      flex: 1;
      display: grid;
      grid-template-columns: 1.2fr 1fr;
      gap: 30px;
    }
    
    .emag-layout-cover-5 .featured-main {
      background: var(--emag-white);
      border-radius: 8px;
      overflow: hidden;
      box-shadow: 0 10px 40px rgba(0,0,0,0.08);
    }
    
    .emag-layout-cover-5 .featured-image {
      height: 200px;
      background-size: cover;
      background-position: center;
      background-image: url('https://images.unsplash.com/photo-1552664730-d307ca884978?w=800&q=80');
    }
    
    .emag-layout-cover-5 .featured-content {
      padding: 25px;
    }
    
    .emag-layout-cover-5 .featured-tag {
      font-family: var(--emag-font-accent);
      font-size: 9px;
      text-transform: uppercase;
      letter-spacing: 2px;
      color: var(--emag-accent);
      margin-bottom: 10px;
    }
    
    .emag-layout-cover-5 .featured-title {
      font-family: var(--emag-font-display);
      font-size: 1.6rem;
      font-weight: 600;
      color: var(--emag-primary);
      line-height: 1.25;
      margin-bottom: 12px;
    }
    
    .emag-layout-cover-5 .featured-desc {
      font-size: 0.9rem;
      color: var(--emag-text-light);
      line-height: 1.6;
    }
    
    .emag-layout-cover-5 .featured-sidebar {
      display: flex;
      flex-direction: column;
      gap: 15px;
    }
    
    .emag-layout-cover-5 .sidebar-item {
      background: var(--emag-white);
      padding: 20px;
      border-radius: 8px;
      border-left: 3px solid var(--emag-accent);
      box-shadow: 0 5px 20px rgba(0,0,0,0.05);
    }
    
    .emag-layout-cover-5 .sidebar-title {
      font-family: var(--emag-font-display);
      font-size: 1rem;
      font-weight: 600;
      color: var(--emag-primary);
      margin-bottom: 6px;
    }
    
    .emag-layout-cover-5 .sidebar-page {
      font-size: 10px;
      color: var(--emag-accent);
      text-transform: uppercase;
      letter-spacing: 1px;
    }
    
    /* --- CONTENTS LAYOUTS --- */
    
    .emag-layout-contents-1 {
      min-height: 600px;
      padding: 55px;
      background: var(--emag-white);
    }
    
    .emag-layout-contents-1 .contents-header {
      margin-bottom: 45px;
    }
    
    .emag-layout-contents-1 .contents-tag {
      font-family: var(--emag-font-accent);
      font-size: 10px;
      text-transform: uppercase;
      letter-spacing: 3px;
      color: var(--emag-accent);
      margin-bottom: 12px;
    }
    
    .emag-layout-contents-1 .contents-title {
      font-family: var(--emag-font-display);
      font-size: 2.8rem;
      font-weight: 600;
      color: var(--emag-primary);
    }
    
    .emag-layout-contents-1 .contents-list {
      display: flex;
      flex-direction: column;
    }
    
    .emag-layout-contents-1 .contents-item {
      display: grid;
      grid-template-columns: 55px 1fr auto;
      gap: 22px;
      align-items: baseline;
      padding: 22px 0;
      border-bottom: 1px solid rgba(0,0,0,0.08);
      transition: all 0.2s ease;
    }
    
    .emag-layout-contents-1 .contents-item:hover {
      padding-left: 12px;
      background: var(--emag-secondary);
    }
    
    .emag-layout-contents-1 .item-num {
      font-family: var(--emag-font-display);
      font-size: 1.8rem;
      font-weight: 300;
      color: var(--emag-accent);
    }
    
    .emag-layout-contents-1 .item-title {
      font-family: var(--emag-font-display);
      font-size: 1.3rem;
      font-weight: 500;
      color: var(--emag-primary);
      margin-bottom: 4px;
    }
    
    .emag-layout-contents-1 .item-desc {
      font-size: 0.85rem;
      color: var(--emag-text-light);
    }
    
    .emag-layout-contents-1 .item-page {
      font-family: var(--emag-font-accent);
      font-size: 11px;
      color: var(--emag-text-light);
    }
    
    /* Contents 2: Grid */
    .emag-layout-contents-2 {
      min-height: 600px;
      padding: 45px;
      background: var(--emag-primary);
      color: white;
    }
    
    .emag-layout-contents-2 .contents-header {
      display: flex;
      justify-content: space-between;
      align-items: flex-end;
      margin-bottom: 35px;
      padding-bottom: 18px;
      border-bottom: 1px solid rgba(255,255,255,0.15);
    }
    
    .emag-layout-contents-2 .contents-title {
      font-family: var(--emag-font-display);
      font-size: 2.2rem;
      font-weight: 500;
    }
    
    .emag-layout-contents-2 .contents-issue {
      font-size: 10px;
      text-transform: uppercase;
      letter-spacing: 2px;
      opacity: 0.6;
    }
    
    .emag-layout-contents-2 .contents-grid {
      display: grid;
      grid-template-columns: repeat(3, 1fr);
      gap: 22px;
    }
    
    .emag-layout-contents-2 .grid-item {
      cursor: pointer;
      transition: transform 0.3s ease;
    }
    
    .emag-layout-contents-2 .grid-item:hover {
      transform: translateY(-4px);
    }
    
    .emag-layout-contents-2 .grid-thumb {
      aspect-ratio: 4/3;
      background-size: cover;
      background-position: center;
      border-radius: 6px;
      margin-bottom: 12px;
      background-color: rgba(255,255,255,0.1);
    }
    
    .emag-layout-contents-2 .grid-num {
      font-size: 10px;
      color: var(--emag-accent);
      margin-bottom: 4px;
    }
    
    .emag-layout-contents-2 .grid-title {
      font-family: var(--emag-font-display);
      font-size: 1.05rem;
      font-weight: 500;
      line-height: 1.3;
    }
    
    /* Contents 3: Minimal */
    .emag-layout-contents-3 {
      min-height: 600px;
      display: flex;
      background: var(--emag-secondary);
    }
    
    .emag-layout-contents-3 .contents-left {
      width: 40%;
      padding: 55px;
      display: flex;
      flex-direction: column;
      justify-content: center;
    }
    
    .emag-layout-contents-3 .contents-right {
      width: 60%;
      background-size: cover;
      background-position: center;
      background-image: url('https://images.unsplash.com/photo-1497366216548-37526070297c?w=800&q=80');
    }
    
    .emag-layout-contents-3 .contents-tag {
      font-family: var(--emag-font-accent);
      font-size: 10px;
      text-transform: uppercase;
      letter-spacing: 3px;
      color: var(--emag-text-light);
      margin-bottom: 12px;
    }
    
    .emag-layout-contents-3 .contents-title {
      font-family: var(--emag-font-display);
      font-size: 2.2rem;
      font-weight: 600;
      color: var(--emag-primary);
      margin-bottom: 35px;
    }
    
    .emag-layout-contents-3 .contents-item {
      display: flex;
      justify-content: space-between;
      padding: 14px 0;
      border-bottom: 1px solid rgba(0,0,0,0.1);
      cursor: pointer;
      transition: all 0.2s ease;
    }
    
    .emag-layout-contents-3 .contents-item:hover {
      padding-left: 8px;
    }
    
    .emag-layout-contents-3 .item-title {
      font-family: var(--emag-font-display);
      font-size: 1.05rem;
      color: var(--emag-primary);
    }
    
    .emag-layout-contents-3 .item-page {
      font-size: 11px;
      color: var(--emag-text-light);
    }
    
    /* --- INSIDE PAGE LAYOUTS --- */
    
    .emag-layout-inside-1 {
      min-height: 600px;
      display: grid;
      grid-template-columns: 1fr 1fr;
    }
    
    .emag-layout-inside-1 .article-image {
      background-size: cover;
      background-position: center;
      background-image: url('https://images.unsplash.com/photo-1552664730-d307ca884978?w=800&q=80');
    }
    
    .emag-layout-inside-1 .article-content {
      padding: 45px;
      background: var(--emag-white);
      display: flex;
      flex-direction: column;
      justify-content: center;
    }
    
    .emag-layout-inside-1 .article-tag {
      font-family: var(--emag-font-accent);
      font-size: 10px;
      text-transform: uppercase;
      letter-spacing: 2px;
      color: var(--emag-accent);
      margin-bottom: 12px;
    }
    
    .emag-layout-inside-1 .article-title {
      font-family: var(--emag-font-display);
      font-size: clamp(1.6rem, 2.8vw, 2.2rem);
      font-weight: 600;
      line-height: 1.2;
      color: var(--emag-primary);
      margin-bottom: 12px;
    }
    
    .emag-layout-inside-1 .article-subtitle {
      font-family: var(--emag-font-display);
      font-size: 1rem;
      font-style: italic;
      color: var(--emag-text-light);
      margin-bottom: 22px;
    }
    
    .emag-layout-inside-1 .article-text {
      font-size: 0.95rem;
      line-height: 1.8;
      color: var(--emag-text);
    }
    
    .emag-layout-inside-1 .article-text p {
      margin-bottom: 1em;
    }
    
    .emag-layout-inside-1 .article-dropcap::first-letter {
      font-family: var(--emag-font-display);
      font-size: 3.5em;
      float: left;
      line-height: 0.8;
      padding-right: 12px;
      color: var(--emag-accent);
    }
    
    /* Inside 2: Two Column */
    .emag-layout-inside-2 {
      min-height: 600px;
      padding: 55px;
      background: var(--emag-white);
    }
    
    .emag-layout-inside-2 .article-header {
      text-align: center;
      margin-bottom: 45px;
      max-width: 650px;
      margin-left: auto;
      margin-right: auto;
    }
    
    .emag-layout-inside-2 .article-tag {
      font-family: var(--emag-font-accent);
      font-size: 10px;
      text-transform: uppercase;
      letter-spacing: 3px;
      color: var(--emag-accent);
      margin-bottom: 12px;
    }
    
    .emag-layout-inside-2 .article-title {
      font-family: var(--emag-font-display);
      font-size: 2.2rem;
      font-weight: 600;
      color: var(--emag-primary);
      margin-bottom: 10px;
    }
    
    .emag-layout-inside-2 .article-subtitle {
      font-family: var(--emag-font-display);
      font-size: 1.1rem;
      font-style: italic;
      color: var(--emag-text-light);
    }
    
    .emag-layout-inside-2 .article-body {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 45px;
    }
    
    .emag-layout-inside-2 .article-text {
      font-size: 0.92rem;
      line-height: 1.85;
      color: var(--emag-text);
    }
    
    .emag-layout-inside-2 .article-text p {
      margin-bottom: 1.1em;
    }
    
    .emag-layout-inside-2 .article-quote {
      padding: 25px;
      background: var(--emag-secondary);
      border-left: 3px solid var(--emag-accent);
      margin: 18px 0;
    }
    
    .emag-layout-inside-2 .quote-text {
      font-family: var(--emag-font-display);
      font-size: 1.2rem;
      font-style: italic;
      color: var(--emag-primary);
      line-height: 1.5;
    }
    
    .emag-layout-inside-2 .quote-author {
      font-size: 11px;
      color: var(--emag-text-light);
      margin-top: 12px;
    }
    
    /* Inside 3: Full Width Hero */
    .emag-layout-inside-3 {
      min-height: 600px;
      background: var(--emag-white);
    }
    
    .emag-layout-inside-3 .article-hero {
      height: 320px;
      background-size: cover;
      background-position: center;
      background-image: url('https://images.unsplash.com/photo-1497366216548-37526070297c?w=1200&q=80');
      position: relative;
    }
    
    .emag-layout-inside-3 .hero-overlay {
      position: absolute;
      bottom: 0;
      left: 0;
      right: 0;
      padding: 35px 55px;
      background: linear-gradient(transparent, rgba(0,0,0,0.85));
      color: white;
    }
    
    .emag-layout-inside-3 .article-tag {
      font-family: var(--emag-font-accent);
      font-size: 10px;
      text-transform: uppercase;
      letter-spacing: 2px;
      color: var(--emag-accent);
      margin-bottom: 8px;
    }
    
    .emag-layout-inside-3 .article-title {
      font-family: var(--emag-font-display);
      font-size: 2.2rem;
      font-weight: 600;
      line-height: 1.15;
    }
    
    .emag-layout-inside-3 .article-content {
      padding: 45px 55px;
      max-width: 850px;
      margin: 0 auto;
    }
    
    .emag-layout-inside-3 .article-text {
      font-size: 1rem;
      line-height: 1.9;
      color: var(--emag-text);
      column-count: 2;
      column-gap: 45px;
    }
    
    .emag-layout-inside-3 .article-text p {
      margin-bottom: 1.1em;
    }
    
    /* --- VIDEO LAYOUTS --- */
    
    /* Video 1: Standard (existing) */
    .emag-layout-video-1 {
      min-height: 600px;
      padding: 55px;
      background: var(--emag-primary);
      color: white;
    }
    
    .emag-layout-video-1 .video-header {
      text-align: center;
      margin-bottom: 35px;
    }
    
    .emag-layout-video-1 .video-tag {
      font-family: var(--emag-font-accent);
      font-size: 10px;
      text-transform: uppercase;
      letter-spacing: 3px;
      color: var(--emag-accent);
      margin-bottom: 12px;
    }
    
    .emag-layout-video-1 .video-title {
      font-family: var(--emag-font-display);
      font-size: 2rem;
      font-weight: 500;
    }
    
    .emag-layout-video-1 .video-container {
      width: 100%;
      max-width: 750px;
      height: 400px;
      margin: 0 auto 35px;
      background: #000;
      border-radius: 8px;
      overflow: hidden;
    }
    
    .emag-layout-video-1 .video-container iframe,
    .emag-layout-video-1 .video-container video {
      width: 100%;
      height: 100%;
      border: none;
    }
    
    .emag-layout-video-1 .video-text {
      max-width: 650px;
      margin: 0 auto;
      text-align: center;
      font-size: 0.95rem;
      line-height: 1.8;
      color: rgba(255,255,255,0.8);
    }
    
    /* Video 2: Interview Style (NEW) */
    .emag-layout-video-2 {
      min-height: 600px;
      padding: 50px;
      background: var(--emag-secondary);
    }
    
    .emag-layout-video-2 .video-grid {
      display: grid;
      grid-template-columns: 1.3fr 1fr;
      gap: 40px;
      align-items: start;
    }
    
    .emag-layout-video-2 .video-main {
    }
    
    .emag-layout-video-2 .video-tag {
      font-family: var(--emag-font-accent);
      font-size: 10px;
      text-transform: uppercase;
      letter-spacing: 2px;
      color: var(--emag-accent);
      margin-bottom: 10px;
    }
    
    .emag-layout-video-2 .video-title {
      font-family: var(--emag-font-display);
      font-size: 1.8rem;
      font-weight: 600;
      color: var(--emag-primary);
      margin-bottom: 20px;
      line-height: 1.2;
    }
    
    .emag-layout-video-2 .video-container {
      width: 100%;
      height: 100%;
      min-height: 250px;
      background: #000;
      border-radius: 8px;
      overflow: hidden;
      box-shadow: 0 15px 50px rgba(0,0,0,0.15);
    }
    
    .emag-layout-video-2 .video-container iframe,
    .emag-layout-video-2 .video-container video {
      width: 100%;
      height: 100%;
      border: none;
    }
    
    .emag-layout-video-2 .video-sidebar {
      background: var(--emag-white);
      border-radius: 8px;
      padding: 30px;
      box-shadow: 0 10px 40px rgba(0,0,0,0.08);
    }
    
    .emag-layout-video-2 .speaker-image {
      width: 80px;
      height: 80px;
      border-radius: 50%;
      background-size: cover;
      background-position: center;
      background-image: url('https://images.unsplash.com/photo-1560250097-0b93528c311a?w=200&q=80');
      margin-bottom: 18px;
      border: 3px solid var(--emag-accent);
    }
    
    .emag-layout-video-2 .speaker-name {
      font-family: var(--emag-font-display);
      font-size: 1.2rem;
      font-weight: 600;
      color: var(--emag-primary);
      margin-bottom: 4px;
    }
    
    .emag-layout-video-2 .speaker-title {
      font-size: 0.85rem;
      color: var(--emag-accent);
      margin-bottom: 15px;
    }
    
    .emag-layout-video-2 .speaker-bio {
      font-size: 0.9rem;
      line-height: 1.7;
      color: var(--emag-text-light);
      margin-bottom: 20px;
    }
    
    .emag-layout-video-2 .video-duration {
      display: flex;
      align-items: center;
      gap: 8px;
      font-size: 0.85rem;
      color: var(--emag-text-light);
      padding-top: 15px;
      border-top: 1px solid rgba(0,0,0,0.08);
    }
    
    .emag-layout-video-2 .duration-icon {
      width: 16px;
      height: 16px;
      background: var(--emag-accent);
      border-radius: 50%;
    }
    
    /* Video 3: Webinar/Presentation Style (NEW) */
    .emag-layout-video-3 {
      min-height: 600px;
      background: var(--emag-white);
    }
    
    .emag-layout-video-3 .video-hero {
      background: var(--emag-primary);
      padding: 40px 50px;
      color: white;
    }
    
    .emag-layout-video-3 .video-hero-content {
      display: flex;
      justify-content: space-between;
      align-items: center;
    }
    
    .emag-layout-video-3 .video-info {
      max-width: 450px;
    }
    
    .emag-layout-video-3 .video-type {
      display: inline-block;
      font-family: var(--emag-font-accent);
      font-size: 9px;
      text-transform: uppercase;
      letter-spacing: 2px;
      background: var(--emag-accent);
      color: white;
      padding: 5px 12px;
      border-radius: 4px;
      margin-bottom: 15px;
    }
    
    .emag-layout-video-3 .video-title {
      font-family: var(--emag-font-display);
      font-size: 1.8rem;
      font-weight: 600;
      margin-bottom: 10px;
      line-height: 1.2;
    }
    
    .emag-layout-video-3 .video-meta {
      font-size: 0.9rem;
      opacity: 0.8;
    }
    
    .emag-layout-video-3 .video-stats {
      display: flex;
      gap: 30px;
    }
    
    .emag-layout-video-3 .stat-item {
      text-align: center;
    }
    
    .emag-layout-video-3 .stat-value {
      font-family: var(--emag-font-display);
      font-size: 2rem;
      font-weight: 700;
      color: var(--emag-accent);
    }
    
    .emag-layout-video-3 .stat-label {
      font-size: 10px;
      text-transform: uppercase;
      letter-spacing: 1px;
      opacity: 0.7;
    }
    
    .emag-layout-video-3 .video-body {
      padding: 40px 50px;
    }
    
    .emag-layout-video-3 .video-container {
      width: 100%;
      height: 300px;
      background: #000;
      border-radius: 8px;
      overflow: hidden;
      margin-bottom: 30px;
      box-shadow: 0 20px 60px rgba(0,0,0,0.12);
    }
    
    .emag-layout-video-3 .video-container iframe,
    .emag-layout-video-3 .video-container video {
      width: 100%;
      height: 100%;
      border: none;
    }
    
    .emag-layout-video-3 .video-description {
      font-size: 0.95rem;
      line-height: 1.8;
      color: var(--emag-text);
      max-width: 800px;
    }
    
    /* Video 4: Key Points Style (NEW) */
    .emag-layout-video-4 {
      min-height: 600px;
      display: grid;
      grid-template-columns: 1fr 1fr;
    }
    
    .emag-layout-video-4 .video-side {
      background: var(--emag-primary);
      padding: 45px;
      color: white;
      display: flex;
      flex-direction: column;
    }
    
    .emag-layout-video-4 .video-tag {
      font-family: var(--emag-font-accent);
      font-size: 10px;
      text-transform: uppercase;
      letter-spacing: 2px;
      color: var(--emag-accent);
      margin-bottom: 12px;
    }
    
    .emag-layout-video-4 .video-title {
      font-family: var(--emag-font-display);
      font-size: 1.8rem;
      font-weight: 600;
      margin-bottom: 20px;
      line-height: 1.2;
    }
    
    .emag-layout-video-4 .video-container {
      position: relative;
      width: 100%;
      padding-bottom: 56.25%;
      background: #000;
      border-radius: 8px;
      overflow: hidden;
      margin-bottom: 25px;
    }
    
    .emag-layout-video-4 .video-container iframe {
      position: absolute;
      top: 0;
      left: 0;
      width: 100%;
      height: 100%;
      border: none;
    }
    
    .emag-layout-video-4 .video-credit {
      font-size: 0.85rem;
      opacity: 0.7;
      margin-top: auto;
    }
    
    .emag-layout-video-4 .content-side {
      background: var(--emag-secondary);
      padding: 45px;
    }
    
    .emag-layout-video-4 .content-label {
      font-family: var(--emag-font-accent);
      font-size: 10px;
      text-transform: uppercase;
      letter-spacing: 2px;
      color: var(--emag-accent);
      margin-bottom: 20px;
    }
    
    .emag-layout-video-4 .key-point {
      display: flex;
      gap: 15px;
      margin-bottom: 22px;
      align-items: flex-start;
    }
    
    .emag-layout-video-4 .point-number {
      width: 32px;
      height: 32px;
      background: var(--emag-accent);
      color: white;
      border-radius: 50%;
      display: flex;
      align-items: center;
      justify-content: center;
      font-family: var(--emag-font-accent);
      font-size: 12px;
      font-weight: 700;
      flex-shrink: 0;
    }
    
    .emag-layout-video-4 .point-content {
      flex: 1;
    }
    
    .emag-layout-video-4 .point-title {
      font-family: var(--emag-font-display);
      font-size: 1.05rem;
      font-weight: 600;
      color: var(--emag-primary);
      margin-bottom: 5px;
    }
    
    .emag-layout-video-4 .point-desc {
      font-size: 0.9rem;
      color: var(--emag-text-light);
      line-height: 1.6;
    }
    
    /* --- CORPORATE LAYOUTS (NEW) --- */
    
    /* Corporate 1: CEO Letter */
    .emag-layout-corporate-1 {
      min-height: 600px;
      padding: 55px;
      background: var(--emag-white);
    }
    
    .emag-layout-corporate-1 .letter-header {
      display: flex;
      gap: 35px;
      margin-bottom: 35px;
      padding-bottom: 30px;
      border-bottom: 1px solid rgba(0,0,0,0.08);
    }
    
    .emag-layout-corporate-1 .leader-image {
      width: 140px;
      height: 170px;
      background-size: cover;
      background-position: center top;
      background-image: url('https://images.unsplash.com/photo-1560250097-0b93528c311a?w=400&q=80');
      border-radius: 6px;
      flex-shrink: 0;
    }
    
    .emag-layout-corporate-1 .leader-info {
      display: flex;
      flex-direction: column;
      justify-content: center;
    }
    
    .emag-layout-corporate-1 .letter-tag {
      font-family: var(--emag-font-accent);
      font-size: 10px;
      text-transform: uppercase;
      letter-spacing: 2px;
      color: var(--emag-accent);
      margin-bottom: 10px;
    }
    
    .emag-layout-corporate-1 .letter-title {
      font-family: var(--emag-font-display);
      font-size: 2rem;
      font-weight: 600;
      color: var(--emag-primary);
      margin-bottom: 15px;
      line-height: 1.2;
    }
    
    .emag-layout-corporate-1 .leader-name {
      font-family: var(--emag-font-display);
      font-size: 1.15rem;
      font-weight: 600;
      color: var(--emag-primary);
    }
    
    .emag-layout-corporate-1 .leader-title {
      font-size: 0.9rem;
      color: var(--emag-text-light);
    }
    
    .emag-layout-corporate-1 .letter-content {
      column-count: 2;
      column-gap: 45px;
    }
    
    .emag-layout-corporate-1 .letter-text {
      font-size: 0.95rem;
      line-height: 1.85;
      color: var(--emag-text);
    }
    
    .emag-layout-corporate-1 .letter-text p {
      margin-bottom: 1em;
    }
    
    .emag-layout-corporate-1 .letter-signature {
      margin-top: 25px;
      padding-top: 20px;
      border-top: 1px solid rgba(0,0,0,0.08);
    }
    
    .emag-layout-corporate-1 .signature-image {
      height: 45px;
      margin-bottom: 8px;
      font-family: 'Brush Script MT', cursive;
      font-size: 28px;
      color: var(--emag-primary);
    }
    
    .emag-layout-corporate-1 .signature-name {
      font-weight: 600;
      color: var(--emag-primary);
    }
    
    /* Corporate 2: Stats & Highlights */
    .emag-layout-corporate-2 {
      min-height: 600px;
      background: var(--emag-gradient);
      color: white;
      padding: 50px;
    }
    
    .emag-layout-corporate-2 .stats-header {
      text-align: center;
      margin-bottom: 45px;
    }
    
    .emag-layout-corporate-2 .stats-tag {
      font-family: var(--emag-font-accent);
      font-size: 10px;
      text-transform: uppercase;
      letter-spacing: 3px;
      color: var(--emag-accent);
      margin-bottom: 12px;
    }
    
    .emag-layout-corporate-2 .stats-title {
      font-family: var(--emag-font-display);
      font-size: 2.5rem;
      font-weight: 600;
    }
    
    .emag-layout-corporate-2 .stats-grid {
      display: grid;
      grid-template-columns: repeat(4, 1fr);
      gap: 25px;
      margin-bottom: 45px;
    }
    
    .emag-layout-corporate-2 .stat-card {
      background: rgba(255,255,255,0.08);
      border-radius: 10px;
      padding: 28px;
      text-align: center;
      border: 1px solid rgba(255,255,255,0.1);
      transition: all 0.2s ease;
    }
    
    .emag-layout-corporate-2 .stat-card:hover {
      background: rgba(255,255,255,0.12);
      transform: translateY(-3px);
    }
    
    .emag-layout-corporate-2 .stat-value {
      font-family: var(--emag-font-display);
      font-size: 2.8rem;
      font-weight: 700;
      color: var(--emag-accent);
      margin-bottom: 8px;
      line-height: 1;
    }
    
    .emag-layout-corporate-2 .stat-label {
      font-size: 0.85rem;
      opacity: 0.8;
      line-height: 1.4;
    }
    
    .emag-layout-corporate-2 .highlights {
      display: grid;
      grid-template-columns: repeat(2, 1fr);
      gap: 20px;
    }
    
    .emag-layout-corporate-2 .highlight-item {
      display: flex;
      gap: 15px;
      align-items: flex-start;
      background: rgba(255,255,255,0.05);
      padding: 20px;
      border-radius: 8px;
    }
    
    .emag-layout-corporate-2 .highlight-icon {
      width: 40px;
      height: 40px;
      background: var(--emag-accent);
      border-radius: 8px;
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 18px;
      flex-shrink: 0;
    }
    
    .emag-layout-corporate-2 .highlight-content {
      flex: 1;
    }
    
    .emag-layout-corporate-2 .highlight-title {
      font-family: var(--emag-font-display);
      font-size: 1.05rem;
      font-weight: 600;
      margin-bottom: 5px;
    }
    
    .emag-layout-corporate-2 .highlight-text {
      font-size: 0.85rem;
      opacity: 0.8;
      line-height: 1.5;
    }
    
    /* Corporate 3: Team Spotlight */
    .emag-layout-corporate-3 {
      min-height: 600px;
      padding: 50px;
      background: var(--emag-secondary);
    }
    
    .emag-layout-corporate-3 .team-header {
      text-align: center;
      margin-bottom: 40px;
    }
    
    .emag-layout-corporate-3 .team-tag {
      font-family: var(--emag-font-accent);
      font-size: 10px;
      text-transform: uppercase;
      letter-spacing: 3px;
      color: var(--emag-accent);
      margin-bottom: 12px;
    }
    
    .emag-layout-corporate-3 .team-title {
      font-family: var(--emag-font-display);
      font-size: 2.2rem;
      font-weight: 600;
      color: var(--emag-primary);
    }
    
    .emag-layout-corporate-3 .team-grid {
      display: grid;
      grid-template-columns: repeat(4, 1fr);
      gap: 25px;
    }
    
    .emag-layout-corporate-3 .team-member {
      background: var(--emag-white);
      border-radius: 10px;
      overflow: hidden;
      box-shadow: 0 8px 30px rgba(0,0,0,0.06);
      transition: all 0.2s ease;
    }
    
    .emag-layout-corporate-3 .team-member:hover {
      transform: translateY(-4px);
      box-shadow: 0 15px 45px rgba(0,0,0,0.1);
    }
    
    .emag-layout-corporate-3 .member-image {
      aspect-ratio: 1;
      background-size: cover;
      background-position: center top;
      background-color: #e5e5e5;
    }
    
    .emag-layout-corporate-3 .member-info {
      padding: 18px;
      text-align: center;
    }
    
    .emag-layout-corporate-3 .member-name {
      font-family: var(--emag-font-display);
      font-size: 1.05rem;
      font-weight: 600;
      color: var(--emag-primary);
      margin-bottom: 3px;
    }
    
    .emag-layout-corporate-3 .member-title {
      font-size: 0.8rem;
      color: var(--emag-accent);
      margin-bottom: 10px;
    }
    
    .emag-layout-corporate-3 .member-bio {
      font-size: 0.82rem;
      color: var(--emag-text-light);
      line-height: 1.5;
    }
    
    /* --- GALLERY LAYOUTS --- */
    
    .emag-layout-gallery-1 {
      min-height: 600px;
      padding: 45px;
      background: var(--emag-white);
    }
    
    .emag-layout-gallery-1 .gallery-header {
      text-align: center;
      margin-bottom: 35px;
    }
    
    .emag-layout-gallery-1 .gallery-tag {
      font-family: var(--emag-font-accent);
      font-size: 10px;
      text-transform: uppercase;
      letter-spacing: 3px;
      color: var(--emag-accent);
      margin-bottom: 10px;
    }
    
    .emag-layout-gallery-1 .gallery-title {
      font-family: var(--emag-font-display);
      font-size: 2.2rem;
      font-weight: 600;
      color: var(--emag-primary);
    }
    
    .emag-layout-gallery-1 .gallery-grid {
      display: grid;
      grid-template-columns: repeat(3, 1fr);
      gap: 22px;
    }
    
    .emag-layout-gallery-1 .gallery-item {
      position: relative;
    }
    
    .emag-layout-gallery-1 .gallery-image {
      aspect-ratio: 4/3;
      background-size: cover;
      background-position: center;
      border-radius: 6px;
      margin-bottom: 10px;
      background-color: #f0f0f0;
    }
    
    .emag-layout-gallery-1 .gallery-caption {
      font-size: 0.85rem;
      color: var(--emag-text-light);
      line-height: 1.4;
    }
    
    .emag-layout-gallery-1 .gallery-number {
      font-family: var(--emag-font-display);
      font-size: 0.8rem;
      color: var(--emag-accent);
      margin-bottom: 3px;
    }
    
    /* Gallery 2: Masonry */
    .emag-layout-gallery-2 {
      min-height: 600px;
      padding: 45px;
      background: var(--emag-primary);
      color: white;
    }
    
    .emag-layout-gallery-2 .gallery-header {
      margin-bottom: 35px;
    }
    
    .emag-layout-gallery-2 .gallery-tag {
      font-family: var(--emag-font-accent);
      font-size: 10px;
      text-transform: uppercase;
      letter-spacing: 3px;
      color: var(--emag-accent);
      margin-bottom: 10px;
    }
    
    .emag-layout-gallery-2 .gallery-title {
      font-family: var(--emag-font-display);
      font-size: 2rem;
      font-weight: 500;
    }
    
    .emag-layout-gallery-2 .gallery-masonry {
      display: grid;
      grid-template-columns: repeat(2, 1fr);
      grid-template-rows: repeat(2, auto);
      gap: 18px;
    }
    
    .emag-layout-gallery-2 .gallery-item {
      position: relative;
      border-radius: 8px;
      overflow: hidden;
    }
    
    .emag-layout-gallery-2 .gallery-item.large {
      grid-row: span 2;
    }
    
    .emag-layout-gallery-2 .gallery-image {
      width: 100%;
      height: 100%;
      min-height: 180px;
      background-size: cover;
      background-position: center;
      background-color: rgba(255,255,255,0.1);
    }
    
    .emag-layout-gallery-2 .gallery-item.large .gallery-image {
      min-height: 400px;
    }
    
    .emag-layout-gallery-2 .gallery-overlay {
      position: absolute;
      bottom: 0;
      left: 0;
      right: 0;
      padding: 18px;
      background: linear-gradient(transparent, rgba(0,0,0,0.85));
    }
    
    .emag-layout-gallery-2 .gallery-caption {
      font-size: 0.9rem;
      line-height: 1.4;
      color: rgba(255,255,255,0.9);
    }
    
    /* Gallery 3: Showcase */
    .emag-layout-gallery-3 {
      min-height: 600px;
      padding: 45px;
      background: var(--emag-secondary);
    }
    
    .emag-layout-gallery-3 .gallery-header {
      text-align: center;
      margin-bottom: 30px;
    }
    
    .emag-layout-gallery-3 .gallery-tag {
      font-family: var(--emag-font-accent);
      font-size: 10px;
      text-transform: uppercase;
      letter-spacing: 3px;
      color: var(--emag-accent);
      margin-bottom: 10px;
    }
    
    .emag-layout-gallery-3 .gallery-title {
      font-family: var(--emag-font-display);
      font-size: 2rem;
      font-weight: 600;
      color: var(--emag-primary);
    }
    
    .emag-layout-gallery-3 .gallery-featured {
      margin-bottom: 22px;
    }
    
    .emag-layout-gallery-3 .gallery-featured .gallery-image {
      width: 100%;
      aspect-ratio: 21/9;
      background-size: cover;
      background-position: center;
      border-radius: 8px;
      background-color: #ddd;
    }
    
    .emag-layout-gallery-3 .gallery-featured .gallery-caption {
      margin-top: 12px;
      font-family: var(--emag-font-display);
      font-size: 1rem;
      font-style: italic;
      color: var(--emag-text-light);
      text-align: center;
    }
    
    .emag-layout-gallery-3 .gallery-row {
      display: grid;
      grid-template-columns: repeat(4, 1fr);
      gap: 18px;
    }
    
    .emag-layout-gallery-3 .gallery-item .gallery-image {
      aspect-ratio: 1;
      background-size: cover;
      background-position: center;
      border-radius: 6px;
      margin-bottom: 8px;
      background-color: #ddd;
    }
    
    .emag-layout-gallery-3 .gallery-item .gallery-caption {
      font-size: 0.8rem;
      color: var(--emag-text-light);
      line-height: 1.3;
      text-align: center;
    }
    
    /* Gallery 4: Event Grid - 8 photos */
    .emag-layout-gallery-4 {
      min-height: 600px;
      padding: 40px;
      background: var(--emag-white);
    }
    
    .emag-layout-gallery-4 .gallery-header {
      display: flex;
      justify-content: space-between;
      align-items: flex-end;
      margin-bottom: 25px;
      padding-bottom: 15px;
      border-bottom: 2px solid var(--emag-primary);
    }
    
    .emag-layout-gallery-4 .gallery-tag {
      font-family: var(--emag-font-accent);
      font-size: 10px;
      text-transform: uppercase;
      letter-spacing: 2px;
      color: var(--emag-accent);
      margin-bottom: 8px;
    }
    
    .emag-layout-gallery-4 .gallery-title {
      font-family: var(--emag-font-display);
      font-size: 1.8rem;
      font-weight: 600;
      color: var(--emag-primary);
    }
    
    .emag-layout-gallery-4 .gallery-meta { text-align: right; }
    
    .emag-layout-gallery-4 .gallery-date {
      font-family: var(--emag-font-accent);
      font-size: 11px;
      color: var(--emag-text-light);
    }
    
    .emag-layout-gallery-4 .gallery-location {
      font-size: 0.9rem;
      color: var(--emag-primary);
      font-weight: 500;
    }
    
    .emag-layout-gallery-4 .gallery-grid {
      display: grid;
      grid-template-columns: repeat(4, 1fr);
      grid-template-rows: repeat(2, 1fr);
      gap: 12px;
    }
    
    .emag-layout-gallery-4 .gallery-item {
      position: relative;
      border-radius: 6px;
      overflow: hidden;
    }
    
    .emag-layout-gallery-4 .gallery-image {
      width: 100%;
      height: 100%;
      min-height: 130px;
      background-size: cover;
      background-position: center;
      background-color: #f0f0f0;
      transition: transform 0.3s ease;
    }
    
    .emag-layout-gallery-4 .gallery-item:hover .gallery-image {
      transform: scale(1.05);
    }
    
    .emag-layout-gallery-4 .gallery-overlay {
      position: absolute;
      bottom: 0;
      left: 0;
      right: 0;
      padding: 10px;
      background: linear-gradient(transparent, rgba(0,0,0,0.75));
      opacity: 0;
      transition: opacity 0.2s ease;
    }
    
    .emag-layout-gallery-4 .gallery-item:hover .gallery-overlay {
      opacity: 1;
    }
    
    .emag-layout-gallery-4 .gallery-caption {
      font-size: 0.75rem;
      color: white;
      line-height: 1.3;
    }
    
    /* Gallery 5: Event Timeline */
    .emag-layout-gallery-5 {
      min-height: 600px;
      padding: 45px;
      background: var(--emag-secondary);
    }
    
    .emag-layout-gallery-5 .gallery-header {
      text-align: center;
      margin-bottom: 35px;
    }
    
    .emag-layout-gallery-5 .gallery-tag {
      font-family: var(--emag-font-accent);
      font-size: 10px;
      text-transform: uppercase;
      letter-spacing: 3px;
      color: var(--emag-accent);
      margin-bottom: 10px;
    }
    
    .emag-layout-gallery-5 .gallery-title {
      font-family: var(--emag-font-display);
      font-size: 2rem;
      font-weight: 600;
      color: var(--emag-primary);
      margin-bottom: 8px;
    }
    
    .emag-layout-gallery-5 .gallery-subtitle {
      font-size: 0.95rem;
      color: var(--emag-text-light);
    }
    
    .emag-layout-gallery-5 .timeline {
      display: flex;
      flex-direction: column;
      gap: 25px;
    }
    
    .emag-layout-gallery-5 .timeline-item {
      display: grid;
      grid-template-columns: 100px 1fr 1fr;
      gap: 25px;
      align-items: start;
    }
    
    .emag-layout-gallery-5 .timeline-item:nth-child(even) {
      grid-template-columns: 1fr 1fr 100px;
    }
    
    .emag-layout-gallery-5 .timeline-item:nth-child(even) .timeline-time {
      order: 3;
      text-align: left;
    }
    
    .emag-layout-gallery-5 .timeline-item:nth-child(even) .timeline-images {
      order: 1;
    }
    
    .emag-layout-gallery-5 .timeline-item:nth-child(even) .timeline-content {
      order: 2;
    }
    
    .emag-layout-gallery-5 .timeline-time {
      font-family: var(--emag-font-accent);
      font-size: 0.9rem;
      font-weight: 600;
      color: var(--emag-accent);
      text-align: right;
      padding-top: 5px;
    }
    
    .emag-layout-gallery-5 .timeline-images {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 8px;
    }
    
    .emag-layout-gallery-5 .timeline-image {
      aspect-ratio: 4/3;
      background-size: cover;
      background-position: center;
      border-radius: 6px;
      background-color: #ddd;
    }
    
    .emag-layout-gallery-5 .timeline-content {
      background: var(--emag-white);
      padding: 20px;
      border-radius: 8px;
      box-shadow: 0 5px 20px rgba(0,0,0,0.05);
    }
    
    .emag-layout-gallery-5 .timeline-title {
      font-family: var(--emag-font-display);
      font-size: 1.1rem;
      font-weight: 600;
      color: var(--emag-primary);
      margin-bottom: 8px;
    }
    
    .emag-layout-gallery-5 .timeline-desc {
      font-size: 0.85rem;
      color: var(--emag-text-light);
      line-height: 1.6;
    }
    
    /* Gallery 6: Event Collage - 7 photos mosaic */
    .emag-layout-gallery-6 {
      min-height: 600px;
      background: var(--emag-primary);
      color: white;
      padding: 40px;
    }
    
    .emag-layout-gallery-6 .gallery-header {
      text-align: center;
      margin-bottom: 30px;
    }
    
    .emag-layout-gallery-6 .gallery-tag {
      font-family: var(--emag-font-accent);
      font-size: 10px;
      text-transform: uppercase;
      letter-spacing: 3px;
      color: var(--emag-accent);
      margin-bottom: 10px;
    }
    
    .emag-layout-gallery-6 .gallery-title {
      font-family: var(--emag-font-display);
      font-size: 2rem;
      font-weight: 600;
    }
    
    .emag-layout-gallery-6 .collage {
      display: grid;
      grid-template-columns: repeat(6, 1fr);
      grid-template-rows: repeat(3, 120px);
      gap: 10px;
    }
    
    .emag-layout-gallery-6 .collage-item {
      position: relative;
      border-radius: 6px;
      overflow: hidden;
    }
    
    .emag-layout-gallery-6 .collage-item:nth-child(1) { grid-column: span 2; grid-row: span 2; }
    .emag-layout-gallery-6 .collage-item:nth-child(2) { grid-column: span 2; }
    .emag-layout-gallery-6 .collage-item:nth-child(3) { grid-column: span 2; }
    .emag-layout-gallery-6 .collage-item:nth-child(4) { grid-column: span 2; }
    .emag-layout-gallery-6 .collage-item:nth-child(5) { grid-column: span 2; }
    .emag-layout-gallery-6 .collage-item:nth-child(6) { grid-column: span 3; }
    .emag-layout-gallery-6 .collage-item:nth-child(7) { grid-column: span 3; }
    
    .emag-layout-gallery-6 .collage-image {
      width: 100%;
      height: 100%;
      background-size: cover;
      background-position: center;
      background-color: rgba(255,255,255,0.1);
      transition: transform 0.3s ease;
    }
    
    .emag-layout-gallery-6 .collage-item:hover .collage-image {
      transform: scale(1.05);
    }
    
    .emag-layout-gallery-6 .collage-overlay {
      position: absolute;
      bottom: 0;
      left: 0;
      right: 0;
      padding: 12px;
      background: linear-gradient(transparent, rgba(0,0,0,0.8));
      opacity: 0;
      transition: opacity 0.2s ease;
    }
    
    .emag-layout-gallery-6 .collage-item:hover .collage-overlay {
      opacity: 1;
    }
    
    .emag-layout-gallery-6 .collage-caption {
      font-size: 0.8rem;
      color: white;
    }
    
    .emag-layout-gallery-6 .gallery-footer {
      margin-top: 20px;
      text-align: center;
      font-size: 0.9rem;
      opacity: 0.7;
    }
    
    /* Internal Page Links */
    .emag-page-link {
      cursor: pointer;
      transition: all 0.2s ease;
      position: relative;
    }
    
    .emag-page-link:hover {
      color: var(--emag-accent) !important;
    }
    
    .emag-page-link::after {
      content: '→';
      opacity: 0;
      margin-left: 5px;
      transition: all 0.2s ease;
    }
    
    .emag-page-link:hover::after {
      opacity: 1;
    }
    
    /* --- BACK PAGE LAYOUTS --- */
    
    .emag-layout-back-1 {
      min-height: 600px;
      display: flex;
      flex-direction: column;
      justify-content: center;
      align-items: center;
      text-align: center;
      padding: 55px;
      background: var(--emag-gradient);
      color: white;
    }
    
    .emag-layout-back-1 .back-logo {
      font-family: var(--emag-font-display);
      font-size: 2.8rem;
      font-weight: 700;
      margin-bottom: 25px;
    }
    
    .emag-layout-back-1 .back-tagline {
      font-family: var(--emag-font-display);
      font-size: 1.3rem;
      font-style: italic;
      color: rgba(255,255,255,0.75);
      margin-bottom: 35px;
    }
    
    .emag-layout-back-1 .back-divider {
      width: 55px;
      height: 2px;
      background: var(--emag-accent);
      margin-bottom: 35px;
    }
    
    .emag-layout-back-1 .back-website {
      font-family: var(--emag-font-accent);
      font-size: 11px;
      text-transform: uppercase;
      letter-spacing: 3px;
      color: var(--emag-accent);
    }
    
    .emag-layout-back-2 {
      min-height: 600px;
      display: grid;
      grid-template-columns: 1fr 1fr;
    }
    
    .emag-layout-back-2 .back-left {
      background: var(--emag-secondary);
      padding: 55px;
      display: flex;
      flex-direction: column;
      justify-content: center;
    }
    
    .emag-layout-back-2 .back-right {
      background: var(--emag-primary);
      padding: 55px;
      display: flex;
      flex-direction: column;
      justify-content: center;
      color: white;
    }
    
    .emag-layout-back-2 .back-title {
      font-family: var(--emag-font-display);
      font-size: 1.8rem;
      font-weight: 600;
      margin-bottom: 22px;
    }
    
    .emag-layout-back-2 .back-text {
      font-size: 0.95rem;
      line-height: 1.8;
      color: var(--emag-text-light);
      margin-bottom: 25px;
    }
    
    .emag-layout-back-2 .back-right .back-text {
      color: rgba(255,255,255,0.75);
    }
    
    .emag-layout-back-2 .back-link {
      font-family: var(--emag-font-accent);
      font-size: 11px;
      text-transform: uppercase;
      letter-spacing: 2px;
      color: var(--emag-accent);
    }
    
    .emag-layout-back-2 .social-links {
      display: flex;
      gap: 15px;
      margin-top: 18px;
    }
    
    .emag-layout-back-2 .social-link {
      width: 42px;
      height: 42px;
      border: 1px solid rgba(255,255,255,0.2);
      border-radius: 50%;
      display: flex;
      align-items: center;
      justify-content: center;
      color: white;
      font-size: 14px;
      transition: all 0.2s ease;
    }
    
    .emag-layout-back-2 .social-link:hover {
      background: var(--emag-accent);
      border-color: var(--emag-accent);
    }
    
    .emag-layout-back-3 {
      min-height: 600px;
      padding: 55px;
      background: var(--emag-white);
      display: flex;
      flex-direction: column;
    }
    
    .emag-layout-back-3 .back-header {
      text-align: center;
      margin-bottom: 45px;
    }
    
    .emag-layout-back-3 .back-logo {
      font-family: var(--emag-font-display);
      font-size: 1.8rem;
      font-weight: 700;
      color: var(--emag-primary);
      margin-bottom: 8px;
    }
    
    .emag-layout-back-3 .back-issue {
      font-size: 10px;
      text-transform: uppercase;
      letter-spacing: 2px;
      color: var(--emag-text-light);
    }
    
    .emag-layout-back-3 .credits-grid {
      display: grid;
      grid-template-columns: repeat(3, 1fr);
      gap: 35px;
      flex: 1;
    }
    
    .emag-layout-back-3 .credit-group h4 {
      font-family: var(--emag-font-accent);
      font-size: 10px;
      text-transform: uppercase;
      letter-spacing: 2px;
      color: var(--emag-accent);
      margin-bottom: 12px;
    }
    
    .emag-layout-back-3 .credit-group p {
      font-size: 0.9rem;
      color: var(--emag-text-light);
      line-height: 1.8;
    }
    
    .emag-layout-back-3 .back-footer {
      text-align: center;
      padding-top: 35px;
      border-top: 1px solid rgba(0,0,0,0.08);
      margin-top: 35px;
    }
    
    .emag-layout-back-3 .back-copyright {
      font-size: 10px;
      color: var(--emag-text-light);
      letter-spacing: 1px;
    }
    
    /* ============================================
       VIEWER MODE
    ============================================ */
    .emag-viewer {
      position: fixed;
      top: 0;
      left: 0;
      right: 0;
      bottom: 0;
      background: #0a0a0a;
      z-index: 1500;
      display: none;
      flex-direction: column;
    }
    
    .emag-viewer.active {
      display: flex;
    }
    
    .emag-viewer-header {
      display: flex;
      justify-content: space-between;
      align-items: center;
      padding: 10px 18px;
      background: rgba(0,0,0,0.85);
      color: white;
    }
    
    .emag-viewer-title {
      font-family: var(--emag-font-display);
      font-size: 1rem;
    }
    
    .emag-viewer-controls {
      display: flex;
      align-items: center;
      gap: 18px;
    }
    
    .emag-viewer-page {
      font-size: 11px;
      color: rgba(255,255,255,0.7);
    }
    
    .emag-viewer-close {
      padding: 6px 12px;
      background: rgba(255,255,255,0.1);
      border: none;
      color: white;
      border-radius: 5px;
      cursor: pointer;
      font-size: 11px;
      transition: all 0.2s ease;
    }
    
    .emag-viewer-close:hover {
      background: rgba(255,255,255,0.2);
    }
    
    .emag-viewer-body {
      flex: 1;
      display: flex;
      align-items: center;
      justify-content: center;
      position: relative;
      overflow: hidden;
    }
    
    .emag-viewer-pages {
      width: 100%;
      max-width: 1050px;
      height: 90%;
      position: relative;
      perspective: 2000px;
    }
    
    .emag-viewer-page-item {
      position: absolute;
      top: 0;
      left: 50%;
      transform: translateX(-50%);
      width: 100%;
      height: 100%;
      background: white;
      opacity: 0;
      visibility: hidden;
      transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
      overflow-y: auto;
      box-shadow: 0 25px 80px rgba(0,0,0,0.5);
    }
    
    .emag-viewer-page-item.active {
      opacity: 1;
      visibility: visible;
      z-index: 10;
    }
    
    .emag-viewer[data-transition="slide"] .emag-viewer-page-item {
      transform: translateX(calc(-50% + 100%));
    }
    
    .emag-viewer[data-transition="slide"] .emag-viewer-page-item.active {
      transform: translateX(-50%);
    }
    
    .emag-viewer[data-transition="slide"] .emag-viewer-page-item.exit-left {
      transform: translateX(calc(-50% - 100%));
    }
    
    .emag-viewer[data-transition="flip"] .emag-viewer-pages {
      transform-style: preserve-3d;
    }
    
    .emag-viewer[data-transition="flip"] .emag-viewer-page-item {
      transform: translateX(-50%) rotateY(-180deg);
      transform-origin: center center;
      backface-visibility: hidden;
    }
    
    .emag-viewer[data-transition="flip"] .emag-viewer-page-item.active {
      transform: translateX(-50%) rotateY(0deg);
    }
    
    .emag-viewer[data-transition="flip"] .emag-viewer-page-item.exit-left {
      transform: translateX(-50%) rotateY(180deg);
    }
    
    .emag-viewer-nav {
      position: absolute;
      top: 50%;
      transform: translateY(-50%);
      width: 48px;
      height: 48px;
      background: rgba(255,255,255,0.95);
      border: none;
      border-radius: 50%;
      cursor: pointer;
      display: flex;
      align-items: center;
      justify-content: center;
      box-shadow: 0 4px 18px rgba(0,0,0,0.25);
      transition: all 0.3s ease;
      z-index: 100;
    }
    
    .emag-viewer-nav:hover {
      background: var(--emag-accent);
      transform: translateY(-50%) scale(1.08);
    }
    
    .emag-viewer-nav:hover svg {
      stroke: white;
    }
    
    .emag-viewer-nav:disabled {
      opacity: 0.3;
      cursor: not-allowed;
    }
    
    .emag-viewer-nav svg {
      width: 18px;
      height: 18px;
      stroke: #1a1a1a;
      stroke-width: 2;
      fill: none;
    }

/* ============================================
   NEW GALLERY LAYOUTS
============================================ */

/* Gallery 7: Full Page Hero Image */
.emag-layout-gallery-7 {
  height: 100%;
  min-height: 100%;
  position: relative;
  overflow: hidden;
}

.emag-layout-gallery-7 .full-image {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-size: cover;
  background-position: center;
  background-color: #1a1a1a;
}

.emag-layout-gallery-7 .image-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 80px 50px 50px;
  background: linear-gradient(transparent, rgba(0,0,0,0.85));
}

.emag-layout-gallery-7 .image-title {
  font-family: var(--emag-font-display);
  font-size: 2.8rem;
  font-weight: 600;
  color: white;
  margin-bottom: 15px;
}

.emag-layout-gallery-7 .image-caption {
  font-family: var(--emag-font-body);
  font-size: 1.1rem;
  color: rgba(255,255,255,0.9);
  max-width: 600px;
  line-height: 1.6;
}

/* Gallery 8: 4 Images Row - No Gaps */
.emag-layout-gallery-8 {
  height: 100%;
  min-height: 100%;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
}

.emag-layout-gallery-8 .grid-image {
  background-size: cover;
  background-position: center;
  background-color: #1a1a1a;
  position: relative;
  cursor: pointer;
}

.emag-layout-gallery-8 .grid-image::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(transparent 50%, rgba(0,0,0,0.7));
  opacity: 0;
  transition: opacity 0.3s;
}

.emag-layout-gallery-8 .grid-image:hover::before {
  opacity: 1;
}

.emag-layout-gallery-8 .grid-caption {
  position: absolute;
  bottom: 20px;
  left: 20px;
  right: 20px;
  color: white;
  font-family: var(--emag-font-body);
  font-size: 0.9rem;
  font-weight: 500;
  opacity: 0;
  transition: opacity 0.3s;
}

.emag-layout-gallery-8 .grid-image:hover .grid-caption {
  opacity: 1;
}

/* Gallery 9: 2x2 Grid - No Gaps */
.emag-layout-gallery-9 {
  height: 100%;
  min-height: 100%;
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
}

.emag-layout-gallery-9 .grid-image {
  background-size: cover;
  background-position: center;
  background-color: #1a1a1a;
  position: relative;
  cursor: pointer;
}

.emag-layout-gallery-9 .grid-image::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(transparent 40%, rgba(0,0,0,0.8));
  opacity: 0;
  transition: opacity 0.3s;
}

.emag-layout-gallery-9 .grid-image:hover::before {
  opacity: 1;
}

.emag-layout-gallery-9 .grid-caption {
  position: absolute;
  bottom: 25px;
  left: 25px;
  right: 25px;
  color: white;
  font-family: var(--emag-font-body);
  font-size: 1rem;
  font-weight: 500;
  opacity: 0;
  transition: opacity 0.3s;
}

.emag-layout-gallery-9 .grid-image:hover .grid-caption {
  opacity: 1;
}

/* Video Layouts */
.emag-layout-video-1 {
  height: 100%;
  padding: 40px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--emag-primary, #1a1a1a);
}

.emag-layout-video-1 .video-header {
  text-align: center;
  margin-bottom: 30px;
}

.emag-layout-video-1 .video-tag {
  font-family: var(--emag-font-accent);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--emag-accent, #c9a87c);
  margin-bottom: 10px;
}

.emag-layout-video-1 .video-title {
  font-family: var(--emag-font-display);
  font-size: 2rem;
  font-weight: 600;
  color: white;
}

.emag-layout-video-1 .video-container {
  width: 100%;
  max-width: 700px;
  height: 394px; /* 700 * 9/16 = 394 */
  background: #000;
  border-radius: 8px;
  overflow: hidden;
}

.emag-layout-video-1 .video-container iframe,
.emag-layout-video-1 .video-container video {
  width: 100%;
  height: 100%;
  border: none;
  display: block;
}

.emag-layout-video-1 .video-desc {
  max-width: 600px;
  text-align: center;
  margin-top: 20px;
  color: rgba(255,255,255,0.7);
  font-size: 0.95rem;
  line-height: 1.6;
}

.emag-layout-video-2 {
  height: 100%;
  padding: 30px;
  background: var(--emag-secondary, #f8f7f4);
}

.emag-layout-video-2 .video-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 30px;
  height: 100%;
}

.emag-layout-video-2 .video-main {
  display: flex;
  flex-direction: column;
}

.emag-layout-video-2 .video-tag {
  font-family: var(--emag-font-accent);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--emag-accent, #c9a87c);
  margin-bottom: 8px;
}

.emag-layout-video-2 .video-title {
  font-family: var(--emag-font-display);
  font-size: 1.6rem;
  font-weight: 600;
  color: var(--emag-text, #2d2d2d);
  margin-bottom: 20px;
}

.emag-layout-video-2 .video-container {
  flex: 1;
  background: #000;
  border-radius: 8px;
  overflow: hidden;
}

.emag-layout-video-2 .video-container iframe,
.emag-layout-video-2 .video-container video {
  width: 100%;
  height: 100%;
  border: none;
  display: block;
}

.emag-layout-video-2 .video-sidebar {
  background: white;
  border-radius: 8px;
  padding: 25px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.08);
}

.emag-layout-video-2 .speaker-image {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background-size: cover;
  background-position: center;
  margin-bottom: 15px;
}

.emag-layout-video-2 .speaker-name {
  font-family: var(--emag-font-display);
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--emag-text);
}

.emag-layout-video-2 .speaker-title {
  font-size: 0.85rem;
  color: var(--emag-text-light);
  margin-bottom: 12px;
}

.emag-layout-video-2 .speaker-bio {
  font-size: 0.85rem;
  line-height: 1.5;
  color: var(--emag-text);
  margin-bottom: 15px;
}

.emag-layout-video-2 .video-duration {
  font-size: 0.8rem;
  color: var(--emag-accent);
  font-weight: 500;
}

.emag-layout-video-3 {
  height: 100%;
  display: flex;
  flex-direction: column;
  background: white;
}

.emag-layout-video-3 .video-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 30px;
  background: var(--emag-primary, #1a1a1a);
}

.emag-layout-video-3 .video-info .video-tag {
  font-family: var(--emag-font-accent);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--emag-accent, #c9a87c);
  margin-bottom: 8px;
}

.emag-layout-video-3 .video-info .video-title {
  font-family: var(--emag-font-display);
  font-size: 1.5rem;
  font-weight: 600;
  color: white;
}

.emag-layout-video-3 .video-stats {
  display: flex;
  gap: 25px;
}

.emag-layout-video-3 .stat {
  text-align: center;
}

.emag-layout-video-3 .stat-value {
  font-family: var(--emag-font-display);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--emag-accent, #c9a87c);
}

.emag-layout-video-3 .stat-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: rgba(255,255,255,0.6);
}

.emag-layout-video-3 .video-body {
  flex: 1;
  padding: 30px;
  display: flex;
  flex-direction: column;
}

.emag-layout-video-3 .video-container {
  flex: 1;
  background: #000;
  border-radius: 8px;
  overflow: hidden;
}

.emag-layout-video-3 .video-container iframe,
.emag-layout-video-3 .video-container video {
  width: 100%;
  height: 100%;
  border: none;
  display: block;
}

.emag-layout-video-3 .video-desc {
  margin-top: 15px;
  color: var(--emag-text-light);
  font-size: 0.9rem;
  line-height: 1.5;
}

/* Video element styling - General */
.video-container {
  position: relative;
  background: #000;
}

.video-container video,
.video-container iframe {
  width: 100%;
  height: 100%;
  border: none;
  pointer-events: auto;
  display: block;
}

.video-container video {
  object-fit: contain;
}

/* Ensure viewer stays contained - more specific selectors */
html body .emag-viewer-wrapper {
  position: relative !important;
  display: block !important;
  width: 100% !important;
  max-width: 1200px;
  height: 550px;
  margin: 20px auto !important;
  background: #0a0a0a;
  border-radius: 12px;
  overflow: hidden !important;
  box-shadow: 0 10px 40px rgba(0,0,0,0.15);
}

/* Prevent any fixed/fullscreen behavior */
html body .emag-viewer-wrapper,
html body .emag-viewer-wrapper .emag-viewer,
html body .emag-viewer-wrapper .emag-viewer-body,
html body .emag-viewer-wrapper .emag-viewer-pages {
  position: relative !important;
}

html body .emag-viewer-wrapper .emag-viewer {
  position: absolute !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
}

html body .emag-viewer-wrapper .emag-viewer-page-item {
  position: absolute !important;
}

/* ============================================
   GALLERY 10: 3x3 Grid (9 Images) - No Gaps
============================================ */
.emag-layout-gallery-10 {
  height: 100%;
  min-height: 100%;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(3, 1fr);
}

.emag-layout-gallery-10 .grid-image {
  background-size: cover;
  background-position: center;
  background-color: #1a1a1a;
  position: relative;
  cursor: pointer;
}

.emag-layout-gallery-10 .grid-image::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(transparent 50%, rgba(0,0,0,0.75));
  opacity: 0;
  transition: opacity 0.3s;
}

.emag-layout-gallery-10 .grid-image:hover::before {
  opacity: 1;
}

.emag-layout-gallery-10 .grid-caption {
  position: absolute;
  bottom: 15px;
  left: 15px;
  right: 15px;
  color: white;
  font-family: var(--emag-font-body);
  font-size: 0.85rem;
  font-weight: 500;
  opacity: 0;
  transition: opacity 0.3s;
  text-shadow: 0 1px 3px rgba(0,0,0,0.5);
}

.emag-layout-gallery-10 .grid-image:hover .grid-caption {
  opacity: 1;
}

/* ============================================
   VIDEO PLAYER FIX
   Ensures videos play and display correctly
============================================ */

/* Video container sizing */
.emag-viewer-wrapper .video-container {
  position: relative;
  width: 100%;
  background: #000;
}

/* Ensure iframe/video fill their container */
.emag-viewer-wrapper .video-container iframe,
.emag-viewer-wrapper .video-container video {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
  pointer-events: auto;
}

/* Ensure videos are interactive */
.emag-viewer-page-item.active iframe,
.emag-viewer-page-item.active video {
  pointer-events: auto;
}
