/**
 * @file
 * Component styles
 */

/* Buttons */
.button,
button,
input[type="submit"],
input[type="button"] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: var(--spacing-sm) var(--spacing-lg);
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.5;
  text-align: center;
  text-decoration: none;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background-color: var(--color-bg);
  color: var(--color-text);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.button:hover,
button:hover,
input[type="submit"]:hover,
input[type="button"]:hover {
  background-color: var(--color-bg-secondary);
  text-decoration: none;
}

.button--primary,
input[type="submit"][name="op"] {
  background-color: var(--color-primary);
  border-color: var(--color-primary);
  color: white;
}

.button--primary:hover,
input[type="submit"][name="op"]:hover {
  background-color: var(--color-primary-hover);
  border-color: var(--color-primary-hover);
}

.button--secondary {
  background-color: transparent;
  border-color: var(--color-border-dark);
}

.button--large {
  padding: var(--spacing-md) var(--spacing-xl);
  font-size: 1rem;
}

.button--small {
  padding: var(--spacing-xs) var(--spacing-md);
  font-size: 0.8125rem;
}

/* Form Elements */
.form-item {
  margin-bottom: var(--spacing-lg);
}

.form-item label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--color-text);
  margin-bottom: var(--spacing-xs);
}

.form-item .description {
  font-size: 0.8125rem;
  color: var(--color-text-muted);
  margin-top: var(--spacing-xs);
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="url"],
input[type="tel"],
input[type="search"],
textarea,
select {
  width: 100%;
  padding: var(--spacing-sm) var(--spacing-md);
  font-size: 0.875rem;
  line-height: 1.5;
  color: var(--color-text);
  background-color: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
input[type="number"]:focus,
input[type="url"]:focus,
input[type="tel"]:focus,
input[type="search"]:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

textarea {
  min-height: 120px;
  resize: vertical;
}

select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2364748b'%3e%3cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3e%3c/path%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  background-size: 1rem;
  padding-right: 2.5rem;
}

/* Checkboxes & Radios */
input[type="checkbox"],
input[type="radio"] {
  width: 1.125rem;
  height: 1.125rem;
  margin-right: var(--spacing-sm);
  accent-color: var(--color-primary);
}

/* Cards */
.card {
  background-color: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: box-shadow var(--transition-normal);
}

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

.card__image {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.card__content {
  padding: var(--spacing-lg);
}

.card__title {
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: var(--spacing-sm);
}

.card__title a {
  color: var(--color-text);
}

.card__title a:hover {
  color: var(--color-primary);
}

.card__meta {
  font-size: 0.8125rem;
  color: var(--color-text-muted);
  margin-bottom: var(--spacing-sm);
}

.card__excerpt {
  font-size: 0.875rem;
  color: var(--color-text-muted);
  line-height: 1.6;
}

/* Tags */
.tag {
  display: inline-flex;
  align-items: center;
  padding: var(--spacing-xs) var(--spacing-sm);
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--color-text-muted);
  background-color: var(--color-bg-tertiary);
  border-radius: var(--radius-full);
  text-decoration: none;
  transition: all var(--transition-fast);
}

.tag:hover {
  background-color: var(--color-primary);
  color: white;
  text-decoration: none;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--spacing-xs);
}

/* Breadcrumbs */
.breadcrumb {
  padding: var(--spacing-md) 0;
}

.breadcrumb__list {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  list-style: none;
  padding: 0;
  margin: 0;
  font-size: 0.875rem;
}

.breadcrumb__item {
  display: flex;
  align-items: center;
}

.breadcrumb__item:not(:last-child)::after {
  content: '/';
  margin: 0 var(--spacing-sm);
  color: var(--color-text-light);
}

.breadcrumb__link {
  color: var(--color-text-muted);
}

.breadcrumb__link:hover {
  color: var(--color-primary);
}

.breadcrumb__item:last-child {
  color: var(--color-text);
}

/* Pagination */
.pager {
  margin-top: var(--spacing-xl);
}

.pager__items {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: var(--spacing-xs);
  list-style: none;
  padding: 0;
  margin: 0;
}

.pager__item a,
.pager__item span {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 40px;
  padding: 0 var(--spacing-sm);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  color: var(--color-text);
  text-decoration: none;
  transition: all var(--transition-fast);
}

.pager__item a:hover {
  background-color: var(--color-bg-secondary);
}

.pager__item--active span {
  background-color: var(--color-primary);
  border-color: var(--color-primary);
  color: white;
}

/* Messages */
.messages {
  padding: var(--spacing-md);
  margin-bottom: var(--spacing-lg);
  border-radius: var(--radius-md);
  font-size: 0.875rem;
}

.messages--status {
  background-color: #ecfdf5;
  border: 1px solid #a7f3d0;
  color: #065f46;
}

.messages--warning {
  background-color: #fffbeb;
  border: 1px solid #fde68a;
  color: #92400e;
}

.messages--error {
  background-color: #fef2f2;
  border: 1px solid #fecaca;
  color: #991b1b;
}

/* Tables */
.table-responsive {
  overflow-x: auto;
}

/* Node Content */
.node {
  margin-bottom: var(--spacing-2xl);
}

.node__title {
  font-size: 2rem;
  margin-bottom: var(--spacing-md);
}

.node__meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--spacing-md);
  font-size: 0.875rem;
  color: var(--color-text-muted);
  margin-bottom: var(--spacing-lg);
}

.node__content {
  line-height: 1.8;
}

.node__content p {
  margin-bottom: var(--spacing-md);
}

.node__content img {
  border-radius: var(--radius-md);
  margin: var(--spacing-lg) 0;
}

.node__tags {
  margin-top: var(--spacing-xl);
  padding-top: var(--spacing-lg);
  border-top: 1px solid var(--color-border);
}

/* Views */
.view-content {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-lg);
}

.views-row {
  padding-bottom: var(--spacing-lg);
  border-bottom: 1px solid var(--color-border);
}

.views-row:last-child {
  border-bottom: none;
}

/* Search Form */
.search-form {
  display: flex;
  gap: var(--spacing-sm);
}

.search-form input[type="search"] {
  flex: 1;
}

.search-form .button {
  flex-shrink: 0;
}

/* Block */
.block {
  margin-bottom: var(--spacing-lg);
}

.block__title {
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: var(--spacing-md);
}

/* Language Switcher in Footer */
.footer-language-switcher .language-switcher-header {
  display: none !important;
}

.footer-language-switcher .language-switcher-footer {
  display: flex !important;
}

.footer-language-switcher .language-switcher-btn-mobile {
  display: none !important;
}

/* Hide footer version in header (secondary_menu region outside footer) */
.region-secondary-menu .language-switcher-footer {
  display: none !important;
}
