/*
 Theme Name:   Astra Child - Reimo Rehkli
 Template:     astra
 Version:      2.0.0
 Description:  Custom child theme for reimorehkli.ee — redesign v2
*/

/* === GLOBAALSED STIILID === */

body {
  background-color: #FDFCF8 !important;
  color: #2C302E;
  font-family: 'Inter', sans-serif;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6, .font-serif {
  font-family: 'Lora', serif;
}

a {
  text-decoration: none;
}

/* === HEADING UNDERLINE === */

.heading-underline {
  position: relative;
  display: inline-block;
}

.heading-underline::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 2px;
  height: 12px;
  background-color: rgba(21, 128, 61, 0.15);
  z-index: -1;
  border-radius: 4px;
}

/* === BLOB SHAPES === */

.blob-shape {
  border-radius: 41% 59% 45% 55% / 41% 39% 61% 59%;
}

/* === PEIDA LEHE PEALKIRI === */

.page .entry-title {
  display: none;
}

/* === FORCE FULL WIDTH === */

.page #primary,
.page-template #primary {
  width: 100% !important;
  max-width: 100% !important;
  float: none !important;
  margin: 0 !important;
}

.page .ast-container,
.page-template .ast-container {
  max-width: 100% !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
  display: block !important;
}

.page #secondary,
.page-template #secondary {
  display: none !important;
}

/* === ASTRA HEADER STIILID === */

.ast-primary-header,
.ast-primary-header .ast-builder-grid-row {
  background: #FDFCF8 !important;
}

/* Avalehel beige taust */
.page-template-page-avaleht .ast-primary-header,
.page-template-page-avaleht .ast-primary-header .ast-builder-grid-row {
  background: #F5F2EB !important;
}

.ast-primary-header .ast-builder-grid-row {
  max-width: 72rem !important;
  margin: 0 auto !important;
  padding: 1.5rem !important;
}

/* Menüü lingid */
.ast-builder-menu .menu-item > .menu-link {
  color: #2C302E !important;
  font-family: 'Inter', sans-serif;
  font-weight: 500;
  font-size: 0.875rem;
  padding: 0 12px !important;
  white-space: nowrap;
  transition: color 0.2s ease;
}

/* Desktop: nowrap et menüü ei murdaks rida */
.ast-builder-menu .main-header-menu {
  flex-wrap: nowrap !important;
}

/* (mobiilmenüü vertikaalne paigutus on functions.php Astra filtris) */

.ast-builder-menu .menu-item:hover > .menu-link,
.ast-builder-menu .menu-item:hover > .ast-menu-toggle {
  color: #15803d !important;
}

.ast-builder-menu .menu-item.current-menu-item > .menu-link,
.ast-builder-menu .current-menu-ancestor > .menu-link {
  color: #15803d !important;
  font-weight: 700;
}

/* Alammenüü — 1. tase */
.ast-builder-menu .main-header-menu > .menu-item > .sub-menu {
  background: #FFFFFF;
  border: 1px solid #F0F0F0;
  border-radius: 14px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.08), 0 2px 8px rgba(0, 0, 0, 0.04);
  padding: 8px !important;
  min-width: 220px;
  animation: submenuFadeIn 0.2s ease;
}

@keyframes submenuFadeIn {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Alammenüü lingid */
.ast-builder-menu .sub-menu .menu-item > .menu-link {
  color: #2C302E !important;
  font-family: 'Inter', sans-serif;
  font-weight: 400;
  font-size: 0.85rem !important;
  padding: 10px 14px !important;
  border-radius: 8px !important;
  transition: color 0.2s ease, background 0.2s ease;
  line-height: 1.4;
  white-space: normal !important;
}

.ast-builder-menu .sub-menu .menu-item:hover > .menu-link {
  color: #15803d !important;
  background: #f0fdf4 !important;
}

.ast-builder-menu .sub-menu .menu-item.current-menu-item > .menu-link {
  color: #15803d !important;
  background: #f0fdf4 !important;
  font-weight: 600;
}

/* Alammenüü eraldaja */
.ast-builder-menu .sub-menu .menu-item {
  border-bottom: none !important;
}

/* Sügavamad alammenüü tasemed (3. tase+) */
.ast-builder-menu .sub-menu .sub-menu {
  background: #FFFFFF !important;
  border: 1px solid #F0F0F0 !important;
  border-radius: 12px !important;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.08), 0 2px 6px rgba(0, 0, 0, 0.03) !important;
  padding: 6px !important;
  margin-left: 4px;
  animation: submenuFadeIn 0.2s ease;
}

