/*
Theme Name: InfoFlick Magbook Child
Theme URI: https://infoflick.com/
Description: InfoFlick custom child theme for Magbook with a modern news homepage.
Author: InfoFlick
Template: magbook
Version: 1.0.0
*/

/* Parent Magbook stylesheet is loaded by functions.php. */

/* INFOFLICK HOME V2 START */
:root {
  --if-max: 1240px;
  --if-gap: 24px;
  --if-border: #e6e6e6;
  --if-text: #111;
  --if-muted: #6b6b6b;
}

.if-home,
.if-home * {
  box-sizing: border-box;
}

.if-home {
  color: var(--if-text);
  background: #fff;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.if-container {
  width: min(var(--if-max), calc(100% - 40px));
  margin-inline: auto;
}

.if-breaking {
  border-bottom: 1px solid var(--if-border);
  background: #111;
  color: #fff;
}

.if-breaking-inner {
  min-height: 42px;
  display: flex;
  align-items: center;
  gap: 18px;
  overflow: hidden;
}

.if-breaking-label {
  flex: 0 0 auto;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .08em;
  white-space: nowrap;
}

.if-breaking-track {
  display: flex;
  gap: 30px;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
}

.if-breaking-track::-webkit-scrollbar {
  display: none;
}

.if-breaking-track a {
  color: #fff;
  font-size: 13px;
  line-height: 1.4;
  text-decoration: none;
  white-space: nowrap;
}


.if-section {
  padding: 34px 0;
}

.if-section + .if-section {
  border-top: 1px solid #f0f0f0;
}

.if-section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 18px;
}

.if-section-heading h1,
.if-section-heading h2 {
  margin: 0;
  font-size: 25px;
  line-height: 1.2;
  letter-spacing: -.025em;
}

.if-section-heading a {
  flex: 0 0 auto;
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
}

.if-latest-grid {
  display: grid;
  grid-template-columns: 1.65fr 1fr 1fr;
  grid-template-rows: auto auto;
  gap: var(--if-gap);
  align-items: start;
}

.if-latest-card {
  min-width: 0;
}

.if-latest-featured {
  grid-row: span 2;
}

.if-card-image {
  display: block;
  overflow: hidden;
  background: #f2f2f2;
  border-radius: 6px;
  aspect-ratio: 16 / 10;
}

.if-card-image img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .25s ease;
}

.if-card-image:hover img {
  transform: scale(1.025);
}

.if-card-body {
  padding-top: 10px;
}

.if-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 7px;
  color: var(--if-muted);
  font-size: 11px;
  line-height: 1.4;
}

.if-meta a {
  font-weight: 700;
  text-decoration: none;
}

.if-meta time {
  color: var(--if-muted);
}

.if-card-body h2,
.if-card-body h3 {
  margin: 0;
  line-height: 1.28;
  letter-spacing: -.015em;
}

.if-card-body h2 {
  font-size: 20px;
}

.if-card-body h3 {
  font-size: 17px;
}

.if-card-body h2 a,
.if-card-body h3 a {
  color: inherit;
  text-decoration: none;
}

.if-card-body p {
  margin: 7px 0 0;
  color: #666;
  font-size: 13px;
  line-height: 1.55;
}

.if-category-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--if-gap);
}

.if-category-card {
  min-width: 0;
}

.if-newsletter {
  padding: 12px 0 54px;
}

.if-newsletter-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 30px;
  padding: 28px 32px;
  border: 1px solid var(--if-border);
  border-radius: 8px;
  background: #fafafa;
}

.if-kicker {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .12em;
}

.if-newsletter h2 {
  margin: 5px 0;
  font-size: 24px;
}

.if-newsletter p {
  margin: 0;
  color: #666;
  font-size: 13px;
}

.if-newsletter-button {
  flex: 0 0 auto;
  padding: 11px 18px;
  border-radius: 5px;
  background: #111;
  color: #fff;
  text-decoration: none;
  font-size: 12px;
  font-weight: 700;
}

@media (max-width: 900px) {
  .if-container {
    width: min(var(--if-max), calc(100% - 28px));
  }

  .if-latest-grid {
    grid-template-columns: 1.2fr 1fr;
  }

  .if-latest-featured {
    grid-row: span 2;
  }

  .if-category-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .if-container {
    width: min(var(--if-max), calc(100% - 20px));
  }

  .if-breaking-inner {
    gap: 12px;
  }

  .if-breaking-label {
    font-size: 10px;
  }

  .if-section {
    padding: 26px 0;
  }

  .if-section-heading h1,
  .if-section-heading h2 {
    font-size: 21px;
  }

  .if-latest-grid {
    grid-template-columns: 1fr;
  }

  .if-latest-featured {
    grid-row: auto;
  }

  .if-category-grid {
    grid-template-columns: 1fr 1fr;
    gap: 14px;
  }

  .if-card-body h2 {
    font-size: 18px;
  }

  .if-card-body h3 {
    font-size: 15px;
  }

  .if-card-body p {
    font-size: 12px;
  }

  .if-newsletter-inner {
    display: block;
    padding: 22px;
  }

  .if-newsletter-button {
    display: inline-block;
    margin-top: 16px;
  }
}
/* INFOFLICK HOME V2 END */


/* INFOFLICK HOME V3 */
.if-home {
  width: 100%;
}

.if-home .if-container {
  width: min(1400px, calc(100% - 48px));
  max-width: 1400px;
  margin-left: auto;
  margin-right: auto;
}

.if-latest-section {
  width: 100%;
}

.if-latest-grid,
.if-category-grid {
  width: 100%;
}

}

@media (max-width: 640px) {
  .if-home .if-container {
    width: calc(100% - 20px);
  }
}
/* END INFOFLICK HOME V3 */

/* INFOFLICK HOME V5 */
.if-home {
  width: 100%;
  margin: 0;
  padding: 0;
  background: #fff;
  color: #111;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.if-home .if-container {
  width: 100%;
  max-width: none;
  margin-left: auto;
  margin-right: auto;
  padding-left: clamp(12px, 3vw, 48px);
  padding-right: clamp(12px, 3vw, 48px);
}

.if-home .if-section {
  width: 100%;
  padding: 34px 0;
}

.if-home .if-section + .if-section {
  border-top: 1px solid #e9e9e9;
}

.if-section-heading {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 24px;
  margin: 0 0 18px !important;
  padding: 0 0 12px;
  border-bottom: 1px solid #dcdcdc;
}

.if-section-heading h1,
.if-section-heading h2 {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 0 !important;
  padding: 0 !important;
  color: #111 !important;
  font-size: 25px !important;
  line-height: 1.2 !important;
  font-weight: 800 !important;
  letter-spacing: -.02em;
}

.if-section-heading h1 > span,
.if-section-heading h2 > span {
  display: inline-block;
  width: 5px;
  height: 25px;
  flex: 0 0 5px;
  background: #ef233c;
}

.if-section-heading > a {
  flex: 0 0 auto;
  color: #111 !important;
  font-size: 11px !important;
  line-height: 1;
  font-weight: 800 !important;
  text-decoration: none !important;
  white-space: nowrap;
}

.if-section-heading > a b {
  font-size: 14px;
  font-weight: 800;
}

.if-news-grid {
  display: grid !important;
  grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
  gap: 20px !important;
  align-items: start !important;
  width: 100%;
}

.if-news-card {
  min-width: 0;
  width: 100%;
  margin: 0 !important;
  padding: 0 !important;
  background: #fff;
}

.if-card-image {
  display: block !important;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  margin: 0 !important;
  padding: 0 !important;
  background: #f1f1f1;
  border-radius: 5px;
  text-decoration: none !important;
}

.if-card-image img {
  display: block !important;
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  transition: transform .25s ease;
}

.if-card-image:hover img {
  transform: scale(1.025);
}

.if-image-placeholder {
  display: block;
  width: 100%;
  height: 100%;
  background: #eee;
}

.if-card-body {
  display: block !important;
  width: 100%;
  padding: 9px 0 0 !important;
  margin: 0 !important;
}

.if-meta {
  display: flex !important;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
  margin: 0 0 6px !important;
  padding: 0 !important;
  color: #777 !important;
  font-size: 10px !important;
  line-height: 1.4 !important;
  text-transform: none;
}

.if-meta a {
  color: #e51d3e !important;
  font-weight: 800 !important;
  text-decoration: none !important;
}

.if-meta time {
  color: #777 !important;
}

.if-card-body h2,
.if-card-body h3 {
  display: block !important;
  width: 100%;
  margin: 0 !important;
  padding: 0 !important;
  color: #111 !important;
  font-size: 16px !important;
  line-height: 1.32 !important;
  font-weight: 750 !important;
  letter-spacing: -.01em;
}

.if-card-body h2 a,
.if-card-body h3 a {
  display: inline !important;
  color: #111 !important;
  text-decoration: none !important;
}

.if-card-body h2 a:hover,
.if-card-body h3 a:hover {
  color: #e51d3e !important;
}

.if-card-body p {
  margin: 6px 0 0 !important;
  padding: 0 !important;
  color: #666 !important;
  font-size: 12px !important;
  line-height: 1.5 !important;
}

.if-empty {
  margin: 0;
  color: #777;
}

/* Explicitly hide any leftover featured/hero/breaking elements from older versions. */
.if-home .if-hero-wrap,
.if-home .if-featured-section,
.if-home .if-breaking,
.if-home .if-hero-grid,
.if-home .if-hero-image-card {
  display: none !important;
}

.if-news-grid {
    gap: 22px !important;
  }
}

@media (max-width: 1100px) {
  .if-news-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  }
}

