/*
 Theme Name: Studio Bagou
 Theme URI:  http://example.com/
 Author:      Your Name
 Author URI:  http://example.com/
 Description: Custom theme for Studio Bagou social media content.
 Version:     1.0
 Text Domain: studio-bagou
 */

 /* Fonts */
@import url('https://fonts.googleapis.com/css2?family=Kufam:wght@300;400;700&display=swap');

@font-face {
  font-family: 'Extenda Exa';
  src: url('fonts/extenda-90-exa.otf') format('opentype');
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}

/* CSS Variables */
:root {
  --color-text: rgb(85, 106, 76);
  --color-bg: rgb(255, 253, 245);
  --color-panel: rgb(85, 106, 76);
  --color-panel-bg: rgb(242, 240, 232);
  --font-body: 'Kufam', sans-serif;
  --font-heading: 'Extenda Exa', serif;
  --font-size-body: 16px;
  --font-weight-body: 300;
  --font-size-heading: 32px;
  --font-weight-heading: 400;
}

/* Base styles */
body {
  background-color: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: var(--font-size-body);
  line-height: 1.6;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-size: var(--font-size-heading);
  margin-top: 0;
  line-height: 1.05;
}

h1 {
  font-size: 39px;
}

/* Header and Navigation */
.site-header {
  background-color: var(--color-bg);
  padding: 20px 0;
}

.site-header .container {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  position: relative;
}

.header-spacer {
  flex: 1 1 0;
}

.header-center {
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  height: 100%;
  z-index: 1101;
}

.site-header nav {
  margin-top: 20px;
}

.site-title {
  font-family: var(--font-heading);
  font-size: var(--font-size-heading);
  color: var(--color-text);
  text-decoration: none;
}

.main-nav {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 30px;
}

.main-nav li a {
  color: var(--color-text);
  text-decoration: none;
  font-family: var(--font-body);
  font-weight: 400;
}

.main-nav li a:hover,
.main-nav li a:focus {
  text-decoration: underline;
  text-underline-offset: 7px;
}

/* Underline the current active menu item */
.main-nav li.current-menu-item > a,
.main-nav li.current_page_item > a {
  text-decoration: underline;
  text-underline-offset: 7px;
}

.skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  background: var(--color-text);
  color: var(--color-bg);
  padding: 8px 16px;
  z-index: 100;
  transition: top 0.3s ease-in-out;
}

.skip-link:focus {
  top: 0;
}

/* Clients Archive Grid */
.clients-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
  width: 80%;
  margin: 40px auto;
}

/* Client Card Styles */
.client-card {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr;
  grid-template-areas: "image content";
  gap: 120px;
  align-items: stretch;
  background-color: var(--color-bg);
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  min-height: 520px;
}

.clients-grid .client-card:nth-child(even) {
  direction: rtl;
}

.clients-grid .client-card:nth-child(even) .client-card__image,
.clients-grid .client-card:nth-child(even) .client-card__content {
  direction: ltr;
}

.clients-grid .client-card:nth-child(even) .client-card__image {
  grid-area: image;
  display: flex;
  justify-content: flex-start;
}

.clients-grid .client-card:nth-child(odd) .client-card__image {
  grid-area: image;
  display: flex;
  justify-content: flex-end;
}

.client-card__image img {
  width: 400px;
  height: 520px;
  object-fit: cover;
  display: block;
}

.client-card__content {
  grid-area: content;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-end;
  text-align: justify;
  font-weight: 300;
}

.client-card__title {
  font-weight: var(--font-weight-heading);
  text-transform: uppercase;
  align-self: start;
  margin-bottom: 0px;
}

.client-card__button {
  margin-top: 12px;
  background-color: var(--color-text);
  color: var(--color-bg);
  border: 2px solid var(--color-text);
  border-radius: 10px;
  padding: 8px 16px;
  text-align: center;
  text-decoration: none;
  font-family: var(--font-body);
  font-weight: 400;
  transition: background-color 0.2s ease, color 0.2s ease;
  width: 100px;
  align-self: end;
}

