/*
Theme Name: Khalabuzar Photography
Description: Minimal photography theme for khalabuzar.com — full-screen slider, masonry galleries, blog.
Version: 1.1
Requires PHP: 7.4
Text Domain: khalabuzar
*/

:root {
  --kh-text: #222;
  --kh-muted: #777;
  --kh-line: #e6e6e6;
  --kh-bg: #fff;
  --kh-soft: #fafafa;
  --kh-serif: "Playfair Display", Georgia, "Times New Roman", serif;
  --kh-body: "Lora", Georgia, serif;
  --kh-wrap: 1240px;
  --kh-gap: 36px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--kh-bg);
  color: var(--kh-text);
  font-family: var(--kh-body);
  font-size: 15px;
  line-height: 1.9;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; transition: opacity .2s, color .2s; }
a:hover { opacity: .7; }
.entry-content a { text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
h1, h2, h3, h4, h5, h6 { font-family: var(--kh-serif); font-weight: 400; line-height: 1.3; margin: 1.6em 0 .6em; }
.screen-reader-text { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(1px,1px,1px,1px); }

.kh-wrap { max-width: var(--kh-wrap); margin: 0 auto; padding: 0 30px; }
.kh-narrow { max-width: 780px; margin: 0 auto; padding: 0 24px; }

/* ---------- Header ---------- */
.kh-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255,255,255,.97);
  border-bottom: 1px solid transparent;
}
.kh-header__inner { display: flex; align-items: center; justify-content: space-between; height: 76px; padding: 0 30px; }
.kh-logo {
  font-family: var(--kh-serif); font-weight: 600; font-size: 19px;
  letter-spacing: .14em; text-transform: uppercase; color: #3a3d44; white-space: nowrap;
}
.kh-logo span { margin-left: .5em; }
.kh-burger {
  background: none; border: 0; cursor: pointer; padding: 10px; margin-right: -10px;
  display: flex; flex-direction: column; gap: 4px;
}
.kh-burger i { display: block; width: 18px; height: 1.5px; background: #333; transition: transform .3s, opacity .3s; }
.kh-menu-open .kh-burger i:nth-child(1) { transform: translateY(5.5px) rotate(45deg); }
.kh-menu-open .kh-burger i:nth-child(2) { opacity: 0; }
.kh-menu-open .kh-burger i:nth-child(3) { transform: translateY(-5.5px) rotate(-45deg); }

.kh-nav {
  position: fixed; inset: 76px 0 0 0; background: #fff; z-index: 49;
  display: flex; align-items: center; justify-content: center;
  opacity: 0; visibility: hidden; transition: opacity .35s, visibility .35s;
}
.kh-menu-open .kh-nav { opacity: 1; visibility: visible; }
.kh-menu-open { overflow: hidden; }
.kh-nav ul { list-style: none; margin: 0; padding: 0; text-align: center; }
.kh-nav li { margin: 0; }
.kh-nav a {
  display: inline-block; padding: 9px 0;
  font-family: var(--kh-serif); font-size: 15px; letter-spacing: .22em; text-transform: uppercase;
}
.kh-nav .sub-menu { margin: 0 0 6px; }
.kh-nav .sub-menu a { font-size: 12px; letter-spacing: .2em; color: var(--kh-muted); padding: 4px 0; }
.kh-nav .current-menu-item > a { color: var(--kh-muted); }

/* ---------- Hero slider ---------- */
.kh-hero { position: relative; height: calc(100vh - 76px); min-height: 420px; overflow: hidden; background: #111; }
.kh-hero__slide {
  position: absolute; inset: 0; background-size: cover; background-position: center;
  opacity: 0; transition: opacity 1.4s ease;
}
.kh-hero__slide.is-active { opacity: 1; }
.kh-hero__arrows { position: absolute; right: 26px; bottom: 22px; display: flex; gap: 6px; z-index: 2; }
.kh-hero__arrows button, .kh-hero__down {
  background: none; border: 0; color: #fff; cursor: pointer; padding: 8px; opacity: .85;
}
.kh-hero__arrows button:hover, .kh-hero__down:hover { opacity: 1; }
.kh-hero__down { position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%); z-index: 2; }
.kh-hero svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 1.6; }

/* ---------- Gallery grid (series / categories) ---------- */
.kh-section { padding: 70px 0; }
.kh-section + .kh-section { border-top: 1px solid var(--kh-line); }
.kh-section-title {
  text-align: center; font-family: var(--kh-serif); font-size: 13px; letter-spacing: .3em;
  text-transform: uppercase; margin: 0 0 46px; font-weight: 600;
}
.kh-grid { columns: 4 240px; column-gap: var(--kh-gap); }
.kh-card { break-inside: avoid; margin: 0 0 var(--kh-gap); display: block; }
.kh-card__img { background: var(--kh-soft); overflow: hidden; }
.kh-card__img img { width: 100%; transition: transform .8s ease; }
.kh-card:hover { opacity: 1; }
.kh-card:hover .kh-card__img img { transform: scale(1.03); }
.kh-card__title { text-align: center; font-family: var(--kh-serif); font-size: 14px; margin: 16px 0 0; letter-spacing: .02em; }