/* Alammenüü nool (toggle) */
.ast-builder-menu .sub-menu .ast-menu-toggle {
  color: #9CA3AF !important;
  transition: color 0.2s ease, transform 0.2s ease;
}

.ast-builder-menu .sub-menu .menu-item:hover > .ast-menu-toggle {
  color: #15803d !important;
}

/* Mobiilne menüü — kõik stiilid on functions.php-s Astra dünaamilisel filtril (prioriteet 99) */

/* Mobiilne alammenüü */
.ast-header-break-point .sub-menu {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  padding: 0 !important;
  padding-left: 12px !important;
  border-left: 2px solid #E5E7EB !important;
  margin-left: 12px !important;
  animation: none !important;
}

.ast-header-break-point .sub-menu .menu-item > .menu-link {
  padding: 8px 12px !important;
  border-radius: 6px !important;
  font-size: 0.85rem !important;
}

.ast-header-break-point .sub-menu .menu-item:hover > .menu-link {
  background: #f0fdf4 !important;
}

.ast-header-break-point .sub-menu .sub-menu {
  margin-left: 4px !important;
  border-left: 2px solid #E5E7EB !important;
  box-shadow: none !important;
}

/* === PEIDA ASTRA JALUS === */

.ast-small-footer,
.site-footer,
.ast-footer-overlay,
.ast-footer-copyright,
footer.site-footer,
.ast-small-footer-section,
.ast-primary-footer,
.ast-above-footer,
.ast-below-footer,
.ast-footer-row {
  display: none !important;
}

/* === KEELEVAHETI === */

.lang-switcher {
  display: inline-block;
  background: #15803d !important;
  color: #fff !important;
  font-size: 0.75rem !important;
  font-weight: 700 !important;
  padding: 4px 12px !important;
  border-radius: 999px !important;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  transition: background 0.2s ease !important;
}

.lang-switcher:hover {
  background: #166534 !important;
  color: #fff !important;
}

.lang-switcher-item {
  margin-left: 8px !important;
  display: flex !important;
  align-items: center !important;
}

/* === AGENDA LOOJA STIILID === */

.agenda-builder {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 1.5rem;
  align-items: start;
}

.agenda-sidebar {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  position: sticky;
  top: 1.5rem;
}

.agenda-panel {
  background: #FFFFFF;
  border: 1px solid #EBEBEB;
  border-radius: 12px;
  padding: 1.5rem;
}

.agenda-panel-title {
  font-family: 'Lora', serif;
  font-size: 1.1rem;
  margin-bottom: 1rem;
}

.agenda-templates {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
}

.agenda-template-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  padding: 0.75rem 0.5rem;
  background: #FAFAFA;
  border: 1px solid transparent;
  border-radius: 10px;
  cursor: pointer;
  font-family: 'Inter', sans-serif;
  font-size: 0.8rem;
  font-weight: 500;
  color: #2C302E;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.agenda-template-btn:hover {
  border-color: #15803d;
  background: #f0fdf4;
}

.agenda-template-icon {
  font-size: 1.25rem;
  line-height: 1;
}

.agenda-actions {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.agenda-action-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 0.75rem;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-family: 'Inter', sans-serif;
  font-size: 0.85rem;
  font-weight: 500;
  transition: opacity 0.2s ease;
}

