/* =========================================================
   Klempířství Chmelař Bohuslav — style.css
   Mobile-first, responsive. Green + copper palette.
   ========================================================= */

/* ---------------------------------------------------------
   1. CSS Custom Properties
   --------------------------------------------------------- */
:root {
  --green-dark:  #1e3a2f;
  --green:       #2d6a4f;
  --copper:      #c8a96e;
  --copper-dark: #a8894e;
  --cream:       #f4f1eb;
  --white:       #ffffff;
  --text:        #3d3d3d;
  --text-light:  #6b7280;
  --footer-bg:   #1a2a23;
  --header-h:    72px;

  --radius:      8px;
  --shadow-sm:   0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.05);
  --shadow-md:   0 4px 16px rgba(0,0,0,.10);
  --shadow-lg:   0 8px 32px rgba(0,0,0,.14);
  --transition:  .25s ease;
}

/* ---------------------------------------------------------
   2. Reset
   --------------------------------------------------------- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--header-h);
}

body {
  font-family: 'Raleway', sans-serif;
  font-size: 1rem;
  line-height: 1.7;
  color: var(--text);
  background: var(--white);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

a {
  text-decoration: none;
  color: inherit;
}

ul, ol {
  list-style: none;
}

button {
  cursor: pointer;
  font-family: inherit;
  border: none;
  background: none;
}

/* ---------------------------------------------------------
   3. Typography
   --------------------------------------------------------- */
h1 {
  font-size: clamp(2rem, 5vw, 3.2rem);
  font-weight: 700;
  line-height: 1.15;
  color: var(--green-dark);
}

h2 {
  font-size: clamp(1.6rem, 4vw, 2.4rem);
  font-weight: 700;
  line-height: 1.2;
  color: var(--green-dark);
}

h3 {
  font-size: 1.15rem;
  font-weight: 600;
  line-height: 1.4;
  color: var(--green-dark);
}

p {
  color: var(--text-light);
}

.eyebrow {
  display: inline-block;
  text-transform: uppercase;
  font-size: .8rem;
  font-weight: 600;
  letter-spacing: 2px;
  color: var(--copper);
  margin-bottom: .5rem;
}

/* ---------------------------------------------------------
   4. Layout Utilities
   --------------------------------------------------------- */
.container {
  width: 100%;
  max-width: 1120px;
  margin-inline: auto;
  padding-inline: 24px;
}

.section {
  padding: 100px 0;
}

.section-header {
  text-align: center;
  margin-bottom: 60px;
}

.section-header p {
  max-width: 580px;
  margin-inline: auto;
  margin-top: .75rem;
}

/* ---------------------------------------------------------
   5. Buttons
   --------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 32px;
  border-radius: 6px;
  font-size: .9rem;
  font-weight: 600;
  letter-spacing: .3px;
  transition: background var(--transition), color var(--transition),
              border-color var(--transition), box-shadow var(--transition),
              transform var(--transition);
}

.btn:active {
  transform: translateY(1px);
}

.btn-primary {
  background: var(--copper);
  color: var(--white);
  border: 2px solid var(--copper);
}

.btn-primary:hover {
  background: var(--copper-dark);
  border-color: var(--copper-dark);
  box-shadow: 0 4px 14px rgba(200,169,110,.35);
}

.btn-outline {
  background: transparent;
  color: var(--green-dark);
  border: 2px solid var(--green-dark);
}

.btn-outline:hover {
  background: var(--green-dark);
  color: var(--white);
}

/* ---------------------------------------------------------
   6. Header
   --------------------------------------------------------- */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  height: var(--header-h);
  background: linear-gradient(135deg, rgba(30,58,47,.85), rgba(45,106,79,.75));
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: background var(--transition), box-shadow var(--transition);
}

.header.scrolled {
  background: linear-gradient(135deg, rgba(30,58,47,.92), rgba(45,106,79,.85));
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 2px 16px rgba(0,0,0,.15);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
}

/* Logo */
.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.15rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: .3px;
  line-height: 1.2;
}

