/*
Theme Name: XChavos Video Grid
Theme URI: https://example.com/
Author: ChatGPT
Description: Tema WordPress estilo portal de videos con Random, Recientes, carga infinita, etiquetas, entrada limpia, enlaces externos por entrada y sección aleatoria en entradas.
Version: 1.4
Requires at least: 6.0
Tested up to: 6.6
Requires PHP: 7.4
License: GPLv2 or later
Text Domain: xchavos-video-grid
*/

:root {
  --xc-red: #ed1227;
  --xc-red-dark: #d70e21;
  --xc-text: #111;
  --xc-muted: #777;
  --xc-border: #ddd;
  --xc-bg: #fff;
  --xc-card-bg: #fff;
  --xc-footer-bg: #111;
  --xc-footer-text: #eee;
  --xc-max: 1120px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  color: var(--xc-text);
  background: var(--xc-bg);
  font-size: 15px;
}

a {
  color: inherit;
}

img,
video,
iframe {
  max-width: 100%;
}

.xc-wrap {
  width: min(var(--xc-max), calc(100% - 32px));
  margin: 0 auto;
}

/* Header */
.xc-header {
  background: #fff;
}

.xc-branding {
  display: flex;
  align-items: center;
  min-height: 54px;
}

.xc-logo {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  font-weight: 900;
  line-height: 1;
  letter-spacing: -1px;
}

.xc-logo-x {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 34px;
  margin-right: 4px;
  background: #000;
  color: #fff;
  font-size: 25px;
  font-weight: 900;
}

.xc-logo-text {
  color: #2e3740;
  font-size: 26px;
  text-transform: uppercase;
}

.xc-nav-bar {
  width: 100%;
  background: var(--xc-red);
}

.xc-menu,
.xc-menu ul {
  display: flex;
  align-items: center;
  gap: 0;
  list-style: none;
  margin: 0;
  padding: 0;
}

.xc-menu a,
.xc-menu .current-menu-item > a,
.xc-menu .current_page_item > a {
  display: block;
  padding: 10px 18px;
  color: #fff;
  text-decoration: none;
  font-weight: 700;
  font-size: 18px;
}

.xc-menu a:hover,
.xc-menu .current-menu-item > a,
.xc-menu .current_page_item > a {
  background: var(--xc-red-dark);
}

.xc-menu-fallback {
  display: inline-block;
  padding: 10px 18px;
  color: #fff;
  background: var(--xc-red-dark);
  font-weight: 700;
  text-decoration: none;
  font-size: 18px;
}

/* Layout */
.xc-main {
  padding: 18px 0 36px;
}

.xc-section {
  margin-bottom: 28px;
}

.xc-section-title,
.xc-archive-title {
  margin: 0 0 12px;
  font-size: 24px;
  font-weight: 900;
  line-height: 1.2;
}

.xc-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px 14px;
}

.xc-card {
  overflow: hidden;
  border: 1px solid var(--xc-border);
  background: var(--xc-card-bg);
}

.xc-card a {
  display: block;
  text-decoration: none;
}

.xc-thumb {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: #e9e9e9;
}

.xc-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform .28s ease;
}

.xc-card:hover .xc-thumb img {
  transform: scale(1.1);
}

.xc-no-thumb {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--xc-muted);
  font-weight: 700;
  background: #f1f1f1;
}