.agenda-action-btn:hover { opacity: 0.85; }
.agenda-action-add { background: #E8F5E9; color: #2E7D32; }
.agenda-action-export { background: #FFF8E1; color: #F57F17; }
.agenda-action-clear { background: #FFEBEE; color: #C62828; }

.agenda-main {
  background: #FFFFFF;
  border: 1px solid #EBEBEB;
  border-radius: 12px;
  min-height: 500px;
}

.agenda-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem;
  border-bottom: 1px solid #EBEBEB;
}

.agenda-title {
  font-family: 'Lora', serif;
  font-size: 1.5rem;
  margin: 0;
}

.agenda-total-time {
  color: #6B7280;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.agenda-total-time strong {
  color: #15803d;
  font-size: 1.25rem;
}

.agenda-items {
  padding: 1rem;
  min-height: 400px;
}

.agenda-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 350px;
  color: #6B7280;
  text-align: center;
}

.agenda-empty-icon {
  font-size: 3rem;
  opacity: 0.25;
  margin-bottom: 1rem;
}

.agenda-empty p { margin: 0.25rem 0; }

.agenda-item {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.85rem;
  margin-bottom: 0.5rem;
  background: #FAFAFA;
  border: 1px solid #EBEBEB;
  border-radius: 10px;
  transition: box-shadow 0.2s ease, opacity 0.2s ease, border-color 0.2s ease;
}

.agenda-item:hover {
  border-color: #15803d;
  box-shadow: 0 2px 8px rgba(21, 128, 61, 0.08);
}

.agenda-item--dragging { opacity: 0.4; }
.agenda-item--dragover {
  border-color: #15803d;
  box-shadow: 0 0 0 2px rgba(21, 128, 61, 0.2);
}

.agenda-item-drag {
  cursor: grab;
  color: #CCC;
  font-size: 1rem;
  padding: 0.2rem 0;
  user-select: none;
  letter-spacing: 2px;
  flex-shrink: 0;
}

.agenda-item-drag:active { cursor: grabbing; }

.agenda-item-number {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #15803d;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 600;
  flex-shrink: 0;
}

.agenda-item-content {
  flex: 1;
  min-width: 0;
}

.agenda-item-title {
  font-weight: 600;
  font-size: 0.95rem;
  color: #2C302E;
  outline: none;
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s ease;
}

.agenda-item-title:focus { border-bottom-color: #15803d; }

.agenda-item-description {
  font-size: 0.82rem;
  color: #6B7280;
  margin-top: 0.25rem;
  line-height: 1.5;
  outline: none;
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s ease;
}

.agenda-item-description:focus { border-bottom-color: #15803d; }

.agenda-item-time {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  flex-shrink: 0;
  white-space: nowrap;
}

.agenda-time-value {
  font-weight: 700;
  font-size: 1rem;
  color: #15803d;
  min-width: 24px;
  text-align: center;
}

.agenda-time-label {
  font-size: 0.75rem;
  color: #6B7280;
}

.agenda-time-btn {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 1px solid #EBEBEB;
  background: #FFFFFF;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  color: #6B7280;
  transition: border-color 0.2s ease, color 0.2s ease;
  padding: 0;
}

.agenda-time-btn:hover {
  border-color: #15803d;
  color: #15803d;
}

.agenda-item-delete {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 1.1rem;
  color: #CCC;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s ease, background 0.2s ease;
  flex-shrink: 0;
  padding: 0;
}

.agenda-item-delete:hover {
  color: #C62828;
  background: #FFEBEE;
}

/* === BLOGI PAGINATSIOON === */

.page-numbers {
  list-style: none;
  display: flex;
  gap: 0.5rem;
  padding: 0;
  margin: 0;
  justify-content: center;
}

.page-numbers li {
  display: inline-block;
}

.page-numbers a,
.page-numbers span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.5rem;
  height: 2.5rem;
  padding: 0 0.75rem;
  border-radius: 9999px;
  font-size: 0.875rem;
  font-weight: 500;
  transition: all 0.2s ease;
}

.page-numbers a {
  background: #FFFFFF;
  border: 1px solid #E5E7EB;
  color: #2C302E;
}

.page-numbers a:hover {
  background: #f0fdf4;
  border-color: #15803d;
  color: #15803d;
}

.page-numbers .current {
  background: #15803d;
  color: #FFFFFF;
  border: 1px solid #15803d;
}

/* === LINE CLAMP === */

.line-clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* === FLIP CARD === */

.flip-card {
  perspective: 800px;
}

.flip-card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transition: transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
  transform-style: preserve-3d;
}

/* Desktop: hover flip */
@media (hover: hover) {
  .flip-card:hover .flip-card-inner {
    transform: rotateY(180deg);
  }
}

/* Puuteekraan: tap to flip */
@media (hover: none) {
  .flip-card.is-flipped .flip-card-inner {
    transform: rotateY(180deg);
  }
}

.flip-card-front,
.flip-card-back {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.75rem;
}

.flip-card-back {
  transform: rotateY(180deg);
}

/* === MOBIIL === */

@media (max-width: 768px) {
  .agenda-builder {
    grid-template-columns: 1fr;
  }
  .agenda-sidebar {
    position: static;
  }
  .agenda-templates {
    grid-template-columns: repeat(3, 1fr);
  }
  .agenda-item {
    flex-wrap: wrap;
  }
  .agenda-item-content {
    width: calc(100% - 80px);
  }
  .agenda-item-time {
    margin-left: auto;
  }

  /* Footer newsletter: inline mobiilis, mitte float */
  .footer-newsletter-float {
    position: relative !important;
    top: auto !important;
    left: auto !important;
    transform: none !important;
    margin-bottom: 2rem;
  }
}

/* === NEWSLETTER FORM — JALUS (HELE TAUST) === */

.newsletter-form .ff-el-group {
  margin-bottom: 0.5rem !important;
}

.newsletter-form .ff-el-input--label {
  display: none !important;
}

.newsletter-form .ff-el-form-control {
  padding: 0.75rem 1.25rem !important;
  border-radius: 0.75rem !important;
  background: #F9FAFB !important;
  border: 1px solid #E5E7EB !important;
  font-size: 0.875rem !important;
  font-family: 'Inter', sans-serif !important;
  outline: none !important;
  transition: border-color 0.2s ease, box-shadow 0.2s ease !important;
}

.newsletter-form .ff-el-form-control:focus {
  border-color: #15803d !important;
  box-shadow: 0 0 0 1px #15803d !important;
}

.newsletter-form .ff_submit_btn_wrapper {
  margin-top: 0.5rem !important;
}

.newsletter-form .ff-btn-submit {
  background: #15803d !important;
  color: white !important;
  padding: 0.75rem 1.5rem !important;
  border-radius: 0.75rem !important;
  font-weight: 500 !important;
  font-family: 'Inter', sans-serif !important;
  font-size: 0.875rem !important;
  border: none !important;
  cursor: pointer !important;
  transition: background 0.2s ease !important;
  width: 100% !important;
}

.newsletter-form .ff-btn-submit:hover {
  background: #166534 !important;
}

/* Peida FluentFormi vaikimisi stiilid */
.newsletter-form .ff-el-is-error .error,
.newsletter-form .ff-message-success {
  font-size: 0.8rem !important;
  font-family: 'Inter', sans-serif !important;
}

/* === NEWSLETTER FORM — CTA (TUME TAUST) === */

.newsletter-form-dark .ff-el-group {
  margin-bottom: 0.75rem !important;
}

.newsletter-form-dark .ff-el-input--label {
  display: none !important;
}

.newsletter-form-dark .ff-el-form-control {
  padding: 0.75rem 1.25rem !important;
  border-radius: 0.75rem !important;
  background: rgba(255, 255, 255, 0.1) !important;
  border: 1px solid rgba(255, 255, 255, 0.2) !important;
  color: white !important;
  font-size: 1rem !important;
  font-family: 'Inter', sans-serif !important;
  outline: none !important;
  transition: box-shadow 0.2s ease !important;
}

.newsletter-form-dark .ff-el-form-control::placeholder {
  color: rgba(255, 255, 255, 0.5) !important;
}

.newsletter-form-dark .ff-el-form-control:focus {
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.3) !important;
}

.newsletter-form-dark .ff_submit_btn_wrapper {
  margin-top: 0.5rem !important;
}

.newsletter-form-dark .ff-btn-submit {
  background: white !important;
  color: #14532d !important;
  padding: 0.75rem 1.5rem !important;
  border-radius: 0.75rem !important;
  font-weight: 500 !important;
  font-family: 'Inter', sans-serif !important;
  font-size: 1rem !important;
  border: none !important;
  cursor: pointer !important;
  transition: background 0.2s ease !important;
  width: 100% !important;
}

.newsletter-form-dark .ff-btn-submit:hover {
  background: #f0fdf4 !important;
}

.newsletter-form-dark .ff-el-is-error .error {
  color: #fca5a5 !important;
  font-size: 0.8rem !important;
}

.newsletter-form-dark .ff-message-success {
  color: white !important;
  font-size: 0.9rem !important;
}
