/*
Theme Name: Empowering You Disability Services
Theme URI: https://eyds.net.au
Author: EYDS
Description: Custom NDIS provider theme with Elementor support (Theme Builder header/footer locations, full-width canvas compatible).
Version: 1.3.0
Requires at least: 6.0
Requires PHP: 7.4
License: GPL-2.0-or-later
Text Domain: eyds
*/

:root {
  --teal: #6ABBCB;
  --teal-dark: #4A9AAB;
  --teal-light: #E0F1F5;
  --dark: #313131;
  --darker: #3D3D3D;
  --gray: #666666;
  --light-bg: #EEEEEE;
  --white: #FFFFFF;
  --purple: #584FAA;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: 'Source Sans 3', 'Source Sans Pro', sans-serif;
  background: var(--light-bg);
  color: var(--dark);
  line-height: 1.6;
}
img { max-width: 100%; height: auto; }

/* Top bar */
.topbar {
  background: var(--teal); color: var(--white); font-size: 0.9rem;
  padding: 0.5rem 5%; display: flex; justify-content: space-between;
  align-items: center; flex-wrap: wrap; gap: 0.75rem 1.5rem;
}
.topbar a { color: var(--white); text-decoration: none; font-weight: 600; transition: opacity 0.2s; }
.topbar a:hover { opacity: 0.85; text-decoration: underline; }
.topbar-left, .topbar-right { display: flex; align-items: center; gap: 1.25rem; flex-wrap: wrap; }
.topbar span { opacity: 0.95; }

/* Header */
.site-header {
  background: var(--white); padding: 0.75rem 5%; display: flex;
  justify-content: space-between; align-items: center;
  box-shadow: 0 2px 10px rgba(0,0,0,0.05); position: sticky; top: 0; z-index: 100;
}
.admin-bar .site-header { top: 32px; }
@media (max-width: 782px) { .admin-bar .site-header { top: 46px; } }
.logo img, .logo .custom-logo { height: 110px; width: auto; display: block; }
.main-nav ul { list-style: none; display: flex; gap: 1.5rem; align-items: center; }
.main-nav li { position: relative; }
.main-nav > ul > li > a {
  text-decoration: none; color: rgb(49,49,49); font-weight: 600;
  transition: color 0.2s; padding: 0.5rem 0; display: flex; align-items: center; gap: 0.35rem;
}
.main-nav a:hover, .main-nav a:focus,
.main-nav .current-menu-item > a, .main-nav .current_page_item > a { color: var(--teal); }
.main-nav .menu-item-has-children > a::after {
  content: "▾"; font-size: 0.75em; opacity: 0.7; transition: transform 0.2s;
}
.main-nav .menu-item-has-children:hover > a::after,
.main-nav .menu-item-has-children:focus-within > a::after { transform: rotate(180deg); opacity: 1; }
.main-nav .sub-menu {
  position: absolute; top: calc(100% + 4px); left: 0; background: var(--white);
  min-width: 240px; box-shadow: 0 10px 30px rgba(0,0,0,0.12); border-radius: 8px;
  padding: 0.4rem 0; opacity: 0; visibility: hidden; transform: translateY(8px);
  transition: all 0.2s ease; z-index: 200; display: flex; flex-direction: column; gap: 0;
}
.main-nav .sub-menu li { width: 100%; }
.main-nav li:hover > .sub-menu, .main-nav li:focus-within > .sub-menu {
  opacity: 1; visibility: visible; transform: translateY(0);
}
.main-nav .sub-menu a {
  padding: 0.65rem 1.25rem; font-weight: 500; color: var(--dark);
  white-space: nowrap; display: block; text-decoration: none;
}
.main-nav .sub-menu a:hover { background: var(--teal-light); color: var(--teal-dark); }

.cta-btn, .btn {
  background: var(--teal); color: var(--white); padding: 0.75rem 1.5rem;
  border-radius: 50px; text-decoration: none; font-weight: 600; display: inline-block;
  transition: background 0.2s, transform 0.2s; border: none; cursor: pointer;
}
.cta-btn:hover, .btn:hover { background: var(--teal-dark); transform: translateY(-2px); }

/* Hero */
.hero {
  background-image: linear-gradient(rgba(0,0,0,0.45), rgba(0,0,0,0.45)), var(--hero-image);
  padding: 5rem 5%; text-align: center; min-height: 60vh; display: flex;
  flex-direction: column; justify-content: center; align-items: center;
  background-size: cover; background-position: center; position: relative;
}
.hero h1 { font-size: 2.8rem; color: var(--white); margin-bottom: 1rem; max-width: 800px; text-shadow: 0 2px 8px rgba(0,0,0,0.4); }
.hero p { font-size: 1.2rem; color: var(--white); max-width: 700px; margin-bottom: 2rem; text-shadow: 0 1px 6px rgba(0,0,0,0.35); }

