/* SolarGuide.ie Irish tricolour design system — theme 0.3.0 */
:root,
.solarguide-page,
.sg-wrap {
  --sg-ink: #12231a;
  --sg-muted: #53665b;
  --sg-line: #d5e3da;
  --sg-border: #d5e3da;
  --sg-bg: #fffdf7;
  --sg-panel: #ffffff;
  --sg-surface: #ffffff;
  --sg-soft: #eaf5ef;
  --sg-green: #006b3c;
  --sg-primary: #006b3c;
  --sg-green-dark: #004d2a;
  --sg-primary-strong: #004d2a;
  --sg-amber: #ff883e;
  --sg-accent: #ff883e;
  --sg-orange-soft: #fff0e6;
  --sg-blue: #246b5a;
  --sg-focus: rgba(255, 136, 62, 0.5);
  --sg-shadow: 0 2px 4px rgba(0, 77, 42, 0.06), 0 18px 48px rgba(0, 77, 42, 0.1);
  --sg-shadow-raised: 0 4px 8px rgba(0, 77, 42, 0.08), 0 24px 64px rgba(0, 77, 42, 0.14);
  --sg-radius: 16px;
  --global-palette-highlight: #006b3c;
  --global-palette-highlight-alt: #004d2a;
  --global-palette3: #12231a;
  --global-palette4: #365047;
  --global-palette5: #53665b;
  --global-palette7: #eaf5ef;
  --global-palette8: #fffdf7;
  --global-palette9: #ffffff;
}

html {
  color-scheme: light;
  scroll-behavior: smooth;
}

html.dark {
  color-scheme: dark;
}

html.dark,
html.dark .solarguide-page,
html.dark .sg-wrap {
  --sg-ink: #f4f7f2;
  --sg-muted: #b7c8be;
  --sg-line: #315443;
  --sg-border: #315443;
  --sg-bg: #07150f;
  --sg-panel: #0c2118;
  --sg-surface: #0c2118;
  --sg-soft: #113323;
  --sg-green: #68d391;
  --sg-primary: #68d391;
  --sg-green-dark: #a1e4ba;
  --sg-primary-strong: #a1e4ba;
  --sg-amber: #ffa56b;
  --sg-accent: #ffa56b;
  --sg-orange-soft: #402315;
  --sg-blue: #71c5b1;
  --sg-focus: rgba(255, 165, 107, 0.56);
  --sg-shadow: 0 2px 4px rgba(0, 0, 0, 0.18), 0 18px 48px rgba(0, 0, 0, 0.3);
  --sg-shadow-raised: 0 4px 8px rgba(0, 0, 0, 0.22), 0 24px 64px rgba(0, 0, 0, 0.42);
  --global-palette-highlight: #68d391;
  --global-palette-highlight-alt: #a1e4ba;
  --global-palette3: #f4f7f2;
  --global-palette4: #d9e5de;
  --global-palette5: #b7c8be;
  --global-palette7: #113323;
  --global-palette8: #0c2118;
  --global-palette9: #07150f;
}

body,
.site,
.site-main,
.content-area,
.content-bg,
.entry-content-wrap {
  background-color: var(--sg-bg);
  color: var(--sg-ink);
}

body {
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a,
button,
input,
select,
textarea,
summary {
  transition-duration: 200ms;
  transition-timing-function: cubic-bezier(0.2, 0, 0, 1);
}

:where(a, button, input, select, textarea, summary):focus-visible {
  outline: 3px solid var(--sg-focus) !important;
  outline-offset: 3px;
}

/* Header and national signature */
#masthead {
  border: 0;
  background: #004d2a;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.12), 0 12px 32px rgba(0, 48, 26, 0.2);
}

#masthead::before,
.sg-site-footer::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 6px;
  background: linear-gradient(90deg, #006b3c 0 33.333%, #ffffff 33.333% 66.666%, #ff883e 66.666% 100%);
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.12);
  z-index: 3;
}

#masthead .site-main-header-wrap,
#masthead .site-main-header-row,
#masthead .site-header-row-container-inner,
#mobile-header .site-main-header-inner-wrap {
  background: #004d2a;
}

#main-header .site-main-header-inner-wrap {
  min-height: 76px;
  padding-top: 6px;
}

#mobile-header .site-main-header-inner-wrap {
  min-height: 66px;
  padding-top: 6px;
}

#masthead .site-branding .site-title,
#masthead .site-branding .site-title a,
#masthead .site-branding a.brand {
  color: #ffffff;
}

#masthead .site-title-wrap {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