.logo-img {
  height: 36px;
  width: auto;
  filter: brightness(0) invert(1);
}

.logo-text .accent {
  color: var(--copper);
}

/* Nav */
.nav {
  display: flex;
  align-items: center;
  gap: 28px;
}

.nav a {
  position: relative;
  font-size: .9rem;
  font-weight: 500;
  color: rgba(255,255,255,.85);
  padding-bottom: 2px;
}

.nav a:hover {
  color: #fff;
}

.nav a::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--copper);
  border-radius: 2px;
  transition: width var(--transition);
}

.nav a:hover::after,
.nav a.active::after {
  width: 100%;
}

/* CTA in nav */
.nav .btn {
  padding: 9px 22px;
  font-size: .85rem;
}

/* Hamburger toggle */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  border-radius: 6px;
  transition: background var(--transition);
}

.nav-toggle:hover {
  background: rgba(255,255,255,.12);
}

.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: #fff;
  border-radius: 2px;
  transition: transform .35s ease, opacity .25s ease;
  transform-origin: center;
}

/* X state */
.nav-toggle.active span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.nav-toggle.active span:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}

.nav-toggle.active span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* ---------------------------------------------------------
   7. Hero
   --------------------------------------------------------- */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  background: linear-gradient(90deg, rgba(0, 0, 0, 0.75) 0%, rgba(0, 0, 0, 0.55) 45%, rgba(0, 0, 0, 0.25) 100%), url('../img/landingpage.jpg') center / cover no-repeat;
  padding-top: var(--header-h);
  color: #fff;
}

.hero-inner {
  display: block;
}

.hero-content {
  max-width: 640px;
  color: #fff;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.5);
}

.hero-content h1,
.hero-content .eyebrow,
.hero-content .hero-desc {
  color: #fff;
}

.hero .btn-outline {
  color: #fff;
  border-color: #fff;
  text-shadow: none;
}

.hero .btn-outline:hover {
  background: #fff;
  color: var(--green-dark);
}

.hero-content h1 {
  margin-bottom: 1.25rem;
}

.hero-content p {
  font-size: 1.05rem;
  margin-bottom: 2rem;
}

.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

.hero-media {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Placeholder blocks used before real images are dropped in */
.hero-placeholder,
.image-placeholder {
  width: 100%;
  background: linear-gradient(135deg, var(--green) 0%, var(--green-dark) 100%);
  border-radius: var(--radius);
}

.hero-placeholder {
  aspect-ratio: 4 / 3;
  min-height: 300px;
}

.image-placeholder {
  aspect-ratio: 16 / 9;
}

/* Real images */
.hero-img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: var(--radius);
  min-height: 300px;
}

.about-img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: var(--radius);
}

.portfolio-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .4s ease;
}

.portfolio-item:hover .portfolio-img {
  transform: scale(1.05);
}

/* ---------------------------------------------------------
   8. O nás (About)
   --------------------------------------------------------- */
#o-nas {
  background: var(--white);
}

.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  align-items: center;
}

.about-content h2 {
  margin-bottom: 1rem;
}

.about-content p {
  margin-bottom: 1rem;
}

.about-content p:last-child {
  margin-bottom: 0;
}

.stats-panel {
  background: var(--green-dark);
  padding: 2rem 0;
}

.stats-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2.5rem;
}

.stat-item {
  text-align: center;
}

.stat-divider {
  width: 1px;
  height: 40px;
  background: rgba(255, 255, 255, .2);
}

.stat-number {
  font-size: 2rem;
  font-weight: 700;
  color: #fff;
  line-height: 1;
  display: block;
  margin-bottom: .25rem;
}

.stat-number.accent {
  color: var(--copper);
}

.stat-label {
  font-size: .85rem;
  color: rgba(255, 255, 255, .7);
  font-weight: 300;
}

/* ---------------------------------------------------------
   9. Služby (Services)
   --------------------------------------------------------- */
#sluzby {
  background: var(--cream);
}

