/*
 * WordPress additions to app.css.
 *
 * 1. Form controls that look like the antd 5 components of the Next.js site
 *    (Form.Item, Input, Select, DatePicker, Button, message).
 * 2. WordPress content classes (alignments, captions, galleries).
 */

/* ---------------------------------------------------------------- *
 * 1. antd look-alikes
 * ---------------------------------------------------------------- */

:root {
  --an-primary: #1677ff;
  --an-primary-hover: #4096ff;
  --an-border: #d9d9d9;
  --an-error: #ff4d4f;
  --an-radius: 6px;
}

.an-form {
  font-size: 14px;
  line-height: 1.5714;
}

/* Form.Item */
.an-field {
  margin-bottom: 24px;
}
.an-field.mb-3 {
  margin-bottom: 1rem;
}
.an-field.mb-0 {
  margin-bottom: 0;
}
.an-field.mb-\[10px\] {
  margin-bottom: 10px;
}
.an-field > label,
.an-label {
  display: block;
  padding: 0 0 8px;
  line-height: 1.5714;
  white-space: initial;
  font-size: 14px;
  color: rgba(0, 0, 0, 0.88);
}
.an-field.is-required > label::before,
.an-label.is-required::before {
  display: inline-block;
  margin-inline-end: 4px;
  color: var(--an-error);
  font-size: 14px;
  font-family: SimSun, sans-serif;
  line-height: 1;
  content: '*';
}
.an-field__error {
  display: none;
  color: var(--an-error);
  font-size: 14px;
  line-height: 1.5714;
  min-height: 0;
}
.an-field.has-error .an-field__error {
  display: block;
}
.an-field.has-error .an-input,
.an-field.has-error .an-select {
  border-color: var(--an-error);
}

/* Input / Select / DatePicker / TextArea */
.an-input,
.an-select,
textarea.an-input {
  box-sizing: border-box;
  display: block;
  width: 100%;
  min-width: 0;
  margin: 0;
  padding: 4px 11px;
  color: rgba(0, 0, 0, 0.88);
  font-size: 14px;
  line-height: 1.5714;
  background-color: #fff;
  background-image: none;
  border: 1px solid var(--an-border);
  border-radius: var(--an-radius);
  transition: all 0.2s;
  font-family: inherit;
  height: 32px;
}
textarea.an-input {
  height: auto;
  min-height: 80px;
  resize: vertical;
}
.an-input:hover,
.an-select:hover {
  border-color: var(--an-primary-hover);
}
.an-input:focus,
.an-select:focus {
  border-color: var(--an-primary-hover);
  box-shadow: 0 0 0 2px rgba(5, 145, 255, 0.1);
  outline: 0;
}
.an-input::placeholder {
  color: rgba(0, 0, 0, 0.25);
}
.an-input[disabled],
.an-select[disabled] {
  color: rgba(0, 0, 0, 0.25);
  background-color: rgba(0, 0, 0, 0.04);
  cursor: not-allowed;
}
.an-select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 30px;
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1024 1024' fill='rgba(0,0,0,0.25)'%3E%3Cpath d='M884 256h-75c-5.1 0-9.9 2.5-12.9 6.6L512 654.2 227.9 262.6c-3-4.1-7.8-6.6-12.9-6.6h-75c-6.5 0-10.3 7.4-6.5 12.7l352.6 486.1c12.8 17.6 39 17.6 51.7 0l352.6-486.1c3.9-5.3.1-12.7-6.4-12.7z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 11px center;
  background-size: 12px 12px;
}
.an-input-lg,
.an-select.an-input-lg {
  height: 40px;
  padding: 7px 11px;
  font-size: 16px;
  border-radius: 8px;
}

/* Checkbox / radio */
.an-check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 14px;
}
.an-check input {
  width: 16px;
  height: 16px;
  accent-color: var(--an-primary);
}

/* Button */
.an-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 400;
  white-space: nowrap;
  text-align: center;
  background: #fff;
  border: 1px solid var(--an-border);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.645, 0.045, 0.355, 1);
  user-select: none;
  touch-action: manipulation;
  line-height: 1.5714;
  color: rgba(0, 0, 0, 0.88);
  font-size: 14px;
  height: 32px;
  padding: 4px 15px;
  border-radius: var(--an-radius);
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.02);
  font-family: inherit;
}
.an-btn:hover {
  color: var(--an-primary-hover);
  border-color: var(--an-primary-hover);
}
.an-btn-primary {
  color: #fff;
  background: var(--an-primary);
  border-color: var(--an-primary);
  box-shadow: 0 2px 0 rgba(5, 145, 255, 0.1);
}
.an-btn-primary:hover {
  color: #fff;
  background: var(--an-primary-hover);
  border-color: var(--an-primary-hover);
}
.an-btn-dashed {
  border-style: dashed;
}
.an-btn-danger {
  color: var(--an-error);
  border-color: var(--an-error);
}
.an-btn-block {
  width: 100%;
}
.an-btn-lg {
  font-size: 16px;
  height: 40px;
  padding: 6.4px 15px;
  border-radius: 8px;
}
.an-btn[disabled],
.an-btn.is-loading {
  cursor: not-allowed;
  opacity: 0.65;
}
.an-btn.is-loading::before {
  content: '';
  width: 14px;
  height: 14px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: an-spin 0.75s linear infinite;
}
@keyframes an-spin {
  to {
    transform: rotate(360deg);
  }
}