#masthead .site-title-wrap::after {
  content: "Ireland · Éire";
  margin-top: 2px;
  color: #ffb483;
  font-size: 10px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

#masthead .main-navigation .primary-menu-container > ul > li.menu-item > a {
  min-height: 44px;
  color: rgba(255, 255, 255, 0.82);
  font-size: 14px;
  font-weight: 720;
  border-radius: 10px;
}

#masthead .main-navigation .primary-menu-container > ul > li.menu-item > a:hover,
#masthead .main-navigation .primary-menu-container > ul > li.current-menu-item > a,
#masthead .main-navigation .primary-menu-container > ul > li.current-menu-ancestor > a {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.1);
}

#masthead .header-navigation[class*="header-navigation-style-underline"] .header-menu-container > ul > li > a::after {
  height: 3px;
  background: #ff883e;
}

#masthead .header-navigation .header-menu-container ul ul.sub-menu {
  padding: 8px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 12px;
  background: #003d22;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.28);
}

#masthead .header-navigation .header-menu-container ul ul li.menu-item > a {
  border: 0;
  border-radius: 8px;
  color: rgba(255, 255, 255, 0.84);
}

.mobile-toggle-open-container .menu-toggle-open,
.mobile-toggle-open-container .menu-toggle-open:focus {
  width: 44px;
  height: 44px;
  border-color: rgba(255, 255, 255, 0.28);
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
  box-shadow: none;
}

#mobile-drawer.popup-drawer .drawer-inner {
  background: #003d22;
}

#mobile-drawer .mobile-navigation ul li.current-menu-item > a,
#mobile-drawer .mobile-navigation ul li a:hover {
  color: #ffffff;
  background: rgba(255, 136, 62, 0.18);
}

@media (min-width: 1025px) {
  #main-header {
    display: block !important;
  }

  #mobile-header {
    display: none !important;
  }
}

@media (max-width: 1024px) {
  #main-header {
    display: none !important;
  }

  #mobile-header {
    display: block !important;
  }
}

/* Hero surfaces */
.entry-hero.page-hero-section .entry-hero-container-inner {
  background:
    linear-gradient(102deg, rgba(0, 61, 34, 0.96), rgba(0, 107, 60, 0.82) 64%, rgba(255, 136, 62, 0.52)),
    url("solar-page-header.svg") center / cover no-repeat;
}

.entry-hero.page-hero-section:not(:has(.entry-title)) {
  display: none;
}

