/* ==========================================================================
   COMPONENTS — Post cards, product cards, hero, widgets, sidebar
   BEM methodology | DeDragones Theme
   ========================================================================== */

/* --------------------------------------------------------------------------
   .post-card
   -------------------------------------------------------------------------- */
.post-card {
  display: flex;
  flex-direction: column;
  background: var(--color-bg-card);
  border: 1px solid var(--color-border-cream);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: transform var(--transition-normal), box-shadow var(--transition-normal);
  text-decoration: none;
}

.post-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

.post-card__thumb {
  position: relative;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  background: var(--color-bg-dark-2);
  flex-shrink: 0;
}

.post-card__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition-slow);
}

.post-card:hover .post-card__thumb img {
  transform: scale(1.04);
}

.post-card__thumb-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--color-ink-2), var(--color-ink-3));
}

.post-card__thumb-placeholder svg {
  width: 48px;
  height: 48px;
  opacity: 0.2;
}

.post-card__body {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: var(--space-5) var(--space-5) var(--space-4);
}

.post-card__tag-row {
  margin-bottom: var(--space-3);
}

.post-card__title {
  font-family: var(--font-serif);
  font-size: var(--text-md);
  font-weight: 700;
  color: var(--color-text-primary);
  line-height: 1.3;
  margin-bottom: var(--space-3);
  flex: 1;
}

.post-card__excerpt {
  font-family: var(--font-sans);
  font-size: 15px;
  color: var(--color-text-secondary);
  line-height: 1.6;
  margin-bottom: var(--space-4);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.post-card__meta {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  font-family: var(--font-ui);
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  padding-top: var(--space-3);
  border-top: 1px solid var(--color-border-cream);
  margin-top: auto;
}

.post-card__meta-item {
  display: flex;
  align-items: center;
  gap: var(--space-1);
}

.post-card__meta-item svg {
  width: 12px;
  height: 12px;
  flex-shrink: 0;
}

/* Featured card variant */
.post-card--featured {
  grid-column: span 2;
  flex-direction: row;
}

.post-card--featured .post-card__thumb {
  width: 45%;
  flex-shrink: 0;
  aspect-ratio: unset;
}

.post-card--featured .post-card__title {
  font-size: var(--text-xl);
}

/* List variant */
.post-card--list {
  flex-direction: row;
  gap: 0;
}

.post-card--list .post-card__thumb {
  width: 180px;
  flex-shrink: 0;
  aspect-ratio: unset;
  min-height: 130px;
}

.post-card--list .post-card__body {
  padding: var(--space-4) var(--space-5);
}

/* --------------------------------------------------------------------------
   .product-card
   -------------------------------------------------------------------------- */
.product-card {
  display: flex;
  flex-direction: column;
  background: var(--color-bg-white);
  border: 1px solid var(--color-border-cream);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: transform var(--transition-normal), box-shadow var(--transition-normal);
}

.product-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.product-card__image-wrap {
  position: relative;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background: var(--color-cream-2);
}

.product-card__image-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition-slow);
}

.product-card:hover .product-card__image-wrap img {
  transform: scale(1.04);
}

.product-card__image-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 40px;
  background: linear-gradient(135deg, var(--color-cream-2), var(--color-cream-3));
}

.product-card__badge {
  position: absolute;
  top: var(--space-3);
  left: var(--space-3);
  font-family: var(--font-ui);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #fff;
  background: var(--color-red-acc);
  padding: 2px 7px;
  border-radius: var(--radius-sm);
}

.product-card__body {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: var(--space-4);
}

.product-card__title {
  font-family: var(--font-ui);
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-text-primary);
  line-height: 1.4;
  margin-bottom: var(--space-2);
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.product-card__price {
  font-family: var(--font-ui);
  font-size: var(--text-md);
  font-weight: 700;
  color: var(--color-gold);
  margin-bottom: var(--space-3);
}

.product-card__price--original {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  font-weight: 400;
  text-decoration: line-through;
  margin-right: var(--space-2);
}

.product-card__btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  background: var(--color-amazon);
  color: var(--color-ink);
  font-family: var(--font-ui);
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 9px var(--space-4);
  border-radius: var(--radius-sm);
  transition: background var(--transition-fast);
  text-decoration: none;
  margin-top: auto;
}

.product-card__btn:hover {
  background: var(--color-amazon-dark);
}

.product-card__btn svg {
  width: 14px;
  height: 14px;
}