.xc-play {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 52px;
  height: 52px;
  border: 2px solid rgba(255, 255, 255, .9);
  border-radius: 50%;
  background: rgba(0, 0, 0, .42);
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.xc-play::after {
  content: '';
  position: absolute;
  left: 20px;
  top: 14px;
  width: 0;
  height: 0;
  border-top: 10px solid transparent;
  border-bottom: 10px solid transparent;
  border-left: 15px solid #fff;
}

.xc-card-title {
  min-height: 54px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 9px 10px;
  text-align: center;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.18;
}

.xc-loader,
.xc-end-message {
  display: none;
  margin: 20px auto 0;
  text-align: center;
  color: var(--xc-muted);
  font-weight: 700;
}

.xc-loader.is-visible,
.xc-end-message.is-visible {
  display: block;
}

/* Single */
.xc-single-wrap {
  max-width: 1000px;
}

.xc-single-clean {
  width: min(940px, 100%);
  margin: 0 auto;
}

.xc-single-header {
  margin: 8px 0 18px;
}

.xc-single-title {
  position: relative;
  margin: 0;
  padding-left: 18px;
  font-size: 28px;
  font-weight: 900;
  line-height: 1.25;
}

.xc-single-title::before {
  content: '';
  position: absolute;
  left: 0;
  top: 3px;
  bottom: 3px;
  width: 4px;
  background: var(--xc-red);
}

.xc-single-featured {
  margin: 0 0 22px;
  overflow: hidden;
  background: #f3f3f3;
}

.xc-single-featured img {
  display: block;
  width: 100%;
  height: auto;
}

.xc-content {
  width: 100%;
  margin: 0 0 28px;
  line-height: 1.68;
  font-size: 16px;
}

.xc-content > *:first-child {
  margin-top: 0;
}

.xc-content > *:last-child {
  margin-bottom: 0;
}

.xc-content p,
.xc-content ul,
.xc-content ol,
.xc-content blockquote,
.xc-content figure {
  margin: 0 0 18px;
}

.xc-content a {
  color: var(--xc-red);
  font-weight: 700;
}

.xc-content img,
.xc-content video,
.xc-content iframe,
.xc-content embed,
.xc-content object {
  max-width: 100%;
}

.xc-content video,
.xc-content iframe {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  height: auto;
  border: 0;
  background: #000;
}

.xc-content .wp-block-embed,
.xc-content .wp-block-video,
.xc-content .wp-block-image {
  margin: 0 0 22px;
}

.xc-page-links {
  margin-top: 22px;
  font-weight: 700;
}

.xc-tags {
  width: 100%;
  margin: 0 0 10px;
  padding-top: 16px;
  border-top: 1px solid #eee;
  font-size: 13px;
  font-weight: 800;
}

.xc-tags a {
  display: inline-block;
  margin: 6px 0 0 8px;
  padding: 8px 11px;
  border-radius: 3px;
  color: #fff;
  background: var(--xc-red);
  text-decoration: none;
}

.xc-tags a:hover {
  background: var(--xc-red-dark);
}


.xc-related-random {
  margin-top: 28px;
}

.xc-related-random .xc-section-title {
  margin-bottom: 12px;
}

/* Footer */
.xc-footer {
  margin-top: 30px;
  padding: 26px 0;
  background: var(--xc-footer-bg);
  color: var(--xc-footer-text);
}

.xc-footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.xc-footer a {
  color: #fff;
  text-decoration: none;
}

.xc-footer-menu ul,
.xc-footer-menu {
  display: flex;
  gap: 14px;
  list-style: none;
  margin: 0;
  padding: 0;
  flex-wrap: wrap;
}

.xc-footer-menu a:hover {
  text-decoration: underline;
}

@media (max-width: 760px) {
  .xc-wrap {
    width: min(100% - 20px, var(--xc-max));
  }

  .xc-branding {
    min-height: 48px;
  }

  .xc-logo-x {
    width: 24px;
    height: 30px;
    font-size: 22px;
  }

  .xc-logo-text {
    font-size: 24px;
  }

  .xc-menu a,
  .xc-menu-fallback {
    padding: 9px 14px;
    font-size: 16px;
  }

  .xc-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px 10px;
  }

  .xc-card-title {
    min-height: 58px;
    font-size: 12px;
  }

  .xc-section-title,
  .xc-archive-title {
    font-size: 22px;
  }

  .xc-single-title {
    font-size: 22px;
  }

  .xc-option-link {
    font-size: 18px;
  }
}
