/*
Theme Name: Kišmetović Varilstvo (Gutenberg)
Description: Bespoke theme, page content authored as native Gutenberg blocks for genuine wp-admin editability.
Author: Spletni Paketi
Version: 1.0
*/

/* =========================================================
   Varilske storitve, Admir Kišmetović, s.p. — Site Styles
   ========================================================= */

/* This WP core version wraps Group block children in an extra
   .wp-block-group__inner-container div. That breaks any flex/grid
   layout declared directly on the .wp-block-group element, since the
   actual children end up one level deeper. Making the wrapper
   "disappear" from layout keeps our flex/grid rules working exactly
   as if the real children were direct children of the group. */
.wp-block-group > .wp-block-group__inner-container { display: contents; }

:root {
  --color-primary: #1B4F72;      /* modra */
  --color-secondary: #2E86C1;    /* sinje modra */
  --color-gray: #566573;         /* siva */
  --color-gray-light: #AEB6BF;
  --color-bg: #FFFFFF;
  --color-bg-alt: #F4F6F7;
  --color-text: #1C2833;
  --color-border: #E2E6E9;

  --font-heading: 'Montserrat', Arial, sans-serif;
  --font-body: 'Inter', Arial, sans-serif;

  --radius: 10px;
  --shadow: 0 4px 18px rgba(27, 79, 114, 0.08);
  --container-width: 1140px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--color-text);
  background: var(--color-bg);
  line-height: 1.6;
}

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

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

h1, h2, h3, h4 {
  font-family: var(--font-heading);
  color: var(--color-primary);
  line-height: 1.2;
  margin: 0 0 16px;
}

h1 { font-size: clamp(2rem, 4vw, 2.8rem); }
h2 { font-size: clamp(1.6rem, 3vw, 2.1rem); }
h3 { font-size: 1.25rem; }

p { margin: 0 0 16px; color: var(--color-gray); }

.container {
  max-width: var(--container-width);
  margin: 0 auto;
  padding: 0 24px;
}

/* Classic-theme alignfull/alignwide breakout (no theme.json/FSE) */
.alignfull {
  width: 100vw;
  max-width: 100vw;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
}
.alignwide { max-width: 1400px; margin-left: auto; margin-right: auto; }

.section { padding: 72px 24px; max-width: var(--container-width); margin: 0 auto; }
.section-alt { background: var(--color-bg-alt); }
/* .section is align:full so its own box can bleed full-bleed for the
   background color; the actual content is wrapped in a real nested
   .container Group block (see content markup) which re-applies the
   1140px cap + centering, same as .container everywhere else on the
   site. This is more reliable than trying to reach through WP's
   .wp-block-group__inner-container wrapper with CSS, since that
   wrapper is set to display:contents and can't carry box-model rules. */
.section.alignfull { max-width: none; padding-left: 24px; padding-right: 24px; }

.section-header { text-align: center; max-width: 680px; margin: 0 auto 48px; }
.section-header p { color: var(--color-gray); }

.eyebrow {
  display: inline-block;
  font-family: var(--font-heading);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--color-secondary);
  margin-bottom: 10px;
}

/* Buttons — styled on WordPress's own core/button markup */
.wp-block-button__link,
.wp-element-button {
  display: inline-block;
  font-family: var(--font-heading) !important;
  font-weight: 600;
  font-size: 0.95rem !important;
  padding: 15px 32px !important;
  border-radius: 999px !important;
  cursor: pointer;
  border: 2px solid transparent;
  background: var(--color-secondary);
  color: #fff !important;
  transition: all 0.2s ease;
}
.wp-block-button__link:hover { background: var(--color-primary); }
.is-style-outline .wp-block-button__link {
  background: transparent !important;
  border-color: #fff;
  color: #fff !important;
}
.is-style-outline .wp-block-button__link:hover { background: rgba(255,255,255,0.15) !important; }
.wp-block-buttons { gap: 16px; margin-top: 8px; }

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255,255,255,0.97);
  border-bottom: 1px solid var(--color-border);
  /* backdrop-filter is applied via ::before, not directly on .site-header,
     because filter/backdrop-filter on an element creates a new containing
     block for any position:fixed descendant. .main-nav (the mobile nav
     panel) is fixed and lives inside this header, so a filter here would
     clip its full-height fixed positioning down to the header's own
     ~80px box instead of the viewport - cutting the dropdown off. */
}
.site-header::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}
.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 82px;
}
.logo img,
.logo .custom-logo { height: 44px; width: auto; }
.logo .custom-logo-link { display: block; }

.main-nav {
  display: flex;
  align-items: center;
  gap: 36px;
  list-style: none;
  margin: 0;
  padding: 0;
}
.main-nav li {
  list-style: none;
  margin: 0;
  padding: 0;
}
.main-nav a {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--color-primary);
  padding: 8px 0;
  border-bottom: 2px solid transparent;
}
.main-nav a:hover,
.main-nav a.active,
.main-nav .current-menu-item > a { border-color: var(--color-secondary); color: var(--color-secondary); }