@media (max-width: 760px) {
  .if-home .if-container {
    width: 100%;
    padding-left: 14px;
    padding-right: 14px;
  }

  .if-home .if-section {
    padding: 27px 0;
  }

  .if-section-heading h1,
  .if-section-heading h2 {
    font-size: 21px !important;
  }

  .if-section-heading h1 > span,
  .if-section-heading h2 > span {
    height: 21px;
    flex-basis: 4px;
    width: 4px;
  }

  .if-news-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 18px 14px !important;
  }

  .if-card-body h2,
  .if-card-body h3 {
    font-size: 15px !important;
  }
}

@media (max-width: 480px) {
  .if-home .if-container {
    width: 100%;
    padding-left: 10px;
    padding-right: 10px;
  }

  .if-news-grid {
    grid-template-columns: 1fr !important;
  }

  .if-section-heading {
    margin-bottom: 15px !important;
  }
}
/* END INFOFLICK HOME V5 */

/* INFOFLICK HOME V6 - TOP THUMBNAILS + HERO SLIDER */
.if-home .if-container {
  width: 100%;
  max-width: none;
  margin-left: auto;
  margin-right: auto;
  padding-left: clamp(12px, 3vw, 48px);
  padding-right: clamp(12px, 3vw, 48px);
}

/* Top 5 thumbnail slider */
.if-top-slider-section {
  width: 100%;
  padding: 18px 0 12px;
  background: #fff;
}

.if-top-slider {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}

.if-top-track {
  display: flex;
  gap: 16px;
  width: 100%;
  overflow-x: auto;
  scroll-behavior: smooth;
  scrollbar-width: none;
  padding: 2px 0 5px;
}

.if-top-track::-webkit-scrollbar {
  display: none;
}

.if-top-slide {
  flex: 0 0 calc((100% - 64px) / 5);
  min-width: 0;
}

.if-top-slide > a {
  display: flex;
  flex-direction: column;
  gap: 8px;
  color: #111;
  text-decoration: none;
}

.if-top-thumb {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: 5px;
  background: #eee;
}

.if-top-thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.if-top-title {
  display: -webkit-box;
  overflow: hidden;
  color: #111;
  font-size: 13px;
  font-weight: 750;
  line-height: 1.32;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.if-slider-arrow {
  z-index: 2;
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  border: 1px solid #ddd;
  border-radius: 50%;
  background: #fff;
  color: #111;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0,0,0,.08);
}

.if-top-prev { margin-right: 10px; }
.if-top-next { margin-left: 10px; }

/* Hero slider */
.if-hero-section {
  width: 100%;
  padding: 12px 0 26px;
  background: #fff;
}

.if-hero-slider {
  position: relative;
  width: 100%;
}

.if-hero-track {
  position: relative;
  width: 100%;
}

.if-hero-slide {
  display: none;
  width: 100%;
}

.if-hero-slide.is-active {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(340px, .85fr);
  gap: 28px;
  align-items: center;
}

.if-hero-image {
  width: 100%;
  aspect-ratio: 16 / 8.8;
  overflow: hidden;
  border-radius: 6px;
  background: #eee;
}

.if-hero-image a,
.if-hero-image img {
  display: block;
  width: 100%;
  height: 100%;
}

.if-hero-image img {
  object-fit: cover;
}

.if-hero-content {
  padding: 8px 30px 8px 0;
}

.if-hero-content .if-meta {
  margin-bottom: 9px !important;
}

.if-hero-content h1 {
  margin: 0 !important;
  padding: 0 !important;
  font-size: clamp(28px, 3vw, 44px) !important;
  line-height: 1.12 !important;
  font-weight: 800 !important;
  letter-spacing: -.03em;
}

.if-hero-content h1 a {
  color: #111 !important;
  text-decoration: none !important;
}

.if-hero-content p {
  margin: 13px 0 0 !important;
  color: #666 !important;
  font-size: 14px !important;
  line-height: 1.65 !important;
}

.if-hero-prev { position: absolute; left: 12px; top: calc(50% - 17px); }
.if-hero-next { position: absolute; right: 12px; top: calc(50% - 17px); }

.if-hero-dots {
  display: flex;
  justify-content: center;
  gap: 7px;
  margin-top: 13px;
}

.if-hero-dot {
  width: 7px;
  height: 7px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: #ccc;
  cursor: pointer;
}

.if-hero-dot.is-active {
  width: 22px;
  border-radius: 8px;
  background: #ef233c;
}

/* Ensure all homepage article text stays below the image */
.if-home .if-card-image,
.if-home .if-featured-image,
.if-home .if-hero-image {
  position: relative;
}

.if-home .if-card-body,
.if-home .if-featured-content,
.if-home .if-hero-content {
  position: static;
  background: #fff;
  color: #111;
}

/* Responsive */
@media (max-width: 1100px) {
  .if-top-slide {
    flex-basis: calc((100% - 32px) / 3);
  }

  .if-hero-slide.is-active {
    grid-template-columns: minmax(0, 1.3fr) minmax(260px, .8fr);
    gap: 20px;
  }

  .if-hero-content h1 {
    font-size: 30px !important;
  }
}

@media (max-width: 760px) {
  .if-home .if-container {
    width: 100%;
    padding-left: 14px;
    padding-right: 14px;
  }

  .if-top-slider-section {
    padding-top: 12px;
  }

  .if-top-slide {
    flex-basis: calc((100% - 14px) / 2);
  }

  .if-slider-arrow {
    width: 30px;
    height: 30px;
    flex-basis: 30px;
  }

  .if-hero-slide.is-active {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .if-hero-image {
    aspect-ratio: 16 / 9;
  }

  .if-hero-content {
    padding: 0 5px;
  }

  .if-hero-content h1 {
    font-size: 25px !important;
  }

  .if-hero-prev,
  .if-hero-next {
    top: calc(50% - 15px);
  }
}

@media (max-width: 480px) {
  .if-home .if-container {
    width: 100%;
    padding-left: 10px;
    padding-right: 10px;
  }

  .if-top-slide {
    flex-basis: 78%;
  }

  .if-top-prev,
  .if-top-next {
    display: none;
  }

  .if-hero-section {
    padding-bottom: 18px;
  }

  .if-hero-content h1 {
    font-size: 23px !important;
  }
}
/* END INFOFLICK HOME V6 */

/* INFOFLICK HOME V7 - FLUID FULL-WIDTH RESPONSIVE LAYOUT */

/* Fluid container: no fixed maximum width */
.if-home .if-container {
  width: 100% !important;
  max-width: none !important;
  margin-left: auto !important;
  margin-right: auto !important;
  padding-left: clamp(12px, 3vw, 48px) !important;
  padding-right: clamp(12px, 3vw, 48px) !important;
}

/* Prevent horizontal overflow */
.if-home {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}

/* Top thumbnails adapt continuously */
.if-top-slide {
  flex: 0 0 clamp(180px, 18vw, 280px);
}

/* Hero adapts to available width */
.if-hero-slide.is-active {
  width: 100%;
}

.if-hero-image {
  width: 100%;
}

/* Latest/category grids */
.if-news-grid {
  width: 100%;
}

/* Large desktop: 5 columns */
@media (min-width: 1200px) {
  .if-news-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
  }
}

/* Medium desktop/tablet landscape: 4 columns */
@media (min-width: 900px) and (max-width: 1199px) {
  .if-news-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  }

  .if-hero-slide.is-active {
    grid-template-columns: minmax(0, 1.25fr) minmax(280px, .75fr);
  }
}

/* Tablet: 3 columns */
@media (min-width: 600px) and (max-width: 899px) {
  .if-home .if-container {
    padding-left: 20px !important;
    padding-right: 20px !important;
  }

  .if-news-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  }

  .if-top-slide {
    flex-basis: clamp(190px, 30vw, 250px);
  }

  .if-hero-slide.is-active {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .if-hero-content {
    padding: 0 4px;
  }
}

/* Mobile: 2 columns */
@media (min-width: 421px) and (max-width: 599px) {
  .if-home .if-container {
    padding-left: 14px !important;
    padding-right: 14px !important;
  }

  .if-news-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  .if-top-slide {
    flex-basis: 48%;
  }

  .if-hero-slide.is-active {
    grid-template-columns: 1fr;
  }
}

