/* =============================================
   TWFG INSURANCE — CUSTOM STYLES
   ============================================= */

/* --- TOP BAR --- */
.twfg-topbar { background:#114850;color:#fff;padding:.45rem 0;font-size:.78rem;font-weight:500; }
.twfg-topbar-inner { display:flex;justify-content:space-between;align-items:center;gap:1rem;color:rgba(255,255,255,.8); }
.twfg-topbar-inner svg { vertical-align:middle;margin-right:.3rem; }
.twfg-topbar a { color:rgba(255,255,255,.75);text-decoration:none;margin-left:1.25rem;transition:color .15s; }
.twfg-topbar a:hover { color:#fff;opacity:1; }

/* --- HERO --- */
.twfg-hero { position:relative;overflow:hidden;padding:5rem 0 4rem;background:linear-gradient(to right,#C8DEE3 0%,#EAF1F4 35%,#ffffff 55%,#ffffff 100%); }
.twfg-hero-diagonal { position:absolute;top:0;right:0;bottom:0;width:48%;background:#ffffff;clip-path:polygon(12% 0,100% 0,100% 100%,0 100%);z-index:0; }
.twfg-hero-inner { display:grid;grid-template-columns:1fr 1fr;gap:3rem;position:relative;z-index:1;align-items:center; }
.twfg-hero-content { max-width:620px; }
.twfg-eyebrow { display:inline-flex;align-items:center;gap:.5rem;background:rgba(62,107,124,.12);border:1px solid rgba(62,107,124,.2);color:#3E6B7C;border-radius:999px;padding:.4rem 1rem;font-size:.78rem;font-weight:600;letter-spacing:.04em;margin-bottom:1.5rem; }
.twfg-hero-title { font-family:'Jost',sans-serif;font-size:clamp(2.2rem,5vw,3.5rem);font-weight:700;line-height:1.1;letter-spacing:-.02em;color:#1E2B2E;margin-bottom:1.25rem; }
.twfg-hero-title span { color:#3E6B7C; }
.twfg-hero-desc { font-size:1.05rem;color:#515159;line-height:1.7;margin-bottom:2rem;max-width:52ch; }
.twfg-hero-actions { display:flex;gap:1rem;flex-wrap:wrap;margin-bottom:2rem; }

/* --- BUTTONS ---
   Single source of truth for every CTA across the theme. Variants are
   composable: `.twfg-btn .twfg-btn-coral`, `.twfg-btn .twfg-btn-teal
   .twfg-btn-sm`, `.twfg-btn .twfg-btn-coral .twfg-btn-block`, etc.
   Do NOT inline-style buttons in templates — add a new variant here.
*/
.twfg-btn { display:inline-flex;align-items:center;justify-content:center;gap:.5rem;padding:.8rem 1.75rem;font-size:.9rem;font-weight:600;border-radius:6px;border:2px solid transparent;cursor:pointer;text-decoration:none;transition:background-color .2s, color .2s, border-color .2s, transform .2s, box-shadow .2s, opacity .2s;font-family:'Jost',sans-serif;line-height:1;white-space:nowrap; }
.twfg-btn:focus-visible { outline:3px solid rgba(234,109,103,.45);outline-offset:2px; }

/* Color variants */
.twfg-btn-coral { background:#EA6D67;color:#fff;box-shadow:0 2px 12px rgba(234,109,103,.3); }
.twfg-btn-coral:hover { background:#d4574f;transform:translateY(-2px);color:#fff;opacity:1; }
.twfg-btn-teal { background:#3E6B7C;color:#fff;box-shadow:0 2px 12px rgba(62,107,124,.25); }
.twfg-btn-teal:hover { background:#2f5663;transform:translateY(-2px);color:#fff;opacity:1; }
.twfg-btn-outline { background:transparent;color:#3E6B7C;border-color:#3E6B7C; }
.twfg-btn-outline:hover { background:#3E6B7C;color:#fff;opacity:1; }
.twfg-btn-white { background:#fff;color:#3E6B7C;font-weight:700; }
.twfg-btn-white:hover { background:#EAF1F4;color:#3E6B7C;opacity:1; }
.twfg-btn-outline-white { background:transparent;color:#fff;border-color:rgba(255,255,255,.4); }
.twfg-btn-outline-white:hover { background:rgba(255,255,255,.1);border-color:#fff;color:#fff;opacity:1; }

/* Size + width modifiers (combine with any color variant) */
.twfg-btn-sm { padding:.65rem 1.25rem;font-size:.85rem; }
.twfg-btn-lg { padding:.95rem 2rem;font-size:1rem; }
.twfg-btn-block { display:flex;width:100%; }

/* Disabled */
.twfg-btn[disabled], .twfg-btn.is-disabled { opacity:.55;cursor:not-allowed;pointer-events:none; }

/* --- CHIPS (pill filters) ---
   For type/category filters where a button shape would be too heavy.
*/
.twfg-chip { display:inline-flex;align-items:center;gap:.3rem;padding:.3rem .75rem;border-radius:999px;font-size:.78rem;font-weight:600;text-decoration:none;background:#EAF1F4;color:#515159;font-family:'Jost',sans-serif;transition:background-color .15s, color .15s, transform .15s;border:0;cursor:pointer;line-height:1.4; }
.twfg-chip:hover { background:#D0DDE2;color:#1E2B2E;transform:translateY(-1px); }
.twfg-chip.is-active { background:#3E6B7C;color:#fff; }
.twfg-chip.is-active:hover { background:#2f5663;color:#fff; }

/* --- TRUST ROW --- */
.twfg-trust-row { display:flex;gap:1.5rem;flex-wrap:wrap; }
.twfg-trust-item { display:flex;align-items:center;gap:.4rem;font-size:.82rem;font-weight:500;color:#515159; }

/* --- CARRIERS --- */
.twfg-carriers { background:#fff;padding:2rem 0;border-top:1px solid #D0DDE2;border-bottom:1px solid #D0DDE2; }
.twfg-carriers-label { font-size:.72rem;font-weight:600;letter-spacing:.12em;text-transform:uppercase;color:#515159;text-align:center;margin-bottom:1.25rem; }
.twfg-carriers-row { display:flex;align-items:center;justify-content:center;gap:1rem;flex-wrap:wrap; }
.twfg-carrier { padding:.45rem 1.1rem;border-radius:6px;border:1px solid #D0DDE2;font-size:.8rem;font-weight:700;color:#515159;background:#fff;transition:all .15s; }
.twfg-carrier:hover { border-color:#3E6B7C;color:#3E6B7C; }

/* --- STATS --- */
.twfg-stats { background:#3E6B7C;padding:2.5rem 0; }
.twfg-stats-inner { display:grid;grid-template-columns:repeat(4,1fr);gap:2rem;text-align:center; }
.twfg-stat-num { font-family:'Jost',sans-serif;font-size:2.8rem;font-weight:700;line-height:1;color:#fff;letter-spacing:-.03em;margin-bottom:.35rem; }
.twfg-stat-lbl { font-size:.82rem;color:rgba(255,255,255,.7);font-weight:500; }

/* --- SECTIONS --- */
.twfg-section { padding:5rem 0; }
.twfg-section-alt { background:#fff; }
.twfg-section-eyebrow { display:inline-flex;align-items:center;gap:.5rem;font-size:.72rem;font-weight:600;letter-spacing:.12em;text-transform:uppercase;color:#3E6B7C;margin-bottom:.75rem; }
.twfg-section-eyebrow::before { content:'';display:block;width:20px;height:2px;background:#EA6D67;border-radius:2px; }
.twfg-section-title { font-family:'Jost',sans-serif;font-size:clamp(1.8rem,3.5vw,2.6rem);font-weight:700;letter-spacing:-.02em;color:#1E2B2E;line-height:1.15;margin-bottom:.75rem; }
.twfg-section-desc { font-size:1rem;color:#515159;max-width:52ch;margin-bottom:2.5rem;line-height:1.7; }

/* --- COVERAGE GRID --- */
.twfg-coverage-grid { display:grid;grid-template-columns:repeat(4,1fr);gap:1.25rem; }
.twfg-cov-card { background:#fff;border:1.5px solid #D0DDE2;border-radius:12px;padding:1.75rem 1.5rem;transition:all .2s;position:relative;overflow:hidden; }
.twfg-cov-card::after { content:'';position:absolute;bottom:0;left:0;right:0;height:3px;background:linear-gradient(90deg,#3E6B7C,#EA6D67);transform:scaleX(0);transform-origin:left;transition:transform .3s; }
.twfg-cov-card:hover { border-color:#3E6B7C;box-shadow:0 8px 32px rgba(62,107,124,.12);transform:translateY(-4px); }
.twfg-cov-card:hover::after { transform:scaleX(1); }
.twfg-cov-icon { font-size:1.75rem;margin-bottom:1rem; }
.twfg-cov-card h3 { font-family:'Jost',sans-serif;font-size:1.05rem;font-weight:700;color:#1E2B2E;margin-bottom:.5rem; }
.twfg-cov-card p { font-size:.85rem;color:#515159;line-height:1.6;margin-bottom:1rem; }
.twfg-cov-link { font-size:.8rem;font-weight:600;color:#3E6B7C; }

/* --- WHY TWFG --- */
.twfg-why-inner { display:grid;grid-template-columns:1fr 1fr;gap:5rem;align-items:center; }
.twfg-why-visual { background:linear-gradient(135deg,#EAF1F4,#C8DEE3);border-radius:16px;padding:2rem;display:flex;flex-direction:column;gap:1rem; }
.twfg-why-badge { background:#fff;border-radius:10px;padding:1.1rem 1.25rem;box-shadow:0 4px 16px rgba(62,107,124,.1);display:flex;align-items:center;gap:1rem; }
.twfg-why-icon { width:42px;height:42px;border-radius:8px;background:#EAF1F4;display:flex;align-items:center;justify-content:center;font-size:1.2rem;flex-shrink:0; }
.twfg-why-badge h4 { font-size:.88rem;font-weight:700;color:#1E2B2E;margin-bottom:.15rem; }
.twfg-why-badge p { font-size:.78rem;color:#515159;margin:0; }
.twfg-why-list { display:flex;flex-direction:column;gap:1.25rem; }
.twfg-why-item { display:flex;align-items:flex-start;gap:.875rem; }
.twfg-why-check { width:24px;height:24px;border-radius:50%;background:#EAF1F4;color:#3E6B7C;display:flex;align-items:center;justify-content:center;font-size:.8rem;font-weight:700;flex-shrink:0;margin-top:.15rem; }
.twfg-why-item h4 { font-size:.92rem;font-weight:600;color:#1E2B2E;margin-bottom:.2rem; }
.twfg-why-item p { font-size:.85rem;color:#515159;line-height:1.6;margin:0; }

/* --- TESTIMONIALS --- */
.twfg-tgrid { display:grid;grid-template-columns:repeat(3,1fr);gap:1.25rem;margin-top:2.5rem; }
.twfg-tcard { background:#fff;border:1.5px solid #D0DDE2;border-radius:12px;padding:1.75rem;transition:all .2s; }
.twfg-tcard:hover { box-shadow:0 8px 32px rgba(62,107,124,.1);border-color:#3E6B7C; }
.twfg-stars { margin-bottom:.875rem;font-size:.9rem; }
.twfg-tquote { font-size:.9rem;color:#1E2B2E;line-height:1.65;margin-bottom:1.25rem;font-style:italic;font-weight:500; }
.twfg-tauthor { display:flex;align-items:center;gap:.75rem;border-top:1px solid #D0DDE2;padding-top:1rem; }
.twfg-tavatar { width:38px;height:38px;border-radius:50%;background:#3E6B7C;display:flex;align-items:center;justify-content:center;font-size:.8rem;font-weight:700;color:#fff;flex-shrink:0; }
.twfg-tname { font-weight:600;font-size:.85rem;color:#1E2B2E;margin:0; }
.twfg-trole { font-size:.75rem;color:#515159;margin:0; }

/* --- CTA BANNER --- */
.twfg-cta-banner { background:linear-gradient(135deg,#3E6B7C 0%,#114850 100%);border-radius:16px;padding:3.5rem;display:flex;align-items:center;justify-content:space-between;gap:2rem;position:relative;overflow:hidden; }
.twfg-cta-banner::before { content:'';position:absolute;top:-40%;right:0;width:300px;height:300px;border-radius:50%;background:radial-gradient(circle,rgba(234,109,103,.15),transparent 70%);overflow:hidden; }
.twfg-cta-content { position:relative;z-index:1; }
.twfg-cta-banner h2 { font-family:'Jost',sans-serif;color:#fff;font-size:clamp(1.5rem,3vw,2.2rem);font-weight:700;letter-spacing:-.02em;margin-bottom:.5rem; }
.twfg-cta-banner p { color:rgba(255,255,255,.65);font-size:.95rem;max-width:44ch;margin:0; }
.twfg-cta-actions { display:flex;gap:.75rem;flex-shrink:0;flex-wrap:wrap;position:relative;z-index:1; }

/* --- RESPONSIVE --- */
@media(max-width:1024px){
  .twfg-coverage-grid{grid-template-columns:repeat(2,1fr)}
  .twfg-why-inner{grid-template-columns:1fr}
  .twfg-why-visual{display:none}
  .twfg-cta-banner{flex-direction:column;text-align:center}
  .twfg-cta-actions{justify-content:center}
}
@media(max-width:768px){
  .twfg-topbar{display:none}
  .twfg-hero{padding:3rem 0}
  .twfg-hero-diagonal{display:none}
  .twfg-stats-inner{grid-template-columns:repeat(2,1fr)}
  .twfg-coverage-grid{grid-template-columns:1fr 1fr}
  .twfg-tgrid{grid-template-columns:1fr}
  .twfg-cta-banner{padding:2.5rem 1.5rem}
  .twfg-hero-actions{flex-direction:column}
  .twfg-hero-actions .twfg-btn{justify-content:center}
}
@media(max-width:480px){
  .twfg-coverage-grid{grid-template-columns:1fr}
  .twfg-stats-inner{grid-template-columns:1fr 1fr}
}

/* --- FOOTER --- */
.twfg-footer{background:#0E3840;color:#fff;padding:4rem 0 2rem}
.twfg-footer-grid{display:grid;grid-template-columns:1.5fr 1fr 1fr 1.2fr;gap:3rem;padding-bottom:3rem;border-bottom:1px solid rgba(255,255,255,.08);margin-bottom:2rem}
.twfg-footer-name{font-family:'Jost',sans-serif;font-size:1.2rem;font-weight:700;margin-bottom:.5rem}
.twfg-footer-tagline{font-size:.85rem;color:rgba(255,255,255,.45);line-height:1.65;max-width:28ch;margin-bottom:1rem}
.twfg-footer-license{font-size:.72rem;color:rgba(255,255,255,.3);border:1px solid rgba(255,255,255,.1);border-radius:4px;padding:.3rem .6rem;display:inline-block}
.twfg-footer-col-title{font-size:.72rem;font-weight:700;letter-spacing:.1em;text-transform:uppercase;color:rgba(255,255,255,.5);margin-bottom:1rem}
.twfg-footer-links{list-style:none;display:flex;flex-direction:column;gap:.6rem}
.twfg-footer-links a{font-size:.85rem;color:rgba(255,255,255,.45);text-decoration:none;transition:color .15s}
.twfg-footer-links a:hover{color:#EA6D67}
.twfg-footer-contact{display:flex;flex-direction:column;gap:.75rem}
.twfg-contact-item{display:flex;align-items:flex-start;gap:.6rem;font-size:.85rem;color:rgba(255,255,255,.5);line-height:1.5}
.twfg-contact-item svg{flex-shrink:0;margin-top:.15rem}
.twfg-footer-bottom{display:flex;align-items:center;justify-content:space-between;font-size:.75rem;color:rgba(255,255,255,.25);flex-wrap:wrap;gap:.75rem}
.twfg-footer-bottom a{color:rgba(255,255,255,.25);text-decoration:none}
.twfg-footer-bottom a:hover{color:rgba(255,255,255,.6)}
.twfg-footer img{filter:brightness(0) invert(1);max-height:40px;width:auto;margin-bottom:1rem}

@media(max-width:768px){
  .twfg-footer-grid{grid-template-columns:1fr}
  .twfg-footer-bottom{flex-direction:column;text-align:center}
}

/* --- GOOGLE REVIEWS / TRUSTINDEX --- */
.twfg-reviews-wrap { margin-top: 2.5rem; }
.twfg-reviews-wrap .trustindex-reviews-widget { width: 100%; }

/* Make Trustindex cards match TWFG brand */
.twfg-reviews-wrap .ti-widget { font-family: 'Jost', sans-serif !important; }
.twfg-reviews-wrap .ti-review-item { border-radius: 12px !important; border: 1.5px solid #D0DDE2 !important; box-shadow: none !important; }
.twfg-reviews-wrap .ti-review-item:hover { border-color: #3E6B7C !important; box-shadow: 0 8px 32px rgba(62,107,124,.1) !important; }
.twfg-reviews-wrap .ti-star { color: #EA6D67 !important; }
.twfg-reviews-wrap .ti-profile-name { color: #1E2B2E !important; font-weight: 600 !important; }

/* Admin notice */
.twfg-plugin-notice {
    margin-top: 2rem;
    padding: 1rem 1.25rem;
    background: #FDF6E3;
    border: 1px solid #F0D080;
    border-radius: 8px;
    font-size: .875rem;
    color: #555;
    display: none; /* only show to admins via PHP */
}
.twfg-plugin-notice a { color: #3E6B7C; font-weight: 600; }
body.logged-in .twfg-plugin-notice { display: block; }

/* --- MAP --- */
.twfg-map-wrap{background:#fff;border-radius:16px;padding:1.5rem;box-shadow:0 4px 24px rgba(62,107,124,.12);display:flex;flex-direction:column;gap:1rem;}
.twfg-map-header{display:flex;align-items:center;gap:.875rem;}
.twfg-map-icon{width:42px;height:42px;border-radius:8px;background:#EAF1F4;display:flex;align-items:center;justify-content:center;font-size:1.2rem;flex-shrink:0;}
.twfg-map-header h4{font-size:.95rem;font-weight:700;color:#1E2B2E;margin:0 0 .2rem;}
.twfg-map-header p{font-size:.82rem;color:#515159;margin:0;}
.twfg-map-frame{border-radius:10px;overflow:hidden;border:1px solid #D0DDE2;}
.twfg-map-frame iframe{display:block;}
.twfg-map-btn{width:100%;justify-content:center;}

/* --- STATE PHONES TOP BAR --- */
.twfg-topbar-phones{display:flex;align-items:center;gap:.75rem;flex-wrap:wrap}
.twfg-topbar-phones span{display:flex;align-items:center;gap:.35rem;color:rgba(255,255,255,.8);font-size:.78rem}
.twfg-topbar-sep{color:rgba(255,255,255,.3)!important}
.twfg-topbar-phones strong{color:rgba(255,255,255,.6);font-weight:600}

/* --- CARRIER TICKER --- */
.twfg-carriers{background:#fff;padding:2rem 0;border-top:1px solid #D0DDE2;border-bottom:1px solid #D0DDE2;overflow:hidden}
.twfg-ticker-wrap{overflow:hidden;position:relative;margin-top:1rem;width:100%}
.twfg-ticker-wrap::before,
.twfg-ticker-wrap::after{content:'';position:absolute;top:0;bottom:0;width:80px;z-index:2;pointer-events:none}
.twfg-ticker-wrap::before{left:0;background:linear-gradient(to right,#fff,transparent)}
.twfg-ticker-wrap::after{right:0;background:linear-gradient(to left,#fff,transparent)}
.twfg-ticker{
    display:flex !important;
    flex-direction:row !important;
    flex-wrap:nowrap !important;
    width:max-content !important;
    animation:ticker-scroll 30s linear infinite;
}
.twfg-ticker:hover{animation-play-state:paused}
.twfg-ticker-item{
    display:inline-flex !important;
    align-items:center;
    gap:.75rem;
    padding:.5rem 1.5rem;
    white-space:nowrap;
    font-size:.85rem;
    font-weight:700;
    color:#515159;
    letter-spacing:.02em;
}
.twfg-ticker-dot{width:6px;height:6px;border-radius:50%;background:#EA6D67;flex-shrink:0;display:inline-block !important}

@keyframes ticker-scroll{
    0%{transform:translateX(0)}
    100%{transform:translateX(-50%)}
}

@media(max-width:768px){
    .twfg-ticker{animation-duration:20s}
}

/* --- TOP BAR NAVIGATION WITH DROPDOWNS --- */
.twfg-topbar-nav{position:relative}
.twfg-topbar-menu{display:flex;align-items:center;gap:.25rem;list-style:none;margin:0;padding:0}
.twfg-topbar-menu li{position:relative}
.twfg-topbar-menu a{
    display:block;padding:.25rem .65rem;
    font-size:.78rem;font-weight:500;
    color:rgba(255,255,255,.75);
    text-decoration:none;
    border-radius:4px;
    transition:all .15s;
    white-space:nowrap;
}
.twfg-topbar-menu a:hover{color:#fff;background:rgba(255,255,255,.1)}
.twfg-topbar-menu .current-menu-item > a{color:#fff}

/* Dropdown */
.twfg-topbar-menu .sub-menu{
    position:absolute;
    top:calc(100% + 6px);
    right:0;
    min-width:180px;
    background:#0E3840;
    border:1px solid rgba(255,255,255,.1);
    border-radius:8px;
    box-shadow:0 8px 24px rgba(0,0,0,.25);
    opacity:0;
    visibility:hidden;
    transform:translateY(-6px);
    transition:all .2s ease;
    z-index:200;
    padding:.4rem;
    list-style:none;
}
.twfg-topbar-menu li:hover > .sub-menu{
    opacity:1;
    visibility:visible;
    transform:translateY(0);
}
.twfg-topbar-menu .sub-menu a{
    padding:.4rem .75rem;
    border-radius:4px;
    font-size:.78rem;
    color:rgba(255,255,255,.7);
}
.twfg-topbar-menu .sub-menu a:hover{color:#fff;background:rgba(255,255,255,.08)}

/* Arrow indicator for items with children */
.twfg-topbar-menu .menu-item-has-children > a::after{
    content:'▾';
    margin-left:.3rem;
    font-size:.65rem;
    opacity:.6;
}

/* --- WHY CHOOSE US STRIP --- */
.twfg-why-strip{background:#fff;padding:2.5rem 0;border-top:1px solid #D0DDE2;border-bottom:1px solid #D0DDE2}
.twfg-why-strip-inner{display:flex;align-items:center;justify-content:space-between;gap:1rem;flex-wrap:wrap}
.twfg-why-strip-item{display:flex;align-items:center;gap:1rem;flex:1;min-width:160px}
.twfg-why-strip-icon{width:52px;height:52px;border-radius:12px;background:#EAF1F4;display:flex;align-items:center;justify-content:center;color:#3E6B7C;flex-shrink:0}
.twfg-why-strip-item h4{font-family:'Jost',sans-serif;font-size:.92rem;font-weight:700;color:#1E2B2E;margin:0 0 .2rem}
.twfg-why-strip-item p{font-size:.78rem;color:#515159;margin:0;line-height:1.4}
.twfg-why-strip-divider{width:1px;height:48px;background:#D0DDE2;flex-shrink:0}

@media(max-width:1024px){
  .twfg-why-strip-divider{display:none}
  .twfg-why-strip-inner{gap:1.5rem}
  .twfg-why-strip-item{min-width:calc(50% - 1rem)}
}
@media(max-width:600px){
  .twfg-why-strip-item{min-width:100%}
}

/* --- FOOTER MENU OVERRIDES --- */
.twfg-footer-links{list-style:none;padding:0;margin:0}
.twfg-footer-links li{margin-bottom:.6rem}
.twfg-footer-links a{font-size:.85rem;color:rgba(255,255,255,.45);text-decoration:none;transition:color .15s;font-family:'Jost',sans-serif}
.twfg-footer-links a:hover{color:#EA6D67}

/* =============================================
   MOBILE FIXES — COMPREHENSIVE
   ============================================= */

/* --- TABLET (max 1024px) --- */
@media(max-width:1024px){
  /* Coverage grid: 2 columns */
  .twfg-coverage-grid{grid-template-columns:repeat(2,1fr)}

  /* Why TWFG: single column */
  .twfg-why-inner{grid-template-columns:1fr}
  .twfg-why-visual{display:none}

  /* CTA banner: stack */
  .twfg-cta-banner{flex-direction:column;text-align:center;padding:2.5rem 1.5rem}
  .twfg-cta-actions{justify-content:center}

  /* Footer: 2 columns */
  .twfg-footer-grid{grid-template-columns:1fr 1fr;gap:2rem}
}

/* --- MOBILE (max 768px) --- */
@media(max-width:768px){

  /* Top bar: hide on mobile — too crowded */
  .twfg-topbar{display:none}

  /* Hero */
  .twfg-hero{padding:2.5rem 0 2rem}
  .twfg-hero-diagonal{display:none}
  .twfg-hero-title{font-size:2rem}
  .twfg-hero-desc{font-size:.95rem}
  .twfg-hero-actions{flex-direction:column;align-items:stretch}
  .twfg-hero-actions .twfg-btn{justify-content:center;text-align:center}
  .twfg-trust-row{gap:1rem}
  .twfg-trust-item{font-size:.78rem}

  /* Eyebrow badge */
  .twfg-eyebrow{font-size:.7rem;padding:.3rem .75rem}

  /* Why Choose Us strip: 2 columns on mobile */
  .twfg-why-strip{padding:1.75rem 0}
  .twfg-why-strip-inner{gap:1.25rem}
  .twfg-why-strip-item{min-width:calc(50% - .75rem);flex:none}
  .twfg-why-strip-icon{width:40px;height:40px;border-radius:8px}

  /* Coverage grid: 1 column on mobile */
  .twfg-coverage-grid{grid-template-columns:1fr}

  /* Testimonials: 1 column */
  .twfg-tgrid{grid-template-columns:1fr}

  /* Why TWFG section */
  .twfg-why-inner{grid-template-columns:1fr}
  .twfg-section-title{font-size:1.6rem}
  .twfg-section-desc{font-size:.9rem}

  /* CTA banner */
  .twfg-cta-banner{flex-direction:column;text-align:center;padding:2rem 1.25rem;border-radius:10px}
  .twfg-cta-banner h2{font-size:1.4rem}
  .twfg-cta-banner p{font-size:.875rem}
  .twfg-cta-actions{flex-direction:column;align-items:stretch;justify-content:center;width:100%}
  .twfg-cta-actions .twfg-btn{justify-content:center}

  /* Footer: 1 column */
  .twfg-footer-grid{grid-template-columns:1fr;gap:2rem}
  .twfg-footer-bottom{flex-direction:column;gap:.5rem;text-align:center}
  .twfg-footer{padding:3rem 0 1.5rem}

  /* Map */
  .twfg-map-frame iframe{height:200px}

  /* Sections padding */
  .twfg-section{padding:3rem 0}

  /* Container padding */
  .container{padding:0 1.25rem}
}

/* --- SMALL MOBILE (max 480px) --- */
@media(max-width:480px){
  .twfg-hero-title{font-size:1.75rem}
  .twfg-why-strip-item{min-width:100%}
  .twfg-coverage-grid{grid-template-columns:1fr}
  .twfg-eyebrow{font-size:.65rem}
  .twfg-section-title{font-size:1.4rem}
  .twfg-cta-banner{padding:1.75rem 1rem}
  .twfg-btn{padding:.7rem 1.25rem;font-size:.85rem}
}

/* --- HEADER MOBILE --- */
@media(max-width:768px){
  .menu-toggle{display:flex}
  .main-navigation{
    position:fixed;
    inset:70px 0 0 auto;
    width:min(85vw, 340px);
    max-width:100%;
    background:#ffffff;
    flex-direction:column;
    align-items:stretch;
    padding:1rem;
    overflow-y:auto;
    transform:translateX(100%);
    transition:transform .3s ease;
    border-top:1px solid #D0DDE2;
    box-shadow:-8px 0 24px rgba(0,0,0,.12);
    /* Sit above the header (z-index ~50) and the hero, but below the
       toggle button so it stays tappable. */
    z-index:1000;
  }
  .main-navigation.is-open{transform:translateX(0)}
  /* Solid backdrop behind the panel so the hero never shows through
     and taps outside the menu close it (handled in main.js). */
  body.nav-open::after{
    content:"";
    position:fixed;
    inset:0;
    background:rgba(15,30,40,.45);
    z-index:999;
  }
  .main-navigation ul{flex-direction:column;gap:0;width:100%;margin:0;padding:0;list-style:none}
  .main-navigation li{width:100%}
  .main-navigation a{
    display:block;
    width:100%;
    padding:1rem;
    font-size:1rem;
    border-radius:6px;
    background:transparent;
  }
  /* Keep the toggle (X) above the panel and backdrop */
  .menu-toggle{position:relative;z-index:1001}
}

/* =============================================
   MOBILE OVERFLOW & BADGE FIXES
   ============================================= */

/* Prevent horizontal scroll globally */
html, body { overflow-x: hidden; max-width: 100%; }

/* Fix eyebrow badge wrapping on mobile */
@media(max-width:768px){
  .twfg-eyebrow {
    font-size:.68rem;
    padding:.3rem .75rem;
    max-width:100%;
    white-space:normal;
    line-height:1.4;
    display:inline-block;
    text-align:left;
  }
}

/* Fix ticker overflow */
@media(max-width:768px){
  #twfg-ticker,
  .twfg-ticker-wrap,
  .twfg-carriers { overflow:hidden; max-width:100vw; }
}

/* Fix any section overflow */
.twfg-hero,
.twfg-why-strip,
.twfg-section,
.twfg-cta-banner,
.twfg-footer { overflow-x:hidden; }

/* =============================================
   NUCLEAR OVERFLOW FIX
   ============================================= */
html { overflow-x: hidden !important; }
body { overflow-x: hidden !important; max-width: 100vw !important; }
* { box-sizing: border-box; }
#twfg-ticker { overflow: visible; }
.twfg-hero, .twfg-section, .twfg-why-strip,
.twfg-footer, .twfg-cta-banner { max-width: 100%; overflow: hidden; }

/* =============================================
   TICKER SPECIFIC OVERFLOW FIX
   ============================================= */
#twfg-ticker {
    position: relative;
    left: 0;
}
/* The key fix — ticker's parent must use clip-path or overflow:hidden with a set height */
#twfg-ticker ~ div,
#twfg-ticker + div { display: none; }

/* Force ticker container to not affect page layout width */
[style*="max-content"] {
    max-width: none;
}

/* The real fix — contain the ticker */
@media (max-width: 768px) {
    #twfg-ticker {
        animation-duration: 15s;
    }
}

/* =============================================
   GLOBAL OVERFLOW & BOX-SIZING FIX
   ============================================= */
html, body {
  overflow-x: hidden;
  max-width: 100%;
}
* {
  box-sizing: border-box;
}
img, video {
  max-width: 100%;
  height: auto;
}

iframe {
  max-width: 100%;
}

/* =============================================
   EDUCATION CENTER
   ============================================= */

/* Hero */
.edu-hero{background:linear-gradient(135deg,#EAF1F4 0%,#C8DEE3 100%);padding:4rem 0 3rem;overflow:hidden}
.edu-hero-inner{display:grid;grid-template-columns:1fr 1fr;gap:3rem;align-items:center}
.edu-eyebrow{font-size:.78rem;font-weight:600;letter-spacing:.1em;text-transform:uppercase;color:#3E6B7C;margin-bottom:.5rem}
.edu-title{font-family:'Jost',sans-serif;font-size:clamp(2rem,4vw,3rem);font-weight:700;color:#1E2B2E;margin-bottom:.75rem;letter-spacing:-.02em;line-height:1.1}
.edu-desc{font-size:1rem;color:#515159;line-height:1.7;max-width:44ch}

/* Search */
.edu-search-form{width:100%}
.edu-search-wrap{display:flex;align-items:center;background:#fff;border:2px solid #D0DDE2;border-radius:8px;padding:.5rem .5rem .5rem 1rem;gap:.75rem;box-shadow:0 4px 16px rgba(62,107,124,.1)}
.edu-search-wrap svg{color:#3E6B7C;flex-shrink:0}
.edu-search-input{flex:1;border:none;outline:none;font-size:.95rem;font-family:'Jost',sans-serif;color:#1E2B2E;background:transparent}
.edu-search-input::placeholder{color:#a0aec0}
.edu-search-btn{background:#3E6B7C;color:#fff;border:none;border-radius:6px;padding:.6rem 1.25rem;font-size:.875rem;font-weight:600;cursor:pointer;font-family:'Jost',sans-serif;transition:background .15s}
.edu-search-btn:hover{background:#2d5566}

/* Filters Bar */
.edu-filters-bar{background:#fff;border-bottom:1px solid #D0DDE2;padding:.875rem 0;position:sticky;top:70px;z-index:50}
.edu-filters-inner{display:flex;align-items:center;justify-content:space-between;gap:1rem;flex-wrap:wrap}
.edu-type-filters{display:flex;gap:.5rem;flex-wrap:wrap}
.edu-type-pill{display:inline-flex;align-items:center;gap:.3rem;padding:.35rem .875rem;border-radius:999px;font-size:.8rem;font-weight:600;text-decoration:none;border:1.5px solid #D0DDE2;color:#515159;transition:all .15s;background:#fff}
.edu-type-pill:hover{border-color:#3E6B7C;color:#3E6B7C}
.edu-type-pill.active{background:#3E6B7C;color:#fff;border-color:#3E6B7C}
.edu-cat-filter select{border:1.5px solid #D0DDE2;border-radius:6px;padding:.4rem .75rem;font-size:.82rem;font-family:'Jost',sans-serif;color:#1E2B2E;outline:none;cursor:pointer}
.edu-cat-filter select:focus{border-color:#3E6B7C}

/* Featured */
.edu-featured{padding:2.5rem 0 0}
.edu-featured-card{display:grid;grid-template-columns:1.2fr 1fr;gap:2.5rem;align-items:center;background:#fff;border:1.5px solid #D0DDE2;border-radius:16px;overflow:hidden}
.edu-featured-image{position:relative;aspect-ratio:16/9;overflow:hidden}
.edu-featured-image img{width:100%;height:100%;object-fit:cover;transition:transform .4s}
.edu-featured-card:hover .edu-featured-image img{transform:scale(1.03)}
.edu-featured-badge{position:absolute;top:1rem;left:1rem;background:#EA6D67;color:#fff;padding:.3rem .75rem;border-radius:999px;font-size:.75rem;font-weight:700}
.edu-featured-content{padding:2rem 2rem 2rem 0}
.edu-cat-badge{display:inline-block;background:#EAF1F4;color:#3E6B7C;padding:.2rem .65rem;border-radius:4px;font-size:.72rem;font-weight:700;letter-spacing:.04em;text-transform:uppercase;margin-bottom:.75rem}
.edu-featured-title{font-family:'Jost',sans-serif;font-size:1.6rem;font-weight:700;color:#1E2B2E;line-height:1.2;margin-bottom:.75rem;letter-spacing:-.02em}
.edu-featured-title a{color:inherit;text-decoration:none}
.edu-featured-title a:hover{color:#3E6B7C}
.edu-featured-excerpt{color:#515159;font-size:.95rem;line-height:1.7;margin-bottom:1.25rem}
.edu-featured-meta{display:flex;gap:1rem;font-size:.8rem;color:#a0aec0;margin-bottom:1.25rem}
.edu-read-btn{display:inline-flex;align-items:center;gap:.4rem;background:#3E6B7C;color:#fff;padding:.65rem 1.4rem;border-radius:6px;font-size:.875rem;font-weight:600;text-decoration:none;transition:all .2s;font-family:'Jost',sans-serif}
.edu-read-btn:hover{background:#2d5566;transform:translateY(-1px);color:#fff}

/* Grid */
.edu-grid-section{padding:2.5rem 0 4rem}
.edu-search-results-header{display:flex;align-items:center;justify-content:space-between;margin-bottom:1.5rem}
.edu-search-results-header h2{font-size:1.25rem;font-weight:600;color:#1E2B2E}
.edu-search-results-header em{color:#3E6B7C;font-style:normal}
.edu-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:1.5rem}
.edu-card{background:#fff;border:1.5px solid #D0DDE2;border-radius:12px;overflow:hidden;display:flex;flex-direction:column;transition:all .2s}
.edu-card:hover{box-shadow:0 8px 32px rgba(62,107,124,.12);transform:translateY(-3px);border-color:#3E6B7C}
.edu-card-image-wrap{position:relative;aspect-ratio:16/9;overflow:hidden;display:block;background:#EAF1F4}
.edu-card-image{width:100%;height:100%;object-fit:cover;transition:transform .4s;display:block}
.edu-card:hover .edu-card-image{transform:scale(1.04)}
.edu-card-image-placeholder{width:100%;height:100%;display:flex;align-items:center;justify-content:center;font-size:2.5rem;background:#EAF1F4}
.edu-play-btn{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);width:52px;height:52px;background:rgba(234,109,103,.9);border-radius:50%;display:flex;align-items:center;justify-content:center;color:#fff;font-size:1.1rem;transition:all .2s}
.edu-card:hover .edu-play-btn{background:#EA6D67;transform:translate(-50%,-50%) scale(1.1)}
.edu-infographic-badge{position:absolute;bottom:.75rem;left:.75rem;background:rgba(62,107,124,.9);color:#fff;padding:.25rem .65rem;border-radius:4px;font-size:.72rem;font-weight:600}
.edu-card-body{padding:1.25rem;flex:1;display:flex;flex-direction:column}
.edu-card-meta-top{display:flex;align-items:center;gap:.5rem;margin-bottom:.6rem;flex-wrap:wrap}
.edu-type-badge{font-size:.68rem;font-weight:600;padding:.15rem .5rem;border-radius:4px}
.edu-type-badge.article{background:#EAF1F4;color:#3E6B7C}
.edu-type-badge.video{background:#FFF5F5;color:#c53030}
.edu-type-badge.infographic{background:#F0FFF4;color:#276749}
.edu-card-title{font-family:'Jost',sans-serif;font-size:1rem;font-weight:700;color:#1E2B2E;line-height:1.3;margin-bottom:.6rem;flex:1}
.edu-card-title a{color:inherit;text-decoration:none}
.edu-card-title a:hover{color:#3E6B7C}
.edu-card-excerpt{font-size:.82rem;color:#515159;line-height:1.6;margin-bottom:.875rem}
.edu-card-footer{display:flex;align-items:center;justify-content:space-between;font-size:.75rem;color:#a0aec0;border-top:1px solid #f0f4f8;padding-top:.75rem;margin-top:auto}

/* Pagination */
.edu-pagination{display:flex;justify-content:center;gap:.5rem;margin-top:2.5rem;flex-wrap:wrap}
.edu-page-btn{width:38px;height:38px;display:flex;align-items:center;justify-content:center;border-radius:6px;font-size:.85rem;font-weight:600;text-decoration:none;border:1.5px solid #D0DDE2;color:#515159;transition:all .15s}
.edu-page-btn:hover,.edu-page-btn.active{background:#3E6B7C;color:#fff;border-color:#3E6B7C}

/* Empty state */
.edu-empty{text-align:center;padding:4rem 2rem}
.edu-empty-icon{font-size:3rem;margin-bottom:1rem}
.edu-empty h3{font-family:'Jost',sans-serif;font-size:1.25rem;font-weight:700;color:#1E2B2E;margin-bottom:.5rem}
.edu-empty p{color:#515159;margin-bottom:1.5rem}

/* CTA Strip */
.edu-cta-strip{background:linear-gradient(135deg,#3E6B7C,#114850);padding:3rem 0}
.edu-cta-strip-inner{display:flex;align-items:center;justify-content:space-between;gap:2rem}
.edu-cta-strip h3{font-family:'Jost',sans-serif;color:#fff;font-size:1.4rem;font-weight:700;margin-bottom:.35rem}
.edu-cta-strip p{color:rgba(255,255,255,.65);font-size:.9rem;margin:0}
.edu-cta-strip-actions{display:flex;gap:.75rem;flex-shrink:0;flex-wrap:wrap}
.edu-cta-strip .twfg-btn-outline-white{border-color:rgba(255,255,255,.4);color:#fff}

/* Responsive */
@media(max-width:1024px){
  .edu-grid{grid-template-columns:repeat(2,1fr)}
  .edu-featured-card{grid-template-columns:1fr}
  .edu-featured-content{padding:1.5rem}
}
@media(max-width:768px){
  .edu-hero-inner{grid-template-columns:1fr}
  .edu-hero{padding:2.5rem 0 2rem}
  .edu-grid{grid-template-columns:1fr}
  .edu-filters-bar{position:static}
  .edu-filters-inner{flex-direction:column;align-items:flex-start}
  .edu-cta-strip-inner{flex-direction:column;text-align:center}
  .edu-cta-strip-actions{justify-content:center}
  .edu-type-filters{gap:.35rem}
  .edu-type-pill{font-size:.72rem;padding:.3rem .65rem}
}

/* --- HERO FORM CARD --- */
.twfg-hero-form-card{
  background:#fff;
  border-radius:14px;
  box-shadow:0 8px 40px rgba(62,107,124,.18);
  overflow:hidden;
  position:relative;
  z-index:2;
}
.twfg-hero-form-header{
  background:linear-gradient(135deg,#3E6B7C,#2d5566);
  padding:1.25rem 1.5rem;
}
.twfg-hero-form-title{
  font-family:'Jost',sans-serif;
  font-size:1.15rem;
  font-weight:700;
  color:#fff;
  margin:0 0 .2rem;
}
.twfg-hero-form-subtitle{
  font-size:.8rem;
  color:rgba(255,255,255,.7);
  margin:0;
}
.twfg-hero-form-body{
  padding:1.25rem 1.5rem 1.5rem;
}

/* Cognito Forms overrides to match brand */
.twfg-hero-form-body .c-forms-heading { display:none !important; }
.twfg-hero-form-body .c-btn {
  background:#EA6D67 !important;
  border-color:#EA6D67 !important;
  border-radius:6px !important;
  font-family:'Jost',sans-serif !important;
  font-weight:600 !important;
  width:100% !important;
}
.twfg-hero-form-body .c-btn:hover { background:#d4574f !important; }
.twfg-hero-form-body .c-field input,
.twfg-hero-form-body .c-field select,
.twfg-hero-form-body .c-field textarea {
  border-radius:6px !important;
  border-color:#D0DDE2 !important;
  font-family:'Jost',sans-serif !important;
}
.twfg-hero-form-body .c-field input:focus,
.twfg-hero-form-body .c-field select:focus {
  border-color:#3E6B7C !important;
  box-shadow:0 0 0 3px rgba(62,107,124,.12) !important;
}
.twfg-hero-form-body .c-label {
  font-family:'Jost',sans-serif !important;
  font-weight:600 !important;
  font-size:.82rem !important;
  color:#1E2B2E !important;
}

/* Admin placeholder */
.twfg-hero-form-placeholder{
  background:#EAF1F4;
  border:2px dashed #3E6B7C;
  border-radius:14px;
  padding:2.5rem;
  text-align:center;
}
.twfg-hero-form-placeholder-inner p{
  margin:.35rem 0;
  color:#515159;
  font-size:.9rem;
}

/* Mobile — stack on small screens */
@media(max-width:900px){
  .twfg-hero-inner{grid-template-columns:1fr}
  .twfg-hero-form-card,.twfg-hero-form-placeholder{margin-top:1.5rem}
}

/* --- GLOBAL FOOTER --- */
.twfg-footer { background:#0E3840; padding:3.5rem 0 0; color:rgba(255,255,255,.45); }
.twfg-footer-grid { display:grid; grid-template-columns:1.6fr 1fr 1fr 1.2fr; gap:2.5rem; padding-bottom:2.5rem; border-bottom:1px solid rgba(255,255,255,.07); }
.twfg-footer-tagline { font-size:.82rem; color:rgba(255,255,255,.4); line-height:1.65; margin-top:.5rem; max-width:28ch; }
.twfg-footer-col-title { font-size:.7rem; font-weight:700; letter-spacing:.1em; text-transform:uppercase; color:rgba(255,255,255,.35); margin-bottom:.875rem; font-family:'Jost',sans-serif; }
.twfg-footer-links { list-style:none; padding:0; margin:0; display:flex; flex-direction:column; gap:.5rem; }
.twfg-footer-links a { font-size:.84rem; color:rgba(255,255,255,.45); text-decoration:none; transition:color .15s; font-family:'Jost',sans-serif; }
.twfg-footer-links a:hover { color:#EA6D67; }
.twfg-footer-contact-item { font-size:.82rem; color:rgba(255,255,255,.45); text-decoration:none; display:flex; align-items:flex-start; gap:.5rem; font-family:'Jost',sans-serif; transition:color .15s; }
.twfg-footer-contact-item:hover { color:rgba(255,255,255,.7); }
.twfg-footer-bottom { display:flex; align-items:center; justify-content:space-between; padding:1.25rem 0; gap:1rem; flex-wrap:wrap; }

@media(max-width:1024px){
  .twfg-footer-grid { grid-template-columns:1fr 1fr; gap:2rem; }
}
@media(max-width:600px){
  .twfg-footer-grid { grid-template-columns:1fr; }
  .twfg-footer-bottom { flex-direction:column; text-align:center; }
}

/* --- SEAMLESS IFRAME FORM --- */
.twfg-iframe-body {
  padding: 0 !important;
  overflow: hidden !important;
  border-radius: 0 0 14px 14px !important;
}
.twfg-seamless-iframe {
  width: 100% !important;
  border: none !important;
  display: block !important;
  min-height: 600px;
  background: transparent;
  border-radius: 0 0 14px 14px;
}
/* Remove Cognito header inside iframe by hiding it via CSS injection */
.twfg-hero-form-card .twfg-iframe-body iframe {
  margin: 0 !important;
  padding: 0 !important;
}

/* ── EDUCATION CENTER PAGE ── */
.page-education-center .site-main,
body.page-template-page-education-center .site-main {
    padding: 0 !important;
    max-width: 100% !important;
}
.page-education-center .entry-content,
body.page-template-page-education-center .entry-content {
    max-width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
}

/* Force hero visibility on education center */
.twfg-edu-hero {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* ── ALL CUSTOM TEMPLATES — remove narrow wrapper ── */
.page-template-templates-page-education-center-php .single-header,
.page-template-templates-page-contact-php .single-header,
.page-template-templates-page-claims-php .single-header,
.page-template-templates-page-about-php .single-header,
.page-template-templates-page-staff-php .single-header {
    display: none !important;
}
.page-template-templates-page-education-center-php .site-main,
.page-template-templates-page-contact-php .site-main,
.page-template-templates-page-claims-php .site-main,
.page-template-templates-page-about-php .site-main,
.page-template-templates-page-staff-php .site-main,
.page-template-templates-page-personal-insurance-php .site-main {
    padding: 0 !important;
    max-width: 100% !important;
}

/* ============================================
   MOBILE OVERFLOW & RESPONSIVE FIXES
   ============================================ */

/* Global overflow prevention */
html, body {
  overflow-x: hidden !important;
  max-width: 100vw !important;
}

@media (max-width: 768px) {

  /* All inline grids collapse to 1 column */
  [style*="grid-template-columns:1fr 1fr"],
  [style*="grid-template-columns: 1fr 1fr"],
  [style*="grid-template-columns:repeat(2"],
  [style*="grid-template-columns:repeat(3"],
  [style*="grid-template-columns:repeat(4"],
  [style*="grid-template-columns: repeat(2"],
  [style*="grid-template-columns: repeat(3"],
  [style*="grid-template-columns: repeat(4"] {
    grid-template-columns: 1fr !important;
  }

  /* Footer grid */
  .twfg-footer-grid {
    grid-template-columns: 1fr !important;
  }

  /* Hero buttons stack */
  .twfg-hero-inner {
    flex-direction: column !important;
  }

  /* Contact quick cards */
  .contact-grid-4 {
    grid-template-columns: 1fr 1fr !important;
  }

  /* Carrier grid */
  #twfg-carrier-grid {
    grid-template-columns: 1fr 1fr !important;
  }

  /* Stats rows */
  .stats-row,
  [style*="grid-template-columns:repeat(3,1fr)"] {
    grid-template-columns: 1fr !important;
  }

  /* Prevent any element from being wider than viewport */
  .container,
  .wrap,
  .site-main,
  section,
  article,
  .twfg-hero-form-card {
    max-width: 100vw !important;
    overflow-x: hidden !important;
  }

  /* CTA banners stack */
  [style*="justify-content:space-between"][style*="flex-wrap:wrap"],
  [style*="justify-content: space-between"] {
    flex-direction: column !important;
    align-items: flex-start !important;
  }

  /* Images don't overflow */
  img {
    max-width: 100% !important;
    height: auto !important;
  }

  /* Padding adjustments */
  [style*="padding:3rem"],
  [style*="padding: 3rem"] {
    padding: 1.5rem !important;
  }

  [style*="padding:2.5rem"],
  [style*="padding: 2.5rem"] {
    padding: 1.25rem !important;
  }

  [style*="padding:2rem"],
  [style*="padding: 2rem"] {
    padding: 1rem !important;
  }
}

@media (max-width: 480px) {
  /* Contact cards fully single column */
  .contact-grid-4,
  #twfg-carrier-grid {
    grid-template-columns: 1fr !important;
  }

  /* Font size reduction for very small screens */
  h1 { font-size: 1.5rem !important; }
  h2 { font-size: 1.25rem !important; }
}


/* =============================================
   CLARITY 5.5.1 MOBILE SAFETY PATCH
   =============================================
   Keeps wide content from creating side-scroll while preserving embedded form heights. */
html {
  width: 100%;
  overflow-x: clip;
}
body {
  width: 100%;
  max-width: 100%;
}
.twfg-page,
.twfg-hero,
.twfg-section,
.twfg-cta-banner,
.twfg-footer,
.twfg-hero-form-card,
.twfg-hero-form-body,
.twfg-map-frame,
.edu-hero,
.edu-grid,
.site,
.site-content {
  max-width: 100%;
}
.twfg-hero-form-card,
.twfg-hero-form-body {
  min-width: 0;
}
.twfg-seamless-iframe {
  width: 100% !important;
  max-width: 100% !important;
  min-height: 700px;
  height: 750px;
}
@media (max-width: 768px) {
  .twfg-hero-inner,
  .edu-hero-inner,
  .edu-featured-card,
  .twfg-contact-grid,
  .twfg-footer-inner {
    grid-template-columns: 1fr !important;
  }
  .twfg-hero,
  .edu-hero,
  .twfg-section {
    padding-left: max(1rem, env(safe-area-inset-left));
    padding-right: max(1rem, env(safe-area-inset-right));
  }
  .twfg-seamless-iframe {
    min-height: 760px;
  }
  [style*="width:100vw"],
  [style*="width: 100vw"] {
    width: 100% !important;
  }
}
/* v5.5.16 duplicate hard fix in twfg.css for cache/order safety */
@media (max-width: 768px) {
  body.nav-open::before, body.nav-open::after { content:none !important; display:none !important; }
  body .main-navigation { display:none !important; }
  body .main-navigation.is-open { display:block !important; position:fixed !important; top:70px !important; left:0 !important; right:0 !important; bottom:0 !important; width:100vw !important; height:calc(100vh - 70px) !important; max-width:none !important; padding:24px 20px 40px !important; background:#fff !important; opacity:1 !important; visibility:visible !important; transform:none !important; overflow-y:auto !important; z-index:2147483601 !important; border-top:1px solid #D0DDE2 !important; box-shadow:none !important; }
  body .main-navigation.is-open ul { display:flex !important; flex-direction:column !important; align-items:stretch !important; gap:10px !important; width:100% !important; max-width:420px !important; margin:0 auto !important; padding:0 !important; list-style:none !important; }
  body .main-navigation.is-open li { display:block !important; width:100% !important; margin:0 !important; padding:0 !important; text-align:left !important; }
  body .main-navigation.is-open a { display:block !important; width:100% !important; padding:16px 18px !important; border-radius:10px !important; background:#F4F8FA !important; color:#4B4F54 !important; font-size:18px !important; font-weight:700 !important; line-height:1.2 !important; text-align:left !important; }
  body .site-header { z-index:2147483600 !important; background:#fff !important; }
  body .menu-toggle { z-index:2147483647 !important; }
}

/* --- HOMEPAGE HERO FAMILY IMAGE --- */
.twfg-hero-visual{position:relative;border-radius:22px;overflow:hidden;min-height:460px;box-shadow:0 24px 70px rgba(30,43,46,.18);isolation:isolate;background:#EAF1F4}
.twfg-hero-visual::after{content:'';position:absolute;inset:0;background:linear-gradient(180deg,rgba(17,72,80,0) 45%,rgba(17,72,80,.42) 100%);z-index:1;pointer-events:none}
.twfg-hero-visual img{width:100%;height:100%;min-height:460px;object-fit:cover;object-position:center center;display:block;transform:scale(1.01)}
.twfg-hero-visual-card{position:absolute;left:1.25rem;right:1.25rem;bottom:1.25rem;z-index:2;background:rgba(255,255,255,.92);backdrop-filter:blur(10px);border:1px solid rgba(255,255,255,.75);border-radius:14px;padding:1rem 1.1rem;box-shadow:0 12px 30px rgba(30,43,46,.14)}
.twfg-hero-visual-card strong{display:block;font-family:'Jost',sans-serif;font-size:1rem;color:#1E2B2E;margin-bottom:.25rem}
.twfg-hero-visual-card span{display:block;font-size:.86rem;line-height:1.45;color:#515159}
@media(max-width:768px){
  .twfg-hero-inner{grid-template-columns:1fr;gap:2rem}
  .twfg-hero-content{max-width:none}
  .twfg-hero-visual{min-height:330px;order:-1;border-radius:18px}
  .twfg-hero-visual img{min-height:330px;object-position:center top}
  .twfg-hero-visual-card{left:.85rem;right:.85rem;bottom:.85rem;padding:.85rem}
}

/* v5.5.26 — Mobile hero image fix: keep the family photo from being covered by the text card */
@media (max-width: 768px) {
  .twfg-hero-inner {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 1.25rem !important;
  }

  .twfg-hero-visual {
    order: -1;
    min-height: 0 !important;
    overflow: visible !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    background: transparent !important;
  }

  .twfg-hero-visual::after {
    display: none !important;
  }

  .twfg-hero-visual img {
    width: 100% !important;
    height: auto !important;
    min-height: 0 !important;
    aspect-ratio: 16 / 10 !important;
    object-fit: cover !important;
    object-position: 62% center !important;
    border-radius: 18px !important;
    box-shadow: 0 18px 45px rgba(30,43,46,.16) !important;
    transform: none !important;
  }

  .twfg-hero-visual-card {
    position: relative !important;
    left: auto !important;
    right: auto !important;
    bottom: auto !important;
    margin: -1rem .85rem 0 !important;
    z-index: 3 !important;
    padding: .85rem .95rem !important;
    border-radius: 14px !important;
  }
}

@media (max-width: 420px) {
  .twfg-hero-visual img {
    aspect-ratio: 4 / 3 !important;
    object-position: 60% center !important;
  }

  .twfg-hero-visual-card strong {
    font-size: .95rem !important;
  }

  .twfg-hero-visual-card span {
    font-size: .8rem !important;
  }
}

/* v5.5.27 — Stronger mobile hero fix: no text overlay on the family photo */
@media (max-width: 768px) {
  .twfg-hero-visual {
    display: flex !important;
    flex-direction: column !important;
    overflow: visible !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    background: transparent !important;
  }

  .twfg-hero-visual img {
    display: block !important;
    width: 100% !important;
    height: auto !important;
    min-height: 0 !important;
    aspect-ratio: 4 / 3 !important;
    object-fit: cover !important;
    object-position: 64% center !important;
    border-radius: 18px !important;
    box-shadow: 0 18px 45px rgba(30,43,46,.16) !important;
    transform: none !important;
  }

  .twfg-hero-visual-card {
    position: static !important;
    width: auto !important;
    left: auto !important;
    right: auto !important;
    bottom: auto !important;
    margin: 12px 0 0 0 !important;
    z-index: auto !important;
    background: #ffffff !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    box-shadow: 0 10px 24px rgba(30,43,46,.10) !important;
  }
}

@media (max-width: 420px) {
  .twfg-hero-visual img {
    aspect-ratio: 1 / 1 !important;
    object-position: 66% center !important;
  }
}


/* v5.5.28 — FINAL mobile hero fix: remove the floating card from the image on phones */
@media screen and (max-width: 768px) {
  html body .twfg-hero .twfg-hero-visual {
    display: block !important;
    position: relative !important;
    overflow: visible !important;
    min-height: 0 !important;
    height: auto !important;
    border-radius: 18px !important;
    box-shadow: none !important;
    background: transparent !important;
  }

  html body .twfg-hero .twfg-hero-visual::after {
    content: none !important;
    display: none !important;
  }

  html body .twfg-hero .twfg-hero-visual img {
    display: block !important;
    width: 100% !important;
    height: auto !important;
    min-height: 0 !important;
    aspect-ratio: 4 / 3 !important;
    object-fit: cover !important;
    object-position: 66% center !important;
    border-radius: 18px !important;
    transform: none !important;
  }

  html body .twfg-hero .twfg-hero-visual .twfg-hero-visual-card {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    position: absolute !important;
    pointer-events: none !important;
  }
}