.entry-hero.page-hero-section .entry-title::after {
  width: 96px;
  height: 6px;
  background: linear-gradient(90deg, #006b3c 0 33.333%, #ffffff 33.333% 66.666%, #ff883e 66.666% 100%);
}

.sg-wrap > .sg-hero {
  position: relative;
  isolation: isolate;
  margin: 32px 0 48px;
  padding: clamp(40px, 6vw, 72px);
  border-radius: 28px;
  overflow: hidden;
  background:
    radial-gradient(circle at 92% 8%, rgba(255, 136, 62, 0.42), transparent 28%),
    linear-gradient(135deg, #003d22, #006b3c 72%);
  box-shadow: var(--sg-shadow-raised);
}

.sg-wrap > .sg-hero::after {
  content: "";
  position: absolute;
  right: -70px;
  bottom: -90px;
  width: 280px;
  height: 280px;
  border: 46px solid rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  z-index: -1;
}

.sg-wrap > .sg-hero h1,
.sg-wrap > .sg-hero .sg-hero__copy > p {
  color: #ffffff;
}

.sg-wrap > .sg-hero .sg-hero__copy > p {
  color: rgba(255, 255, 255, 0.82);
}

.sg-wrap > .sg-hero .sg-hero__panel {
  border-color: rgba(255, 255, 255, 0.42);
  background: rgba(255, 253, 247, 0.96);
  color: #12231a;
  backdrop-filter: blur(20px) saturate(140%);
  -webkit-backdrop-filter: blur(20px) saturate(140%);
}

.sg-wrap > .sg-hero .sg-hero__panel h2,
.sg-wrap > .sg-hero .sg-hero__panel label {
  color: #12231a;
}

.sg-wrap > .sg-hero .sg-hero__panel p,
.sg-wrap > .sg-hero .sg-source-note {
  color: #53665b;
}

.sg-wrap > .sg-hero .sg-button-primary {
  border-color: #ff883e;
  background: #ff883e;
  color: #12231a;
}

.sg-wrap > .sg-hero .sg-button-primary:hover {
  border-color: #ff9f66;
  background: #ff9f66;
  color: #12231a;
}

/* Buttons, fields and form controls */
.sg-button,
.sg-ad-banner a,
.sg-footer-ad a,
button[type="submit"],
input[type="submit"] {
  min-height: 44px;
  border-radius: 999px;
  font-weight: 760;
  transition: transform 200ms cubic-bezier(0.2, 0, 0, 1), background-color 200ms cubic-bezier(0.2, 0, 0, 1), border-color 200ms cubic-bezier(0.2, 0, 0, 1), box-shadow 200ms cubic-bezier(0.2, 0, 0, 1);
}

.sg-button:hover,
.sg-ad-banner a:hover,
.sg-footer-ad a:hover {
  transform: translateY(-2px);
}

.sg-button:active,
.sg-ad-banner a:active,
.sg-footer-ad a:active {
  transform: translateY(0);
}

.sg-button-primary {
  border-color: var(--sg-green);
  background: var(--sg-green);
  color: #ffffff;
  box-shadow: 0 8px 20px rgba(0, 107, 60, 0.18);
}

.sg-wrap a.sg-button-primary,
.sg-wrap button.sg-button-primary {
  color: #ffffff;
}

html.dark .sg-button-primary,
html.dark .sg-wrap a.sg-button-primary,
html.dark .sg-wrap button.sg-button-primary {
  color: #07150f;
}

.sg-button-secondary {
  border-color: var(--sg-line);
  background: var(--sg-panel);
  color: var(--sg-green-dark);
}

.sg-button-secondary:hover {
  border-color: var(--sg-green);
  background: var(--sg-soft);
}

.sg-form :where(input:not([type="checkbox"]):not([type="radio"]), select, textarea),
.sg-filter-panel :where(input:not([type="checkbox"]):not([type="radio"]), select, textarea),
.sg-finder-form :where(input, select),
.hp-form :where(input:not([type="checkbox"]):not([type="radio"]), select, textarea) {
  min-height: 48px;
  border: 1px solid var(--sg-line) !important;
  border-radius: 10px !important;
  background-color: var(--sg-panel) !important;
  color: var(--sg-ink) !important;
  box-shadow: none;
}

.sg-form :where(input, select, textarea):focus,
.sg-filter-panel :where(input, select, textarea):focus,
.sg-finder-form :where(input, select):focus,
.hp-form :where(input, select, textarea):focus {
  border-color: var(--sg-green) !important;
  box-shadow: 0 0 0 3px rgba(0, 107, 60, 0.16) !important;
}

html.dark .sg-form :where(input, select, textarea):focus,
html.dark .sg-filter-panel :where(input, select, textarea):focus,
html.dark .sg-finder-form :where(input, select):focus,
html.dark .hp-form :where(input, select, textarea):focus {
  box-shadow: 0 0 0 3px rgba(104, 211, 145, 0.2) !important;
}

input[type="checkbox"],
input[type="radio"] {
  min-width: 20px;
  min-height: 20px;
  accent-color: var(--sg-green);
}

/* Directory, cards and profiles */
.sg-hero__panel,
.sg-panel,
.sg-card,
.sg-filter-panel,
.sg-service-card,
.sg-guide-card,
.sg-resource-section,
.sg-faq-list details,
.sg-package-card,
.hp-listing,
.hp-form {
  border-color: var(--sg-line);
  border-radius: var(--sg-radius);
  background: var(--sg-panel);
  color: var(--sg-ink);
  box-shadow: var(--sg-shadow);
}

.sg-filter-panel {
  border-top: 5px solid var(--sg-green);
  background: linear-gradient(180deg, var(--sg-soft), var(--sg-panel) 120px);
}

.sg-directory-owner-panel,
.sg-claim-band,
.sg-band,
.sg-ranking-note,
.sg-installer-seo-panel,
.sg-profile-cta {
  border: 1px solid var(--sg-line);
  border-left: 6px solid var(--sg-amber);
  border-radius: 16px;
  background: linear-gradient(110deg, var(--sg-orange-soft), var(--sg-panel));
  color: var(--sg-ink);
  box-shadow: 0 12px 32px rgba(0, 77, 42, 0.08);
}

.sg-card,
.sg-service-card,
.sg-guide-card,
.sg-package-card {
  transition: transform 200ms cubic-bezier(0.2, 0, 0, 1), box-shadow 200ms cubic-bezier(0.2, 0, 0, 1), border-color 200ms cubic-bezier(0.2, 0, 0, 1);
}

.sg-card:hover,
.sg-service-card:hover,
.sg-guide-card:hover,
.sg-package-card:hover {
  transform: translateY(-3px);
  border-color: rgba(0, 107, 60, 0.42);
  box-shadow: var(--sg-shadow-raised);
}

.sg-listing-grid-featured .sg-card,
.sg-card:has(.sg-card__badges span:first-child) {
  border-top: 5px solid var(--sg-amber);
}

.sg-card__mark {
  background: linear-gradient(135deg, #006b3c 0 62%, #ff883e 62% 100%);
  color: #ffffff;
  box-shadow: 0 8px 18px rgba(0, 77, 42, 0.2);
}

.sg-tags span,
.sg-chip-list button,
.sg-card__badges span,
.sg-rating-row span {
  border: 1px solid var(--sg-line);
  border-radius: 999px;
  background: var(--sg-soft);
  color: var(--sg-green-dark);
}

.sg-card__badges span:first-child,
.sg-guide-card-featured::before,
.sg-package-card-featured::before {
  background: var(--sg-orange-soft);
  color: var(--sg-ink);
}

.sg-score {
  background: var(--sg-green);
  color: #ffffff;
}

html.dark .sg-score {
  color: #07150f;
}

.sg-listing-media,
.sg-map-panel,
.sg-map-default,
.sg-calculator-map {
  border-color: var(--sg-line);
  border-radius: 14px;
  background-color: var(--sg-soft);
  overflow: hidden;
}

.sg-profile-hero {
  padding: clamp(28px, 5vw, 52px);
  border-radius: 24px;
  background:
    linear-gradient(120deg, rgba(0, 77, 42, 0.97), rgba(0, 107, 60, 0.86)),
    url("solar-page-header.svg") center / cover no-repeat;
  color: #ffffff;
  box-shadow: var(--sg-shadow-raised);
}

.sg-profile-hero h1,
.sg-profile-hero h2,
.sg-profile-hero p,
.sg-profile-hero .sg-small,
.sg-profile-hero a:not(.sg-button) {
  color: #ffffff;
}

.sg-profile-hero h2 {
  margin: 0 0 12px;
  font-size: clamp(34px, 5vw, 54px);
  line-height: 1.02;
}

.sg-profile-hero .sg-eyebrow {
  color: #ffb483;
}

.sg-profile-hero .sg-profile-cta .sg-icon-link {
  color: #004d2a;
}

html.dark .sg-profile-hero .sg-profile-cta .sg-icon-link {
  color: #a1e4ba;
}

.sg-profile-kpis div,
.sg-trust-strip div,
.sg-claim-flywheel div,
.sg-result-kpis div {
  border-color: var(--sg-line);
  border-radius: 14px;
  background: var(--sg-panel);
}

.sg-profile-kpis div {
  min-width: 0;
}

.sg-profile-kpis dt {
  color: #004d2a;
  font-size: 14px;
  line-height: 1.25;
  overflow-wrap: normal;
}

.sg-profile-kpis dd {
  color: #53665b;
  font-size: 12px;
  line-height: 1.4;
}

/* Native HivePress profile shell */
.single-hp_listing .hp-page.hp-listing {
  border: 1px solid var(--sg-line);
  border-radius: 20px;
  background: var(--sg-panel);
  box-shadow: var(--sg-shadow);
  overflow: hidden;
}

.single-hp_listing .hp-page__content,
.single-hp_listing .hp-page__sidebar {
  padding: 24px;
}

.single-hp_listing .hp-listing__title {
  color: var(--sg-ink);
  font-size: clamp(32px, 4vw, 48px);
  line-height: 1.05;
}

.single-hp_listing .hp-page__topbar {
  border-color: var(--sg-line);
}

.single-hp_listing .hp-menu--tabbed .hp-menu__item--current a {
  border-color: var(--sg-amber);
  color: var(--sg-green-dark);
}

.single-hp_listing .hp-listing__attributes--primary .hp-listing__attribute {
  margin-bottom: 12px;
  padding: 18px;
  border: 1px solid var(--sg-line);
  border-left: 4px solid var(--sg-green);
  border-radius: 12px;
  background: var(--sg-soft);
  color: var(--sg-ink);
}

.single-hp_listing .hp-listing__actions--primary {
  padding: 16px;
  border: 1px solid var(--sg-line);
  border-radius: 12px;
  background: var(--sg-orange-soft);
}

.single-hp_listing .hp-listing__actions--primary .hp-listing__action {
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--sg-green-dark);
}

/* Guides, tables, messages and sponsorship */
.sg-guide-main,
.sg-guide-side,
.sg-resource-page,
.entry-content {
  color: var(--sg-ink);
}

.sg-guide-table th {
  background: var(--sg-soft);
  color: var(--sg-green-dark);
}

.sg-guide-table :where(th, td) {
  border-color: var(--sg-line);
}

.sg-faq-list summary {
  min-height: 48px;
  color: var(--sg-green-dark);
}

.sg-form-status.is-good,
.woocommerce-message,
.hp-form__messages--success {
  border-left: 4px solid var(--sg-green);
  border-radius: 10px;
  background: var(--sg-soft);
  color: var(--sg-ink);
}

.sg-form-status.is-bad,
.woocommerce-error,
.hp-form__messages--error {
  border-left: 4px solid #c4372d;
  border-radius: 10px;
  background: #fff0ef;
  color: #5d1712;
}

html.dark .sg-form-status.is-bad,
html.dark .woocommerce-error,
html.dark .hp-form__messages--error {
  background: #3d1916;
  color: #ffc6c0;
}

.sg-ad-banner,
.sg-text-ad {
  border-color: var(--sg-line);
  border-radius: 14px;
  background: linear-gradient(100deg, var(--sg-orange-soft), var(--sg-panel));
  color: var(--sg-ink);
  box-shadow: var(--sg-shadow);
}

.sg-ad-banner span,
.sg-text-ad span,
.sg-footer-ad span,
.sg-section-kicker {
  color: var(--sg-amber);
}

.sg-ad-banner a {
  background: var(--sg-green);
  color: #ffffff;
}

html.dark .sg-ad-banner a {
  color: #07150f;
}

/* Footer and theme control */
.sg-site-footer {
  position: relative;
  padding-top: clamp(38px, 6vw, 64px);
  background:
    linear-gradient(180deg, rgba(0, 77, 42, 0.97), rgba(0, 45, 25, 0.99)),
    url("solar-page-header.svg") center / cover no-repeat;
}

.sg-footer-ad {
  border-color: rgba(255, 255, 255, 0.24);
  border-left: 6px solid #ff883e;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.sg-footer-ad a {
  background: #ff883e;
  color: #12231a;
}

.sg-footer-columns a:focus-visible,
.sg-footer-bottom a:focus-visible {
  outline-color: #ffb483 !important;
}

.sg-theme-toggle {
  position: fixed;
  left: 16px;
  bottom: 16px;
  z-index: 1090;
  min-width: 88px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 14px;
  border: 1px solid rgba(0, 107, 60, 0.28);
  border-radius: 999px;
  background: rgba(255, 253, 247, 0.92);
  color: #004d2a;
  font-size: 13px;
  font-weight: 760;
  box-shadow: 0 8px 28px rgba(0, 77, 42, 0.2);
  cursor: pointer;
  backdrop-filter: blur(18px) saturate(160%);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
}

.sg-theme-toggle:hover {
  transform: translateY(-2px);
  border-color: #006b3c;
}

.sg-theme-toggle svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.sg-theme-toggle__sun,
html.dark .sg-theme-toggle__moon {
  display: none;
}

html.dark .sg-theme-toggle__sun {
  display: block;
}

html.dark .sg-theme-toggle {
  border-color: rgba(104, 211, 145, 0.34);
  background: rgba(12, 33, 24, 0.92);
  color: #f4f7f2;
}

/* Dark surface repair for third-party WordPress and HivePress markup */
html.dark :where(.entry-content-wrap, .hp-page, .hp-listing, .hp-form, .hp-modal__body, .woocommerce, .woocommerce-page) {
  color: var(--sg-ink);
}

html.dark :where(.hp-listing, .hp-form, .hp-modal__body, .woocommerce form, .woocommerce table) {
  border-color: var(--sg-line);
  background: var(--sg-panel);
}

html.dark :where(.hp-listing__title, .hp-field__label, .hp-form__label, .woocommerce label, .woocommerce h2, .woocommerce h3) {
  color: var(--sg-ink);
}

@media (max-width: 780px) {
  .sg-wrap {
    padding-right: 16px;
    padding-left: 16px;
  }

  .sg-wrap > .sg-hero {
    margin-top: 20px;
    padding: 32px 20px;
    border-radius: 20px;
  }

  .sg-wrap > .sg-hero h1,
  .sg-page-head h1,
  .sg-profile-hero h1 {
    font-size: clamp(36px, 12vw, 52px);
    line-height: 1.02;
  }

  .sg-profile-hero {
    padding: 28px 20px;
    border-radius: 18px;
  }

  .sg-button,
  .sg-actions .sg-button,
  .sg-card-actions .sg-button,
  .sg-profile-actions .sg-button {
    width: 100%;
  }

  .sg-theme-toggle {
    left: 12px;
    bottom: 12px;
    min-width: 44px;
    padding: 0 12px;
  }

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

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
