/*
Theme Name: Tonga Energy Commission
Theme URI: https://tongaec.to
Author: Tonga Energy Commission
Author URI: https://tongaec.to
Description: Official WordPress theme for the Tonga Energy Commission (TEC), the statutory regulator of Tonga's energy sector established under the Energy Act 2021. Includes a home page, About TEC page with CEO/team profiles, news layout, and contact page.
Version: 1.0.0
Requires at least: 6.0
Requires PHP: 7.4
Tested up to: 6.6
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: tongaec
Tags: government, one-column, custom-menu, custom-logo, featured-images, translation-ready, responsive-layout

This theme, like WordPress, is licensed under the GPL.
Use it to make something cool, have fun, and share what you've learned.
*/

/* =========================================================
   0. VARIABLES & RESET
   ========================================================= */
:root{
  --tec-red: #C8102E;
  --tec-red-dark: #8E0A20;
  --tec-navy: #0A2342;
  --tec-navy-light: #133b6b;
  --tec-gold: #F2A900;
  --tec-white: #FFFFFF;
  --tec-gray-light: #F5F5F3;
  --tec-gray: #E4E4E1;
  --tec-text: #232323;
  --tec-text-light: #5b5b5b;
  --tec-radius: 6px;
  --tec-max-width: 1180px;
  --tec-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

*, *::before, *::after{ box-sizing: border-box; }

html{ scroll-behavior: smooth; }

body{
  margin:0;
  font-family: var(--tec-font);
  color: var(--tec-text);
  background: var(--tec-white);
  line-height: 1.65;
  font-size: 17px;
}

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

a{ color: var(--tec-red); text-decoration: none; }
a:hover{ text-decoration: underline; }

h1,h2,h3,h4{
  font-family: var(--tec-font);
  color: var(--tec-navy);
  line-height: 1.25;
  margin: 0 0 .6em;
  font-weight: 700;
}
h1{ font-size: 2.4rem; }
h2{ font-size: 1.9rem; }
h3{ font-size: 1.35rem; }
p{ margin: 0 0 1.1em; }

ul, ol{ padding-left: 1.3em; }

.container{
  max-width: var(--tec-max-width);
  margin: 0 auto;
  padding: 0 24px;
}

.btn{
  display: inline-block;
  padding: 12px 26px;
  border-radius: var(--tec-radius);
  background: var(--tec-red);
  color: var(--tec-white);
  font-weight: 600;
  border: 2px solid var(--tec-red);
  transition: background .15s ease, color .15s ease;
}
.btn:hover{
  background: var(--tec-red-dark);
  border-color: var(--tec-red-dark);
  text-decoration: none;
  color:#fff;
}
.btn-outline{
  background: transparent;
  color: var(--tec-white);
  border: 2px solid var(--tec-white);
}
.btn-outline:hover{
  background: var(--tec-white);
  color: var(--tec-navy);
}
.btn-gold{
  background: var(--tec-gold);
  border-color: var(--tec-gold);
  color: var(--tec-navy);
}
.btn-gold:hover{
  background:#d99400;
  border-color:#d99400;
  color: var(--tec-navy);
}

.section{ padding: 64px 0; }
.section-alt{ background: var(--tec-gray-light); }
.section-title{
  text-align:center;
  max-width: 700px;
  margin: 0 auto 44px;
}
.section-title .eyebrow{
  display:inline-block;
  color: var(--tec-red);
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  font-size: .8rem;
  margin-bottom: 10px;
}

/* =========================================================
   1. TOP BAR & HEADER
   ========================================================= */
.tec-topbar{
  background: var(--tec-navy);
  color: #cfd8e6;
  font-size: .82rem;
}
.tec-topbar .container{
  display:flex;
  justify-content: space-between;
  align-items:center;
  flex-wrap: wrap;
  padding-top:6px;
  padding-bottom:6px;
  gap: 8px;
}
.tec-topbar a{ color:#cfd8e6; }
.tec-topbar a:hover{ color:#fff; }
.tec-topbar-contact{ display:flex; gap:20px; flex-wrap:wrap; }

.tec-header{
  background: var(--tec-white);
  border-bottom: 4px solid var(--tec-red);
  position: sticky;
  top:0;
  z-index: 500;
}
.tec-header .container{
  display:flex;
  align-items:center;
  justify-content: space-between;
  padding-top: 14px;
  padding-bottom: 14px;
}

.tec-brand{
  display:flex;
  align-items:center;
  gap:12px;
  color: var(--tec-navy);
}
.tec-brand:hover{ text-decoration:none; }
.tec-brand img{ max-height: 56px; width:auto; }
.tec-brand-mark{
  width:52px; height:52px;
  border-radius:50%;
  background: linear-gradient(135deg, var(--tec-red), var(--tec-navy));
  color:#fff;
  display:flex;
  align-items:center;
  justify-content:center;
  font-weight:800;
  font-size:1.05rem;
  letter-spacing: -0.02em;
  flex: none;
}
.tec-brand-text .tec-brand-name{
  display:block;
  font-weight:800;
  font-size:1.08rem;
  color: var(--tec-navy);
  line-height:1.2;
}
.tec-brand-text .tec-brand-sub{
  display:block;
  font-size:.72rem;
  color: var(--tec-text-light);
  text-transform: uppercase;
  letter-spacing:.06em;
}

/* Nav */
.tec-nav-toggle{
  display:none;
  background:none;
  border:2px solid var(--tec-navy);
  border-radius:4px;
  padding:8px 10px;
  cursor:pointer;
}
.tec-nav-toggle span{
  display:block;
  width:22px;
  height:2px;
  background: var(--tec-navy);
  margin:4px 0;
}

.tec-primary-nav ul{
  list-style:none;
  display:flex;
  gap:6px;
  margin:0;
  padding:0;
}
.tec-primary-nav li{ position:relative; }
.tec-primary-nav a{
  display:block;
  padding:10px 14px;
  color: var(--tec-navy);
  font-weight:600;
  font-size:.96rem;
  border-radius: var(--tec-radius);
}
.tec-primary-nav a:hover,
.tec-primary-nav .current-menu-item > a{
  background: var(--tec-gray-light);
  color: var(--tec-red);
  text-decoration:none;
}

.tec-primary-nav .sub-menu{
  list-style:none;
  position:absolute;
  top:100%;
  left:0;
  background:#fff;
  min-width:220px;
  box-shadow: 0 10px 30px rgba(10,35,66,.15);
  border-radius: var(--tec-radius);
  padding:8px;
  margin:0;
  opacity:0;
  visibility:hidden;
  transform: translateY(6px);
  transition: all .15s ease;
}
.tec-primary-nav li:hover > .sub-menu{
  opacity:1;
  visibility:visible;
  transform: translateY(0);
}
.tec-primary-nav .sub-menu a{ padding:8px 12px; }

@media (max-width: 880px){
  .tec-nav-toggle{ display:block; }
  .tec-primary-nav{
    display:none;
    width:100%;
    order: 3;
  }
  .tec-primary-nav.is-open{ display:block; }
  .tec-header .container{ flex-wrap:wrap; }
  .tec-primary-nav ul{ flex-direction:column; gap:0; padding: 10px 0; }
  .tec-primary-nav .sub-menu{
    position:static;
    box-shadow:none;
    opacity:1;
    visibility:visible;
    transform:none;
    display:none;
    padding-left: 14px;
  }
  .tec-primary-nav li:hover .sub-menu{ display:block; }
}

/* =========================================================
   2. HERO
   ========================================================= */
.tec-hero{
  background:
    linear-gradient(120deg, rgba(10,35,66,.92), rgba(200,16,46,.82)),
    var(--tec-navy);
  color:#fff;
  padding: 90px 0;
}
.tec-hero .container{
  display:grid;
  grid-template-columns: 1.2fr .8fr;
  gap: 40px;
  align-items:center;
}
.tec-hero h1{ color:#fff; font-size: 2.7rem; }
.tec-hero p.lead{
  font-size: 1.15rem;
  color: #e7ecf5;
  max-width: 620px;
}
.tec-hero .tec-hero-actions{ display:flex; gap:14px; margin-top: 24px; flex-wrap:wrap; }
.tec-hero-badge{
  display:inline-flex;
  align-items:center;
  gap:8px;
  background: rgba(255,255,255,.12);
  border: 1px solid rgba(255,255,255,.3);
  padding: 6px 14px;
  border-radius: 999px;
  font-size:.8rem;
  font-weight:600;
  margin-bottom: 18px;
}
.tec-hero-panel{
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.25);
  border-radius: 14px;
  padding: 28px;
  backdrop-filter: blur(2px);
}
.tec-hero-panel h3{ color:#fff; margin-bottom: 14px; font-size:1.1rem; }
.tec-hero-stat{
  display:flex;
  justify-content:space-between;
  padding: 10px 0;
  border-bottom: 1px solid rgba(255,255,255,.18);
  font-size:.95rem;
}
.tec-hero-stat:last-child{ border-bottom:none; }
.tec-hero-stat strong{ color: var(--tec-gold); font-size:1.05rem; }

@media (max-width: 880px){
  .tec-hero .container{ grid-template-columns: 1fr; }
  .tec-hero{ padding: 56px 0; }
  .tec-hero h1{ font-size:2.1rem; }
}

/* =========================================================
   3. CARDS / GRIDS
   ========================================================= */
.tec-grid{
  display:grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 26px;
}
@media (max-width: 880px){ .tec-grid{ grid-template-columns: 1fr; } }

.tec-card{
  background:#fff;
  border: 1px solid var(--tec-gray);
  border-radius: var(--tec-radius);
  padding: 28px;
  transition: box-shadow .15s ease, transform .15s ease;
}
.tec-card:hover{
  box-shadow: 0 14px 30px rgba(10,35,66,.1);
  transform: translateY(-3px);
}
.tec-card .tec-icon{
  width:48px; height:48px;
  border-radius:10px;
  background: var(--tec-gray-light);
  display:flex; align-items:center; justify-content:center;
  color: var(--tec-red);
  font-size:1.4rem;
  margin-bottom: 16px;
  font-weight:800;
}
.tec-card h3{ margin-bottom:.4em; }
.tec-card p{ color: var(--tec-text-light); margin-bottom:0; }

/* Mandate / functions list */
.tec-func-list{
  list-style:none;
  margin:0;
  padding:0;
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
@media (max-width: 700px){ .tec-func-list{ grid-template-columns: 1fr; } }
.tec-func-list li{
  display:flex;
  gap:12px;
  align-items:flex-start;
  background: var(--tec-white);
  border-left: 4px solid var(--tec-red);
  padding: 14px 16px;
  border-radius: 4px;
  box-shadow: 0 2px 8px rgba(10,35,66,.06);
}
.tec-func-list li::before{
  content: "\2713";
  color: var(--tec-red);
  font-weight:800;
  flex:none;
}

/* Act info box */
.tec-act-box{
  background: var(--tec-navy);
  color:#e7ecf5;
  border-radius: 12px;
  padding: 30px;
  display:grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin: 40px 0;
}
.tec-act-box .tec-act-item strong{
  display:block;
  color: var(--tec-gold);
  font-size:1.5rem;
  margin-bottom:4px;
}
.tec-act-box .tec-act-item span{ font-size:.9rem; color:#c9d3e3; }
@media (max-width: 700px){ .tec-act-box{ grid-template-columns: 1fr; } }

/* =========================================================
   4. TEAM
   ========================================================= */
.tec-ceo{
  display:grid;
  grid-template-columns: 260px 1fr;
  gap: 40px;
  align-items:start;
  background: var(--tec-gray-light);
  border-radius: 14px;
  padding: 36px;
  margin-bottom: 50px;
}
@media (max-width: 700px){ .tec-ceo{ grid-template-columns: 1fr; } }
.tec-ceo-photo{
  width:100%;
  aspect-ratio: 1 / 1;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--tec-navy), var(--tec-red));
  color:#fff;
  display:flex;
  align-items:center;
  justify-content:center;
  font-size:3.4rem;
  font-weight:800;
}
.tec-ceo-body .tec-role{
  display:inline-block;
  background: var(--tec-red);
  color:#fff;
  font-size:.75rem;
  font-weight:700;
  letter-spacing:.05em;
  text-transform:uppercase;
  padding: 4px 12px;
  border-radius: 999px;
  margin-bottom: 12px;
}
.tec-ceo-body h2{ margin-bottom:.2em; }
.tec-ceo-body .tec-ceo-title{ color: var(--tec-text-light); font-weight:600; margin-bottom:16px; }

.tec-team-grid{
  display:grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 22px;
}
@media (max-width: 980px){ .tec-team-grid{ grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px){ .tec-team-grid{ grid-template-columns: 1fr; } }
.tec-team-card{
  text-align:center;
  border: 1px solid var(--tec-gray);
  border-radius: var(--tec-radius);
  padding: 24px 16px;
  background:#fff;
}
.tec-team-avatar{
  width:84px; height:84px;
  margin: 0 auto 14px;
  border-radius:50%;
  background: var(--tec-gray-light);
  color: var(--tec-navy);
  display:flex; align-items:center; justify-content:center;
  font-weight:800;
  font-size:1.3rem;
  border: 2px dashed var(--tec-gray);
}
.tec-team-card h4{ margin:0 0 4px; font-size:1.02rem; color:var(--tec-navy); }
.tec-team-card span{ font-size:.85rem; color: var(--tec-text-light); }
.tec-team-note{
  text-align:center;
  color: var(--tec-text-light);
  font-size:.88rem;
  margin-top: 18px;
  font-style: italic;
}

/* =========================================================
   5. NEWS / BLOG
   ========================================================= */
.tec-post-grid{
  display:grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 26px;
}
@media (max-width: 880px){ .tec-post-grid{ grid-template-columns: 1fr; } }
.tec-post-card{
  border: 1px solid var(--tec-gray);
  border-radius: var(--tec-radius);
  overflow:hidden;
  background:#fff;
  display:flex;
  flex-direction:column;
}
.tec-post-card .tec-post-thumb{
  aspect-ratio: 16/10;
  background: var(--tec-gray-light);
  overflow:hidden;
}
.tec-post-card .tec-post-thumb img{ width:100%; height:100%; object-fit:cover; }
.tec-post-card .tec-post-body{ padding: 20px; flex:1; display:flex; flex-direction:column; }
.tec-post-card .tec-post-date{
  color: var(--tec-red);
  text-transform: uppercase;
  font-size:.75rem;
  font-weight:700;
  letter-spacing:.05em;
  margin-bottom: 8px;
}
.tec-post-card h3{ font-size:1.1rem; margin-bottom: 10px; }
.tec-post-card p{ color: var(--tec-text-light); font-size:.95rem; flex:1; }
.tec-post-card .btn{ align-self:flex-start; padding: 8px 18px; font-size:.85rem; margin-top: 10px; }

.tec-page-header{
  background: var(--tec-navy);
  color:#fff;
  padding: 50px 0;
  text-align:center;
}
.tec-page-header h1{ color:#fff; margin-bottom:.2em; }
.tec-breadcrumb{ color:#b9c4d8; font-size:.9rem; }
.tec-breadcrumb a{ color:#dbe3f1; }

.tec-pagination{ display:flex; gap:8px; justify-content:center; margin-top: 40px; flex-wrap:wrap; }
.tec-pagination a, .tec-pagination span{
  padding: 8px 14px;
  border: 1px solid var(--tec-gray);
  border-radius: 4px;
  color: var(--tec-navy);
}
.tec-pagination .current{ background: var(--tec-red); color:#fff; border-color: var(--tec-red); }

.tec-single-content{
  max-width: 780px;
  margin: 0 auto;
}
.tec-single-content img{ border-radius: var(--tec-radius); margin: 20px 0; }
.tec-single-meta{
  color: var(--tec-text-light);
  font-size:.9rem;
  margin-bottom: 30px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--tec-gray);
}

/* =========================================================
   5b. FAQ ACCORDION
   ========================================================= */
.tec-faq{
  max-width: 820px;
  margin: 0 auto;
  display:flex;
  flex-direction:column;
  gap: 12px;
}
.tec-faq-item{
  border: 1px solid var(--tec-gray);
  border-radius: var(--tec-radius);
  background:#fff;
  padding: 4px 22px;
}
.tec-faq-item summary{
  cursor:pointer;
  list-style:none;
  padding: 16px 0;
  font-weight:700;
  color: var(--tec-navy);
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 12px;
}
.tec-faq-item summary::-webkit-details-marker{ display:none; }
.tec-faq-item summary::after{
  content: "+";
  color: var(--tec-red);
  font-size: 1.3rem;
  font-weight:800;
  flex:none;
  transition: transform .15s ease;
}
.tec-faq-item[open] summary::after{ content: "\2212"; }
.tec-faq-item p{
  color: var(--tec-text-light);
  padding-bottom: 16px;
  margin:0;
}

/* =========================================================
   6. CONTACT
   ========================================================= */
.tec-contact-grid{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap: 46px;
  align-items:start;
}
@media (max-width: 880px){ .tec-contact-grid{ grid-template-columns: 1fr; } }
.tec-contact-info-item{
  display:flex;
  gap:16px;
  margin-bottom: 24px;
}
.tec-contact-info-item .tec-icon{
  width:44px; height:44px;
  border-radius:8px;
  background: var(--tec-gray-light);
  color: var(--tec-red);
  display:flex; align-items:center; justify-content:center;
  flex:none;
  font-weight:800;
}
.tec-contact-info-item h4{ margin:0 0 4px; font-size:1rem; }
.tec-contact-info-item p{ margin:0; color: var(--tec-text-light); }

.tec-form label{
  display:block;
  font-weight:600;
  margin-bottom: 6px;
  font-size:.92rem;
  color: var(--tec-navy);
}
.tec-form input,
.tec-form textarea{
  width:100%;
  padding: 12px 14px;
  border: 1px solid var(--tec-gray);
  border-radius: var(--tec-radius);
  font-family: inherit;
  font-size: .96rem;
  margin-bottom: 18px;
}
.tec-form input:focus,
.tec-form textarea:focus{
  outline: 2px solid var(--tec-navy);
  outline-offset: 1px;
}
.tec-form-notice{
  padding: 14px 16px;
  border-radius: var(--tec-radius);
  margin-bottom: 20px;
  font-size:.93rem;
}
.tec-form-notice.success{ background:#e7f6ec; color:#1f6e3a; border:1px solid #bfe6cc; }
.tec-form-notice.error{ background:#fdecec; color:#a3242a; border:1px solid #f5c2c4; }

.tec-map{
  border-radius: var(--tec-radius);
  overflow:hidden;
  border: 1px solid var(--tec-gray);
  margin-top: 30px;
}
.tec-map iframe{ width:100%; height:280px; border:0; display:block; }

/* =========================================================
   7. WIDGETS / SIDEBAR
   ========================================================= */
.widget{ margin-bottom: 34px; }
.widget h2, .widget .widget-title{
  font-size:1.05rem;
  border-bottom: 2px solid var(--tec-red);
  padding-bottom: 8px;
  margin-bottom: 14px;
}
.widget ul{ list-style:none; margin:0; padding:0; }
.widget ul li{ padding: 6px 0; border-bottom: 1px dashed var(--tec-gray); }

/* =========================================================
   8. FOOTER
   ========================================================= */
.tec-footer{
  background: var(--tec-navy);
  color: #c9d3e3;
  padding-top: 56px;
}
.tec-footer a{ color:#dbe3f1; }
.tec-footer a:hover{ color: var(--tec-gold); }
.tec-footer-grid{
  display:grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 34px;
  padding-bottom: 40px;
  border-bottom: 1px solid rgba(255,255,255,.12);
}
@media (max-width: 880px){ .tec-footer-grid{ grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px){ .tec-footer-grid{ grid-template-columns: 1fr; } }
.tec-footer h4{
  color:#fff;
  font-size:.95rem;
  text-transform: uppercase;
  letter-spacing:.05em;
  margin-bottom: 16px;
}
.tec-footer ul{ list-style:none; margin:0; padding:0; }
.tec-footer ul li{ margin-bottom: 10px; font-size:.92rem; }
.tec-footer-brand .tec-brand-mark{ margin-bottom: 14px; }
.tec-footer-bottom{
  padding: 20px 0;
  display:flex;
  justify-content:space-between;
  flex-wrap:wrap;
  gap:10px;
  font-size:.82rem;
  color:#93a1bb;
}

/* =========================================================
   9. UTILITIES
   ========================================================= */
.screen-reader-text{
  position:absolute !important;
  width:1px; height:1px;
  overflow:hidden;
  clip: rect(1px,1px,1px,1px);
}
.alignwide{ margin-left:0; margin-right:0; }
.wp-block-image img{ border-radius: var(--tec-radius); }
