/*
Theme Name:     Canning Glass
Theme URI:      https://canning-glass.nz/
Description:    A child theme for Divi
Author:         Stephen Canning
Author URI:     https://id8.co.nz/
Template:       Divi
Version:        1.0.0
*/

/*
IMPORTANT
- Do not use @import to load the parent theme. Enqueue Divi in functions.php instead.
- Keeping this file as the single source of truth for site CSS (including reCAPTCHA badge rule).
*/


/* =========================================================
   Sitewide links
   ========================================================= */

a {
  color: #cfe0e1;
  text-decoration: none;
  font-weight: 500;
}

a:hover {
  color: #000;
}


/* =========================================================
   Sticky footer layout
   Keeps footer at bottom on short pages without hacks
   ========================================================= */

html, body {
  height: 100%;
}

#page-container {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

#et-boc,
#et-main-area {
  flex: 1 0 auto;
  display: flex;
  flex-direction: column;
}

#main-content {
  flex: 1 0 auto;
}


/* =========================================================
   Portfolio grid tiles (Divi Portfolio module)
   Class required on the module, row, or section: cg-portfolio-grid

   Goals:
   - Square tiles with cropped images
   - Title appears on hover, text stays fully opaque
   - Background tint is separate from the text (no opacity on text)
   - Divi's native overlay is disabled to prevent double overlays
   ========================================================= */

/* Base tile container */
.cg-portfolio-grid .et_pb_portfolio_item {
  position: relative;
  overflow: hidden;
}

/* Force square tiles */
.cg-portfolio-grid img {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover;
  aspect-ratio: 1 / 1;
}

/* Disable Divi’s built-in overlay and its hover icon */
.cg-portfolio-grid .et_overlay,
.cg-portfolio-grid .et_overlay:before {
  display: none !important;
}

/* Title overlay container (holds the text) */
.cg-portfolio-grid .et_pb_portfolio_item h2.et_pb_module_header {
  position: absolute;
  inset: 0;
  margin: 0;
  padding: 0 1em;

  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;

  color: #fff !important;
  background: none !important;     /* tint lives on ::before */
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: 3;
  pointer-events: none;

  /* Optional: slight vertical nudge (keep if you still want it) */
  transform: translateY(-12px);
}

/* Tint layer behind the title text */
.cg-portfolio-grid .et_pb_portfolio_item h2.et_pb_module_header::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.15); /* adjust to taste */
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: -1;
}

/* Show title + tint on hover */
.cg-portfolio-grid .et_pb_portfolio_item:hover h2.et_pb_module_header,
.cg-portfolio-grid .et_pb_portfolio_item:hover h2.et_pb_module_header::before {
  opacity: 1;
}

/* =========================================================
   Portfolio tiles - touch devices
   Phones + tablets: overlay always visible, no hover preview
   ========================================================= */

@media (max-width: 980px) {

  /* Lock overlay and title on */
  .cg-portfolio-grid .et_pb_portfolio_item h2.et_pb_module_header,
  .cg-portfolio-grid .et_pb_portfolio_item h2.et_pb_module_header::before {
    opacity: 1 !important;
  }

  /* Remove transitions so nothing "previews" */
  .cg-portfolio-grid .et_pb_portfolio_item h2.et_pb_module_header,
  .cg-portfolio-grid .et_pb_portfolio_item h2.et_pb_module_header::before {
    transition: none !important;
  }
}


/* =========================================================
   Single project pages
   ========================================================= */

/* Remove extra blank paragraph spacing above Modula galleries */
body.single-project .et_pb_text_inner p:empty {
  margin: 0 !important;
  padding: 0 !important;
}


/* =========================================================
   Contact Form 7 styling
   Matches site look
   ========================================================= */

.wpcf7 input[type="text"],
.wpcf7 input[type="email"],
.wpcf7 input[type="tel"],
.wpcf7 input[type="url"],
.wpcf7 input[type="number"],
.wpcf7 input[type="date"],
.wpcf7 textarea {
  width: 100%;
  border-radius: 5px;
  font-size: 1em;
  padding: 12px;
  box-sizing: border-box;
  margin-bottom: 10px;
  font-family: 'Kumbh Sans', Helvetica, Arial, sans-serif;
}

.wpcf7 textarea {
  min-height: 180px;
  resize: vertical;
}

.wpcf7 input[type="submit"],
.wpcf7 .wpcf7-submit {
  background: #3e5057;
  color: #ffffff;
  border: 2px solid #ffffff;
  border-radius: 30px;
  padding: 10px 28px;
  margin-top: 15px;
  font-size: 1.1em;
  letter-spacing: 0.01em;
  cursor: pointer;
  display: inline-block;
}

.wpcf7 input[type="submit"]:hover,
.wpcf7 .wpcf7-submit:hover {
  background: #d67e5c;
}

/* Hide CF7 inline validation tip text */
span.wpcf7-not-valid-tip {
  display: none !important;
}

/* Response message */
div.wpcf7-response-output {
  border: none !important;
  color: #FFEA78;
  padding: 0;
  margin-top: 15px;
  font-style: italic;
  font-size: 15px;
}


/* =========================================================
   Footer layout tweaks
   ========================================================= */

.et-l--footer .et_pb_column {
  margin-bottom: 0 !important;
}


/* =========================================================
   SEO helper (visually hidden, still accessible to screen readers)
   ========================================================= */

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}


/* =========================================================
   reCAPTCHA badge
   Single source of truth: keep this here, not scattered elsewhere
   ========================================================= */

.grecaptcha-badge {
  visibility: hidden !important;
}