.main-nav .nav-cta > a {
  background: var(--color-secondary);
  color: #fff !important;
  padding: 12px 24px;
  border-radius: 999px;
  border-bottom: none !important;
}
.main-nav .nav-cta > a:hover { background: var(--color-primary); }

.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
}
.nav-toggle span {
  display: block;
  width: 26px;
  height: 3px;
  margin: 5px 0;
  background: var(--color-primary);
  border-radius: 2px;
}

/* Hero — core/cover block */
.hero.wp-block-cover {
  color: #fff;
  min-height: 560px;
  display: flex;
  align-items: center;
}
.hero.wp-block-cover .wp-block-cover__background {
  background: linear-gradient(120deg, rgba(27,79,114,0.92) 20%, rgba(27,79,114,0.55) 100%) !important;
  opacity: 1 !important;
}
.hero.wp-block-cover .wp-block-cover__image-background { object-fit: cover; }
.hero .wp-block-cover__inner-container { max-width: 680px; margin: 0 auto; width: 100%; padding: 0 24px; }
.hero h1 { color: #fff; }
.hero p.lead { color: #EAF1F7; font-size: 1.15rem; max-width: 540px; }

.page-hero {
  background: linear-gradient(120deg, var(--color-primary), var(--color-secondary));
  color: #fff;
  padding: 64px 24px;
  text-align: center;
}
.page-hero h1 { color: #fff; margin-bottom: 8px; }
.page-hero p { color: #EAF1F7; margin: 0; max-width: 680px; margin-left: auto; margin-right: auto; }

/* Cards grid — core/columns with className "grid" */
.grid.wp-block-columns {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
}
.card.wp-block-column {
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  padding: 0;
}
.card .wp-block-image { margin: 0; }
.card .wp-block-image img { height: 200px; object-fit: cover; width: 100%; }
.card-body { padding: 24px; flex: 1; display: flex; flex-direction: column; }
.card-body h3 { margin-bottom: 8px; }
.card-body p { flex: 1; }
.card-link {
  font-family: var(--font-heading);
  font-weight: 600;
  color: var(--color-secondary);
  font-size: 0.9rem;
}
.card-link:hover { color: var(--color-primary); }

/* About / trust */
.about-flex.wp-block-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: center;
}
.about-flex .wp-block-image img { border-radius: var(--radius); box-shadow: var(--shadow); }

.trust-points {
  list-style: none;
  padding: 0;
  margin: 24px 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.trust-points li {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  font-weight: 500;
  color: var(--color-text);
}
.trust-points li::before {
  content: "✓";
  flex-shrink: 0;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--color-secondary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 700;
}

.stat-row {
  display: flex;
  gap: 40px;
  margin-top: 32px;
  margin-bottom: 28px;
  flex-wrap: wrap;
}
.stat-row .stat-num {
  font-family: var(--font-heading);
  font-size: 2rem;
  font-weight: 700;
  color: var(--color-primary);
  display: block;
  margin: 0;
}
.stat-row .stat-label { color: var(--color-gray); font-size: 0.9rem; margin: 0; }

/* Services detail */
.service-detail.wp-block-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: center;
  padding: 56px 0;
  border-bottom: 1px solid var(--color-border);
}
.service-detail:last-child { border-bottom: none; }
.service-detail .wp-block-image img { border-radius: var(--radius); box-shadow: var(--shadow); }
.service-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--color-bg-alt);
  color: var(--color-secondary);
  font-family: var(--font-heading);
  font-weight: 700;
  margin-bottom: 16px;
}

/* Gallery — core/gallery block */
.gallery-grid.wp-block-gallery {
  display: grid !important;
  grid-template-columns: repeat(4, 1fr) !important;
  gap: 14px !important;
}
.gallery-grid img {
  border-radius: 8px;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  cursor: pointer;
  transition: transform 0.2s ease;
  width: 100%;
}
.gallery-grid img:hover { transform: scale(1.03); }
/* Core Gallery block (has-nested-images / is-layout-flex) sizes each
   figure to 50% width by default (its own 2-up flex layout). Since we
   put the real gallery on a 4-col CSS Grid instead, force every figure
   to fill its grid cell so there's no leftover gap inside each cell. */
.gallery-grid.wp-block-gallery figure.wp-block-image,
.gallery-grid .wp-block-image {
  width: 100% !important;
  margin: 0 !important;
}

.lightbox {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(10, 20, 30, 0.92);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 32px;
}
.lightbox.open { display: flex; }
.lightbox img { max-width: 90vw; max-height: 85vh; border-radius: 8px; }
.lightbox-close {
  position: absolute;
  top: 24px; right: 32px;
  color: #fff;
  font-size: 2rem;
  cursor: pointer;
  background: none;
  border: none;
}
.lightbox-prev,
.lightbox-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  color: #fff;
  font-size: 2.5rem;
  line-height: 1;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.12);
  border: none;
  border-radius: 50%;
  width: 52px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease;
}
.lightbox-prev:hover,
.lightbox-next:hover { background: rgba(255, 255, 255, 0.25); }
.lightbox-prev { left: 24px; }
.lightbox-next { right: 24px; }
@media (max-width: 640px) {
  .lightbox-prev, .lightbox-next { width: 40px; height: 40px; font-size: 1.8rem; }
  .lightbox-prev { left: 8px; }
  .lightbox-next { right: 8px; }
}
.lightbox-counter {
  position: absolute;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  color: #EAF1F7;
  font-size: 0.85rem;
  letter-spacing: 0.02em;
}

