/* ------------------------------------------------------------
   Unified site stylesheet — pastel / mocha / light elegant theme
   Max content width: 1200px
   ------------------------------------------------------------ */

:root{
  --c-bg:#f7f3ee;
  --c-surface:#fffaf4;
  --c-text:#3d2f2f;
  --c-accent:#c5a27b;
  --c-accent-dark:#a38463;
  --c-border:#e5d8c9;
  --c-shadow: 0 10px 30px rgba(60,40,30,0.06);
  --maxw:1200px;
  --radius:8px;
  --gap:1.25rem;
}

*{box-sizing:border-box}
html {
  scroll-behavior: smooth; /* Enables smooth scrolling for anchor links */
}
html,body{height:100%}
body{
  margin:0;
  font-family:"EB Garamond", "Merriweather", Georgia, serif, system-ui,-apple-system,"Segoe UI",Roboto,"Helvetica Neue",Arial;
  background:var(--c-bg);
  color:var(--c-text);
  -webkit-font-smoothing:antialiased;
  -moz-osx-font-smoothing:grayscale;
  line-height:1.55;
  transition:opacity .6s ease,filter .9s ease;
  opacity:1;
  font-size: 1rem;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

p {
  margin-bottom:1.25rem;
}
a{
  color:var(--c-accent-dark);
  text-decoration:none;
}
a:hover{
  color:var(--c-text);
  text-decoration:none;
}
hr{
  border:0;
  border-top:1px solid var(--c-border);
  margin:28px 0;
}
main {
  flex: 1 0 auto; /* takes remaining space, pushes footer down */
}

/* --- Sticky footer --- */
.site-footer {
  flex-shrink: 0;
  background: var(--c-surface);
  border-top: 1px solid var(--c-border);
  padding: 20px 0;
  text-align: center;
}

/* --- Portfolio gallery spacing --- */
.gallery-grid { /* Changed to 4 columns for desktop */
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

/* PRELOADER (overlay) */
#preloader{
  position:fixed; inset:0; background:var(--c-bg); z-index:9999;
  backdrop-filter: blur(8px);
  display:flex; align-items:center; justify-content:center;
  transition:opacity .6s ease, visibility .6s ease;
  opacity:1;
  visibility:visible;
}
body.loaded #preloader{ opacity:0; visibility:hidden; pointer-events:none; }

/* small animated mark */
#preloader::before{
  content:""; width:88px; height:88px; border-radius:50%;
  background:linear-gradient(135deg,var(--c-accent),var(--c-accent-dark));
  box-shadow:var(--c-shadow);
  filter:blur(6px);
  animation: pulse 1.8s infinite;
}
@keyframes pulse{ 0%{transform:scale(.98)} 50%{transform:scale(1.06)} 100%{transform:scale(.98)} }

/* layout helpers */
.wrap{max-width:var(--maxw); margin:0 auto; padding:0 20px}
.site-header{
  position:sticky; 
  top:0; 
  z-index:50; 
  background:var(--c-surface); 
  border-bottom:1px solid var(--c-border); 
  box-shadow:var(--c-shadow);
  transition: background-color 0.3s ease, box-shadow 0.3s ease; /* Added for smooth transition */
}
.site-header.scrolled {
  background-color: rgba(255, 250, 244, 0.75); /* Semi-transparent version of --c-surface */
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px); /* For Safari */
}
.site-header .wrap{display:flex; align-items:center; justify-content:space-between; padding:18px 20px}
.brand{display:flex; align-items:center; gap:.9rem; text-decoration:none; color:var(--c-text)}
.brand .mark{width:46px;height:46px;border-radius:8px; background:linear-gradient(180deg,var(--c-accent),var(--c-accent-dark)); color:#fff; display:flex; align-items:center; justify-content:center; font-family:"EB Garamond", "Merriweather", Georgia, serif, cursive; font-size:1.2rem}
.brand .brand-name{font-family:"EB Garamond", "Merriweather", Georgia, serif, cursive; font-size:clamp(0.9rem,2vw,2.6rem); color:var(--c-accent-dark);}

/* desktop nav */
.nav-desktop{display:flex; gap:8px; align-items:center;}
.nav-desktop a{color:var(--c-accent); text-decoration:none; padding:8px 10px; border-radius:8px; font-weight:600;}
.nav-desktop a:hover, .nav-desktop a.active{color:var(--c-accent-dark); background:rgba(163,132,99,0.06)}

/* burger */
.burger{display:none; background:none;border:0;font-size:1rem;color:var(--c-accent-dark); cursor:pointer}

/* --- Mobile Menu (Side Panel) --- */
.mobile-menu {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: auto; /* Width will be determined by content */
  min-width: 250px; /* Minimum width for usability */
  background: var(--c-surface);
  z-index: 100;
  padding: 15px; /* Reduced overall padding */
  box-shadow: -10px 0 30px rgba(60, 40, 30, 0.1);
  border-left: 1px solid var(--c-border);
  transform: translateX(100%); /* Initially hidden off-screen */
  transition: transform 0.3s ease-in-out;
  overflow-y: auto; /* Add scroll if content still overflows */
}
.mobile-menu.show {
  transform: translateX(0); /* Slides into view */
}
.mobile-menu .mobile-nav {
  display: flex;
  flex-direction: column;
  align-items: flex-start; /* Align items to the left */
  gap: 2px; /* Reduced gap between menu items */
}
.mobile-menu a {
  display: block;
  text-decoration: none;
  color: var(--c-text);
  padding: 6px 12px; /* Reduced vertical padding for each link */
  border-radius: 6px;
  text-align: left; /* Align text to the left */
  white-space: nowrap; /* Prevent text from wrapping */
}

/* Menu Overlay */
#menu-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5); /* Semi-transparent black */
  z-index: 99; /* Below the menu (z-index: 100), above everything else */
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease-in-out, visibility 0.3s ease-in-out;
}
#menu-overlay.show {
  opacity: 1;
  visibility: visible;
}

