/*
 Theme Name:   Astra Child
 Description:  Aavsan OÜ custom child theme for Astra
 Template:     astra
 Version:      2.0.0
 Text Domain:  astra-child
*/

/* ============================================
   GLOBAL
   ============================================ */
html {
  scroll-behavior: smooth;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

/* ============================================
   STICKY HEADER
   ============================================ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 999;
}

.ast-primary-header-bar {
  background: #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  transition: box-shadow 0.3s ease;
}

/* Offset scroll targets so sticky header doesn't hide them */
#hero,
#teenused,
#tehtud-tood,
#kontakt {
  scroll-margin-top: 100px;
}

/* ============================================
   FULL-WIDTH CONTAINER for front page
   ============================================ */
.aavsan-front .site-content > .ast-container {
  max-width: 100%;
  padding: 0;
}

/* Remove default entry content margins from Astra */
.aavsan-front .entry-content > .alignfull {
  margin-left: 0;
  margin-right: 0;
}

/* ============================================
   HEADER: Logo + Nav styling
   ============================================ */
.site-branding .ast-logo-svg-icon svg {
  height: auto;
}

.ast-primary-header-bar .menu-item a {
  color: #22425E;
  font-weight: 500;
  text-transform: uppercase;
  font-size: 0.9rem;
  letter-spacing: 0.5px;
  transition: color 0.2s ease;
}

.ast-primary-header-bar .menu-item a:hover,
.ast-primary-header-bar .menu-item a.current {
  color: #1a3549;
}

/* Header phone link — hidden on desktop, flex item on mobile */
.header-phone {
  display: none;
}

.header-phone a {
  font-variant-numeric: tabular-nums;
  color: #22425E;
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
  white-space: nowrap;
}

.header-phone a:hover {
  color: #1a3549;
}

/* ============================================
   HERO SECTION
   ============================================ */
.aavsan-front .wp-block-cover .wp-block-cover__inner-container {
  max-width: 800px;
  margin: 0 auto;
}

/* Hero h1 */
.hero-title {
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.6), 0 4px 16px rgba(0, 0, 0, 0.3);
  margin-bottom: 1rem;
}

/* Hero subtitle */
.hero-subtitle {
  opacity: 0.85;
  margin-bottom: 1.5rem;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5), 0 2px 10px rgba(0, 0, 0, 0.2);
}

/* Hero body text */
.hero-body {
  max-width: 640px;
  margin-left: auto;
  margin-right: auto;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5), 0 2px 10px rgba(0, 0, 0, 0.2);
}

/* Hero CTA button */
.hero-cta .wp-block-button__link {
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.hero-cta .wp-block-button__link:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
}

/* ============================================
   SERVICES SECTION
   ============================================ */

/* Content blocks: centered text within max-width */
.service-content > .wp-block-heading,
.service-content > p {
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
}

/* Service h3 styling */
.service-content h3 {
  margin-bottom: 0.75rem;
}

/* Image band cover blocks */
.service-image-band {
  margin-top: 0 !important;
  margin-bottom: 0 !important;
}

/* Remove WordPress default block spacing within services wrapper */
#teenused > .service-content {
  margin-block-start: 0 !important;
  margin-block-end: 0 !important;
}

.service-image-band .wp-block-cover__inner-container {
  min-height: 0;
  padding: 0;
}


/* ============================================
   PORTFOLIO SECTION
   ============================================ */
.portfolio-section {
  background: #e9ecf0;
  padding: 4rem 0;
  border-top: 3px solid #22425E;
  box-shadow: inset 0 4px 12px rgba(0, 0, 0, 0.04);
}

.portfolio-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
}

.portfolio-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
}