.client-card__button:hover,
.client-card__button:focus {
  background-color: var(--color-bg);
  color: var(--color-text);
}

/* Link Styles */
a {
  font-weight: 300;
  color: var(--color-text);
  text-decoration: none;
}

/* Center footer legal links */
.site-footer {
  text-align: center;
}

.site-footer .legal-links {
  font-size: 14px;
}

/* Contact Form 7 Styles */
.wpcf7-form, .wpcf7-form * {
  box-sizing: border-box;
}
.contact-layout__form {
  width: 100%;
  max-width: 500px;
  margin: 0 auto;
}
.wpcf7-form .form-group {
  margin-bottom: 1rem;
}

.wpcf7-form .form-control {
  width: 100%;
  padding: 0.5rem;
  border: 0px solid var(--color-panel);
  font-family: var(--font-body);
  font-size: var(--font-size-body);
  background-color: var(--color-panel-bg);
  border-radius: 5px;
}

.wpcf7-form .btn-primary {
  background-color: var(--color-text);
  font-size: 16px;
  color: var(--color-bg);
  border: 2px solid var(--color-text);
  padding: 0.75rem 1.5rem;
  border-radius: 10px;
  cursor: pointer;
  transition: background-color 0.2s;
}

.wpcf7-form .btn-primary:hover {
  background-color: var(--color-bg);
  color: var(--color-text);
}

/* Center the submit button in the form */
.wpcf7-form .form-submit {
  text-align: center;
}

/* Ensure the button is inline-block */
.wpcf7-form .form-submit .wpcf7-submit {
  display: inline-block;
}

.wpcf7-spinner {
  display: none; /* Hide the spinner */
}

/* Disable resizing on all textareas in your forms */
.wpcf7-form textarea,
textarea {
  resize: none;
}

.contact-layout {
  display: flex;
  flex-direction: row;
  align-items: stretch;
  justify-content: center;
  padding: 40px 20px;
  gap: 70px;
}

/* Make the image fill the full height of the form container */
.contact-layout__image {
  margin-top: 16px;
}

.contact-layout__image img {
  max-width: 380px;
  width: 100%;
  height: auto;
  display: block;
}

.client-wrapper {
  max-width: 900px;
  margin-top: 40px;
  text-align: center;
}

.single-client {
  display: flex;
  flex-direction: column;
}

.client-header,
.client-content {
  width: 100%;
}

.client-header h1 {
  font-weight: 400;
}

/* Lightbox styles */
.lightbox-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0,0,0,0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  cursor: zoom-out;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}
.lightbox-overlay.active {
  opacity: 1;
  pointer-events: auto;
}
.lightbox-overlay img {
  max-width: 90vw;
  max-height: 90vh;
  box-shadow: 0 8px 40px rgba(0,0,0,0.5);
  border-radius: 8px;
}

.client-content img:hover,
.wp-block-gallery img:hover {
  cursor: zoom-in;
}

.lightbox-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--color-bg);
  font-size: 3.5rem;
  padding: 0;
  border-radius: 0;
  cursor: pointer;
  z-index: 10000;
  transition: color 0.2s;
}
.lightbox-arrow#lightboxPrev {
  left: 5vw;
}
.lightbox-arrow#lightboxNext {
  right: 5vw;
}
.lightbox-arrow:hover,
.lightbox-arrow:focus {
  color: #fff;
}

.wp-block-button__link {
  margin-top: 12px;
  background-color: var(--color-text);
  color: var(--color-bg);
  border: 2px solid var(--color-text);
  border-radius: 10px;
  padding: 8px 16px;
  text-align: center;
  text-decoration: none;
  font-family: var(--font-body);
  font-weight: 400;
  transition: background-color 0.2s ease, color 0.2s ease;
  align-self: end;
}

.wp-block-button__link:hover,
.wp-block-button__link:focus {
  background-color: var(--color-bg);
  color: var(--color-text);
}

.wp-block-heading {
  font-weight: 400 !important;
}