/* Sections */
.services { padding: 4rem 5%; background: var(--white); }
.section-title { text-align: center; font-size: 2.2rem; margin-bottom: 2.5rem; color: var(--darker); }
.service-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 2rem; }
.service-card {
  background: var(--light-bg); border-radius: 12px; border-top: 4px solid var(--teal);
  transition: transform 0.2s, box-shadow 0.2s; overflow: hidden;
}
.service-card img { width: 100%; height: 180px; object-fit: cover; display: block; }
.service-card .card-content { padding: 1.4rem 1.6rem 1.6rem; }
.service-card:hover { transform: translateY(-5px); box-shadow: 0 8px 20px rgba(106,187,203,0.2); }
.service-card h3 { color: var(--teal-dark); margin-bottom: 0.8rem; }
.about, .values, .contact-section { padding: 4rem 5%; }
.about { background: var(--teal-light); }
.values { background: var(--white); }
.contact-section { background: var(--teal-light); text-align: center; }
.contact-box { max-width: 600px; margin: 2rem auto; text-align: left; background: #fff; padding: 2rem; border-radius: 12px; }
.contact-box a { color: var(--teal-dark); }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 3rem; align-items: center; max-width: 1100px; margin: 0 auto; }
.values-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 1.5rem; margin-top: 2rem; }
.value-card { background: var(--light-bg); padding: 1.5rem; border-radius: 10px; text-align: center; }
.value-card h4 { color: var(--purple); margin-bottom: 0.5rem; }

/* Generic content (non-Elementor pages/posts) */
.site-content { max-width: 1100px; margin: 0 auto; padding: 3rem 5%; background: var(--white); }
.site-content h1, .site-content h2 { margin-bottom: 1rem; color: var(--darker); }
.site-content p { margin-bottom: 1rem; }