/* Small mobile: 1 column where needed */
@media (max-width: 420px) {
  .if-home .if-container {
    padding-left: 10px !important;
    padding-right: 10px !important;
  }

  .if-news-grid {
    grid-template-columns: 1fr !important;
  }

  .if-top-slide {
    flex-basis: 78%;
  }

  .if-hero-slide.is-active {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .if-hero-content {
    padding: 0 2px;
  }

  .if-hero-content h1 {
    font-size: clamp(22px, 7vw, 28px) !important;
  }
}

/* Images remain responsive and never distort */
.if-home img {
  max-width: 100%;
}

.if-home .if-card-image,
.if-home .if-top-thumb,
.if-home .if-hero-image {
  width: 100%;
}

/* Keep controls usable on touch devices */
.if-slider-arrow {
  min-width: 34px;
  min-height: 34px;
  touch-action: manipulation;
}
/* END INFOFLICK HOME V7 */

/* INFOFLICK HOME V9 - STABLE RESPONSIVE HOMEPAGE */

/* Top thumbnail slider is permanently removed. */
.if-home .if-top-slider-section,
.if-home .if-top-slider,
.if-home .if-top-track,
.if-home .if-top-slide,
.if-home .if-top-prev,
.if-home .if-top-next {
  display: none !important;
}

/* Fluid centered content: no fixed maximum width. */
.if-home {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}

.if-home .if-container {
  width: 100%;
  max-width: none !important;
  margin-inline: auto;
  padding-inline: clamp(12px, 3vw, 48px);
}

/* Hero slider */
.if-hero-section {
  width: 100%;
  padding: 20px 0 30px;
}

.if-hero-slide {
  display: none;
  width: 100%;
}

.if-hero-slide.is-active {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(280px, .8fr);
  gap: clamp(20px, 3vw, 42px);
  align-items: center;
}

.if-hero-image {
  width: 100%;
  aspect-ratio: 16 / 8.5;
  overflow: hidden;
  border-radius: 6px;
  background: #eee;
}

.if-hero-image a,
.if-hero-image img {
  display: block;
  width: 100%;
  height: 100%;
}

.if-hero-image img {
  object-fit: cover;
}

.if-hero-content {
  position: static !important;
  padding: 0 clamp(0px, 1vw, 16px) 0 0;
  background: #fff !important;
}

.if-hero-content h1 {
  margin: 0 !important;
  color: #111 !important;
  font-size: clamp(26px, 3.2vw, 46px) !important;
  line-height: 1.12 !important;
  font-weight: 800 !important;
  letter-spacing: -.03em;
}

.if-hero-content h1 a {
  color: #111 !important;
  text-decoration: none !important;
}

.if-hero-content p {
  margin: 12px 0 0 !important;
  color: #666 !important;
  font-size: clamp(13px, 1.1vw, 15px) !important;
  line-height: 1.6 !important;
}

/* Article rows */
.if-news-grid {
  display: grid !important;
  grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
  gap: clamp(14px, 1.7vw, 24px) !important;
  width: 100%;
  align-items: start;
}

.if-news-card {
  min-width: 0;
  width: 100%;
}

.if-card-image {
  display: block !important;
  width: 100%;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  border-radius: 5px;
  background: #eee;
}

.if-card-image img {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
}

.if-card-body {
  position: static !important;
  width: 100%;
  padding-top: 9px !important;
  background: #fff !important;
}

.if-card-body h2,
.if-card-body h3 {
  color: #111 !important;
  margin: 0 !important;
  line-height: 1.32 !important;
}

.if-card-body h2 a,
.if-card-body h3 a {
  color: #111 !important;
  text-decoration: none !important;
}

/* Tablet */
@media (max-width: 1100px) {
  .if-news-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  }

  .if-hero-slide.is-active {
    grid-template-columns: minmax(0, 1.3fr) minmax(240px, .7fr);
  }
}

/* Mobile/tablet */
@media (max-width: 760px) {
  .if-home .if-container {
    padding-inline: 16px;
  }

  .if-news-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  .if-hero-slide.is-active {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .if-hero-image {
    aspect-ratio: 16 / 9;
  }

  .if-hero-content {
    padding: 0 !important;
  }
}

/* Small phones */
@media (max-width: 480px) {
  .if-home .if-container {
    padding-inline: 10px;
  }

  .if-news-grid {
    grid-template-columns: 1fr !important;
  }

  .if-hero-content h1 {
    font-size: 24px !important;
  }
}
/* END INFOFLICK HOME V9 */


/* INFOFLICK HOME V10 - LATEST NEWS 5-IMAGE SLIDER */

/* Latest News becomes a horizontal five-story image slider. */
.if-latest-section .if-section-heading {
  align-items: center !important;
}

.if-slider-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.if-latest-slider {
  position: relative;
  width: 100%;
  overflow: hidden;
}

.if-latest-track {
  display: flex;
  gap: 20px;
  width: 100%;
  overflow-x: auto;
  scroll-behavior: smooth;
  scrollbar-width: none;
  scroll-snap-type: x proximity;
  padding: 2px 0 8px;
}

.if-latest-track::-webkit-scrollbar {
  display: none;
}

.if-latest-slide {
  flex: 0 0 calc((100% - 80px) / 5);
  min-width: 0;
  scroll-snap-align: start;
}

.if-latest-slide .if-card-image {
  width: 100%;
  aspect-ratio: 16 / 10;
  display: block;
  overflow: hidden;
  border-radius: 5px;
  background: #eee;
}

.if-latest-slide .if-card-image img {
  display: block;
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
}

.if-latest-slide .if-card-body {
  padding-top: 9px !important;
}

.if-latest-slide .if-card-body h3 {
  margin: 0 !important;
  font-size: 16px !important;
  line-height: 1.32 !important;
  font-weight: 750 !important;
}

.if-latest-slide .if-card-body h3 a {
  color: #111 !important;
  text-decoration: none !important;
}

.if-latest-slide .if-card-body p {
  margin-top: 6px !important;
}

/* Large screens: exactly five cards visible */
@media (min-width: 1200px) {
  .if-latest-slide {
    flex-basis: calc((100% - 80px) / 5);
  }
}

/* Medium desktop: four visible */
@media (min-width: 900px) and (max-width: 1199px) {
  .if-latest-slide {
    flex-basis: calc((100% - 60px) / 4);
  }
}

/* Tablet: three visible */
@media (min-width: 600px) and (max-width: 899px) {
  .if-latest-slide {
    flex-basis: calc((100% - 40px) / 3);
  }
}

/* Mobile: two visible */
@media (min-width: 421px) and (max-width: 599px) {
  .if-latest-slide {
    flex-basis: calc((100% - 14px) / 2);
  }
}

/* Small mobile: one large card visible */
@media (max-width: 420px) {
  .if-latest-slide {
    flex-basis: 88%;
  }

  .if-slider-controls {
    gap: 5px;
  }

  .if-latest-slide .if-card-body h3 {
    font-size: 17px !important;
  }
}

/* Keep all Latest News text below the image and black. */
.if-latest-slide .if-card-body,
.if-latest-slide .if-meta,
.if-latest-slide h3,
.if-latest-slide h3 a,
.if-latest-slide p {
  position: static !important;
  background: #fff !important;
  color: #111 !important;
}
/* END INFOFLICK HOME V10 */

/* =========================================================
   INFOFLICK HOME V11
   Completely white, fluid and mobile-safe
   ========================================================= */

/* Kill inherited dark backgrounds from Magbook on the homepage. */
html,
body,
body.home,
body.blog,
body.page-template-default {
  background: #fff !important;
  color: #111 !important;
}

body.home #page,
body.home #content,
body.home .site,
body.home .site-content,
body.home .content-area,
body.home .main-content,
body.home .container,
body.home .wrapper,
body.home .site-main {
  background: #fff !important;
}

/* Homepage must occupy the complete viewport width. */
body.home #page,
body.home .site,
body.home .site-content,
body.home .content-area,
body.home .site-main,
body.home #primary,
body.home .if-home {
  width: 100% !important;
  max-width: none !important;
  min-width: 0 !important;
  margin-left: auto !important;
  margin-right: auto !important;
  float: none !important;
}

/* Remove inherited sidebar/secondary column that can create the black right panel. */
body.home #secondary,
body.home .widget-area,
body.home .sidebar,
body.home aside.sidebar,
body.home .secondary {
  display: none !important;
}

/* Remove inherited content/sidebar layout constraints. */
body.home .site-content .container,
body.home .site-content .inner-wrap,
body.home .site-content .content-wrapper,
body.home .main-content-wrap,
body.home .main-wrapper {
  width: 100% !important;
  max-width: none !important;
  padding: 0 !important;
  margin: 0 auto !important;
  background: #fff !important;
}

/* Fluid homepage container. */
body.home .if-home .if-container {
  width: 100% !important;
  max-width: none !important;
  min-width: 0 !important;
  margin: 0 auto !important;
  padding-left: clamp(10px, 3vw, 48px) !important;
  padding-right: clamp(10px, 3vw, 48px) !important;
}

/* Never allow any child element to create horizontal overflow. */
body.home .if-home,
body.home .if-home section,
body.home .if-home .if-container {
  max-width: 100% !important;
  overflow-x: hidden;
}

/* Hero: image and text stay inside the viewport. */
body.home .if-hero-section,
body.home .if-hero-slider,
body.home .if-hero-track,
body.home .if-hero-slide.is-active {
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
}

body.home .if-hero-slide.is-active {
  display: grid !important;
  grid-template-columns: minmax(0, 1.6fr) minmax(0, .8fr) !important;
  align-items: center !important;
}

body.home .if-hero-image,
body.home .if-hero-image a,
body.home .if-hero-image img {
  max-width: 100% !important;
  min-width: 0 !important;
}

body.home .if-hero-content {
  min-width: 0 !important;
  max-width: 100% !important;
  overflow-wrap: anywhere;
  word-break: normal;
  background: #fff !important;
  color: #111 !important;
}

/* Latest News slider and category grids are fluid. */
body.home .if-latest-slider,
body.home .if-latest-track,
body.home .if-news-grid,
body.home .if-news-card,
body.home .if-latest-slide {
  min-width: 0 !important;
  max-width: 100% !important;
}

body.home .if-latest-track {
  width: 100% !important;
  overflow-x: auto !important;
  overflow-y: hidden !important;
}

/* No accidental black overlay/background on article text. */
body.home .if-card-body,
body.home .if-latest-slide .if-card-body,
body.home .if-category-section,
body.home .if-latest-section {
  background: #fff !important;
  color: #111 !important;
}

body.home .if-card-body h2,
body.home .if-card-body h3,
body.home .if-card-body h2 a,
body.home .if-card-body h3 a {
  color: #111 !important;
}

/* Images scale naturally without stretching. */
body.home .if-home img {
  max-width: 100% !important;
  height: auto;
}

body.home .if-card-image img,
body.home .if-hero-image img {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
}

/* Tablet */
@media (max-width: 899px) {
  body.home .if-hero-slide.is-active {
    grid-template-columns: 1fr !important;
    gap: 16px !important;
  }

  body.home .if-hero-content {
    padding: 0 !important;
  }

  body.home .if-news-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  }
}

/* Mobile */
@media (max-width: 600px) {
  body.home .if-home .if-container {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }

  body.home .if-news-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  body.home .if-hero-image {
    aspect-ratio: 16 / 9 !important;
  }

  body.home .if-hero-content h1 {
    font-size: clamp(23px, 7vw, 30px) !important;
    line-height: 1.15 !important;
  }

  body.home .if-hero-content p {
    font-size: 13px !important;
  }
}