/* message.success / message.error */
.an-toasts {
  position: fixed;
  top: 8px;
  left: 0;
  right: 0;
  z-index: 100010;
  display: flex;
  flex-direction: column;
  align-items: center;
  pointer-events: none;
}
.an-toast {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  padding: 9px 12px;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 6px 16px 0 rgba(0, 0, 0, 0.08), 0 3px 6px -4px rgba(0, 0, 0, 0.12), 0 9px 28px 8px rgba(0, 0, 0, 0.05);
  font-size: 14px;
  color: rgba(0, 0, 0, 0.88);
  pointer-events: all;
  animation: an-toast-in 0.2s ease-out;
  transition: opacity 0.3s, transform 0.3s;
}
.an-toast--out {
  opacity: 0;
  transform: translateY(-8px);
}
.an-toast__icon {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  flex: none;
}
.an-toast--success .an-toast__icon {
  background: #52c41a url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='none' stroke='%23fff' stroke-width='2' d='M4 8.5l2.5 2.5L12 5.5'/%3E%3C/svg%3E") center/12px no-repeat;
}
.an-toast--error .an-toast__icon {
  background: var(--an-error) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath stroke='%23fff' stroke-width='2' d='M5 5l6 6M11 5l-6 6'/%3E%3C/svg%3E") center/12px no-repeat;
}
.an-toast--info .an-toast__icon,
.an-toast--warning .an-toast__icon {
  background: #faad14;
}
@keyframes an-toast-in {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
}

/* Honeypot field of the forms */
.an-hp {
  position: absolute !important;
  left: -10000px !important;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* Upload button (components/UploadBtn.js) */
.an-upload {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 102px;
  height: 102px;
  border: 1px dashed var(--an-border);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.02);
  cursor: pointer;
  transition: border-color 0.3s;
  overflow: hidden;
  position: relative;
}
.an-upload:hover {
  border-color: var(--an-primary);
}
.an-upload input[type='file'] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}
.an-upload img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Modal (antd Modal / react-modal-video) */
.an-modal[hidden] {
  display: none !important;
}

/* ---------------------------------------------------------------- *
 * 2. WordPress content
 * ---------------------------------------------------------------- */

.screen-reader-text {
  border: 0;
  clip: rect(1px, 1px, 1px, 1px);
  clip-path: inset(50%);
  height: 1px;
  margin: -1px;
  overflow: hidden;
  padding: 0;
  position: absolute !important;
  width: 1px;
  word-wrap: normal !important;
}
.screen-reader-text:focus {
  background-color: #fff;
  clip: auto !important;
  clip-path: none;
  color: #21759b;
  display: block;
  font-size: 14px;
  font-weight: 600;
  height: auto;
  left: 5px;
  line-height: normal;
  padding: 15px 23px 14px;
  text-decoration: none;
  top: 5px;
  width: auto;
  z-index: 100000;
}

.alignleft {
  float: left;
  margin: 0.5em 1.5em 1em 0;
}
.alignright {
  float: right;
  margin: 0.5em 0 1em 1.5em;
}
.aligncenter {
  display: block;
  margin-left: auto;
  margin-right: auto;
}
.alignnone {
  margin: 0.5em 0 1em;
}
.wp-caption {
  max-width: 100%;
  margin-bottom: 1.5em;
}
.wp-caption img {
  display: block;
  max-width: 100%;
  height: auto;
}
.wp-caption-text,
.gallery-caption {
  font-size: 13px;
  color: #6c757d;
  padding-top: 0.5em;
}
.gallery {
  display: grid;
  gap: 12px;
  margin-bottom: 1.5em;
}
.gallery-columns-2 { grid-template-columns: repeat(2, 1fr); }
.gallery-columns-3 { grid-template-columns: repeat(3, 1fr); }
.gallery-columns-4 { grid-template-columns: repeat(4, 1fr); }
.gallery-columns-5 { grid-template-columns: repeat(5, 1fr); }
.gallery img {
  width: 100%;
  height: auto;
}
.sticky,
.bypostauthor {
  display: block;
}

/* Editor content inside templates */
.an-content img {
  max-width: 100%;
  height: auto;
}
.an-content iframe,
.an-content video,
.an-content embed {
  max-width: 100%;
}
.an-content ul {
  list-style: disc;
  padding-left: 1.5em;
}
.an-content ol {
  list-style: decimal;
  padding-left: 1.5em;
}
.an-content a {
  color: var(--thm-primary, #d71524);
  text-decoration: underline;
}
.an-content::after {
  content: '';
  display: table;
  clear: both;
}

/* Preloader: gone after 1.5s even if the scripts are still downloading */
#an-preloader {
  animation: an-preloader-out 0.3s ease 1.5s forwards;
}
@keyframes an-preloader-out {
  to {
    opacity: 0;
    visibility: hidden;
    z-index: -1;
  }
}

/* Logged-in admin bar does not cover the sticky header */
body.admin-bar .stricky-header.stricky-fixed {
  top: 32px;
}
@media (max-width: 782px) {
  body.admin-bar .stricky-header.stricky-fixed {
    top: 46px;
  }
}

/* Mobile menu open: no page scroll behind it */
body.locked {
  overflow: hidden;
}

/* Widgets */
.widget {
  margin-bottom: 24px;
}
.widget-title {
  font-size: 18px;
  margin-bottom: 12px;
}

/* Header with more than four items (About Us, Why Travel With Us) */
@media (min-width: 1200px) {
  .main-menu .main-menu__list.an-menu-many > li + li,
  .stricky-header .main-menu__list.an-menu-many > li + li {
    margin-left: 34px;
  }
}

/* Footer: booking information links under the contact details */
.an-footer-divider {
  border-top: 1px solid rgba(255, 255, 255, 0.25);
  margin: 18px 0 14px;
  max-width: 240px;
}
.an-footer-info li + li {
  margin-top: 4px;
}