/* HERO */
.hero{background-image:url('../images/hero.webp'); background-size:cover; background-position:center; min-height:70vh; display:flex; align-items:center; justify-content:center; padding:68px 0; position:relative}
.hero-inner{position:relative; z-index:2; text-align:center; max-width:1100px}
.hero h1{font-family:"EB Garamond", "Merriweather", Georgia, serif, cursive; font-size:clamp(1rem,3vw,3rem); margin:0; color:var(--c-accent-dark)}
.lead{font-size:clamp(0.9rem,2vw,1.6rem); color:rgba(61,47,47,0.9); margin-top:12px}
.hero-actions{margin-top:18px; display:flex; gap:12px; justify-content:center}
.btn{display:inline-block;padding:10px 18px;border-radius:10px;text-decoration:none;font-weight:700}
.btn-primary{background:var(--c-accent-dark); color:#fff}
.btn-outline{background:transparent;border:2px solid var(--c-accent); color:var(--c-accent-dark)}

/* section titles */
.section-title {font-family:"EB Garamond", "Merriweather", Georgia, serif, cursive; font-size:clamp(1.6rem,3.2vw,2.4rem); text-align:center; color:var(--c-accent-dark); margin:28px 0 6px}

.section-lead{max-width:900px; margin:0 auto 18px; text-align:center; color:rgba(61,47,47,0.9)}

/* cards grid */
.cards{
  display:grid; 
  grid-template-columns: repeat(3, 1fr); /* Default to 3 columns on desktop */
  gap:18px; 
  margin-top:18px;
}
@media (max-width: 980px) {
  .cards { grid-template-columns: repeat(2, 1fr); } /* 2 columns on tablets */
}
@media (max-width: 600px) {
  .cards { grid-template-columns: repeat(1, 1fr); } /* 1 column on mobile */
}
.card{
  background:var(--c-surface); 
  border-radius:8px; 
  border:1px solid var(--c-border); 
  box-shadow:var(--c-shadow);
  overflow: hidden; /* This is important to contain the image within the rounded corners */
}
.card img {
    opacity: 0.7;
    transition: opacity 0.3s ease-in-out;
}
.card:hover img {
    opacity: 1;

}
.card p {
  padding: 0 18px 18px; /* Add padding only to the text paragraph */
}

/* New styles for the card image and header */
.card-header {
  position: relative;
}
.card-header img {
  display: block;
  width: 100%;
  height: 220px; /* A fixed height for uniform cards */
  object-fit: cover; /* Ensures the image fills the space without distortion */
}
.card-header h3 {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  margin: 0;
  padding: 18px;
  color: var(--c-accent-dark); /* Changed color back to the default text color */
  background: linear-gradient(0deg,rgba(255, 250, 244, 1) 20%, rgba(255, 250, 244, 0.5) 85%, rgba(255, 255, 255, 0) 100%);
}
.close-menu-btn {
  position: absolute;
  top: 15px;
  right: 15px;
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--c-accent-dark);
  cursor: pointer;
  padding: 5px;
}