/* Small phones */
@media (max-width: 420px) {
  body.home .if-home .if-container {
    padding-left: 10px !important;
    padding-right: 10px !important;
  }

  body.home .if-news-grid {
    grid-template-columns: 1fr !important;
  }

  body.home .if-latest-slide {
    flex-basis: 88% !important;
  }

  body.home .if-hero-slide.is-active {
    gap: 12px !important;
  }
}

/* Desktop: use the available screen width while preserving clean gutters. */
@media (min-width: 1200px) {
  body.home .if-home .if-container {
    padding-left: clamp(28px, 4vw, 64px) !important;
    padding-right: clamp(28px, 4vw, 64px) !important;
  }
}

/* Remove common Magbook homepage wrapper backgrounds/borders that can appear dark. */
body.home .entry-content,
body.home .type-page,
body.home .page,
body.home .hentry {
  background: #fff !important;
  border: 0 !important;
}

/* END INFOFLICK HOME V11 */

/* INFOFLICK HOME V12 - LATEST NEWS REMOVED */
.if-home .if-latest-section,
.if-home .if-latest-slider,
.if-home .if-latest-track,
.if-home .if-latest-slide,
.if-home .if-latest-prev,
.if-home .if-latest-next {
  display: none !important;
}
/* END INFOFLICK HOME V12 */


/* ============================================================
   INFOFLICK MOVIE DATABASE
   Dedicated design for /category/movie-database/
   ============================================================ */
body.if-movie-database-page,
body.category-movie-database {
  background: #fff;
}

.if-movie-database,
.if-movie-database * {
  box-sizing: border-box;
}

.if-movie-database {
  width: 100%;
  background: #fff;
  color: #111;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.if-md-container {
  width: min(1400px, calc(100% - 48px));
  margin: 0 auto;
}