/* --------------------------------------------------------------------------
   .hero-section (homepage)
   -------------------------------------------------------------------------- */
.hero-section {
  background: var(--color-bg-dark);
  position: relative;
  overflow: hidden;
  padding: var(--space-16) 0 var(--space-12);
}

.hero-section::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 60% 80% at 75% 50%, rgba(201, 149, 42, 0.07) 0%, transparent 70%),
    radial-gradient(ellipse 40% 60% at 20% 80%, rgba(139, 32, 32, 0.06) 0%, transparent 70%);
  pointer-events: none;
}

.hero-section__inner {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--space-6);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-12);
  align-items: center;
  position: relative;
}

.hero-section__eyebrow {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  font-family: var(--font-ui);
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--color-gold);
  margin-bottom: var(--space-5);
}

.hero-section__eyebrow::before {
  content: '';
  display: block;
  width: 24px;
  height: 1px;
  background: var(--color-gold);
}

.hero-section__title {
  font-family: var(--font-serif);
  font-size: clamp(32px, 4.5vw, 54px);
  font-weight: 700;
  line-height: 1.1;
  color: #fff;
  margin-bottom: var(--space-5);
  letter-spacing: -0.01em;
}

.hero-section__title em {
  color: var(--color-gold-light);
  font-style: normal;
}

.hero-section__excerpt {
  font-family: var(--font-sans);
  font-size: 17px;
  line-height: 1.75;
  color: rgba(245, 240, 232, 0.6);
  margin-bottom: var(--space-8);
  max-width: 480px;
}

.hero-section__actions {
  display: flex;
  align-items: center;
  gap: var(--space-5);
  flex-wrap: wrap;
}

.hero-section__read-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
  font-family: var(--font-ui);
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-gold-light);
  border-bottom: 1px solid rgba(232, 184, 75, 0.4);
  padding-bottom: 2px;
  transition: border-color var(--transition-fast), color var(--transition-fast);
}

.hero-section__read-btn:hover {
  color: var(--color-gold);
  border-bottom-color: var(--color-gold);
}

.hero-section__read-btn svg {
  width: 14px;
  height: 14px;
  transition: transform var(--transition-fast);
}

.hero-section__read-btn:hover svg {
  transform: translateX(3px);
}

.hero-section__date {
  font-family: var(--font-ui);
  font-size: var(--text-xs);
  color: rgba(245, 240, 232, 0.3);
  letter-spacing: 0.05em;
}

/* Hero visual */
.hero-section__visual {
  position: relative;
  background: linear-gradient(135deg, var(--color-ink-2) 0%, var(--color-ink) 100%);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  aspect-ratio: 4 / 3;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.hero-section__visual img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: var(--radius-xl);
}

.hero-section__visual-placeholder {
  font-size: 100px;
  opacity: 0.12;
  filter: grayscale(1);
}

.hero-section__visual-info {
  position: absolute;
  bottom: var(--space-4);
  left: var(--space-4);
  font-family: var(--font-ui);
  font-size: 10px;
  letter-spacing: 0.08em;
  color: rgba(245, 240, 232, 0.35);
  text-transform: uppercase;
}

.hero-section__visual-badge {
  position: absolute;
  top: var(--space-4);
  right: var(--space-4);
}

/* --------------------------------------------------------------------------
   .widget (sidebar widgets)
   -------------------------------------------------------------------------- */
.widget {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border-cream);
  border-radius: var(--radius-lg);
  padding: var(--space-5) var(--space-5);
}

.widget__title {
  font-family: var(--font-serif);
  font-size: var(--text-base);
  font-weight: 700;
  color: var(--color-text-primary);
  margin-bottom: var(--space-4);
  padding-bottom: var(--space-3);
  border-bottom: 1px solid var(--color-border-cream);
}

/* Widget search */
.widget-search {
  display: flex;
  gap: var(--space-2);
}

.widget-search__input {
  flex: 1;
  background: var(--color-bg-white);
  border: 1px solid var(--color-border-cream);
  border-radius: var(--radius-md);
  padding: 9px var(--space-3);
  font-size: var(--text-sm);
  color: var(--color-text-primary);
  outline: none;
  transition: border-color var(--transition-fast);
}

.widget-search__input::placeholder {
  color: var(--color-text-muted);
}

.widget-search__input:focus {
  border-color: var(--color-gold);
}

