/**
 * Components Styles
 *
 * Reusable UI components (buttons, cards, forms, etc.)
 *
 * @package Ithawk_Theme
 * @version 1.0.0
 */

/* ========================================
   BANNER TOP
   ======================================== */

.banner-top {
  background-color: var(--color-primary);
  color: var(--color-white);
  font-size: var(--font-size-sm);
  padding: var(--spacing-2) 0;
  position: relative;
  z-index: var(--z-index-sticky);
}

.banner-top__container {
  max-width: var(--container-xl);
  margin: 0 auto;
  padding: 0 var(--content-padding);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--spacing-4);
}

.banner-top__left,
.banner-top__right {
  display: flex;
  align-items: center;
  gap: var(--spacing-3);
}

.banner-top__link {
  font-family: var(--font-heading);
  color: var(--color-white);
  text-decoration: none;
  transition: opacity var(--transition-fast);
  font-size: var(--font-size-sm);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.banner-top__link:hover {
  opacity: 0.8;
}

.banner-top__social {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.banner-top__separator {
  color: var(--color-white);
  opacity: 0.5;
  font-size: var(--font-size-sm);
}

.banner-top__language {
  display: flex;
  align-items: center;
  gap: var(--spacing-2);
}

.banner-top__lang {
  font-family: var(--font-heading);
  color: var(--color-white);
  text-decoration: none;
  font-size: var(--font-size-sm);
  opacity: 0.7;
  transition: opacity var(--transition-fast);
}

.banner-top__lang:hover {
  opacity: 1;
}

.banner-top__lang--active {
  opacity: 1;
  font-weight: var(--font-weight-bold);
}

.banner-top__lang-sep {
  color: var(--color-white);
  opacity: 0.4;
  font-size: var(--font-size-sm);
}

/* Desktop: Ensure banner-top background extends over pattern */
@media (min-width: 769px) {
  .banner-top {
    position: relative;
  }

  .banner-top::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--color-primary);
    z-index: -1;
  }
}

/* Responsive: Hide banner top on mobile */
@media (max-width: 767px) {
  .banner-top {
    display: none;
  }
}

/* ========================================
   LOGO COMPONENT
   ======================================== */

.site-logo {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--spacing-1);
}

.site-logo__link {
  text-decoration: none;
  color: inherit;
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--spacing-1);
  transition: opacity var(--transition-base);
}

.site-logo__link:hover {
  opacity: 0.85;
}

/* Logo Image */
.site-logo__image {
  max-width: 220px;
  height: auto;
  display: block;
}

/* Logo Text (fallback) */
.site-logo__text {
  font-family: var(--font-heading);
  font-weight: var(--font-weight-bold);
  color: var(--color-text-secondary);
  text-transform: uppercase;
  line-height: 1;
  letter-spacing: 0.05em;
}

/* Tagline */
.site-logo__tagline {
  font-family: var(--font-verdana);
  font-style: italic;
  font-weight: var(--font-weight-light);
  color: var(--color-text-secondary);
  opacity: 0.7;
  line-height: 1;
}

/* Size Variants */
.site-logo--small .site-logo__text {
  font-size: var(--font-size-2xl); /* 24px */
}

.site-logo--small .site-logo__tagline {
  font-size: var(--font-size-sm); /* 14px */
}

.site-logo--small .site-logo__image {
  max-height: 40px;
}

.site-logo--medium .site-logo__text {
  font-size: var(--font-size-4xl); /* 36px */
}

.site-logo--medium .site-logo__tagline {
  font-size: var(--font-size-base); /* 16px */
}

.site-logo--medium .site-logo__image {
  max-height: 60px;
}

.site-logo--large .site-logo__text {
  font-size: var(--font-size-6xl); /* 60px */
}

.site-logo--large .site-logo__tagline {
  font-size: var(--font-size-xl); /* 20px */
}

.site-logo--large .site-logo__image {
  max-width: 220px;
  max-height: 120px;
  width: auto;
  height: auto;
}

/* Responsive */
@media (max-width: 767px) {
  .site-logo--large .site-logo__text {
    font-size: var(--font-size-5xl); /* 48px on mobile */
  }

  .site-logo--large .site-logo__tagline {
    font-size: var(--font-size-lg); /* 18px on mobile */
  }

  .site-logo--large .site-logo__image {
    max-width: 180px;
    max-height: 80px;
  }
}

