/**
 * ENHANCED CONTENT BLOCKS CSS
 * Add this to your theme's main stylesheet or create a new content-blocks.css file
 * This matches the styling from your HTML demo
 */

/* ===== BASE VARIABLES ===== */
:root {
  --forest-green: #1b5137;
  --rust-red: #cc4020;
  --warm-orange: #e1a038;
  --text-gray: #666;
  --light-gray: #f9f9f9;
  --border-gray: #ddd;
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.15), 0 2px 4px rgba(0, 0, 0, 0.1);
  --radius-sm: 4px;
  --radius-md: 20px;
  --radius-lg: 25px;
}

/* ===== SECTION LAYOUT ===== */
.section {
  background: rgba(255, 255, 255, 0.85);
  margin: 40px 0;
  padding: 10px 0;
  box-shadow: var(--shadow-md);
}

.block {
  margin: 20px 0;
}

.full-width {
  width: 100%;
  box-sizing: border-box;
}

.eighty-width {
  width: 90%;
  margin: 0 auto;
  box-sizing: border-box;
}

/* ===== TEXT BLOCKS ===== */
.text-block .text-content {
  max-width: 100%;
  margin: 0 auto;
  padding: 0 2rem;
  color: var(--forest-green);
  line-height: 1.6;
  font-family: 'Work Sans', sans-serif;
}

.text-block .text-content h2,
.text-block .text-content h3,
.text-block .text-content h4 {
  color: var(--rust-red);
  margin-top: 2rem;
  margin-bottom: 1rem;
  font-family: 'Fraunces', serif;
  font-weight: bold;
}

.text-block .text-content h2 {
  font-size: clamp(1.8rem, 3vw, 2.5rem);
}

.text-block .text-content h3 {
  font-size: clamp(1.4rem, 2.5vw, 2rem);
}

.text-block .text-content p {
  font-size: clamp(1rem, 1.8vw, 1.1rem);
  margin-bottom: 1.5rem;
}

/* ===== VIDEO BLOCKS ===== */
.video-card {
  position: relative;
  width: 100%;
  aspect-ratio: 16/9;
  background: #000;
  overflow: hidden;
  border-radius: 0;
  box-shadow: var(--shadow-md);
}

.video-card video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.video-card {
  position: absolute;
  bottom: 50px;
  left: 0;
  right: 0;
  background: rgba(255, 255, 255, 0.3);
  color: #333;
  padding: 15px 20px;
  font-family: 'Fraunces', serif;
  font-weight: bold;
  font-size: clamp(1.2rem, 2.5vw, 1.8rem);
  text-align: center;
}

.fullscreen-button {
  position: absolute;
  bottom: 15px;
  right: 15px;
  width: 24px;
  height: 24px;
  background: rgba(0, 0, 0, 0.6);
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease, background 0.2s ease;
  z-index: 10;
}

.fullscreen-button:hover {
  transform: scale(1.2);
  background: rgba(0, 0, 0, 0.8);
}

.fullscreen-button svg {
  width: 16px;
  height: 16px;
}

/* ===== FULL WIDTH CARDS ===== */
.card-full {
  position: relative;
  width: 100%;
  aspect-ratio: 16/9;
  background-color: white;
  border-radius: 0;
  padding: 0;
  text-align: center;
  margin: 0;
  box-shadow: var(--shadow-md);
  overflow: hidden;
}

.card-full.text-content {
  padding: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
}

.card-full .image-content {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.card-full .embedded-content {
  width: 100%;
  height: 100%;
}

.card-full .embedded-content iframe,
.embedded-content iframe {
  width: 100%;
  height: 100%;
  border: none;
}

.inspirational-quote {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0, 0, 0, 0.3);
  color: white;
  padding: 30px;
  border-radius: 15px;
  font-family: 'Fraunces', serif;
  font-weight: bold;
  font-size: clamp(1.5rem, 3vw, 2.5rem);
  max-width: 400px;
  line-height: 1.3;
}

.inspirational-quote.left {
  left: 40px;
}

.inspirational-quote.center {
  left: 50%;
  transform: translate(-50%, -50%);
}

.inspirational-quote.right {
  right: 40px;
}

/* ===== MULTIPLE CARDS ===== */
.card-row {
  display: flex;
  justify-content: space-between;
  gap: 20px;
}

