/*
Theme Name: Crescendum
Version: 3.1
Author: Crescendum Dev Team
Description: Responsive layout with SVG logo support, dropdown nav, Gutenberg alignment fixes, and scaling.
*/

/* Box Model Reset */
*, *::before, *::after {
  box-sizing: border-box;
}

/* Root Variables */
:root {
  --font-base: 1rem;
  --font-heading: 2rem;
  --font-subheading: 1.5rem;
  --color-primary: #0077aa;
  --color-accent: #00aa99;
  --color-background: #f5f7fa;
  --color-text: #222;
  --color-white: #ffffff;
}

/* Base Styles */
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background-color: var(--color-background);
  color: var(--color-text);
  font-size: var(--font-base);
  line-height: 1.6;
}

a {
  color: var(--color-primary);
  text-decoration: none;
}

a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible {
  outline: 2px dashed var(--color-primary);
  outline-offset: 2px;
}

h1, h2, h3, h4, h5, h6 {
  color: var(--color-text);
  line-height: 1.2;
  margin-top: 0;
}

img {
  max-width: 100%;
  height: auto;
}

/* Container */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
}

/* Finalized Logo and Header Styling Fix */

/* Limit header height to contain logo */
.site-header {
  background: var(--color-white);
  padding: 0.5rem 1rem;
  border-bottom: 1px solid #eee;
  display: flex;
  align-items: center;
  min-height: 100px; /* Ensure enough height to accommodate larger logos */
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  width: 100%;
}

/* Constrain logo container */
.logo {
  display: flex;
  align-items: center;
  height: auto;
  max-height: none; /* Let logo grow unrestricted */
}

/* Force scaling of embedded SVG or <img class="custom-logo"> */
.logo svg,
.logo img.custom-logo {
  height: auto;
  max-height: 94px; /* Adjust this value to control logo size */
  width: auto;
  display: block;
  transition: max-height 0.3s ease;
}

@media (max-width: 700px) {
  .logo svg,
  .logo img.custom-logo {
    max-height: 94px;
  }
  .site-header {
    min-height: 100px;
  }
}

@media (max-width: 480px) {
  .logo svg,
  .logo img.custom-logo {
    max-height: 94px;
  }
  .site-header {
    min-height: 100px;
  }
}

.main-nav ul {
  display: flex;
  gap: 1.5rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.main-nav ul li {
  position: relative;
}

.main-nav ul li a {
  color: var(--color-text);
  text-decoration: none;
  font-weight: 500;
  padding: 0.25rem 0.5rem;
  transition: color 0.3s ease;
}

.main-nav ul li a:hover {
  color: var(--color-primary);
}

/* Dropdown Menu */
.main-nav ul ul {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  background: var(--color-white);
  padding: 0.5rem 0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  border: 1px solid #eee;
  z-index: 9999;
  min-width: 180px;
}

.main-nav ul ul li {
  display: block;
  width: 100%;
}

.main-nav ul ul li a {
  display: block;
  padding: 0.5rem 1rem;
  color: var(--color-text);
  white-space: nowrap;
}

.main-nav ul ul li a:hover {
  background: var(--color-background);
  color: var(--color-primary);
}

.main-nav ul li:hover > ul {
  display: block;
}

/* Hero */
.hero {
  background: linear-gradient(135deg, #009dc0, #00b99d);
  color: white;
  padding: 5rem 2rem;
  text-align: center;
}

.hero h1 {
  font-size: 2.5rem;
  margin-bottom: 1rem;
}

.btn-cta {
  background: white;
  color: var(--color-primary);
  padding: 0.75rem 1.5rem;
  font-weight: bold;
  border-radius: 5px;
  display: inline-block;
  margin-top: 1rem;
  transition: background 0.3s ease;
}

.btn-cta:hover {
  background: #f0f0f0;
}

/* Value Proposition */
.value-prop {
  background: #f2f9fb;
  padding: 5rem 2rem;
}

.value-prop .container {
  max-width: 800px;
  margin: 0 auto;
}

.value-prop h2, .value-prop p {
  text-align: center;
}

.value-list {
  list-style: none;
  padding-left: 0;
  text-align: left;
}

.value-list li {
  padding-left: 1.5rem;
  position: relative;
  margin-bottom: 0.75rem;
}

.value-list li::before {
  content: "\2714";
  position: absolute;
  left: 0;
  top: 0.2rem;
  color: var(--color-accent);
}

/* Services */
.service-section {
  padding: 5rem 2rem;
  background: var(--color-white);
}

.service-section h2 {
  font-size: 2rem;
  text-align: center;
  margin-bottom: 2rem;
}

.service-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 30px;
  margin: 40px auto;
  padding: 0 3rem;
  width: 100%;
}

@media (max-width: 1023px) {
  .service-cards {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 600px) {
  .service-cards {
    grid-template-columns: 1fr;
  }
}

.card {
  display: flex;
  flex-direction: column;
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
  transition: transform 0.2s ease;
}

.card:hover {
  transform: translateY(-5px);
}

.card-link {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 1.5rem;
  text-align: center;
  text-decoration: none;
  color: inherit;
  height: 100%;
}

.card-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.card-content i {
  font-size: 2rem;
  color: #0077b6;
}

@media (max-width: 480px) {
  .card-link {
    padding: 1.25rem 1rem;
  }
  .card-content h3 {
    font-size: 1.125rem;
  }
  .card-content p {
    font-size: 0.95rem;
  }
}

/* ACF Blocks */
.acf-full-width {
  max-width: 1280px;
  margin: 2rem auto;
  padding: 0 1rem;
}

.acf-contained {
  max-width: 900px;
  margin: 2rem auto;
  padding: 0 1rem;
  overflow-wrap: break-word;
}

.acf-contained img {
  display: block;
  margin: 1rem auto;
}

@media (max-width: 768px) {
  .acf-contained table,
  .acf-contained tr,
  .acf-contained td {
    display: block;
    width: 100%;
  }
}

/* Gutenberg Alignment */
.alignleft {
  float: left;
  margin-right: 1.5em;
  margin-bottom: 1em;
}

.alignright {
  float: right;
  margin-left: 1.5em;
  margin-bottom: 1em;
}

.aligncenter {
  display: block;
  margin-left: auto;
  margin-right: auto;
  text-align: center;
}

.wp-block-column .wp-block-image.alignleft {
  float: left !important;
  margin-right: 1.5em;
  margin-left: 0 !important;
  display: inline-block;
  text-align: left !important;
  justify-content: flex-start !important;
}

.wp-block-column .wp-block-image.alignright {
  float: right !important;
  margin-left: 1.5em;
  margin-right: 0 !important;
  display: inline-block;
  text-align: right !important;
  justify-content: flex-end !important;
}

.wp-block-column .wp-block-image.aligncenter {
  float: none !important;
  margin-left: auto !important;
  margin-right: auto !important;
  display: block;
  text-align: center;
  justify-content: center;
}

.gutenberg-content .has-text-align-left {
  text-align: left !important;
}

.gutenberg-content .has-text-align-center {
  text-align: center !important;
}

.gutenberg-content .has-text-align-right {
  text-align: right !important;
}

/* Footer */
footer.site-footer {
  background: #111;
  color: #ccc;
  text-align: center;
  padding: 2rem;
}