/* ---------- Single gallery ---------- */
.kh-gallery-head { text-align: center; padding: 56px 0 34px; }
.kh-gallery-head h1 { font-size: 26px; margin: 0; letter-spacing: .04em; }
.kh-gallery-head p { color: var(--kh-muted); margin: 10px 0 0; }
.kh-gallery-body { max-width: 1160px; margin: 0 auto; padding: 0 30px 40px; }
.kh-gallery-body .wp-block-gallery { margin: 0 0 10px !important; gap: 10px !important; flex-wrap: nowrap !important; }
.kh-gallery-body .wp-block-gallery.has-nested-images figure.wp-block-image { margin: 0 !important; flex: 1 1 0 !important; width: auto !important; }
.kh-gallery-body .wp-block-gallery figure.wp-block-image img { width: 100%; height: 100% !important; object-fit: cover; }
.kh-gallery-body .wp-block-gallery figure.wp-block-image a { display: block; height: 100%; }
.kh-gallery-body > .wp-block-group, .kh-gallery-body > p { max-width: 780px; margin-left: auto; margin-right: auto; }
.kh-gallery-nav { display: flex; justify-content: space-between; gap: 20px; padding: 30px; max-width: 1160px; margin: 0 auto 30px; border-top: 1px solid var(--kh-line); font-family: var(--kh-serif); font-size: 13px; letter-spacing: .12em; text-transform: uppercase; }