/* gallery */
.thumb{margin:0.25rem; border-radius:6px; box-shadow:var(--c-shadow); overflow:hidden}
.thumb img{display:block; width:100%; border-radius:6px; transition:transform .28s ease}
/* Removed aspect-ratio and object-fit to preserve original image proportions */
.thumb:hover img{transform:scale(1.02)}

/* filters */
.filters{display:flex; gap:10px; justify-content:center; flex-wrap:wrap; margin-bottom:14px;}
.filters .filter{background:transparent;border:1px solid var(--c-accent); color:var(--c-accent-dark); padding:8px 12px; border-radius:999px; cursor:pointer; font-weight:700}
.filters .filter.active{background:var(--c-accent); color:#fff}
button.filter{font-size:1rem; font-family:"EB Garamond", "Merriweather", Georgia, serif;}
button.filter:hover{background:var(--c-accent); color:#fff}
/* services/prices/cards */
.services-grid, .prices-grid{display:grid; grid-template-columns:repeat(auto-fit,minmax(260px,1fr)); gap:18px}
.service-card, .price-card{background:var(--c-surface); padding:18px; border-radius:12px; border:1px solid var(--c-border); box-shadow:var(--c-shadow)}
.service-card h3, .price-card h3{font-family:"EB Garamond", "Merriweather", Georgia, serif;font-size:clamp(1rem,2.5vw,1.4rem); cursive; margin-top:0; color:var(--c-accent-dark)}

/* testimonials */
.testimonials-grid{display:grid; grid-template-columns:repeat(auto-fit,minmax(260px,1fr)); gap:14px}
.quote{background:var(--c-surface); padding:18px; border-radius:10px; border:1px solid var(--c-border); font-style:italic}

/* about layout */
.about-grid{display:grid; grid-template-columns:350px 1fr; gap:20px; align-items:center}
.about-photo img{width:100%; border-radius:12px; border:1px solid var(--c-border); box-shadow:var(--c-shadow)}
@media (max-width:900px){ .about-grid{grid-template-columns:1fr} }

/* contact */
.contact-grid{display:grid; grid-template-columns:1fr 340px; gap:20px}
.contact-form{display:flex; flex-direction:column; gap:10px}
.contact-form label{display:block}
.contact-form input, .contact-form textarea{width:100%; padding:10px; border-radius:8px; border:1px solid var(--c-border); background:#fff}
@media (max-width:980px){ .contact-grid{grid-template-columns:1fr} }

/* footer */
.site-footer{border-top:1px solid var(--c-border); background:var(--c-surface); padding:20px 0}
.footer-inner{display:flex; align-items:center; justify-content:space-between; gap:12px}
.footer-inner .socials a{margin-left:8px; color:var(--c-accent-dark); text-decoration:none; font-size:18px; padding:8px; border-radius:8px; background:rgba(163,132,99,0.04)}
@media (max-width:980px){ .nav-desktop{display:none} .burger{display:inline-block} .footer-inner{flex-direction:column} }

/* Responsive adjustments for gallery grid */
@media (max-width: 980px) {
  .gallery-grid {
    grid-template-columns: repeat(2, 1fr); /* 2 columns on tablets */
  }
}
@media (max-width: 600px) {
  .gallery-grid {
    grid-template-columns: repeat(1, 1fr); /* 1 column on mobile */
  }
}

/* Specific grid for 3-item portfolio preview on index.html */
.preview-grid {
  grid-template-columns: repeat(3, 1fr);
}

/* Responsive fix for the preview grid */
@media (max-width: 600px) {
  .preview-grid {
    grid-template-columns: repeat(1, 1fr); /* 1 column on small mobile screens */
  }
}
/* utility */
.muted{color:rgba(61,47,47,0.6)}
.center{text-align:center}

#slider {
  padding: 2rem 0;
  background: var(--c-bg:#f7f3ee);
  overflow: hidden;
  position: relative;
}

.slider-wrapper {
  max-width: 1200px;
  margin: 0 auto;
  overflow: hidden;
  position: relative;
  mask-image: linear-gradient(to right, transparent 0%, black 10%, black 90%, transparent 100%);
  -webkit-mask-image: linear-gradient(to right, transparent 0%, black 10%, black 90%, transparent 100%);
}

.slider-track {
  display: flex;
  gap: 16px;
}

.slide {
  flex: 0 0 300px;
}

.slide img {
  width: 100%;
  border-radius: 12px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

/* Hero section */
#home {
  position: relative;
  height: 100vh;
  overflow: hidden;
  display: flex;
  justify-content: center;
  align-items: center;
  text-align: center;
}

/* Background image with gradient overlay */
.hero-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 120%;
    background: linear-gradient(0deg,rgba(247, 243, 238, 1) 20%, rgba(247, 243, 238, 0.8) 60%, rgba(247, 243, 238, 0) 90%), url('../images/hero.webp') center/cover no-repeat;
    z-index: -1;
}
.hero-content {
  position: relative;
  z-index: 1;
  margin: 0 20px;
}
.hero-content h1 {
  color: var(--c-accent-dark);
}

#home h1 {
  font-size: clamp(2.5rem, 6vw, 5rem);
  font-weight: 900;
}

#home p {
  font-size: clamp(1rem, 2vw, 1.3rem);
  margin-top: 1rem;
}