.widget-search__btn {
  background: var(--color-gold);
  color: var(--color-ink);
  font-size: var(--text-sm);
  font-weight: 700;
  padding: 9px var(--space-4);
  border-radius: var(--radius-md);
  transition: background var(--transition-fast);
}

.widget-search__btn:hover {
  background: var(--color-gold-light);
}

/* Widget popular posts */
.widget-posts__list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.widget-posts__item {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  padding: var(--space-3) 0;
  border-bottom: 1px solid var(--color-border-cream);
}

.widget-posts__item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.widget-posts__num {
  font-family: var(--font-serif);
  font-size: 22px;
  font-weight: 700;
  color: var(--color-gold);
  opacity: 0.45;
  line-height: 1;
  min-width: 20px;
  flex-shrink: 0;
}

.widget-posts__content {
  flex: 1;
}

.widget-posts__title {
  font-family: var(--font-ui);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--color-text-primary);
  line-height: 1.4;
  text-decoration: none;
  display: block;
  transition: color var(--transition-fast);
}

.widget-posts__title:hover {
  color: var(--color-gold);
}

.widget-posts__date {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  margin-top: 2px;
}

/* Widget tags */
.widget-tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.widget-tag {
  font-family: var(--font-ui);
  font-size: 11px;
  font-weight: 500;
  color: var(--color-gold);
  background: rgba(201, 149, 42, 0.08);
  border: 1px solid var(--color-border);
  padding: 4px 10px;
  border-radius: 20px;
  text-decoration: none;
  transition: background var(--transition-fast), color var(--transition-fast);
}

.widget-tag:hover {
  background: var(--color-gold);
  color: var(--color-ink);
  border-color: var(--color-gold);
}

/* Widget CTA */
.widget--cta {
  background: var(--color-bg-dark);
  border-color: var(--color-border);
}

.widget--cta .widget__cta-title {
  font-family: var(--font-serif);
  font-size: var(--text-md);
  color: var(--color-gold-light);
  margin-bottom: var(--space-3);
}

.widget--cta .widget__cta-text {
  font-family: var(--font-ui);
  font-size: var(--text-sm);
  color: rgba(245, 240, 232, 0.5);
  line-height: 1.6;
  margin-bottom: var(--space-4);
}

.widget--cta .widget__cta-btn {
  display: block;
  text-align: center;
  background: var(--color-gold);
  color: var(--color-ink);
  font-family: var(--font-ui);
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 10px;
  border-radius: var(--radius-sm);
  text-decoration: none;
  transition: background var(--transition-fast);
}

.widget--cta .widget__cta-btn:hover {
  background: var(--color-gold-light);
}

/* --------------------------------------------------------------------------
   .affiliate-disclaimer
   -------------------------------------------------------------------------- */
.affiliate-disclaimer {
  background: rgba(201, 149, 42, 0.05);
  border: 1px solid rgba(201, 149, 42, 0.15);
  border-radius: var(--radius-md);
  padding: var(--space-4) var(--space-5);
  margin: var(--space-8) auto;
}
@media (max-width: 1024px) {
  .affiliate-disclaimer {
    margin: var(--space-8);
  }
}

.affiliate-disclaimer p {
  font-family: var(--font-ui);
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  line-height: 1.6;
  margin: 0;
}

.affiliate-disclaimer strong {
  color: var(--color-gold);
}

/* --------------------------------------------------------------------------
   .loading-spinner (AJAX)
   -------------------------------------------------------------------------- */
.loading-spinner {
  display: none;
  align-items: center;
  justify-content: center;
  padding: var(--space-10) 0;
  gap: var(--space-3);
  color: var(--color-text-muted);
  font-size: var(--text-sm);
}

.loading-spinner.is-visible {
  display: flex;
}

.loading-spinner__icon {
  width: 20px;
  height: 20px;
  border: 2px solid var(--color-border-cream);
  border-top-color: var(--color-gold);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* --------------------------------------------------------------------------
   .no-results
   -------------------------------------------------------------------------- */
.no-results {
  text-align: center;
  padding: var(--space-16) var(--space-6);
}

.no-results__icon {
  font-size: 48px;
  margin-bottom: var(--space-4);
  opacity: 0.4;
}

.no-results__title {
  font-family: var(--font-serif);
  font-size: var(--text-xl);
  margin-bottom: var(--space-3);
}

.no-results__text {
  color: var(--color-text-muted);
  max-width: 400px;
  margin: 0 auto;
}