/* Footer */
.site-footer {
  background: linear-gradient(180deg, #2a2a2a 0%, var(--darker) 100%);
  color: var(--white); padding: 3.5rem 5% 1.5rem;
}
.footer-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 2.5rem; margin-bottom: 2.5rem; font-size: 0.95rem; }
.site-footer h4 { color: var(--teal); margin-bottom: 1rem; font-size: 1.15rem; position: relative; padding-bottom: 0.4rem; }
.site-footer h4::after { content: ''; position: absolute; bottom: 0; left: 0; width: 40px; height: 2px; background: var(--teal); }
.site-footer p, .site-footer li { margin-bottom: 0.45rem; color: #e0e0e0; line-height: 1.5; }
.site-footer a { color: var(--teal); text-decoration: none; transition: color 0.2s; }
.site-footer a:hover { text-decoration: underline; color: #fff; }
.site-footer ul { list-style: none; padding: 0; }
.copyright { text-align: center; border-top: 1px solid rgba(255,255,255,0.08); padding-top: 1.2rem; font-size: 0.9rem; color: #aaa; }

/* ---------- Responsive ---------- */

/* Mobile nav controls are hidden on desktop. */
.nav-toggle, .sub-toggle { display: none; }
.nav-toggle {
  background: none; border: 0; cursor: pointer; width: 48px; height: 48px;
  padding: 12px; flex-direction: column; justify-content: center; gap: 6px; border-radius: 8px;
}
.nav-toggle:focus-visible, .sub-toggle:focus-visible { outline: 3px solid var(--teal); outline-offset: 2px; }
.nav-toggle-bar { display: block; height: 3px; width: 100%; background: var(--dark); border-radius: 2px; transition: transform 0.25s, opacity 0.2s; }
.site-header.is-open .nav-toggle-bar:nth-child(1) { transform: translateY(9px) rotate(45deg); }
.site-header.is-open .nav-toggle-bar:nth-child(2) { opacity: 0; }
.site-header.is-open .nav-toggle-bar:nth-child(3) { transform: translateY(-9px) rotate(-45deg); }

/* Large tablet & below: collapsible menu */
@media (max-width: 1100px) {
  .site-header { flex-wrap: wrap; gap: 0; padding: 0.5rem 5%; }
  .logo img, .logo .custom-logo { height: 72px; }
  .nav-toggle { display: flex; }
  .main-nav, .site-header > .cta-btn { display: none; width: 100%; order: 3; }
  .site-header.is-open .main-nav { display: block; max-height: calc(100vh - 160px); overflow-y: auto; padding: 0.5rem 0; border-top: 1px solid var(--light-bg); margin-top: 0.5rem; }
  .site-header.is-open > .cta-btn { display: block; text-align: center; margin: 0.5rem 0 0.75rem; order: 4; }

  .main-nav ul { flex-direction: column; align-items: stretch; gap: 0; }
  .main-nav > ul > li { border-bottom: 1px solid var(--light-bg); }
  .main-nav > ul > li > a { padding: 0.9rem 0; min-height: 48px; }
  .main-nav .menu-item-has-children > a::after { display: none; }
  .main-nav .menu-item-has-children { display: flex; flex-wrap: wrap; align-items: center; }
  .main-nav .menu-item-has-children > a { flex: 1; }
  .sub-toggle {
    display: flex; align-items: center; justify-content: center; width: 48px; height: 48px;
    background: none; border: 0; cursor: pointer; font-size: 1.1rem; color: var(--dark);
  }
  .sub-toggle span { transition: transform 0.2s; }
  .menu-item-has-children.is-open > .sub-toggle span { transform: rotate(180deg); }

  /* Submenus become inline accordions (override desktop hover dropdown) */
  .main-nav .sub-menu {
    position: static; display: none; width: 100%; opacity: 1; visibility: visible; transform: none;
    box-shadow: none; border-radius: 0; background: var(--teal-light); padding: 0.25rem 0; transition: none;
  }
  .main-nav .menu-item-has-children.is-open > .sub-menu { display: flex; }
  .main-nav li:hover > .sub-menu, .main-nav li:focus-within > .sub-menu { transform: none; }
  .main-nav .sub-menu a { white-space: normal; padding: 0.75rem 1.25rem; min-height: 44px; }
}

/* Tablet */
@media (max-width: 900px) {
  .two-col { grid-template-columns: 1fr; gap: 2rem; }
  .services, .about, .values, .contact-section { padding: 3rem 5%; }
  .section-title { font-size: 1.9rem; margin-bottom: 2rem; }
  .hero { min-height: 50vh; padding: 4rem 5%; }
  .hero h1 { font-size: clamp(2rem, 6vw, 2.5rem); }
  .site-content { padding: 2rem 5%; }
}

/* Mobile */
@media (max-width: 600px) {
  .topbar { justify-content: center; text-align: center; font-size: 0.85rem; padding: 0.5rem 4%; }
  .topbar-left, .topbar-right { justify-content: center; gap: 0.5rem 1rem; }
  .logo img, .logo .custom-logo { height: 60px; }
  .hero { min-height: 0; padding: 3rem 5%; }
  .hero h1 { font-size: 1.9rem; }
  .hero p { font-size: 1.05rem; margin-bottom: 1.25rem; }
  .section-title { font-size: 1.6rem; margin-bottom: 1.5rem; }
  .services, .about, .values, .contact-section { padding: 2.5rem 5%; }
  .service-grid { grid-template-columns: 1fr; gap: 1.25rem; }
  .service-card img { height: 160px; }
  .values-grid { grid-template-columns: 1fr; }
  .btn, .cta-btn { padding: 0.85rem 1.5rem; min-height: 48px; }
  .contact-box { padding: 1.25rem; margin: 1.5rem 0; }
  .site-footer { padding: 2.5rem 5% 1.25rem; }
  .footer-grid { grid-template-columns: 1fr; gap: 1.75rem; }
}

/* Small phones */
@media (max-width: 380px) {
  .topbar-right span:last-child { display: none; }
  .hero h1 { font-size: 1.65rem; }
}

/* Touch devices: skip hover lift effects */
@media (hover: none) {
  .service-card:hover, .btn:hover, .cta-btn:hover { transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}

/* ---------- Service card as Elementor widget / link ---------- */
a.service-card { display: block; color: inherit; text-decoration: none; }
a.service-card:focus-visible { outline: 3px solid var(--teal-dark); outline-offset: 3px; }
.elementor-widget-eyds-service-card, .elementor-widget-eyds-service-card .elementor-widget-container { height: 100%; }
.elementor-widget-eyds-service-card .service-card { height: 100%; }
.service-card .card-title { color: var(--teal-dark); margin-bottom: 0.8rem; font-size: 1.17rem; }

/* ---------- Hero as Elementor widget ---------- */
.hero {
  background-image: linear-gradient(var(--hero-overlay, rgba(0,0,0,0.45)), var(--hero-overlay, rgba(0,0,0,0.45))), var(--hero-image);
}
.hero-buttons { display: flex; flex-wrap: wrap; gap: 1rem; justify-content: center; }
.hero .btn.btn-outline { background: transparent; border: 2px solid var(--white); }
.hero .btn.btn-outline:hover { background: var(--white); color: var(--teal-dark); }
.eyds-hero-align-left .hero { text-align: left; align-items: flex-start; }
.eyds-hero-align-left .hero-buttons { justify-content: flex-start; }
.eyds-hero-align-right .hero { text-align: right; align-items: flex-end; }
.eyds-hero-align-right .hero-buttons { justify-content: flex-end; }
.eyds-hero-align-center .hero { text-align: center; align-items: center; }