.if-md-breadcrumbs {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 18px 0 10px;
  color: #777;
  font-size: 11px;
}
.if-md-breadcrumbs a { color: #555; text-decoration: none; }
.if-md-breadcrumbs a:hover { color: #ef233c; }

.if-md-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(320px, .75fr);
  align-items: center;
  gap: 42px;
  margin: 0 0 12px;
  padding: clamp(34px, 5vw, 62px);
  border-radius: 16px;
  background: #090909;
  color: #fff;
  overflow: hidden;
  position: relative;
}
.if-md-hero:after {
  content: "";
  position: absolute;
  width: 420px;
  height: 420px;
  right: -170px;
  top: -220px;
  border-radius: 50%;
  background: rgba(239,35,60,.14);
}
.if-md-hero-copy,
.if-md-search { position: relative; z-index: 1; }
.if-md-kicker {
  display: inline-block;
  color: #ef233c;
  font-size: 10px;
  line-height: 1.4;
  font-weight: 800;
  letter-spacing: .13em;
}
.if-md-hero h1 {
  margin: 9px 0 12px;
  color: #fff;
  font-size: clamp(38px, 5vw, 66px);
  line-height: .98;
  letter-spacing: -.045em;
}
.if-md-hero p {
  max-width: 720px;
  margin: 0;
  color: #cfcfcf;
  font-size: 15px;
  line-height: 1.75;
}

.if-md-search {
  display: flex;
  padding: 7px;
  border: 1px solid #333;
  border-radius: 9px;
  background: #151515;
}
.if-md-search input {
  min-width: 0;
  flex: 1;
  border: 0;
  outline: 0;
  padding: 13px 14px;
  background: transparent;
  color: #fff;
  font: inherit;
  font-size: 13px;
}
.if-md-search input::placeholder { color: #888; }
.if-md-search button,
.if-md-filter-button {
  border: 0;
  border-radius: 6px;
  padding: 0 19px;
  background: #ef233c;
  color: #fff;
  font: inherit;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.if-md-section {
  padding: 38px 0;
  border-bottom: 1px solid #ededed;
}
.if-md-section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 20px;
}
.if-md-section-head h2 {
  margin: 5px 0 0;
  color: #111;
  font-size: clamp(24px, 3vw, 32px);
  line-height: 1.1;
  letter-spacing: -.035em;
}
.if-md-result-count,
.if-md-view-all {
  color: #777;
  font-size: 11px;
  font-weight: 700;
  text-decoration: none;
}
.if-md-view-all:hover { color: #ef233c; }

.if-md-language-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 12px;
}
.if-md-language-card {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding: 17px 13px;
  border: 1px solid #e6e6e6;
  border-radius: 9px;
  background: #fff;
  color: #111;
  text-decoration: none;
  transition: border-color .18s ease, transform .18s ease, box-shadow .18s ease;
}
.if-md-language-card:hover,
.if-md-language-card.is-active {
  border-color: #ef233c;
  transform: translateY(-2px);
  box-shadow: 0 8px 22px rgba(0,0,0,.07);
}
.if-md-language-icon {
  display: grid;
  flex: 0 0 34px;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 50%;
  background: #f7f7f7;
  font-size: 15px;
}
.if-md-language-card strong {
  display: block;
  font-size: 12px;
  line-height: 1.3;
}
.if-md-language-card small {
  display: block;
  margin-top: 3px;
  color: #888;
  font-size: 9px;
}
.if-md-arrow {
  margin-left: auto;
  color: #aaa;
  font-size: 15px;
}

.if-md-filters {
  display: grid;
  grid-template-columns: .75fr .9fr .9fr 1.35fr auto auto;
  align-items: end;
  gap: 10px;
}
.if-md-filter label,
.if-md-filter-search label {
  display: block;
  margin-bottom: 6px;
  color: #777;
  font-size: 10px;
  font-weight: 700;
}
.if-md-filter select,
.if-md-filter-search input {
  width: 100%;
  height: 44px;
  border: 1px solid #ddd;
  border-radius: 6px;
  padding: 0 11px;
  background: #fff;
  color: #222;
  font: inherit;
  font-size: 12px;
  outline: none;
}
.if-md-filter select:focus,
.if-md-filter-search input:focus { border-color: #111; }
.if-md-filter-button {
  height: 44px;
  white-space: nowrap;
}
.if-md-clear {
  align-self: end;
  height: 44px;
  display: grid;
  place-items: center;
  padding: 0 10px;
  color: #777;
  font-size: 11px;
  font-weight: 700;
  text-decoration: none;
}

.if-md-movie-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 24px;
}
.if-md-card {
  min-width: 0;
  overflow: hidden;
  border: 1px solid #e7e7e7;
  border-radius: 10px;
  background: #fff;
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.if-md-card:hover {
  transform: translateY(-3px);
  border-color: #d9d9d9;
  box-shadow: 0 12px 28px rgba(0,0,0,.08);
}
.if-md-poster {
  display: block;
  position: relative;
  aspect-ratio: 2 / 3;
  overflow: hidden;
  background: #f1f1f1;
}
.if-md-poster img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .3s ease;
}
.if-md-card:hover .if-md-poster img { transform: scale(1.025); }
.if-md-poster-placeholder {
  display: grid;
  width: 100%;
  height: 100%;
  place-items: center;
  color: #aaa;
  font-size: 36px;
}
.if-md-card-body {
  padding: 14px 15px 16px;
}
.if-md-card-meta {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 7px;
  color: #888;
  font-size: 9px;
  line-height: 1.4;
}
.if-md-card-meta span {
  max-width: 65%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.if-md-card-body h3 {
  margin: 0;
  font-size: 16px;
  line-height: 1.3;
  letter-spacing: -.018em;
}
.if-md-card-body h3 a {
  color: #111;
  text-decoration: none;
}
.if-md-card-body p {
  margin: 7px 0 0;
  color: #777;
  font-size: 11px;
  line-height: 1.55;
}
.if-md-read {
  display: inline-block;
  margin-top: 11px;
  color: #111;
  font-size: 10px;
  font-weight: 800;
  text-decoration: none;
}
.if-md-read:hover { color: #ef233c; }

.if-md-pagination {
  margin-top: 30px;
}
.if-md-pagination ul {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 7px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.if-md-pagination a,
.if-md-pagination span {
  display: grid;
  min-width: 35px;
  height: 35px;
  place-items: center;
  padding: 0 9px;
  border: 1px solid #ddd;
  border-radius: 5px;
  color: #333;
  background: #fff;
  font-size: 11px;
  text-decoration: none;
}
.if-md-pagination .current,
.if-md-pagination a:hover {
  border-color: #111;
  background: #111;
  color: #fff;
}

.if-md-mini-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 15px;
}
.if-md-mini-card {
  display: grid;
  grid-template-columns: 82px minmax(0, 1fr);
  gap: 13px;
  align-items: center;
  min-width: 0;
  padding: 10px;
  border: 1px solid #e7e7e7;
  border-radius: 8px;
}
.if-md-mini-poster {
  display: block;
  aspect-ratio: 2 / 3;
  overflow: hidden;
  border-radius: 5px;
  background: #f1f1f1;
}
.if-md-mini-poster img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.if-md-mini-card h3 {
  margin: 0 0 6px;
  font-size: 13px;
  line-height: 1.35;
}
.if-md-mini-card h3 a {
  color: #111;
  text-decoration: none;
}
.if-md-mini-card time {
  color: #888;
  font-size: 9px;
}

.if-md-explore-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}
.if-md-explore-grid a {
  min-height: 115px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 20px;
  border-radius: 9px;
  background: #f7f7f7;
  color: #111;
  text-decoration: none;
  transition: background .18s ease, transform .18s ease;
}
.if-md-explore-grid a:hover {
  background: #efefef;
  transform: translateY(-2px);
}
.if-md-explore-grid strong {
  font-size: 15px;
}
.if-md-explore-grid span {
  color: #777;
  font-size: 10px;
  line-height: 1.5;
}

.if-md-about {
  max-width: 920px;
}
.if-md-about h2 {
  margin: 7px 0 9px;
  font-size: 27px;
  letter-spacing: -.03em;
}
.if-md-about p {
  margin: 0;
  color: #666;
  font-size: 13px;
  line-height: 1.8;
}

.if-md-faq details {
  border-bottom: 1px solid #e5e5e5;
}
.if-md-faq details:first-of-type { border-top: 1px solid #e5e5e5; }
.if-md-faq summary {
  cursor: pointer;
  padding: 18px 0;
  color: #111;
  font-size: 14px;
  font-weight: 700;
  list-style: none;
}
.if-md-faq summary::-webkit-details-marker { display: none; }
.if-md-faq summary:after {
  content: "+";
  float: right;
  color: #999;
  font-size: 17px;
}
.if-md-faq details[open] summary:after { content: "−"; }
.if-md-faq details p {
  max-width: 900px;
  margin: -4px 0 18px;
  color: #666;
  font-size: 12px;
  line-height: 1.75;
}

.if-md-empty {
  padding: 60px 20px;
  border: 1px dashed #ddd;
  border-radius: 10px;
  text-align: center;
}
.if-md-empty-icon { font-size: 34px; }
.if-md-empty h3 { margin: 10px 0 5px; }
.if-md-empty p { color: #777; font-size: 12px; }
.if-md-empty a {
  display: inline-block;
  padding: 10px 15px;
  border-radius: 5px;
  background: #111;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  text-decoration: none;
}

@media (max-width: 1100px) {
  .if-md-language-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .if-md-movie-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .if-md-filters { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .if-md-filter-button { width: 100%; }
  .if-md-clear { justify-self: start; }
  .if-md-explore-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 800px) {
  .if-md-container { width: calc(100% - 28px); }
  .if-md-hero { grid-template-columns: 1fr; gap: 24px; padding: 32px 26px; }
  .if-md-search { max-width: 680px; }
  .if-md-movie-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
  .if-md-mini-grid { grid-template-columns: 1fr; }
}

@media (max-width: 600px) {
  .if-md-container { width: calc(100% - 20px); }
  .if-md-breadcrumbs { padding-top: 12px; }
  .if-md-hero { margin-top: 2px; padding: 28px 18px; border-radius: 10px; }
  .if-md-hero h1 { font-size: 38px; }
  .if-md-hero p { font-size: 12px; line-height: 1.65; }
  .if-md-search input { font-size: 12px; }
  .if-md-search button { padding: 0 13px; }
  .if-md-section { padding: 28px 0; }
  .if-md-language-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .if-md-language-card { padding: 13px 10px; }
  .if-md-language-icon { flex-basis: 28px; width: 28px; height: 28px; font-size: 12px; }
  .if-md-language-card strong { font-size: 10px; }
  .if-md-language-card small { font-size: 8px; }
  .if-md-section-head { align-items: flex-end; }
  .if-md-section-head h2 { font-size: 22px; }
  .if-md-filters { grid-template-columns: 1fr 1fr; }
  .if-md-filter-search { grid-column: 1 / -1; }
  .if-md-filter-button { grid-column: 1; }
  .if-md-clear { grid-column: 2; justify-self: start; }
  .if-md-movie-grid { gap: 10px; }
  .if-md-card-body { padding: 10px 10px 12px; }
  .if-md-card-body h3 { font-size: 13px; }
  .if-md-card-body p { font-size: 10px; }
  .if-md-read { font-size: 9px; }
  .if-md-explore-grid { grid-template-columns: 1fr; }
}

@media (max-width: 390px) {
  .if-md-movie-grid { grid-template-columns: 1fr; }
  .if-md-language-grid { grid-template-columns: 1fr; }
  .if-md-filters { grid-template-columns: 1fr; }
  .if-md-filter-search,
  .if-md-filter-button,
  .if-md-clear { grid-column: auto; }
}

/* ============================================================
   MOVIE DATABASE: FULL-WIDTH / NO SIDEBAR / MOBILE HARDENING
   The Magbook archive can inherit a two-column content + sidebar
   layout. The movie database is a dedicated full-width experience.
   ============================================================ */
body.category-movie-database {
  overflow-x: hidden;
}

body.category-movie-database #secondary,
body.category-movie-database .sidebar,
body.category-movie-database aside.sidebar,
body.category-movie-database .widget-area,
body.category-movie-database .secondary,
body.category-movie-database .right-sidebar,
body.category-movie-database .site-sidebar,
body.category-movie-database .sidebar-wrap,
body.category-movie-database .main-sidebar,
body.category-movie-database .content-sidebar {
  display: none !important;
  width: 0 !important;
  max-width: 0 !important;
  min-width: 0 !important;
  flex: 0 0 0 !important;
  visibility: hidden !important;
}

/* Remove the inherited 2-column constraints. */
body.category-movie-database #primary,
body.category-movie-database .site-main,
body.category-movie-database .content-area,
body.category-movie-database .main-content,
body.category-movie-database .main-content-wrap,
body.category-movie-database .site-content,
body.category-movie-database .site-content .container,
body.category-movie-database .site-content > .container,
body.category-movie-database .content-wrapper,
body.category-movie-database .main-wrapper {
  width: 100% !important;
  max-width: none !important;
  min-width: 0 !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
  flex: 1 1 100% !important;
}

body.category-movie-database .site-content {
  display: block !important;
}

body.category-movie-database #primary {
  float: none !important;
}

/* Our database container is the only horizontal constraint. */
body.category-movie-database .if-md-container {
  width: min(1400px, calc(100% - 48px)) !important;
  max-width: 1400px !important;
  margin-left: auto !important;
  margin-right: auto !important;
}

/* Prevent inherited article/category styles from forcing widths. */
body.category-movie-database .if-movie-database,
body.category-movie-database .if-md-hero,
body.category-movie-database .if-md-language-grid,
body.category-movie-database .if-md-filters,
body.category-movie-database .if-md-movie-grid,
body.category-movie-database .if-md-mini-grid,
body.category-movie-database .if-md-explore-grid {
  min-width: 0;
  max-width: none;
}

body.category-movie-database .if-md-hero-copy,
body.category-movie-database .if-md-search {
  min-width: 0;
}

body.category-movie-database img {
  max-width: 100%;
}

@media (max-width: 900px) {
  body.category-movie-database .if-md-container {
    width: calc(100% - 28px) !important;
  }

  body.category-movie-database .if-md-hero {
    grid-template-columns: 1fr;
  }

  body.category-movie-database .if-md-search {
    width: 100%;
    max-width: none;
  }

  body.category-movie-database .if-md-language-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  body.category-movie-database .if-md-movie-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  body.category-movie-database .if-md-container {
    width: calc(100% - 20px) !important;
  }

  body.category-movie-database .if-md-breadcrumbs {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  body.category-movie-database .if-md-hero {
    width: 100%;
    padding: 28px 18px;
    border-radius: 10px;
  }

  body.category-movie-database .if-md-hero h1 {
    font-size: clamp(34px, 10vw, 44px);
    overflow-wrap: anywhere;
  }

  body.category-movie-database .if-md-hero p {
    font-size: 12px;
    overflow-wrap: anywhere;
  }

  body.category-movie-database .if-md-search {
    display: flex;
    width: 100%;
  }

  body.category-movie-database .if-md-search input {
    width: 100%;
    min-width: 0;
  }

  body.category-movie-database .if-md-search button {
    flex: 0 0 auto;
  }

  body.category-movie-database .if-md-language-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  body.category-movie-database .if-md-filters {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  body.category-movie-database .if-md-filter-search {
    grid-column: 1 / -1;
  }

  body.category-movie-database .if-md-filter-button {
    width: 100%;
  }

  body.category-movie-database .if-md-movie-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  body.category-movie-database .if-md-card,
  body.category-movie-database .if-md-poster {
    min-width: 0;
  }
}

@media (max-width: 390px) {
  body.category-movie-database .if-md-language-grid,
  body.category-movie-database .if-md-movie-grid,
  body.category-movie-database .if-md-filters {
    grid-template-columns: 1fr;
  }

  body.category-movie-database .if-md-filter-search {
    grid-column: auto;
  }
}

/* ============================================================
   FINAL MOBILE / FULL-WIDTH FIX
   Magbook parent sets #primary to width:70%. The Movie Database
   template itself uses id="primary", so explicitly reset that
   inherited archive width. This removes the empty/black 30% area.
   ============================================================ */
body.category-movie-database #primary.if-movie-database {
  float: none !important;
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
}

body.category-movie-database #primary.if-movie-database > * {
  max-width: 100%;
}

body.category-movie-database {
  overflow-x: hidden !important;
}

body.category-movie-database .if-movie-database {
  width: 100% !important;
  max-width: 100% !important;
  overflow: hidden;
}

body.category-movie-database .if-md-container {
  width: min(1400px, calc(100% - 40px)) !important;
  max-width: 1400px !important;
  margin-left: auto !important;
  margin-right: auto !important;
}

@media (max-width: 767px) {
  body.category-movie-database #primary.if-movie-database {
    display: block !important;
    float: none !important;
    width: 100vw !important;
    max-width: 100vw !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
  }

  body.category-movie-database .if-md-container {
    width: calc(100% - 20px) !important;
    max-width: none !important;
  }

  body.category-movie-database .if-md-hero {
    width: 100% !important;
    max-width: 100% !important;
    grid-template-columns: minmax(0, 1fr) !important;
  }

  body.category-movie-database .if-md-hero-copy,
  body.category-movie-database .if-md-search {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
  }

  body.category-movie-database .if-md-search input {
    min-width: 0 !important;
    width: 100% !important;
  }

  body.category-movie-database .if-md-language-grid,
  body.category-movie-database .if-md-movie-grid {
    width: 100% !important;
    max-width: 100% !important;
  }
}


/* FINAL MOVIE DATABASE FULL-WIDTH FIX
 * Magbook parent theme sets #primary { width:70%; float:left; }.
 * This template intentionally does not use #primary, so the page is full width.
 */
#main.if-md-main,
#if-md-main.if-movie-database,
.if-movie-database {
  float: none !important;
  display: block !important;
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  margin: 0 !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
  box-sizing: border-box !important;
}

.if-movie-database > .if-md-container {
  width: min(1400px, calc(100% - 40px)) !important;
  max-width: 1400px !important;
  margin-left: auto !important;
  margin-right: auto !important;
  box-sizing: border-box !important;
}

@media (max-width: 767px) {
  #if-md-main.if-movie-database,
  .if-movie-database {
    width: 100vw !important;
    max-width: 100vw !important;
    overflow-x: hidden !important;
  }
  .if-movie-database > .if-md-container {
    width: calc(100% - 20px) !important;
    max-width: none !important;
  }
}

/* =========================================================
   MOVIE DATABASE LANGUAGE PAGES
   Six child database URLs use the same 16:9 landscape design.
   Source image ratio: 1200x675. Images are NEVER cropped.
   ========================================================= */
body.category-tamil,
body.category-telugu,
body.category-kannada,
body.category-malayalam,
body.category-bollywood,
body.category-english {
  overflow-x: hidden !important;
}

body.category-tamil #secondary,
body.category-telugu #secondary,
body.category-kannada #secondary,
body.category-malayalam #secondary,
body.category-bollywood #secondary,
body.category-english #secondary,
body.category-tamil .sidebar,
body.category-telugu .sidebar,
body.category-kannada .sidebar,
body.category-malayalam .sidebar,
body.category-bollywood .sidebar,
body.category-english .sidebar {
  display: none !important;
}

body.category-tamil #primary,
body.category-telugu #primary,
body.category-kannada #primary,
body.category-malayalam #primary,
body.category-bollywood #primary,
body.category-english #primary,
body.category-tamil .site-main,
body.category-telugu .site-main,
body.category-kannada .site-main,
body.category-malayalam .site-main,
body.category-bollywood .site-main,
body.category-english .site-main {
  float: none !important;
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
}

body.category-tamil .if-md-container,
body.category-telugu .if-md-container,
body.category-kannada .if-md-container,
body.category-malayalam .if-md-container,
body.category-bollywood .if-md-container,
body.category-english .if-md-container {
  width: min(1400px, calc(100% - 40px)) !important;
  max-width: 1400px !important;
  margin-left: auto !important;
  margin-right: auto !important;
}

.if-lang-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 460px);
  gap: 32px;
  align-items: end;
  min-height: 330px;
  margin-bottom: 28px;
  padding: 44px;
  border-radius: 18px;
  overflow: hidden;
  color: #fff;
  background:
    radial-gradient(circle at 85% 10%, rgba(239,35,60,.35), transparent 32%),
    radial-gradient(circle at 65% 100%, rgba(239,35,60,.18), transparent 35%),
    #090909;
  position: relative;
}
.if-lang-hero:after {
  content: '';
  position: absolute;
  width: 430px;
  height: 430px;
  right: -160px;
  bottom: -230px;
  border-radius: 50%;
  background: rgba(239,35,60,.15);
  pointer-events: none;
}
.if-lang-hero-copy { position: relative; z-index: 1; max-width: 850px; }
.if-lang-hero h1 {
  margin: 12px 0 14px;
  color: #fff;
  font-size: clamp(38px, 5vw, 66px);
  line-height: .98;
  letter-spacing: -.055em;
}
.if-lang-hero p {
  max-width: 780px;
  margin: 0;
  color: rgba(255,255,255,.72);
  font-size: 15px;
  line-height: 1.75;
}
.if-lang-hero .if-md-search { position: relative; z-index: 2; }

.if-lang-nav-section { margin: 0 0 44px; }
.if-lang-nav-scroll {
  display: flex;
  gap: 9px;
  overflow-x: auto;
  padding: 2px 2px 7px;
  scrollbar-width: thin;
}
.if-lang-nav-pill {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  padding: 0 17px;
  border: 1px solid #e5e5e5;
  border-radius: 999px;
  background: #fff;
  color: #222;
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
  transition: .18s ease;
}
.if-lang-nav-pill:hover,
.if-lang-nav-pill.is-active {
  border-color: #ef233c;
  background: #ef233c;
  color: #fff;
}

.if-lang-section { margin: 0 0 58px; }
.if-lang-section-head {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 20px;
  margin-bottom: 20px;
}
.if-lang-section-head h2 {
  margin: 7px 0 0;
  font-size: clamp(26px, 3vw, 38px);
  line-height: 1.08;
  letter-spacing: -.04em;
}
.if-lang-count { color: #777; font-size: 11px; font-weight: 700; }

.if-lang-filters {
  display: grid;
  grid-template-columns: 190px 190px minmax(240px, 1fr) auto auto;
  align-items: end;
  gap: 10px;
  padding: 18px;
  border: 1px solid #e7e7e7;
  border-radius: 12px;
  background: #fafafa;
}
.if-lang-filters label {
  display: block;
  margin: 0 0 6px;
  color: #777;
  font-size: 10px;
  font-weight: 800;
}
.if-lang-filters select,
.if-lang-filters input {
  width: 100%;
  height: 44px;
  box-sizing: border-box;
  border: 1px solid #ddd;
  border-radius: 6px;
  background: #fff;
  color: #222;
  padding: 0 11px;
  font: inherit;
  font-size: 12px;
  outline: none;
}
.if-lang-filters button {
  height: 44px;
  border: 0;
  border-radius: 6px;
  padding: 0 18px;
  background: #ef233c;
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
}
.if-lang-filters > a {
  display: grid;
  height: 44px;
  place-items: center;
  padding: 0 10px;
  color: #777;
  font-size: 11px;
  font-weight: 700;
  text-decoration: none;
}

.if-lang-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
}
.if-lang-card {
  min-width: 0;
  overflow: hidden;
  border: 1px solid #e6e6e6;
  border-radius: 12px;
  background: #fff;
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.if-lang-card:hover {
  transform: translateY(-4px);
  border-color: #ddd;
  box-shadow: 0 14px 32px rgba(0,0,0,.09);
}
.if-lang-image {
  display: block;
  position: relative;
  width: 100%;
  aspect-ratio: 1200 / 675;
  overflow: hidden;
  background: #111;
}
.if-lang-image img {
  display: block !important;
  width: 100% !important;
  height: 100% !important;
  max-width: none !important;
  object-fit: contain !important;
  object-position: center !important;
  transition: transform .3s ease;
}
.if-lang-card:hover .if-lang-image img { transform: scale(1.015); }
.if-lang-image-placeholder {
  display: grid;
  width: 100%;
  height: 100%;
  place-items: center;
  color: #aaa;
  font-size: 42px;
}
.if-lang-image-label {
  position: absolute;
  left: 12px;
  bottom: 12px;
  padding: 6px 9px;
  border-radius: 5px;
  background: rgba(0,0,0,.72);
  color: #fff;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.if-lang-card-body { padding: 16px 17px 18px; }
.if-lang-meta {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
  color: #888;
  font-size: 9px;
}
.if-lang-meta span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.if-lang-card-body h2 { margin: 0; font-size: 18px; line-height: 1.28; letter-spacing: -.025em; }
.if-lang-card-body h2 a { color: #111; text-decoration: none; }
.if-lang-card-body p { margin: 8px 0 0; color: #777; font-size: 11px; line-height: 1.6; }
.if-lang-details {
  display: inline-block;
  margin-top: 12px;
  color: #111;
  font-size: 10px;
  font-weight: 800;
  text-decoration: none;
}
.if-lang-details:hover { color: #ef233c; }

.if-lang-empty {
  padding: 45px 25px;
  border: 1px solid #e7e7e7;
  border-radius: 12px;
  text-align: center;
  background: #fafafa;
}
.if-lang-empty strong { font-size: 20px; }
.if-lang-empty p { color: #777; font-size: 12px; }
.if-lang-empty a { color: #ef233c; font-size: 12px; font-weight: 800; text-decoration: none; }

.if-lang-about {
  padding: 34px;
  border-radius: 14px;
  background: #f7f7f7;
}
.if-lang-about h2 { margin: 8px 0 10px; font-size: 28px; letter-spacing: -.035em; }
.if-lang-about p { max-width: 900px; margin: 0; color: #666; font-size: 13px; line-height: 1.8; }

.if-lang-related {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
.if-lang-related a {
  display: flex;
  min-height: 88px;
  flex-direction: column;
  justify-content: space-between;
  padding: 18px;
  border: 1px solid #e6e6e6;
  border-radius: 10px;
  color: #111;
  text-decoration: none;
  background: #fff;
  transition: .18s ease;
}
.if-lang-related a:hover { border-color: #ef233c; transform: translateY(-2px); }
.if-lang-related strong { font-size: 14px; }
.if-lang-related span { color: #888; font-size: 10px; font-weight: 700; }

@media (max-width: 1000px) {
  .if-lang-hero { grid-template-columns: 1fr; }
  .if-lang-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .if-lang-filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .if-lang-filter-search { grid-column: 1 / -1; }
  .if-lang-filters button { width: 100%; }
  .if-lang-related { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 640px) {
  body.category-tamil #primary,
  body.category-telugu #primary,
  body.category-kannada #primary,
  body.category-malayalam #primary,
  body.category-bollywood #primary,
  body.category-english #primary {
    width: 100vw !important;
    max-width: 100vw !important;
  }
  body.category-tamil .if-md-container,
  body.category-telugu .if-md-container,
  body.category-kannada .if-md-container,
  body.category-malayalam .if-md-container,
  body.category-bollywood .if-md-container,
  body.category-english .if-md-container {
    width: calc(100% - 20px) !important;
    max-width: none !important;
  }
  .if-lang-hero { min-height: 0; padding: 28px 18px; border-radius: 11px; gap: 24px; }
  .if-lang-hero h1 { font-size: clamp(34px, 10vw, 48px); }
  .if-lang-hero p { font-size: 12px; line-height: 1.65; }
  .if-lang-grid { grid-template-columns: 1fr; gap: 16px; }
  .if-lang-filters { grid-template-columns: 1fr; }
  .if-lang-filter-search { grid-column: auto; }
  .if-lang-related { grid-template-columns: 1fr; }
  .if-lang-section { margin-bottom: 42px; }
  .if-lang-section-head { align-items: start; }
  .if-lang-section-head h2 { font-size: 26px; }
  .if-lang-count { padding-top: 8px; white-space: nowrap; }
}

/* =========================================================
   HOMEPAGE — MOVIE DATABASE TOP BLOCK
   ========================================================= */
.if-home-movie-database {
  margin: 0 0 22px;
  padding: 28px 0 34px;
  background: #f7f7f7;
  border-top: 1px solid #e9e9e9;
  border-bottom: 1px solid #e9e9e9;
}
.if-home-md-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 16px;
}
.if-home-md-kicker {
  display: block;
  margin-bottom: 5px;
  color: #ef233c;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .13em;
}
.if-home-md-heading h2 {
  margin: 0;
  color: #111;
  font-size: clamp(26px, 3vw, 34px);
  line-height: 1.05;
  letter-spacing: -.04em;
}
.if-home-md-heading p {
  margin: 7px 0 0;
  color: #777;
  font-size: 12px;
  line-height: 1.55;
}
.if-home-md-view-all {
  flex: 0 0 auto;
  color: #111;
  font-size: 11px;
  font-weight: 800;
  text-decoration: none;
}
.if-home-md-view-all:hover { color: #ef233c; }
.if-home-md-languages {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-bottom: 18px;
}
.if-home-md-languages a {
  display: inline-flex;
  min-height: 30px;
  align-items: center;
  padding: 0 12px;
  border: 1px solid #ddd;
  border-radius: 999px;
  background: #fff;
  color: #333;
  font-size: 10px;
  font-weight: 700;
  text-decoration: none;
}
.if-home-md-languages a:hover {
  border-color: #ef233c;
  color: #ef233c;
}
.if-home-md-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}
.if-home-md-card {
  min-width: 0;
  overflow: hidden;
  border: 1px solid #e4e4e4;
  border-radius: 10px;
  background: #fff;
  transition: transform .2s ease, box-shadow .2s ease;
}
.if-home-md-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 28px rgba(0,0,0,.08);
}
.if-home-md-image {
  display: block;
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: #111;
}
.if-home-md-image img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #111;
}
.if-home-md-placeholder {
  display: grid;
  width: 100%;
  height: 100%;
  place-items: center;
  color: #aaa;
  font-size: 34px;
}
.if-home-md-badge {
  position: absolute;
  left: 10px;
  bottom: 10px;
  padding: 5px 8px;
  border-radius: 4px;
  background: rgba(0,0,0,.82);
  color: #fff;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .03em;
}
.if-home-md-body {
  padding: 13px 14px 15px;
}
.if-home-md-meta {
  color: #888;
  font-size: 9px;
}
.if-home-md-body h3 {
  margin: 6px 0 0;
  font-size: 17px;
  line-height: 1.3;
  letter-spacing: -.02em;
}
.if-home-md-body h3 a {
  color: #111;
  text-decoration: none;
}
.if-home-md-body p {
  margin: 6px 0 0;
  color: #777;
  font-size: 11px;
  line-height: 1.55;
}
.if-home-md-details {
  display: inline-block;
  margin-top: 10px;
  color: #111;
  font-size: 10px;
  font-weight: 800;
  text-decoration: none;
}
.if-home-md-details:hover { color: #ef233c; }

/* =========================================================
   MOVIE DATABASE — SINGLE MOVIE PAGE
   ========================================================= */
body.single-post:has(#if-movie-post) {
  overflow-x: hidden;
}
.if-movie-post {
  width: 100%;
  background: #fff;
  color: #111;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
.if-movie-post-container {
  width: min(1280px, calc(100% - 40px));
  margin: 0 auto;
}
.if-movie-post-breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 18px 0 12px;
  color: #888;
  font-size: 11px;
}
.if-movie-post-breadcrumbs a {
  color: #555;
  text-decoration: none;
}
.if-movie-post-breadcrumbs a:hover { color: #ef233c; }
.if-movie-post-hero {
  display: grid;
  grid-template-columns: minmax(360px, .9fr) minmax(0, 1.1fr);
  gap: 42px;
  align-items: center;
  padding: 34px;
  border-radius: 16px;
  overflow: hidden;
  background: #090909;
  color: #fff;
}
.if-movie-post-poster {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: 10px;
  background: #151515;
}
.if-movie-post-poster img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #111;
}
.if-movie-post-placeholder {
  display: grid;
  width: 100%;
  height: 100%;
  place-items: center;
  color: #888;
  font-size: 55px;
}
.if-movie-post-hero-copy { min-width: 0; }
.if-movie-post-kicker {
  display: inline-block;
  color: #ef233c;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .13em;
  line-height: 1.4;
}
.if-movie-post-hero h1 {
  margin: 10px 0 14px;
  color: #fff;
  font-size: clamp(32px, 4vw, 56px);
  line-height: 1.02;
  letter-spacing: -.045em;
}
.if-movie-post-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}
.if-movie-post-tags span {
  padding: 6px 9px;
  border: 1px solid #333;
  border-radius: 999px;
  color: #ddd;
  font-size: 9px;
  font-weight: 700;
}
.if-movie-post-lead {
  max-width: 700px;
  margin: 18px 0 0;
  color: #bbb;
  font-size: 13px;
  line-height: 1.75;
}
.if-movie-post-quick {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: 18px 0 32px;
  border: 1px solid #e4e4e4;
  border-radius: 10px;
  background: #fff;
  overflow: hidden;
}
.if-movie-post-quick-item {
  min-width: 0;
  padding: 15px 17px;
  border-right: 1px solid #e7e7e7;
}
.if-movie-post-quick-item:last-child { border-right: 0; }
.if-movie-post-quick-item small {
  display: block;
  margin-bottom: 5px;
  color: #888;
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.if-movie-post-quick-item strong {
  display: block;
  color: #111;
  font-size: 12px;
  line-height: 1.4;
}
.if-movie-post-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 34px;
  align-items: start;
}
.if-movie-post-main { min-width: 0; }
.if-movie-post-section {
  padding: 30px 0;
  border-bottom: 1px solid #e7e7e7;
}
.if-movie-post-section h2 {
  margin: 7px 0 14px;
  color: #111;
  font-size: clamp(23px, 3vw, 31px);
  line-height: 1.15;
  letter-spacing: -.035em;
}
.if-movie-post-overview {
  margin: 0;
  color: #555;
  font-size: 14px;
  line-height: 1.85;
}
.if-movie-post-details {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border-top: 1px solid #e5e5e5;
  border-left: 1px solid #e5e5e5;
  border-radius: 8px;
  overflow: hidden;
}
.if-movie-post-detail {
  min-width: 0;
  padding: 14px 15px;
  border-right: 1px solid #e5e5e5;
  border-bottom: 1px solid #e5e5e5;
  background: #fff;
}
.if-movie-post-detail span {
  display: block;
  margin-bottom: 5px;
  color: #888;
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.if-movie-post-detail strong {
  display: block;
  color: #222;
  font-size: 12px;
  line-height: 1.55;
  overflow-wrap: anywhere;
}
.if-movie-post-article .entry-content {
  color: #444;
  font-size: 14px;
  line-height: 1.85;
}
.if-movie-post-article .entry-content h2,
.if-movie-post-article .entry-content h3 {
  margin-top: 24px;
}
.if-movie-post-article .entry-content img {
  max-width: 100%;
  height: auto;
}
.if-movie-post-share {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 24px 0 45px;
  color: #777;
  font-size: 11px;
}
.if-movie-post-share strong { color: #222; }
.if-movie-post-share a {
  padding: 7px 10px;
  border: 1px solid #ddd;
  border-radius: 5px;
  color: #333;
  text-decoration: none;
}
.if-movie-post-share a:hover { border-color: #ef233c; color: #ef233c; }
.if-movie-post-sidebar { min-width: 0; }
.if-movie-post-side-box {
  position: sticky;
  top: 20px;
  padding: 20px;
  border: 1px solid #e5e5e5;
  border-radius: 10px;
  background: #fafafa;
}
.if-movie-post-side-box h2 {
  margin: 6px 0 13px;
  font-size: 20px;
  letter-spacing: -.025em;
}
.if-movie-post-side-link {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 15px;
  padding: 11px 12px;
  border-radius: 5px;
  background: #111;
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  text-decoration: none;
}
.if-movie-post-related {
  display: grid;
  grid-template-columns: 82px minmax(0, 1fr);
  gap: 11px;
  align-items: center;
  padding: 11px 0;
  border-top: 1px solid #e5e5e5;
}
.if-movie-post-related > a {
  display: block;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: 5px;
  background: #111;
}
.if-movie-post-related img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.if-movie-post-related-placeholder {
  display: grid;
  width: 100%;
  height: 100%;
  place-items: center;
  color: #aaa;
}
.if-movie-post-related h3 {
  margin: 0 0 5px;
  font-size: 12px;
  line-height: 1.35;
}
.if-movie-post-related h3 a {
  color: #222;
  text-decoration: none;
}
.if-movie-post-related time {
  color: #888;
  font-size: 9px;
}

@media (max-width: 980px) {
  .if-home-md-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .if-movie-post-hero { grid-template-columns: minmax(0, 1fr); gap: 24px; }
  .if-movie-post-layout { grid-template-columns: minmax(0, 1fr); }
  .if-movie-post-sidebar { order: 2; }
  .if-movie-post-side-box { position: static; }
}

@media (max-width: 767px) {
  .if-home-movie-database { padding: 22px 0 26px; }
  .if-home-md-heading { align-items: start; flex-direction: column; gap: 10px; }
  .if-home-md-grid {
    display: flex;
    gap: 14px;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding: 2px 2px 10px;
    margin-right: -10px;
  }
  .if-home-md-grid::-webkit-scrollbar { display: none; }
  .if-home-md-card {
    flex: 0 0 82%;
    scroll-snap-align: start;
  }
  .if-home-md-image { aspect-ratio: 16 / 9; }
  .if-home-md-languages {
    overflow-x: auto;
    flex-wrap: nowrap;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 4px;
  }
  .if-home-md-languages::-webkit-scrollbar { display: none; }
  .if-home-md-languages a { flex: 0 0 auto; }
  .if-movie-post-container { width: calc(100% - 20px); }
  .if-movie-post-breadcrumbs { font-size: 10px; }
  .if-movie-post-hero { padding: 15px; border-radius: 10px; }
  .if-movie-post-poster { aspect-ratio: 16 / 9; }
  .if-movie-post-hero h1 { font-size: 32px; }
  .if-movie-post-quick { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .if-movie-post-quick-item:nth-child(2) { border-right: 0; }
  .if-movie-post-quick-item:nth-child(-n+2) { border-bottom: 1px solid #e7e7e7; }
  .if-movie-post-details { grid-template-columns: 1fr; }
  .if-movie-post-section { padding: 24px 0; }
}

@media (max-width: 390px) {
  .if-movie-post-quick { grid-template-columns: 1fr; }
  .if-movie-post-quick-item { border-right: 0; border-bottom: 1px solid #e7e7e7; }
  .if-movie-post-quick-item:last-child { border-bottom: 0; }
}


/* V19: full-width movie discovery blocks */
.if-movie-post-discovery { margin-top: 38px; padding-top: 8px; border-top: 1px solid #e7e7e7; }
.if-movie-post-discovery-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; }
.if-movie-post-discovery-grid .if-movie-post-side-box { min-width: 0; }
.if-movie-post-discovery-grid .if-movie-post-video-box { grid-column: 1 / -1; }
.if-movie-post-related-tags { display:flex; flex-wrap:wrap; gap:7px; margin:0 0 15px; }
.if-movie-post-related-tags a { display:inline-block; padding:6px 10px; border:1px solid #ddd; border-radius:999px; color:#333; font-size:11px; text-decoration:none; }
.if-movie-post-related-tags a:hover { color:#ef233c; border-color:#ef233c; }
.if-movie-post-video iframe { display:block; width:100%; min-height:360px; border:0; }
@media (max-width: 760px) {
  .if-movie-post-discovery-grid { grid-template-columns:1fr; }
  .if-movie-post-discovery-grid .if-movie-post-video-box { grid-column:auto; }
  .if-movie-post-video iframe { min-height:220px; }
}

/* V20: thumbnail-card discovery layout */
.if-md-discovery-section { margin-top: 42px; padding-top: 28px; border-top: 1px solid #e6e6e6; }
.if-md-discovery-heading { display:flex; align-items:flex-end; justify-content:space-between; gap:20px; margin-bottom:18px; }
.if-md-discovery-heading h2 { margin:4px 0 0; font-size:24px; line-height:1.2; }
.if-md-discovery-heading > a { font-size:13px; font-weight:700; color:#e21d2d; text-decoration:none; white-space:nowrap; }
.if-md-thumb-grid { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:20px; }
.if-md-thumb-card { min-width:0; background:#fff; border:1px solid #e7e7e7; border-radius:10px; overflow:hidden; transition:transform .2s ease, box-shadow .2s ease; }
.if-md-thumb-card:hover { transform:translateY(-3px); box-shadow:0 8px 24px rgba(0,0,0,.08); }
.if-md-thumb-image { display:block; aspect-ratio:16/9; background:#111; overflow:hidden; }
.if-md-thumb-image img { display:block; width:100%; height:100%; object-fit:cover; }
.if-md-thumb-placeholder { width:100%; height:100%; min-height:120px; display:flex; align-items:center; justify-content:center; font-size:38px; color:#fff; background:#171717; }
.if-md-thumb-body { padding:12px 13px 14px; }
.if-md-thumb-meta { display:block; margin-bottom:5px; color:#888; font-size:10px; font-weight:700; text-transform:uppercase; letter-spacing:.04em; }
.if-md-thumb-body h3 { margin:0; font-size:16px; line-height:1.35; }
.if-md-thumb-body h3 a { color:#171717; text-decoration:none; }
.if-md-thumb-body h3 a:hover { color:#e21d2d; }
.if-md-video-section { margin-bottom:10px; }
.if-md-video-card { display:block; max-width:760px; margin:0 auto; text-decoration:none; }
.if-md-video-thumb { position:relative; aspect-ratio:16/9; overflow:hidden; border-radius:10px; background:#111; }
.if-md-video-thumb img { display:block; width:100%; height:100%; object-fit:cover; }
.if-md-play { position:absolute; left:50%; top:50%; transform:translate(-50%,-50%); width:64px; height:64px; border-radius:50%; background:rgba(225,29,45,.95); color:#fff; display:flex; align-items:center; justify-content:center; padding-left:4px; font-size:25px; box-shadow:0 5px 20px rgba(0,0,0,.35); }
.if-md-video-title { padding:12px 2px 0; color:#171717; font-size:18px; font-weight:700; line-height:1.35; }
@media (max-width:1000px) { .if-md-thumb-grid { grid-template-columns:repeat(3,minmax(0,1fr)); } }
@media (max-width:760px) { .if-md-thumb-grid { grid-template-columns:repeat(2,minmax(0,1fr)); gap:14px; } .if-md-discovery-heading h2 { font-size:21px; } .if-md-thumb-body h3 { font-size:14px; } .if-md-thumb-body { padding:10px; } .if-md-play { width:52px; height:52px; font-size:20px; } }
@media (max-width:480px) { .if-md-thumb-grid { grid-template-columns:1fr 1fr; gap:10px; } .if-md-thumb-body h3 { font-size:13px; } .if-md-thumb-meta { font-size:9px; } }


/* V21: remove Movie Database video block and make same-language movies horizontally scrollable on mobile. */
.if-md-video-section, .if-md-video-card, .if-md-video-thumb, .if-md-video-title { display:none !important; }
.if-md-language-movies .if-md-thumb-grid { display:grid; }
@media (max-width:760px) {
  .if-md-language-movies .if-md-thumb-grid {
    display:flex;
    overflow-x:auto;
    overflow-y:hidden;
    gap:14px;
    padding:0 2px 12px;
    scroll-snap-type:x mandatory;
    -webkit-overflow-scrolling:touch;
    scrollbar-width:thin;
  }
  .if-md-language-movies .if-md-thumb-card {
    flex:0 0 78%;
    max-width:78%;
    scroll-snap-align:start;
  }
  .if-md-language-movies .if-md-thumb-image { aspect-ratio:16/9; }
}
@media (min-width:761px) {
  .if-md-language-movies .if-md-thumb-grid { grid-template-columns:repeat(4,minmax(0,1fr)); }
}

/* Movie Database single-post section submenu and video */
.if-movie-post-subnav { position:sticky; top:0; z-index:20; display:flex; gap:8px; overflow-x:auto; padding:10px 0; margin:0 0 22px; background:#fff; border-bottom:1px solid #ececec; scrollbar-width:none; }
.if-movie-post-subnav::-webkit-scrollbar { display:none; }
.if-movie-post-subnav a { flex:0 0 auto; display:inline-flex; align-items:center; padding:8px 13px; border:1px solid #e2e2e2; border-radius:999px; color:#222; background:#fff; font-size:13px; font-weight:700; text-decoration:none; white-space:nowrap; }
.if-movie-post-subnav a:hover { color:#e21d2d; border-color:#e21d2d; }
.if-movie-post-video-section { margin:32px 0; padding-top:26px; border-top:1px solid #e6e6e6; }
.if-movie-post-video-section h2 { margin:5px 0 16px; font-size:24px; }
.if-movie-post-video-wrap { position:relative; width:100%; aspect-ratio:16/9; overflow:hidden; background:#000; border-radius:12px; }
.if-movie-post-video-wrap iframe { position:absolute; inset:0; width:100%; height:100%; border:0; }
@media (max-width:760px) { .if-movie-post-subnav { margin-left:-12px; margin-right:-12px; padding-left:12px; padding-right:12px; } .if-movie-post-video-section h2 { font-size:21px; } }

/* V23: Cast & Crew section */
.if-movie-post-cast-crew-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px; }
.if-movie-post-cast-crew-card { padding:16px; border:1px solid #e6e6e6; border-radius:10px; background:#fff; }
.if-movie-post-cast-crew-card span { display:block; margin-bottom:6px; color:#888; font-size:11px; font-weight:800; text-transform:uppercase; letter-spacing:.04em; }
.if-movie-post-cast-crew-card strong { display:block; color:#171717; font-size:14px; line-height:1.55; }
@media (max-width:600px) { .if-movie-post-cast-crew-grid { grid-template-columns:1fr; } }


/* V24: Latest Articles become a swipeable thumbnail rail on mobile. */
@media (max-width:760px) {
  .if-md-latest-articles .if-md-thumb-grid {
    display:flex;
    flex-wrap:nowrap;
    overflow-x:auto;
    overflow-y:hidden;
    gap:14px;
    padding:0 2px 12px;
    margin-right:-12px;
    padding-right:12px;
    scroll-snap-type:x mandatory;
    -webkit-overflow-scrolling:touch;
    scrollbar-width:thin;
  }
  .if-md-latest-articles .if-md-thumb-card {
    flex:0 0 78%;
    max-width:78%;
    scroll-snap-align:start;
  }
}
@media (min-width:761px) {
  .if-md-latest-articles .if-md-thumb-grid {
    display:grid;
    grid-template-columns:repeat(4,minmax(0,1fr));
  }
}