/* ========================================
   BUTTONS
   ======================================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--spacing-2);
  padding: var(--spacing-3) var(--spacing-6);
  font-family: var(--font-heading);
  font-weight: var(--font-weight-medium);
  text-align: center;
  text-transform: uppercase;
  white-space: nowrap;
  border: var(--border-width) solid transparent;
  border-radius: var(--border-radius-lg);
  transition: all var(--transition-base);
  cursor: pointer;
  text-decoration: none;
}

.btn-primary {
  background-color: var(--color-primary);
  color: var(--color-white);
}

.btn-primary:hover,
.btn-primary:focus,
.btn-primary:active {
  background-color: var(--color-primary-hover);
  color: var(--color-white);
}

.btn-secondary {
  background-color: var(--color-secondary);
  color: var(--color-white);
}

.btn-secondary:hover,
.btn-secondary:focus,
.btn-secondary:active {
  background-color: var(--color-secondary-hover);
  color: var(--color-white);
}

.btn-outline {
  background-color: transparent;
  color: var(--color-primary);
  border-color: var(--color-primary);
}

.btn-outline:hover,
.btn-outline:focus,
.btn-outline:active {
  background-color: var(--color-primary);
  color: var(--color-white);
}

.btn-sm {
  padding: var(--spacing-2) var(--spacing-4);
  font-size: var(--font-size-sm);
}

.btn-lg {
  padding: var(--spacing-4) var(--spacing-8);
  font-size: var(--font-size-lg);
}

/* ========================================
   CARDS
   ======================================== */

.card {
  background-color: var(--color-white);
  border: var(--border-width) solid var(--color-border);
  border-radius: var(--border-radius-lg);
  padding: var(--spacing-6);
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition-base);
}

.card:hover {
  box-shadow: var(--shadow-md);
}

.card-header {
  margin-bottom: var(--spacing-4);
  padding-bottom: var(--spacing-4);
  border-bottom: var(--border-width) solid var(--color-border);
}

.card-title {
  font-size: var(--font-size-xl);
  font-weight: var(--font-weight-semibold);
  margin-bottom: var(--spacing-2);
}

.card-body {
  margin-bottom: var(--spacing-4);
}

.card-footer {
  margin-top: var(--spacing-4);
  padding-top: var(--spacing-4);
  border-top: var(--border-width) solid var(--color-border);
}

/* ========================================
   BADGES
   ======================================== */

.badge {
  display: inline-flex;
  align-items: center;
  padding: var(--spacing-1) var(--spacing-3);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-medium);
  border-radius: var(--border-radius-full);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.badge-success {
  background-color: var(--color-success-light);
  color: var(--color-success);
}

.badge-warning {
  background-color: var(--color-warning-light);
  color: var(--color-warning);
}

.badge-error {
  background-color: var(--color-error-light);
  color: var(--color-error);
}

.badge-info {
  background-color: var(--color-info-light);
  color: var(--color-info);
}

/* ========================================
   ALERTS
   ======================================== */

.alert {
  padding: var(--spacing-4);
  border-radius: var(--border-radius-md);
  border-left: 4px solid;
  margin-bottom: var(--spacing-4);
}

.alert-success {
  background-color: var(--color-success-light);
  border-color: var(--color-success);
  color: var(--color-success);
}

.alert-warning {
  background-color: var(--color-warning-light);
  border-color: var(--color-warning);
  color: var(--color-warning);
}

.alert-error {
  background-color: var(--color-error-light);
  border-color: var(--color-error);
  color: var(--color-error);
}

.alert-info {
  background-color: var(--color-info-light);
  border-color: var(--color-info);
  color: var(--color-info);
}

/* ========================================
   FORMS
   ======================================== */

.form-group {
  margin-bottom: var(--spacing-4);
}

.form-label {
  display: block;
  margin-bottom: var(--spacing-2);
  font-weight: var(--font-weight-medium);
  color: var(--color-text-primary);
}

.form-control {
  width: 100%;
  padding: var(--spacing-3) var(--spacing-4);
  border: var(--border-width) solid var(--color-border);
  border-radius: var(--border-radius-md);
  background-color: var(--color-white);
  transition: border-color var(--transition-base);
}

.form-control:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px var(--color-primary-light);
}

.form-error {
  display: block;
  margin-top: var(--spacing-2);
  font-size: var(--font-size-sm);
  color: var(--color-error);
}

/* ========================================
   NAVIGATION
   ======================================== */

.nav {
  display: flex;
  gap: var(--spacing-6);
  list-style: none;
  padding: 0;
  margin: 0;
}

.nav-item {
  margin: 0;
}

.nav-link {
  display: block;
  padding: var(--spacing-2) 0;
  color: var(--color-text-primary);
  text-decoration: none;
  transition: color var(--transition-base);
}

.nav-link:hover,
.nav-link:focus {
  color: var(--color-primary);
}

.nav-link.active {
  color: var(--color-primary);
  font-weight: var(--font-weight-semibold);
}

/* ========================================
   LOADING
   ======================================== */

.loading {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 3px solid var(--color-gray-200);
  border-radius: 50%;
  border-top-color: var(--color-primary);
  animation: spin 1s ease-in-out infinite;
}

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

/* ========================================
   POST CARD
   ======================================== */