/* ---------- Lightbox ---------- */
.kh-lb { position: fixed; inset: 0; background: rgba(255,255,255,.98); z-index: 100; display: none; align-items: center; justify-content: center; }
.kh-lb.is-open { display: flex; }
.kh-lb img { max-width: 92vw; max-height: 90vh; width: auto; height: auto; }
.kh-lb button { position: absolute; background: none; border: 0; font-size: 30px; line-height: 1; cursor: pointer; padding: 18px; color: #333; font-family: var(--kh-serif); }
.kh-lb__close { top: 6px; right: 10px; }
.kh-lb__prev { left: 6px; top: 50%; transform: translateY(-50%); }
.kh-lb__next { right: 6px; top: 50%; transform: translateY(-50%); }

/* ---------- Content / pages ---------- */
.kh-page { padding: 60px 0 70px; }
.kh-page-title { text-align: center; font-size: 13px; letter-spacing: .3em; text-transform: uppercase; font-weight: 600; margin: 0 0 46px; }
.entry-content > * { margin-top: 0; margin-bottom: 1.2em; }
.entry-content .wp-block-image { margin-bottom: 1.6em; }
.entry-content .wp-block-separator { border: 0; border-top: 1px solid var(--kh-line); margin: 60px auto; max-width: 100%; }
.has-text-align-center { text-align: center; }
.entry-content .wp-block-columns { gap: 50px; align-items: center; }
.entry-content .wp-block-gallery { gap: 10px; }

/* About block (3 columns) */
.kh-about h3 { font-size: 13px; font-style: italic; letter-spacing: .25em; text-transform: uppercase; text-align: center; margin: 0 0 22px; }
.kh-about p { font-size: 14px; line-height: 2.1; }

/* Reviews */
.kh-review { margin: 0 0 70px; }
.kh-review .wp-block-image img { margin: 0 auto; }
.kh-review__name { text-align: center; font-family: var(--kh-serif); font-style: italic; letter-spacing: .08em; }

/* Forms (Contact Form 7) */
.wpcf7 { max-width: 560px; margin: 0 auto; }
.wpcf7 label { display: block; font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--kh-muted); }
.wpcf7 input[type=text], .wpcf7 input[type=email], .wpcf7 textarea {
  width: 100%; border: 0; border-bottom: 1px solid #cfcfcf; padding: 10px 0; margin-top: 4px;
  font: inherit; font-size: 15px; background: transparent; color: var(--kh-text); border-radius: 0;
}
.wpcf7 textarea { height: 120px; resize: vertical; }
.wpcf7 input:focus, .wpcf7 textarea:focus { outline: none; border-bottom-color: #333; }
.wpcf7 input[type=submit] {
  background: #111; color: #fff; border: 0; padding: 14px 44px; cursor: pointer;
  font-family: var(--kh-serif); letter-spacing: .25em; text-transform: uppercase; font-size: 12px; margin-top: 10px;
}
.wpcf7 input[type=submit]:hover { background: #444; }
.wpcf7 p { text-align: left; }
.wpcf7-form > p:last-of-type { text-align: center; }

/* ---------- Blog ---------- */
.kh-blog-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 56px var(--kh-gap); }
.kh-post-card__img { margin-bottom: 18px; background: var(--kh-soft); aspect-ratio: 4/3; overflow: hidden; }
.kh-post-card__img img { width: 100%; height: 100%; object-fit: cover; }
.kh-post-card h2 { font-size: 20px; margin: 0 0 12px; }
.kh-post-card__tags { font-size: 12px; color: var(--kh-muted); letter-spacing: .03em; margin-bottom: 12px; line-height: 1.7; }
.kh-post-card__more { font-size: 12px; letter-spacing: .2em; text-transform: uppercase; border-bottom: 1px solid currentColor; }
.kh-pagination { display: flex; justify-content: center; gap: 8px; margin-top: 70px; font-family: var(--kh-serif); }
.kh-pagination .page-numbers { padding: 6px 12px; }
.kh-pagination .current { border-bottom: 1px solid #333; }

.kh-single-head { text-align: center; padding: 60px 0 30px; }
.kh-single-head h1 { font-size: 34px; margin: 0 0 14px; }
.kh-single-head .kh-meta { color: var(--kh-muted); font-size: 13px; }
.single .entry-content { font-size: 16px; }
.single .entry-content h1 { font-size: 30px; }
.single .entry-content h2 { font-size: 24px; }
.single .entry-content h3 { font-size: 19px; }
.kh-post-tags { margin: 50px 0 0; padding-top: 24px; border-top: 1px solid var(--kh-line); font-size: 13px; color: var(--kh-muted); }
.kh-post-tags a { margin-right: 10px; }

/* ---------- Footer ---------- */
.kh-footer { text-align: center; padding: 50px 20px 40px; border-top: 1px solid var(--kh-line); font-size: 12px; letter-spacing: .05em; color: #555; }
.kh-footer__site { font-size: 10px; letter-spacing: .35em; text-transform: uppercase; margin-bottom: 28px; color: var(--kh-muted); }
.kh-footer__ig { display: inline-block; margin-bottom: 14px; }
.kh-footer__ig svg { width: 20px; height: 20px; }
.kh-top { background: none; border: 0; cursor: pointer; display: block; margin: 0 auto 26px; padding: 6px; color: #333; }
.kh-top svg { width: 14px; height: 14px; stroke: currentColor; fill: none; stroke-width: 1.6; }

@media (max-width: 960px) {
  .kh-blog-grid { grid-template-columns: repeat(2, 1fr); }
  .kh-grid { columns: 3 200px; }
}
@media (max-width: 640px) {
  :root { --kh-gap: 20px; }
  .kh-header__inner { height: 64px; padding: 0 18px; }
  .kh-nav { inset: 64px 0 0 0; }
  .kh-hero { height: calc(100vh - 64px); }
  .kh-logo { font-size: 15px; }
  .kh-wrap { padding: 0 18px; }
  .kh-grid { columns: 2; }
  .kh-blog-grid { grid-template-columns: 1fr; }
  .kh-gallery-body { padding: 0 10px 30px; }
  .kh-gallery-body .wp-block-gallery { flex-wrap: wrap !important; }
  .kh-gallery-body .wp-block-gallery.has-nested-images figure.wp-block-image { flex: 1 1 100% !important; }
  .entry-content .wp-block-columns { gap: 30px; }
  .kh-single-head h1 { font-size: 26px; }
}

/* Front page blocks */
.entry-content .kh-section-title { margin-bottom: 46px; }
.kh-touch-title { font-family: var(--kh-serif); font-size: 13px; letter-spacing: .3em; text-transform: uppercase; font-weight: 600; margin-bottom: 10px !important; }
.kh-touch { align-items: center !important; }
.entry-content .kh-touch-title { font-size: 34px; letter-spacing: 0; text-transform: none; font-weight: 400; margin: 0 0 18px !important; color: #555; }
.kh-touch { align-items: flex-start !important; }
.kh-touch > .wp-block-column:first-child { flex-basis: 46% !important; padding-top: 30px; }
.kh-touch > .wp-block-column:nth-child(2) { margin-top: 70px; }
.kh-touch .wpcf7 { margin: 0; }
.kh-about > .wp-block-column:nth-child(2) img { margin: 0 auto; max-height: 520px; width: auto; }
@media (max-width: 781px) { .kh-touch > .wp-block-column:nth-child(2) { margin-top: 0; } }
.kh-gallery-body .wp-block-gallery.columns-1 img { max-height: 94vh; width: auto !important; max-width: 100%; margin: 0 auto; object-fit: contain; }
.kh-touch .wpcf7-form p, .kh-touch .wpcf7-form > p:last-of-type { text-align: left; }
/* JS masonry: keeps left-to-right order like the old site */
.kh-grid.is-masonry { columns: auto; display: flex; gap: var(--kh-gap); align-items: flex-start; }
.kh-grid__col { flex: 1 1 0; min-width: 0; }