body.page-id-69 .page-wrapper {
  max-width: 640px;
  margin: 0 auto;
  padding: 0 16px;
}

body.page-id-19 .page-wrapper {
  max-width: 1000px;
  margin: 0 auto;
  padding: 0 16px;
}

.site-content, .page-wrapper {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 16px;
}

.wp-block-media-text__content {
  padding: 0 !important;
}

.site-footer {
  margin-top: 70px;
}

#backToTop {
  position: fixed;
  bottom: 32px;
  right: 32px;
  width: 48px;
  height: 48px;
  background: var(--color-text);
  border: none;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s, background 0.2s, width 0.3s, padding 0.3s;
  z-index: 10001;
  padding: 0;
  overflow: hidden;
}
#backToTop svg {
  display: block;
}
.back-to-top-label {
  display: none;
  color: var(--color-bg);
  font-family: var(--font-body);
  font-size: 1.1rem;
  font-weight: 400;
  margin-left: 8px;
  opacity: 0;
  width: 0;
  transition: opacity 0.3s, width 0.3s, color 0.3s;
  pointer-events: none;
  white-space: nowrap;
}
#backToTop:hover, #backToTop:focus {
  background: rgba(255, 253, 245, 0.7);
  backdrop-filter: blur(4px);
  width: 110px;
  padding: 0 18px 0 12px;
  border: 2px solid var(--color-text);
}
#backToTop:hover .back-to-top-label,
#backToTop:focus .back-to-top-label {
  display: inline-block;
  opacity: 1;
  width: auto;
  color: var(--color-text);
}
#backToTop svg path {
  stroke: var(--color-bg);
  transition: stroke 0.3s;
}
#backToTop:hover svg path,
#backToTop:focus svg path {
  stroke: var(--color-text);
}

.btn-bagou,
.wp-block-button__link {
  background-color: var(--color-text);
  color: var(--color-bg);
  border: 2px solid var(--color-text);
  border-radius: 10px;
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 16px;
  padding: 0 1.5rem;
  text-align: center;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 44px;
  min-width: 44px;
  width: auto;
  transition: background-color 0.2s, color 0.2s, border-color 0.2s;
  cursor: pointer;
}
.btn-bagou:hover,
.btn-bagou:focus,
.wp-block-button__link:hover,
.wp-block-button__link:focus {
  background-color: var(--color-bg);
  color: var(--color-text);
  border-color: var(--color-text);
}

/* Responsive styles for client archive */
@media (max-width: 900px) {
  .clients-grid {
    width: 95%;
    margin: 24px auto;
  }
  .client-card {
    min-height: 400px;
    gap: 40px;
    border-bottom: 2px solid var(--color-text);
    border-radius: 10px;
    padding-bottom: 1.5rem;
    margin-bottom: 1.5rem;
  }
  .client-card__image img {
    width: 260px;
    height: 340px;
  }
  .client-card__content {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    text-align: left;
    height: 340px;
    max-height: 340px;
    overflow: hidden;
    width: 100%;
  }
  .client-card__title {
    align-self: flex-start;
    font-size: 2.5rem;
    margin-bottom: 0;
  }
  .client-card__excerpt {
    display: -webkit-box;
    -webkit-line-clamp: 5;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 1em;
    width: 100%;
  }
  .client-card__button {
    align-self: flex-start;
    width: auto;
    margin-top: auto;
  }
  .contact-layout__image img {
    max-width: 260px;
  }
}