.portfolio-item {
  background: #fff;
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.portfolio-item:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.portfolio-thumb {
  position: relative;
  aspect-ratio: 4 / 3;
  overflow: hidden;
}

.portfolio-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.portfolio-overlay {
  position: absolute;
  inset: 0;
  background: rgba(34, 66, 94, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.portfolio-item:hover .portfolio-overlay {
  opacity: 1;
}

.portfolio-overlay span {
  color: #fff;
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  background: rgba(0, 0, 0, 0.35);
  padding: 0.4rem 1rem;
  border-radius: 4px;
}

.portfolio-item h3 {
  margin: 0;
  padding: 0.85rem 1rem;
  font-size: 1rem;
  color: #22425E;
  font-weight: 600;
}

/* ============================================
   LIGHTBOX
   ============================================ */
.portfolio-lightbox {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: rgba(0, 0, 0, 0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.portfolio-lightbox.lb-active {
  opacity: 1;
  visibility: visible;
}

.lb-content {
  position: relative;
  max-width: 90vw;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.lb-image {
  max-width: 90vw;
  max-height: 80vh;
  object-fit: contain;
  border-radius: 4px;
}

.lb-caption {
  color: #fff;
  font-size: 0.9rem;
  margin-top: 0.75rem;
  text-align: center;
  max-width: 600px;
}

.lb-counter {
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.8rem;
  margin-top: 0.5rem;
}

.lb-close {
  position: absolute;
  top: 1rem;
  right: 1.5rem;
  background: none;
  border: none;
  color: #fff;
  font-size: 2.5rem;
  cursor: pointer;
  z-index: 10001;
  line-height: 1;
  padding: 0.25rem;
  opacity: 0.8;
  transition: opacity 0.2s ease;
}

.lb-close:hover {
  opacity: 1;
}

.lb-prev,
.lb-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(34, 66, 94, 0.6);
  border: none;
  color: #fff;
  font-size: 1.6rem;
  cursor: pointer;
  z-index: 10001;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  padding: 0;
  opacity: 0.8;
  transition: opacity 0.2s ease, background 0.2s ease;
}

.lb-prev:hover,
.lb-next:hover {
  opacity: 1;
  background: rgba(34, 66, 94, 0.85);
}

.lb-prev {
  left: 1.5rem;
}

.lb-next {
  right: 1.5rem;
}

/* ============================================
   CONTACT SECTION
   ============================================ */
.contact-info a {
  color: #fff;
  text-decoration: none;
  border-bottom: 1px solid rgba(255, 255, 255, 0.4);
  transition: border-color 0.2s ease;
}

.contact-info a:hover {
  border-color: #fff;
}

#kontakt .wpcf7 {
  max-width: 600px;
  margin: 0 auto;
}

#kontakt .wpcf7 form {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

#kontakt .wpcf7 form > div,
#kontakt .wpcf7 form > p,
#kontakt .wpcf7 form div p {
  margin: 0 !important;
  margin-bottom: 0 !important;
  padding: 0 !important;
}

#kontakt .wpcf7 form br {
  display: none;
}

#kontakt .wpcf7 label {
  font-size: 0.9rem;
  font-weight: 600;
  color: #fff;
  display: block;
  margin-bottom: 0.25rem;
}

#kontakt .wpcf7 input:not([type="submit"]):not([type="hidden"]),
#kontakt .wpcf7 textarea {
  width: 100%;
  height: auto !important;
  padding: 0.5rem 0.75rem !important;
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  font-family: inherit !important;
  font-size: 0.95rem !important;
  line-height: 1.5 !important;
  box-sizing: border-box;
}

#kontakt .wpcf7 input::placeholder,
#kontakt .wpcf7 textarea::placeholder {
  color: rgba(255, 255, 255, 0.65);
}

#kontakt .wpcf7 input:focus,
#kontakt .wpcf7 textarea:focus {
  outline: none;
  border-color: rgba(255, 255, 255, 0.7);
  background: rgba(255, 255, 255, 0.2);
}

#kontakt .wpcf7 textarea {
  min-height: 100px;
  max-height: 200px;
  resize: vertical;
  font-family: inherit;
}

#kontakt .wpcf7 input[type="submit"] {
  align-self: flex-start;
  padding: 0.6rem 2.5rem;
  background: #fff;
  color: #22425E;
  border: 1px solid #fff;
  border-radius: 6px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease;
}

#kontakt .wpcf7 input[type="submit"]:hover {
  background: rgba(255, 255, 255, 0.85);
  transform: translateY(-1px);
}

#kontakt .wpcf7-response-output {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.4) !important;
}

#kontakt .wpcf7-not-valid-tip {
  color: #ffb3b3;
}

/* ============================================
   FOOTER
   ============================================ */
.aavsan-front .site-footer {
  background: #1a3549;
  color: rgba(255, 255, 255, 0.6);
  text-align: center;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 768px) {
  .ast-mobile-header-content {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border-bottom: 2px solid #22425E;
  }

  .ast-mobile-header-wrap .ast-builder-grid-row {
    display: flex !important;
    grid-template-columns: none !important;
    align-items: center;
  }

  .ast-mobile-header-wrap .site-header-section {
    width: auto !important;
    flex: 0 0 auto;
  }

  .header-phone {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1;
    min-width: 0;
  }

  .aavsan-front .wp-block-cover:first-child {
    min-height: 85vh !important;
  }

  .service-image-band {
    min-height: 180px !important;
  }

  .service-content {
    padding: 2rem 1.25rem !important;
  }

  #hero,
  #teenused,
  #tehtud-tood,
  #kontakt {
    scroll-margin-top: 80px;
  }

  .portfolio-inner {
    padding: 0 1.25rem;
  }

  .portfolio-section {
    padding: 3rem 0;
  }

  .lb-prev,
  .lb-next {
    width: 36px;
    height: 36px;
  }

  .lb-prev svg,
  .lb-next svg {
    width: 16px;
    height: 16px;
  }

  .lb-prev {
    left: 0.5rem;
  }

  .lb-next {
    right: 0.5rem;
  }
}