/* Bottom CTA block — core/group */
.cta-block {
  background: var(--color-primary);
  color: #fff;
  text-align: center;
  padding: 56px 24px;
}
.cta-block h2 { color: #fff; margin-bottom: 8px; }
.cta-block p { color: #EAF1F7; margin: 0 auto 24px; max-width: 600px; }

/* Contact */
.contact-grid.wp-block-columns {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 48px;
}
.contact-info-item {
  display: flex;
  gap: 16px;
  margin-bottom: 24px;
}
.contact-info-item .icon {
  width: 44px; height: 44px;
  border-radius: 50%;
  background: var(--color-bg-alt);
  color: var(--color-secondary);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  font-size: 1.2rem;
}
.contact-info-item h4 { margin: 0 0 4px; color: var(--color-text); font-size: 1rem; }
.contact-info-item p { margin: 0; }

.map-embed {
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  margin-top: 8px;
}
.map-embed iframe { width: 100%; height: 260px; border: 0; display: block; }

.form-card {
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 40px;
}
.form-card .wpcf7-form-control-wrap { display: block; margin-bottom: 20px; }
.form-card p { margin-bottom: 0; }
.form-card label { display: block; font-weight: 600; font-size: 0.9rem; margin-bottom: 6px; color: var(--color-text); }
.form-card input[type=text],
.form-card input[type=tel],
.form-card input[type=email],
.form-card select,
.form-card textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  font-family: var(--font-body);
  font-size: 0.95rem;
  background: var(--color-bg-alt);
}
.form-card input:focus, .form-card select:focus, .form-card textarea:focus {
  outline: none;
  border-color: var(--color-secondary);
  background: #fff;
}
.form-card input[type=submit] {
  width: 100%;
  background: var(--color-secondary);
  color: #fff;
  border: none;
  font-family: var(--font-heading);
  font-weight: 600;
  padding: 15px 32px;
  border-radius: 999px;
  cursor: pointer;
}
.form-card input[type=submit]:hover { background: var(--color-primary); }
.form-note { font-size: 0.85rem; color: var(--color-gray); margin-top: 16px; }
.wpcf7-not-valid-tip { color: #c0392b; font-size: 0.8rem; margin-top: 4px; }
.wpcf7-response-output { border-radius: 8px !important; margin: 20px 0 0 !important; }

/* Footer */
.site-footer {
  background: #10222f;
  color: #B9C4CC;
  padding: 40px 0 0;
  font-size: 0.9rem;
}
.footer-flex {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  padding-bottom: 28px;
}
.footer-flex a:hover { color: #fff; }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.08);
  padding: 16px 0;
  text-align: center;
  font-size: 0.8rem;
  color: #7C8894;
}

/* Cookie banner */
.cookie-banner {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: #10222f;
  color: #EAF1F7;
  padding: 18px 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  flex-wrap: wrap;
  z-index: 999;
  font-size: 0.9rem;
  transform: translateY(120%);
  transition: transform 0.3s ease;
}
.cookie-banner.show { transform: translateY(0); }
.cookie-banner .wp-block-button__link { padding: 10px 22px !important; font-size: 0.85rem !important; }

/* Responsive */
@media (max-width: 900px) {
  .grid.wp-block-columns { grid-template-columns: repeat(2, 1fr); }
  .about-flex.wp-block-columns, .contact-grid.wp-block-columns, .service-detail.wp-block-columns { grid-template-columns: 1fr; }
  .gallery-grid.wp-block-gallery { grid-template-columns: repeat(3, 1fr) !important; }
}

@media (max-width: 760px) {
  .main-nav { position: fixed; top: 82px; left: 0; right: 0; bottom: 0; background: #fff; flex-direction: column; align-items: flex-start; padding: 32px 24px; gap: 24px; transform: translateX(100%); transition: transform 0.25s ease; overflow-y: auto; }
  .main-nav.open { transform: translateX(0); }
  .nav-toggle { display: block; }
  .grid.wp-block-columns { grid-template-columns: 1fr; }
  .gallery-grid.wp-block-gallery { grid-template-columns: repeat(2, 1fr) !important; }
  .form-card { padding: 28px 20px; }
  .footer-flex { flex-direction: column; text-align: center; }
}