@media (max-width: 600px) {
  body {
    overflow-x: hidden;
  }
  .clients-grid {
    width: 100%;
    margin: 12px 0;
  }
  .client-card {
    display: flex;
    flex-direction: column;
    min-height: unset;
    gap: 20px;
    padding: 0 8px;
  }
  .client-card__image {
    display: flex;
    justify-content: center !important;
    margin-bottom: 0;
  }
  .client-card__image img {
    width: 100%;
    max-width: 320px;
    height: auto;
  }
  .client-card__content {
    align-items: center;
    text-align: left;
    width: 100%;
    margin-bottom: 1.5em;
  }
  .client-card__title {
    align-self: center;
    font-size: 2.5rem;
  }
  .client-card__button {
    align-self: center;
    width: auto;
  }
  .contact-layout__image {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 0;
    width: 100%;
  }
  .contact-layout__image img {
    display: block;
    margin: 0 auto;
    max-width: 180px;
  }
  .contact-layout {
    flex-direction: column;
    gap: 24px;
    padding: 20px 0;
    box-sizing: border-box;
    overflow-x: hidden;
  }
  .contact-layout__form,
  .contact-layout__image {
    width: 100%;
    max-width: none;
  }
  .contact-layout__image img {
    width: 100%;
    max-width: 100%;
    height: auto;
    display: block;
    margin: 0 auto;
  }
  .wpcf7-form {
    padding: 0;
    max-width: 100%;
    width: 100%;
    margin: 0;
  }
  .site-content, .page-wrapper {
    padding: 0;
  }
}

/* Burger menu styles and responsive nav */
.burger-menu {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  background: none;
  border: none;
  cursor: pointer;
  width: 44px;
  height: 44px;
  z-index: 1200;
  position: relative;
}
.burger-menu span {
  display: block;
  width: 28px;
  height: 3px;
  background: var(--color-text);
  margin: 2.5px 0;
  border-radius: 2px;
  transition: all 0.3s;
}
@media (max-width: 900px) {
  .burger-menu {
    display: flex;
  }
  .main-nav-wrapper {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100vw;
    background: var(--color-bg);
    box-shadow: 0 8px 32px rgba(0,0,0,0.08);
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s cubic-bezier(0.4,0,0.2,1);
    z-index: 2000;
  }
  .main-nav-wrapper.open {
    max-height: 400px;
    transition: max-height 0.4s cubic-bezier(0.4,0,0.2,1);
  }
  .main-nav {
    flex-direction: column;
    gap: 0;
    padding: 0;
    margin: 0;
  }
  .main-nav li {
    width: 100%;
    text-align: left;
    border-bottom: 1px solid #e5e5e5;
  }
  .main-nav li:last-child {
    border-bottom: none;
  }
  .main-nav li a {
    display: block;
    padding: 18px 24px;
    font-size: 1.2rem;
  }
  .site-header .container {
    position: relative;
  }
  /* Burger to X animation */
  .burger-menu[aria-expanded="true"] span:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
  }
  .burger-menu[aria-expanded="true"] span:nth-child(2) {
    opacity: 0;
  }
  .burger-menu[aria-expanded="true"] span:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
  }
}

.burger-menu[aria-expanded="true"] {
  background: var(--color-text);
  color: var(--color-bg);
  border: 2px solid var(--color-text);
  border-radius: 10px;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}
.burger-menu[aria-expanded="true"] span {
  background: var(--color-bg);
}
.burger-menu[aria-expanded="true"]:hover,
.burger-menu[aria-expanded="true"]:focus {
  background: var(--color-bg);
  color: var(--color-text);
  border-color: var(--color-text);
}
.burger-menu[aria-expanded="true"]:hover span,
.burger-menu[aria-expanded="true"]:focus span {
  background: var(--color-text);
}

.nav-blur-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 1000;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s;
  backdrop-filter: blur(6px);
  background: rgba(255,255,255,0.18);
}
body.nav-open .nav-blur-overlay,
body.lightbox-open .nav-blur-overlay {
  opacity: 1;
  pointer-events: auto;
}

@media (max-width: 900px) {
  .page-wrapper,
  .site-content,
  .client-wrapper {
    max-width: 100%;
    padding: 0 10px;
    margin-top: 24px;
  }
  .client-header h1 {
    font-size: 2rem;
  }
  body.nav-open .site-header .custom-logo,
  body.nav-open .site-header .custom-logo-link img {
    filter: blur(4px) brightness(0.9);
    transition: filter 0.2s;
  }
}
@media (max-width: 600px) {
  .page-wrapper,
  .site-content,
  .client-wrapper {
    max-width: 100%;
    padding: 0 4px;
    margin-top: 12px;
  }
  .client-header h1 {
    font-size: 2.5rem;
  }
  .site-footer .legal-links {
    font-size: 12px;
    word-break: break-word;
    padding: 0 8px;
  }
}

