/*
Theme Name: Canal Preview
Theme URI: https://example.com/
Author: Codex
Description: Tema sencillo para mostrar entradas con imagen destacada, boton de play y aviso para abrir un canal de Telegram.
Version: 1.0.3
Requires at least: 6.0
Tested up to: 6.5
Requires PHP: 7.4
License: GPL-2.0-or-later
Text Domain: canal-preview
*/

:root {
  --bg: #101114;
  --panel: #181a1f;
  --panel-soft: #20232a;
  --text: #f7f7f8;
  --muted: #b9bdc7;
  --line: rgba(255, 255, 255, 0.12);
  --accent: #28a8ea;
  --accent-strong: #1688c7;
  --danger: #f2b84b;
  --radius: 8px;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.35);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Arial, Helvetica, sans-serif;
  line-height: 1.5;
}

a {
  color: inherit;
}

img {
  display: block;
  max-width: 100%;
}

.site-header {
  border-bottom: 1px solid var(--line);
  background: rgba(16, 17, 20, 0.92);
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(10px);
}

.site-header__inner,
.site-main,
.site-footer__inner {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 68px;
  gap: 20px;
}

.site-title {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 700;
}

.site-title a {
  text-decoration: none;
}

.site-description {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 0.88rem;
}

.site-main {
  padding: 32px 0 48px;
}

.post-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 22px;
}

.preview-card {
  overflow: hidden;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.preview-card__media {
  position: relative;
  aspect-ratio: 16 / 10;
  background: var(--panel-soft);
  overflow: hidden;
}

.preview-media {
  position: relative;
  width: 100%;
  height: 100%;
}

.preview-card__media img,
.single-preview__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.preview-card__fallback,
.single-preview__fallback {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  min-height: 220px;
  color: var(--muted);
  background:
    linear-gradient(135deg, rgba(40, 168, 234, 0.2), transparent 55%),
    var(--panel-soft);
}

.play-button {
  appearance: none;
  position: absolute;
  inset: 0;
  z-index: 2;
  display: grid;
  place-items: center;
  border: 0;
  color: white;
  cursor: pointer;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.58), rgba(0, 0, 0, 0.08));
}

.play-button__icon {
  display: grid;
  place-items: center;
  width: 76px;
  height: 76px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.62);
  border: 2px solid rgba(255, 255, 255, 0.84);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
}

.play-button__icon::before {
  content: "";
  width: 0;
  height: 0;
  margin-left: 6px;
  border-top: 17px solid transparent;
  border-bottom: 17px solid transparent;
  border-left: 25px solid #fff;
}

.preview-overlay {
  position: absolute;
  inset: 0;
  z-index: 4;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 22px;
  background: rgba(8, 9, 11, 0.78);
  text-align: center;
}

.preview-overlay.is-visible {
  display: flex;
}

.preview-overlay__box {
  width: min(420px, 100%);
  padding: 22px;
  border-radius: var(--radius);
  background: rgba(24, 26, 31, 0.96);
  border: 1px solid var(--line);
}