.post-card {
  display: flex;
  flex-direction: column;
  /* height: 100%; */
  transition: transform var(--transition-base),
    box-shadow var(--transition-base);
  position: relative;
  margin-bottom: var(--spacing-16);
}

.post-card:hover {
  transform: translateY(-4px);
}

.post-card__link {
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.post-card__image-wrapper {
  width: 100%;
  margin: 0 auto;
  overflow: hidden;
}

.post-card__image {
  width: 100%;
  height: 200px;
  margin: 0;
  overflow: hidden;
}

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

.post-card:hover .post-card__image img {
  transform: scale(1.05);
}

.post-card__content {
  bottom: -55%;
  background: var(--color-white);
  padding: var(--spacing-6);
  text-align: center;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: var(--spacing-3);
  margin-left: 15px;
  margin-right: 15px;
  position: absolute;
  z-index: 1;
  box-shadow: var(--shadow-md);
  clip-path: polygon(
    5% 0%,
    95% 0%,
    100% 5%,
    100% 95%,
    95% 100%,
    5% 100%,
    0% 95%,
    0% 5%
  );
}

.post-card--featured .post-card__content {
  bottom: 10%;
  width: 290px;
  height: 195px;
  max-height: 195px;
}

.post-card__title {
  margin: 0;
  font-family: var(--font-heading);
  font-size: 11px;
  font-weight: var(--font-weight-normal);
  text-transform: uppercase;
}

.post-card__separator {
  width: 100%;
  height: 3px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.post-card__separator::before {
  content: "";
  width: 100%;
  height: 100%;
  background-color: var(--color-text-primary);
  clip-path: polygon(0 50%, 50% 0, 100% 50%, 50% 100%);
}

.post-card__excerpt {
  font-family: var(--font-fraunces);
  line-height: var(--line-height-tight);
  font-size: 18px;
  color: var(--color-text-secondary);
  font-weight: var(--font-weight-light);
}

.post-card__author {
  font-family: var(--font-heading);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-bold);
  color: var(--color-text-primary);
  letter-spacing: 0.5px;
}

/* Featured variant - larger for hero post */
.post-card--featured {
  grid-column: 1 / -1;
  position: relative;
}

.post-card--featured .post-card__image-wrapper {
  max-width: 100%;
}

.post-card--featured .post-card__image {
  height: 500px;
}

.post-card--featured .post-card__content {
  margin-left: var(--spacing-12);
  margin-right: var(--spacing-12);
  padding: var(--spacing-6);
}

/* Responsive */
@media (max-width: 767px) {
  .post-card__image-wrapper {
    max-width: 100%;
  }

  .post-card__image {
    height: 180px;
  }

  .post-card__content {
    padding: var(--spacing-4);
    margin-top: -40px;
    margin-left: 10px;
    margin-right: 10px;
  }

  .post-card--featured .post-card__image {
    height: 300px;
  }

  .post-card--featured .post-card__content {
    margin-top: -60px;
    margin-left: var(--spacing-6);
    margin-right: var(--spacing-6);
    padding: var(--spacing-6);
  }
}

/* ========================================
   WORDPRESS BLOCK BUTTONS OVERRIDE
   ======================================== */

/* Aplicar estilos base de .btn a los botones de WordPress */
.wp-block-button__link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--spacing-2);
  padding: var(--spacing-3) var(--spacing-6);
  font-family: var(--font-heading);
  font-weight: var(--font-weight-medium);
  text-align: center;
  text-transform: uppercase;
  white-space: nowrap;
  border: var(--border-width) solid transparent;
  border-radius: var(--border-radius-lg);
  transition: all var(--transition-base);
  cursor: pointer;
  text-decoration: none;

  /* Estilos de .btn-primary por defecto */
  background-color: var(--color-primary);
  color: var(--color-white);
  box-shadow: none;
}

.wp-block-button__link:hover,
.wp-block-button__link:focus,
.wp-block-button__link:active {
  background-color: var(--color-primary-hover);
  color: var(--color-white);
  text-decoration: none;
}

/* Variantes de WordPress con clases adicionales */
.wp-block-button.is-style-outline .wp-block-button__link {
  background-color: transparent;
  color: var(--color-primary);
  border-color: var(--color-primary);
}

.wp-block-button.is-style-outline .wp-block-button__link:hover,
.wp-block-button.is-style-outline .wp-block-button__link:focus,
.wp-block-button.is-style-outline .wp-block-button__link:active {
  background-color: var(--color-primary);
  color: var(--color-white);
}

/* Variante secundaria */
.wp-block-button.is-style-secondary .wp-block-button__link {
  background-color: var(--color-secondary);
  color: var(--color-white);
}

.wp-block-button.is-style-secondary .wp-block-button__link:hover,
.wp-block-button.is-style-secondary .wp-block-button__link:focus,
.wp-block-button.is-style-secondary .wp-block-button__link:active {
  background-color: var(--color-secondary-hover);
  color: var(--color-white);
}
