/* CIO TechView Magazine Manager — front-end styles
 * Covers both rendering modes:
 *  1) Built-in template  (.ctvm-single ...)
 *  2) Elementor master template shortcodes (.ctvm_cover_image, .ctvm-digital-button, etc.)
 */

@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@500;600;700;800&family=Inter:wght@400;500;600;700&display=swap');

:root {
  --ctvm-red: #e21f2f;
  --ctvm-red-dark: #b90f20;
  --ctvm-ink: #171717;
  --ctvm-muted: #6a6a6a;
  --ctvm-line: #e6e6e6;
  /* Headings (titles, article titles, buttons) use Poppins.
     Body copy (paragraphs, descriptions) uses Inter. */
  --ctvm-font-heading: 'Poppins', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --ctvm-font-body: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --ctvm-font: var(--ctvm-font-body);
}

/* ---------- Shared building blocks (used by both modes) ---------- */

.ctvm_cover_image,
.ctvm_banner_image,
.ctvm-elementor-cover-story,
.ctvm-elementor-content,
.ctvm-elementor-articles,
.ctvm-dynamic-title {
  font-family: var(--ctvm-font);
  color: var(--ctvm-ink);
}

.ctvm_cover_image img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 6px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.14);
}

.ctvm_banner_image img {
  display: block;
  width: 100%;
  height: clamp(300px, 32vw, 480px);
  object-fit: cover;
  border-radius: 6px;
}

.ctvm-digital-button {
  display: block;
  width: 100%;
  margin-top: 18px;
  padding: 16px 20px;
  border-radius: 4px;
  background: var(--ctvm-red);
  color: #fff !important;
  font-family: var(--ctvm-font-heading);
  font-size: 18px;
  font-weight: 600;
  text-align: center;
  text-decoration: none !important;
  transition: background 0.2s ease, transform 0.2s ease;
}
.ctvm-digital-button:hover {
  background: var(--ctvm-red-dark);
  color: #fff !important;
  transform: translateY(-1px);
}

.ctvm-elementor-cover-story h3 {
  margin: 18px 0 0;
  font-family: var(--ctvm-font-heading);
  font-size: clamp(24px, 2.4vw, 32px);
  font-weight: 700;
  line-height: 1.32;
  color: var(--ctvm-ink);
}
.ctvm-elementor-cover-story a {
  text-decoration: none;
  color: inherit;
}
.ctvm-elementor-cover-story a:hover h3 {
  color: var(--ctvm-red);
}

.ctvm-dynamic-title {
  font-family: var(--ctvm-font-heading);
  font-size: clamp(28px, 3vw, 40px);
  font-weight: 700;
  line-height: 1.2;
}

.ctvm-elementor-content {
  font-family: var(--ctvm-font-body);
  color: #3a3a3a;
  font-size: 17px;
  line-height: 1.85;
}
.ctvm-elementor-content p { margin: 0 0 1.2em; }

/* Article grid — used both as [ctvm_articles] output and inside the
   built-in template */
.ctvm-elementor-articles,
.ctvm-article-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 40px 48px;
  margin-top: 10px;
}

.ctvm-elementor-article,
.ctvm-article {
  list-style: none;
}
.ctvm-elementor-article > a,
.ctvm-article > a {
  display: block;
  color: inherit !important;
  text-decoration: none !important;
}

.ctvm-elementor-article img,
.ctvm-article-image {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 11;
  border-radius: 6px;
  object-fit: cover;
  overflow: hidden;
  background: linear-gradient(135deg, #1c1c1c, #333);
}
.ctvm-article-image img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}
.ctvm-article:hover .ctvm-article-image img,
.ctvm-elementor-article:hover img {
  transform: scale(1.03);
}
.ctvm-placeholder {
  display: grid;
  place-items: center;
  height: 100%;
  color: rgba(255, 255, 255, 0.75);
  font-weight: 700;
}

