/*
Theme Name: Ingrid Bergér Design
Theme URI: https://www.ibergerdesign.com
Author: André Berger
Description: Minimales, galerieartiges Theme für Ingrid Bergér Design. Zweisprachig (Deutsch/Englisch) mit Polylang.
Version: 1.0.6
Requires at least: 6.0
Requires PHP: 7.4
Text Domain: ibergerdesign
*/

:root {
  --ib-green: #14352B;
  --ib-ink: #0E1015;
  --ib-text: #555555;
  --ib-line: #E5E5E5;
  --ib-soft: #F5F5F5;
  --ib-on-green: #C9D6D0;
  --ib-max: 1160px;
  --ib-pad: 40px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: #FFFFFF;
  color: var(--ib-ink);
  font-family: 'Jost', system-ui, -apple-system, 'Helvetica Neue', Arial, sans-serif;
  font-weight: 300;
  font-size: 18px;
  line-height: 1.6;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--ib-ink); text-decoration: none; }
a:hover { color: var(--ib-text); }
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--ib-green);
  outline-offset: 3px;
}
.screen-reader-text {
  position: absolute !important; width: 1px; height: 1px; overflow: hidden;
  clip: rect(1px, 1px, 1px, 1px); white-space: nowrap;
}
.skip-link:focus {
  clip: auto; width: auto; height: auto; z-index: 1000;
  top: 8px; left: 8px; padding: 12px 18px; background: #FFFFFF; color: var(--ib-ink);
}

.ib-wrap { max-width: var(--ib-max); margin: 0 auto; padding-left: var(--ib-pad); padding-right: var(--ib-pad); }
.ib-kicker {
  margin: 0; font-size: 13px; letter-spacing: 0.2em; text-transform: uppercase;
  color: var(--ib-green); font-weight: 400;
}
.ib-link { font-size: 15px; font-weight: 400; color: var(--ib-green); }
.ib-link:hover { color: var(--ib-ink); }

/* Header */
.ib-header {
  padding-top: 32px; padding-bottom: 32px;
  display: flex; flex-wrap: wrap; gap: 24px; justify-content: space-between; align-items: center;
}
.ib-brand { font-size: 20px; font-weight: 500; letter-spacing: 0.18em; text-transform: uppercase; }
.ib-nav { display: flex; flex-wrap: wrap; gap: 12px 32px; align-items: center; font-size: 15px; font-weight: 400; letter-spacing: 0.04em; }
.ib-nav a[aria-current="page"] { border-bottom: 1px solid var(--ib-ink); }
.ib-lang { color: var(--ib-text); }
.ib-lang a { color: var(--ib-text); }
.ib-lang a[aria-current="true"] { color: var(--ib-ink); }

/* Mobile menu (three-line button) */
.ib-menu-toggle {
  display: none; position: relative; z-index: 102; width: 44px; height: 44px; margin-right: -10px;
  background: none; border: 0; padding: 0; cursor: pointer;
  flex-direction: column; align-items: center; justify-content: center; gap: 6px;
}
.ib-menu-toggle span { display: block; width: 24px; height: 1.5px; background: var(--ib-ink); transition: transform 0.2s ease, opacity 0.2s ease; }
.ib-menu-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7.5px) rotate(45deg); }
.ib-menu-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.ib-menu-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7.5px) rotate(-45deg); }

@media (max-width: 900px) {
  .ib-header { flex-wrap: nowrap; }
  .ib-brand { position: relative; z-index: 102; }
  .js .ib-menu-toggle { display: inline-flex; }
  .js .ib-nav {
    display: none; position: fixed; inset: 0; z-index: 101; background: #FFFFFF;
    flex-direction: column; flex-wrap: nowrap; align-items: flex-start; gap: 8px;
    padding: 120px var(--ib-pad) 48px; overflow-y: auto;
    font-size: 30px; font-weight: 300; letter-spacing: 0;
  }
  .js .ib-nav.is-open { display: flex; }
  .js .ib-nav a { padding: 6px 0; }
  .js .ib-nav .ib-lang { margin-top: 32px; font-size: 16px; font-weight: 400; letter-spacing: 0.04em; }
  .js .ib-nav .ib-lang a { padding: 10px 4px; }
  .ib-menu-open, .ib-menu-open body { overflow: hidden; }
  .ib-header { padding-top: 20px; padding-bottom: 20px; }
}

/* Footer */
.ib-footer {
  margin-top: 0; padding-top: 32px; padding-bottom: 48px; border-top: 1px solid var(--ib-line);
  display: flex; flex-wrap: wrap; gap: 16px 32px; justify-content: space-between;
  font-size: 14px; color: var(--ib-text); font-weight: 400;
}
.ib-footer a { color: var(--ib-text); }
.ib-footer a:hover { color: var(--ib-ink); }
.ib-footer-links { display: flex; flex-wrap: wrap; gap: 8px 24px; }