img.lazy {
  opacity: 0;
  min-height: 220px;      /* keeps layout before image loads */
  background: #ece7e1;    /* soft placeholder */
}
img.lazy-loaded { opacity: 1; transition: opacity .4s ease; }

/* --- GLightbox Customizations to match theme --- */

.glightbox-container .gslide-image {
  /* Frame style: Adds padding, background, border, and shadow */
  background: var(--c-surface); 
  padding: 8px; 
  border: 1px solid var(--c-border);
  box-shadow: var(--c-shadow);
  
  /* Corner Radius setup: Ensures the image container is rounded */
  border-radius: var(--radius); 
  overflow: hidden; 
}

.glightbox-container .gslide-image img {
  /* Resets the individual image radius if needed */
  border-radius: 0; 
}

/* ----------------------------------------------------------------------------------
 * --- SUBMENU FIXES (Desktop Spacing & Mobile Height) ---
 * ---------------------------------------------------------------------------------- */

/* --- Desktop Submenu (Hover) --- */

/* 1. CRITICAL DESKTOP FIX: Resets the container to allow flex gap to work */
.nav-desktop .has-submenu {
    position: relative; 
    padding: 0; /* Remove padding */
    margin: 0; /* Remove margin */
    border-radius: 0;
    display: block; /* Ensure it doesn't try to take full width */
}

/* 2. Style the actual link inside the container to match its siblings */
.nav-desktop .has-submenu > a {
    /* Reapply the padding and styling of sibling <a> tags */
    padding: 8px 10px; 
    border-radius: 8px;
    font-weight: 600;

    /* Allows icon and text alignment */
    display: inline-flex; 
    align-items: center;
    gap: 5px;
    text-decoration: none;
    /*color: var(--c-text);*/
}

/* Hover/Active State Consistency */
.nav-desktop .has-submenu > a:hover,
.nav-desktop .has-submenu > a.active {
    color: var(--c-accent-dark); 
    background: rgba(163, 132, 99, 0.06);
}


/* Submenu Container (Dropdown styling) */
.submenu-desktop {
    position: absolute; /* Changed from calc(100% + 5px) to 100% */
    top: 100%; 
    left: 0;
    min-width: 280px; /* Increased width */
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    box-shadow: var(--c-shadow);
    border-radius: var(--radius);
    overflow: hidden;
    
    /* Initially hidden */
    display: none; 
    visibility: hidden;
    opacity: 0;
    transform: translateY(-10px); /* Start slightly above */
    z-index: 55; 
    transition: opacity 0.2s ease, visibility 0.2s ease, transform 0.2s ease; /* Add transform to transition */
}

/* Show submenu on hover */
.nav-desktop .has-submenu:hover .submenu-desktop {
    display: block;
    visibility: visible;
    opacity: 1;
    transform: translateY(0); /* Move to final position */
}

/* Style for individual submenu links */
.submenu-desktop a {
    display: block;
    padding: 10px 15px; /* Standard link padding inside dropdown */
    white-space: nowrap; 
    font-weight: 400; 
    text-decoration: none;
    text-align: left; /* Align text to the left */
    color: var(--c-text);
}

.submenu-desktop a:hover {
    background: rgba(163, 132, 99, 0.06);
    color: var(--c-accent-dark);
}

/* Icon rotation */
.nav-desktop .submenu-arrow {
    font-size: 0.7em;
    transition: transform 0.2s ease;
}
.nav-desktop .has-submenu:hover .submenu-arrow {
    transform: rotate(180deg);
}

/* --- Mobile Submenu (Compacting Height) --- */

.has-submenu-mobile {
    width: 100%;
    max-width: 420px;
}

.mobile-sublinks {
    /* Visual indentation and separation */
    width: 100%;
    padding-left: 20px; 
    border-left: 4px solid var(--c-border); 
    margin: 2px 0 6px; /* Further reduced margin */
}