.services-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.service-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 36px 28px;
  transition: transform var(--transition), box-shadow var(--transition);
  box-shadow: var(--shadow-sm);
}

.service-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
}

.service-icon {
  width: 48px;
  height: 48px;
  margin-bottom: 1.25rem;
  color: var(--copper);
  flex-shrink: 0;
}

.service-card h3 {
  margin-bottom: .6rem;
}

.service-card p {
  font-size: .9rem;
}

/* ---------------------------------------------------------
   10. Reference (Portfolio)
   --------------------------------------------------------- */
#reference {
  background: var(--white);
}

.portfolio-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.portfolio-item {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  aspect-ratio: 4 / 3;
  background: var(--green);
  cursor: pointer;
}

.portfolio-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .45s ease;
}

.portfolio-item:hover img {
  transform: scale(1.08);
}

.portfolio-overlay {
  position: absolute;
  inset: 0;
  background: rgba(30, 58, 47, .78);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 24px;
  opacity: 0;
  transition: opacity .35s ease;
  gap: 8px;
}

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

.portfolio-overlay h3 {
  color: var(--white);
  font-size: 1rem;
}

.portfolio-overlay p {
  color: rgba(255,255,255,.75);
  font-size: .85rem;
}

/* ---------------------------------------------------------
   11. Poptávka (Inquiry / Contact Form)
   --------------------------------------------------------- */
#poptavka {
  background: var(--cream);
}

.inquiry-form {
  max-width: 680px;
  margin-inline: auto;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
}

.form-group label {
  font-size: .85rem;
  font-weight: 600;
  color: var(--green-dark);
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-family: inherit;
  font-size: .9rem;
  color: var(--text);
  background: var(--white);
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
  appearance: none;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--copper);
  box-shadow: 0 0 0 3px rgba(200,169,110,.20);
}

.form-group textarea {
  resize: vertical;
  min-height: 130px;
}

.form-submit {
  margin-top: 8px;
}

.form-success {
  display: none;
  background: var(--green);
  color: var(--white);
  border-radius: var(--radius);
  padding: 16px 24px;
  text-align: center;
  font-weight: 600;
  margin-top: 16px;
}

.form-success.visible {
  display: block;
}

/* ---------------------------------------------------------
   12. Kontakt (Contact)
   --------------------------------------------------------- */
#kontakt {
  background: var(--green-dark);
  color: var(--white);
}

#kontakt h2 {
  color: var(--white);
}

#kontakt p {
  color: rgba(255,255,255,.72);
}

.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  align-items: start;
}

.contact-details {
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.contact-item label {
  display: block;
  text-transform: uppercase;
  font-size: .75rem;
  letter-spacing: 1.5px;
  font-weight: 600;
  color: var(--copper);
  margin-bottom: 4px;
}

.contact-item a,
.contact-item address {
  font-style: normal;
  color: var(--white);
  font-size: 1rem;
  transition: color var(--transition);
}

.contact-item a:hover {
  color: var(--copper);
}

.map-placeholder {
  width: 100%;
  aspect-ratio: 4 / 3;
  background: rgba(255,255,255,.10);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255,255,255,.5);
  font-size: .9rem;
}

/* ---------------------------------------------------------
   13. Footer
   --------------------------------------------------------- */
footer {
  background: var(--footer-bg);
  color: rgba(255,255,255,.6);
  padding: 28px 0;
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.footer-inner p {
  font-size: .85rem;
  color: rgba(255,255,255,.6);
}

.footer-logo {
  font-weight: 700;
  font-size: 1rem;
  color: rgba(255,255,255,.85);
}

.footer-logo span {
  color: var(--copper);
}

.scroll-top {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,.2);
  color: rgba(255,255,255,.6);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition), border-color var(--transition), color var(--transition);
  flex-shrink: 0;
}

.scroll-top:hover {
  background: var(--copper);
  border-color: var(--copper);
  color: var(--white);
}

/* ---------------------------------------------------------
   14. Lightbox
   --------------------------------------------------------- */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.92);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px;
}