/* Headings */
.ib-h1 { margin: 0; font-size: clamp(36px, 4.4vw, 60px); font-weight: 300; letter-spacing: -0.02em; line-height: 1; }
.ib-h2 { margin: 0; font-size: 28px; font-weight: 300; line-height: 1.2; }

/* Front page */
.ib-intro { padding-top: 72px; padding-bottom: 56px; display: flex; flex-direction: column; gap: 28px; }
.ib-intro h1 { margin: 0; font-size: clamp(38px, 5.6vw, 76px); line-height: 1.02; font-weight: 300; letter-spacing: -0.02em; max-width: 14ch; }
.ib-triptych { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 24px; }
.ib-triptych img, .ib-grid img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; }

.ib-band { background: var(--ib-green); color: #FFFFFF; }
.ib-quote { padding-top: 160px; padding-bottom: 160px; display: flex; flex-direction: column; align-items: center; gap: 24px; text-align: center; }
.ib-quote blockquote { margin: 0; font-size: clamp(24px, 2.6vw, 34px); line-height: 1.35; font-weight: 300; max-width: 26ch; }
.ib-quote p { margin: 0; font-size: 14px; color: var(--ib-on-green); letter-spacing: 0.08em; }
.ib-spacer { height: 120px; }

.ib-section { padding-bottom: 160px; display: flex; flex-direction: column; gap: 48px; }
.ib-section-head {
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 16px;
  border-top: 1px solid var(--ib-line); padding-top: 24px;
}
.ib-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 56px 32px; }
.ib-grid a { display: flex; flex-direction: column; gap: 14px; }
.ib-grid span { font-size: 14px; color: var(--ib-text); letter-spacing: 0.06em; }

.ib-materials { background: var(--ib-soft); }
.ib-materials .ib-wrap { padding-top: 120px; padding-bottom: 120px; display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 32px; }
.ib-materials a { display: flex; flex-direction: column; gap: 20px; }
.ib-materials img { width: 100%; aspect-ratio: 1 / 1; object-fit: cover; }
.ib-materials h3 { margin: 0; font-size: 24px; font-weight: 300; }
.ib-materials p { margin: 0; font-size: 15px; color: var(--ib-text); font-weight: 400; }

.ib-about { padding-top: 160px; padding-bottom: 160px; display: flex; flex-wrap: wrap; gap: 80px; align-items: center; }
.ib-about img { flex: 1 1 380px; width: 100%; max-width: 520px; aspect-ratio: 4 / 5; object-fit: cover; }
.ib-about-text { flex: 1 1 420px; display: flex; flex-direction: column; gap: 28px; }
.ib-about-text .ib-lead { margin: 0; font-size: clamp(22px, 2.2vw, 28px); line-height: 1.4; font-weight: 300; }
.ib-about-text .ib-body { margin: 0; font-size: 18px; line-height: 1.7; color: var(--ib-text); font-weight: 400; max-width: 52ch; }

.ib-awards .ib-wrap { padding-top: 120px; padding-bottom: 120px; display: flex; flex-direction: column; gap: 56px; }
.ib-awards-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 16px; }
.ib-awards-head h2 { margin: 0; font-size: clamp(28px, 3vw, 38px); font-weight: 300; }
.ib-awards-head a { font-size: 15px; font-weight: 400; color: #FFFFFF; border-bottom: 1px solid #FFFFFF; }
.ib-awards-head a:hover { color: var(--ib-on-green); border-color: var(--ib-on-green); }
.ib-award-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 24px; }
.ib-award-card {
  background: #FFFFFF; color: var(--ib-ink); padding: 40px 32px 32px; min-height: 280px;
  display: flex; flex-direction: column; gap: 32px;
}
.ib-award-logo { height: 120px; display: flex; align-items: center; justify-content: center; }
.ib-award-logo img { max-width: 100%; object-fit: contain; }
.ib-award-meta { display: flex; flex-direction: column; gap: 6px; border-top: 1px solid var(--ib-line); padding-top: 20px; }
.ib-award-meta strong { font-size: 18px; font-weight: 400; }
.ib-award-meta span { font-size: 14px; color: var(--ib-text); letter-spacing: 0.06em; text-transform: uppercase; }
.ib-awards-note { margin: 0; font-size: 18px; line-height: 1.6; color: var(--ib-on-green); max-width: 60ch; }