.mobile-sublinks a {
    /* CRITICAL MOBILE FIX: Reduced vertical padding and font size for height reduction */
    padding: 5px 18px 5px 10px; /* Reduced vertical padding (5px top/bottom) */
    font-size: 0.8rem; /* Smaller font for compactness */
    
    /* Ensure styles match parent mobile nav link behavior */
    display: block; 
    text-align: left;
    background: none; 
}

.mobile-sublinks a:hover, .mobile-menu a:hover{
    background: rgba(163, 132, 99, 0.06);
}

/* Scroll Down Icon in Hero */
.scroll-down {
  position: absolute;
  bottom: 150px; /* Increased from 30px to raise the icon */
  left: 50%;
  transform: translateX(-50%);
  width: 30px;
  height: 50px;
  border: 2px solid var(--c-accent-dark);
  border-radius: 20px;
  cursor: pointer;
  z-index: 2;
}

.scroll-down::before {
  content: '';
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  width: 6px;
  height: 6px;
  background: var(--c-accent-dark);
  border-radius: 50%;
  animation: scroll-animation 2s infinite;
}

@keyframes scroll-animation {
  0% { opacity: 1; top: 10px; }
  100% { opacity: 0; top: 30px; }
}
.gotcha {
  display: none;
}

/* --- Language Switcher Styles --- */
.lang-switch-container-desktop {
  display: none; /* Hidden by default, shown on desktop */
  padding-bottom: 10px; /* Add some padding below the line */
  border-bottom: 1px solid var(--c-border);
}

.lang-switch-container-desktop .wrap {
  display: flex;
  flex-direction: column; /* Stack hr and buttons vertically */
  align-items: flex-end; /* Align content to the right */
  padding-top: 10px; /* Space above the line */
}

.lang-buttons {
  display: flex;
  gap: 10px;
}

.btn-lang {
  display: inline-block;
  padding: 5px 10px;
  border-radius: 5px;
  text-decoration: none;
  font-weight: 600;
  color: var(--c-accent);
  border: 1px solid var(--c-accent); /* Button border */
  transition: all 0.2s ease;
  font-size: 0.8rem; /* Slightly smaller font for compactness */
}

.btn-lang:hover {
  background: var(--c-accent);
  color: #fff;
}

.btn-lang.active {
  background: var(--c-accent-dark);
  color: #fff;
  border-color: var(--c-accent-dark);
  cursor: default; /* Active button is not clickable */
}

/* Mobile Language Switcher */
.lang-switch-container-mobile {
  display: none; /* Hidden by default, shown in mobile menu */
  padding-top: 15px; /* Space above the line in mobile menu */
  padding-bottom: 5px;
  width: 100%; /* Take full width of mobile menu */
  text-align: center; /* Center buttons in mobile menu */
}

.lang-switch-container-mobile hr {
  width: 100%;
  margin: 0 0 15px 0; /* Adjust margin for the line */
  border-top: 1px solid var(--c-border);
}

/* Media queries for responsiveness */
@media (min-width: 981px) { /* Desktop styles */
  .lang-switch-container-desktop {
    display: block; /* Show on desktop */
  }
}

@media (max-width: 980px) { /* Mobile/Tablet styles */
  .lang-switch-container-desktop {
    display: none; /* Hide desktop switcher on mobile */
  }
  .lang-switch-container-mobile {
    display: block; /* Show mobile switcher in mobile menu */
  }
}

/* Styles for the container with language switcher and social icons on index.html */
.lang-social-wrapper {
  flex-direction: row !important;
  justify-content: space-between;
  align-items: center !important;
  font-size: 1.2rem;
  padding: 0 1.2rem;
}
.lang-social-wrapper .socials a {
  margin: 0 0.5rem;
  color: var(--c-accent-dark);
  text-decoration: none;
}

/* --- Back to Top Button --- */
#back-to-top {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 50px;
  height: 50px;
  background-color: var(--c-accent-dark);
  color: #fff;
  border: none;
  border-radius: 50%;
  box-shadow: var(--c-shadow);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  z-index: 50;
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px);
  transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s ease;
}
#back-to-top.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

/* --- Masonry Gallery Layout --- */
.gallery-grid:not(.preview-grid) {
  column-width: 200px; /* Бажана ширина колонки */
  column-gap: 1rem;     /* Відстань між колонками */
  display: block;       /* Перевизначаємо display: grid */
}

.gallery-grid:not(.preview-grid) .thumb {
  break-inside: avoid;  /* Запобігаємо розриву елемента між колонками */
  margin-bottom: 1rem;  /* Відступ знизу для кожного зображення */
}