.lightbox-close {
  position: absolute;
  top: 24px;
  right: 32px;
  background: none;
  color: var(--color-bg);
  border: none;
  border-radius: 0;
  width: 44px;
  height: 44px;
  font-size: 3rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 10001;
  box-shadow: none;
  transition: background 0.2s, color 0.2s;
}
.lightbox-close:hover,
.lightbox-close:focus {
  background: none;
  color: var(--color-bg);
}

.hidden {
  display: none !important;
}

body.lightbox-open #backToTop {
  display: none !important;
}

@media (min-width: 901px) {
  .burger-menu {
    display: none !important;
  }
  .site-header .container {
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    position: relative;
  }
  .header-center {
    position: static;
    left: unset;
    top: unset;
    bottom: unset;
    transform: none;
    height: auto;
    z-index: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    margin-bottom: 12px;
  }
  .main-nav-wrapper {
    position: static;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    width: 100%;
    max-width: 100vw;
    background: none;
    box-shadow: none;
    max-height: none;
    overflow: visible;
  }
  .main-nav {
    display: inline-flex;
    gap: 30px;
    flex-direction: row;
    padding: 0;
    margin: 0;
  }
}

@media (min-width: 600px) {
  .contact-layout {
    display: flex;
    flex-direction: row;
    align-items: stretch;
    justify-content: center;
    gap: 70px;
    padding: 40px 20px;
  }
  .contact-layout__form,
  .contact-layout__image {
    width: 50%;
    max-width: 50%;
    box-sizing: border-box;
  }
  .contact-layout__image {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 0;
  }
  .contact-layout__image img {
    width: 100%;
    max-width: 100%;
    height: auto;
    display: block;
    margin: 0 auto;
  }
}

/* Prevent .client-wrapper from centering the header */
.client-wrapper .site-header,
.client-wrapper .site-header * {
  text-align: initial !important;
  align-items: initial !important;
  justify-content: initial !important;
}

/* Optionally, scope centering to only direct children of .client-wrapper */
.client-wrapper > article,
.client-wrapper > .lightbox-overlay {
  text-align: center;
}

/* Media left: media 1/3, text 2/3 */
.wp-block-media-text {
  display: grid;
  grid-template-columns: 1fr 2fr;
  align-items: center;
  gap: 2rem;
  margin-top: 2.5rem;
}
.wp-block-media-text__media {
  grid-column: 1;
}
.wp-block-media-text__content {
  grid-column: 2;
}

/* Media right: text 2/3, media 1/3 */
.wp-block-media-text.has-media-on-the-right {
  grid-template-columns: 2fr 1fr;
}
.wp-block-media-text.has-media-on-the-right .wp-block-media-text__content {
  grid-column: 1;
}
.wp-block-media-text.has-media-on-the-right .wp-block-media-text__media {
  grid-column: 2;
}

@media (max-width: 900px) {
  .wp-block-media-text,
  .wp-block-media-text.has-media-on-the-right {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
  }
  .wp-block-media-text:last-child,
  .wp-block-media-text.has-media-on-the-right:last-child {
    margin-bottom: 0;
  }
  .wp-block-media-text__content,
  .wp-block-media-text__media {
    width: 100%;
    max-width: 100%;
    grid-column: auto;
  }
  .wp-image-116.size-full {
    display: none;
  }
  .wp-image-100.size-full {
    display: none;
  }
  .wp-image-103.size-full {
    display: none;
  }
  .wp-image-104.size-full {
    display: none;
  }
  .wp-block-heading {
    font-size: 24px;
  }
}

.custom-logo, .custom-logo-link img {
  width: 350px !important;
  max-width: 100%;
  height: auto;
  display: block;
}