.lightbox[hidden] {
  display: none;
}

.lightbox-content {
  position: relative;
  width: 100%;
  max-width: 1600px;
  max-height: 95vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
}

.lightbox-image-wrap {
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
}

.lightbox-content img {
  border-radius: var(--radius);
  width: auto;
  max-width: 100%;
  max-height: 80vh;
  object-fit: contain;
  box-shadow: var(--shadow-lg);
}

.lightbox-caption {
  color: var(--white);
  text-align: center;
  font-size: 1.05rem;
  line-height: 1.5;
  max-width: 900px;
  margin: 0;
  padding: 0 12px;
  text-shadow: 0 1px 4px rgba(0,0,0,.5);
}

.lightbox-close {
  position: absolute;
  top: -44px;
  right: 0;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255,255,255,.15);
  color: var(--white);
  font-size: 1.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition);
  z-index: 1;
}

.lightbox-close:hover {
  background: rgba(255,255,255,.30);
}

@media (max-width: 640px) {
  .lightbox { padding: 16px; }
  .lightbox-content img { max-height: 72vh; }
  .lightbox-caption { font-size: 0.95rem; }
}

/* ---------------------------------------------------------
   15. Fade-in animation
   --------------------------------------------------------- */
.fade-in-el {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity .6s ease, transform .6s ease;
}

.fade-in-el.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ---------------------------------------------------------
   16. Responsive — 1024px breakpoint
   --------------------------------------------------------- */
@media (max-width: 1024px) {
  .services-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .portfolio-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .hero-inner {
    gap: 40px;
  }

  .about-grid {
    gap: 40px;
  }
}

/* ---------------------------------------------------------
   17. Responsive — 768px breakpoint (mobile)
   --------------------------------------------------------- */
@media (max-width: 768px) {
  /* Nav: slide-in panel from the right */
  .nav {
    position: fixed;
    top: 0;
    right: -100%;
    width: min(80vw, 300px);
    height: 100vh;
    background: var(--white);
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: 32px;
    padding: 40px 32px;
    box-shadow: -4px 0 24px rgba(0,0,0,.12);
    transition: right .35s cubic-bezier(.4,0,.2,1);
    z-index: 999;
  }

  .nav.open {
    right: 0;
  }

  .nav a {
    font-size: 1.1rem;
    font-weight: 600;
  }

  .nav .btn {
    width: 100%;
    justify-content: center;
    padding: 12px 24px;
    font-size: .95rem;
  }

  /* Toggle button visible */
  .nav-toggle {
    display: flex;
    z-index: 1001;
  }

  /* Overlay behind nav panel */
  .nav-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.4);
    z-index: 998;
  }

  .nav-overlay.active {
    display: block;
  }

  /* Section padding */
  .section {
    padding: 60px 0;
  }

  /* Hero */
  .hero-inner {
    grid-template-columns: 1fr;
    text-align: center;
    gap: 40px;
  }

  .hero-content {
    max-width: 100%;
    order: 2;
  }

  .hero-media {
    order: 1;
  }

  .hero-cta {
    justify-content: center;
  }

  /* About */
  .about-grid {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  .stats-inner {
    gap: 1.5rem;
  }

  .stat-number {
    font-size: 1.5rem;
  }

  /* Services */
  .services-grid {
    grid-template-columns: 1fr;
  }

  /* Portfolio */
  .portfolio-grid {
    grid-template-columns: 1fr;
  }

  /* Form */
  .form-row {
    grid-template-columns: 1fr;
  }

  /* Contact */
  .contact-grid {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  /* Footer */
  .footer-inner {
    flex-direction: column;
    text-align: center;
    gap: 12px;
  }
}

/* Extra-small screens */
@media (max-width: 400px) {
  .stats-inner {
    flex-direction: column;
    gap: 1rem;
  }

  .stat-divider {
    width: 60px;
    height: 1px;
  }

  .hero-cta {
    flex-direction: column;
  }

  .hero-cta .btn {
    width: 100%;
    justify-content: center;
  }
}