.preview-overlay__label {
  margin: 0 0 8px;
  color: var(--danger);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.preview-overlay__title {
  margin: 0 0 10px;
  font-size: 1.2rem;
}

.preview-overlay__text {
  margin: 0 0 18px;
  color: var(--muted);
  font-size: 0.95rem;
}

.channel-button,
.telegram-button,
.read-more {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 16px;
  border-radius: var(--radius);
  background: var(--accent);
  color: white;
  font-weight: 700;
  text-decoration: none;
  transition: background 160ms ease, transform 160ms ease;
}

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

.channel-button {
  flex-direction: column;
  min-height: 58px;
  gap: 2px;
  padding: 10px 12px;
  line-height: 1.1;
}

.channel-button span {
  font-size: 0.78rem;
  font-weight: 600;
  opacity: 0.88;
}

.channel-button--whatsapp {
  background: #20b15a;
}

.channel-button--whatsapp:hover {
  background: #178f48;
}

.channel-button--telegram {
  background: #28a8ea;
}

.channel-button--telegram:hover {
  background: #1688c7;
}

.channel-button--site {
  grid-column: 1 / -1;
  justify-self: center;
  width: min(260px, 100%);
  background: #f2b84b;
  color: #101114;
}

.channel-button--site:hover {
  background: #d99b24;
}

.telegram-button:hover,
.read-more:hover {
  background: var(--accent-strong);
  transform: translateY(-1px);
}

.preview-card__body {
  padding: 16px;
}

.preview-card__title {
  margin: 0 0 10px;
  font-size: 1.05rem;
}

.preview-card__title a {
  text-decoration: none;
}

.preview-card__excerpt {
  margin: 0 0 16px;
  color: var(--muted);
  font-size: 0.94rem;
}

.single-preview {
  width: min(920px, 100%);
  margin: 0 auto;
}

.single-preview__media {
  position: relative;
  margin-top: 16px;
  min-height: 320px;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--panel-soft);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.single-preview__content {
  margin-top: 24px;
  padding: 24px;
  border-radius: var(--radius);
  background: var(--panel);
  border: 1px solid var(--line);
}

.single-preview__title {
  margin: 0 0 14px;
  font-size: clamp(1.8rem, 4vw, 3rem);
  line-height: 1.08;
}

.entry-content {
  margin-top: 18px;
  color: #e4e6eb;
}

.single-preview .entry-content > figure:first-child,
.single-preview .entry-content > .wp-block-image:first-child {
  display: none;
}

.entry-content p:first-child {
  margin-top: 0;
}

.site-footer {
  border-top: 1px solid var(--line);
  color: var(--muted);
}

.site-footer__inner {
  padding: 24px 0;
  font-size: 0.9rem;
}

@media (max-width: 640px) {
  .site-header__inner,
  .site-main,
  .site-footer__inner {
    width: min(100% - 12px, 1120px);
  }

  .site-header__inner {
    min-height: 54px;
    gap: 10px;
  }

  .site-title {
    font-size: 1rem;
  }

  .site-description {
    font-size: 0.78rem;
  }

  .site-main {
    padding: 10px 0 28px;
  }

  .post-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .play-button__icon {
    width: 58px;
    height: 58px;
  }

  .play-button__icon::before {
    margin-left: 5px;
    border-top-width: 13px;
    border-bottom-width: 13px;
    border-left-width: 20px;
  }

  .single-preview {
    width: 100%;
  }

  .single-preview__media {
    margin-top: 12px;
    min-height: 0;
    aspect-ratio: 4 / 5;
    border-left: 0;
    border-right: 0;
    border-radius: 6px;
  }

  .preview-overlay {
    padding: 10px;
  }

  .preview-overlay__box {
    width: min(100%, 340px);
    padding: 14px;
  }

  .preview-overlay__label {
    margin-bottom: 5px;
    font-size: 0.68rem;
  }

  .preview-overlay__title {
    margin-bottom: 6px;
    font-size: 1rem;
  }

  .preview-overlay__text {
    margin-bottom: 10px;
    font-size: 0.82rem;
  }

  .preview-actions {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .channel-button {
    min-height: 48px;
    padding: 8px 10px;
    font-size: 0.9rem;
  }

  .channel-button span {
    font-size: 0.7rem;
  }

  .channel-button--site {
    grid-column: auto;
    width: 100%;
  }

  .single-preview__content {
    margin-top: 8px;
    padding: 12px;
    border-left: 0;
    border-right: 0;
    border-radius: 6px;
  }

  .single-preview__title {
    margin-bottom: 10px;
    font-size: clamp(1.42rem, 7vw, 2rem);
    line-height: 1.08;
  }

  .entry-content {
    margin-top: 12px;
    font-size: 0.95rem;
  }
}

@media (max-width: 360px) {
  .site-header__inner,
  .site-main,
  .site-footer__inner {
    width: 100%;
  }

  .single-preview__content {
    padding: 10px;
  }

  .preview-overlay__box {
    padding: 12px;
  }

  .preview-overlay__text {
    display: none;
  }
}