.card {
  background-color: white;
  border-radius: var(--radius-md);
  padding: 20px;
  flex: 1;
  text-align: center;
  box-shadow: var(--shadow-md);
  position: relative;
  overflow: hidden;
}

/* Aspect ratio classes */
.card.aspect-1-1, .aspect-1-1 { aspect-ratio: 1/1; }
.card.aspect-2-3, .aspect-2-3 { aspect-ratio: 2/3; }
.card.aspect-3-2, .aspect-3-2 { aspect-ratio: 3/2; }
.card.aspect-3-4, .aspect-3-4 { aspect-ratio: 3/4; }
.card.aspect-4-3, .aspect-4-3 { aspect-ratio: 4/3; }
.card.aspect-16-9, .aspect-16-9 { aspect-ratio: 16/9; }

.card .image-content {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.card .embedded-content {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

.card .embedded-content iframe {
  width: 100%;
  height: 100%;
  border: none;
}

.card .text-content {
  padding: 20px;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  box-sizing: border-box;
}

.card-title {
  font-family: 'Fraunces', serif;
  font-weight: bold;
  font-size: clamp(1.2rem, 2.5vw, 1.8rem);
  margin-bottom: 15px;
  color: #333;
}

.card-description {
  font-family: 'Work Sans', sans-serif;
  font-size: clamp(0.9rem, 1.8vw, 1rem);
  line-height: 1.5;
  color: var(--text-gray);
  margin-bottom: 20px;
}

.read-more-btn {
  background: transparent;
  color: var(--forest-green);
  border: 2px solid var(--forest-green);
  padding: 12px 24px;
  border-radius: var(--radius-lg);
  cursor: pointer;
  font-family: 'Fraunces', serif;
  font-weight: bold;
  font-size: 0.9rem;
  transition: all 0.3s ease;
  margin-top: auto;
  text-decoration: none;
  display: inline-block;
}

.read-more-btn:hover {
  background: var(--warm-orange);
  color: white;
  border: 2px solid transparent;
  transform: translateY(-2px);
}

/* ===== CONTENT BOX CARDS ===== */
.content-box-card {
  background: white;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  aspect-ratio: 3/4;
}

.content-box-card.split-box {
  flex-direction: column;
}

.content-box-card.split-box.card-reversed .card-text {
  order: 2;
}

.content-box-card.split-box.card-reversed .card-image {
  order: 1;
}

.content-box-card .card-text,
.content-box-card .card-image,
.content-box-card .card-embedded {
  flex: 1;
}

.content-box-card .card-text {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.content-box-card .card-image {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #9b9b9b;
}

.content-box-card .card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.content-box-card .card-embedded {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f0f0f0;
}

.content-box-card .card-embedded iframe {
  width: 100%;
  height: 100%;
  border: none;
}

.content-box-card.text-only .card-text {
  flex: 1;
  padding: 2rem;
}

.content-box-card.image-only .card-image,
.content-box-card.embedded-only .card-embedded {
  flex: 1;
}

/* ===== SPLIT CARDS ===== */
.split-card {
  display: flex;
  width: 100%;
  box-shadow: var(--shadow-md);
  border-radius: 0;
  overflow: hidden;
}

.split-card.aspect-1-2 { aspect-ratio: 1/2; }
.split-card.aspect-2-1 { aspect-ratio: 2/1; }
.split-card.aspect-1-4 { aspect-ratio: 1/4; }
.split-card.aspect-1-1 { aspect-ratio: 1/1; }

.split-half {
  flex: 1;
  position: relative;
  overflow: hidden;
}

.split-half.aspect-square { aspect-ratio: 1/1; }
.split-half.aspect-2-1 { aspect-ratio: 2/1; }

.split-half .image-content {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.split-half .text-content {
  padding: 40px;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  background: white;
  box-sizing: border-box;
}

.split-half .embedded-content {
  width: 100%;
  height: 100%;
}

.split-half .embedded-content iframe {
  width: 100%;
  height: 100%;
  border: none;
}

/* ===== COLOR SCHEMES ===== */
.default-scheme {
  background: white;
  color: var(--forest-green);
}

.green-bg-scheme {
  background: var(--forest-green);
  color: white;
}

.orange-bg-scheme {
  background: var(--rust-red);
  color: white;
}

.orange-text-scheme {
  background: white;
  color: var(--rust-red);
}

.green-bg-scheme h3,
.orange-bg-scheme h3 {
  color: white;
}

.orange-text-scheme h3 {
  color: var(--rust-red);
}

.green-bg-scheme .read-more-btn {
  color: white;
  border-color: white;
}

.orange-bg-scheme .read-more-btn {
  color: white;
  border-color: white;
}

.orange-text-scheme .read-more-btn {
  color: var(--rust-red);
  border-color: var(--rust-red);
}

/* ===== PLACEHOLDER STYLES ===== */
.placeholder-image,
.image-placeholder,
.placeholder-embed,
.embedded-placeholder {
  background: #3b3b3b;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  color: white;
  font-family: 'Work Sans', sans-serif;
  font-size: clamp(0.9rem, 1.5vw, 1.1rem);
}

.placeholder-icon {
  width: 120px;
  height: 120px;
  opacity: 0.7;
}

/* ===== EMBEDDED CONTENT ASPECT RATIOS ===== */
.embedded-content.aspect-16-9 {
  aspect-ratio: 16/9;
}

.embedded-content.aspect-4-3 {
  aspect-ratio: 4/3;
}

.embedded-content.aspect-1-1 {
  aspect-ratio: 1/1;
}

/* ===== RESPONSIVE BEHAVIOR ===== */
@media (max-width: 768px) {
  .card-row {
    flex-direction: column;
    gap: 15px;
  }

  .card {
    margin: 0;
  }

  .split-card {
    flex-direction: column;
  }

  .split-card.aspect-1-4 {
    aspect-ratio: 1/1;
  }

  .inspirational-quote {
    position: relative;
    top: auto;
    transform: none;
    left: auto !important;
    right: auto !important;
    margin: 20px;
    font-size: clamp(1.2rem, 4vw, 1.8rem);
  }

  .video-card .subtitle-bar {
    bottom: 45px;
    padding: 10px 15px;
    font-size: clamp(0.9rem, 3vw, 1rem);
  }

  .content-box-card {
    aspect-ratio: 2/1;
    flex-direction: row;
  }

  .content-box-card.split-box.card-reversed {
    flex-direction: row-reverse;
  }

  .content-box-card .card-text,
  .content-box-card .card-image,
  .content-box-card .card-embedded {
    flex: 1;
  }

  .content-box-card.text-only {
    aspect-ratio: auto;
  }

  .content-box-card.text-only .card-text {
    flex: 1;
    padding: 1.5rem;
  }

  .content-box-card.image-only,
  .content-box-card.embedded-only {
    aspect-ratio: 16/9;
  }

  .split-half .text-content {
    padding: 25px;
  }
}

@media (max-width: 480px) {
  .eighty-width {
    width: 95%;
  }

  .card, 
  .card .text-content {
    padding: 15px;
  }

  .split-half .text-content {
    padding: 20px;
  }

  .content-box-card .card-text {
    padding: 1rem;
  }
}

/* ===== ADMIN PREVIEW STYLES ===== */
.admin-preview {
  border: 2px dashed var(--border-gray);
  padding: 20px;
  margin: 10px 0;
  background: var(--light-gray);
  border-radius: var(--radius-sm);
  text-align: center;
  color: var(--text-gray);
  font-family: 'Work Sans', sans-serif;
}

.admin-preview::before {
  content: "Preview: ";
  font-weight: bold;
  color: var(--rust-red);
}

/* ===== ACCESSIBILITY IMPROVEMENTS ===== */
.card:focus-within,
.content-box-card:focus-within,
.split-card:focus-within {
  outline: 2px solid var(--warm-orange);
  outline-offset: 2px;
}

.read-more-btn:focus {
  outline: 2px solid var(--warm-orange);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  .read-more-btn {
    transition: none;
  }
  
  .fullscreen-button {
    transition: none;
  }
}

/* ===== PRINT STYLES ===== */
@media print {
  .section {
    box-shadow: none;
    background: white;
  }
  
  .card,
  .content-box-card,
  .card-full {
    box-shadow: none;
    border: 1px solid #ccc;
  }
  
  .fullscreen-button {
    display: none;
  }
}