.ctvm-elementor-article h3,
.ctvm-article h3 {
  margin: 22px 0 0;
  font-family: var(--ctvm-font-heading);
  font-size: clamp(20px, 1.7vw, 26px);
  font-weight: 700;
  line-height: 1.4;
  color: var(--ctvm-ink);
  transition: color 0.2s ease;
}
.ctvm-elementor-article a:hover h3,
.ctvm-article a:hover h3 {
  color: var(--ctvm-red);
}

/* ---------- Built-in template layout ---------- */

.ctvm-single {
  width: 100%;
  margin: 0;
  padding: 48px 0 90px;
  background: #fff;
  color: var(--ctvm-ink);
  font-family: var(--ctvm-font-body);
}
.ctvm-single * { box-sizing: border-box; }

.ctvm-container {
  width: min(1200px, calc(100% - 64px));
  margin: 0 auto;
}

.ctvm-title {
  margin: 0 0 34px;
  font-family: var(--ctvm-font-heading);
  font-size: clamp(30px, 3.6vw, 44px);
  font-weight: 700;
  line-height: 1.2;
  color: var(--ctvm-ink);
}

.ctvm-hero {
  display: grid;
  grid-template-columns: minmax(240px, 320px) minmax(0, 1fr);
  gap: 44px;
  align-items: start;
}

.ctvm-hero-cover { min-width: 0; }
.ctvm-cover-frame { margin: 0; }
.ctvm-cover-img { display: block; width: 100%; height: auto; border-radius: 6px; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.14); }

.ctvm-hero-banner { min-width: 0; }
.ctvm-banner-frame { margin: 0; }
.ctvm-banner-img { display: block; width: 100%; height: clamp(300px, 32vw, 480px); object-fit: cover; border-radius: 6px; }
.ctvm-story-title {
  margin: 20px 0 0;
  font-family: var(--ctvm-font-heading);
  font-size: clamp(24px, 2.4vw, 32px);
  font-weight: 700;
  line-height: 1.32;
}
.ctvm-story-title a { color: var(--ctvm-ink); text-decoration: none; }
.ctvm-story-title a:hover { color: var(--ctvm-red); }

.ctvm-description { max-width: 900px; margin: 56px 0; }
.ctvm-prose { font-family: var(--ctvm-font-body); color: #3a3a3a; font-size: 17px; line-height: 1.85; }
.ctvm-prose > *:first-child { margin-top: 0; }
.ctvm-prose > *:last-child { margin-bottom: 0; }
.ctvm-prose p { margin: 0 0 1.2em; }
.ctvm-prose h2, .ctvm-prose h3 { color: var(--ctvm-ink); }
.ctvm-prose a { color: var(--ctvm-red); }

.ctvm-story-image-wrap { margin: 0 0 56px; }
.ctvm-story-image { margin: 0; border-radius: 8px; overflow: hidden; }
.ctvm-story-image img { display: block; width: 100%; height: auto; max-height: 460px; object-fit: cover; }

.ctvm-section-heading { display: flex; align-items: center; gap: 24px; margin: 56px 0 34px; }
.ctvm-section-heading h2 { margin: 0; font-family: var(--ctvm-font-heading); font-size: clamp(26px, 2.8vw, 34px); font-weight: 700; white-space: nowrap; }
.ctvm-section-heading i { flex: 1; height: 1px; background: var(--ctvm-line); }

/* ---------- Responsive ---------- */

@media (max-width: 900px) {
  .ctvm-hero { grid-template-columns: 1fr; gap: 28px; }
  .ctvm-hero-cover { max-width: 320px; margin: 0 auto; }
}

@media (max-width: 780px) {
  .ctvm-elementor-articles,
  .ctvm-article-grid { grid-template-columns: 1fr; gap: 32px; }
}

@media (max-width: 640px) {
  .ctvm-container { width: calc(100% - 32px); }
  .ctvm-single { padding: 32px 0 60px; }
  .ctvm-title { margin-bottom: 24px; }
  .ctvm-elementor-articles,
  .ctvm-article-grid { grid-template-columns: 1fr; gap: 30px; }
  .ctvm-section-heading { margin: 44px 0 22px; }
}