/* Inner pages */
.ib-page { padding-top: 96px; padding-bottom: 160px; }
.ib-page-head { display: flex; flex-direction: column; gap: 40px; margin-bottom: 48px; }
.ib-tabs { display: flex; flex-wrap: wrap; gap: 12px; border-bottom: 1px solid var(--ib-line); padding-bottom: 24px; }
.ib-tabs a {
  min-height: 44px; padding: 10px 22px; border-radius: 999px; font-size: 15px; font-weight: 400;
  border: 1px solid #CCCCCC; display: inline-flex; align-items: center;
}
.ib-tabs a:hover { border-color: var(--ib-green); color: var(--ib-ink); }
.ib-tabs a[aria-current="page"] { background: var(--ib-green); color: #FFFFFF; border-color: var(--ib-green); }

/* Galleries (classic shortcode + block editor) on the work pages */
.ib-works .gallery, .ib-works .wp-block-gallery, .ib-works .tiled-gallery {
  display: grid !important; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 32px; margin: 0 !important;
}
.ib-works .gallery br { display: none; }
.ib-works .gallery-item, .ib-works .wp-block-gallery .wp-block-image, .ib-works .blocks-gallery-item {
  width: auto !important; max-width: none !important; margin: 0 !important; padding: 0 !important; float: none !important;
}
.ib-works .gallery-icon, .ib-works .gallery-icon a, .ib-works .wp-block-gallery figure, .ib-works .wp-block-gallery a { display: block; width: 100%; margin: 0; }
.ib-works .gallery img, .ib-works .wp-block-gallery img {
  width: 100% !important; height: auto !important; aspect-ratio: 4 / 5; object-fit: cover !important; border: 0 !important;
}
.ib-works .gallery-caption, .ib-works figcaption { font-size: 14px; color: var(--ib-text); padding-top: 10px; }
.ib-works > p:empty, .ib-works > h6:empty { display: none; }
/* Work pages show only the gallery: intro text from the editor is hidden */
.ib-works > :is(h1, h2, h3, h4, h5, h6, p):not(:has(img)) { display: none; }

/* Prose (About, Imprint, Privacy, generic pages) */
.ib-prose { font-size: 18px; line-height: 1.75; color: var(--ib-text); font-weight: 400; max-width: 68ch; }
.ib-prose h1, .ib-prose h2, .ib-prose h3, .ib-prose h4 { color: var(--ib-ink); font-weight: 400; line-height: 1.3; margin: 1.6em 0 0.6em; }
.ib-prose h2 { font-size: 26px; font-weight: 300; }
.ib-prose h3 { font-size: 21px; }
.ib-prose h4, .ib-prose h5, .ib-prose h6 { font-size: 19px; }
.ib-prose p { margin: 0 0 1.1em; }
.ib-prose a { color: var(--ib-green); border-bottom: 1px solid currentColor; }
.ib-prose img { margin: 32px 0; }
.ib-prose hr { border: 0; border-top: 1px solid var(--ib-line); margin: 48px 0; }

/* Text pages (Impressum, Datenschutz and any other page): title, rule, text */
.ib-page-body { border-top: 1px solid var(--ib-line); padding-top: 64px; }
.ib-text-page .ib-prose { max-width: 760px; }
.ib-prose > :first-child { margin-top: 0; }
.ib-prose h2 { font-size: 26px; font-weight: 300; margin-top: 64px; }
.ib-prose h4, .ib-prose h5, .ib-prose h6 {
  font-size: 19px; font-weight: 400; color: var(--ib-ink); letter-spacing: 0; text-transform: none; margin: 40px 0 10px;
}
.ib-prose h4 strong, .ib-prose h5 strong, .ib-prose h6 strong { font-weight: 400; }
.ib-prose hr { margin: 64px 0; }

.ib-about-page { display: flex; flex-wrap: wrap; gap: 64px; align-items: flex-start; }
.ib-about-page > img { flex: 1 1 320px; width: 100%; max-width: 440px; aspect-ratio: 4 / 5; object-fit: cover; }
.ib-about-page > div { flex: 1 1 420px; display: flex; flex-direction: column; gap: 32px; }
.ib-about-page .ib-prose > :first-child { margin-top: 0; }
.ib-statement .ib-wrap { padding-top: 140px; padding-bottom: 140px; text-align: center; }
.ib-statement p { margin: 0; font-size: clamp(30px, 4vw, 52px); font-weight: 300; line-height: 1.1; }

/* Awards page */
.ib-entry { display: flex; flex-wrap: wrap; gap: 32px 64px; padding: 64px 0; border-top: 1px solid var(--ib-line); }
.ib-entry > header { flex: 1 1 260px; display: flex; flex-direction: column; gap: 10px; }
.ib-entry h2 { margin: 0; font-size: 24px; font-weight: 300; line-height: 1.25; }
.ib-entry-media { flex: 3 1 560px; display: flex; flex-direction: column; gap: 24px; }
.ib-pair { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 24px; align-items: center; }
.ib-panel { background: var(--ib-soft); padding: 40px; display: flex; align-items: center; justify-content: center; }
.ib-panel--logo { background: #FFFFFF; border: 1px solid var(--ib-line); padding: 48px; min-height: 200px; }
.ib-panel img.ib-doc { box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12); }
.ib-dark { background: var(--ib-ink); }
.ib-dark img { margin: 0 auto; max-width: 560px; width: 100%; }

/* Contact page: title left like every page, a rule below it, then text and form centred */
.ib-contact-body { border-top: 1px solid var(--ib-line); padding-top: 64px; text-align: center; }
.ib-contact .ib-prose { margin-left: auto; margin-right: auto; }
.ib-contact .wpcf7, .ib-contact .fluentform { margin-left: auto !important; margin-right: auto !important; text-align: left; }
.ib-contact .wpcf7 input[type="submit"] { display: block; margin: 0 auto; }
.ib-contact .fluentform .ff_submit_btn_wrapper, .ib-contact .fluentform .ff-el-group.ff-text-left { text-align: center !important; }

/* Contact (Contact Form 7) */
.ib-contact .wpcf7 { margin-top: 40px; max-width: 640px; }
.ib-contact .wpcf7 p { margin: 0 0 24px; color: var(--ib-text); font-size: 14px; letter-spacing: 0.06em; }
.ib-contact .wpcf7 input[type="text"], .ib-contact .wpcf7 input[type="email"], .ib-contact .wpcf7 textarea {
  display: block; width: 100%; margin-top: 8px; font: inherit; font-size: 17px; letter-spacing: 0;
  padding: 14px 16px; border: 1px solid #CCCCCC; border-radius: 0; background: #FFFFFF; color: var(--ib-ink);
}
.ib-contact .wpcf7 input[type="submit"] {
  min-height: 52px; padding: 14px 40px; background: var(--ib-green); color: #FFFFFF; border: 0; border-radius: 0;
  font: inherit; font-size: 14px; font-weight: 500; letter-spacing: 0.14em; text-transform: uppercase; cursor: pointer;
}
.ib-contact .wpcf7 input[type="submit"]:hover { background: var(--ib-ink); }

/* Contact (Fluent Forms) */
.ib-contact .fluentform { margin-top: 40px; max-width: 640px; }
.ib-contact .fluentform .ff-el-group { margin-bottom: 24px; }
.ib-contact .fluentform .ff-el-input--label label {
  font-size: 14px; font-weight: 400; letter-spacing: 0.06em; color: var(--ib-text);
}
.ib-contact .fluentform .ff-el-is-required.asterisk-right label::after { color: var(--ib-green); }
.ib-contact .fluentform .ff-el-form-control {
  font: inherit; font-size: 17px; letter-spacing: 0; color: var(--ib-ink);
  background: #FFFFFF; border: 1px solid #CCCCCC; border-radius: 0; padding: 14px 16px; box-shadow: none;
}
.ib-contact .fluentform .ff-el-form-control:focus { border-color: var(--ib-green); background: #FFFFFF; }
.ib-contact .fluentform .ff-el-form-control::placeholder { color: #8A8A8A; }
.ib-contact .fluentform .ff-btn-submit,
.ib-contact .fluentform .ff-btn-submit.ff_btn_style {
  min-height: 52px; padding: 14px 40px; background: var(--ib-green) !important; color: #FFFFFF !important;
  border: 0; border-radius: 0; font: inherit; font-size: 14px; font-weight: 500; letter-spacing: 0.14em;
  text-transform: uppercase; cursor: pointer; opacity: 1;
}
.ib-contact .fluentform .ff-btn-submit:hover { background: var(--ib-ink) !important; }
.ib-contact .fluentform .ff-message-success { border: 1px solid var(--ib-green); color: var(--ib-ink); box-shadow: none; }

/* Lightbox */
.ib-lightbox {
  position: fixed; inset: 0; z-index: 9999; background: rgba(255, 255, 255, 0.97);
  display: flex; align-items: center; justify-content: center; padding: 48px;
}
.ib-lightbox[hidden] { display: none; }
.ib-lightbox img { max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; }
.ib-lightbox button {
  position: absolute; background: none; border: 0; cursor: pointer; color: var(--ib-ink);
  width: 56px; height: 56px; font: inherit; font-size: 32px; font-weight: 300; line-height: 1;
}
.ib-lb-close { top: 16px; right: 16px; }
.ib-lb-prev { left: 8px; top: 50%; transform: translateY(-50%); }
.ib-lb-next { right: 8px; top: 50%; transform: translateY(-50%); }

@media (max-width: 640px) {
  :root { --ib-pad: 20px; }
  .ib-intro { padding-top: 40px; }
  .ib-quote, .ib-about { padding-top: 96px; padding-bottom: 96px; }
  .ib-section { padding-bottom: 96px; }
  .ib-page { padding-top: 48px; padding-bottom: 96px; }
  .ib-about, .ib-about-page { gap: 40px; }
  .ib-lightbox { padding: 16px; }
}
